hotfix Architecture

This commit is contained in:
Astound 2024-07-21 11:15:16 +08:00
parent 46ac764399
commit 91b23af81d
Signed by: kaiser
GPG Key ID: 97504AF0027B1A56
2 changed files with 8 additions and 7 deletions

View File

@ -151,6 +151,7 @@ configure_pacman() {
debug "Configuring SERVER" debug "Configuring SERVER"
SERVER=$(get_template_repo_url "$REPO_URL" "$ARCH") SERVER=$(get_template_repo_url "$REPO_URL" "$ARCH")
echo "Server = $SERVER" > "$DEST/etc/pacman.d/mirrorlist" echo "Server = $SERVER" > "$DEST/etc/pacman.d/mirrorlist"
sed -i "s|^Architecture = auto|Architecture = $ARCH|" "$DEST/etc/pacman.conf"
debug "Configuring CERT" debug "Configuring CERT"
cp -fv certs/1.pem "$DEST/etc/ca-certificates/extracted/tls-ca-bundle.pem" 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" sed -i "s|^[[:space:]]*\(CheckSpace\)|# \1|" "$DEST/etc/pacman.conf"
} }
restore_signature() { set_final_conf() {
local DEST=$1 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|SigLevel = Never|SigLevel = Required DatabaseOptional|" "$DEST/etc/pacman.conf"
sed -i "s|^Architecture = auto|Architecture = $ARCH|" "$DEST/etc/pacman.conf"
} }
configure_locale() { configure_locale() {
@ -293,7 +298,7 @@ main() {
configure_locale "$DEST" configure_locale "$DEST"
clean_chroot "$DEST" # clean clean_chroot "$DEST" # clean
[[ -z "$PRESERVE_DOWNLOAD_DIR" ]] && rm -rf "$DOWNLOAD_DIR" [[ -z "$PRESERVE_DOWNLOAD_DIR" ]] && rm -rf "$DOWNLOAD_DIR"
restore_signature "$DEST" set_final_conf "$DEST" "$ARCH"
debug "Done!" debug "Done!"
debug debug
debug "You may now chroot or arch-chroot from package arch-install-scripts:" debug "You may now chroot or arch-chroot from package arch-install-scripts:"

View File

@ -94,10 +94,6 @@ bash "${SCRIPT_PWD}/hyper-bootstrap_${RELEASE}.sh" -a "${ARCH}" -r "${REPO_URL}"
# Clean up package cache # Clean up package cache
(cd "${ROOTFS}" && rm -rf var/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 # 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' 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" *) (cd "${RESULTPATH}/${ROOTFS}" && tar --create --gzip --numeric-owner --xattrs --acls --file="${SCRIPT_PWD}/hyperbola-bootstrap-${ARCH}.tar.gz" *)