|
|
|
@ -393,10 +393,99 @@ make_swap() {
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Warn users that they CAN mount partitions without formatting them!
|
|
|
|
|
DIALOG " $_PrepMntPart " --msgbox "$_WarnMount1 '$_FSSkip' $_WarnMount2" 0 0
|
|
|
|
|
|
|
|
|
|
# LVM Detection. If detected, activate.
|
|
|
|
|
lvm_detect
|
|
|
|
|
|
|
|
|
|
# Ensure partitions are unmounted (i.e. where mounted previously), and then list available partitions
|
|
|
|
|
INCLUDE_PART='part\|lvm\|crypt'
|
|
|
|
|
umount_partitions
|
|
|
|
|
find_partitions
|
|
|
|
|
|
|
|
|
|
# Identify and mount root
|
|
|
|
|
DIALOG " $_PrepMntPart " --menu "$_SelRootBody" 0 0 7 ${PARTITIONS} 2>${ANSWER} || prep_menu
|
|
|
|
|
PARTITION=$(cat ${ANSWER})
|
|
|
|
|
ROOT_PART=${PARTITION}
|
|
|
|
|
|
|
|
|
|
# Format with FS (or skip)
|
|
|
|
|
select_filesystem
|
|
|
|
|
|
|
|
|
|
# Make the directory and mount. Also identify LUKS and/or LVM
|
|
|
|
|
mount_current_partition
|
|
|
|
|
|
|
|
|
|
# Identify and create swap, if applicable
|
|
|
|
|
make_swap
|
|
|
|
|
|
|
|
|
|
# Extra Step for VFAT UEFI Partition. This cannot be in an LVM container.
|
|
|
|
|
if [[ $SYSTEM == "UEFI" ]]; then
|
|
|
|
|
DIALOG " $_PrepMntPart " --menu "$_SelUefiBody" 0 0 7 ${PARTITIONS} 2>${ANSWER} || prep_menu
|
|
|
|
|
PARTITION=$(cat ${ANSWER})
|
|
|
|
|
UEFI_PART=${PARTITION}
|
|
|
|
|
|
|
|
|
|
# If it is already a fat/vfat partition...
|
|
|
|
|
if [[ $(fsck -N $PARTITION | grep fat) ]]; then
|
|
|
|
|
DIALOG " $_PrepMntPart " --yesno "$_FormUefiBody $PARTITION $_FormUefiBody2" 0 0 && mkfs.vfat -F32 ${PARTITION} >/dev/null 2>/tmp/.errlog
|
|
|
|
|
else
|
|
|
|
|
mkfs.vfat -F32 ${PARTITION} >/dev/null 2>/tmp/.errlog
|
|
|
|
|
fi
|
|
|
|
|
check_for_error
|
|
|
|
|
|
|
|
|
|
# Inform users of the mountpoint options and consequences
|
|
|
|
|
DIALOG " $_PrepMntPart " --menu "$_MntUefiBody" 0 0 2 \
|
|
|
|
|
"/boot" "systemd-boot"\
|
|
|
|
|
"/boot/efi" "-" 2>${ANSWER}
|
|
|
|
|
|
|
|
|
|
[[ $(cat ${ANSWER}) != "" ]] && UEFI_MOUNT=$(cat ${ANSWER}) || prep_menu
|
|
|
|
|
|
|
|
|
|
mkdir -p ${MOUNTPOINT}${UEFI_MOUNT} 2>/tmp/.errlog
|
|
|
|
|
mount ${PARTITION} ${MOUNTPOINT}${UEFI_MOUNT} 2>>/tmp/.errlog
|
|
|
|
|
check_for_error
|
|
|
|
|
confirm_mount ${MOUNTPOINT}${UEFI_MOUNT}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# All other partitions
|
|
|
|
|
while [[ $NUMBER_PARTITIONS > 0 ]]; do
|
|
|
|
|
DIALOG " $_PrepMntPart " --menu "$_ExtPartBody" 0 0 7 "$_Done" $"-" ${PARTITIONS} 2>${ANSWER} || prep_menu
|
|
|
|
|
PARTITION=$(cat ${ANSWER})
|
|
|
|
|
|
|
|
|
|
if [[ $PARTITION == $_Done ]]; then
|
|
|
|
|
break;
|
|
|
|
|
else
|
|
|
|
|
MOUNT=""
|
|
|
|
|
select_filesystem
|
|
|
|
|
|
|
|
|
|
# Ask user for mountpoint. Don't give /boot as an example for UEFI systems!
|
|
|
|
|
[[ $SYSTEM == "UEFI" ]] && MNT_EXAMPLES="/home\n/var" || MNT_EXAMPLES="/boot\n/home\n/var"
|
|
|
|
|
DIALOG " $_PrepMntPart $PARTITON " --inputbox "$_ExtPartBody1$MNT_EXAMPLES\n" 0 0 "/" 2>${ANSWER} || prep_menu
|
|
|
|
|
MOUNT=$(cat ${ANSWER})
|
|
|
|
|
|
|
|
|
|
# loop while the mountpoint specified is incorrect (is only '/', is blank, or has spaces).
|
|
|
|
|
while [[ ${MOUNT:0:1} != "/" ]] || [[ ${#MOUNT} -le 1 ]] || [[ $MOUNT =~ \ |\' ]]; do
|
|
|
|
|
# Warn user about naming convention
|
|
|
|
|
DIALOG " $_ErrTitle " --msgbox "$_ExtErrBody" 0 0
|
|
|
|
|
# Ask user for mountpoint again
|
|
|
|
|
DIALOG " $_PrepMntPart $PARTITON " --inputbox "$_ExtPartBody1$MNT_EXAMPLES\n" 0 0 "/" 2>${ANSWER} || prep_menu
|
|
|
|
|
MOUNT=$(cat ${ANSWER})
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Create directory and mount.
|
|
|
|
|
mount_current_partition
|
|
|
|
|
|
|
|
|
|
# Determine if a seperate /boot is used. 0 = no seperate boot, 1 = seperate non-lvm boot,
|
|
|
|
|
# 2 = seperate lvm boot. For Grub configuration
|
|
|
|
|
if [[ $MOUNT == "/boot" ]]; then
|
|
|
|
|
[[ $(lsblk -lno TYPE ${PARTITION} | grep "lvm") != "" ]] && LVM_SEP_BOOT=2 || LVM_SEP_BOOT=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Had to write it in this way due to (bash?) bug(?), as if/then statements in a single
|
|
|
|
|
# "create LUKS" function for default and "advanced" modes were interpreted as commands,
|
|
|
|
|
# not mere string statements. Not happy with it, but it works...
|
|
|
|
|
|
|
|
|
|
luks_password() {
|
|
|
|
|
DIALOG " $_PrepLUKS " --clear --insecure --passwordbox "$_LuksPassBody" 0 0 2> ${ANSWER} || prep_menu
|
|
|
|
|
PASSWD=$(cat ${ANSWER})
|
|
|
|
|