From f759dab4a32b54fa1db52f0a2c911b1c6cbcf8af Mon Sep 17 00:00:00 2001 From: Alexis Ehret Date: Sat, 10 Sep 2022 19:15:52 +0200 Subject: [PATCH 1/2] efibootmgr: fix when no bootorder is configured --- srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install | 4 +++- srcpkgs/efibootmgr/template | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install index adf523e7b1fa..8ee051fed3fb 100644 --- a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install +++ b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install @@ -42,4 +42,6 @@ fi efibootmgr -qc $args -L "Void Linux with kernel ${major_version}" -l /vmlinuz-${VERSION} -u "${OPTIONS}" # restore the boot order -efibootmgr -qo $bootorder +if [ -n "$bootorder" ]; then + efibootmgr -qo $bootorder +fi diff --git a/srcpkgs/efibootmgr/template b/srcpkgs/efibootmgr/template index 2f636914a566..8db1f68fd3f6 100644 --- a/srcpkgs/efibootmgr/template +++ b/srcpkgs/efibootmgr/template @@ -1,7 +1,7 @@ # Template file for 'efibootmgr' pkgname=efibootmgr version=18 -revision=1 +revision=2 hostmakedepends="pkg-config" makedepends="libefivar-devel popt-devel" short_desc="Tool to modify UEFI Firmware Boot Manager Variables" From 3800ed69612755df99141fa475c735ec25542d4a Mon Sep 17 00:00:00 2001 From: Alexis Ehret Date: Sat, 10 Sep 2022 19:17:28 +0200 Subject: [PATCH 2/2] efibootmgr: add LOADER_PATH to the kernel hook --- srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd | 2 ++ .../efibootmgr/files/kernel.d/efibootmgr.post-install | 9 ++++++--- srcpkgs/efibootmgr/template | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd b/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd index 42adfc0da400..25f0f99fdba9 100644 --- a/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd +++ b/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd @@ -2,6 +2,8 @@ MODIFY_EFI_ENTRIES=0 # To allow efibootmgr to modify boot entries, set # MODIFY_EFI_ENTRIES=1 +# To choose an alternative loader path, set +# LOADER_PATH=/efi/EFI/void/linux-${VERSION}.efi # Kernel command-line options. Example: # OPTIONS="root=/dev/sda3 loglevel=4" # Disk where EFI Partition is. Default is /dev/sda diff --git a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install index 8ee051fed3fb..ace3af262258 100644 --- a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install +++ b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install @@ -12,8 +12,6 @@ if [ "x${MODIFY_EFI_ENTRIES}" != x1 ]; then exit 0 fi -OPTIONS="${OPTIONS} initrd=/initramfs-${VERSION}.img" - args="" if [ "x${DISK}" != x ]; then args="-d $DISK" @@ -39,7 +37,12 @@ if [ "$existing_entry" != "" ]; then fi # create the new entry -efibootmgr -qc $args -L "Void Linux with kernel ${major_version}" -l /vmlinuz-${VERSION} -u "${OPTIONS}" +if [ -z "${LOADER_PATH}" ]; then + OPTIONS="${OPTIONS} initrd=/initramfs-${VERSION}.img" + efibootmgr -qc $args -L "Void Linux with kernel ${major_version}" -l /vmlinuz-${VERSION} -u "${OPTIONS}" +else + efibootmgr -qc $args -L "Void Linux with kernel ${major_version}" -l "${LOADER_PATH}" +fi # restore the boot order if [ -n "$bootorder" ]; then diff --git a/srcpkgs/efibootmgr/template b/srcpkgs/efibootmgr/template index 8db1f68fd3f6..35ca33ef9897 100644 --- a/srcpkgs/efibootmgr/template +++ b/srcpkgs/efibootmgr/template @@ -1,7 +1,7 @@ # Template file for 'efibootmgr' pkgname=efibootmgr version=18 -revision=2 +revision=3 hostmakedepends="pkg-config" makedepends="libefivar-devel popt-devel" short_desc="Tool to modify UEFI Firmware Boot Manager Variables"