From 3f7ce5b3f44efd683ac8ea62b01d3f24c6682fd0 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 fb704e7b2ec562..374a26848825ea 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 55bde1bce263ff..adf523e7b1fae3 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 2545291e6c6c0a..adcf20fcd8a562 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"