From d5133635340c60471bf72cbca52004287965e234 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Wed, 30 Aug 2023 21:51:43 +0200 Subject: [PATCH] dynamic progressbar --- usr/bin/archboot-localize.sh | 4 ++-- usr/bin/archboot-update.sh | 2 +- usr/lib/archboot/update/manage.sh | 18 +++++++++++------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/usr/bin/archboot-localize.sh b/usr/bin/archboot-localize.sh index d6ad6743d..da7ea5dcd 100755 --- a/usr/bin/archboot-localize.sh +++ b/usr/bin/archboot-localize.sh @@ -49,7 +49,7 @@ _vconsole_keymap() { fi } -_task() { +_localize_task() { echo "LANG=${_LOCALE}.UTF-8" > /etc/locale.conf echo "LANG=${_LOCALE}.UTF-8" > /.localize echo LC_COLLATE=C >> /etc/locale.conf @@ -71,7 +71,7 @@ _task() { _run() { : >/.archboot - _task & + _localize_task & _progress_wait "0" "99" "Using ${_LOCALE}.UTF-8 and ${_KEYMAP}..." "0.01" _progress "100" "Localization completed successfully." sleep 2 diff --git a/usr/bin/archboot-update.sh b/usr/bin/archboot-update.sh index 15bb3b616..8bb5e7e7a 100755 --- a/usr/bin/archboot-update.sh +++ b/usr/bin/archboot-update.sh @@ -41,7 +41,7 @@ if [[ -n "${_D_SCRIPTS}" ]]; then _network_check : > /.update _TITLE="Archboot $(uname -m) | Basic Setup | GIT Master Scripts" - _download_latest | _dialog --title " Archboot GIT Master " --gauge "Downloading latest config..." 6 75 0 + _download_latest | _dialog --title " Archboot GIT Master " --gauge "Downloading latest GIT..." 6 75 0 clear fi # Generate new environment and launch it with kexec diff --git a/usr/lib/archboot/update/manage.sh b/usr/lib/archboot/update/manage.sh index 57c3901bc..6c5cb893c 100644 --- a/usr/lib/archboot/update/manage.sh +++ b/usr/lib/archboot/update/manage.sh @@ -129,13 +129,10 @@ _create_initramfs() { rm "${_W_DIR}"/.archboot } -_download_latest() { - # Download latest setup and quickinst script from git repository - [[ -d "${_INST}" ]] || mkdir "${_INST}" +_download_latest_task() { # config wget -q "${_SOURCE}${_ETC}/defaults?inline=false" -O "${_ETC}/defaults" # helper binaries - _progress "25" "Downloading latest scripts..." # main binaries _SCRIPTS="quickinst setup clock launcher localize network pacsetup update copy-mountpoint rsync-backup restore-usbstick" for i in ${_SCRIPTS}; do @@ -151,7 +148,6 @@ _download_latest() { [[ -e "${_HELP}/${i}" ]] && wget -q "${_SOURCE}${_HELP}/${i}?inline=false" -O "${_HELP}/${i}" done # main libs - _progress "50" "Downloading latest script libs..." LIBS="basic-common.sh common.sh container.sh release.sh iso.sh login.sh cpio.sh" for i in ${LIBS}; do wget -q "${_SOURCE}${_LIB}/${i}?inline=false" -O "${_LIB}/${i}" @@ -167,7 +163,6 @@ _download_latest() { wget -q "${_SOURCE}${_RUN}/${i}?inline=false" -O "${_RUN}/${i}" done # setup libs - _progress "75" "Downloading latest setup libs..." LIBS="autoconfiguration.sh quicksetup.sh base.sh blockdevices.sh bootloader.sh \ bootloader_sb.sh bootloader_grub.sh bootloader_uki.sh bootloader_systemd_bootd.sh \ bootloader_limine.sh bootloader_pacman_hooks.sh bootloader_refind.sh \ @@ -176,7 +171,16 @@ _download_latest() { for i in ${LIBS}; do wget -q "${_SOURCE}${_INST}/${i}?inline=false" -O "${_INST}/${i}" done - _progress "100" "Downloading scripts done." + rm /.archboot +} + +_download_latest() { + # Download latest setup and quickinst script from git repository + [[ -d "${_INST}" ]] || mkdir "${_INST}" + : > /.archboot + _download_latest_task & + _progress_wait "0" "99" "Downloading latest GIT..." "0.01" + _progress "100" "Downloading... done." sleep 2 }