diff options
author | Antonio Russo <[email protected]> | 2018-07-31 13:15:41 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-07-31 10:15:41 -0700 |
commit | 9b9d1adc38d14f0e01564b980662006589227f0a (patch) | |
tree | 0055379fb934e3a01a75fffbece43673e1a6c204 | |
parent | dae3e9ea21a73b1ca940abd4aee1993ea4be8028 (diff) |
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 <[email protected]>
Reviewed-by: Manuel Amador (Rudd-O) <[email protected]>
Signed-off-by: Antonio Russo <[email protected]>
Closes #6964
-rwxr-xr-x | contrib/dracut/90zfs/module-setup.sh.in | 12 | ||||
-rwxr-xr-x | 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 19b763a3c..38dd84d5a 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 4446ed52e..0b8a8aaca 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" |