Check for failure to install base and retry

This commit is contained in:
natemaia 2022-07-29 19:43:07 -07:00
parent 2947da8c42
commit ba89e69277

View File

@ -6,7 +6,7 @@
# AIF, Calamares, and the Arch Wiki.. Credit where credit is due
# shellcheck disable=2086,2046,2254,2164,2030,2031,2001
VER=2.19
VER=2.20
# default values {
@ -1796,6 +1796,8 @@ install_base()
unset BG_PID
fi
install_check_base
mkdir -pv "$MNT/etc/default"
if [[ $DIST == "ArchLabs" ]]; then
@ -2115,6 +2117,7 @@ install_packages()
[[ $NEWSHELL =~ (bash|zsh) ]] && inpkg+=('bash-completion')
[[ $INSTALL_WMS =~ dwm ]] && inpkg+=('git' 'make' 'gcc' 'pkgconf')
# remove the packages we don't want on the installed system
[[ ${rmpkg[*]} ]] && chrun "pacman -Rnsc ${rmpkg[*]} --noconfirm"
@ -2203,6 +2206,52 @@ install_packages()
return 0
}
install_check_bg()
{
# check for errors in the background install
[[ -e $MNT/bin/bash ]] && return
local luks='' key="9E4F11C6A072942A7B3FD3B0B81EB14A09A25EB0"
[[ $LUKS ]] && luks='cryptsetup'
# select_mirrors || AUTO_MIRROR=true
# install_mirrorlist > /tmp/bgout 2>&1
# al_repo "/etc/pacman.conf"
{
pacman -Syy
pacman -S archlinux-keyring --noconfirm
pacstrap /mnt base rsync
} >> /tmp/bgout 2>&1
cp -Rf /etc/pacman.d "$MNT/etc/"
cp -f /etc/pacman.conf "$MNT/etc/"
cp -f /etc/pacman.d/mirrorlist "$MNT/etc/pacman.d/"
al_repo "$MNT/etc/pacman.conf"
{
chrun "pacman -Syyu --noconfirm"
if ! pacman-key --list-keys | grep -q "$key"; then
chrun "pacman-key --recv-keys '$key'"
chrun "pacman-key --finger '$key'"
chrun "pacman-key --lsign-key '$key'"
fi
chrun "pacman -S archlinux-keyring archlabs-keyring --noconfirm"
chrun "pacman -S ${ISO_PKGS[*]} $luks $NET_TYPE --noconfirm --needed"
} >> /tmp/bgout 2>&1
if [[ $NET_TYPE == 'networkmanager' ]]; then
chrun 'systemctl enable NetworkManager.service' >> /tmp/bgout 2>&1
else
chrun 'systemctl enable iwd.service' >> /tmp/bgout 2>&1
fi
if [[ -e /tmp/wmlist ]]; then
chrun "pacman -S ${BASE_PKGS[*]} $(cat /tmp/wmlist) --noconfirm --needed" >> /tmp/bgout 2>&1
fi
}
install_suckless()
{
local dir="$1/suckless"
@ -2360,8 +2409,11 @@ install_background()
(
install_mirrorlist > /tmp/bgout 2>&1
al_repo "/etc/pacman.conf"
pacman -Syy >> /tmp/bgout 2>&1
pacstrap /mnt base rsync >> /tmp/bgout 2>&1
{
pacman -Syy
pacman -S archlinux-keyring --noconfirm
pacstrap /mnt base rsync
} >> /tmp/bgout 2>&1
cp -Rf /etc/pacman.d "$MNT/etc/"
cp -f /etc/pacman.conf "$MNT/etc/"
@ -2385,9 +2437,8 @@ install_background()
chrun 'systemctl enable iwd.service' >> /tmp/bgout 2>&1
fi
if [[ -e /tmp/wmlist ]]; then
chrun "pacman -S ${BASE_PKGS[*]} --noconfirm --needed" >> /tmp/bgout 2>&1
fi
[[ -e /tmp/wmlist ]] &&
chrun "pacman -S ${BASE_PKGS[*]} $(cat /tmp/wmlist) --noconfirm --needed" >> /tmp/bgout 2>&1
) &
BG_PID=$!
@ -2395,6 +2446,7 @@ install_background()
trap "kill $BG_PID 2> /dev/null; tput cnorm" EXIT
}
###############################################################################
# display manager config
# these are called based on which DM is chosen after it is installed