From 9b9d1adc38d14f0e01564b980662006589227f0a Mon Sep 17 00:00:00 2001 From: Antonio Russo Date: Tue, 31 Jul 2018 13:15:41 -0400 Subject: [PATCH] Use zfs-import.target in contrib/dracut The new zfs-import.target should be used in place of the zfs-import-*.service units. Reviewed by: Brian Behlendorf Reviewed-by: Manuel Amador (Rudd-O) Signed-off-by: Antonio Russo Closes #6964 --- contrib/dracut/90zfs/module-setup.sh.in | 12 +++++++++--- contrib/dracut/90zfs/zfs-generator.sh.in | 3 +-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in index 19b763a3c5..38dd84d5a7 100755 --- a/contrib/dracut/90zfs/module-setup.sh.in +++ b/contrib/dracut/90zfs/module-setup.sh.in @@ -89,15 +89,21 @@ install() { printf "\x${DD}\x${CC}\x${BB}\x${AA}" > "${initdir}/etc/hostid" if dracut_module_included "systemd"; then - mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants" + mkdir -p "${initdir}/$systemdsystemunitdir/zfs-import.target.wants" for _item in scan cache ; do dracut_install @systemdunitdir@/zfs-import-$_item.service - if ! [ -L "${initdir}/$systemdsystemunitdir/initrd.target.wants"/zfs-import-$_item.service ]; then - ln -s ../zfs-import-$_item.service "${initdir}/$systemdsystemunitdir/initrd.target.wants"/zfs-import-$_item.service + if ! [ -L "${initdir}/$systemdsystemunitdir/zfs-import.target.wants"/zfs-import-$_item.service ]; then + ln -s ../zfs-import-$_item.service "${initdir}/$systemdsystemunitdir/zfs-import.target.wants"/zfs-import-$_item.service type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-import-$_item.service fi done dracut_install systemd-ask-password dracut_install systemd-tty-ask-password-agent + mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants" + dracut_install @systemdunitdir@/zfs-import.target + if ! [ -L "${initdir}/$systemdsystemunitdir/initrd.target.wants"/zfs-import.target ]; then + ln -s ../zfs-import.target "${initdir}/$systemdsystemunitdir/initrd.target.wants"/zfs-import.target + type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-import.target + fi fi } diff --git a/contrib/dracut/90zfs/zfs-generator.sh.in b/contrib/dracut/90zfs/zfs-generator.sh.in index 4446ed52ea..0b8a8aaca7 100755 --- a/contrib/dracut/90zfs/zfs-generator.sh.in +++ b/contrib/dracut/90zfs/zfs-generator.sh.in @@ -41,8 +41,7 @@ echo "zfs-generator: writing extension for sysroot.mount to $GENERATOR_DIR"/sysr { echo "[Unit]" echo "Before=initrd-root-fs.target" - echo "After=zfs-import-scan.service" - echo "After=zfs-import-cache.service" + echo "After=zfs-import.target" echo "[Mount]" if [ "${root}" = "zfs:AUTO" ] ; then echo "PassEnvironment=BOOTFS"