From cb6d684aff1f2321c56c5b1de6c4da539e3a7a64 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 21 Jan 2026 00:33:42 -0600 Subject: Use zfs-import-scan instead of zfs-import-cache for boot Switch to the recommended pool import method that uses blkid to scan for pools instead of relying on zpool.cache. This eliminates the complexity of managing cachefile paths with altroot during installation. Changes: - Remove cachefile setup from create_zfs_pool() and configure_zfs_services() - Enable zfs-import-scan.service instead of zfs-import-cache.service - Set cachefile=none on the pool since it's not needed - Update full-test.sh to verify zfs-import-scan is enabled This approach is recommended per the Arch Wiki and doesn't require the cachefile to be present in the initramfs. --- scripts/full-test.sh | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'scripts/full-test.sh') diff --git a/scripts/full-test.sh b/scripts/full-test.sh index c5fa641..a1e1c3a 100755 --- a/scripts/full-test.sh +++ b/scripts/full-test.sh @@ -448,23 +448,12 @@ CONF" fi $VERBOSE && info "Genesis snapshot exists" - # Check cachefile property is set (required for boot) - local cachefile=$(ssh_cmd "zpool get -H -o value cachefile zroot" 2>/dev/null) - if [[ "$cachefile" != "/etc/zfs/zpool.cache" ]]; then - fail "$test_name: Pool cachefile not set (was: '$cachefile', need: '/etc/zfs/zpool.cache')" - cleanup - return 1 - fi - $VERBOSE && info "Pool cachefile property set correctly" - - # Check zpool.cache is in initramfs (required for boot) - local initramfs_cache=$(ssh_cmd "lsinitcpio /boot/initramfs-linux-lts.img 2>/dev/null | grep zpool.cache" 2>/dev/null) - if [[ -z "$initramfs_cache" ]]; then - fail "$test_name: zpool.cache missing from initramfs" - cleanup - return 1 + # Check zfs-import-scan is enabled (our preferred import method - no cachefile needed) + local import_scan=$(ssh_cmd "systemctl is-enabled zfs-import-scan" 2>/dev/null) + if [[ "$import_scan" != "enabled" ]]; then + warn "$test_name: zfs-import-scan not enabled (was: '$import_scan')" fi - $VERBOSE && info "zpool.cache present in initramfs" + $VERBOSE && info "zfs-import-scan service: $import_scan" # Check kernel local kernel=$(ssh_cmd "uname -r" 2>/dev/null) -- cgit v1.2.3