12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #!/bin/bash
- # build: Bootstrap a base Hyperbola GNU+Linux-libre system.
- set -e -u -o pipefail
- SCRIPT=$(readlink -f "$0")
- SCRIPT_PWD=$(dirname "$SCRIPT")
- CHROOT_DELETE='y'
- RESULTPATH=${SCRIPT_PWD}/
- ARCH="x86_64"
- # Hyperbola v0.4.2
- # REPO_URL="https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/testing"
- # Hyperbola v0.4.1
- REPO_URL="https://mirror.fsf.org/hyperbola/gnu-plus-linux-libre/stable"
- ROOTFS="$ARCH"
- # remove old archives
- rm -f "${RESULTPATH}/hyperbola-bootstrap.tar.gz" "${RESULTPATH}/hyperbola-bootstrap.tar.gz.sha512sum"
- # bootstrap for v0.4
- bash "${SCRIPT_PWD}/hyper-bootstrap_v0.4.1.sh" -a "${ARCH}" -r "${REPO_URL}" "${ROOTFS}"
- # bootstrap for v0.3
- # bash "${SCRIPT_PWD}/hyper-bootstrap_v0.4.2.sh" -a "${ARCH}" -r "${REPO_URL}" "${ROOTFS}"
- cd "${ROOTFS}"
- # clean up package cache
- rm -rf var/cache/*
- # 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
- 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 "$@"' ;;
- esac
- # report result
- echo "REPO: $REPO_URL"
- echo "ROOTFS: $ROOTFS"
- echo "RESULTPATH: $RESULTPATH"
|