From da3e568d6554458e03cb3d9eee5a820b7e970bab Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 19 Jan 2026 08:39:28 -0600 Subject: Add zfssnapshot and zfsrollback scripts to ISO Copied from archsetup to make these tools available on the live ISO for rescue scenarios and post-install management. zfssnapshot: - Creates recursive snapshots across all pools - Timestamps with descriptive labels (YYYY-MM-DD_HH-MM-SS_description) - Integrates with grub-zfs-snap for boot menu updates zfsrollback: - Interactive fzf-based snapshot selection - Two modes: single dataset or all matching datasets - Safety warnings showing what will be destroyed - Special genesis rollback warning --- build.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'build.sh') diff --git a/build.sh b/build.sh index 59dea31..e6d7111 100755 --- a/build.sh +++ b/build.sh @@ -266,6 +266,11 @@ cp "$CUSTOM_DIR/zz-grub-zfs-snap.hook" "$PROFILE_DIR/airootfs/usr/local/share/gr info "Copying zfs-snap-prune..." cp "$CUSTOM_DIR/zfs-snap-prune" "$PROFILE_DIR/airootfs/usr/local/bin/" +# Copy zfssnapshot and zfsrollback for ZFS management +info "Copying zfssnapshot and zfsrollback..." +cp "$CUSTOM_DIR/zfssnapshot" "$PROFILE_DIR/airootfs/usr/local/bin/" +cp "$CUSTOM_DIR/zfsrollback" "$PROFILE_DIR/airootfs/usr/local/bin/" + # Copy example config for unattended installs mkdir -p "$PROFILE_DIR/airootfs/root" cp "$CUSTOM_DIR/install-archzfs.conf.example" "$PROFILE_DIR/airootfs/root/" @@ -292,6 +297,12 @@ if grep -q "file_permissions=" "$PROFILE_DIR/profiledef.sh"; then sed -i '/^file_permissions=(/,/)/ { /)/ i\ ["/usr/local/bin/zfs-snap-prune"]="0:0:755" }' "$PROFILE_DIR/profiledef.sh" + sed -i '/^file_permissions=(/,/)/ { + /)/ i\ ["/usr/local/bin/zfssnapshot"]="0:0:755" + }' "$PROFILE_DIR/profiledef.sh" + sed -i '/^file_permissions=(/,/)/ { + /)/ i\ ["/usr/local/bin/zfsrollback"]="0:0:755" + }' "$PROFILE_DIR/profiledef.sh" sed -i '/^file_permissions=(/,/)/ { /)/ i\ ["/etc/shadow"]="0:0:400" }' "$PROFILE_DIR/profiledef.sh" -- cgit v1.2.3