add keyring initialization checks to setup and quickinst

This commit is contained in:
Tobias Powalowski 2022-09-02 11:59:39 +02:00
parent a4c3dfdb53
commit 32f9077e9a
2 changed files with 19 additions and 0 deletions

View file

@ -37,6 +37,15 @@ prepare_pacman() {
if [[ ! -d "${DESTDIR}/var/lib/pacman" ]]; then
mkdir -p "${DESTDIR}/var/lib/pacman"
fi
# pacman-key process itself
while pgrep -x pacman-key > /dev/null 2>&1; do
sleep 1
done
# gpg finished in background
while pgrep -x gpg > /dev/null 2>&1; do
sleep 1
done
[[ -e /etc/systemd/system/pacman-init.service ]] && systemctl stop pacman-init.service
${PACMAN} -Sy
KEYRING="archlinux-keyring"
[[ "$(uname -m)" == "aarch64" ]] && KEYRING="${KEYRING} archlinuxarm-keyring"

View file

@ -99,6 +99,16 @@ prepare_pacman() {
# Set up the necessary directories for pacman use
[[ ! -d "${DESTDIR}/var/cache/pacman/pkg" ]] && mkdir -p "${DESTDIR}/var/cache/pacman/pkg"
[[ ! -d "${DESTDIR}/var/lib/pacman" ]] && mkdir -p "${DESTDIR}/var/lib/pacman"
DIALOG --infobox "Waiting for Arch Linux keyring initialization..." 3 40
# pacman-key process itself
while pgrep -x pacman-key > /dev/null 2>&1; do
sleep 1
done
# gpg finished in background
while pgrep -x gpg > /dev/null 2>&1; do
sleep 1
done
[[ -e /etc/systemd/system/pacman-init.service ]] && systemctl stop pacman-init.service
DIALOG --infobox "Refreshing package database..." 3 40
${PACMAN} -Sy > "${LOG}" 2>&1 || (DIALOG --msgbox "Pacman preparation failed! Check ${LOG} for errors." 6 60; return 1)
DIALOG --infobox "Update Arch Linux keyring ..." 3 40