# 7. Update bootloader config if needed (example for extlinux) if [[ -f "$BOOTLOADER_CFG" ]]; then log_info "Updating bootloader entry for recovery..." sed -i 's/^\(.*recovery.*\)initrd.*$/\1initrd=\/recovery-ramdisk.img/' "$BOOTLOADER_CFG" sync fi
# Optional: test boot into recovery mode if [[ "$TEST_RECOVERY_BOOT:-0" == "1" ]]; then log_info "Testing recovery boot (dry-run)..." # In real system: reboot recovery fi install recovery ramdisk
log_warn() echo -e "$YELLOW[WARN]$NC $1" then umount "$RECOVERY_MNT" trap cleanup EXIT
cleanup() if mountpoint -q "$RECOVERY_MNT"; then umount "$RECOVERY_MNT" trap cleanup EXIT install recovery ramdisk