diff --git a/usr/bin/archboot-pacsetup.sh b/usr/bin/archboot-pacsetup.sh index a9009051f..351c157fa 100755 --- a/usr/bin/archboot-pacsetup.sh +++ b/usr/bin/archboot-pacsetup.sh @@ -3,6 +3,8 @@ # created by Tobias Powalowski . /usr/lib/archboot/basic-common.sh _TITLE="Archboot ${_RUNNING_ARCH} | Basic Setup | Pacman Configuration" +_DLPROG="wget -q" +_MIRRORLIST="/etc/pacman.d/mirrorlist" _select_mirror() { ## Download updated mirrorlist, if possible (only on x86_64) @@ -51,14 +53,10 @@ _enable_testing() { } _update_environment() { - if [[ -d "/var/cache/pacman/pkg" ]] && [[ -n "$(ls -A "/var/cache/pacman/pkg")" ]]; then - echo "Packages are already in pacman cache..." >"${_LOG}" - _dialog --infobox "Packages are already in pacman cache.\nSkipping update environment.\nContinuing in 5 seconds..." 5 50 - sleep 5 - else - _UPDATE_ENVIRONMENT="" - _LOCAL_KERNEL="" - _ONLINE_KERNEL="" + _UPDATE_ENVIRONMENT="" + _LOCAL_KERNEL="" + _ONLINE_KERNEL="" + if update | grep -q '\-latest'; then if [[ "$(grep -w MemTotal /proc/meminfo | cut -d ':' -f2 | sed -e 's# ##g' -e 's#kB$##g')" -gt "2571000" ]]; then if ! [[ "${_RUNNING_ARCH}" == "riscv64" ]]; then _dialog --infobox "Refreshing package database..." 3 70 @@ -69,7 +67,7 @@ _update_environment() { _LOCAL_KERNEL="$(pacman -Qi ${_KERNELPKG} | grep Version | cut -d ':' -f2 | sed -e 's# ##')" if [[ "${_RUNNING_ARCH}" == "aarch64" ]]; then #shellcheck disable=SC2086 - _ONLINE_KERNEL="$(pacman -Si ${_KERNELPKG}-${_RUNNING_ARCH} | grep Version | cut -d ':' -f2 | sed -e 's# ##')" + _ ONLINE_KERNEL="$(pacman -Si ${_KERNELPKG}-${_RUNNING_ARCH} | grep Version | cut -d ':' -f2 | sed -e 's# ##')" else if [[ -n "${_DOTESTING}" ]]; then #shellcheck disable=SC2086 @@ -91,9 +89,11 @@ _update_environment() { clear echo -e "\e[93mGo and get a cup of coffee. Depending on your system setup,\e[m" echo -e "\e[93myou can \e[1mstart\e[m\e[93m with your tasks in about \e[1m5\e[m\e[93m minutes...\e[m" - echo -e "\e[1mStarting\e[m assembling of archboot environment \e[1mwith\e[m package cache..." - echo -e "\e[1mRunning now: \e[92mupdate -latest-install\e[m" - update -latest-install + if update | grep -q latest-install; then + update -latest-install + else + update -latest + fi fi fi fi @@ -128,7 +128,9 @@ _prepare_pacman() { _check while true; do + _enable_testing _select_mirror && break done +_update_environment _cleanup # vim: set ft=sh ts=4 sw=4 et: diff --git a/usr/lib/archboot/basic-common.sh b/usr/lib/archboot/basic-common.sh index f0aa75287..58c0c271f 100644 --- a/usr/lib/archboot/basic-common.sh +++ b/usr/lib/archboot/basic-common.sh @@ -6,8 +6,6 @@ _ANSWER="/tmp/.$(basename ${0})" _RUNNING_ARCH="$(uname -m)" _LOG="/dev/tty7" _NO_LOG="/dev/null" -_DLPROG="wget -q" -_MIRRORLIST="/etc/pacman.d/mirrorlist" _LABEL="Exit" # _dialog() diff --git a/usr/lib/archboot/installer/autoconfiguration.sh b/usr/lib/archboot/installer/autoconfiguration.sh index e1da333cd..e4623a70e 100644 --- a/usr/lib/archboot/installer/autoconfiguration.sh +++ b/usr/lib/archboot/installer/autoconfiguration.sh @@ -50,10 +50,10 @@ _auto_mdadm() fi } -# configures network on host system according to installer +# configures network on host system according to Basic Setup _auto_network() { - # exit if network wasn't configured in basic setup + # exit if network wasn't configured in Basic Setup if [[ ! -e /tmp/.network ]]; then return 1 fi @@ -91,7 +91,7 @@ _auto_pacman_keyring() _auto_testing() { - if [[ -n "${_DOTESTING}" ]]; then + if grep -q "^\[.*testing\]" /etc/pacman.conf; then _dialog --infobox "Enable [testing] repository on installed system..." 3 70 sed -i -e '/^#\[core-testing\]/ { n ; s/^#// }' "${_DESTDIR}"/etc/pacman.conf sed -i -e '/^#\[extra-testing\]/ { n ; s/^#// }' "${_DESTDIR}"/etc/pacman.conf diff --git a/usr/lib/archboot/installer/base.sh b/usr/lib/archboot/installer/base.sh index e0d4fa0f9..1be06617f 100644 --- a/usr/lib/archboot/installer/base.sh +++ b/usr/lib/archboot/installer/base.sh @@ -60,10 +60,6 @@ _abort_running_system() { _dialog --msgbox "This function is not available on System Setup Mode." 5 60 } -_abort_local_mode() { - _dialog --msgbox "This function is not available on Offline Mode." 5 60 -} - _geteditor() { if ! [[ "${_EDITOR}" ]]; then _dialog --title " Text Editor " --no-cancel --menu "" 8 35 2 \ diff --git a/usr/lib/archboot/update/update.sh b/usr/lib/archboot/update/update.sh index 30f4b4b4c..1d3b87133 100644 --- a/usr/lib/archboot/update/update.sh +++ b/usr/lib/archboot/update/update.sh @@ -101,7 +101,7 @@ _download_latest() { # helper binaries echo -e "\e[1mStep 2/4:\e[m Downloading latest scripts..." # main binaries - BINS="quickinst setup vconsole clock launcher localize network update copy-mountpoint rsync-backup restore-usbstick" + BINS="quickinst setup vconsole clock launcher localize network pacsetup update copy-mountpoint rsync-backup restore-usbstick" for i in ${BINS}; do [[ -e "${_BIN}/${i}" ]] && wget -q "${_SOURCE}${_BIN}/archboot-${i}.sh?inline=false" -O "${_BIN}/${i}" done