From bf20b8113b7243e47f399ee3924c8438e6ef6774 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 18 Jan 2026 11:19:47 -0600 Subject: Update ZFS scripts for archzfs compatibility zfssnapshot: - Change date format to YYYY-MM-DD_HH-MM-SS_description (matches pre-pacman snapshot format for consistent sorting) - Convert spaces to underscores instead of hyphens - Add GRUB menu regeneration after snapshot creation zfsrollback: - Add special warning for genesis rollback - Add GRUB menu regeneration after successful rollback (removes destroyed snapshots from boot menu) Co-Authored-By: Claude Opus 4.5 --- dotfiles/system/.local/bin/zfsrollback | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'dotfiles/system/.local/bin/zfsrollback') diff --git a/dotfiles/system/.local/bin/zfsrollback b/dotfiles/system/.local/bin/zfsrollback index a03cd57..6e727e2 100755 --- a/dotfiles/system/.local/bin/zfsrollback +++ b/dotfiles/system/.local/bin/zfsrollback @@ -110,6 +110,16 @@ echo "════════════════════════ echo " ⚠️ WARNING ⚠️" echo "═══════════════════════════════════════════════════════════════════" echo "" + +# Special warning for genesis rollback +if [[ "$snap_name" == "genesis" ]]; then + echo " 🚨 GENESIS ROLLBACK DETECTED 🚨" + echo "" + echo " Rolling back to genesis will destroy ALL changes since installation!" + echo " This includes all packages installed, configurations, and user data." + echo "" +fi + echo "You are about to roll back to snapshot: @${snap_name}" echo "" echo "The following datasets will be rolled back:" @@ -160,6 +170,14 @@ done echo "" if [ $failed -eq 0 ]; then echo "Rollback complete." + + # Update GRUB boot menu if grub-zfs-snap is available + # (destroyed snapshots need to be removed from menu) + if command -v grub-zfs-snap &> /dev/null; then + echo "" + echo "Updating GRUB boot menu..." + grub-zfs-snap + fi else echo "Rollback completed with $failed failure(s)" exit 1 -- cgit v1.2.3