From f2c73ac37bc1b67adb622e785b0e9a5e2ed55708 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Sun, 15 May 2022 10:10:52 +0200 Subject: [PATCH] add EFISTUB boot option to GRUB --- usr/lib/archboot/iso.sh | 24 +++++++++++++++++++ .../archboot/grub/archboot-main-grub.cfg | 10 ++++++++ .../loader/entries/archboot-aa64-local.conf | 6 +++++ .../boot/loader/entries/archboot-aa64.conf | 5 ++++ .../loader/entries/archboot-x64-local.conf | 7 ++++++ .../boot/loader/entries/archboot-x64.conf | 6 +++++ .../systemd-boot/boot/loader/loader-aa64.conf | 2 ++ .../systemd-boot/boot/loader/loader-x64.conf | 2 ++ 8 files changed, 62 insertions(+) create mode 100644 usr/share/archboot/systemd-boot/boot/loader/entries/archboot-aa64-local.conf create mode 100644 usr/share/archboot/systemd-boot/boot/loader/entries/archboot-aa64.conf create mode 100644 usr/share/archboot/systemd-boot/boot/loader/entries/archboot-x64-local.conf create mode 100644 usr/share/archboot/systemd-boot/boot/loader/entries/archboot-x64.conf create mode 100644 usr/share/archboot/systemd-boot/boot/loader/loader-aa64.conf create mode 100644 usr/share/archboot/systemd-boot/boot/loader/loader-x64.conf diff --git a/usr/lib/archboot/iso.sh b/usr/lib/archboot/iso.sh index 0046d4d91..e1b65ba6d 100644 --- a/usr/lib/archboot/iso.sh +++ b/usr/lib/archboot/iso.sh @@ -138,6 +138,30 @@ _prepare_background() { cp ${_GRUB_BACKGROUND} "${_ISODIR}/boot/grub/archboot-background.png" } +_prepare_systemd-boot_X64() { + echo "Prepare X64 systemd-boot ..." + [[ -d ${_ISODIR}/boot/systemd-boot ]] || mkdir -p ${_ISODIR}/boot/systemd-boot + [[ -d ${_ISODIR}/boot/systemd-boot ]] || mkdir -p ${_ISODIR}/boot/loader/entries + cp /usr/lib/systemd/boot/efi/systemd-bootx64.efi ${_ISODIR}/boot/systemd-boot/ + cp /usr/share/archboot/systemd-boot/boot/loader/loader-x64.conf \ + ${_ISODIR}/boot/systemd-boot/loader-x64.conf +} + +_prepare_systemd-boot_AA64() { + echo "Prepare AA64 systemd-boot ..." + [[ -d ${_ISODIR}/boot/systemd-boot ]] || mkdir -p ${_ISODIR}/boot/systemd-boot + [[ -d ${_ISODIR}/boot/systemd-boot ]] || mkdir -p ${_ISODIR}/boot/loader/entries + cp /usr/lib/systemd/boot/efi/systemd-bootaa64.efi ${_ISODIR}/boot/systemd-boot/ + cp /usr/share/archboot/systemd-boot/boot/loader/loader-aa64.conf \ + ${_ISODIR}/boot/systemd-boot/loader-aa64.conf +} + +_prepare_systemd-boot_entry() { + echo "Prepare systemd-boot entry ..." + cp /usr/share/archboot/systemd-boot/boot/loader/entries/archboot-${1}.conf \ + ${_ISODIR}/boot/systemd-boot/entries/archboot-${1}.conf +} + _reproducibility() { # Reproducibility: set all timestamps to 0 # from /usr/bin/mkinitcpio diff --git a/usr/share/archboot/grub/archboot-main-grub.cfg b/usr/share/archboot/grub/archboot-main-grub.cfg index 3f59bbb24..91554c2c7 100644 --- a/usr/share/archboot/grub/archboot-main-grub.cfg +++ b/usr/share/archboot/grub/archboot-main-grub.cfg @@ -100,6 +100,11 @@ if [ ${grub_platform} == "efi" ]; then _initrd_x86_64 } + menuentry "Arch Linux x86_64 Archboot - EFISTUB" { + _menu_running + chainloader /boot/systemd-boot/systemd-bootx64.efi + } + submenu "UEFI Tools" { _secure_boot_tools _efi_shell @@ -114,6 +119,11 @@ if [ ${grub_platform} == "efi" ]; then _initrd_aarch64 } + menuentry "Arch Linux AA64 Archboot - EFISTUB" { + _menu_running + chainloader /boot/systemd-boot/systemd-bootaa64.efi + } + submenu "UEFI Tools" { _secure_boot_tools } diff --git a/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-aa64-local.conf b/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-aa64-local.conf new file mode 100644 index 000000000..e50f8a856 --- /dev/null +++ b/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-aa64-local.conf @@ -0,0 +1,6 @@ +title Arch Linux AA64 Archboot - EFISTUB +linux /vmlinuz_aarch64 +initrd /amd-ucode.img +initrd /initramfs_aarch64-0.img +initrd /initramfs_aarch64-1.img +options rootfstype=ramfs nr_cpus=1 console=ttyAMA0,115200 console=tty0 loglevel=4 diff --git a/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-aa64.conf b/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-aa64.conf new file mode 100644 index 000000000..479370a9a --- /dev/null +++ b/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-aa64.conf @@ -0,0 +1,5 @@ +title Arch Linux AA64 Archboot - EFISTUB +linux /vmlinuz_aarch64 +initrd /amd-ucode.img +initrd /initramfs_aarch64.img +options rootfstype=ramfs nr_cpus=1 console=ttyAMA0,115200 console=tty0 loglevel=4 diff --git a/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-x64-local.conf b/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-x64-local.conf new file mode 100644 index 000000000..68f313114 --- /dev/null +++ b/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-x64-local.conf @@ -0,0 +1,7 @@ +title Arch Linux x86_64 Archboot - EFISTUB +linux /vmlinuz_x86_64 +initrd /amd-ucode.img +initrd /intel-ucode.img +initrd /initramfs_x86_64-0.img +initrd /initramfs_x86_64-1.img +options rootfstype=ramfs console=ttyS0,115200 console=tty0 diff --git a/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-x64.conf b/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-x64.conf new file mode 100644 index 000000000..082f914a6 --- /dev/null +++ b/usr/share/archboot/systemd-boot/boot/loader/entries/archboot-x64.conf @@ -0,0 +1,6 @@ +title Arch Linux x86_64 Archboot - EFISTUB +linux /vmlinuz_x86_64 +initrd /amd-ucode.img +initrd /intel-ucode.img +initrd /initramfs_x86_64.img +options rootfstype=ramfs console=ttyS0,115200 console=tty0 diff --git a/usr/share/archboot/systemd-boot/boot/loader/loader-aa64.conf b/usr/share/archboot/systemd-boot/boot/loader/loader-aa64.conf new file mode 100644 index 000000000..2b3f3e83a --- /dev/null +++ b/usr/share/archboot/systemd-boot/boot/loader/loader-aa64.conf @@ -0,0 +1,2 @@ +timeout 10 +default archboot-aa64 diff --git a/usr/share/archboot/systemd-boot/boot/loader/loader-x64.conf b/usr/share/archboot/systemd-boot/boot/loader/loader-x64.conf new file mode 100644 index 000000000..a1e4042ad --- /dev/null +++ b/usr/share/archboot/systemd-boot/boot/loader/loader-x64.conf @@ -0,0 +1,2 @@ +timeout 10 +default archboot-x64