Add fix permission by default

This commit is contained in:
Jesus 2023-09-25 02:15:57 +08:00
parent fc1365f2b2
commit 30e0053ac2
No known key found for this signature in database
GPG Key ID: E607CE7149F4D71C
2 changed files with 13 additions and 6 deletions

View File

@ -18,12 +18,6 @@ If you want change the download repository
# bash make-bootstrap-file.sh -u https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/testing # bash make-bootstrap-file.sh -u https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/testing
``` ```
Change tarballs files permissions, example:
```console
$ doas chown 1000:1000 hyperbola-bootstrap-x86_64.tar.gz*
```
License License
======= =======

View File

@ -24,6 +24,8 @@ RESULTPATH="${SCRIPT_PWD}"
ARCH="x86_64" ARCH="x86_64"
RELEASE="v0.4.3" RELEASE="v0.4.3"
REPO_URL="https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/stable" REPO_URL="https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/stable"
TAR_OWNER_USER_ID="1000"
TAR_OWNER_GROUP_ID="1000"
# Parse command-line arguments # Parse command-line arguments
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@ -41,6 +43,14 @@ while [[ $# -gt 0 ]]; do
REPO_URL="${2}" REPO_URL="${2}"
shift 2 shift 2
;; ;;
-owu|--owner-user-id)
TAR_OWNER_USER_ID="${2}"
shift 2
;;
-owg|--owner-group-id)
TAR_OWNER_GROUP_ID="${2}"
shift 2
;;
*) *)
echo "Unrecognized option: $key" echo "Unrecognized option: $key"
usage usage
@ -71,6 +81,9 @@ printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' "Make hyperbola-bootstrap
# Make sha512sum # Make sha512sum
(cd ${RESULTPATH} && sha512sum "hyperbola-bootstrap-${ARCH}.tar.gz" >| "hyperbola-bootstrap-${ARCH}.tar.gz.sha512sum") (cd ${RESULTPATH} && sha512sum "hyperbola-bootstrap-${ARCH}.tar.gz" >| "hyperbola-bootstrap-${ARCH}.tar.gz.sha512sum")
# Fix permission Tarballs
(cd ${RESULTPATH} && chown ${TAR_OWNER_USER_ID}:${TAR_OWNER_GROUP_ID} hyperbola-bootstrap-x86_64.tar.gz*)
# Clean chroot temp # Clean chroot temp
case $CHROOT_DELETE in case $CHROOT_DELETE in
y) rm -rf "${ROOTFS}" || true && echo -e "\e[1;32m==>\e[0m\033[1m Temporal chroot deleted! \e[m" ;; y) rm -rf "${ROOTFS}" || true && echo -e "\e[1;32m==>\e[0m\033[1m Temporal chroot deleted! \e[m" ;;