Make mounting into sub-directoies work fixes #1073

This commit is contained in:
Dietmar Rieder
2024-02-07 17:02:02 +01:00
committed by Christian Goll
parent ea8e4680bc
commit f17ba7c62b
3 changed files with 14 additions and 3 deletions

View File

@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
has a container these binaries are extracted from the container image. has a container these binaries are extracted from the container image.
### Fixed ### Fixed
- Make mounting of local patitions into sub-directories work
- Make Variables.mk consistent with spec file w.r.t. WWPROVISIONDIR, e.g. - Make Variables.mk consistent with spec file w.r.t. WWPROVISIONDIR, e.g.
instead of basing in `/srv`, handle it the same as chroots and overlays. instead of basing in `/srv`, handle it the same as chroots and overlays.
- Enable spec file to work with Fedora - Enable spec file to work with Fedora

View File

@@ -10,11 +10,18 @@ After=ignition-ww4-disks.service
Requisite=ignition-ww4-disks.service Requisite=ignition-ww4-disks.service
# Get the mounts # Get the mounts
{{- range $fsdevice,$fs := .FileSystems }} {{- range $fsdevice,$fs := .FileSystems }}
{{- $prefix := $fsdevice }}{{ $suffix := "mount" }} {{- $prefix := $fsdevice }}
{{- $prefix = tr $fsdevice "-" "\\x2d" }}
{{- $prefix = tr $prefix "/" "-" }}
{{- $prefix = slice $prefix 1 }}{{ $suffix := "mount" }}
{{- if eq $fs.Format "swap"}} {{- if eq $fs.Format "swap"}}
{{- $prefix = tr $fsdevice "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-"}}{{ $suffix = "swap"}} {{- $prefix = tr $fsdevice "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-"}}{{ $suffix = "swap"}}
{{- else }} {{- else }}
{{- if $fs.Path }}{{ $prefix = tr $fs.Path "/" "" }}{{ end }} {{- if ne $fs.Path "" }}
{{- $prefix = tr $fs.Path "-" "\\x2d" }}
{{- $prefix = tr $prefix "/" "-" }}
{{- $prefix = slice $prefix 1 }}
{{- end }}
{{- end }} {{- end }}
Wants={{ print $prefix "." $suffix }} Wants={{ print $prefix "." $suffix }}
{{- end }} {{- end }}

View File

@@ -2,7 +2,10 @@
{{- $time := .BuildTime }} {{- $time := .BuildTime }}
{{- $source := .BuildSource }} {{- $source := .BuildSource }}
{{- range $fsdevice,$fs := .FileSystems }} {{- range $fsdevice,$fs := .FileSystems }}
{{- $prefix := tr $fs.Path "/" "" }}{{ $suffix:="mount"}} {{- $prefix := tr $fs.Path "-" "\\x2d" }}
{{- $prefix = tr $prefix "/" "-" }}
{{- $prefix = slice $prefix 1 }}
{{ $suffix := "mount"}}
{{- if $fs.Label }}{{ $prefix = $fs.Label }}{{ end }} {{- if $fs.Label }}{{ $prefix = $fs.Label }}{{ end }}
{{- if eq $fs.Format "swap"}}{{ $prefix = tr $fsdevice "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-"}}{{ $suffix = "swap"}}{{ end }} {{- if eq $fs.Format "swap"}}{{ $prefix = tr $fsdevice "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-"}}{{ $suffix = "swap"}}{{ end }}
{{- $filename := print $prefix "." $suffix }} {{- $filename := print $prefix "." $suffix }}