mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 12:00:37 +02:00
rename ANSWER to _ANSWER
This commit is contained in:
parent
02f75a86ff
commit
39dfa85656
12 changed files with 156 additions and 156 deletions
|
@ -15,8 +15,8 @@ autoprepare() {
|
|||
if [[ "$(echo "${DISCS}" | wc -w)" -gt 1 ]]; then
|
||||
DIALOG --cr-wrap --msgbox "Available Disks:\n\n$(_getavaildisks)\n" 0 0
|
||||
#shellcheck disable=SC2046
|
||||
DIALOG --menu "Select the storage drive to use:" 14 55 7 $(blockdevices _) 2>"${ANSWER}" || return 1
|
||||
DISC=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select the storage drive to use:" 14 55 7 $(blockdevices _) 2>"${_ANSWER}" || return 1
|
||||
DISC=$(cat "${_ANSWER}")
|
||||
else
|
||||
DISC="${DISCS}"
|
||||
if [[ "${DISC}" == "" ]]; then
|
||||
|
@ -45,8 +45,8 @@ autoprepare() {
|
|||
set_device_name_scheme || return 1
|
||||
fi
|
||||
if [[ "${_GUIDPARAMETER}" == "1" ]]; then
|
||||
DIALOG --inputbox "Enter the mountpoint of your UEFI SYSTEM PARTITION (Default is /boot) : " 10 60 "/boot" 2>"${ANSWER}" || return 1
|
||||
UEFISYS_MP="$(cat "${ANSWER}")"
|
||||
DIALOG --inputbox "Enter the mountpoint of your UEFI SYSTEM PARTITION (Default is /boot) : " 10 60 "/boot" 2>"${_ANSWER}" || return 1
|
||||
UEFISYS_MP="$(cat "${_ANSWER}")"
|
||||
fi
|
||||
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
|
||||
|
@ -73,8 +73,8 @@ autoprepare() {
|
|||
if [[ "${_GUIDPARAMETER}" == "1" ]]; then
|
||||
if [[ "${_UEFISYS_BOOTPART}" == "1" ]]; then
|
||||
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
|
||||
UEFISYS_PART_SIZE="$(cat "${ANSWER}")"
|
||||
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}")"
|
||||
if [[ "${UEFISYS_PART_SIZE}" == "" ]]; then
|
||||
DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0
|
||||
else
|
||||
|
@ -90,8 +90,8 @@ autoprepare() {
|
|||
done
|
||||
else
|
||||
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
|
||||
UEFISYS_PART_SIZE="$(cat "${ANSWER}")"
|
||||
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}")"
|
||||
if [[ "${UEFISYS_PART_SIZE}" == "" ]]; then
|
||||
DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0
|
||||
else
|
||||
|
@ -107,8 +107,8 @@ autoprepare() {
|
|||
fi
|
||||
DISC_SIZE="$((DISC_SIZE-UEFISYS_PART_SIZE))"
|
||||
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
|
||||
BOOT_PART_SIZE="$(cat "${ANSWER}")"
|
||||
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}")"
|
||||
if [[ "${BOOT_PART_SIZE}" == "" ]]; then
|
||||
DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0
|
||||
else
|
||||
|
@ -124,8 +124,8 @@ autoprepare() {
|
|||
done
|
||||
else
|
||||
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
|
||||
BOOT_PART_SIZE="$(cat "${ANSWER}")"
|
||||
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}")"
|
||||
if [[ "${BOOT_PART_SIZE}" == "" ]]; then
|
||||
DIALOG --msgbox "ERROR: You have entered a invalid size, please enter again." 0 0
|
||||
else
|
||||
|
@ -143,8 +143,8 @@ autoprepare() {
|
|||
SWAP_SIZE="256"
|
||||
[[ "${DISC_SIZE}" -lt "256" ]] && SWAP_SIZE="${DISC_SIZE}"
|
||||
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
|
||||
SWAP_PART_SIZE=$(cat "${ANSWER}")
|
||||
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}")
|
||||
if [[ "${SWAP_PART_SIZE}" == "" || "${SWAP_PART_SIZE}" == "0" ]]; then
|
||||
DIALOG --msgbox "ERROR: You have entered an invalid size, please enter again." 0 0
|
||||
else
|
||||
|
@ -159,8 +159,8 @@ autoprepare() {
|
|||
done
|
||||
while [[ "${CHOSEN_FS}" == "" ]]; do
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select a filesystem for / and /home:" 16 45 9 ${FSOPTS} 2>"${ANSWER}" || return 1
|
||||
FSTYPE=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select a filesystem for / and /home:" 16 45 9 ${FSOPTS} 2>"${_ANSWER}" || return 1
|
||||
FSTYPE=$(cat "${_ANSWER}")
|
||||
DIALOG --yesno "${FSTYPE} will be used for / and /home. Is this OK?" 0 0 && CHOSEN_FS=1
|
||||
done
|
||||
# / and /home are subvolumes on btrfs
|
||||
|
@ -169,8 +169,8 @@ autoprepare() {
|
|||
ROOT_SIZE="7500"
|
||||
[[ "${DISC_SIZE}" -lt "7500" ]] && ROOT_SIZE="${DISC_SIZE}"
|
||||
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
|
||||
ROOT_PART_SIZE=$(cat "${ANSWER}")
|
||||
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}")
|
||||
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
|
||||
else
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
ANSWER="/tmp/.setup"
|
||||
_ANSWER="/tmp/.setup"
|
||||
# use the first VT not dedicated to a running console
|
||||
# don't use DESTDIR=/mnt because it's intended to mount other things there!
|
||||
# check first if bootet in archboot
|
||||
|
@ -58,8 +58,8 @@ geteditor() {
|
|||
if ! [[ "${EDITOR}" ]]; then
|
||||
DIALOG --menu "Select a Text Editor to Use" 9 35 3 \
|
||||
"1" "nano (easier)" \
|
||||
"2" "neovim" 2>${ANSWER} || return 1
|
||||
case $(cat ${ANSWER}) in
|
||||
"2" "neovim" 2>${_ANSWER} || return 1
|
||||
case $(cat ${_ANSWER}) in
|
||||
"1") EDITOR="nano" ;;
|
||||
"2") EDITOR="nvim" ;;
|
||||
esac
|
||||
|
@ -96,3 +96,14 @@ set_uefi_parameters() {
|
|||
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
|
||||
}
|
||||
|
|
|
@ -327,8 +327,8 @@ set_device_name_scheme() {
|
|||
fi
|
||||
NAME_SCHEME_LEVELS="${NAME_SCHEME_LEVELS} FSUUID UUID=<uuid> FSLABEL LABEL=<label> KERNEL /dev/<kernelname>"
|
||||
#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
|
||||
NAME_SCHEME_PARAMETER=$(cat "${ANSWER}")
|
||||
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_RUN="1"
|
||||
}
|
||||
|
||||
|
@ -578,8 +578,8 @@ _raid()
|
|||
# enter raid device name
|
||||
RAIDDEVICE=""
|
||||
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
|
||||
RAIDDEVICE=$(cat "${ANSWER}")
|
||||
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}")
|
||||
if grep -q "^${RAIDDEVICE//\/dev\//}" /proc/mdstat; then
|
||||
DIALOG --msgbox "ERROR: You have defined 2 identical node names! Please enter another name." 8 65
|
||||
RAIDDEVICE=""
|
||||
|
@ -587,23 +587,23 @@ _raid()
|
|||
done
|
||||
RAIDLEVELS="linear - raid0 - raid1 - raid4 - raid5 - raid6 - raid10 -"
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select the raid level you want to use:" 14 50 7 ${RAIDLEVELS} 2>"${ANSWER}" || return 1
|
||||
LEVEL=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select the raid level you want to use:" 14 50 7 ${RAIDLEVELS} 2>"${_ANSWER}" || return 1
|
||||
LEVEL=$(cat "${_ANSWER}")
|
||||
# raid5 and raid10 support parity parameter
|
||||
PARITY=""
|
||||
if [[ "${LEVEL}" == "raid5" || "${LEVEL}" == "raid6" || "${LEVEL}" == "raid10" ]]; then
|
||||
PARITYLEVELS="left-asymmetric - left-symmetric - right-asymmetric - right-symmetric -"
|
||||
#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
|
||||
PARITY=$(cat "${ANSWER}")
|
||||
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}")
|
||||
fi
|
||||
# show all devices with sizes
|
||||
DIALOG --cr-wrap --msgbox "DISKS:\n$(_getavaildisks)\n\nPARTITIONS:\n$(_getavailpartitions)" 0 0
|
||||
# select the first device to use, no missing option available!
|
||||
RAIDNUMBER=1
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select device ${RAIDNUMBER}:" 21 50 13 ${PARTS} 2>"${ANSWER}" || return 1
|
||||
PART=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select device ${RAIDNUMBER}:" 21 50 13 ${PARTS} 2>"${_ANSWER}" || return 1
|
||||
PART=$(cat "${_ANSWER}")
|
||||
echo "${PART}" >>/tmp/.raid
|
||||
while [[ "${PART}" != "DONE" ]]; do
|
||||
RAIDNUMBER=$((RAIDNUMBER + 1))
|
||||
|
@ -613,8 +613,8 @@ _raid()
|
|||
! [[ "${LEVEL}" == "raid0" || "${LEVEL}" == "linear" ]] && MDEXTRA="MISSING _"
|
||||
# add more devices
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select additional device ${RAIDNUMBER}:" 21 50 13 ${PARTS} ${MDEXTRA} DONE _ 2>"${ANSWER}" || return 1
|
||||
PART=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select additional device ${RAIDNUMBER}:" 21 50 13 ${PARTS} ${MDEXTRA} DONE _ 2>"${_ANSWER}" || return 1
|
||||
PART=$(cat "${_ANSWER}")
|
||||
SPARE=""
|
||||
! [[ "${LEVEL}" == "raid0" || "${LEVEL}" == "linear" ]] && DIALOG --yesno --defaultno "Would you like to use ${PART} as spare device?" 0 0 && SPARE="1"
|
||||
[[ "${PART}" == "DONE" ]] && break
|
||||
|
@ -724,8 +724,8 @@ _createpv()
|
|||
# select the first device to use
|
||||
DEVNUMBER=1
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select device number ${DEVNUMBER} for physical volume:" 15 50 12 ${PARTS} 2>"${ANSWER}" || return 1
|
||||
PART=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select device number ${DEVNUMBER} for physical volume:" 15 50 12 ${PARTS} 2>"${_ANSWER}" || return 1
|
||||
PART=$(cat "${_ANSWER}")
|
||||
echo "${PART}" >>/tmp/.pvs-create
|
||||
while [[ "${PART}" != "DONE" ]]; do
|
||||
DEVNUMBER="$((DEVNUMBER + 1))"
|
||||
|
@ -733,8 +733,8 @@ _createpv()
|
|||
PARTS="${PARTS//${PART}\ _/}"
|
||||
# add more devices
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select additional device number ${DEVNUMBER} for physical volume:" 15 60 12 ${PARTS} DONE _ 2>"${ANSWER}" || return 1
|
||||
PART=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select additional device number ${DEVNUMBER} for physical volume:" 15 60 12 ${PARTS} DONE _ 2>"${_ANSWER}" || return 1
|
||||
PART=$(cat "${_ANSWER}")
|
||||
[[ "${PART}" == "DONE" ]] && break
|
||||
echo "${PART}" >>/tmp/.pvs-create
|
||||
done
|
||||
|
@ -824,8 +824,8 @@ _createvg()
|
|||
# enter volume group name
|
||||
VGDEVICE=""
|
||||
while [[ "${VGDEVICE}" == "" ]]; do
|
||||
DIALOG --inputbox "Enter the Volume Group name:\nfoogroup\n<yourvolumegroupname>\n\n" 11 40 "foogroup" 2>"${ANSWER}" || return 1
|
||||
VGDEVICE=$(cat "${ANSWER}")
|
||||
DIALOG --inputbox "Enter the Volume Group name:\nfoogroup\n<yourvolumegroupname>\n\n" 11 40 "foogroup" 2>"${_ANSWER}" || return 1
|
||||
VGDEVICE=$(cat "${_ANSWER}")
|
||||
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
|
||||
VGDEVICE=""
|
||||
|
@ -837,8 +837,8 @@ _createvg()
|
|||
# select the first device to use, no missing option available!
|
||||
PVNUMBER=1
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select Physical Volume ${PVNUMBER} for ${VGDEVICE}:" 13 50 10 ${PVS} 2>"${ANSWER}" || return 1
|
||||
PV=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select Physical Volume ${PVNUMBER} for ${VGDEVICE}:" 13 50 10 ${PVS} 2>"${_ANSWER}" || return 1
|
||||
PV=$(cat "${_ANSWER}")
|
||||
echo "${PV}" >>/tmp/.pvs
|
||||
while [[ "${PVS}" != "DONE" ]]; do
|
||||
PVNUMBER=$((PVNUMBER + 1))
|
||||
|
@ -847,8 +847,8 @@ _createvg()
|
|||
PVS="$(echo ${PVS} | sed -e "s#${PV} _##g")"
|
||||
# add more devices
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select additional Physical Volume ${PVNUMBER} for ${VGDEVICE}:" 13 50 10 ${PVS} DONE _ 2>"${ANSWER}" || return 1
|
||||
PV=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select additional Physical Volume ${PVNUMBER} for ${VGDEVICE}:" 13 50 10 ${PVS} DONE _ 2>"${_ANSWER}" || return 1
|
||||
PV=$(cat "${_ANSWER}")
|
||||
[[ "${PV}" == "DONE" ]] && break
|
||||
echo "${PV}" >>/tmp/.pvs
|
||||
done
|
||||
|
@ -884,13 +884,13 @@ _createlv()
|
|||
# show all devices with sizes, which are not 100% in use!
|
||||
DIALOG --cr-wrap --msgbox "Volume Groups:\n$(getavailablevg)" 0 0
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select Volume Group:" 11 50 5 ${LVS} 2>"${ANSWER}" || return 1
|
||||
LV=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select Volume Group:" 11 50 5 ${LVS} 2>"${_ANSWER}" || return 1
|
||||
LV=$(cat "${_ANSWER}")
|
||||
# enter logical volume name
|
||||
LVDEVICE=""
|
||||
while [[ "${LVDEVICE}" == "" ]]; do
|
||||
DIALOG --inputbox "Enter the Logical Volume name:\nfooname\n<yourvolumename>\n\n" 10 65 "fooname" 2>"${ANSWER}" || return 1
|
||||
LVDEVICE=$(cat "${ANSWER}")
|
||||
DIALOG --inputbox "Enter the Logical Volume name:\nfooname\n<yourvolumename>\n\n" 10 65 "fooname" 2>"${_ANSWER}" || return 1
|
||||
LVDEVICE=$(cat "${_ANSWER}")
|
||||
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
|
||||
LVDEVICE=""
|
||||
|
@ -898,8 +898,8 @@ _createlv()
|
|||
done
|
||||
while [[ "${LV_SIZE_SET}" == "" ]]; do
|
||||
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
|
||||
LV_SIZE=$(cat "${ANSWER}")
|
||||
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}")
|
||||
if [[ "${LV_SIZE}" == "" ]]; then
|
||||
DIALOG --yesno "Would you like to create Logical Volume with no free space left?" 0 0 && LV_ALL="1"
|
||||
if ! [[ "${LV_ALL}" == "1" ]]; then
|
||||
|
@ -956,8 +956,8 @@ _createlv()
|
|||
_enter_luks_name() {
|
||||
LUKSDEVICE=""
|
||||
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
|
||||
LUKSDEVICE=$(cat "${ANSWER}")
|
||||
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}")
|
||||
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
|
||||
LUKSDEVICE=""
|
||||
|
@ -969,10 +969,10 @@ _enter_luks_name() {
|
|||
_enter_luks_passphrase () {
|
||||
LUKSPASSPHRASE=""
|
||||
while [[ "${LUKSPASSPHRASE}" == "" ]]; do
|
||||
DIALOG --insecure --passwordbox "Enter passphrase for luks encrypted device ${PART}:" 0 0 2>"${ANSWER}" || return 1
|
||||
LUKSPASS=$(cat "${ANSWER}")
|
||||
DIALOG --insecure --passwordbox "Retype passphrase for luks encrypted device ${PART}:" 0 0 2>"${ANSWER}" || return 1
|
||||
LUKSPASS2=$(cat "${ANSWER}")
|
||||
DIALOG --insecure --passwordbox "Enter passphrase for luks encrypted device ${PART}:" 0 0 2>"${_ANSWER}" || return 1
|
||||
LUKSPASS=$(cat "${_ANSWER}")
|
||||
DIALOG --insecure --passwordbox "Retype passphrase for luks encrypted device ${PART}:" 0 0 2>"${_ANSWER}" || return 1
|
||||
LUKSPASS2=$(cat "${_ANSWER}")
|
||||
if [[ -n "${LUKSPASS}" && -n "${LUKSPASS2}" && "${LUKSPASS}" == "${LUKSPASS2}" ]]; then
|
||||
LUKSPASSPHRASE=${LUKSPASS}
|
||||
echo "${LUKSPASSPHRASE}" > "/tmp/passphrase-${LUKSDEVICE}"
|
||||
|
@ -1044,8 +1044,8 @@ _luks()
|
|||
# show all devices with sizes
|
||||
DIALOG --cr-wrap --msgbox "DISKS:\n$(_getavaildisks)\n\nPARTITIONS:\n$(_getavailpartitions)\n\n" 0 0
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select device for luks encryption:" 15 50 12 ${PARTS} 2>"${ANSWER}" || return 1
|
||||
PART=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select device for luks encryption:" 15 50 12 ${PARTS} 2>"${_ANSWER}" || return 1
|
||||
PART=$(cat "${_ANSWER}")
|
||||
# enter luks name
|
||||
_enter_luks_name || return 1
|
||||
### TODO: offer more options for encrypt!
|
||||
|
|
|
@ -232,15 +232,15 @@ do_secureboot_keys() {
|
|||
MOK_PW=""
|
||||
KEYDIR=""
|
||||
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
|
||||
KEYDIR=$(cat "${ANSWER}")
|
||||
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}")
|
||||
#shellcheck disable=SC2086,SC2001
|
||||
KEYDIR="$(echo ${KEYDIR} | sed -e 's#^/##g')"
|
||||
done
|
||||
if [[ ! -d "${DESTDIR}/${KEYDIR}" ]]; then
|
||||
while [[ "${CN}" == "" ]]; do
|
||||
DIALOG --inputbox "Setup keys:\nEnter a common name(CN) for your keys, eg. Your Name" 8 65 "" 2>"${ANSWER}" || return 1
|
||||
CN=$(cat "${ANSWER}")
|
||||
DIALOG --inputbox "Setup keys:\nEnter a common name(CN) for your keys, eg. Your Name" 8 65 "" 2>"${_ANSWER}" || return 1
|
||||
CN=$(cat "${_ANSWER}")
|
||||
done
|
||||
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
|
||||
|
@ -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"
|
||||
if [[ "${INSTALL_MOK}" == "1" ]]; then
|
||||
while [[ "${MOK_PW}" == "" ]]; do
|
||||
DIALOG --insecure --passwordbox "Enter a one time MOK password for SHIM on reboot:" 8 65 2>"${ANSWER}" || return 1
|
||||
PASS=$(cat "${ANSWER}")
|
||||
DIALOG --insecure --passwordbox "Retype one time MOK password:" 8 65 2>"${ANSWER}" || return 1
|
||||
PASS2=$(cat "${ANSWER}")
|
||||
DIALOG --insecure --passwordbox "Enter a one time MOK password for SHIM on reboot:" 8 65 2>"${_ANSWER}" || return 1
|
||||
PASS=$(cat "${_ANSWER}")
|
||||
DIALOG --insecure --passwordbox "Retype one time MOK password:" 8 65 2>"${_ANSWER}" || return 1
|
||||
PASS2=$(cat "${_ANSWER}")
|
||||
if [[ "${PASS}" == "${PASS2}" && -n "${PASS}" ]]; then
|
||||
MOK_PW=${PASS}
|
||||
echo "${MOK_PW}" > /tmp/.password
|
||||
|
@ -423,8 +423,8 @@ do_efistub_uefi() {
|
|||
else
|
||||
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" \
|
||||
"rEFInd" "rEFInd for ${_UEFI_ARCH} UEFI" 2>"${ANSWER}"
|
||||
case $(cat "${ANSWER}") in
|
||||
"rEFInd" "rEFInd for ${_UEFI_ARCH} UEFI" 2>"${_ANSWER}"
|
||||
case $(cat "${_ANSWER}") in
|
||||
"SYSTEMD-BOOT") do_systemd_boot_uefi ;;
|
||||
"rEFInd") do_refind_uefi ;;
|
||||
esac
|
||||
|
@ -812,8 +812,8 @@ do_grub_bios() {
|
|||
return 1
|
||||
fi
|
||||
#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
|
||||
bootdev=$(cat "${ANSWER}")
|
||||
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}")
|
||||
if [[ "$(${_BLKID} -p -i -o value -s PTTYPE "${bootdev}")" == "gpt" ]]; then
|
||||
CHECK_BIOS_BOOT_GRUB="1"
|
||||
CHECK_UEFISYS_PART=""
|
||||
|
@ -948,8 +948,8 @@ install_bootloader_uefi() {
|
|||
else
|
||||
DIALOG --menu "Which ${_UEFI_ARCH} UEFI bootloader would you like to use?" 9 55 3 \
|
||||
"${_EFISTUB_MENU_LABEL}" "${_EFISTUB_MENU_TEXT}" \
|
||||
"GRUB_UEFI" "GRUB(2) for ${_UEFI_ARCH} UEFI" 2>"${ANSWER}"
|
||||
case $(cat "${ANSWER}") in
|
||||
"GRUB_UEFI" "GRUB(2) for ${_UEFI_ARCH} UEFI" 2>"${_ANSWER}"
|
||||
case $(cat "${_ANSWER}") in
|
||||
"EFISTUB") do_efistub_uefi
|
||||
[[ -z "${S_BOOTLOADER}" ]] || do_efistub_copy_to_efisys
|
||||
;;
|
||||
|
|
|
@ -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
|
||||
while [[ "${BTRFS_RAID_FINISH}" != "DONE" ]]; do
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select the raid data level you want to use:" 14 50 10 ${BTRFS_RAIDLEVELS} 2>"${ANSWER}" || return 1
|
||||
BTRFS_LEVEL=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select the raid data level you want to use:" 14 50 10 ${BTRFS_RAIDLEVELS} 2>"${_ANSWER}" || return 1
|
||||
BTRFS_LEVEL=$(cat "${_ANSWER}")
|
||||
if [[ "${BTRFS_LEVEL}" == "NONE" ]]; then
|
||||
echo "${BTRFS_DEVICE}" >>/tmp/.btrfs-devices
|
||||
break
|
||||
|
@ -135,8 +135,8 @@ select_btrfs_raid_devices () {
|
|||
BTRFS_PARTS=$(echo ${PARTS} | sed -e "s#${BTRFS_DEVICE}\ _##g")
|
||||
RAIDNUMBER=2
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select device ${RAIDNUMBER}:" 13 50 10 ${BTRFS_PARTS} 2>"${ANSWER}" || return 1
|
||||
BTRFS_PART=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select device ${RAIDNUMBER}:" 13 50 10 ${BTRFS_PARTS} 2>"${_ANSWER}" || return 1
|
||||
BTRFS_PART=$(cat "${_ANSWER}")
|
||||
echo "${BTRFS_PART}" >>/tmp/.btrfs-devices
|
||||
while [[ "${BTRFS_PART}" != "DONE" ]]; do
|
||||
BTRFS_DONE=""
|
||||
|
@ -151,8 +151,8 @@ select_btrfs_raid_devices () {
|
|||
BTRFS_PARTS=$(echo ${BTRFS_PARTS} | sed -e "s#${BTRFS_PART}\ _##g")
|
||||
# add more devices
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select device ${RAIDNUMBER}:" 13 50 10 ${BTRFS_PARTS} ${BTRFS_DONE} 2>"${ANSWER}" || return 1
|
||||
BTRFS_PART=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select device ${RAIDNUMBER}:" 13 50 10 ${BTRFS_PARTS} ${BTRFS_DONE} 2>"${_ANSWER}" || return 1
|
||||
BTRFS_PART=$(cat "${_ANSWER}")
|
||||
[[ "${BTRFS_PART}" == "DONE" ]] && break
|
||||
echo "${BTRFS_PART}" >>/tmp/.btrfs-devices
|
||||
done
|
||||
|
@ -179,8 +179,8 @@ prepare_btrfs_subvolume() {
|
|||
if [[ "${DOSUBVOLUME}" == "yes" ]]; then
|
||||
BTRFS_SUBVOLUME="NONE"
|
||||
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
|
||||
BTRFS_SUBVOLUME=$(cat "${ANSWER}")
|
||||
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}")
|
||||
check_btrfs_subvolume
|
||||
done
|
||||
else
|
||||
|
@ -233,8 +233,8 @@ choose_btrfs_subvolume () {
|
|||
done
|
||||
if [[ -n "${SUBVOLUMES}" ]]; then
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select the subvolume to mount:" 15 50 13 ${SUBVOLUMES} 2>"${ANSWER}" || return 1
|
||||
BTRFS_SUBVOLUME=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select the subvolume to mount:" 15 50 13 ${SUBVOLUMES} 2>"${_ANSWER}" || return 1
|
||||
BTRFS_SUBVOLUME=$(cat "${_ANSWER}")
|
||||
else
|
||||
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
|
||||
|
@ -275,7 +275,7 @@ btrfs_compress() {
|
|||
fi
|
||||
if [[ "${BTRFS_COMPRESS}" == "compress" ]]; then
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select the compression method you want to use:" 10 50 8 ${BTRFS_COMPRESSLEVELS} 2>"${ANSWER}" || return 1
|
||||
BTRFS_COMPRESS="compress=$(cat "${ANSWER}")"
|
||||
DIALOG --menu "Select the compression method you want to use:" 10 50 8 ${BTRFS_COMPRESSLEVELS} 2>"${_ANSWER}" || return 1
|
||||
BTRFS_COMPRESS="compress=$(cat "${_ANSWER}")"
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -152,14 +152,3 @@ locale_gen() {
|
|||
locale-gen >/dev/null 2>&1
|
||||
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
|
||||
}
|
||||
|
|
|
@ -37,12 +37,12 @@ set_locale() {
|
|||
OTHER_LOCALES="${OTHER_LOCALES} ${i} -"
|
||||
done
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select A System-Wide Locale:" 14 40 8 ${LOCALES} 2>${ANSWER} || return 1
|
||||
set_locale=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select A System-Wide Locale:" 14 40 8 ${LOCALES} 2>${_ANSWER} || return 1
|
||||
set_locale=$(cat "${_ANSWER}")
|
||||
if [[ "${set_locale}" == "OTHER" ]]; then
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select A System-Wide Locale:" 18 40 12 ${OTHER_LOCALES} 2>${ANSWER} || return 1
|
||||
set_locale=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select A System-Wide Locale:" 18 40 12 ${OTHER_LOCALES} 2>${_ANSWER} || return 1
|
||||
set_locale=$(cat "${_ANSWER}")
|
||||
fi
|
||||
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
|
||||
|
@ -59,12 +59,12 @@ set_password() {
|
|||
PASS2=""
|
||||
while [[ "${PASSWORD}" == "" ]]; do
|
||||
while [[ "${PASS}" == "" ]]; do
|
||||
DIALOG --insecure --passwordbox "Enter new root password:" 0 0 2>"${ANSWER}" || return 1
|
||||
PASS=$(cat "${ANSWER}")
|
||||
DIALOG --insecure --passwordbox "Enter new root password:" 0 0 2>"${_ANSWER}" || return 1
|
||||
PASS=$(cat "${_ANSWER}")
|
||||
done
|
||||
while [[ "${PASS2}" == "" ]]; do
|
||||
DIALOG --insecure --passwordbox "Retype new root password:" 0 0 2>"${ANSWER}" || return 1
|
||||
PASS2=$(cat "${ANSWER}")
|
||||
DIALOG --insecure --passwordbox "Retype new root password:" 0 0 2>"${_ANSWER}" || return 1
|
||||
PASS2=$(cat "${_ANSWER}")
|
||||
done
|
||||
if [[ "${PASS}" == "${PASS2}" ]]; then
|
||||
PASSWORD=${PASS}
|
||||
|
|
|
@ -57,16 +57,16 @@ select_filesystem() {
|
|||
command -v mkfs.nilfs2 2>/dev/null && FSOPTS="${FSOPTS} nilfs2 Nilfs2"
|
||||
command -v mkfs.jfs 2>/dev/null && FSOPTS="${FSOPTS} jfs JFS"
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select a filesystem for ${PART}:" 15 50 12 ${FSOPTS} 2>"${ANSWER}" || return 1
|
||||
FSTYPE=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select a filesystem for ${PART}:" 15 50 12 ${FSOPTS} 2>"${_ANSWER}" || return 1
|
||||
FSTYPE=$(cat "${_ANSWER}")
|
||||
}
|
||||
|
||||
enter_mountpoint() {
|
||||
FILESYSTEM_FINISH=""
|
||||
MP=""
|
||||
while [[ "${MP}" == "" ]]; do
|
||||
DIALOG --inputbox "Enter the mountpoint for ${PART}" 8 65 "/boot" 2>"${ANSWER}" || return 1
|
||||
MP=$(cat "${ANSWER}")
|
||||
DIALOG --inputbox "Enter the mountpoint for ${PART}" 8 65 "/boot" 2>"${_ANSWER}" || return 1
|
||||
MP=$(cat "${_ANSWER}")
|
||||
if grep ":${MP}:" /tmp/.parts; then
|
||||
DIALOG --msgbox "ERROR: You have defined 2 identical mountpoints! Please select another mountpoint." 8 65
|
||||
MP=""
|
||||
|
@ -96,8 +96,8 @@ create_filesystem() {
|
|||
if [[ "${DOMKFS}" == "yes" ]]; then
|
||||
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 \
|
||||
"$(${_LSBLK} LABEL "${PART}")" 2>"${ANSWER}" || return 1
|
||||
LABEL_NAME=$(cat "${ANSWER}")
|
||||
"$(${_LSBLK} LABEL "${PART}")" 2>"${_ANSWER}" || return 1
|
||||
LABEL_NAME=$(cat "${_ANSWER}")
|
||||
if grep ":${LABEL_NAME}$" /tmp/.parts; then
|
||||
DIALOG --msgbox "ERROR: You have defined 2 identical LABEL names! Please enter another name." 8 65
|
||||
LABEL_NAME=""
|
||||
|
@ -107,8 +107,8 @@ create_filesystem() {
|
|||
prepare_btrfs || return 1
|
||||
btrfs_compress
|
||||
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
|
||||
FS_OPTIONS=$(cat "${ANSWER}")
|
||||
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}")
|
||||
fi
|
||||
FILESYSTEM_FINISH="yes"
|
||||
}
|
||||
|
@ -132,8 +132,8 @@ mountpoints() {
|
|||
while [[ "${DO_SWAP}" != "DONE" ]]; do
|
||||
FSTYPE="swap"
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select the partition to use as swap:" 15 50 12 NONE - ${PARTS} 2>"${ANSWER}" || return 1
|
||||
PART=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select the partition to use as swap:" 15 50 12 NONE - ${PARTS} 2>"${_ANSWER}" || return 1
|
||||
PART=$(cat "${_ANSWER}")
|
||||
if [[ "${PART}" != "NONE" ]]; then
|
||||
clear_fs_values
|
||||
if [[ "${ASK_MOUNTPOINTS}" == "1" ]]; then
|
||||
|
@ -155,8 +155,8 @@ mountpoints() {
|
|||
DO_ROOT=""
|
||||
while [[ "${DO_ROOT}" != "DONE" ]]; do
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select the partition to mount as /:" 15 50 12 ${PARTS} 2>"${ANSWER}" || return 1
|
||||
PART=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select the partition to mount as /:" 15 50 12 ${PARTS} 2>"${_ANSWER}" || return 1
|
||||
PART=$(cat "${_ANSWER}")
|
||||
PART_ROOT=${PART}
|
||||
# Select root filesystem type
|
||||
FSTYPE="$(${_LSBLK} FSTYPE "${PART}")"
|
||||
|
@ -183,8 +183,8 @@ mountpoints() {
|
|||
DO_ADDITIONAL=""
|
||||
while [[ "${DO_ADDITIONAL}" != "DONE" ]]; do
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select any additional partitions to mount under your new root:" 15 52 12 ${PARTS} DONE _ 2>"${ANSWER}" || return 1
|
||||
PART=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select any additional partitions to mount under your new root:" 15 52 12 ${PARTS} DONE _ 2>"${_ANSWER}" || return 1
|
||||
PART=$(cat "${_ANSWER}")
|
||||
if [[ "${PART}" != "DONE" ]]; then
|
||||
FSTYPE="$(${_LSBLK} FSTYPE "${PART}")"
|
||||
# clear values first!
|
||||
|
|
|
@ -36,13 +36,13 @@ do_wireless() {
|
|||
#shellcheck disable=SC2086,SC2046
|
||||
DIALOG --menu "Choose your SSID:\n(Empty spaces in your SSID are replaced by '+' char)" 14 60 7 \
|
||||
$(essid_scan _) \
|
||||
"Hidden" "_" 2>"${ANSWER}" || return 1
|
||||
WLAN_SSID=$(cat "${ANSWER}")
|
||||
"Hidden" "_" 2>"${_ANSWER}" || return 1
|
||||
WLAN_SSID=$(cat "${_ANSWER}")
|
||||
WLAN_CONNECT="connect"
|
||||
if [[ "${WLAN_SSID}" == "Hidden" ]]; then
|
||||
DIALOG --inputbox "Enter the hidden SSID:" 8 65 \
|
||||
"secret" 2>"${ANSWER}" || return 1
|
||||
WLAN_SSID=$(cat "${ANSWER}")
|
||||
"secret" 2>"${_ANSWER}" || return 1
|
||||
WLAN_SSID=$(cat "${_ANSWER}")
|
||||
WLAN_CONNECT="connect-hidden"
|
||||
WLAN_HIDDEN="yes"
|
||||
fi
|
||||
|
@ -54,8 +54,8 @@ do_wireless() {
|
|||
# expect hidden network has a WLAN_KEY
|
||||
#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
|
||||
DIALOG --inputbox "Enter your KEY for SSID='${WLAN_SSID}'" 8 50 "SecretWirelessKey" 2>"${ANSWER}" || return 1
|
||||
WLAN_KEY=$(cat "${ANSWER}")
|
||||
DIALOG --inputbox "Enter your KEY for SSID='${WLAN_SSID}'" 8 50 "SecretWirelessKey" 2>"${_ANSWER}" || return 1
|
||||
WLAN_KEY=$(cat "${_ANSWER}")
|
||||
fi
|
||||
# time to connect
|
||||
DIALOG --infobox "Connection to SSID='${WLAN_SSID}' with interface ${INTERFACE} ..." 3 70
|
||||
|
@ -90,10 +90,10 @@ donetwork() {
|
|||
ifaces=$(net_interfaces)
|
||||
while [[ "${INTERFACE}" == "" ]]; do
|
||||
#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
|
||||
1) return 1 ;;
|
||||
0) INTERFACE=$(cat "${ANSWER}") ;;
|
||||
0) INTERFACE=$(cat "${_ANSWER}") ;;
|
||||
esac
|
||||
done
|
||||
echo "${INTERFACE}" >/tmp/.network-interface
|
||||
|
@ -105,8 +105,8 @@ donetwork() {
|
|||
fi
|
||||
# profile name
|
||||
NETWORK_PROFILE=""
|
||||
DIALOG --inputbox "Enter your network profile name:" 7 40 "${INTERFACE}-${CONNECTION}" 2>"${ANSWER}" || return 1
|
||||
NETWORK_PROFILE=/etc/systemd/network/$(cat "${ANSWER}").network
|
||||
DIALOG --inputbox "Enter your network profile name:" 7 40 "${INTERFACE}-${CONNECTION}" 2>"${_ANSWER}" || return 1
|
||||
NETWORK_PROFILE=/etc/systemd/network/$(cat "${_ANSWER}").network
|
||||
# wifi setup first
|
||||
do_wireless || return 1
|
||||
# dhcp switch
|
||||
|
@ -117,16 +117,16 @@ donetwork() {
|
|||
IP="dhcp"
|
||||
else
|
||||
IP="static"
|
||||
DIALOG --inputbox "Enter your IP address and netmask:" 7 40 "192.168.1.23/24" 2>"${ANSWER}" || return 1
|
||||
IPADDR=$(cat "${ANSWER}")
|
||||
DIALOG --inputbox "Enter your gateway:" 7 40 "192.168.1.1" 2>"${ANSWER}" || return 1
|
||||
GW=$(cat "${ANSWER}")
|
||||
DIALOG --inputbox "Enter your DNS server IP:" 7 40 "192.168.1.1" 2>"${ANSWER}" || return 1
|
||||
DNS=$(cat "${ANSWER}")
|
||||
DIALOG --inputbox "Enter your IP address and netmask:" 7 40 "192.168.1.23/24" 2>"${_ANSWER}" || return 1
|
||||
IPADDR=$(cat "${_ANSWER}")
|
||||
DIALOG --inputbox "Enter your gateway:" 7 40 "192.168.1.1" 2>"${_ANSWER}" || return 1
|
||||
GW=$(cat "${_ANSWER}")
|
||||
DIALOG --inputbox "Enter your DNS server IP:" 7 40 "192.168.1.1" 2>"${_ANSWER}" || return 1
|
||||
DNS=$(cat "${_ANSWER}")
|
||||
fi
|
||||
# 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
|
||||
PROXY=$(cat "${ANSWER}")
|
||||
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}")
|
||||
PROXIES="http_proxy https_proxy ftp_proxy rsync_proxy HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY"
|
||||
if [[ "${PROXY}" == "" ]]; then
|
||||
for i in ${PROXIES}; do
|
||||
|
|
|
@ -39,13 +39,13 @@ select_mirror() {
|
|||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select a mirror:" 14 55 7 \
|
||||
${MIRRORS} \
|
||||
"Custom" "_" 2>${ANSWER} || return 1
|
||||
"Custom" "_" 2>${_ANSWER} || return 1
|
||||
#shellcheck disable=SC2155
|
||||
local _server=$(cat "${ANSWER}")
|
||||
local _server=$(cat "${_ANSWER}")
|
||||
if [[ "${_server}" == "Custom" ]]; then
|
||||
DIALOG --inputbox "Enter the full URL to repositories." 8 65 \
|
||||
"" 2>"${ANSWER}" || return 1
|
||||
SYNC_URL=$(cat "${ANSWER}")
|
||||
"" 2>"${_ANSWER}" || return 1
|
||||
SYNC_URL=$(cat "${_ANSWER}")
|
||||
else
|
||||
# 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
|
||||
|
|
|
@ -83,8 +83,8 @@ check_efisys_part() {
|
|||
#autodetect efisys mountpoint, on fail ask for mountpoint
|
||||
UEFISYS_MP="/$(basename "$(mount | grep "${UEFISYS_PART}" | cut -d " " -f 3)")"
|
||||
if [[ "${UEFISYS_MP}" == "/" ]]; then
|
||||
DIALOG --inputbox "Enter the mountpoint of your EFI System partition (Default is /boot): " 0 0 "/boot" 2>"${ANSWER}" || return 1
|
||||
UEFISYS_MP="$(cat "${ANSWER}")"
|
||||
DIALOG --inputbox "Enter the mountpoint of your EFI System partition (Default is /boot): " 0 0 "/boot" 2>"${_ANSWER}" || return 1
|
||||
UEFISYS_MP="$(cat "${_ANSWER}")"
|
||||
fi
|
||||
umount "${DESTDIR}/${UEFISYS_MP}" &> /dev/null
|
||||
umount "${UEFISYS_PART}" &> /dev/null
|
||||
|
@ -128,11 +128,11 @@ partition() {
|
|||
while true; do
|
||||
# Prompt the user with a list of known disks
|
||||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select the disk you want to partition:" 14 55 7 ${DISCS} 2>"${ANSWER}" || return 1
|
||||
DISC=$(cat "${ANSWER}")
|
||||
DIALOG --menu "Select the disk you want to partition:" 14 55 7 ${DISCS} 2>"${_ANSWER}" || return 1
|
||||
DISC=$(cat "${_ANSWER}")
|
||||
if [[ "${DISC}" == "OTHER" ]]; then
|
||||
DIALOG --inputbox "Enter the full path to the device you wish to partition" 8 65 "/dev/sda" 2>"${ANSWER}" || DISC=""
|
||||
DISC=$(cat "${ANSWER}")
|
||||
DIALOG --inputbox "Enter the full path to the device you wish to partition" 8 65 "/dev/sda" 2>"${_ANSWER}" || DISC=""
|
||||
DISC=$(cat "${_ANSWER}")
|
||||
fi
|
||||
# Leave our loop if the user is done partitioning
|
||||
[[ "${DISC}" == "DONE" ]] && break
|
||||
|
|
|
@ -16,9 +16,9 @@ create_special() {
|
|||
"1" "Manage Software Raid" \
|
||||
"2" "Manage LVM2" \
|
||||
"3" "Manage Luks encryption" \
|
||||
"4" "Return to Previous Menu" 2>"${ANSWER}" || CANCEL="1"
|
||||
NEXTITEM="$(cat "${ANSWER}")"
|
||||
case $(cat "${ANSWER}") in
|
||||
"4" "Return to Previous Menu" 2>"${_ANSWER}" || CANCEL="1"
|
||||
NEXTITEM="$(cat "${_ANSWER}")"
|
||||
case $(cat "${_ANSWER}") in
|
||||
"1")
|
||||
_createmd ;;
|
||||
"2")
|
||||
|
@ -53,9 +53,9 @@ _createmd() {
|
|||
"2" "Create Partitionable Software Raid" \
|
||||
"3" "Reset Software Raid" \
|
||||
"4" "Raid Help" \
|
||||
"5" "Return to Previous Menu" 2>"${ANSWER}" || CANCEL="1"
|
||||
NEXTITEM="$(cat "${ANSWER}")"
|
||||
case $(cat "${ANSWER}") in
|
||||
"5" "Return to Previous Menu" 2>"${_ANSWER}" || CANCEL="1"
|
||||
NEXTITEM="$(cat "${_ANSWER}")"
|
||||
case $(cat "${_ANSWER}") in
|
||||
"1")
|
||||
RAID_PARTITION=""
|
||||
_raid ;;
|
||||
|
@ -91,9 +91,9 @@ _createlvm() {
|
|||
"3" "Create Logical Volume" \
|
||||
"4" "Reset Logical Volume" \
|
||||
"5" "LVM Help" \
|
||||
"6" "Return to Previous Menu" 2>"${ANSWER}" || CANCEL="1"
|
||||
NEXTITEM="$(cat "${ANSWER}")"
|
||||
case $(cat "${ANSWER}") in
|
||||
"6" "Return to Previous Menu" 2>"${_ANSWER}" || CANCEL="1"
|
||||
NEXTITEM="$(cat "${_ANSWER}")"
|
||||
case $(cat "${_ANSWER}") in
|
||||
"1")
|
||||
_createpv ;;
|
||||
"2")
|
||||
|
@ -127,9 +127,9 @@ _createluks() {
|
|||
"1" "Create Luks" \
|
||||
"2" "Reset Luks Encryption completely" \
|
||||
"3" "Luks Help" \
|
||||
"4" "Return to Previous Menu" 2>"${ANSWER}" || CANCEL="1"
|
||||
NEXTITEM="$(cat "${ANSWER}")"
|
||||
case $(cat "${ANSWER}") in
|
||||
"4" "Return to Previous Menu" 2>"${_ANSWER}" || CANCEL="1"
|
||||
NEXTITEM="$(cat "${_ANSWER}")"
|
||||
case $(cat "${_ANSWER}") in
|
||||
"1")
|
||||
_luks ;;
|
||||
"2")
|
||||
|
|
Loading…
Reference in a new issue