• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

external/efibootmgr


Commit MetaInfo

Revisionce9dbb3e59bd6c5aea67aa18bb3c3629483a5722 (tree)
Zeit2017-03-08 01:07:06
AutorRaymund Will <rw@suse...>
CommiterPeter Jones

Log Message

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=<vendor> EFI_LOADER=<loader>.efi

to get the desired value. :)

Signed-off-by: Raymund Will <rw@suse.com>

Ändern Zusammenfassung

Diff

--- a/Make.defaults
+++ b/Make.defaults
@@ -9,6 +9,9 @@ localedir ?= $(datadir)/locale/
99 PCDIR ?= $(libdir)/pkgconfig
1010 DESTDIR ?=
1111
12+OS_VENDOR := redhat
13+EFI_LOADER := grub.efi
14+
1215 INSTALL ?= install
1316 CROSS_COMPILE ?=
1417 PKG_CONFIG = $(CROSS_COMPILE)pkg-config
@@ -29,6 +32,7 @@ cflags = $(CFLAGS) $(SUBDIR_CFLAGS) \
2932 -std=gnu11 -fPIC \
3033 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DLOCALEDIR=\"$(localedir)\" \
3134 -DEFIBOOTMGR_VERSION="\"$(VERSION)\"" \
35+ -DDEFAULT_LOADER=\"\\\\EFI\\\\$(OS_VENDOR)\\\\$(EFI_LOADER)\" \
3236 $(if $(findstring clang,$(CC)),$(clang_cflags),) \
3337 $(if $(findstring gcc,$(CC)),$(gcc_cflags),) \
3438 $(call pkg-config-cflags)
--- a/src/efibootmgr.c
+++ b/src/efibootmgr.c
@@ -1,5 +1,6 @@
11 /*
2- efibootmgr.c - Manipulates EFI variables as exported in /proc/efi/vars
2+ efibootmgr.c - Manipulates EFI variables as exported in /sys/firmware/efi/
3+ efivars or vars (previously /proc/efi/vars)
34
45 Copyright (C) 2001-2004 Dell, Inc. <Matt_Domsch@dell.com>
56
@@ -18,7 +19,7 @@
1819 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1920
2021
21- This must tie the EFI_DEVICE_PATH to /boot/efi/EFI/redhat/grub.efi
22+ This must tie the EFI_DEVICE_PATH to /boot/efi/EFI/<vendor>/<loader>.efi
2223 The EFI_DEVICE_PATH will look something like:
2324 ACPI device path, length 12 bytes
2425 Hardware Device Path, PCI, length 6 bytes
@@ -1237,7 +1238,7 @@ usage()
12371238 printf("\t --ip-port <local>,<remote> set local and remote IP ports\n");
12381239 printf("\t --ip-origin { {dhcp|static} | { static|stateless|stateful} }\n");
12391240 #endif
1240- printf("\t-l | --loader name (defaults to \\EFI\\redhat\\grub.efi)\n");
1241+ printf("\t-l | --loader name (defaults to \""DEFAULT_LOADER"\")\n");
12411242 printf("\t-L | --label label Boot manager display label (defaults to \"Linux\")\n");
12421243 printf("\t-m | --mirror-below-4G t|f mirror memory below 4GB\n");
12431244 printf("\t-M | --mirror-above-4G X percentage memory to mirror above 4GB\n");
@@ -1267,7 +1268,7 @@ set_default_opts()
12671268 opts.active = -1; /* Don't set it */
12681269 opts.timeout = -1; /* Don't set it */
12691270 opts.edd10_devicenum = 0x80;
1270- opts.loader = "\\EFI\\redhat\\grub.efi";
1271+ opts.loader = DEFAULT_LOADER;
12711272 opts.label = (unsigned char *)"Linux";
12721273 opts.disk = "/dev/sda";
12731274 opts.part = 1;