Skip to content

Commit

Permalink
Merge pull request warewulf#1074 from riederd/main
Browse files Browse the repository at this point in the history
Make mounting into sub-directoies work
  • Loading branch information
mslacken authored Feb 19, 2024
2 parents ea8e468 + f17ba7c commit 88446f9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

### Fixed
- Make mounting of local patitions into sub-directories work
- 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.
- Enable spec file to work with Fedora
Expand Down
11 changes: 9 additions & 2 deletions overlays/wwinit/rootfs/etc/systemd/system/ww4-disks.target.ww
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ After=ignition-ww4-disks.service
Requisite=ignition-ww4-disks.service
# Get the mounts
{{- 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"}}
{{- $prefix = tr $fsdevice "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-"}}{{ $suffix = "swap"}}
{{- 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 }}
Wants={{ print $prefix "." $suffix }}
{{- end }}
5 changes: 4 additions & 1 deletion overlays/wwinit/rootfs/etc/systemd/system/ww4-mounts.ww
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
{{- $time := .BuildTime }}
{{- $source := .BuildSource }}
{{- 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 eq $fs.Format "swap"}}{{ $prefix = tr $fsdevice "/dev/disk/by-partlabel/" "dev-disk-by\\x2dpartlabel-"}}{{ $suffix = "swap"}}{{ end }}
{{- $filename := print $prefix "." $suffix }}
Expand Down

0 comments on commit 88446f9

Please sign in to comment.