Skip to content

Commit 3eaacdf

Browse files
rkitovernabijaczleweli
authored andcommitted
dracut: support mountpoint=legacy for root dataset
Support mountpoint=legacy for the root dataset in the dracut zfs support scripts. mountpoint=/ or mountpoint=/sysroot also works. Change zfs-env-bootfs.service to add zfsutil to BOOTFSFLAGS only for root datasets with mountpoint != legacy. Signed-off-by: Rafael Kitover <[email protected]>
1 parent e47e9bb commit 3eaacdf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

contrib/dracut/90zfs/zfs-env-bootfs.service.in

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ ExecStart=/bin/sh -c '
1212
decode_root_args || exit 0; \
1313
[ "$root" = "zfs:AUTO" ] && root="$(@sbindir@/zpool list -H -o bootfs | grep -m1 -vFx -)"; \
1414
rootflags="$(getarg rootflags=)"; \
15-
case ",$rootflags," in \
16-
*,zfsutil,*) ;; \
17-
,,) rootflags=zfsutil ;; \
18-
*) rootflags="zfsutil,$rootflags" ;; \
19-
esac; \
15+
[ "$(@sbindir@/zfs get -H -o value mountpoint "$root")" = legacy ] || \
16+
case ",$rootflags," in \
17+
*,zfsutil,*) ;; \
18+
,,) rootflags=zfsutil ;; \
19+
*) rootflags="zfsutil,$rootflags" ;; \
20+
esac; \
2021
exec systemctl set-environment BOOTFS="$root" BOOTFSFLAGS="$rootflags"'
2122

2223
[Install]

0 commit comments

Comments
 (0)