mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
use GUIDPARAMETER numeric instead of yes
This commit is contained in:
parent
c1b2a5c766
commit
5dbefafb0a
5 changed files with 23 additions and 23 deletions
|
@ -44,7 +44,7 @@ autoprepare() {
|
||||||
if [[ "${NAME_SCHEME_PARAMETER_RUN}" == "" ]]; then
|
if [[ "${NAME_SCHEME_PARAMETER_RUN}" == "" ]]; then
|
||||||
set_device_name_scheme || return 1
|
set_device_name_scheme || return 1
|
||||||
fi
|
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
|
DIALOG --inputbox "Enter the mountpoint of your UEFI SYSTEM PARTITION (Default is /boot) : " 10 60 "/boot" 2>"${ANSWER}" || return 1
|
||||||
UEFISYS_MOUNTPOINT="$(cat "${ANSWER}")"
|
UEFISYS_MOUNTPOINT="$(cat "${ANSWER}")"
|
||||||
fi
|
fi
|
||||||
|
@ -63,14 +63,14 @@ autoprepare() {
|
||||||
[[ "$(which mkfs.nilfs2 2>/dev/null)" ]] && FSOPTS="${FSOPTS} nilfs2 Nilfs2"
|
[[ "$(which mkfs.nilfs2 2>/dev/null)" ]] && FSOPTS="${FSOPTS} nilfs2 Nilfs2"
|
||||||
[[ "$(which mkfs.jfs 2>/dev/null)" ]] && FSOPTS="${FSOPTS} jfs JFS"
|
[[ "$(which mkfs.jfs 2>/dev/null)" ]] && FSOPTS="${FSOPTS} jfs JFS"
|
||||||
# create 1 MB bios_grub partition for grub BIOS GPT support
|
# create 1 MB bios_grub partition for grub BIOS GPT support
|
||||||
if [[ "${GUIDPARAMETER}" = "yes" ]]; then
|
if [[ "${GUIDPARAMETER}" = "1" ]]; then
|
||||||
GUID_PART_SIZE="2"
|
GUID_PART_SIZE="2"
|
||||||
GPT_BIOS_GRUB_PART_SIZE="${GUID_PART_SIZE}"
|
GPT_BIOS_GRUB_PART_SIZE="${GUID_PART_SIZE}"
|
||||||
_PART_NUM="1"
|
_PART_NUM="1"
|
||||||
_GPT_BIOS_GRUB_PART_NUM="${_PART_NUM}"
|
_GPT_BIOS_GRUB_PART_NUM="${_PART_NUM}"
|
||||||
DISC_SIZE="$((DISC_SIZE-GUID_PART_SIZE))"
|
DISC_SIZE="$((DISC_SIZE-GUID_PART_SIZE))"
|
||||||
fi
|
fi
|
||||||
if [[ "${GUIDPARAMETER}" = "yes" ]]; 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
|
||||||
|
@ -207,7 +207,7 @@ autoprepare() {
|
||||||
# disable swap and all mounted partitions, umount / last!
|
# disable swap and all mounted partitions, umount / last!
|
||||||
_umountall
|
_umountall
|
||||||
# we assume a /dev/sdX,/dev/vdX or /dev/nvmeXnY format
|
# 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'
|
# GPT (GUID) is supported only by 'parted' or 'sgdisk'
|
||||||
printk off
|
printk off
|
||||||
DIALOG --infobox "Partitioning ${DEVICE} ..." 0 0
|
DIALOG --infobox "Partitioning ${DEVICE} ..." 0 0
|
||||||
|
@ -274,7 +274,7 @@ autoprepare() {
|
||||||
_FSSPEC_SWAP_PART="${_SWAP_PART_NUM}:swap:swap::SWAP_ARCH"
|
_FSSPEC_SWAP_PART="${_SWAP_PART_NUM}:swap:swap::SWAP_ARCH"
|
||||||
_FSSPEC_BOOT_PART="${_BOOT_PART_NUM}:/boot:ext2::BOOT_ARCH"
|
_FSSPEC_BOOT_PART="${_BOOT_PART_NUM}:/boot:ext2::BOOT_ARCH"
|
||||||
_FSSPEC_UEFISYS_PART="${_UEFISYS_PART_NUM}:${UEFISYS_MOUNTPOINT}:vfat:-F32:EFISYS"
|
_FSSPEC_UEFISYS_PART="${_UEFISYS_PART_NUM}:${UEFISYS_MOUNTPOINT}:vfat:-F32:EFISYS"
|
||||||
if [[ "${GUIDPARAMETER}" == "yes" ]]; then
|
if [[ "${GUIDPARAMETER}" == "1" ]]; then
|
||||||
if [[ "${_UEFISYS_BOOTPART}" == "1" ]]; then
|
if [[ "${_UEFISYS_BOOTPART}" == "1" ]]; then
|
||||||
FSSPECS="${_FSSPEC_ROOT_PART} ${_FSSPEC_UEFISYS_PART} ${_FSSPEC_HOME_PART} ${_FSSPEC_SWAP_PART}"
|
FSSPECS="${_FSSPEC_ROOT_PART} ${_FSSPEC_UEFISYS_PART} ${_FSSPEC_HOME_PART} ${_FSSPEC_SWAP_PART}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -675,7 +675,7 @@ _createraid()
|
||||||
if [[ ${RAID_PARTITION} == "1" ]]; then
|
if [[ ${RAID_PARTITION} == "1" ]]; then
|
||||||
# switch for mbr usage
|
# switch for mbr usage
|
||||||
set_guid
|
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
|
DIALOG --msgbox "Now you'll be put into the cfdisk program where you can partition your raiddevice to your needs." 6 70
|
||||||
cfdisk "${RAIDDEVICE}"
|
cfdisk "${RAIDDEVICE}"
|
||||||
else
|
else
|
||||||
|
|
|
@ -169,19 +169,19 @@ uefi_mount_efivarfs() {
|
||||||
do_uefi_setup_env_vars() {
|
do_uefi_setup_env_vars() {
|
||||||
if [[ "${RUNNING_ARCH}" == "x86_64" ]]; then
|
if [[ "${RUNNING_ARCH}" == "x86_64" ]]; then
|
||||||
if grep -q '_IA32_UEFI=1' /proc/cmdline 1>/dev/null; then
|
if grep -q '_IA32_UEFI=1' /proc/cmdline 1>/dev/null; then
|
||||||
export _EFI_MIXED="1"
|
_EFI_MIXED="1"
|
||||||
export _UEFI_ARCH="IA32"
|
_UEFI_ARCH="IA32"
|
||||||
export _SPEC_UEFI_ARCH="ia32"
|
_SPEC_UEFI_ARCH="ia32"
|
||||||
else
|
else
|
||||||
export _EFI_MIXED="0"
|
_EFI_MIXED="0"
|
||||||
export _UEFI_ARCH="X64"
|
_UEFI_ARCH="X64"
|
||||||
export _SPEC_UEFI_ARCH="x64"
|
_SPEC_UEFI_ARCH="x64"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "${RUNNING_ARCH}" == "aarch64" ]]; then
|
if [[ "${RUNNING_ARCH}" == "aarch64" ]]; then
|
||||||
export _EFI_MIXED="0"
|
_EFI_MIXED="0"
|
||||||
export _UEFI_ARCH="AA64"
|
_UEFI_ARCH="AA64"
|
||||||
export _SPEC_UEFI_ARCH="aa64"
|
_SPEC_UEFI_ARCH="aa64"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,33 +155,33 @@ locale_gen() {
|
||||||
|
|
||||||
# set GUID (gpt) usage
|
# set GUID (gpt) usage
|
||||||
set_guid() {
|
set_guid() {
|
||||||
export GUIDPARAMETER=""
|
GUIDPARAMETER="0"
|
||||||
detect_uefi_boot
|
detect_uefi_boot
|
||||||
# all uefi systems should use GUID layout
|
# all uefi systems should use GUID layout
|
||||||
if [[ "${_DETECTED_UEFI_BOOT}" == "1" ]]; then
|
if [[ "${_DETECTED_UEFI_BOOT}" == "1" ]]; then
|
||||||
GUIDPARAMETER="yes"
|
GUIDPARAMETER="1"
|
||||||
else
|
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 - 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
|
## 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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
detect_uefi_secure_boot() {
|
detect_uefi_secure_boot() {
|
||||||
export _DETECTED_UEFI_SECURE_BOOT="0"
|
_DETECTED_UEFI_SECURE_BOOT="0"
|
||||||
if [[ "${_DETECTED_UEFI_BOOT}" == "1" ]]; then
|
if [[ "${_DETECTED_UEFI_BOOT}" == "1" ]]; then
|
||||||
uefi_mount_efivarfs
|
uefi_mount_efivarfs
|
||||||
_SECUREBOOT_VAR_VALUE="$(efivar -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-SecureBoot 2>/dev/null | tail -n -1 | awk '{print $2}')"
|
_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}')"
|
_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
|
if [[ "${_SECUREBOOT_VAR_VALUE}" == "01" ]] && [[ "${_SETUPMODE_VAR_VALUE}" == "00" ]]; then
|
||||||
export _DETECTED_UEFI_SECURE_BOOT="1"
|
_DETECTED_UEFI_SECURE_BOOT="1"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
detect_uefi_boot() {
|
detect_uefi_boot() {
|
||||||
export _DETECTED_UEFI_BOOT="0"
|
_DETECTED_UEFI_BOOT="0"
|
||||||
[[ -e "/sys/firmware/efi" ]] && export _DETECTED_UEFI_BOOT="1"
|
[[ -e "/sys/firmware/efi" ]] && _DETECTED_UEFI_BOOT="1"
|
||||||
detect_uefi_secure_boot
|
detect_uefi_secure_boot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ partition() {
|
||||||
[[ "${DISC}" == "DONE" ]] && break
|
[[ "${DISC}" == "DONE" ]] && break
|
||||||
MSDOS_DETECTED=""
|
MSDOS_DETECTED=""
|
||||||
if ! [[ "${DISC}" == "" ]]; then
|
if ! [[ "${DISC}" == "" ]]; then
|
||||||
if [[ "${GUIDPARAMETER}" == "yes" ]]; then
|
if [[ "${GUIDPARAMETER}" == "1" ]]; then
|
||||||
CHECK_BIOS_BOOT_GRUB=""
|
CHECK_BIOS_BOOT_GRUB=""
|
||||||
CHECK_UEFISYS_PART=""
|
CHECK_UEFISYS_PART=""
|
||||||
RUN_CFDISK="1"
|
RUN_CFDISK="1"
|
||||||
|
|
Loading…
Reference in a new issue