This commit is contained in:
natemaia 2020-05-17 18:48:08 -07:00
parent 07af2cd556
commit 86c9388485

View File

@ -330,7 +330,7 @@ _luksomenu="\nEnter a name and password for the encrypted device.\n\nIt is not n
_lukskey="Once the specified flags have been amended, they will automatically be used with the 'cryptsetup -q luksFormat /dev/...' command.\n\nNOTE: Do not specify any additional flags such as -v (--verbose) or -y (--verify-passphrase)."
# LVM
_lvmmenu="\nLogical volume management (LVM) allows 'virtual' hard drives (volume groups) and partitions (logical volumes) to be created from existing device partitions.\n\nA volume group must be created first, then one or more logical volumes within it.\n\nLVM can also be used with an encrypted partition to create multiple logical volumes (e.g. root and home) within it."
_lvmmenu="\nLogical volume management (LVM) allows 'virtual' drives (volume groups) and partitions (logical volumes)\nto be created from existing device partitions. A volume group must be created first, then one or more logical volumes within it.\n\nLVM can also be used with a LUKS partition to create multiple logical volumes (e.g. root and home) within it."
_lvmvgname="\nEnter a name for the volume group (VG) being created from the partition(s) selected."
_lvmlvname="\nEnter a name for the logical volume (LV) being created.\n\nThis is similar to setting a label for a partition."
_lvmlvsize="\nEnter what size you want the logical volume (LV) to be in megabytes (M) or gigabytes (G).\n\ne.g. 100M will create a 100 megabyte volume, 10G will create a 10 gigabyte volume."
@ -340,11 +340,9 @@ _lvmdelask="\nConfirm deletion of volume group(s) and logical volume(s).\n\nDele
_errexpart="\nCannot mount partition due to a problem with the mountpoint.\n\nEnsure it begins with a slash (/) followed by at least one character.\n"
_errpart="\nYou need to create partition(s) first.\n\n\nBIOS systems require at least one partition (ROOT).\n\nUEFI systems require at least two (ROOT and EFI).\n"
_errchoice="\nIf you want to fix the issue yourself use Ctrl-z to pause the installer.\nFrom there you can do whatever is needed to resolve the error.\nOnce finished use the 'fg' command to resume the installer and select 'Continue'.\n"
_lukserr="\nA minimum of two partitions are required for encryption:\n\n 1. root (/) - standard or LVM.\n 2. boot (/boot) - standard (unless using LVM on BIOS systems).\n"
_lvmerr="\nThere are no viable partitions available to use for LVM, a minimum of one is required.\n\nIf LVM is already in use, deactivating it will allow the partition(s) to be used again.\n"
_lvmerrvgname="\nInvalid name entered.\n\nThe volume group name may be alpha-numeric, but may not contain spaces, start with a '/', or already be in use.\n"
_btrfserrname="\nInvalid name entered.\n\nThe subvolume name may be alpha-numeric, but may not contain spaces, start with a '/', or already be in use.\n"
_lvmerlvname="\nInvalid name entered.\n\nThe logical volume (LV) name may be alpha-numeric, but may not contain spaces or be preceded with a '/'\n"
_errvolname="\nInvalid name entered.\n\nThe volume name may be alpha-numeric, but may not contain spaces, start with a '/', or already be in use.\n"
_lukserr="\nA minimum of two partitions are required for LUKS encryption:\n\n 1. root (/) - standard or LVM.\n 2. boot (/boot) - standard (unless LVM on BIOS system).\n"
_lvmerr="\nThere are no available partitions to use for LVM, a minimum of one is required.\n\nIf LVM is already in use, deactivating it will allow the partition(s) to be used again.\n"
_lvmerrlvsize="\nInvalid value Entered.\n\nMust be a numeric value with 'M' (megabytes) or 'G' (gigabytes) at the end.\n\ne.g. 400M, 10G, 250G, etc...\n\nThe value may also not be equal to or greater than the remaining size of the volume group.\n"
# }
@ -857,7 +855,7 @@ dev_menu()
[[ $txt ]] && back="Return to mounting"
while :; do
dlg DEVMNG_OPT menu "Device Management" "\nHere you can perform some basic operations to modify system storage devices.\n$txt" \
dlg DEVMNG_OPT menu "Device Management" "\nHere you can perform some operations to modify system storage devices.\nSelect an option from the list below to get started\n$txt" \
'view' 'View the device tree output from lsblk' \
'part' 'Modify the partition layout of a device' \
'luks' 'Setup LUKS encryption on a partition or LVM' \
@ -903,7 +901,7 @@ part_menu()
'gparted -') \
'fdisk' 'Dialog-driven creation and manipulation of partitions' \
'gdisk' 'A text-mode partitioning tool that works on GUID Partition Table (GPT) disks' \
'back' 'Return to the device management menu'
'back' 'Return to the device management menu' || return 0
if [[ -z $choice || $choice == 'back' ]]; then
return 0
@ -1313,7 +1311,7 @@ select_boot()
esac
[[ $BOOT ]] || return 1
else
(( ptcount == 0 )) && return 0
(( ! ptcount )) && return 0
dlg BOOT menu "Boot Partition" "$_bios" "skip" "no separate boot" $pts
if [[ -z $BOOT || $BOOT == "skip" ]]; then
BOOT=''
@ -1452,7 +1450,7 @@ select_extra()
done <<< "$PARTS"
fi
if (( PART_COUNT == 0 )); then
if (( ! PART_COUNT )); then
msg "Mount Extra" "\nMounting Finished\n\nNo more partitions to mount, returning to main menu.\n" 2
else
while (( PART_COUNT )); do
@ -1633,7 +1631,7 @@ install_base()
mkdir -pv "$MNT/etc/default"
mkdir -pv "$MNT/etc/X11/xorg.conf.d/"
if [[ $PACSTRAP == 0 ]]; then
if (( ! PACSTRAP )); then
# remove archiso files when copying iso
rm -rf "$MNT/etc/mkinitcpio-archiso.conf"
find "$MNT/usr/lib/initcpio" -name 'archiso*' -type f -delete
@ -2462,7 +2460,7 @@ btrfs_name()
if [[ -z $SUBVOL ]]; then
return 1
elif [[ $SUBVOL =~ \ |\' || $exists == *"$SUBVOL"* ]]; then
msg "Subvolume Name Error" "$_btrfserrname"
msg "Subvolume Name Error" "$_errvolname"
SUBVOL=''
fi
done
@ -2537,10 +2535,10 @@ lvm_menu()
'create' "Create a new volume group and volumes" \
'remove' "Delete an existing volume group" \
'remove_all' "Delete ALL volume groups and volumes" \
"back" "Return to the device management menu"
"back" "Return to the device management menu"
case "$choice" in
'create') lvm_create && break ;;
'remove') lvm_delgroup && yesno "Remove Volume Group" "$_lvmdelask" && vgremove -f "$DEL_VG" > /dev/null 2>&1 ;;
'remove') lvm_del_one && yesno "Remove Volume Group" "$_lvmdelask" && vgremove -f "$DEL_VG" > /dev/null 2>&1 ;;
'remove_all') lvm_del_all ;;
*) break ;;
esac
@ -2569,7 +2567,7 @@ lvm_create()
local txt="\nThe last (or only) logical volume will automatically use all remaining space in the volume group."
dlg VOL_COUNT menu "Create Volume Group" "\nSelect the number of logical volumes (LVs) to create in: $VGROUP\n$txt" \
1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 -
1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 -
[[ $VOL_COUNT ]] || return 1
lvm_extra_lvs || return 1
@ -2595,7 +2593,7 @@ lvm_lv_size()
if [[ -z $VOLUME_SIZE ]]; then
ERR_SIZE=1
break # allow bailing with escape or an empty choice
elif (( ${VOLUME_SIZE:0:1} == 0 )); then
elif (( ! ${VOLUME_SIZE:0:1} )); then
ERR_SIZE=1 # size values can't begin with '0'
else
# walk the string and make sure all but the last char are digits
@ -2685,7 +2683,7 @@ lvm_del_all()
fi
}
lvm_delgroup()
lvm_del_one()
{
DEL_VG=''
VOL_GROUP_LIST=''
@ -2732,7 +2730,7 @@ lvm_group_name()
if [[ -z $VGROUP ]]; then
return 1
elif [[ ${VGROUP:0:1} == "/" || $VGROUP =~ \ |\' ]] || vgdisplay | grep -q "$VGROUP"; then
msg "LVM Name Error" "$_lvmerrvgname"
msg "LVM Name Error" "$_errvolname"
VGROUP=''
fi
done
@ -2748,7 +2746,7 @@ lvm_volume_name()
if [[ -z $VNAME ]]; then
return 1
elif [[ ${VNAME:0:1} == "/" || $VNAME =~ \ |\' ]] || lsblk | grep -q "$VNAME"; then
msg "LVM Name Error" "$_lvmerlvname"
msg "LVM Name Error" "$_errvolname"
VNAME=''
fi
done
@ -2904,7 +2902,7 @@ die()
trap - INT
tput cnorm
(( e == 0 )) && clear
(( ! e )) && clear
if [[ -d $MNT ]]; then
umount_dir "$MNT"
(( e == 127 )) && umount_dir /run/archiso/bootmnt && sleep 0.5 && reboot -f