From 91b23af81d573422a6f707d4b7013834c7034b80 Mon Sep 17 00:00:00 2001 From: Astound Date: Sun, 21 Jul 2024 11:15:16 +0800 Subject: [PATCH] hotfix Architecture --- hyper-bootstrap_v0.4.3.sh | 11 ++++++++--- make-bootstrap-file.sh | 4 ---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/hyper-bootstrap_v0.4.3.sh b/hyper-bootstrap_v0.4.3.sh index e578ac4..ffafb76 100644 --- a/hyper-bootstrap_v0.4.3.sh +++ b/hyper-bootstrap_v0.4.3.sh @@ -151,6 +151,7 @@ configure_pacman() { debug "Configuring SERVER" SERVER=$(get_template_repo_url "$REPO_URL" "$ARCH") echo "Server = $SERVER" > "$DEST/etc/pacman.d/mirrorlist" + sed -i "s|^Architecture = auto|Architecture = $ARCH|" "$DEST/etc/pacman.conf" debug "Configuring CERT" cp -fv certs/1.pem "$DEST/etc/ca-certificates/extracted/tls-ca-bundle.pem" } @@ -183,9 +184,13 @@ configure_minimal_system() { sed -i "s|^[[:space:]]*\(CheckSpace\)|# \1|" "$DEST/etc/pacman.conf" } -restore_signature() { - local DEST=$1 +set_final_conf() { + local DEST=$1 ARCH=$2 + debug 'Rename files ending in .pacnew...' + find "${DEST}" -type f -name "*.pacnew" -exec sh -c 'mv -f "$1" "${1%.pacnew}"' _ {} \; + debug 'Update pacman.conf...' sed -i "s|SigLevel = Never|SigLevel = Required DatabaseOptional|" "$DEST/etc/pacman.conf" + sed -i "s|^Architecture = auto|Architecture = $ARCH|" "$DEST/etc/pacman.conf" } configure_locale() { @@ -293,7 +298,7 @@ main() { configure_locale "$DEST" clean_chroot "$DEST" # clean [[ -z "$PRESERVE_DOWNLOAD_DIR" ]] && rm -rf "$DOWNLOAD_DIR" - restore_signature "$DEST" + set_final_conf "$DEST" "$ARCH" debug "Done!" debug debug "You may now chroot or arch-chroot from package arch-install-scripts:" diff --git a/make-bootstrap-file.sh b/make-bootstrap-file.sh index 6bab5e4..4bf3674 100644 --- a/make-bootstrap-file.sh +++ b/make-bootstrap-file.sh @@ -94,10 +94,6 @@ bash "${SCRIPT_PWD}/hyper-bootstrap_${RELEASE}.sh" -a "${ARCH}" -r "${REPO_URL}" # Clean up package cache (cd "${ROOTFS}" && rm -rf var/cache/*) -# Rename pacnew files -printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\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}"' _ {} \; - # 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" *)