|
|
|
@ -6,6 +6,7 @@ |
|
|
|
|
# |
|
|
|
|
ZPOOL_FORCE="" |
|
|
|
|
ZPOOL_IMPORT_FLAGS="" |
|
|
|
|
ZFS_BOOT_ONLY="" |
|
|
|
|
|
|
|
|
|
zfs_get_bootfs () { |
|
|
|
|
for zfs_dataset in $(zpool list -H -o bootfs); do |
|
|
|
@ -114,6 +115,9 @@ set_flags() { |
|
|
|
|
# Force import the pools, useful if the pool has not properly been exported using 'zpool export <pool>' |
|
|
|
|
[ ! "${zfs_force}" = "" ] && ZPOOL_FORCE="-f" |
|
|
|
|
|
|
|
|
|
# Disable late hook, useful if we want to use zfs-import-cache.service instead |
|
|
|
|
[ ! "${zfs_boot_only}" = "" ] && ZFS_BOOT_ONLY="1" |
|
|
|
|
|
|
|
|
|
# Add import directory to import command flags |
|
|
|
|
[ ! "${zfs_import_dir}" = "" ] && ZPOOL_IMPORT_FLAGS="${ZPOOL_IMPORT_FLAGS} -d ${zfs_import_dir}" |
|
|
|
|
[ "${zfs_import_dir}" = "" ] && [ -f /etc/zfs/zpool.cache.org ] && ZPOOL_IMPORT_FLAGS="${ZPOOL_IMPORT_FLAGS} -c /etc/zfs/zpool.cache.org" |
|
|
|
@ -182,8 +186,8 @@ run_hook() { |
|
|
|
|
|
|
|
|
|
run_latehook () { |
|
|
|
|
set_flags |
|
|
|
|
# only run zpool import, if flags were set (cache file found / zfs_import_dir specified) |
|
|
|
|
[ ! "${ZPOOL_IMPORT_FLAGS}" = "" ] && zpool import ${ZPOOL_IMPORT_FLAGS} -N -a ${ZPOOL_FORCE} |
|
|
|
|
# only run zpool import, if flags were set (cache file found / zfs_import_dir specified) and zfs_boot_only is not set |
|
|
|
|
[ ! "${ZPOOL_IMPORT_FLAGS}" = "" ] && [ "${ZFS_BOOT_ONLY}" = "" ] && zpool import ${ZPOOL_IMPORT_FLAGS} -N -a ${ZPOOL_FORCE} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# vim:set ts=4 sw=4 ft=sh et: |
|
|
|
|