Reorder main menu so show is last.

- check part counts in part_find and show error there rather than
failing later.
- message while running portions that man be slow and seem like nothing
is happening.
This commit is contained in:
natemaia 2019-10-27 17:25:06 -07:00
parent aa00f0e206
commit 09795368cc

View File

@ -8,7 +8,7 @@
# check for syntax errors # check for syntax errors
# set -n # set -n
VER=2.0.94 VER=2.0.95
# default values { # default values {
@ -190,8 +190,8 @@ main()
8 "* System configuration" \ 8 "* System configuration" \
9 "Select window manager or desktop" \ 9 "Select window manager or desktop" \
10 "Select additional packages" \ 10 "Select additional packages" \
11 "View configuration selections" \ 11 "Run a command on the installed system" \
12 "Run a command on the installed system" \ 12 "View configuration and command selections" \
13 "* Confirm choices and start the installation" 2> "$ANS" 13 "* Confirm choices and start the installation" 2> "$ANS"
read -r SEL < "$ANS" read -r SEL < "$ANS"
@ -207,8 +207,8 @@ main()
8) prechecks 2 && { select_config || (( SEL-- )); } ;; 8) prechecks 2 && { select_config || (( SEL-- )); } ;;
9) prechecks 3 && { select_sessions || (( SEL-- )); } ;; 9) prechecks 3 && { select_sessions || (( SEL-- )); } ;;
10) prechecks 3 && { select_packages || (( SEL-- )); } ;; 10) prechecks 3 && { select_packages || (( SEL-- )); } ;;
11) prechecks 3 && select_show ;; 11) prechecks 3 && select_usercmd ;;
12) prechecks 3 && select_usercmd ;; 12) prechecks 3 && select_show ;;
13) prechecks 3 && install_main ;; 13) prechecks 3 && install_main ;;
*) yesno "Exit" "\nUnmount partitions (if any) and exit the installer?\n" && die 0 *) yesno "Exit" "\nUnmount partitions (if any) and exit the installer?\n" && die 0
esac esac
@ -257,6 +257,8 @@ select_show()
Hostname: ${MYHOST:-none} Hostname: ${MYHOST:-none}
Timezone: ${ZONE:-none}/${SUBZ:-none} Timezone: ${ZONE:-none}/${SUBZ:-none}
Chroot cmd: ${USER_CMD:-none}
------------ USER CONFIGURATION --------------- ------------ USER CONFIGURATION ---------------
Username: ${NEWUSER:-none} Username: ${NEWUSER:-none}
@ -285,8 +287,8 @@ select_login()
"sddm" "Simple desktop display manager" || return 1 "sddm" "Simple desktop display manager" || return 1
case $LOGIN_TYPE in case $LOGIN_TYPE in
ly) EDIT_FILES[login]="/etc/ly/config.ini" ;;
gdm|sddm) EDIT_FILES[login]="" ;; gdm|sddm) EDIT_FILES[login]="" ;;
ly) EDIT_FILES[login]="/etc/ly/config.ini" ;;
lightdm) EDIT_FILES[login]="/etc/lightdm/lightdm.conf /etc/lightdm/lightdm-gtk-greeter.conf" ;; lightdm) EDIT_FILES[login]="/etc/lightdm/lightdm.conf /etc/lightdm/lightdm-gtk-greeter.conf" ;;
xinit) EDIT_FILES[login]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.xprofile" xinit) EDIT_FILES[login]="/home/$NEWUSER/.xinitrc /home/$NEWUSER/.xprofile"
if (( $(wc -w <<< "$INSTALL_WMS") > 1 )); then if (( $(wc -w <<< "$INSTALL_WMS") > 1 )); then
@ -574,11 +576,11 @@ part_menu()
choice="" choice=""
dlg choice menu "Edit Partitions" "$_part\n\n$(lsblk -no NAME,MODEL,SIZE,TYPE,FSTYPE $device)" \ dlg choice menu "Edit Partitions" "$_part\n\n$(lsblk -no NAME,MODEL,SIZE,TYPE,FSTYPE $device)" \
"auto" "Whole device automatic partitioning" \ "auto" "Whole device automatic partitioning" \
"shrink" "Shrink an existing ext or ntfs partition" \
"cfdisk" "Curses based variant of fdisk" \ "cfdisk" "Curses based variant of fdisk" \
"parted" "GNU partition editor" \ "parted" "GNU partition editor" \
"fdisk" "Dialog-driven creation and manipulation of partitions" \ "fdisk" "Dialog-driven creation and manipulation of partitions" \
"done" "Return to the main menu" "done" "Return to the main menu"
# "shrink" "Shrink an existing ext or ntfs partition" \
if [[ -z $choice || $choice == 'done' ]]; then if [[ -z $choice || $choice == 'done' ]]; then
return 0 return 0
@ -733,6 +735,7 @@ part_shrink()
part_find() part_find()
{ {
local regexp="$1" err='' local regexp="$1" err=''
local pts dev size isize ptcount=0
# string of partitions as /TYPE/PART SIZE.. eg. /dev/sda1 256G # string of partitions as /TYPE/PART SIZE.. eg. /dev/sda1 256G
if [[ $IGNORE_DEV ]]; then if [[ $IGNORE_DEV ]]; then
@ -743,10 +746,19 @@ part_find()
# ensure we have enough partitions for the system and action were trying to do # ensure we have enough partitions for the system and action were trying to do
COUNT=$(wc -l <<< "$PARTS") COUNT=$(wc -l <<< "$PARTS")
while read -r dev size; do # walk partition list and skip ones that are too small
[[ $dev && $size ]] || continue
size_t="${size: -1:1}"
isize=${size:0:-1}
isize=${isize%.*}
[[ $size_t == 'K' || ($size_t == 'M' && $isize -lt 100) ]] || { pts+="$dev $size "; (( ptcount++ )); }
done <<< "$PARTS"
case "$regexp" in case "$regexp" in
'part|lvm|crypt') [[ $COUNT -lt 1 || ($SYS == 'UEFI' && $COUNT -lt 2) ]] && err="$_errpart" ;; 'part|lvm|crypt') [[ $ptcount -lt 1 || ($SYS == 'UEFI' && $COUNT -lt 2) ]] && err="$_errpart" ;;
'part|crypt') (( COUNT < 1 )) && err="$_lvmerr" ;; 'part|crypt') (( ptcount < 1 )) && err="$_lvmerr" ;;
'part|lvm') (( COUNT < 2 )) && err="$_lukserr" ;; 'part|lvm') (( ptcount < 2 )) && err="$_lukserr" ;;
esac esac
if [[ $err ]]; then if [[ $err ]]; then
@ -907,6 +919,7 @@ part_mountconf()
mount_menu() mount_menu()
{ {
msg "Mount Menu" "\nGathering device and partition information.\n" 0
no_bg_install || return 0 no_bg_install || return 0
lvm_detect lvm_detect
umount_dir "$MNT" umount_dir "$MNT"
@ -1869,17 +1882,14 @@ lvm_menu()
lvm_detect() lvm_detect()
{ {
local v pv if [[ $(vgs -o vg_name --noheading 2> /dev/null) ]]; then
pv="$(pvs -o pv_name --noheading 2> /dev/null)" if [[ $(lvs -o vg_name,lv_name --noheading --separator - 2> /dev/null) && $(pvs -o pv_name --noheading 2> /dev/null) ]]; then
v="$(lvs -o vg_name,lv_name --noheading --separator - 2> /dev/null)" msg "LVM Setup" "\nActivating existing logical volume management.\n" 0
VGROUP="$(vgs -o vg_name --noheading 2> /dev/null)" modprobe dm-mod > /dev/null 2> "$ERR"
errshow 'modprobe dm-mod'
if [[ $VGROUP && $v && $pv ]]; then vgscan > /dev/null 2>&1
msg "LVM Setup" "\nActivating existing logical volume management.\n" 0 vgchange -ay > /dev/null 2>&1
modprobe dm-mod > /dev/null 2> "$ERR" fi
errshow 'modprobe dm-mod'
vgscan > /dev/null 2>&1
vgchange -ay > /dev/null 2>&1
fi fi
} }