2 # shellcheck disable=SC2034,SC2154
4 # shellcheck source=zfs-lib.sh.in
5 .
/lib
/dracut-zfs-lib.sh
7 # Let the command line override our host id.
8 spl_hostid
=$
(getarg spl_hostid
=)
9 if [ -n "${spl_hostid}" ] ; then
10 info
"ZFS: Using hostid from command line: ${spl_hostid}"
11 zgenhostid
-f "${spl_hostid}"
12 elif [ -f "/etc/hostid" ] ; then
13 info
"ZFS: Using hostid from /etc/hostid: $(hostid)"
15 warn
"ZFS: No hostid found on kernel command line or /etc/hostid."
16 warn
"ZFS: Pools may not import correctly."
19 if decode_root_args
; then
20 if [ "$root" = "zfs:AUTO" ]; then
21 info
"ZFS: Boot dataset autodetected from bootfs=."
23 info
"ZFS: Boot dataset is ${root}."
27 # Make sure Dracut is happy that we have a root and will wait for ZFS
28 # modules to settle before mounting.
29 if [ -n "${wait_for_zfs}" ]; then
31 echo '[ -e /dev/zfs ]' > "${hookdir}/initqueue/finished/zfs.sh"
34 info
"ZFS: no ZFS-on-root."