rename ANSWER to _ANSWER

This commit is contained in:
Tobias Powalowski 2023-01-07 21:24:30 +01:00
parent 02f75a86ff
commit 39dfa85656
12 changed files with 156 additions and 156 deletions

View file

@ -15,8 +15,8 @@ autoprepare() {
if [[ "$(echo "${DISCS}" | wc -w)" -gt 1 ]]; then if [[ "$(echo "${DISCS}" | wc -w)" -gt 1 ]]; then
DIALOG --cr-wrap --msgbox "Available Disks:\n\n$(_getavaildisks)\n" 0 0 DIALOG --cr-wrap --msgbox "Available Disks:\n\n$(_getavaildisks)\n" 0 0
#shellcheck disable=SC2046 #shellcheck disable=SC2046
DIALOG --menu "Select the storage drive to use:" 14 55 7 $(blockdevices _) 2>"${ANSWER}" || return 1 DIALOG --menu "Select the storage drive to use:" 14 55 7 $(blockdevices _) 2>"${_ANSWER}" || return 1
DISC=$(cat "${ANSWER}") DISC=$(cat "${_ANSWER}")
else else
DISC="${DISCS}" DISC="${DISCS}"
if [[ "${DISC}" == "" ]]; then if [[ "${DISC}" == "" ]]; then
@ -45,8 +45,8 @@ autoprepare() {
set_device_name_scheme || return 1 set_device_name_scheme || return 1
fi fi
if [[ "${_GUIDPARAMETER}" == "1" ]]; then if [[ "${_GUIDPARAMETER}" == "1" ]]; then
DIALOG --inputbox "Enter the mountpoint of your UEFI SYSTEM PARTITION (Default is /boot) : " 10 60 "/boot" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the mountpoint of your UEFI SYSTEM PARTITION (Default is /boot) : " 10 60 "/boot" 2>"${_ANSWER}" || return 1
UEFISYS_MP="$(cat "${ANSWER}")" UEFISYS_MP="$(cat "${_ANSWER}")"
fi fi
if [[ "${UEFISYS_MP}" == "/boot" ]]; then if [[ "${UEFISYS_MP}" == "/boot" ]]; then
DIALOG --msgbox "You have chosen to use /boot as the UEFISYS Mountpoint. The minimum partition size is 260 MiB and only FAT32 FS is supported." 0 0 DIALOG --msgbox "You have chosen to use /boot as the UEFISYS Mountpoint. The minimum partition size is 260 MiB and only FAT32 FS is supported." 0 0
@ -73,8 +73,8 @@ autoprepare() {
if [[ "${_GUIDPARAMETER}" == "1" ]]; then if [[ "${_GUIDPARAMETER}" == "1" ]]; then
if [[ "${_UEFISYS_BOOTPART}" == "1" ]]; then if [[ "${_UEFISYS_BOOTPART}" == "1" ]]; then
while [[ "${UEFISYS_PART_SET}" == "" ]]; do while [[ "${UEFISYS_PART_SET}" == "" ]]; do
DIALOG --inputbox "Enter the size (MB) of your /boot partition,\nMinimum value is 260.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "512" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the size (MB) of your /boot partition,\nMinimum value is 260.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "512" 2>"${_ANSWER}" || return 1
UEFISYS_PART_SIZE="$(cat "${ANSWER}")" UEFISYS_PART_SIZE="$(cat "${_ANSWER}")"
if [[ "${UEFISYS_PART_SIZE}" == "" ]]; then if [[ "${UEFISYS_PART_SIZE}" == "" ]]; then
DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0 DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0
else else
@ -90,8 +90,8 @@ autoprepare() {
done done
else else
while [[ "${UEFISYS_PART_SET}" == "" ]]; do while [[ "${UEFISYS_PART_SET}" == "" ]]; do
DIALOG --inputbox "Enter the size (MB) of your UEFI SYSTEM PARTITION,\nMinimum value is 260.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "1024" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the size (MB) of your UEFI SYSTEM PARTITION,\nMinimum value is 260.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "1024" 2>"${_ANSWER}" || return 1
UEFISYS_PART_SIZE="$(cat "${ANSWER}")" UEFISYS_PART_SIZE="$(cat "${_ANSWER}")"
if [[ "${UEFISYS_PART_SIZE}" == "" ]]; then if [[ "${UEFISYS_PART_SIZE}" == "" ]]; then
DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0 DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0
else else
@ -107,8 +107,8 @@ autoprepare() {
fi fi
DISC_SIZE="$((DISC_SIZE-UEFISYS_PART_SIZE))" DISC_SIZE="$((DISC_SIZE-UEFISYS_PART_SIZE))"
while [[ "${BOOT_PART_SET}" == "" ]]; do while [[ "${BOOT_PART_SET}" == "" ]]; do
DIALOG --inputbox "Enter the size (MB) of your /boot partition,\nMinimum value is 16.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "512" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the size (MB) of your /boot partition,\nMinimum value is 16.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "512" 2>"${_ANSWER}" || return 1
BOOT_PART_SIZE="$(cat "${ANSWER}")" BOOT_PART_SIZE="$(cat "${_ANSWER}")"
if [[ "${BOOT_PART_SIZE}" == "" ]]; then if [[ "${BOOT_PART_SIZE}" == "" ]]; then
DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0 DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0
else else
@ -124,8 +124,8 @@ autoprepare() {
done done
else else
while [[ "${BOOT_PART_SET}" == "" ]]; do while [[ "${BOOT_PART_SET}" == "" ]]; do
DIALOG --inputbox "Enter the size (MB) of your /boot partition,\nMinimum value is 16.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "512" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the size (MB) of your /boot partition,\nMinimum value is 16.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "512" 2>"${_ANSWER}" || return 1
BOOT_PART_SIZE="$(cat "${ANSWER}")" BOOT_PART_SIZE="$(cat "${_ANSWER}")"
if [[ "${BOOT_PART_SIZE}" == "" ]]; then if [[ "${BOOT_PART_SIZE}" == "" ]]; then
DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0 DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0
else else
@ -143,8 +143,8 @@ autoprepare() {
SWAP_SIZE="256" SWAP_SIZE="256"
[[ "${DISC_SIZE}" -lt "256" ]] && SWAP_SIZE="${DISC_SIZE}" [[ "${DISC_SIZE}" -lt "256" ]] && SWAP_SIZE="${DISC_SIZE}"
while [[ "${SWAP_PART_SET}" == "" ]]; do while [[ "${SWAP_PART_SET}" == "" ]]; do
DIALOG --inputbox "Enter the size (MB) of your swap partition,\nMinimum value is > 0.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "${SWAP_SIZE}" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the size (MB) of your swap partition,\nMinimum value is > 0.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "${SWAP_SIZE}" 2>"${_ANSWER}" || return 1
SWAP_PART_SIZE=$(cat "${ANSWER}") SWAP_PART_SIZE=$(cat "${_ANSWER}")
if [[ "${SWAP_PART_SIZE}" == "" || "${SWAP_PART_SIZE}" == "0" ]]; then if [[ "${SWAP_PART_SIZE}" == "" || "${SWAP_PART_SIZE}" == "0" ]]; then
DIALOG --msgbox "ERROR: You have entered an invalid size, please enter again." 0 0 DIALOG --msgbox "ERROR: You have entered an invalid size, please enter again." 0 0
else else
@ -159,8 +159,8 @@ autoprepare() {
done done
while [[ "${CHOSEN_FS}" == "" ]]; do while [[ "${CHOSEN_FS}" == "" ]]; do
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select a filesystem for / and /home:" 16 45 9 ${FSOPTS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select a filesystem for / and /home:" 16 45 9 ${FSOPTS} 2>"${_ANSWER}" || return 1
FSTYPE=$(cat "${ANSWER}") FSTYPE=$(cat "${_ANSWER}")
DIALOG --yesno "${FSTYPE} will be used for / and /home. Is this OK?" 0 0 && CHOSEN_FS=1 DIALOG --yesno "${FSTYPE} will be used for / and /home. Is this OK?" 0 0 && CHOSEN_FS=1
done done
# / and /home are subvolumes on btrfs # / and /home are subvolumes on btrfs
@ -169,8 +169,8 @@ autoprepare() {
ROOT_SIZE="7500" ROOT_SIZE="7500"
[[ "${DISC_SIZE}" -lt "7500" ]] && ROOT_SIZE="${DISC_SIZE}" [[ "${DISC_SIZE}" -lt "7500" ]] && ROOT_SIZE="${DISC_SIZE}"
while [[ "${ROOT_PART_SET}" == "" ]]; do while [[ "${ROOT_PART_SET}" == "" ]]; do
DIALOG --inputbox "Enter the size (MB) of your / partition\nMinimum value is 2000,\nthe /home partition will use the remaining space.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "${ROOT_SIZE}" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the size (MB) of your / partition\nMinimum value is 2000,\nthe /home partition will use the remaining space.\n\nDisk space left: ${DISC_SIZE} MB" 10 65 "${ROOT_SIZE}" 2>"${_ANSWER}" || return 1
ROOT_PART_SIZE=$(cat "${ANSWER}") ROOT_PART_SIZE=$(cat "${_ANSWER}")
if [[ "${ROOT_PART_SIZE}" == "" || "${ROOT_PART_SIZE}" == "0" || "${ROOT_PART_SIZE}" -lt "2000" ]]; then if [[ "${ROOT_PART_SIZE}" == "" || "${ROOT_PART_SIZE}" == "0" || "${ROOT_PART_SIZE}" -lt "2000" ]]; then
DIALOG --msgbox "ERROR: You have entered an invalid size, please enter again." 0 0 DIALOG --msgbox "ERROR: You have entered an invalid size, please enter again." 0 0
else else

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# created by Tobias Powalowski <tpowa@archlinux.org> # created by Tobias Powalowski <tpowa@archlinux.org>
ANSWER="/tmp/.setup" _ANSWER="/tmp/.setup"
# use the first VT not dedicated to a running console # use the first VT not dedicated to a running console
# don't use DESTDIR=/mnt because it's intended to mount other things there! # don't use DESTDIR=/mnt because it's intended to mount other things there!
# check first if bootet in archboot # check first if bootet in archboot
@ -58,8 +58,8 @@ geteditor() {
if ! [[ "${EDITOR}" ]]; then if ! [[ "${EDITOR}" ]]; then
DIALOG --menu "Select a Text Editor to Use" 9 35 3 \ DIALOG --menu "Select a Text Editor to Use" 9 35 3 \
"1" "nano (easier)" \ "1" "nano (easier)" \
"2" "neovim" 2>${ANSWER} || return 1 "2" "neovim" 2>${_ANSWER} || return 1
case $(cat ${ANSWER}) in case $(cat ${_ANSWER}) in
"1") EDITOR="nano" ;; "1") EDITOR="nano" ;;
"2") EDITOR="nvim" ;; "2") EDITOR="nvim" ;;
esac esac
@ -96,3 +96,14 @@ set_uefi_parameters() {
fi fi
fi fi
} }
# set GUID (gpt) usage
set_guid() {
# all uefi systems should use GUID layout
if [[ "${_UEFI_BOOT}" == "0" ]]; then
## Lenovo BIOS-GPT issues - Arch Forum - https://bbs.archlinux.org/viewtopic.php?id=131149 , https://bbs.archlinux.org/viewtopic.php?id=133330 , https://bbs.archlinux.org/viewtopic.php?id=138958
## Lenovo BIOS-GPT issues - in Fedora - https://bugzilla.redhat.com/show_bug.cgi?id=735733, https://bugzilla.redhat.com/show_bug.cgi?id=749325 , http://git.fedorahosted.org/git/?p=anaconda.git;a=commit;h=ae74cebff312327ce2d9b5ac3be5dbe22e791f09
#shellcheck disable=SC2034
DIALOG --yesno "You are running in BIOS/MBR mode.\n\nDo you want to use GUID Partition Table (GPT)?\n\nIt is a standard for the layout of the partition table on a physical storage disk. Although it forms a part of the Unified Extensible Firmware Interface (UEFI) standard, it is also used on some BIOS systems because of the limitations of MBR aka msdos partition tables, which restrict maximum disk size to 2 TiB.\n\nWindows 10 and later versions include the capability to use GPT for non-boot aka data disks (only UEFI systems can boot Windows 10 and later from GPT disks).\n\nAttention:\n- Please check if your other operating systems have GPT support!\n- Use this option for a GRUB(2) setup, which should support LVM, RAID\n etc., which doesn't fit into the usual 30k MS-DOS post-MBR gap.\n- BIOS-GPT boot may not work in some Lenovo systems (irrespective of the\n bootloader used). " 0 0 && _GUIDPARAMETER="1"
fi
}

View file

@ -327,8 +327,8 @@ set_device_name_scheme() {
fi fi
NAME_SCHEME_LEVELS="${NAME_SCHEME_LEVELS} FSUUID UUID=<uuid> FSLABEL LABEL=<label> KERNEL /dev/<kernelname>" NAME_SCHEME_LEVELS="${NAME_SCHEME_LEVELS} FSUUID UUID=<uuid> FSLABEL LABEL=<label> KERNEL /dev/<kernelname>"
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select the device name scheme you want to use in config files. ${MENU_DESC_TEXT} FSUUID is recommended." 15 70 9 ${NAME_SCHEME_LEVELS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select the device name scheme you want to use in config files. ${MENU_DESC_TEXT} FSUUID is recommended." 15 70 9 ${NAME_SCHEME_LEVELS} 2>"${_ANSWER}" || return 1
NAME_SCHEME_PARAMETER=$(cat "${ANSWER}") NAME_SCHEME_PARAMETER=$(cat "${_ANSWER}")
NAME_SCHEME_PARAMETER_RUN="1" NAME_SCHEME_PARAMETER_RUN="1"
} }
@ -578,8 +578,8 @@ _raid()
# enter raid device name # enter raid device name
RAIDDEVICE="" RAIDDEVICE=""
while [[ "${RAIDDEVICE}" == "" ]]; do while [[ "${RAIDDEVICE}" == "" ]]; do
DIALOG --inputbox "Enter the node name for the raiddevice:\n/dev/md[number]\n/dev/md0\n/dev/md1\n\n" 12 50 "/dev/md0" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the node name for the raiddevice:\n/dev/md[number]\n/dev/md0\n/dev/md1\n\n" 12 50 "/dev/md0" 2>"${_ANSWER}" || return 1
RAIDDEVICE=$(cat "${ANSWER}") RAIDDEVICE=$(cat "${_ANSWER}")
if grep -q "^${RAIDDEVICE//\/dev\//}" /proc/mdstat; then if grep -q "^${RAIDDEVICE//\/dev\//}" /proc/mdstat; then
DIALOG --msgbox "ERROR: You have defined 2 identical node names! Please enter another name." 8 65 DIALOG --msgbox "ERROR: You have defined 2 identical node names! Please enter another name." 8 65
RAIDDEVICE="" RAIDDEVICE=""
@ -587,23 +587,23 @@ _raid()
done done
RAIDLEVELS="linear - raid0 - raid1 - raid4 - raid5 - raid6 - raid10 -" RAIDLEVELS="linear - raid0 - raid1 - raid4 - raid5 - raid6 - raid10 -"
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select the raid level you want to use:" 14 50 7 ${RAIDLEVELS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select the raid level you want to use:" 14 50 7 ${RAIDLEVELS} 2>"${_ANSWER}" || return 1
LEVEL=$(cat "${ANSWER}") LEVEL=$(cat "${_ANSWER}")
# raid5 and raid10 support parity parameter # raid5 and raid10 support parity parameter
PARITY="" PARITY=""
if [[ "${LEVEL}" == "raid5" || "${LEVEL}" == "raid6" || "${LEVEL}" == "raid10" ]]; then if [[ "${LEVEL}" == "raid5" || "${LEVEL}" == "raid6" || "${LEVEL}" == "raid10" ]]; then
PARITYLEVELS="left-asymmetric - left-symmetric - right-asymmetric - right-symmetric -" PARITYLEVELS="left-asymmetric - left-symmetric - right-asymmetric - right-symmetric -"
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select the parity layout you want to use (default is left-symmetric):" 21 50 13 ${PARITYLEVELS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select the parity layout you want to use (default is left-symmetric):" 21 50 13 ${PARITYLEVELS} 2>"${_ANSWER}" || return 1
PARITY=$(cat "${ANSWER}") PARITY=$(cat "${_ANSWER}")
fi fi
# show all devices with sizes # show all devices with sizes
DIALOG --cr-wrap --msgbox "DISKS:\n$(_getavaildisks)\n\nPARTITIONS:\n$(_getavailpartitions)" 0 0 DIALOG --cr-wrap --msgbox "DISKS:\n$(_getavaildisks)\n\nPARTITIONS:\n$(_getavailpartitions)" 0 0
# select the first device to use, no missing option available! # select the first device to use, no missing option available!
RAIDNUMBER=1 RAIDNUMBER=1
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select device ${RAIDNUMBER}:" 21 50 13 ${PARTS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select device ${RAIDNUMBER}:" 21 50 13 ${PARTS} 2>"${_ANSWER}" || return 1
PART=$(cat "${ANSWER}") PART=$(cat "${_ANSWER}")
echo "${PART}" >>/tmp/.raid echo "${PART}" >>/tmp/.raid
while [[ "${PART}" != "DONE" ]]; do while [[ "${PART}" != "DONE" ]]; do
RAIDNUMBER=$((RAIDNUMBER + 1)) RAIDNUMBER=$((RAIDNUMBER + 1))
@ -613,8 +613,8 @@ _raid()
! [[ "${LEVEL}" == "raid0" || "${LEVEL}" == "linear" ]] && MDEXTRA="MISSING _" ! [[ "${LEVEL}" == "raid0" || "${LEVEL}" == "linear" ]] && MDEXTRA="MISSING _"
# add more devices # add more devices
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select additional device ${RAIDNUMBER}:" 21 50 13 ${PARTS} ${MDEXTRA} DONE _ 2>"${ANSWER}" || return 1 DIALOG --menu "Select additional device ${RAIDNUMBER}:" 21 50 13 ${PARTS} ${MDEXTRA} DONE _ 2>"${_ANSWER}" || return 1
PART=$(cat "${ANSWER}") PART=$(cat "${_ANSWER}")
SPARE="" SPARE=""
! [[ "${LEVEL}" == "raid0" || "${LEVEL}" == "linear" ]] && DIALOG --yesno --defaultno "Would you like to use ${PART} as spare device?" 0 0 && SPARE="1" ! [[ "${LEVEL}" == "raid0" || "${LEVEL}" == "linear" ]] && DIALOG --yesno --defaultno "Would you like to use ${PART} as spare device?" 0 0 && SPARE="1"
[[ "${PART}" == "DONE" ]] && break [[ "${PART}" == "DONE" ]] && break
@ -724,8 +724,8 @@ _createpv()
# select the first device to use # select the first device to use
DEVNUMBER=1 DEVNUMBER=1
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select device number ${DEVNUMBER} for physical volume:" 15 50 12 ${PARTS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select device number ${DEVNUMBER} for physical volume:" 15 50 12 ${PARTS} 2>"${_ANSWER}" || return 1
PART=$(cat "${ANSWER}") PART=$(cat "${_ANSWER}")
echo "${PART}" >>/tmp/.pvs-create echo "${PART}" >>/tmp/.pvs-create
while [[ "${PART}" != "DONE" ]]; do while [[ "${PART}" != "DONE" ]]; do
DEVNUMBER="$((DEVNUMBER + 1))" DEVNUMBER="$((DEVNUMBER + 1))"
@ -733,8 +733,8 @@ _createpv()
PARTS="${PARTS//${PART}\ _/}" PARTS="${PARTS//${PART}\ _/}"
# add more devices # add more devices
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select additional device number ${DEVNUMBER} for physical volume:" 15 60 12 ${PARTS} DONE _ 2>"${ANSWER}" || return 1 DIALOG --menu "Select additional device number ${DEVNUMBER} for physical volume:" 15 60 12 ${PARTS} DONE _ 2>"${_ANSWER}" || return 1
PART=$(cat "${ANSWER}") PART=$(cat "${_ANSWER}")
[[ "${PART}" == "DONE" ]] && break [[ "${PART}" == "DONE" ]] && break
echo "${PART}" >>/tmp/.pvs-create echo "${PART}" >>/tmp/.pvs-create
done done
@ -824,8 +824,8 @@ _createvg()
# enter volume group name # enter volume group name
VGDEVICE="" VGDEVICE=""
while [[ "${VGDEVICE}" == "" ]]; do while [[ "${VGDEVICE}" == "" ]]; do
DIALOG --inputbox "Enter the Volume Group name:\nfoogroup\n<yourvolumegroupname>\n\n" 11 40 "foogroup" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the Volume Group name:\nfoogroup\n<yourvolumegroupname>\n\n" 11 40 "foogroup" 2>"${_ANSWER}" || return 1
VGDEVICE=$(cat "${ANSWER}") VGDEVICE=$(cat "${_ANSWER}")
if vgs -o vg_name --noheading 2>/dev/null | grep -q "^ ${VGDEVICE}"; then if vgs -o vg_name --noheading 2>/dev/null | grep -q "^ ${VGDEVICE}"; then
DIALOG --msgbox "ERROR: You have defined 2 identical Volume Group names! Please enter another name." 8 65 DIALOG --msgbox "ERROR: You have defined 2 identical Volume Group names! Please enter another name." 8 65
VGDEVICE="" VGDEVICE=""
@ -837,8 +837,8 @@ _createvg()
# select the first device to use, no missing option available! # select the first device to use, no missing option available!
PVNUMBER=1 PVNUMBER=1
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select Physical Volume ${PVNUMBER} for ${VGDEVICE}:" 13 50 10 ${PVS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select Physical Volume ${PVNUMBER} for ${VGDEVICE}:" 13 50 10 ${PVS} 2>"${_ANSWER}" || return 1
PV=$(cat "${ANSWER}") PV=$(cat "${_ANSWER}")
echo "${PV}" >>/tmp/.pvs echo "${PV}" >>/tmp/.pvs
while [[ "${PVS}" != "DONE" ]]; do while [[ "${PVS}" != "DONE" ]]; do
PVNUMBER=$((PVNUMBER + 1)) PVNUMBER=$((PVNUMBER + 1))
@ -847,8 +847,8 @@ _createvg()
PVS="$(echo ${PVS} | sed -e "s#${PV} _##g")" PVS="$(echo ${PVS} | sed -e "s#${PV} _##g")"
# add more devices # add more devices
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select additional Physical Volume ${PVNUMBER} for ${VGDEVICE}:" 13 50 10 ${PVS} DONE _ 2>"${ANSWER}" || return 1 DIALOG --menu "Select additional Physical Volume ${PVNUMBER} for ${VGDEVICE}:" 13 50 10 ${PVS} DONE _ 2>"${_ANSWER}" || return 1
PV=$(cat "${ANSWER}") PV=$(cat "${_ANSWER}")
[[ "${PV}" == "DONE" ]] && break [[ "${PV}" == "DONE" ]] && break
echo "${PV}" >>/tmp/.pvs echo "${PV}" >>/tmp/.pvs
done done
@ -884,13 +884,13 @@ _createlv()
# show all devices with sizes, which are not 100% in use! # show all devices with sizes, which are not 100% in use!
DIALOG --cr-wrap --msgbox "Volume Groups:\n$(getavailablevg)" 0 0 DIALOG --cr-wrap --msgbox "Volume Groups:\n$(getavailablevg)" 0 0
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select Volume Group:" 11 50 5 ${LVS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select Volume Group:" 11 50 5 ${LVS} 2>"${_ANSWER}" || return 1
LV=$(cat "${ANSWER}") LV=$(cat "${_ANSWER}")
# enter logical volume name # enter logical volume name
LVDEVICE="" LVDEVICE=""
while [[ "${LVDEVICE}" == "" ]]; do while [[ "${LVDEVICE}" == "" ]]; do
DIALOG --inputbox "Enter the Logical Volume name:\nfooname\n<yourvolumename>\n\n" 10 65 "fooname" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the Logical Volume name:\nfooname\n<yourvolumename>\n\n" 10 65 "fooname" 2>"${_ANSWER}" || return 1
LVDEVICE=$(cat "${ANSWER}") LVDEVICE=$(cat "${_ANSWER}")
if lvs -o lv_name,vg_name --noheading 2>/dev/null | grep -q " ${LVDEVICE} ${LV}$"; then if lvs -o lv_name,vg_name --noheading 2>/dev/null | grep -q " ${LVDEVICE} ${LV}$"; then
DIALOG --msgbox "ERROR: You have defined 2 identical Logical Volume names! Please enter another name." 8 65 DIALOG --msgbox "ERROR: You have defined 2 identical Logical Volume names! Please enter another name." 8 65
LVDEVICE="" LVDEVICE=""
@ -898,8 +898,8 @@ _createlv()
done done
while [[ "${LV_SIZE_SET}" == "" ]]; do while [[ "${LV_SIZE_SET}" == "" ]]; do
LV_ALL="" LV_ALL=""
DIALOG --inputbox "Enter the size (MB) of your Logical Volume,\nMinimum value is > 0.\n\nVolume space left: $(vgs -o vg_free --noheading --units m "${LV}")B\n\nIf you enter no value, all free space left will be used." 10 65 "" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the size (MB) of your Logical Volume,\nMinimum value is > 0.\n\nVolume space left: $(vgs -o vg_free --noheading --units m "${LV}")B\n\nIf you enter no value, all free space left will be used." 10 65 "" 2>"${_ANSWER}" || return 1
LV_SIZE=$(cat "${ANSWER}") LV_SIZE=$(cat "${_ANSWER}")
if [[ "${LV_SIZE}" == "" ]]; then if [[ "${LV_SIZE}" == "" ]]; then
DIALOG --yesno "Would you like to create Logical Volume with no free space left?" 0 0 && LV_ALL="1" DIALOG --yesno "Would you like to create Logical Volume with no free space left?" 0 0 && LV_ALL="1"
if ! [[ "${LV_ALL}" == "1" ]]; then if ! [[ "${LV_ALL}" == "1" ]]; then
@ -956,8 +956,8 @@ _createlv()
_enter_luks_name() { _enter_luks_name() {
LUKSDEVICE="" LUKSDEVICE=""
while [[ "${LUKSDEVICE}" == "" ]]; do while [[ "${LUKSDEVICE}" == "" ]]; do
DIALOG --inputbox "Enter the name for luks encrypted device ${PART}:\nfooname\n<yourname>\n\n" 10 65 "fooname" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the name for luks encrypted device ${PART}:\nfooname\n<yourname>\n\n" 10 65 "fooname" 2>"${_ANSWER}" || return 1
LUKSDEVICE=$(cat "${ANSWER}") LUKSDEVICE=$(cat "${_ANSWER}")
if ! cryptsetup status "${LUKSDEVICE}" | grep -q inactive; then if ! cryptsetup status "${LUKSDEVICE}" | grep -q inactive; then
DIALOG --msgbox "ERROR: You have defined 2 identical luks encryption device names! Please enter another name." 8 65 DIALOG --msgbox "ERROR: You have defined 2 identical luks encryption device names! Please enter another name." 8 65
LUKSDEVICE="" LUKSDEVICE=""
@ -969,10 +969,10 @@ _enter_luks_name() {
_enter_luks_passphrase () { _enter_luks_passphrase () {
LUKSPASSPHRASE="" LUKSPASSPHRASE=""
while [[ "${LUKSPASSPHRASE}" == "" ]]; do while [[ "${LUKSPASSPHRASE}" == "" ]]; do
DIALOG --insecure --passwordbox "Enter passphrase for luks encrypted device ${PART}:" 0 0 2>"${ANSWER}" || return 1 DIALOG --insecure --passwordbox "Enter passphrase for luks encrypted device ${PART}:" 0 0 2>"${_ANSWER}" || return 1
LUKSPASS=$(cat "${ANSWER}") LUKSPASS=$(cat "${_ANSWER}")
DIALOG --insecure --passwordbox "Retype passphrase for luks encrypted device ${PART}:" 0 0 2>"${ANSWER}" || return 1 DIALOG --insecure --passwordbox "Retype passphrase for luks encrypted device ${PART}:" 0 0 2>"${_ANSWER}" || return 1
LUKSPASS2=$(cat "${ANSWER}") LUKSPASS2=$(cat "${_ANSWER}")
if [[ -n "${LUKSPASS}" && -n "${LUKSPASS2}" && "${LUKSPASS}" == "${LUKSPASS2}" ]]; then if [[ -n "${LUKSPASS}" && -n "${LUKSPASS2}" && "${LUKSPASS}" == "${LUKSPASS2}" ]]; then
LUKSPASSPHRASE=${LUKSPASS} LUKSPASSPHRASE=${LUKSPASS}
echo "${LUKSPASSPHRASE}" > "/tmp/passphrase-${LUKSDEVICE}" echo "${LUKSPASSPHRASE}" > "/tmp/passphrase-${LUKSDEVICE}"
@ -1044,8 +1044,8 @@ _luks()
# show all devices with sizes # show all devices with sizes
DIALOG --cr-wrap --msgbox "DISKS:\n$(_getavaildisks)\n\nPARTITIONS:\n$(_getavailpartitions)\n\n" 0 0 DIALOG --cr-wrap --msgbox "DISKS:\n$(_getavaildisks)\n\nPARTITIONS:\n$(_getavailpartitions)\n\n" 0 0
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select device for luks encryption:" 15 50 12 ${PARTS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select device for luks encryption:" 15 50 12 ${PARTS} 2>"${_ANSWER}" || return 1
PART=$(cat "${ANSWER}") PART=$(cat "${_ANSWER}")
# enter luks name # enter luks name
_enter_luks_name || return 1 _enter_luks_name || return 1
### TODO: offer more options for encrypt! ### TODO: offer more options for encrypt!

View file

@ -232,15 +232,15 @@ do_secureboot_keys() {
MOK_PW="" MOK_PW=""
KEYDIR="" KEYDIR=""
while [[ "${KEYDIR}" == "" ]]; do while [[ "${KEYDIR}" == "" ]]; do
DIALOG --inputbox "Setup keys:\nEnter the directory to store the keys on ${DESTDIR}." 9 65 "/etc/secureboot/keys" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Setup keys:\nEnter the directory to store the keys on ${DESTDIR}." 9 65 "/etc/secureboot/keys" 2>"${_ANSWER}" || return 1
KEYDIR=$(cat "${ANSWER}") KEYDIR=$(cat "${_ANSWER}")
#shellcheck disable=SC2086,SC2001 #shellcheck disable=SC2086,SC2001
KEYDIR="$(echo ${KEYDIR} | sed -e 's#^/##g')" KEYDIR="$(echo ${KEYDIR} | sed -e 's#^/##g')"
done done
if [[ ! -d "${DESTDIR}/${KEYDIR}" ]]; then if [[ ! -d "${DESTDIR}/${KEYDIR}" ]]; then
while [[ "${CN}" == "" ]]; do while [[ "${CN}" == "" ]]; do
DIALOG --inputbox "Setup keys:\nEnter a common name(CN) for your keys, eg. Your Name" 8 65 "" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Setup keys:\nEnter a common name(CN) for your keys, eg. Your Name" 8 65 "" 2>"${_ANSWER}" || return 1
CN=$(cat "${ANSWER}") CN=$(cat "${_ANSWER}")
done done
secureboot-keys.sh -name="${CN}" "${DESTDIR}/${KEYDIR}" > "${LOG}" 2>&1 || return 1 secureboot-keys.sh -name="${CN}" "${DESTDIR}/${KEYDIR}" > "${LOG}" 2>&1 || return 1
DIALOG --infobox "Setup keys created:\n\nCommon name(CN) ${CN}\nused for your keys in ${DESTDIR}/${KEYDIR}\n\nContinuing in 10 seconds ..." 8 60 DIALOG --infobox "Setup keys created:\n\nCommon name(CN) ${CN}\nused for your keys in ${DESTDIR}/${KEYDIR}\n\nContinuing in 10 seconds ..." 8 60
@ -258,10 +258,10 @@ do_mok_sign () {
DIALOG --yesno "Do you want to install the MOK certificate to the UEFI keys?" 5 65 && INSTALL_MOK="1" DIALOG --yesno "Do you want to install the MOK certificate to the UEFI keys?" 5 65 && INSTALL_MOK="1"
if [[ "${INSTALL_MOK}" == "1" ]]; then if [[ "${INSTALL_MOK}" == "1" ]]; then
while [[ "${MOK_PW}" == "" ]]; do while [[ "${MOK_PW}" == "" ]]; do
DIALOG --insecure --passwordbox "Enter a one time MOK password for SHIM on reboot:" 8 65 2>"${ANSWER}" || return 1 DIALOG --insecure --passwordbox "Enter a one time MOK password for SHIM on reboot:" 8 65 2>"${_ANSWER}" || return 1
PASS=$(cat "${ANSWER}") PASS=$(cat "${_ANSWER}")
DIALOG --insecure --passwordbox "Retype one time MOK password:" 8 65 2>"${ANSWER}" || return 1 DIALOG --insecure --passwordbox "Retype one time MOK password:" 8 65 2>"${_ANSWER}" || return 1
PASS2=$(cat "${ANSWER}") PASS2=$(cat "${_ANSWER}")
if [[ "${PASS}" == "${PASS2}" && -n "${PASS}" ]]; then if [[ "${PASS}" == "${PASS2}" && -n "${PASS}" ]]; then
MOK_PW=${PASS} MOK_PW=${PASS}
echo "${MOK_PW}" > /tmp/.password echo "${MOK_PW}" > /tmp/.password
@ -423,8 +423,8 @@ do_efistub_uefi() {
else else
DIALOG --menu "Select which UEFI Boot Manager to install, to provide a menu for the EFISTUB kernels?" 10 55 2 \ DIALOG --menu "Select which UEFI Boot Manager to install, to provide a menu for the EFISTUB kernels?" 10 55 2 \
"SYSTEMD-BOOT" "SYSTEMD-BOOT for ${_UEFI_ARCH} UEFI" \ "SYSTEMD-BOOT" "SYSTEMD-BOOT for ${_UEFI_ARCH} UEFI" \
"rEFInd" "rEFInd for ${_UEFI_ARCH} UEFI" 2>"${ANSWER}" "rEFInd" "rEFInd for ${_UEFI_ARCH} UEFI" 2>"${_ANSWER}"
case $(cat "${ANSWER}") in case $(cat "${_ANSWER}") in
"SYSTEMD-BOOT") do_systemd_boot_uefi ;; "SYSTEMD-BOOT") do_systemd_boot_uefi ;;
"rEFInd") do_refind_uefi ;; "rEFInd") do_refind_uefi ;;
esac esac
@ -812,8 +812,8 @@ do_grub_bios() {
return 1 return 1
fi fi
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select the boot device where the GRUB(2) bootloader will be installed." 14 55 7 ${DEVS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select the boot device where the GRUB(2) bootloader will be installed." 14 55 7 ${DEVS} 2>"${_ANSWER}" || return 1
bootdev=$(cat "${ANSWER}") bootdev=$(cat "${_ANSWER}")
if [[ "$(${_BLKID} -p -i -o value -s PTTYPE "${bootdev}")" == "gpt" ]]; then if [[ "$(${_BLKID} -p -i -o value -s PTTYPE "${bootdev}")" == "gpt" ]]; then
CHECK_BIOS_BOOT_GRUB="1" CHECK_BIOS_BOOT_GRUB="1"
CHECK_UEFISYS_PART="" CHECK_UEFISYS_PART=""
@ -948,8 +948,8 @@ install_bootloader_uefi() {
else else
DIALOG --menu "Which ${_UEFI_ARCH} UEFI bootloader would you like to use?" 9 55 3 \ DIALOG --menu "Which ${_UEFI_ARCH} UEFI bootloader would you like to use?" 9 55 3 \
"${_EFISTUB_MENU_LABEL}" "${_EFISTUB_MENU_TEXT}" \ "${_EFISTUB_MENU_LABEL}" "${_EFISTUB_MENU_TEXT}" \
"GRUB_UEFI" "GRUB(2) for ${_UEFI_ARCH} UEFI" 2>"${ANSWER}" "GRUB_UEFI" "GRUB(2) for ${_UEFI_ARCH} UEFI" 2>"${_ANSWER}"
case $(cat "${ANSWER}") in case $(cat "${_ANSWER}") in
"EFISTUB") do_efistub_uefi "EFISTUB") do_efistub_uefi
[[ -z "${S_BOOTLOADER}" ]] || do_efistub_copy_to_efisys [[ -z "${S_BOOTLOADER}" ]] || do_efistub_copy_to_efisys
;; ;;

View file

@ -114,8 +114,8 @@ btrfs_raid_level() {
DIALOG --msgbox "BTRFS DATA RAID OPTIONS:\n\nRAID5/6 are for testing purpose. Use with extreme care!\n\nIf you don't need this feature select NONE." 0 0 DIALOG --msgbox "BTRFS DATA RAID OPTIONS:\n\nRAID5/6 are for testing purpose. Use with extreme care!\n\nIf you don't need this feature select NONE." 0 0
while [[ "${BTRFS_RAID_FINISH}" != "DONE" ]]; do while [[ "${BTRFS_RAID_FINISH}" != "DONE" ]]; do
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select the raid data level you want to use:" 14 50 10 ${BTRFS_RAIDLEVELS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select the raid data level you want to use:" 14 50 10 ${BTRFS_RAIDLEVELS} 2>"${_ANSWER}" || return 1
BTRFS_LEVEL=$(cat "${ANSWER}") BTRFS_LEVEL=$(cat "${_ANSWER}")
if [[ "${BTRFS_LEVEL}" == "NONE" ]]; then if [[ "${BTRFS_LEVEL}" == "NONE" ]]; then
echo "${BTRFS_DEVICE}" >>/tmp/.btrfs-devices echo "${BTRFS_DEVICE}" >>/tmp/.btrfs-devices
break break
@ -135,8 +135,8 @@ select_btrfs_raid_devices () {
BTRFS_PARTS=$(echo ${PARTS} | sed -e "s#${BTRFS_DEVICE}\ _##g") BTRFS_PARTS=$(echo ${PARTS} | sed -e "s#${BTRFS_DEVICE}\ _##g")
RAIDNUMBER=2 RAIDNUMBER=2
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select device ${RAIDNUMBER}:" 13 50 10 ${BTRFS_PARTS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select device ${RAIDNUMBER}:" 13 50 10 ${BTRFS_PARTS} 2>"${_ANSWER}" || return 1
BTRFS_PART=$(cat "${ANSWER}") BTRFS_PART=$(cat "${_ANSWER}")
echo "${BTRFS_PART}" >>/tmp/.btrfs-devices echo "${BTRFS_PART}" >>/tmp/.btrfs-devices
while [[ "${BTRFS_PART}" != "DONE" ]]; do while [[ "${BTRFS_PART}" != "DONE" ]]; do
BTRFS_DONE="" BTRFS_DONE=""
@ -151,8 +151,8 @@ select_btrfs_raid_devices () {
BTRFS_PARTS=$(echo ${BTRFS_PARTS} | sed -e "s#${BTRFS_PART}\ _##g") BTRFS_PARTS=$(echo ${BTRFS_PARTS} | sed -e "s#${BTRFS_PART}\ _##g")
# add more devices # add more devices
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select device ${RAIDNUMBER}:" 13 50 10 ${BTRFS_PARTS} ${BTRFS_DONE} 2>"${ANSWER}" || return 1 DIALOG --menu "Select device ${RAIDNUMBER}:" 13 50 10 ${BTRFS_PARTS} ${BTRFS_DONE} 2>"${_ANSWER}" || return 1
BTRFS_PART=$(cat "${ANSWER}") BTRFS_PART=$(cat "${_ANSWER}")
[[ "${BTRFS_PART}" == "DONE" ]] && break [[ "${BTRFS_PART}" == "DONE" ]] && break
echo "${BTRFS_PART}" >>/tmp/.btrfs-devices echo "${BTRFS_PART}" >>/tmp/.btrfs-devices
done done
@ -179,8 +179,8 @@ prepare_btrfs_subvolume() {
if [[ "${DOSUBVOLUME}" == "yes" ]]; then if [[ "${DOSUBVOLUME}" == "yes" ]]; then
BTRFS_SUBVOLUME="NONE" BTRFS_SUBVOLUME="NONE"
while [[ "${BTRFS_SUBVOLUME}" == "NONE" ]]; do while [[ "${BTRFS_SUBVOLUME}" == "NONE" ]]; do
DIALOG --inputbox "Enter the SUBVOLUME name for the device, keep it short\nand use no spaces or special\ncharacters." 10 65 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the SUBVOLUME name for the device, keep it short\nand use no spaces or special\ncharacters." 10 65 2>"${_ANSWER}" || return 1
BTRFS_SUBVOLUME=$(cat "${ANSWER}") BTRFS_SUBVOLUME=$(cat "${_ANSWER}")
check_btrfs_subvolume check_btrfs_subvolume
done done
else else
@ -233,8 +233,8 @@ choose_btrfs_subvolume () {
done done
if [[ -n "${SUBVOLUMES}" ]]; then if [[ -n "${SUBVOLUMES}" ]]; then
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select the subvolume to mount:" 15 50 13 ${SUBVOLUMES} 2>"${ANSWER}" || return 1 DIALOG --menu "Select the subvolume to mount:" 15 50 13 ${SUBVOLUMES} 2>"${_ANSWER}" || return 1
BTRFS_SUBVOLUME=$(cat "${ANSWER}") BTRFS_SUBVOLUME=$(cat "${_ANSWER}")
else else
if [[ "${SUBVOLUMES_DETECTED}" == "yes" ]]; then if [[ "${SUBVOLUMES_DETECTED}" == "yes" ]]; then
DIALOG --msgbox "ERROR: All subvolumes of the device are already in use. Switching to create a new one now." 8 65 DIALOG --msgbox "ERROR: All subvolumes of the device are already in use. Switching to create a new one now." 8 65
@ -275,7 +275,7 @@ btrfs_compress() {
fi fi
if [[ "${BTRFS_COMPRESS}" == "compress" ]]; then if [[ "${BTRFS_COMPRESS}" == "compress" ]]; then
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select the compression method you want to use:" 10 50 8 ${BTRFS_COMPRESSLEVELS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select the compression method you want to use:" 10 50 8 ${BTRFS_COMPRESSLEVELS} 2>"${_ANSWER}" || return 1
BTRFS_COMPRESS="compress=$(cat "${ANSWER}")" BTRFS_COMPRESS="compress=$(cat "${_ANSWER}")"
fi fi
} }

View file

@ -152,14 +152,3 @@ locale_gen() {
locale-gen >/dev/null 2>&1 locale-gen >/dev/null 2>&1
fi fi
} }
# set GUID (gpt) usage
set_guid() {
# all uefi systems should use GUID layout
if [[ "${_UEFI_BOOT}" == "0" ]]; then
## Lenovo BIOS-GPT issues - Arch Forum - https://bbs.archlinux.org/viewtopic.php?id=131149 , https://bbs.archlinux.org/viewtopic.php?id=133330 , https://bbs.archlinux.org/viewtopic.php?id=138958
## Lenovo BIOS-GPT issues - in Fedora - https://bugzilla.redhat.com/show_bug.cgi?id=735733, https://bugzilla.redhat.com/show_bug.cgi?id=749325 , http://git.fedorahosted.org/git/?p=anaconda.git;a=commit;h=ae74cebff312327ce2d9b5ac3be5dbe22e791f09
#shellcheck disable=SC2034
DIALOG --yesno "You are running in BIOS/MBR mode.\n\nDo you want to use GUID Partition Table (GPT)?\n\nIt is a standard for the layout of the partition table on a physical storage disk. Although it forms a part of the Unified Extensible Firmware Interface (UEFI) standard, it is also used on some BIOS systems because of the limitations of MBR aka msdos partition tables, which restrict maximum disk size to 2 TiB.\n\nWindows 10 and later versions include the capability to use GPT for non-boot aka data disks (only UEFI systems can boot Windows 10 and later from GPT disks).\n\nAttention:\n- Please check if your other operating systems have GPT support!\n- Use this option for a GRUB(2) setup, which should support LVM, RAID\n etc., which doesn't fit into the usual 30k MS-DOS post-MBR gap.\n- BIOS-GPT boot may not work in some Lenovo systems (irrespective of the\n bootloader used). " 0 0 && _GUIDPARAMETER="1"
fi
}

View file

@ -37,12 +37,12 @@ set_locale() {
OTHER_LOCALES="${OTHER_LOCALES} ${i} -" OTHER_LOCALES="${OTHER_LOCALES} ${i} -"
done done
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select A System-Wide Locale:" 14 40 8 ${LOCALES} 2>${ANSWER} || return 1 DIALOG --menu "Select A System-Wide Locale:" 14 40 8 ${LOCALES} 2>${_ANSWER} || return 1
set_locale=$(cat "${ANSWER}") set_locale=$(cat "${_ANSWER}")
if [[ "${set_locale}" == "OTHER" ]]; then if [[ "${set_locale}" == "OTHER" ]]; then
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select A System-Wide Locale:" 18 40 12 ${OTHER_LOCALES} 2>${ANSWER} || return 1 DIALOG --menu "Select A System-Wide Locale:" 18 40 12 ${OTHER_LOCALES} 2>${_ANSWER} || return 1
set_locale=$(cat "${ANSWER}") set_locale=$(cat "${_ANSWER}")
fi fi
sed -i -e "s#LANG=.*#LANG=${set_locale}#g" "${DESTDIR}"/etc/locale.conf sed -i -e "s#LANG=.*#LANG=${set_locale}#g" "${DESTDIR}"/etc/locale.conf
DIALOG --infobox "Setting locale LANG=${set_locale} on installed system ..." 3 70 DIALOG --infobox "Setting locale LANG=${set_locale} on installed system ..." 3 70
@ -59,12 +59,12 @@ set_password() {
PASS2="" PASS2=""
while [[ "${PASSWORD}" == "" ]]; do while [[ "${PASSWORD}" == "" ]]; do
while [[ "${PASS}" == "" ]]; do while [[ "${PASS}" == "" ]]; do
DIALOG --insecure --passwordbox "Enter new root password:" 0 0 2>"${ANSWER}" || return 1 DIALOG --insecure --passwordbox "Enter new root password:" 0 0 2>"${_ANSWER}" || return 1
PASS=$(cat "${ANSWER}") PASS=$(cat "${_ANSWER}")
done done
while [[ "${PASS2}" == "" ]]; do while [[ "${PASS2}" == "" ]]; do
DIALOG --insecure --passwordbox "Retype new root password:" 0 0 2>"${ANSWER}" || return 1 DIALOG --insecure --passwordbox "Retype new root password:" 0 0 2>"${_ANSWER}" || return 1
PASS2=$(cat "${ANSWER}") PASS2=$(cat "${_ANSWER}")
done done
if [[ "${PASS}" == "${PASS2}" ]]; then if [[ "${PASS}" == "${PASS2}" ]]; then
PASSWORD=${PASS} PASSWORD=${PASS}

View file

@ -57,16 +57,16 @@ select_filesystem() {
command -v mkfs.nilfs2 2>/dev/null && FSOPTS="${FSOPTS} nilfs2 Nilfs2" command -v mkfs.nilfs2 2>/dev/null && FSOPTS="${FSOPTS} nilfs2 Nilfs2"
command -v mkfs.jfs 2>/dev/null && FSOPTS="${FSOPTS} jfs JFS" command -v mkfs.jfs 2>/dev/null && FSOPTS="${FSOPTS} jfs JFS"
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select a filesystem for ${PART}:" 15 50 12 ${FSOPTS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select a filesystem for ${PART}:" 15 50 12 ${FSOPTS} 2>"${_ANSWER}" || return 1
FSTYPE=$(cat "${ANSWER}") FSTYPE=$(cat "${_ANSWER}")
} }
enter_mountpoint() { enter_mountpoint() {
FILESYSTEM_FINISH="" FILESYSTEM_FINISH=""
MP="" MP=""
while [[ "${MP}" == "" ]]; do while [[ "${MP}" == "" ]]; do
DIALOG --inputbox "Enter the mountpoint for ${PART}" 8 65 "/boot" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the mountpoint for ${PART}" 8 65 "/boot" 2>"${_ANSWER}" || return 1
MP=$(cat "${ANSWER}") MP=$(cat "${_ANSWER}")
if grep ":${MP}:" /tmp/.parts; then if grep ":${MP}:" /tmp/.parts; then
DIALOG --msgbox "ERROR: You have defined 2 identical mountpoints! Please select another mountpoint." 8 65 DIALOG --msgbox "ERROR: You have defined 2 identical mountpoints! Please select another mountpoint." 8 65
MP="" MP=""
@ -96,8 +96,8 @@ create_filesystem() {
if [[ "${DOMKFS}" == "yes" ]]; then if [[ "${DOMKFS}" == "yes" ]]; then
while [[ "${LABEL_NAME}" == "" ]]; do while [[ "${LABEL_NAME}" == "" ]]; do
DIALOG --inputbox "Enter the LABEL name for the device, keep it short\n(not more than 12 characters) and use no spaces or special\ncharacters." 10 65 \ DIALOG --inputbox "Enter the LABEL name for the device, keep it short\n(not more than 12 characters) and use no spaces or special\ncharacters." 10 65 \
"$(${_LSBLK} LABEL "${PART}")" 2>"${ANSWER}" || return 1 "$(${_LSBLK} LABEL "${PART}")" 2>"${_ANSWER}" || return 1
LABEL_NAME=$(cat "${ANSWER}") LABEL_NAME=$(cat "${_ANSWER}")
if grep ":${LABEL_NAME}$" /tmp/.parts; then if grep ":${LABEL_NAME}$" /tmp/.parts; then
DIALOG --msgbox "ERROR: You have defined 2 identical LABEL names! Please enter another name." 8 65 DIALOG --msgbox "ERROR: You have defined 2 identical LABEL names! Please enter another name." 8 65
LABEL_NAME="" LABEL_NAME=""
@ -107,8 +107,8 @@ create_filesystem() {
prepare_btrfs || return 1 prepare_btrfs || return 1
btrfs_compress btrfs_compress
fi fi
DIALOG --inputbox "Enter additional options to the filesystem creation utility.\nUse this field only, if the defaults are not matching your needs,\nelse just leave it empty." 10 70 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter additional options to the filesystem creation utility.\nUse this field only, if the defaults are not matching your needs,\nelse just leave it empty." 10 70 2>"${_ANSWER}" || return 1
FS_OPTIONS=$(cat "${ANSWER}") FS_OPTIONS=$(cat "${_ANSWER}")
fi fi
FILESYSTEM_FINISH="yes" FILESYSTEM_FINISH="yes"
} }
@ -132,8 +132,8 @@ mountpoints() {
while [[ "${DO_SWAP}" != "DONE" ]]; do while [[ "${DO_SWAP}" != "DONE" ]]; do
FSTYPE="swap" FSTYPE="swap"
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select the partition to use as swap:" 15 50 12 NONE - ${PARTS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select the partition to use as swap:" 15 50 12 NONE - ${PARTS} 2>"${_ANSWER}" || return 1
PART=$(cat "${ANSWER}") PART=$(cat "${_ANSWER}")
if [[ "${PART}" != "NONE" ]]; then if [[ "${PART}" != "NONE" ]]; then
clear_fs_values clear_fs_values
if [[ "${ASK_MOUNTPOINTS}" == "1" ]]; then if [[ "${ASK_MOUNTPOINTS}" == "1" ]]; then
@ -155,8 +155,8 @@ mountpoints() {
DO_ROOT="" DO_ROOT=""
while [[ "${DO_ROOT}" != "DONE" ]]; do while [[ "${DO_ROOT}" != "DONE" ]]; do
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select the partition to mount as /:" 15 50 12 ${PARTS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select the partition to mount as /:" 15 50 12 ${PARTS} 2>"${_ANSWER}" || return 1
PART=$(cat "${ANSWER}") PART=$(cat "${_ANSWER}")
PART_ROOT=${PART} PART_ROOT=${PART}
# Select root filesystem type # Select root filesystem type
FSTYPE="$(${_LSBLK} FSTYPE "${PART}")" FSTYPE="$(${_LSBLK} FSTYPE "${PART}")"
@ -183,8 +183,8 @@ mountpoints() {
DO_ADDITIONAL="" DO_ADDITIONAL=""
while [[ "${DO_ADDITIONAL}" != "DONE" ]]; do while [[ "${DO_ADDITIONAL}" != "DONE" ]]; do
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select any additional partitions to mount under your new root:" 15 52 12 ${PARTS} DONE _ 2>"${ANSWER}" || return 1 DIALOG --menu "Select any additional partitions to mount under your new root:" 15 52 12 ${PARTS} DONE _ 2>"${_ANSWER}" || return 1
PART=$(cat "${ANSWER}") PART=$(cat "${_ANSWER}")
if [[ "${PART}" != "DONE" ]]; then if [[ "${PART}" != "DONE" ]]; then
FSTYPE="$(${_LSBLK} FSTYPE "${PART}")" FSTYPE="$(${_LSBLK} FSTYPE "${PART}")"
# clear values first! # clear values first!

View file

@ -36,13 +36,13 @@ do_wireless() {
#shellcheck disable=SC2086,SC2046 #shellcheck disable=SC2086,SC2046
DIALOG --menu "Choose your SSID:\n(Empty spaces in your SSID are replaced by '+' char)" 14 60 7 \ DIALOG --menu "Choose your SSID:\n(Empty spaces in your SSID are replaced by '+' char)" 14 60 7 \
$(essid_scan _) \ $(essid_scan _) \
"Hidden" "_" 2>"${ANSWER}" || return 1 "Hidden" "_" 2>"${_ANSWER}" || return 1
WLAN_SSID=$(cat "${ANSWER}") WLAN_SSID=$(cat "${_ANSWER}")
WLAN_CONNECT="connect" WLAN_CONNECT="connect"
if [[ "${WLAN_SSID}" == "Hidden" ]]; then if [[ "${WLAN_SSID}" == "Hidden" ]]; then
DIALOG --inputbox "Enter the hidden SSID:" 8 65 \ DIALOG --inputbox "Enter the hidden SSID:" 8 65 \
"secret" 2>"${ANSWER}" || return 1 "secret" 2>"${_ANSWER}" || return 1
WLAN_SSID=$(cat "${ANSWER}") WLAN_SSID=$(cat "${_ANSWER}")
WLAN_CONNECT="connect-hidden" WLAN_CONNECT="connect-hidden"
WLAN_HIDDEN="yes" WLAN_HIDDEN="yes"
fi fi
@ -54,8 +54,8 @@ do_wireless() {
# expect hidden network has a WLAN_KEY # expect hidden network has a WLAN_KEY
#shellcheck disable=SC2143 #shellcheck disable=SC2143
if ! [[ "$(iwctl station "${INTERFACE}" get-networks | grep -w "${WLAN_SSID}" | cut -c 42-49 | grep -q 'open')" ]] || [[ "${WLAN_CONNECT}" == "connect-hidden" ]]; then if ! [[ "$(iwctl station "${INTERFACE}" get-networks | grep -w "${WLAN_SSID}" | cut -c 42-49 | grep -q 'open')" ]] || [[ "${WLAN_CONNECT}" == "connect-hidden" ]]; then
DIALOG --inputbox "Enter your KEY for SSID='${WLAN_SSID}'" 8 50 "SecretWirelessKey" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter your KEY for SSID='${WLAN_SSID}'" 8 50 "SecretWirelessKey" 2>"${_ANSWER}" || return 1
WLAN_KEY=$(cat "${ANSWER}") WLAN_KEY=$(cat "${_ANSWER}")
fi fi
# time to connect # time to connect
DIALOG --infobox "Connection to SSID='${WLAN_SSID}' with interface ${INTERFACE} ..." 3 70 DIALOG --infobox "Connection to SSID='${WLAN_SSID}' with interface ${INTERFACE} ..." 3 70
@ -90,10 +90,10 @@ donetwork() {
ifaces=$(net_interfaces) ifaces=$(net_interfaces)
while [[ "${INTERFACE}" == "" ]]; do while [[ "${INTERFACE}" == "" ]]; do
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --ok-label "Select" --menu "Select a network interface:" 14 55 7 ${ifaces} 2>"${ANSWER}" DIALOG --ok-label "Select" --menu "Select a network interface:" 14 55 7 ${ifaces} 2>"${_ANSWER}"
case $? in case $? in
1) return 1 ;; 1) return 1 ;;
0) INTERFACE=$(cat "${ANSWER}") ;; 0) INTERFACE=$(cat "${_ANSWER}") ;;
esac esac
done done
echo "${INTERFACE}" >/tmp/.network-interface echo "${INTERFACE}" >/tmp/.network-interface
@ -105,8 +105,8 @@ donetwork() {
fi fi
# profile name # profile name
NETWORK_PROFILE="" NETWORK_PROFILE=""
DIALOG --inputbox "Enter your network profile name:" 7 40 "${INTERFACE}-${CONNECTION}" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter your network profile name:" 7 40 "${INTERFACE}-${CONNECTION}" 2>"${_ANSWER}" || return 1
NETWORK_PROFILE=/etc/systemd/network/$(cat "${ANSWER}").network NETWORK_PROFILE=/etc/systemd/network/$(cat "${_ANSWER}").network
# wifi setup first # wifi setup first
do_wireless || return 1 do_wireless || return 1
# dhcp switch # dhcp switch
@ -117,16 +117,16 @@ donetwork() {
IP="dhcp" IP="dhcp"
else else
IP="static" IP="static"
DIALOG --inputbox "Enter your IP address and netmask:" 7 40 "192.168.1.23/24" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter your IP address and netmask:" 7 40 "192.168.1.23/24" 2>"${_ANSWER}" || return 1
IPADDR=$(cat "${ANSWER}") IPADDR=$(cat "${_ANSWER}")
DIALOG --inputbox "Enter your gateway:" 7 40 "192.168.1.1" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter your gateway:" 7 40 "192.168.1.1" 2>"${_ANSWER}" || return 1
GW=$(cat "${ANSWER}") GW=$(cat "${_ANSWER}")
DIALOG --inputbox "Enter your DNS server IP:" 7 40 "192.168.1.1" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter your DNS server IP:" 7 40 "192.168.1.1" 2>"${_ANSWER}" || return 1
DNS=$(cat "${ANSWER}") DNS=$(cat "${_ANSWER}")
fi fi
# http/ftp proxy settings # http/ftp proxy settings
DIALOG --inputbox "Enter your proxy server, for example:\nhttp://name:port\nhttp://ip:port\nhttp://username:password@ip:port\n\n Leave the field empty if no proxy is needed to install." 13 65 "" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter your proxy server, for example:\nhttp://name:port\nhttp://ip:port\nhttp://username:password@ip:port\n\n Leave the field empty if no proxy is needed to install." 13 65 "" 2>"${_ANSWER}" || return 1
PROXY=$(cat "${ANSWER}") PROXY=$(cat "${_ANSWER}")
PROXIES="http_proxy https_proxy ftp_proxy rsync_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY" PROXIES="http_proxy https_proxy ftp_proxy rsync_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY"
if [[ "${PROXY}" == "" ]]; then if [[ "${PROXY}" == "" ]]; then
for i in ${PROXIES}; do for i in ${PROXIES}; do

View file

@ -39,13 +39,13 @@ select_mirror() {
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select a mirror:" 14 55 7 \ DIALOG --menu "Select a mirror:" 14 55 7 \
${MIRRORS} \ ${MIRRORS} \
"Custom" "_" 2>${ANSWER} || return 1 "Custom" "_" 2>${_ANSWER} || return 1
#shellcheck disable=SC2155 #shellcheck disable=SC2155
local _server=$(cat "${ANSWER}") local _server=$(cat "${_ANSWER}")
if [[ "${_server}" == "Custom" ]]; then if [[ "${_server}" == "Custom" ]]; then
DIALOG --inputbox "Enter the full URL to repositories." 8 65 \ DIALOG --inputbox "Enter the full URL to repositories." 8 65 \
"" 2>"${ANSWER}" || return 1 "" 2>"${_ANSWER}" || return 1
SYNC_URL=$(cat "${ANSWER}") SYNC_URL=$(cat "${_ANSWER}")
else else
# Form the full URL for our mirror by grepping for the server name in # Form the full URL for our mirror by grepping for the server name in
# our mirrorlist and pulling the full URL out. Substitute 'core' in # our mirrorlist and pulling the full URL out. Substitute 'core' in

View file

@ -83,8 +83,8 @@ check_efisys_part() {
#autodetect efisys mountpoint, on fail ask for mountpoint #autodetect efisys mountpoint, on fail ask for mountpoint
UEFISYS_MP="/$(basename "$(mount | grep "${UEFISYS_PART}" | cut -d " " -f 3)")" UEFISYS_MP="/$(basename "$(mount | grep "${UEFISYS_PART}" | cut -d " " -f 3)")"
if [[ "${UEFISYS_MP}" == "/" ]]; then if [[ "${UEFISYS_MP}" == "/" ]]; then
DIALOG --inputbox "Enter the mountpoint of your EFI System partition (Default is /boot): " 0 0 "/boot" 2>"${ANSWER}" || return 1 DIALOG --inputbox "Enter the mountpoint of your EFI System partition (Default is /boot): " 0 0 "/boot" 2>"${_ANSWER}" || return 1
UEFISYS_MP="$(cat "${ANSWER}")" UEFISYS_MP="$(cat "${_ANSWER}")"
fi fi
umount "${DESTDIR}/${UEFISYS_MP}" &> /dev/null umount "${DESTDIR}/${UEFISYS_MP}" &> /dev/null
umount "${UEFISYS_PART}" &> /dev/null umount "${UEFISYS_PART}" &> /dev/null
@ -128,11 +128,11 @@ partition() {
while true; do while true; do
# Prompt the user with a list of known disks # Prompt the user with a list of known disks
#shellcheck disable=SC2086 #shellcheck disable=SC2086
DIALOG --menu "Select the disk you want to partition:" 14 55 7 ${DISCS} 2>"${ANSWER}" || return 1 DIALOG --menu "Select the disk you want to partition:" 14 55 7 ${DISCS} 2>"${_ANSWER}" || return 1
DISC=$(cat "${ANSWER}") DISC=$(cat "${_ANSWER}")
if [[ "${DISC}" == "OTHER" ]]; then if [[ "${DISC}" == "OTHER" ]]; then
DIALOG --inputbox "Enter the full path to the device you wish to partition" 8 65 "/dev/sda" 2>"${ANSWER}" || DISC="" DIALOG --inputbox "Enter the full path to the device you wish to partition" 8 65 "/dev/sda" 2>"${_ANSWER}" || DISC=""
DISC=$(cat "${ANSWER}") DISC=$(cat "${_ANSWER}")
fi fi
# Leave our loop if the user is done partitioning # Leave our loop if the user is done partitioning
[[ "${DISC}" == "DONE" ]] && break [[ "${DISC}" == "DONE" ]] && break

View file

@ -16,9 +16,9 @@ create_special() {
"1" "Manage Software Raid" \ "1" "Manage Software Raid" \
"2" "Manage LVM2" \ "2" "Manage LVM2" \
"3" "Manage Luks encryption" \ "3" "Manage Luks encryption" \
"4" "Return to Previous Menu" 2>"${ANSWER}" || CANCEL="1" "4" "Return to Previous Menu" 2>"${_ANSWER}" || CANCEL="1"
NEXTITEM="$(cat "${ANSWER}")" NEXTITEM="$(cat "${_ANSWER}")"
case $(cat "${ANSWER}") in case $(cat "${_ANSWER}") in
"1") "1")
_createmd ;; _createmd ;;
"2") "2")
@ -53,9 +53,9 @@ _createmd() {
"2" "Create Partitionable Software Raid" \ "2" "Create Partitionable Software Raid" \
"3" "Reset Software Raid" \ "3" "Reset Software Raid" \
"4" "Raid Help" \ "4" "Raid Help" \
"5" "Return to Previous Menu" 2>"${ANSWER}" || CANCEL="1" "5" "Return to Previous Menu" 2>"${_ANSWER}" || CANCEL="1"
NEXTITEM="$(cat "${ANSWER}")" NEXTITEM="$(cat "${_ANSWER}")"
case $(cat "${ANSWER}") in case $(cat "${_ANSWER}") in
"1") "1")
RAID_PARTITION="" RAID_PARTITION=""
_raid ;; _raid ;;
@ -91,9 +91,9 @@ _createlvm() {
"3" "Create Logical Volume" \ "3" "Create Logical Volume" \
"4" "Reset Logical Volume" \ "4" "Reset Logical Volume" \
"5" "LVM Help" \ "5" "LVM Help" \
"6" "Return to Previous Menu" 2>"${ANSWER}" || CANCEL="1" "6" "Return to Previous Menu" 2>"${_ANSWER}" || CANCEL="1"
NEXTITEM="$(cat "${ANSWER}")" NEXTITEM="$(cat "${_ANSWER}")"
case $(cat "${ANSWER}") in case $(cat "${_ANSWER}") in
"1") "1")
_createpv ;; _createpv ;;
"2") "2")
@ -127,9 +127,9 @@ _createluks() {
"1" "Create Luks" \ "1" "Create Luks" \
"2" "Reset Luks Encryption completely" \ "2" "Reset Luks Encryption completely" \
"3" "Luks Help" \ "3" "Luks Help" \
"4" "Return to Previous Menu" 2>"${ANSWER}" || CANCEL="1" "4" "Return to Previous Menu" 2>"${_ANSWER}" || CANCEL="1"
NEXTITEM="$(cat "${ANSWER}")" NEXTITEM="$(cat "${_ANSWER}")"
case $(cat "${ANSWER}") in case $(cat "${_ANSWER}") in
"1") "1")
_luks ;; _luks ;;
"2") "2")