Dirk Mueller
7de38aff65
- Update version number to 0.11.0 - Rebase patches (efibootmgr-0.11.0-derhat.diff, efibootmgr-0.11.0-check-boot-order.diff) - Drop efibootmgr-0.6.0-set_boot_order.diff since the data size of the variable is handled properly now - Drop efibootmgr-0.6.0-fail-visibly.diff since err() and warn() are introduced to show more meaningful messages - Drop upstreamed patch (efibootmgr-0.6.0-gcc-Wall.diff, efibootmgr-0.6.0-write-unique-id-once.diff) OBS-URL: https://build.opensuse.org/request/show/258751 OBS-URL: https://build.opensuse.org/package/show/Base:System/efibootmgr?expand=0&rev=21
86 lines
3.1 KiB
Diff
86 lines
3.1 KiB
Diff
From: Raymund Will <rw@suse.com>
|
|
Subject: Make default '--loader' build-time configurable.
|
|
|
|
Each distribution uses a specific 'vendor'-directory in the
|
|
'efi' directory on the EFI System Partition to store their
|
|
EFI loader. There's little use in hardcoding the value
|
|
for just one in 'efibootmgr', which is displayed in '--help'
|
|
and used as default without '--loader'.
|
|
|
|
Simply use
|
|
make OS_VENDOR=redhat EFI_LOADER=grub.efi
|
|
to get the previous value. :)
|
|
|
|
Signed-off-by: Raymund Will <rw@suse.com>
|
|
---
|
|
Makefile | 4 ++++
|
|
src/efibootmgr/efibootmgr.c | 12 ++++++++----
|
|
2 files changed, 12 insertions(+), 4 deletions(-)
|
|
|
|
--- a/Makefile
|
|
+++ b/Makefile
|
|
@@ -1,5 +1,8 @@
|
|
default: all
|
|
|
|
+ OS_VENDOR := vendor
|
|
+ EFI_LOADER := boot.efi
|
|
+
|
|
SIGNING_KEY := pjones
|
|
RELEASE_MAJOR := 0
|
|
RELEASE_MINOR := 11
|
|
@@ -8,6 +11,7 @@
|
|
RELEASE_STRING := $(RELEASE_NAME)-$(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)
|
|
|
|
CFLAGS = $(EXTRA_CFLAGS) -DEFIBOOTMGR_VERSION=\"$(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)\" \
|
|
+ -DDEFAULT_LOADER=\"\\\\efi\\\\$(OS_VENDOR)\\\\$(EFI_LOADER)\" \
|
|
-Wsign-compare -Wall -Werror -g -D_FILE_OFFSET_BITS=64
|
|
|
|
MODULES := src
|
|
--- a/src/efibootmgr/efibootmgr.c
|
|
+++ b/src/efibootmgr/efibootmgr.c
|
|
@@ -1,5 +1,6 @@
|
|
/*
|
|
- efibootmgr.c - Manipulates EFI variables as exported in /proc/efi/vars
|
|
+ efibootmgr.c - Manipulates EFI variables as exported in
|
|
+ /sys/firmware/efi/vars (previously was /proc/efi/vars)
|
|
|
|
Copyright (C) 2001-2004 Dell, Inc. <Matt_Domsch@dell.com>
|
|
|
|
@@ -18,7 +19,7 @@
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
|
- This must tie the EFI_DEVICE_PATH to /boot/efi/EFI/redhat/grub.efi
|
|
+ This must tie the EFI_DEVICE_PATH to /boot/efi/efi/<vendor>/<loader>.efi
|
|
The EFI_DEVICE_PATH will look something like:
|
|
ACPI device path, length 12 bytes
|
|
Hardware Device Path, PCI, length 6 bytes
|
|
@@ -59,6 +60,9 @@
|
|
#define EFIBOOTMGR_VERSION "unknown (fix Makefile!)"
|
|
#endif
|
|
|
|
+#ifndef DEFAULT_LOADER
|
|
+#define DEFAULT_LOADER "unknown (fix Makefile!)"
|
|
+#endif
|
|
|
|
typedef struct _var_entry {
|
|
char *name;
|
|
@@ -965,7 +969,7 @@ usage()
|
|
printf("\t-g | --gpt force disk with invalid PMBR to be treated as GPT\n");
|
|
printf("\t-H | --acpi_hid XXXX set the ACPI HID (used with -i)\n");
|
|
printf("\t-i | --iface name create a netboot entry for the named interface\n");
|
|
- printf("\t-l | --loader name (defaults to \\EFI\\redhat\\grub.efi)\n");
|
|
+ printf("\t-l | --loader name (defaults to \""DEFAULT_LOADER"\")\n");
|
|
printf("\t-L | --label label Boot manager display label (defaults to \"Linux\")\n");
|
|
printf("\t-n | --bootnext XXXX set BootNext to XXXX (hex)\n");
|
|
printf("\t-N | --delete-bootnext delete BootNext\n");
|
|
@@ -993,7 +997,7 @@ set_default_opts()
|
|
opts.active = -1; /* Don't set it */
|
|
opts.timeout = -1; /* Don't set it */
|
|
opts.edd10_devicenum = 0x80;
|
|
- opts.loader = "\\EFI\\redhat\\grub.efi";
|
|
+ opts.loader = DEFAULT_LOADER;
|
|
opts.label = "Linux";
|
|
opts.disk = "/dev/sda";
|
|
opts.iface = NULL;
|