SEL=0 # currently selected menu item
ERR="/tmp/errlog" # error log used internally
DBG="/tmp/debuglog" # debug log when passed -d
-RUN="/run/archiso/bootmnt/arch/boot" # path for live /boot
-VM="$(dmesg | grep -i "hypervisor")" # is the system a vm
-SYS='Unknown'
+RUN="/run/archiso/bootmnt/arch/boot" # path for live system /boot
+VM="$(dmesg | grep -i "hypervisor")" # system running in a virtual machine
+SYS='Unknown' # bios type to be determined: UEFI/BIOS
-export DIALOGOPTS="--cr-wrap"
+export DIALOGOPTS="--cr-wrap" # see `man dialog`
# }
# terminal size
[[ $LINES ]] || LINES=$(tput lines)
[[ $COLUMNS ]] || COLUMNS=$(tput cols)
-SHL=$((LINES - 20))
# associative arrays
# {
part_menu()
{
- is_bg_install || return 0
+ no_bg_install || return 0
local device choice devhash
devhash="$(lsblk -f | base64)"
umount_dir $MNT
mount_menu()
{
msg "Info" "\nGathering device info.\n" 0
- is_bg_install || return 0
+ no_bg_install || return 0
lvm_detect
umount_dir $MNT
part_find 'part|lvm|crypt' || { SEL=2; return 1; }
lvm_menu()
{
msg "Info" "\nGathering device info.\n" 0
- is_bg_install || return 1
+ no_bg_install || return 1
lvm_detect
local choice
while :; do
until [[ $named ]]; do
lvm_partitions || return 1
lvm_group_name || return 1
- yesno "$_lvmnew" "\nConfirm creation of volume group: $VGROUP\n\nwith the following partition(s): $LVM_PARTS\n" && named=true
+ yesno "$_lvmnew" "\nCreate volume group: $VGROUP\n\nusing these partition(s): $LVM_PARTS\n" && named=true
done
- msg "$_lvmnew" "\nCreating group: $VGROUP\n" 0
+ msg "$_lvmnew" "\nCreating volume group: $VGROUP\n" 0
vgcreate -f "$VGROUP" $LVM_PARTS >/dev/null 2>$ERR
errshow "vgcreate -f $VGROUP $LVM_PARTS" || return 1
VGROUP_MB=$SIZE
fi
- msg "$_lvmnew" "\nVolume group: $VGROUP (${SIZE}$SIZE_UNIT) has been created\n"
+ msg "$_lvmnew" "\nVolume group $VGROUP (${SIZE}$SIZE_UNIT) successfully created\n"
}
lvm_del_all()
{
VGROUP=''
until [[ $VGROUP ]]; do
- dlg VGROUP input "$_lvmnew" "$_lvmvgname" "mygroup"
+ dlg VGROUP input "$_lvmnew" "$_lvmvgname" "lvgroup"
if [[ -z $VGROUP ]]; then
return 1
elif [[ ${VGROUP:0:1} == "/" || $VGROUP =~ \ |\' ]] || vgdisplay | grep -q "$VGROUP"; then
{
VNAME=''
local txt="$1" default="mainvolume"
- (( VOL_COUNT > 1 )) && default="extravolume$VOL_COUNT"
+ (( VOL_COUNT > 1 )) && default="extvolume$VOL_COUNT"
until [[ $VNAME ]]; do
dlg VNAME input "$_lvmnew (LV:$VOL_COUNT)" "\n$txt" "$default"
if [[ -z $VNAME ]]; then
luks_menu()
{
local choice
- is_bg_install || return 1
+ no_bg_install || return 1
dlg choice menu "LUKS Encryption" "$_luksmenu" \
"$_luksnew" "cryptsetup -q luksFormat" \
"$_luksopen" "cryptsetup open --type luks" \
local dlg_t="$2" # dialog type (menu, check, input)
local title="$3" # dialog title
local body="$4" # dialog message
- local n=0 # number of items to display
+ local n=0 # number of items to display for menu and check dialogs
shift 4 # shift off args assigned above
- # when passed a large amount of arguments (menu list) adjust menu height
- (( ($# / 2) > SHL )) && n=$SHL
+ # adjust $n when passed a large list
+ local l=$((LINES - 20))
+ (( ($# / 2) > l )) && n=$l
tput civis
case "$dlg_t" in
fi
}
-is_bg_install()
+no_bg_install()
{
[[ $RSYNC_PID || $MIRROR_PID ]] || return 0
msg "Install Running" "\nA background install process is currently running.\n" 2