mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
95649854ba
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. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Rafael Kitover <rkitover@gmail.com> Closes #15149
25 lines
1.4 KiB
SYSTEMD
25 lines
1.4 KiB
SYSTEMD
[Unit]
|
|
Description=Set BOOTFS and BOOTFSFLAGS environment variables for dracut
|
|
DefaultDependencies=no
|
|
After=zfs-import-cache.service
|
|
After=zfs-import-scan.service
|
|
Before=zfs-import.target
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
ExecStart=/bin/sh -c ' \
|
|
. /lib/dracut-zfs-lib.sh; \
|
|
decode_root_args || exit 0; \
|
|
[ "$root" = "zfs:AUTO" ] && root="$(@sbindir@/zpool list -H -o bootfs | grep -m1 -vFx -)"; \
|
|
rootflags="$(getarg rootflags=)"; \
|
|
[ "$(@sbindir@/zfs get -H -o value mountpoint "$root")" = legacy ] || \
|
|
case ",$rootflags," in \
|
|
*,zfsutil,*) ;; \
|
|
,,) rootflags=zfsutil ;; \
|
|
*) rootflags="zfsutil,$rootflags" ;; \
|
|
esac; \
|
|
exec systemctl set-environment BOOTFS="$root" BOOTFSFLAGS="$rootflags"'
|
|
|
|
[Install]
|
|
WantedBy=zfs-import.target
|