Fix generating file tar.gz
This commit is contained in:
parent
eab7a6db0b
commit
ab6a7fcb62
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
myhyper
|
||||
myhyper/
|
||||
x86_64/
|
||||
i686/
|
||||
*.tar.gz
|
||||
*.sha512sum
|
||||
|
@ -13,6 +13,7 @@
|
||||
# Example:
|
||||
#
|
||||
# # ./hyper-bootstrap.sh -a x86_64 -r "https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/testing" myhyper
|
||||
# # ./hyper-bootstrap.sh myhyper
|
||||
#
|
||||
# And then you can chroot to the destination directory (user: root, password: root):
|
||||
#
|
||||
|
@ -11,24 +11,22 @@ CHROOT_DELETE='y'
|
||||
RESULTPATH=${SCRIPT_PWD}/
|
||||
ARCH="x86_64"
|
||||
REPO_URL="https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/testing"
|
||||
DOWNLOAD_DIR="/tmp/bootstrap-packages"
|
||||
|
||||
ROOTFS=$(mktemp -d)
|
||||
mkdir -p "$ROOTFS"
|
||||
ROOTFS="$ARCH"
|
||||
# remove old archives
|
||||
rm -f "${RESULTPATH}/hyperbola-bootstrap.tar.gz" "${RESULTPATH}/hyperbola-bootstrap.tar.gz.sha512sum"
|
||||
|
||||
# bootstrap
|
||||
"${SCRIPT_PWD}/hyper-bootstrap.sh" -a "${ARCH}" -r "${REPO_URL}" -d "${DOWNLOAD_DIR}" "${ROOTFS}"
|
||||
"${SCRIPT_PWD}/hyper-bootstrap.sh" -a "${ARCH}" -r "${REPO_URL}" "${ROOTFS}"
|
||||
|
||||
cd "${ROOTFS}"
|
||||
# clean up package cache
|
||||
rm -rf var/cache/*
|
||||
# create new archive
|
||||
tar -czf "${RESULTPATH}/hyperbola-bootstrap.tar.gz" --transform "s|^|root.${ARCH}/|" --owner 0 --group 0 -- \
|
||||
bin dev home media opt root sbin sys usr lib64 \
|
||||
boot etc lib mnt proc run srv tmp var
|
||||
|
||||
# create new archive
|
||||
cd ${RESULTPATH}
|
||||
tar --create --gzip --numeric-owner --xattrs --acls --file="hyperbola-bootstrap.tar.gz" "${ROOTFS}"
|
||||
|
||||
# create shasum
|
||||
sha512sum "${RESULTPATH}/hyperbola-bootstrap.tar.gz" >| "${RESULTPATH}/hyperbola-bootstrap.tar.gz.sha512sum"
|
||||
|
||||
# clean chroot temp
|
||||
@ -40,6 +38,5 @@ esac
|
||||
|
||||
# report result
|
||||
echo "REPO: $REPO_URL"
|
||||
echo "DOWNLOAD_DIR: $DOWNLOAD_DIR"
|
||||
echo "ROOTFS: $ROOTFS"
|
||||
echo "RESULTPATH: $RESULTPATH"
|
||||
|
Loading…
x
Reference in New Issue
Block a user