From 6505511f2e6b43a37570fc840f6d2851c7cc170c Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 18 Jan 2026 10:55:18 -0600 Subject: Add grub-zfs-snap for ZFS snapshot boot entries Add ability to boot into ZFS snapshots directly from GRUB menu: - grub-zfs-snap: generates GRUB submenu entries for recent snapshots - 40_zfs_snapshots: GRUB generator script installed to /etc/grub.d/ - zz-grub-zfs-snap.hook: pacman hook for automatic GRUB regeneration The GRUB menu automatically updates after kernel/ZFS package changes. Up to 10 most recent snapshots appear in a "ZFS Snapshots" submenu. --- custom/install-archzfs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'custom/install-archzfs') diff --git a/custom/install-archzfs b/custom/install-archzfs index dfba090..660cf34 100755 --- a/custom/install-archzfs +++ b/custom/install-archzfs @@ -1031,6 +1031,26 @@ EOF fi } +configure_grub_zfs_snap() { + step "Configuring ZFS Snapshot Boot Entries" + + # Install grub-zfs-snap script + info "Installing grub-zfs-snap..." + cp /usr/local/bin/grub-zfs-snap /mnt/usr/local/bin/grub-zfs-snap + chmod +x /mnt/usr/local/bin/grub-zfs-snap + + # Install GRUB generator + cp /usr/local/share/grub-zfs-snap/40_zfs_snapshots /mnt/etc/grub.d/40_zfs_snapshots + chmod +x /mnt/etc/grub.d/40_zfs_snapshots + + # Install pacman hook for auto-regeneration + mkdir -p /mnt/etc/pacman.d/hooks + cp /usr/local/share/grub-zfs-snap/zz-grub-zfs-snap.hook /mnt/etc/pacman.d/hooks/ + + info "ZFS snapshots will appear in GRUB boot menu." + info "Run 'grub-zfs-snap' to manually regenerate after creating snapshots." +} + configure_zfs_services() { step "Configuring ZFS Services" @@ -1276,6 +1296,7 @@ main() { configure_ssh configure_initramfs configure_bootloader + configure_grub_zfs_snap configure_zfs_services configure_pacman_hook copy_archsetup -- cgit v1.2.3