diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 2fb0eb4..f8f9825 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1181,7 +1181,7 @@ startVolumes() { then good_msg "Importing ZFS pools" - /sbin/zpool import -N -a ${ZPOOL_FORCE} + /sbin/zpool import -N -a ${ZPOOL_CACHE} ${ZPOOL_FORCE} if [ "$?" = '0' ] then @@ -1199,12 +1199,12 @@ startVolumes() { then good_msg "LUKS detected. Reimporting ${ZFS_POOL}" /sbin/zpool export -f "${ZFS_POOL}" - /sbin/zpool import -N ${ZPOOL_FORCE} "${ZFS_POOL}" + /sbin/zpool import -N ${ZPOOL_CACHE} ${ZPOOL_FORCE} "${ZFS_POOL}" fi else good_msg "Importing ZFS pool ${ZFS_POOL}" - /sbin/zpool import -N ${ZPOOL_FORCE} "${ZFS_POOL}" + /sbin/zpool import -N ${ZPOOL_CACHE} ${ZPOOL_FORCE} "${ZFS_POOL}" if [ "$?" = '0' ] then diff --git a/defaults/linuxrc b/defaults/linuxrc index d58ef06..0451eff 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -111,10 +111,16 @@ do dozfs*) USE_ZFS=1 - if [ "${x#*=}" = 'force' ] - then - ZPOOL_FORCE=-f - fi + case "${x#*=}" in + *force*) + ZPOOL_FORCE=-f + ;; + esac + case "${x#*=}" in + *cache*) + ZPOOL_CACHE="-c /etc/zfs/zpool.cache" + ;; + esac ;; dobtrfs*) USE_BTRFS=1 diff --git a/doc/genkernel.8.txt b/doc/genkernel.8.txt index 908212e..1424948 100644 --- a/doc/genkernel.8.txt +++ b/doc/genkernel.8.txt @@ -522,9 +522,9 @@ recognized by the kernel itself. *domdadm*:: Scan for RAID arrays on bootup -*dozfs*[=force]:: - Scan for bootable ZFS pools on bootup. Optionally force import if - necessary. +*dozfs*[=cache,force]:: + Scan for bootable ZFS pools on bootup. Optionally use cachefile or force import if + necessary or do perform both actions. *dobtrfs*:: Scan for attached Btrfs devices on bootup.