add titles

This commit is contained in:
Tobias Powalowski 2023-07-15 12:15:44 +02:00
parent 53492ee8e2
commit 107735c6da

View file

@ -107,13 +107,14 @@ _autoprepare() {
fi
_DISK_SIZE="$((_DISK_SIZE-_UEFISYSDEV_SIZE))"
while [[ -z "${_BOOTDEV_SET}" ]]; do
_dialog --no-cancel --inputbox "Enter the size (MiB/M) of your /boot partition:\nMinimum value is 100.\n\nDisk space left: ${_DISK_SIZE}M" 11 65 "512" 2>"${_ANSWER}" || return 1
_dialog --title " /boot In MiB " --no-cancel --inputbox "Minimum value is 100. Disk space left: ${_DISK_SIZE}M" 8 65 "512" 2>"${_ANSWER}" || return 1
_BOOTDEV_SIZE="$(cat "${_ANSWER}")"
if [[ -z "${_BOOTDEV_SIZE}" ]]; then
_dialog --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0
_dialog --title " ERROR " --infobox "You have entered a invalid size, please enter again." 3 60
sleep 5
else
if [[ "${_BOOTDEV_SIZE}" -ge "${_DISK_SIZE}" || "${_BOOTDEV_SIZE}" -lt "100" || "${_BOOTDEV_SIZE}" == "${_DISK_SIZE}" ]]; then
_dialog --msgbox "ERROR: You have entered an invalid size, please enter again." 0 0
_dialog --title " ERROR " --infobox "You have entered an invalid size, please enter again." 3 60
else
_BOOTDEV_SET=1
_BOOTDEV_NUM="$((_DEV_NUM+1))"
@ -124,13 +125,15 @@ _autoprepare() {
done
else
while [[ -z "${_BOOTDEV_SET}" ]]; do
_dialog --no-cancel --inputbox "Enter the size (MiB/M) of your /boot partition:\nMinimum value is 100.\n\nDisk space left: ${_DISK_SIZE}M" 11 65 "512" 2>"${_ANSWER}" || return 1
_dialog --title " /boot In MiB "--no-cancel --inputbox "Minimum value is 100.\n\nDisk space left: ${_DISK_SIZE}M" 8 65 "512" 2>"${_ANSWER}" || return 1
_BOOTDEV_SIZE="$(cat "${_ANSWER}")"
if [[ -z "${_BOOTDEV_SIZE}" ]]; then
_dialog --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0
_dialog --title " ERROR " --infobox "You have entered a invalid size, please enter again." 3 60
sleep 5
else
if [[ "${_BOOTDEV_SIZE}" -ge "${_DISK_SIZE}" || "${_BOOTDEV_SIZE}" -lt "100" || "${_BOOTDEV_SIZE}" == "${_DISK_SIZE}" ]]; then
_dialog --msgbox "ERROR: You have entered an invalid size, please enter again." 0 0
_dialog --title " ERROR " --infobox "You have entered an invalid size, please enter again." 3 60
sleep 5
else
_BOOTDEV_SET=1
_BOOTDEV_NUM=$((_DEV_NUM+1))
@ -143,13 +146,15 @@ _autoprepare() {
_SWAP_SIZE="256"
[[ "${_DISK_SIZE}" -lt "256" ]] && _SWAP_SIZE="${_DISK_SIZE}"
while [[ -z "${_SWAPDEV_SET}" ]]; do
_dialog --no-cancel --inputbox "Enter the size (MiB/M) of your swap partition:\nMinimum value is > 0.\n\nDisk space left: ${_DISK_SIZE}M" 11 65 "${_SWAP_SIZE}" 2>"${_ANSWER}" || return 1
_dialog --title " Swap In MiB " --no-cancel --inputbox "Minimum value is > 0. Disk space left: ${_DISK_SIZE}M" 8 65 "${_SWAP_SIZE}" 2>"${_ANSWER}" || return 1
_SWAPDEV_SIZE=$(cat "${_ANSWER}")
if [[ -z "${_SWAPDEV_SIZE}" || "${_SWAPDEV_SIZE}" == 0 ]]; then
_dialog --msgbox "ERROR: You have entered an invalid size, please enter again." 0 0
_dialog --title " ERROR " --infobox "You have entered an invalid size, please enter again." 3 60
sleep 5
else
if [[ "${_SWAPDEV_SIZE}" -ge "${_DISK_SIZE}" ]]; then
_dialog --msgbox "ERROR: You have entered a too large size, please enter again." 0 0
_dialog --title " ERROR " --infobox "You have entered a too large size, please enter again." 3 60
sleep 5
else
_SWAPDEV_SET=1
_SWAPDEV_NUM="$((_DEV_NUM+1))"
@ -159,7 +164,7 @@ _autoprepare() {
done
while [[ -z "${_CHOSENFS}" ]]; do
#shellcheck disable=SC2086
_dialog --no-cancel --menu "Select a filesystem for / and /home:" 16 45 9 ${_FSOPTS} 2>"${_ANSWER}" || return 1
_dialog --title " Filesystem / and /home " --no-cancel --menu "" 15 45 9 ${_FSOPTS} 2>"${_ANSWER}" || return 1
_FSTYPE=$(cat "${_ANSWER}")
_dialog --yesno "${_FSTYPE} will be used for\n/ and /home. Is this OK?" 0 0 && _CHOSENFS=1
done
@ -169,13 +174,15 @@ _autoprepare() {
# btrfs minimum size is around 120M
[[ "${_DISK_SIZE}" -lt "7500" ]] && _ROOT_SIZE="$((_DISK_SIZE-350))"
while [[ -z "${_ROOTDEV_SET}" ]]; do
_dialog --inputbox "Enter the size (MiB/M) of your / partition:\nMinimum value is 2000.\nThe /home partition's minimum is > 350M remaining space.\n\nDisk space left: $((_DISK_SIZE-350))M" 12 65 "${_ROOT_SIZE}" 2>"${_ANSWER}" || return 1
_dialog --title " / in MiB " --inputbox "Minimum value is 2000. Disk space left: $((_DISK_SIZE-350))M" 12 65 "${_ROOT_SIZE}" 2>"${_ANSWER}" || return 1
_ROOTDEV_SIZE=$(cat "${_ANSWER}")
if [[ -z "${_ROOTDEV_SIZE}" || "${_ROOTDEV_SIZE}" == 0 || "${_ROOTDEV_SIZE}" -lt "2000" ]]; then
_dialog --msgbox "ERROR: You have entered an invalid size, please enter again." 0 0
_dialog --title " ERROR " --infobox "You have entered an invalid size, please enter again." 3 60
sleep 5
else
if [[ "${_ROOTDEV_SIZE}" -ge "${_DISK_SIZE}" || "$((_DISK_SIZE-_ROOTDEV_SIZE))" -lt "350" ]]; then
_dialog --msgbox "ERROR: You have entered a too large size, please enter again." 0 0
_dialog --title " ERROR " --infobox "You have entered a too large size, please enter again." 3 60
sleep 5
else
_dialog --yesno "$((_DISK_SIZE-_ROOTDEV_SIZE))M will be used for your /home partition. Is this OK?" 0 0 && _ROOTDEV_SET=1
fi