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 # AIF, Calamares, and the Arch Wiki.. Credit where credit is due
# shellcheck disable=2086,2046,2254,2164,2030,2031,2001 # shellcheck disable=2086,2046,2254,2164,2030,2031,2001
VER=2.19 VER=2.20
# default values { # default values {
@ -1796,6 +1796,8 @@ install_base()
unset BG_PID unset BG_PID
fi fi
install_check_base
mkdir -pv "$MNT/etc/default" mkdir -pv "$MNT/etc/default"
if [[ $DIST == "ArchLabs" ]]; then if [[ $DIST == "ArchLabs" ]]; then
@ -2115,6 +2117,7 @@ install_packages()
[[ $NEWSHELL =~ (bash|zsh) ]] && inpkg+=('bash-completion') [[ $NEWSHELL =~ (bash|zsh) ]] && inpkg+=('bash-completion')
[[ $INSTALL_WMS =~ dwm ]] && inpkg+=('git' 'make' 'gcc' 'pkgconf') [[ $INSTALL_WMS =~ dwm ]] && inpkg+=('git' 'make' 'gcc' 'pkgconf')
# remove the packages we don't want on the installed system # remove the packages we don't want on the installed system
[[ ${rmpkg[*]} ]] && chrun "pacman -Rnsc ${rmpkg[*]} --noconfirm" [[ ${rmpkg[*]} ]] && chrun "pacman -Rnsc ${rmpkg[*]} --noconfirm"
@ -2203,6 +2206,52 @@ install_packages()
return 0 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() install_suckless()
{ {
local dir="$1/suckless" local dir="$1/suckless"
@ -2360,8 +2409,11 @@ install_background()
( (
install_mirrorlist > /tmp/bgout 2>&1 install_mirrorlist > /tmp/bgout 2>&1
al_repo "/etc/pacman.conf" 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 -Rf /etc/pacman.d "$MNT/etc/"
cp -f /etc/pacman.conf "$MNT/etc/" cp -f /etc/pacman.conf "$MNT/etc/"
@ -2385,9 +2437,8 @@ install_background()
chrun 'systemctl enable iwd.service' >> /tmp/bgout 2>&1 chrun 'systemctl enable iwd.service' >> /tmp/bgout 2>&1
fi fi
if [[ -e /tmp/wmlist ]]; then [[ -e /tmp/wmlist ]] &&
chrun "pacman -S ${BASE_PKGS[*]} --noconfirm --needed" >> /tmp/bgout 2>&1 chrun "pacman -S ${BASE_PKGS[*]} $(cat /tmp/wmlist) --noconfirm --needed" >> /tmp/bgout 2>&1
fi
) & ) &
BG_PID=$! BG_PID=$!
@ -2395,6 +2446,7 @@ install_background()
trap "kill $BG_PID 2> /dev/null; tput cnorm" EXIT trap "kill $BG_PID 2> /dev/null; tput cnorm" EXIT
} }
############################################################################### ###############################################################################
# display manager config # display manager config
# these are called based on which DM is chosen after it is installed # these are called based on which DM is chosen after it is installed