use GUIDPARAMETER numeric instead of yes

This commit is contained in:
Tobias Powalowski 2022-12-29 12:02:31 +01:00
parent c1b2a5c766
commit 5dbefafb0a
5 changed files with 23 additions and 23 deletions

View file

@ -44,7 +44,7 @@ autoprepare() {
if [[ "${NAME_SCHEME_PARAMETER_RUN}" == "" ]]; then
set_device_name_scheme || return 1
fi
if [[ "${GUIDPARAMETER}" = "yes" ]]; 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
UEFISYS_MOUNTPOINT="$(cat "${ANSWER}")"
fi
@ -63,14 +63,14 @@ autoprepare() {
[[ "$(which mkfs.nilfs2 2>/dev/null)" ]] && FSOPTS="${FSOPTS} nilfs2 Nilfs2"
[[ "$(which mkfs.jfs 2>/dev/null)" ]] && FSOPTS="${FSOPTS} jfs JFS"
# create 1 MB bios_grub partition for grub BIOS GPT support
if [[ "${GUIDPARAMETER}" = "yes" ]]; then
if [[ "${GUIDPARAMETER}" = "1" ]]; then
GUID_PART_SIZE="2"
GPT_BIOS_GRUB_PART_SIZE="${GUID_PART_SIZE}"
_PART_NUM="1"
_GPT_BIOS_GRUB_PART_NUM="${_PART_NUM}"
DISC_SIZE="$((DISC_SIZE-GUID_PART_SIZE))"
fi
if [[ "${GUIDPARAMETER}" = "yes" ]]; then
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
@ -207,7 +207,7 @@ autoprepare() {
# disable swap and all mounted partitions, umount / last!
_umountall
# we assume a /dev/sdX,/dev/vdX or /dev/nvmeXnY format
if [[ "${GUIDPARAMETER}" == "yes" ]]; then
if [[ "${GUIDPARAMETER}" == "1" ]]; then
# GPT (GUID) is supported only by 'parted' or 'sgdisk'
printk off
DIALOG --infobox "Partitioning ${DEVICE} ..." 0 0
@ -274,7 +274,7 @@ autoprepare() {
_FSSPEC_SWAP_PART="${_SWAP_PART_NUM}:swap:swap::SWAP_ARCH"
_FSSPEC_BOOT_PART="${_BOOT_PART_NUM}:/boot:ext2::BOOT_ARCH"
_FSSPEC_UEFISYS_PART="${_UEFISYS_PART_NUM}:${UEFISYS_MOUNTPOINT}:vfat:-F32:EFISYS"
if [[ "${GUIDPARAMETER}" == "yes" ]]; then
if [[ "${GUIDPARAMETER}" == "1" ]]; then
if [[ "${_UEFISYS_BOOTPART}" == "1" ]]; then
FSSPECS="${_FSSPEC_ROOT_PART} ${_FSSPEC_UEFISYS_PART} ${_FSSPEC_HOME_PART} ${_FSSPEC_SWAP_PART}"
else

View file

@ -675,7 +675,7 @@ _createraid()
if [[ ${RAID_PARTITION} == "1" ]]; then
# switch for mbr usage
set_guid
if [[ "${GUIDPARAMETER}" = "" ]]; then
if [[ "${GUIDPARAMETER}" = "0" ]]; then
DIALOG --msgbox "Now you'll be put into the cfdisk program where you can partition your raiddevice to your needs." 6 70
cfdisk "${RAIDDEVICE}"
else

View file

@ -169,19 +169,19 @@ uefi_mount_efivarfs() {
do_uefi_setup_env_vars() {
if [[ "${RUNNING_ARCH}" == "x86_64" ]]; then
if grep -q '_IA32_UEFI=1' /proc/cmdline 1>/dev/null; then
export _EFI_MIXED="1"
export _UEFI_ARCH="IA32"
export _SPEC_UEFI_ARCH="ia32"
_EFI_MIXED="1"
_UEFI_ARCH="IA32"
_SPEC_UEFI_ARCH="ia32"
else
export _EFI_MIXED="0"
export _UEFI_ARCH="X64"
export _SPEC_UEFI_ARCH="x64"
_EFI_MIXED="0"
_UEFI_ARCH="X64"
_SPEC_UEFI_ARCH="x64"
fi
fi
if [[ "${RUNNING_ARCH}" == "aarch64" ]]; then
export _EFI_MIXED="0"
export _UEFI_ARCH="AA64"
export _SPEC_UEFI_ARCH="aa64"
_EFI_MIXED="0"
_UEFI_ARCH="AA64"
_SPEC_UEFI_ARCH="aa64"
fi
}

View file

@ -155,33 +155,33 @@ locale_gen() {
# set GUID (gpt) usage
set_guid() {
export GUIDPARAMETER=""
GUIDPARAMETER="0"
detect_uefi_boot
# all uefi systems should use GUID layout
if [[ "${_DETECTED_UEFI_BOOT}" == "1" ]]; then
GUIDPARAMETER="yes"
GUIDPARAMETER="1"
else
## 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
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 && export GUIDPARAMETER="yes"
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
}
detect_uefi_secure_boot() {
export _DETECTED_UEFI_SECURE_BOOT="0"
_DETECTED_UEFI_SECURE_BOOT="0"
if [[ "${_DETECTED_UEFI_BOOT}" == "1" ]]; then
uefi_mount_efivarfs
_SECUREBOOT_VAR_VALUE="$(efivar -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-SecureBoot 2>/dev/null | tail -n -1 | awk '{print $2}')"
_SETUPMODE_VAR_VALUE="$(efivar -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-SetupMode 2>/dev/null | tail -n -1 | awk '{print $2}')"
if [[ "${_SECUREBOOT_VAR_VALUE}" == "01" ]] && [[ "${_SETUPMODE_VAR_VALUE}" == "00" ]]; then
export _DETECTED_UEFI_SECURE_BOOT="1"
_DETECTED_UEFI_SECURE_BOOT="1"
fi
fi
}
detect_uefi_boot() {
export _DETECTED_UEFI_BOOT="0"
[[ -e "/sys/firmware/efi" ]] && export _DETECTED_UEFI_BOOT="1"
_DETECTED_UEFI_BOOT="0"
[[ -e "/sys/firmware/efi" ]] && _DETECTED_UEFI_BOOT="1"
detect_uefi_secure_boot
}

View file

@ -138,7 +138,7 @@ partition() {
[[ "${DISC}" == "DONE" ]] && break
MSDOS_DETECTED=""
if ! [[ "${DISC}" == "" ]]; then
if [[ "${GUIDPARAMETER}" == "yes" ]]; then
if [[ "${GUIDPARAMETER}" == "1" ]]; then
CHECK_BIOS_BOOT_GRUB=""
CHECK_UEFISYS_PART=""
RUN_CFDISK="1"