summaryrefslogtreecommitdiff
path: root/dotfiles/system/.local/bin/zfsrollback
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-01-18 11:19:47 -0600
committerCraig Jennings <c@cjennings.net>2026-01-18 11:19:47 -0600
commitbf20b8113b7243e47f399ee3924c8438e6ef6774 (patch)
tree7147b7a86259a7fb5a94f4e35cf37af14dccf472 /dotfiles/system/.local/bin/zfsrollback
parent149f236701dda8c8ff5e9ee68df39ee21b57f139 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'dotfiles/system/.local/bin/zfsrollback')
-rwxr-xr-xdotfiles/system/.local/bin/zfsrollback18
1 files changed, 18 insertions, 0 deletions
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