From 97af122828ad42bdf6c1320b7da394d8234747ba Mon Sep 17 00:00:00 2001 From: Alain Kalker Date: Mon, 8 Jul 2019 12:07:32 +0200 Subject: [PATCH] efibootmgr: add option to set partition number of EFI partition This is useful when ESP is not the first partition, for instance if it is added after some existing partitions during switch from BIOS to UEFI boot. --- srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd | 2 ++ srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install | 3 +++ srcpkgs/efibootmgr/template | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd b/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd index fb704e7b2ec..374a2684882 100644 --- a/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd +++ b/srcpkgs/efibootmgr/files/efibootmgr-kernel-hook.confd @@ -6,3 +6,5 @@ MODIFY_EFI_ENTRIES=0 # OPTIONS="root=/dev/sda3 loglevel=4 slub_debug=P page_poison=1" # Disk where EFI Partition is. Default is /dev/sda # DISK="/dev/sda" +# Partition number of EFI Partition. Default is 1 +# PART=1 diff --git a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install index 55bde1bce26..adf523e7b1f 100644 --- a/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install +++ b/srcpkgs/efibootmgr/files/kernel.d/efibootmgr.post-install @@ -18,6 +18,9 @@ args="" if [ "x${DISK}" != x ]; then args="-d $DISK" fi +if [ "x${PART}" != x ]; then + args="$args -p $PART" +fi # get major version, e.g. "4.8" for "linux4.8" major_version=$(echo $PKGNAME | cut -c 6-) diff --git a/srcpkgs/efibootmgr/template b/srcpkgs/efibootmgr/template index 2545291e6c6..adcf20fcd8a 100644 --- a/srcpkgs/efibootmgr/template +++ b/srcpkgs/efibootmgr/template @@ -1,7 +1,7 @@ # Template file for 'efibootmgr' pkgname=efibootmgr version=17 -revision=2 +revision=3 hostmakedepends="pkg-config" makedepends="libefivar-devel popt-devel" short_desc="Tool to modify UEFI Firmware Boot Manager Variables"