5 # Let the command line override our host id.
6 spl_hostid=`getarg spl_hostid=`
7 if [ "${spl_hostid}" != "" ] ; then
8 info "ZFS: Using hostid from command line: ${spl_hostid}"
9 echo "${spl_hostid}" > /etc/hostid
10 elif [ -f /etc/hostid ] ; then
11 info "ZFS: Using hostid from /etc/hostid: `cat /etc/hostid`"
13 warn "ZFS: No hostid found on kernel command line or /etc/hostid. "
14 warn "ZFS: Pools may not import correctly."
19 # We'll take root unset, root=zfs, or root=zfs:
20 # No root set, so we want to read the bootfs attribute. We can't do
21 # that until udev settles so we'll set dummy values and hope for the
26 info "ZFS: Enabling autodetection of bootfs after udev settles."
29 ZFS\=*|zfs:*|zfs:FILESYSTEM\=*|FILESYSTEM\=*)
30 # root is explicit ZFS root. Parse it now.
31 # We can handle a root=... param in any of the following formats:
34 # root=zfs:FILESYSTEM=rpool/ROOT
35 # root=FILESYSTEM=rpool/ROOT
37 # Strip down to just the pool/fs
39 root="${root#FILESYSTEM=}"
40 root="zfs:${root#ZFS=}"
43 info "ZFS: Set ${root} as bootfs."
47 # Make sure Dracut is happy that we have a root and will wait for ZFS
48 # modules to settle before mounting.
49 ln -s /dev/null /dev/root 2>/dev/null
50 echo '[ -e /dev/zfs ]' > $hookdir/initqueue/finished/zfs.sh