+#!/bin/sh
+
+. /lib/dracut-lib.sh
+
+# Let the command line override our host id.
+spl_hostid=`getarg spl_hostid=`
+if [ "${spl_hostid}" != "" ] ; then
+ info "ZFS: Using hostid from command line: ${spl_hostid}"
+ echo "${spl_hostid}" > /etc/hostid
+elif [ -f /etc/hostid ] ; then
+ info "ZFS: Using hostid from /etc/hostid: `cat /etc/hostid`"
+else
+ warn "ZFS: No hostid found on kernel command line or /etc/hostid. "
+ warn "ZFS: Pools may not import correctly."
+fi
+