From c57eeb4da76cfd67b034c1b2591e0473f37a9cd9 Mon Sep 17 00:00:00 2001 From: Dennis ten Hoove Date: Sat, 24 Feb 2024 05:36:24 +0100 Subject: [PATCH] Add ARKDEP_NO_CLEANUP --- arkdep-build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arkdep-build b/arkdep-build index e652dea..071210a 100755 --- a/arkdep-build +++ b/arkdep-build @@ -21,6 +21,7 @@ if [[ ! -n $1 || -n $2 ]]; then ARKDEP_CUSTOM_NAME Define a custom image name ARKDEP_OUTPUT_TARGET Overwrite location to which images will be written ARKDEP_CONFIGS Define directory in which build will search for configuration files + ARKDEP_NO_CLEANUP Do not remove the temporary rootfs upon error or exit END exit 0 fi @@ -33,6 +34,11 @@ cleanup_and_quit () { # If any paramters are passed we will assume it to be an error [[ -n $1 ]] && printf "\e[1;31m<#>\e[0m $*\e[0m\n" >&2 + if [[ $ARKDEP_NO_CLEANUP -eq 1 ]]; then + printf 'Cleanup disabled, not running cleanup\n' + exit 1 + fi + umount $workdir btrfs property set -ts $workdir ro false