Fixed handling of comma-separated mount options in fstab and ignition overlays

- Fixed: #1950

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Jonathon Anderson
2025-08-01 01:29:59 -06:00
parent 3174b633c7
commit ae9d349e33
6 changed files with 12 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fixed a bug when cloning an overlay to site when parent is missing - Fixed a bug when cloning an overlay to site when parent is missing
- Fixed `wwctl upgrade nodes` to properly handle kernel argument lists. #1938 - Fixed `wwctl upgrade nodes` to properly handle kernel argument lists. #1938
- Fixed a panic during `wwctl overlay edit` due to missing `reexec.Init()`. #1879 - Fixed a panic during `wwctl overlay edit` due to missing `reexec.Init()`. #1879
- Fixed handling of comma-separated mount options in `fstab` and `ignition` overlays. #1950
## v4.6.2, 2025-07-09 ## v4.6.2, 2025-07-09

View File

@@ -61,7 +61,8 @@ sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0 proc /proc proc defaults 0 0
# mounts for local file systems created with ignition in nodes.conf # mounts for local file systems created with ignition in nodes.conf
# all with noauto as mounts happens with systemd units # all with noauto as mounts happens with systemd units
/dev/disk/by-partlabel/scratch /scratch btrfs noauto,defaults 0 0 /dev/disk/by-partlabel/scratch /scratch btrfs noauto,nondefault 0 0
/dev/disk/by-partlabel/scratch2 /scratch2 btrfs noauto,defaults 0 0
/dev/disk/by-partlabel/swap swap swap noauto,defaults 0 0 /dev/disk/by-partlabel/swap swap swap noauto,defaults 0 0
warewulf:/home /home nfs defaults 0 0 warewulf:/home /home nfs defaults 0 0
` `

View File

@@ -18,6 +18,11 @@ nodes:
format: btrfs format: btrfs
path: /scratch path: /scratch
wipe_filesystem: true wipe_filesystem: true
mount_options: "nondefault"
/dev/disk/by-partlabel/scratch2:
format: btrfs
path: /scratch2
wipe_filesystem: true
/dev/disk/by-partlabel/swap: /dev/disk/by-partlabel/swap:
format: swap format: swap
path: swap path: swap

View File

@@ -9,7 +9,7 @@ proc /proc proc defaults 0 0
# all with noauto as mounts happens with systemd units # all with noauto as mounts happens with systemd units
{{- range $fsdevice,$fs := .FileSystems }} {{- range $fsdevice,$fs := .FileSystems }}
{{ $fsdevice }} {{ $fs.Path }} {{ $fs.Format }} {{ $fsdevice }} {{ $fs.Path }} {{ $fs.Format }}
{{- if $fs.MountOptions }} noauto{{range $index,$opt := $fs.MountOptions }},{{ $opt }}{{ end }} 0 0 {{- if $fs.MountOptions }} noauto,{{ $fs.MountOptions }} 0 0
{{- else }} noauto,defaults 0 0 {{- else }} noauto,defaults 0 0
{{- end }}{{ end }}{{ end }} {{- end }}{{ end }}{{ end }}
{{- with $fstab := index .Resources "fstab" }} {{- with $fstab := index .Resources "fstab" }}

View File

@@ -111,6 +111,7 @@ nodes:
format: btrfs format: btrfs
path: /scratch path: /scratch
wipe_filesystem: true wipe_filesystem: true
mount_options: "nondefault"
/dev/disk/by-partlabel/swap: /dev/disk/by-partlabel/swap:
format: swap format: swap
path: swap`, path: swap`,
@@ -129,6 +130,7 @@ After=ignition-ww4-disks.service
Where=/scratch Where=/scratch
What=/dev/disk/by-partlabel/scratch What=/dev/disk/by-partlabel/scratch
Type=btrfs Type=btrfs
Options=nondefault
[Install] [Install]
RequiredBy=local-fs.target RequiredBy=local-fs.target
backupFile: true backupFile: true

View File

@@ -27,7 +27,7 @@ Where={{ $fs.Path }}
What={{ $fsdevice }} What={{ $fsdevice }}
Type={{ $fs.Format }} Type={{ $fs.Format }}
{{- if $fs.MountOptions }} {{- if $fs.MountOptions }}
Options={{ $fs.MountOptions | join "." }} Options={{ $fs.MountOptions }}
{{- end }} {{- end }}
[Install] [Install]
RequiredBy=local-fs.target RequiredBy=local-fs.target