zfs dracut module should not assume systemd presence

Signed-off-by: Moritz Maxeiner <moritz@ucworks.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4749
Closes #5058
This commit is contained in:
Moritz Maxeiner 2016-09-01 18:29:31 +02:00 committed by Brian Behlendorf
parent 61c7349439
commit 8516203d53
1 changed files with 10 additions and 8 deletions

View File

@ -10,14 +10,16 @@ case "${root}" in
*) return ;; *) return ;;
esac esac
# If sysroot.mount exists, the initial RAM disk configured if command -v systemctl >/dev/null; then
# it to mount ZFS on root. In that case, we bail early. # If sysroot.mount exists, the initial RAM disk configured
loadstate="$(systemctl --system --show -p LoadState sysroot.mount || true)" # it to mount ZFS on root. In that case, we bail early.
if [ "${loadstate}" = "LoadState=not-found" -o "${loadstate}" = "" ] ; then loadstate="$(systemctl --system --show -p LoadState sysroot.mount || true)"
if [ "${loadstate}" = "LoadState=not-found" -o "${loadstate}" = "" ] ; then
info "ZFS: sysroot.mount absent, mounting root with mount-zfs.sh" info "ZFS: sysroot.mount absent, mounting root with mount-zfs.sh"
else else
info "ZFS: sysroot.mount present, delegating root mount to it" info "ZFS: sysroot.mount present, delegating root mount to it"
return return
fi
fi fi
# Delay until all required block devices are present. # Delay until all required block devices are present.