From 173b771d6e06b1abd812cde1ff3e294bbe5628de Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Sat, 20 Jul 2024 22:07:34 +0200 Subject: [PATCH] use already local pacman chroot --- usr/lib/archboot/container.sh | 4 ---- usr/lib/archboot/run/container.sh | 4 ++-- usr/lib/archboot/server.sh | 7 ++++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/usr/lib/archboot/container.sh b/usr/lib/archboot/container.sh index 26337aebc..02fce9cf5 100644 --- a/usr/lib/archboot/container.sh +++ b/usr/lib/archboot/container.sh @@ -51,10 +51,6 @@ _pacman_chroot() { echo "Verifying ${3}..." gpg --verify "${3}.sig" &>"${_NO_LOG}" || exit 1 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..." ${_NSPAWN} "${1}" pacman -Syu --noconfirm &>"${_NO_LOG}" } diff --git a/usr/lib/archboot/run/container.sh b/usr/lib/archboot/run/container.sh index 7e3c50999..326802c2a 100755 --- a/usr/lib/archboot/run/container.sh +++ b/usr/lib/archboot/run/container.sh @@ -36,11 +36,11 @@ else if [[ "${_RUNNING_ARCH}" == "x86_64" ]]; then if echo "${_BASENAME}" | rg -qw 'aarch64'; then _pacman_chroot "${1}" "${_ARCHBOOT_AARCH64_CHROOT_PUBLIC}" \ - "${_PACMAN_AARCH64_CHROOT}" || exit 1 + "${_ISO_HOME}/${_PACMAN_AARCH64_CHROOT}" || exit 1 fi if echo "${_BASENAME}" | rg -qw 'riscv64'; then _pacman_chroot "${1}" "${_ARCHBOOT_RISCV64_CHROOT_PUBLIC}" \ - "${_PACMAN_RISCV64_CHROOT}" || exit 1 + "${_ISO_HOME}/${_PACMAN_RISCV64_CHROOT}" || exit 1 fi _create_pacman_conf "${1}" "use_binfmt" _pacman_parameters "${1}" "use_binfmt" diff --git a/usr/lib/archboot/server.sh b/usr/lib/archboot/server.sh index 36468d27b..0f0d8c811 100644 --- a/usr/lib/archboot/server.sh +++ b/usr/lib/archboot/server.sh @@ -21,9 +21,10 @@ _update_pacman_chroot() { cd "${_ISO_HOME}" || exit 1 [[ -d "${_ARCH_DIR}" ]] || mkdir "${_ARCH_DIR}" echo "Downloading pacman ${_ARCH} chroot..." - [[ -f pacman-${_ARCH}-chroot-latest.tar.zst ]] && rm pacman-"${_ARCH}"-chroot-latest.tar.zst{,.sig} 2>"${_NO_LOG}" - ${_DLPROG} -O "${_ARCH_CHROOT_PUBLIC}"/"${_PACMAN_CHROOT}" - ${_DLPROG} -O "${_ARCH_CHROOT_PUBLIC}"/"${_PACMAN_CHROOT}".sig + if ! [[ -f pacman-${_ARCH}-chroot-latest.tar.zst ]]; then + ${_DLPROG} -O "${_ARCH_CHROOT_PUBLIC}"/"${_PACMAN_CHROOT}" + ${_DLPROG} -O "${_ARCH_CHROOT_PUBLIC}"/"${_PACMAN_CHROOT}".sig + fi # verify download #shellcheck disable=SC2024 gpg --chuid "${_USER}" --verify "${_PACMAN_CHROOT}.sig" &>"${_NO_LOG}" || exit 1