From 138734cd00be2e966931691f62f0831cff7bf724 Mon Sep 17 00:00:00 2001 From: Jesus Date: Mon, 25 Sep 2023 01:20:21 +0800 Subject: Remove x86_64/ and i686/ directory to make tarball file Details: - Add paramaters features --arch, --release, --url --- make-bootstrap-file.sh | 88 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 62 insertions(+), 26 deletions(-) (limited to 'make-bootstrap-file.sh') diff --git a/make-bootstrap-file.sh b/make-bootstrap-file.sh index 6419f47..16cf769 100644 --- a/make-bootstrap-file.sh +++ b/make-bootstrap-file.sh @@ -1,48 +1,84 @@ #!/bin/bash -# build: Bootstrap a base Hyperbola GNU+Linux-libre system. +# Build: Bootstrap a base Hyperbola GNU plus Linux-libre system set -e -u -o pipefail +usage() { + cat < ' '\e[0m\033[1m' 'Rename files ending in .pacnew...' '\e[m' +find "${ROOTFS}" -type f -name "*.pacnew" -exec sh -c 'mv -f "$1" "${1%.pacnew}"' _ {} \; -# create new archive -cd "${RESULTPATH}" -tar --create --gzip --numeric-owner --xattrs --acls --file="hyperbola-bootstrap.tar.gz" "${ROOTFS}" +# Make new tarball +printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' "Make hyperbola-bootstrap-${ARCH}.tar.gz..." '\e[m' +(cd "${RESULTPATH}/${ROOTFS}" && tar --create --gzip --numeric-owner --xattrs --acls --file="${SCRIPT_PWD}/hyperbola-bootstrap-${ARCH}.tar.gz" *) -# create shasum -sha512sum "${RESULTPATH}/hyperbola-bootstrap.tar.gz" >| "${RESULTPATH}/hyperbola-bootstrap.tar.gz.sha512sum" +# Make sha512sum +sha512sum "${RESULTPATH}/hyperbola-bootstrap-${ARCH}.tar.gz" >| "${RESULTPATH}/hyperbola-bootstrap-${ARCH}.tar.gz.sha512sum" -# clean chroot temp +# 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' ;; - *) echo 'invalid_option "$@"' ;; + n) echo 'Temporal chroot available' ;; + *) echo 'Invalid option "$@"' ;; esac -# report result -echo "REPO: $REPO_URL" -echo "ROOTFS: $ROOTFS" -echo "RESULTPATH: $RESULTPATH" +# Report result +echo "REPO: ${REPO_URL}" +echo "ROOTFS: ${ROOTFS}" +echo "RESULTPATH: ${RESULTPATH}" -- cgit v1.2.3