Files
mirror_zfs/contrib/dracut/90zfs/parse-zfs.sh.in
T

36 lines
965 B
Bash
Raw Normal View History

#!/bin/sh
# shellcheck disable=SC2034,SC2154
2011-07-04 13:25:31 -04:00
# shellcheck source=zfs-lib.sh.in
. /lib/dracut-zfs-lib.sh
2011-07-04 13:25:31 -04:00
# Let the command line override our host id.
2018-02-21 20:54:54 -05:00
spl_hostid=$(getarg spl_hostid=)
2015-02-15 20:28:42 +01:00
if [ -n "${spl_hostid}" ] ; then
2011-07-24 16:46:16 -04:00
info "ZFS: Using hostid from command line: ${spl_hostid}"
zgenhostid -f "${spl_hostid}"
2015-02-15 20:28:42 +01:00
elif [ -f "/etc/hostid" ] ; then
2018-02-21 20:54:54 -05:00
info "ZFS: Using hostid from /etc/hostid: $(hostid)"
2011-07-04 13:25:31 -04:00
else
2015-02-15 20:28:42 +01:00
warn "ZFS: No hostid found on kernel command line or /etc/hostid."
2011-07-31 00:21:40 -04:00
warn "ZFS: Pools may not import correctly."
2011-07-04 13:25:31 -04:00
fi
if decode_root_args; then
if [ "$root" = "zfs:AUTO" ]; then
info "ZFS: Boot dataset autodetected from bootfs=."
else
info "ZFS: Boot dataset is ${root}."
fi
rootok=1
# Make sure Dracut is happy that we have a root and will wait for ZFS
# modules to settle before mounting.
if [ -n "${wait_for_zfs}" ]; then
ln -s null /dev/root
echo '[ -e /dev/zfs ]' > "${hookdir}/initqueue/finished/zfs.sh"
fi
else
info "ZFS: no ZFS-on-root."
fi