From 5db81c454cc4071283800876c49cce5e40895049 Mon Sep 17 00:00:00 2001 From: David P Date: Sun, 17 Jul 2022 19:31:08 -0400 Subject: drop refind Signed-off-by: David P --- CHANGELOG.rst | 1 + configs/releng/grub/grub.cfg | 2 +- parabolaiso/mkparabolaiso | 183 +++---------------------------------------- 3 files changed, 12 insertions(+), 174 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 901d175..0411415 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -36,6 +36,7 @@ Removed - Remove the custom pacman hook that ran ``locale-gen`` on glibc install from the releng profile. The used locale now ships with the glibc package itself. +- Drop parabolaiso rEFInd support in favor of upstream archiso GRUB EFI bootmode. [64] - 2022-05-30 ================= diff --git a/configs/releng/grub/grub.cfg b/configs/releng/grub/grub.cfg index e5ef077..c8c885e 100644 --- a/configs/releng/grub/grub.cfg +++ b/configs/releng/grub/grub.cfg @@ -34,7 +34,7 @@ menuentry "Parabola GNU/Linux-libre install medium (x86_64, UEFI)" --class arch set gfxpayload=keep search --no-floppy --set=root --label %PARABOLAISO_LABEL% linux /%INSTALL_DIR%/boot/x86_64/vmlinuz-linux-libre parabolaisobasedir=%INSTALL_DIR% parabolaisolabel=%PARABOLAISO_LABEL% - initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux.img + initrd /%INSTALL_DIR%/boot/x86_64/initramfs-linux-libre.img } menuentry "Parabola GNU/Linux-libre install medium with speakup screen reader (x86_64, UEFI)" --hotkey s --class arch --class gnu-linux --class gnu --class os --id 'parabola-accessibility' { diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index 94fc352..3fd3f5b 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -578,7 +578,6 @@ EOF --modules="part_gpt part_msdos fat iso9660" \ --locales="en@quot" \ --themes="" \ - --sbat=/usr/share/grub/sbat.csv \ -o "${work_dir}/BOOTIA32.EFI" "boot/grub/grub.cfg=${work_dir}/grub-embed.cfg" # Add GRUB to the list of files used to calculate the required FAT image size. efiboot_files+=("${work_dir}/BOOTIA32.EFI" @@ -663,7 +662,6 @@ EOF --modules="part_gpt part_msdos fat iso9660" \ --locales="en@quot" \ --themes="" \ - --sbat=/usr/share/grub/sbat.csv \ -o "${work_dir}/BOOTx64.EFI" "boot/grub/grub.cfg=${work_dir}/grub-embed.cfg" # Add GRUB to the list of files used to calculate the required FAT image size. efiboot_files+=("${work_dir}/BOOTx64.EFI" @@ -795,83 +793,6 @@ _make_bootmode_uefi-x64.systemd-boot.eltorito() { _msg_info "Done!" } -# Prepare rEFInd for booting when written to a disk (isohybrid) -_make_bootmode_uefi-x64.refind.esp() { - local efiboot_imgsize - _msg_info "Setting up rEFInd for UEFI booting..." - - # Calculate the required FAT image size in bytes - efiboot_files+=("${pacstrap_dir}/usr/share/refind/refind_x64.efi" \ - "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" \ - "${profile}/efiboot/" \ - "${pacstrap_dir}/boot/vmlinuz-"* \ - "${pacstrap_dir}/boot/initramfs-"*".img") - efiboot_imgsize="$(du -bc "${efiboot_files[@]}" \ - 2>/dev/null | awk 'END { print $1 }')" - # Create a FAT image for the EFI system partition - _make_efibootimg "$efiboot_imgsize" - - # Copy rEFInd EFI binary to the default/fallback boot path - mcopy -i "${work_dir}/efiboot.img" \ - "${pacstrap_dir}/usr/share/refind/refind_x64.efi" ::/EFI/BOOT/BOOTx64.EFI - - # Copy rEFInd configuration files - mmd -i "${work_dir}/efiboot.img" ::/EFI/BOOT/entries - mcopy -i "${work_dir}/efiboot.img" "${profile}/efiboot/refind.conf" ::/EFI/BOOT/ - for _conf in "${profile}/efiboot/entries/"*".conf"; do - sed "s|%PARABOLAISO_LABEL%|${iso_label}|g; - s|%INSTALL_DIR%|${install_dir}|g; - s|%ARCH%|${arch}|g" \ - "${_conf}" | mcopy -i "${work_dir}/efiboot.img" - "::/EFI/BOOT/entries/${_conf##*/}" - done - - # shellx64.efi is picked up automatically when on / - if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then - mcopy -i "${work_dir}/efiboot.img" \ - "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ::/shellx64.efi - fi - - # Copy kernel and initramfs to FAT image. - _make_boot_on_fat - - _msg_info "Done! rEFInd set up for UEFI booting successfully." -} - -# Prepare rEFInd for El Torito booting -_make_bootmode_uefi-x64.refind.eltorito() { - # El Torito UEFI boot requires an image containing the EFI system partition. - # uefi-x64.refind.eltorito has the same requirements as uefi-x64.refind.esp - _run_once _make_bootmode_uefi-x64.refind.esp - - # Additionally set up rEFInd in ISO 9660. This allows creating a medium for the live environment by using - # manual partitioning and simply copying the ISO 9660 file system contents. - # This is not related to El Torito booting and no firmware uses these files. - _msg_info "Preparing an /EFI directory for the ISO 9660 file system..." - install -d -m 0755 -- "${isofs_dir}/EFI/BOOT" - - # Copy rEFInd EFI binary to the default/fallback boot path - install -m 0644 -- "${pacstrap_dir}/usr/share/refind/refind_x64.efi" \ - "${isofs_dir}/EFI/BOOT/BOOTx64.EFI" - - # Copy rEFInd configuration files - install -d -m 0755 -- "${isofs_dir}/EFI/BOOT/entries" - install -m 0644 -- "${profile}/efiboot/refind.conf" "${isofs_dir}/EFI/BOOT/" - for _conf in "${profile}/efiboot/entries/"*".conf"; do - sed "s|%PARABOLAISO_LABEL%|${iso_label}|g; - s|%INSTALL_DIR%|${install_dir}|g; - s|%ARCH%|${arch}|g" \ - "${_conf}" > "${isofs_dir}/EFI/BOOT/entries/${_conf##*/}" - done - - # edk2-shell based UEFI shell - # shellx64.efi is picked up automatically when on / - if [[ -e "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" ]]; then - install -m 0644 -- "${pacstrap_dir}/usr/share/edk2-shell/x64/Shell_Full.efi" "${isofs_dir}/shellx64.efi" - fi - - _msg_info "Done!" -} - _validate_requirements_bootmode_bios.syslinux.mbr() { # bios.syslinux.mbr requires bios.syslinux.eltorito # shellcheck disable=SC2076 @@ -915,11 +836,10 @@ _validate_requirements_bootmode_bios.syslinux.eltorito() { _validate_requirements_bootmode_bios.syslinux.mbr } -_validate_common_requirements_bootmode_uefi-x64() { - # Check if we are building an x64 system - if [[ "${arch}" != @("dual"|"x86_64") ]]; then - (( validation_error=validation_error+1 )) - _msg_error "Validating '${bootmode}': This bootmode is available for 'dual' and 'x86_64' architectures only!" 0 +_validate_requirements_bootmode_uefi-x64.systemd-boot.esp() { + # shellcheck disable=SC2076 + if [[ " ${bootmodes[*]} " =~ ' uefi-x64.grub.esp ' ]]; then + _msg_error "Validating '${bootmode}': cannot be used with bootmode uefi-x64.grub.esp!" 0 fi # Check if mkfs.fat is available @@ -934,19 +854,6 @@ _validate_common_requirements_bootmode_uefi-x64() { _msg_error "Validating '${bootmode}': mmd and/or mcopy are not available on this host. Install 'mtools'!" 0 fi - # Check for optional packages - if [[ ! " ${pkg_list[*]} " =~ ' edk2-shell ' ]]; then - _msg_info "'edk2-shell' is not in the package list. The ISO will not contain a bootable UEFI shell." - fi -} - -_validate_requirements_bootmode_uefi-x64.systemd-boot.esp() { - # shellcheck disable=SC2076 - if [[ " ${bootmodes[*]} " =~ ' uefi-x64.grub.esp ' ]]; then - _msg_error "Validating '${bootmode}': cannot be used with bootmode uefi-x64.grub.esp!" 0 - fi - - _validate_common_requirements_bootmode_uefi-x64 # Check if systemd-boot configuration files exist if [[ ! -d "${profile}/efiboot/loader/entries" ]]; then (( validation_error=validation_error+1 )) @@ -966,6 +873,12 @@ _validate_requirements_bootmode_uefi-x64.systemd-boot.esp() { fi done fi + + # Check for optional packages + # shellcheck disable=SC2076 + if [[ ! " ${pkg_list[*]} " =~ ' edk2-shell ' ]]; then + _msg_info "'edk2-shell' is not in the package list. The ISO will not contain a bootable UEFI shell." + fi } _validate_requirements_bootmode_uefi-x64.systemd-boot.eltorito() { @@ -1000,34 +913,6 @@ _validate_requirements_bootmode_uefi-ia32.grub.eltorito() { _validate_requirements_bootmode_uefi-ia32.grub.esp } -_validate_requirements_bootmode_uefi-x64.refind.esp() { - _validate_common_requirements_bootmode_uefi-x64 - # Check if rEFInd configuration files exist - if [[ ! -d "${profile}/efiboot/entries" ]]; then - (( validation_error=validation_error+1 )) - _msg_error "Validating '${bootmode}': The '${profile}/efiboot/entries' directory is missing!" 0 - else - if [[ ! -e "${profile}/efiboot/refind.conf" ]]; then - (( validation_error=validation_error+1 )) - _msg_error "Validating '${bootmode}': File '${profile}/efiboot/refind.conf' not found!" 0 - fi - local conffile - for conffile in "${profile}/efiboot/entries/"*'.conf'; do - if [[ -e "${conffile}" ]]; then - break - else - (( validation_error=validation_error+1 )) - _msg_error "Validating '${bootmode}': No configuration file found in '${profile}/efiboot/entries/'!" 0 - fi - done - fi -} - -_validate_requirements_bootmode_uefi-x64.refind.eltorito() { - # uefi-x64.refind.eltorito has the exact same requirements as uefi-x64.refind.esp - _validate_requirements_bootmode_uefi-x64.refind.esp -} - _validate_requirements_bootmode_uefi-x64.grub.esp() { # shellcheck disable=SC2076 if [[ " ${bootmodes[*]} " =~ ' uefi-x64.systemd-boot.esp ' ]]; then @@ -1515,54 +1400,6 @@ _add_xorrisofs_options_uefi-x64.grub.eltorito() { [[ " ${bootmodes[*]} " =~ ' bios.' ]] || xorrisofs_options+=('-eltorito-catalog' 'EFI/boot.cat') } -# rEFInd in an attached EFI system partition -_add_xorrisofs_options_uefi-x64.refind.esp() { - # _add_xorrisofs_options_uefi-x64.refind.esp does the exact same thing as _add_xorrisofs_options_uefi-x64.systemd-boot.esp - _add_xorrisofs_options_uefi-x64.systemd-boot.esp -} - -# rEFInd via El Torito -_add_xorrisofs_options_uefi-x64.refind.eltorito() { - # shellcheck disable=SC2076 - if [[ " ${bootmodes[*]} " =~ ' uefi-x64.refind.esp ' ]]; then - # rEFInd in an attached EFI system partition via El Torito - xorrisofs_options+=( - # Start a new El Torito boot entry for UEFI - '-eltorito-alt-boot' - # Set the second partition as the El Torito UEFI boot image - '-e' '--interval:appended_partition_2:all::' - # Boot image is not emulating floppy or hard disk; required for all known boot loaders - '-no-emul-boot' - ) - # A valid GPT prevents BIOS booting on some systems, use an invalid GPT instead. - if [[ " ${bootmodes[*]} " =~ ' bios.syslinux.mbr ' ]]; then - # If '-isohybrid-gpt-basdat' is specified before '-e', then the appended EFI system partition will have the - # EFI system partition type ID/GUID in both MBR and GPT. If '-isohybrid-gpt-basdat' is specified after '-e', - # the appended EFI system partition will have the Microsoft basic data type GUID in GPT. - if [[ ! " ${xorrisofs_options[*]} " =~ ' -isohybrid-gpt-basdat ' ]]; then - xorrisofs_options+=('-isohybrid-gpt-basdat') - fi - fi - else - # The ISO will not contain a GPT partition table, so to be able to reference efiboot.img, place it as a - # file inside the ISO 9660 file system - install -d -m 0755 -- "${isofs_dir}/EFI/parabolaiso" - cp -a -- "${work_dir}/efiboot.img" "${isofs_dir}/EFI/parabolaiso/efiboot.img" - # rEFInd in an embedded efiboot.img via El Torito - xorrisofs_options+=( - # Start a new El Torito boot entry for UEFI - '-eltorito-alt-boot' - # Set efiboot.img as the El Torito UEFI boot image - '-e' 'EFI/parabolaiso/efiboot.img' - # Boot image is not emulating floppy or hard disk; required for all known boot loaders - '-no-emul-boot' - ) - fi - # Specify where to save the El Torito boot catalog file in case it is not already set by bios.syslinux.eltorito - # shellcheck disable=SC2076 - [[ " ${bootmodes[*]} " =~ ' bios.' ]] || xorrisofs_options+=('-eltorito-catalog' 'EFI/boot.cat') -} - # Build bootstrap image _build_bootstrap_image() { local _bootstrap_parent -- cgit v1.2.2