Clean up a few things

This commit is contained in:
natemaia 2020-03-02 22:14:19 -08:00
parent 904cd16a5b
commit 6b8d0b7e1d

View File

@ -5,15 +5,12 @@
# Some ideas and code reworked from other resources # Some ideas and code reworked from other resources
# AIF, Calamares, and the Arch Wiki.. Credit where credit is due # AIF, Calamares, and the Arch Wiki.. Credit where credit is due
# check for syntax errors VER=2.1.17
# set -n
VER=2.1.16
# default values { # default values {
: ${DIST=ArchLabs} # distro name if not set : ${DIST=ArchLabs} # distro name if not set
MNT=/mnt # installation root mountpoint : ${MNT=/mnt} # installation root mountpoint if not set
ANS=/tmp/ans # dialog answer output file ANS=/tmp/ans # dialog answer output file
FONT=ter-i16n # font used for the linux console FONT=ter-i16n # font used for the linux console
HOOKS=shutdown # additional mkinitcpio HOOKS HOOKS=shutdown # additional mkinitcpio HOOKS
@ -2135,7 +2132,8 @@ luks_pass()
until [[ $LUKS_PASS ]]; do until [[ $LUKS_PASS ]]; do
tput cnorm tput cnorm
dialog --insecure --backtitle "$DIST Installer - $SYS - v$VER" --separator $'\n' --title " $t " --mixedform "$_luksomenu" 0 0 0 \ dialog --insecure --backtitle "$DIST Installer - $SYS - v$VER" \
--separator $'\n' --title " $t " --mixedform "$_luksomenu" 0 0 0 \
"Name:" 1 1 "${ans[0]}" 1 7 "$COLUMNS" 0 0 \ "Name:" 1 1 "${ans[0]}" 1 7 "$COLUMNS" 0 0 \
"Password:" 2 1 '' 2 11 "$COLUMNS" 0 1 \ "Password:" 2 1 '' 2 11 "$COLUMNS" 0 1 \
"Password2:" 3 1 '' 3 12 "$COLUMNS" 0 1 2> "$ANS" || return 1 "Password2:" 3 1 '' 3 12 "$COLUMNS" 0 1 2> "$ANS" || return 1
@ -2188,13 +2186,14 @@ luks_basic()
errshow 0 "cryptsetup -q luksFormat '$LUKS_PART' <<< '$LUKS_PASS'" || return 1 errshow 0 "cryptsetup -q luksFormat '$LUKS_PART' <<< '$LUKS_PASS'" || return 1
cryptsetup open "$LUKS_PART" "$LUKS_NAME" <<< "$LUKS_PASS" 2> "$ERR" cryptsetup open "$LUKS_PART" "$LUKS_NAME" <<< "$LUKS_PASS" 2> "$ERR"
errshow 0 "cryptsetup open '$LUKS_PART' '$LUKS_NAME' <<< '$LUKS_PASS'" || return 1 errshow 0 "cryptsetup open '$LUKS_PART' '$LUKS_NAME' <<< '$LUKS_PASS'" || return 1
LUKS='encrypted'; luks_show LUKS='encrypted'
luks_show
return 0 return 0
} }
luks_advanced() luks_advanced()
{ {
if luks_setup; then luks_setup || return 1
local cipher local cipher
dlg cipher input "LUKS Encryption" "$_lukskey" "-s 512 -c aes-xts-plain64" dlg cipher input "LUKS Encryption" "$_lukskey" "-s 512 -c aes-xts-plain64"
[[ $cipher ]] || return 1 [[ $cipher ]] || return 1
@ -2203,10 +2202,9 @@ luks_advanced()
errshow 0 "cryptsetup -q $cipher luksFormat '$LUKS_PART' <<< '$LUKS_PASS'" || return 1 errshow 0 "cryptsetup -q $cipher luksFormat '$LUKS_PART' <<< '$LUKS_PASS'" || return 1
cryptsetup open "$LUKS_PART" "$LUKS_NAME" <<< "$LUKS_PASS" 2> "$ERR" cryptsetup open "$LUKS_PART" "$LUKS_NAME" <<< "$LUKS_PASS" 2> "$ERR"
errshow 0 "cryptsetup open '$LUKS_PART' '$LUKS_NAME' <<< '$LUKS_PASS'" || return 1 errshow 0 "cryptsetup open '$LUKS_PART' '$LUKS_NAME' <<< '$LUKS_PASS'" || return 1
LUKS='encrypted'
luks_show luks_show
return 0 return 0
fi
return 1
} }
############################################################################### ###############################################################################