refactor(os): Retry pacman download on fail

This commit is contained in:
hygienic-books 2024-12-28 16:33:13 +01:00
parent eadbbea2fd
commit 08f33c33c7

View File

@ -429,12 +429,18 @@ function update_pacman_db () {
systemctl start reflector
# In an ISO and for the minimal number of packages we need we do not
# care about partial upgrades
pacman -Syyuu --noconfirm
while ! pacman -Syyuu --needed --noconfirm --downloadonly; do
sleep 5
done
pacman -Syyuu --needed --noconfirm
}
function install_pkgs () {
#1.5
printf -- '%s\n' 'Installing packages ...'
while ! pacman -S --needed --noconfirm --downloadonly "${@}"; do
sleep 5
done
pacman -S --needed --noconfirm "${@}"
}
@ -763,27 +769,29 @@ function install_archlinux () {
#1.12
pacman_dl_parallel
pacman_dont_check_space
pacstrap /mnt \
base \
base-devel \
linux \
linux-headers \
linux-firmware \
amd-ucode \
efibootmgr \
vim \
git \
iwd \
networkmanager \
network-manager-applet \
dialog \
os-prober \
reflector \
bluez \
bluez-utils \
man-db \
xdg-utils \
xdg-user-dirs
while ! pacstrap /mnt \
base \
base-devel \
linux \
linux-headers \
linux-firmware \
amd-ucode \
efibootmgr \
vim \
git \
iwd \
networkmanager \
network-manager-applet \
dialog \
os-prober \
reflector \
bluez \
bluez-utils \
man-db \
xdg-utils \
xdg-user-dirs; do
sleep 5
done
}
function gen_fstab () {
@ -1295,6 +1303,9 @@ function install_os_in_chroot () {
rm -rf '/etc/pacman.d/gnupg'
pacman-key --init
pacman-key --populate archlinux
while ! pacman -S archlinux-keyring --noconfirm --downloadonly; do
sleep 5
done
pacman -S archlinux-keyring --noconfirm
locale-gen