add progressbar to quicksetup

This commit is contained in:
Tobias Powalowski 2023-08-06 17:56:40 +02:00
parent adbdd8a4ca
commit 4baf67ab1d
2 changed files with 10 additions and 6 deletions

View file

@ -340,15 +340,15 @@ _mountpoints() {
_mkfs() { _mkfs() {
if [[ -n "${4}" ]]; then if [[ -n "${4}" ]]; then
if [[ "${2}" == "swap" ]]; then if [[ "${2}" == "swap" ]]; then
_dialog --no-mouse --infobox "Creating and activating\nswapspace on ${1}..." 0 0 _progress "${_COUNT}" "Creating and activating\nswapspace on ${1}..."
else else
_dialog --no-mouse --infobox "Creating ${2} on ${1},\nmounting to ${3}${5}..." 0 0 _progress "${_COUNT}" "Creating ${2} on ${1},\nmounting to ${3}${5}..."
fi fi
else else
if [[ "${2}" == "swap" ]]; then if [[ "${2}" == "swap" ]]; then
_dialog --no-mouse --infobox "Activating swapspace \non ${1}..." 0 0 _progress "${_COUNT}" "Activating swapspace \non ${1}..."
else else
_dialog --no-mouse --infobox "Mounting ${2} \non ${1} \nto ${3}${5}..." 0 0 _progress "${_COUNT}" "Mounting ${2} \non ${1} \nto ${3}${5}..." 0 0
fi fi
fi fi
# add btrfs raid level, if needed # add btrfs raid level, if needed

View file

@ -275,6 +275,9 @@ _autoprepare() {
else else
_FSSPECS="${_FSSPEC_ROOTDEV} ${_FSSPEC_BOOTDEV} ${_FSSPEC_HOMEDEV} ${_FSSPEC_SWAPDEV}" _FSSPECS="${_FSSPEC_ROOTDEV} ${_FSSPEC_BOOTDEV} ${_FSSPEC_HOMEDEV} ${_FSSPEC_SWAPDEV}"
fi fi
_MAX_COUNT=$(($(echo ${_FSSPECS} | wc -w)+1))
_PROGRESS_COUNT=$((100/_MAX_COUNT))
_COUNT=0
## make and mount filesystems ## make and mount filesystems
for fsspec in ${_FSSPECS}; do for fsspec in ${_FSSPECS}; do
_DEV="${_DISK}$(echo "${fsspec}" | tr -d ' ' | cut -f1 -d:)" _DEV="${_DISK}$(echo "${fsspec}" | tr -d ' ' | cut -f1 -d:)"
@ -306,8 +309,9 @@ _autoprepare() {
if [[ "${_FSTYPE}" == "btrfs" ]]; then if [[ "${_FSTYPE}" == "btrfs" ]]; then
btrfs subvolume set-default "${_DESTDIR}"/"${_MP}" || return 1 btrfs subvolume set-default "${_DESTDIR}"/"${_MP}" || return 1
fi fi
done _COUNT=$((_COUNT+_PROGRESS_COUNT))
_dialog --no-mouse --infobox "Quick Setup was successful." 3 40 done | _dialog --title " Filesystems " --no-mouse --gauge "Creating Filesystems on ${_DISK}..." 6 75 0
_dialog --title " Success " --no-mouse --infobox "Quick Setup was successful." 3 40
sleep 3 sleep 3
_S_QUICK_SETUP=1 _S_QUICK_SETUP=1
} }