Disable late hook if zfs_boot_only is set (#366)

This allows the user to rely on zfs-import-cache.service to import ZFS pools, if they want to.
pull/367/head
Bronek Kozicki 4 years ago committed by GitHub
parent 6574ca37c4
commit 23bb142404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      conf.sh
  2. 4
      src/kernels/_utils.sh
  3. 8
      src/zfs-utils/zfs-utils.initcpio.hook

@ -10,7 +10,7 @@ zfs_src_hash="dbb41d6b9c606a34ac93f4c19069fd6806ceeacb558f834f8a70755dadb7cd3d"
zfs_rc_src_hash="d06ef8baa44a302ff28c6860e4ff1bf454c617198f755dbbce5d46d3bb7bca7b"
zfs_initcpio_install_hash="29a8a6d76fff01b71ef1990526785405d9c9410bdea417b08b56107210d00b10"
zfs_initcpio_hook_hash="b60bf208e2166266132180a8f21d295405617e30ebf3d0c7d15c251d7c0e92e8"
zfs_initcpio_hook_hash="446a4793cbb8ebf5196ef5ed60c372096c161c48bf714eb053f619791a7042f9"
zfs_initcpio_zfsencryptssh_install="29080a84e5d7e36e63c4412b98646043724621245b36e5288f5fed6914da5b68"
# Notification address

@ -3,7 +3,7 @@ mode_name="utils"
mode_desc="Select and use the utils packages"
# version
pkgrel="2"
pkgrel="3"
# Version for GIT packages
pkgrel_git="1"
@ -11,7 +11,7 @@ zfs_git_commit=""
zfs_git_url="https://github.com/zfsonlinux/zfs.git"
# Version for RC packages
pkgrel_rc="2"
pkgrel_rc="3"
header="\
# Maintainer: Jan Houben <jan@nexttrex.de>

@ -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:

Loading…
Cancel
Save