From ffd13e2cdaa01ac3d48cb7acdf9ec575ee670ee5 Mon Sep 17 00:00:00 2001 From: Antonio Russo Date: Thu, 14 Dec 2017 18:00:45 -0500 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. Signed-off-by: Antonio Russo --- contrib/dracut/90zfs/module-setup.sh.in | 10 ++++++---- contrib/dracut/90zfs/zfs-generator.sh.in | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/contrib/dracut/90zfs/module-setup.sh.in b/contrib/dracut/90zfs/module-setup.sh.in index 0f85c2a2505f..90456e73e6a6 100755 --- a/contrib/dracut/90zfs/module-setup.sh.in +++ b/contrib/dracut/90zfs/module-setup.sh.in @@ -89,10 +89,12 @@ install() { mkdir -p "${initdir}/$systemdsystemunitdir/initrd.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 - type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-import-$_item.service - fi + type mark_hostonly >/dev/null 2>&1 && mark_hostonly @systemdunitdir@/zfs-import-$_item.service done + dracut_install @systemdunitdir@/zfs-import.target + type mark_hostonly >/dev/null 2>&1 && mark_hostonly @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 + fi fi } diff --git a/contrib/dracut/90zfs/zfs-generator.sh.in b/contrib/dracut/90zfs/zfs-generator.sh.in index c6384f583586..d2e511b0850f 100755 --- a/contrib/dracut/90zfs/zfs-generator.sh.in +++ b/contrib/dracut/90zfs/zfs-generator.sh.in @@ -51,8 +51,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]" echo "What=${root}" echo "Type=${rootfstype}"