More fixes and cleanup

This commit is contained in:
natemaia 2019-09-09 20:35:29 -07:00
parent 9dea6c7dd9
commit 9cd8276366

View File

@ -1272,7 +1272,7 @@ select_root_partition()
if (( ptcount == 1 )); then # only one available device
msg "Select Root Partition (/)" "\nOnly one partition available that meets size requirements.\n" 2
ROOT_PART="$(awk 'NR==1 {print $1}' <<< "$pts")"
ROOT_PART="$(awk 'NF > 0 {print $1}' <<< "$pts")"
else
dlg ROOT_PART menu "Mount Root" "\nSelect the root (/) partition, this is where $DIST will be installed.\n\nDevices smaller than 8G will not be shown here." $pts
fi
@ -2111,49 +2111,32 @@ luks_open()
luks_pass()
{
LUKS_PASS=''
local t="$1" op="$2" v='' p='' p2=''
local t="$1" n='' p='' p2=''
until [[ $LUKS_PASS ]]; do
i=0
local i=0
tput cnorm
if [[ $op ]]; then
dialog --insecure --backtitle "$DIST Installer - $SYS - v$VER" --separator $'\n' --title " $t " \
--mixedform "\nEnter the password to decrypt $ROOT_PART\n\nThis is needed to create a keyfile." 0 0 0 \
"Password:" 1 1 '' 1 11 "$COLUMNS" 0 1 \
"Password2:" 2 1 '' 2 12 "$COLUMNS" 0 1 2>"$ANS" || return 1
else
dialog --insecure --backtitle "$DIST Installer - $SYS - v$VER" --separator $'\n' --title " $t " --mixedform "$_luksomenu" 0 0 0 \
"Name:" 1 1 "${LUKS_NAME:-cryptroot}" 1 7 "$COLUMNS" 0 0 \
"Password:" 2 1 '' 2 11 "$COLUMNS" 0 1 \
"Password2:" 3 1 '' 3 12 "$COLUMNS" 0 1 2>"$ANS" || return 1
fi
dialog --insecure --backtitle "$DIST Installer - $SYS - v$VER" --separator $'\n' --title " $t " --mixedform "$_luksomenu" 0 0 0 \
"Name:" 1 1 "${LUKS_NAME:-cryptroot}" 1 7 "$COLUMNS" 0 0 \
"Password:" 2 1 '' 2 11 "$COLUMNS" 0 1 \
"Password2:" 3 1 '' 3 12 "$COLUMNS" 0 1 2>"$ANS" || return 1
while read -r line; do
if [[ $op ]]; then
case $i in
0) p="$line" ;;
1) p2="$line" ;;
esac
else
case $i in
0) n="$line" ;;
1) p="$line" ;;
2) p2="$line" ;;
esac
fi
case $i in
0) n="$line" ;;
1) p="$line" ;;
2) p2="$line" ;;
esac
(( i++ ))
done < "$ANS"
if [[ -z $op && -z $n ]]; then
if [[ -z $n ]]; then
msg "Name Empty" "\nEncrypted device name cannot be empty.\n\nPlease try again.\n" 2
elif [[ -z $p || "$p" != "$p2" ]]; then
[[ $op ]] || LUKS_NAME="$n"
LUKS_NAME="$n"
msg "Password Mismatch" "\nThe passwords entered do not match.\n\nPlease try again.\n" 2
else
[[ $op ]] || LUKS_NAME="$n"
LUKS_PASS="$p"
LUKS_NAME="$n" LUKS_PASS="$p"
fi
done