aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus <heckyel@riseup.net>2023-09-25 02:59:44 +0800
committerJesus <heckyel@riseup.net>2023-09-25 02:59:44 +0800
commit19b520487d125e5bcd4d07cd2849126a2f23c8ea (patch)
tree5bd83375de2bf677cb50c6e1f504e61a63f5cda8
parentfe6c9aa2b4a6a8f9dea8e0f4c3fa56b10c234018 (diff)
downloadhyperbola-bootstrap-19b520487d125e5bcd4d07cd2849126a2f23c8ea.tar.lz
hyperbola-bootstrap-19b520487d125e5bcd4d07cd2849126a2f23c8ea.tar.xz
hyperbola-bootstrap-19b520487d125e5bcd4d07cd2849126a2f23c8ea.zip
Add flexible chroot delete
-rw-r--r--make-bootstrap-file.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/make-bootstrap-file.sh b/make-bootstrap-file.sh
index 2e0c883..5153150 100644
--- a/make-bootstrap-file.sh
+++ b/make-bootstrap-file.sh
@@ -17,6 +17,7 @@ Usage: bash $0 [options]
Options:
-a, --arch ARCH Specify architecture (default: x86_64)
+ -d, --delete-chroot Delete the chroot environment after processing (default: yes)
-r, --release VERSION Specify version (default: v0.4.3)
-u, --url URL Specify repository URL (default: https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/stable)
-owu, --owner-user-id ID Owner user ID for the tar file (default: 1000)
@@ -44,6 +45,10 @@ while [[ $# -gt 0 ]]; do
ARCH="${2}"
shift 2
;;
+ -d|--delete-chroot)
+ CHROOT_DELETE="${2}"
+ shift 2
+ ;;
-r|--release)
RELEASE="${2}"
shift 2
@@ -98,8 +103,8 @@ printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' "Make hyperbola-bootstrap
# Clean chroot temp
case $CHROOT_DELETE in
- y) rm -rf "${ROOTFS}" || true && echo -e "\e[1;32m==>\e[0m\033[1m Temporal chroot deleted! \e[m" ;;
- n) echo 'Temporal chroot available' ;;
+ y|yes) rm -rf "${RESULTPATH}/${ROOTFS}" || true && echo -e "\e[1;32m==>\e[0m\033[1m Temporal chroot deleted! \e[m" ;;
+ n|not) echo 'Temporal chroot available' ;;
*) echo 'Invalid option "$@"' ;;
esac