]> granicus.if.org Git - zfs/commitdiff
Use zfs-import.target in contrib/dracut
authorAntonio Russo <antonio.e.russo@gmail.com>
Tue, 31 Jul 2018 17:15:41 +0000 (13:15 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 31 Jul 2018 17:15:41 +0000 (10:15 -0700)
The new zfs-import.target should be used in place of the
zfs-import-*.service units.

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Manuel Amador (Rudd-O) <rudd-o@rudd-o.com>
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
Closes #6964

contrib/dracut/90zfs/module-setup.sh.in
contrib/dracut/90zfs/zfs-generator.sh.in

index 19b763a3c5f7e96d69e7dae57cd7b1ac65fe7174..38dd84d5a7630a5a2e3160ba046f0f796795574a 100755 (executable)
@@ -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
 }
index 4446ed52ea738d7e492d73ee2ae6f5864df3ed70..0b8a8aaca796b5fa51ede4459b6817b86d4d415f 100755 (executable)
@@ -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"