use already local pacman chroot

This commit is contained in:
Tobias Powalowski 2024-07-20 22:07:34 +02:00
parent 2b690ad836
commit 173b771d6e
3 changed files with 6 additions and 9 deletions

View file

@ -51,10 +51,6 @@ _pacman_chroot() {
echo "Verifying ${3}..." echo "Verifying ${3}..."
gpg --verify "${3}.sig" &>"${_NO_LOG}" || exit 1 gpg --verify "${3}.sig" &>"${_NO_LOG}" || exit 1
bsdtar -C "${1}" -xf "${3}" bsdtar -C "${1}" -xf "${3}"
if [[ -f "${3}" && -f "${3}".sig ]]; then
echo "Removing installation tarball ${3}..."
rm "${3}"{,.sig}
fi
echo "Updating container to latest packages..." echo "Updating container to latest packages..."
${_NSPAWN} "${1}" pacman -Syu --noconfirm &>"${_NO_LOG}" ${_NSPAWN} "${1}" pacman -Syu --noconfirm &>"${_NO_LOG}"
} }

View file

@ -36,11 +36,11 @@ else
if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then
if echo "${_BASENAME}" | rg -qw 'aarch64'; then if echo "${_BASENAME}" | rg -qw 'aarch64'; then
_pacman_chroot "${1}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" \ _pacman_chroot "${1}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" \
"${_PACMAN_AARCH64_CHROOT}" || exit 1 "${_ISO_HOME}/${_PACMAN_AARCH64_CHROOT}" || exit 1
fi fi
if echo "${_BASENAME}" | rg -qw 'riscv64'; then if echo "${_BASENAME}" | rg -qw 'riscv64'; then
_pacman_chroot "${1}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" \ _pacman_chroot "${1}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" \
"${_PACMAN_RISCV64_CHROOT}" || exit 1 "${_ISO_HOME}/${_PACMAN_RISCV64_CHROOT}" || exit 1
fi fi
_create_pacman_conf "${1}" "use_binfmt" _create_pacman_conf "${1}" "use_binfmt"
_pacman_parameters "${1}" "use_binfmt" _pacman_parameters "${1}" "use_binfmt"

View file

@ -21,9 +21,10 @@ _update_pacman_chroot() {
cd "${_ISO_HOME}" || exit 1 cd "${_ISO_HOME}" || exit 1
[[ -d "${_ARCH_DIR}" ]] || mkdir "${_ARCH_DIR}" [[ -d "${_ARCH_DIR}" ]] || mkdir "${_ARCH_DIR}"
echo "Downloading pacman ${_ARCH} chroot..." echo "Downloading pacman ${_ARCH} chroot..."
[[ -f pacman-${_ARCH}-chroot-latest.tar.zst ]] && rm pacman-"${_ARCH}"-chroot-latest.tar.zst{,.sig} 2>"${_NO_LOG}" if ! [[ -f pacman-${_ARCH}-chroot-latest.tar.zst ]]; then
${_DLPROG} -O "${_ARCH_CHROOT_PUBLIC}"/"${_PACMAN_CHROOT}" ${_DLPROG} -O "${_ARCH_CHROOT_PUBLIC}"/"${_PACMAN_CHROOT}"
${_DLPROG} -O "${_ARCH_CHROOT_PUBLIC}"/"${_PACMAN_CHROOT}".sig ${_DLPROG} -O "${_ARCH_CHROOT_PUBLIC}"/"${_PACMAN_CHROOT}".sig
fi
# verify download # verify download
#shellcheck disable=SC2024 #shellcheck disable=SC2024
gpg --chuid "${_USER}" --verify "${_PACMAN_CHROOT}.sig" &>"${_NO_LOG}" || exit 1 gpg --chuid "${_USER}" --verify "${_PACMAN_CHROOT}.sig" &>"${_NO_LOG}" || exit 1