Skip to content

Commit

Permalink
Make conditional default loader path use EFIDIR like fwupdate does.
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Jones <[email protected]>
  • Loading branch information
vathpela committed Mar 7, 2017
1 parent ce9dbb3 commit 2d9f9e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions Make.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ localedir ?= $(datadir)/locale/
PCDIR ?= $(libdir)/pkgconfig
DESTDIR ?=

OS_VENDOR := redhat
EFIDIR ?= $(shell x=$$(which --skip-alias --skip-functions git 2>/dev/null) ; [ -n "$$x" ] && git config --get efibootmgr.efidir)
ifeq ($(EFIDIR),)
EFIDIR_ERROR = $(error EFIDIR or .gitconfig efibootmgr.efidir must be set to this distro's reserved EFI System Partition subdirectory name)
endif
EFI_LOADER := grub.efi

INSTALL ?= install
Expand All @@ -32,7 +35,7 @@ cflags = $(CFLAGS) $(SUBDIR_CFLAGS) \
-std=gnu11 -fPIC \
-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DLOCALEDIR=\"$(localedir)\" \
-DEFIBOOTMGR_VERSION="\"$(VERSION)\"" \
-DDEFAULT_LOADER=\"\\\\EFI\\\\$(OS_VENDOR)\\\\$(EFI_LOADER)\" \
-DDEFAULT_LOADER=\"\\\\EFI\\\\$(EFIDIR)\\\\$(EFI_LOADER)\" \
$(if $(findstring clang,$(CC)),$(clang_cflags),) \
$(if $(findstring gcc,$(CC)),$(gcc_cflags),) \
$(call pkg-config-cflags)
Expand All @@ -47,3 +50,6 @@ ccldflags = $(cflags) $(CCLDFLAGS) $(LDFLAGS) \
CPPFLAGS?=
SOFLAGS=-shared
LDLIBS=$(foreach lib,$(LIBS),-l$(lib)) $(call pkg-config-ldlibs)

.PHONY: check_efidir_error
check_efidir_error : ; $(EFIDIR_ERROR) $(info Building with EFIDIR as $(EFIDIR))
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include $(TOPDIR)/Make.defaults

SUBDIRS := src

all clean install deps : | Make.version
all clean install deps : | check_efidir_error Make.version
@set -e ; for x in $(SUBDIRS) ; do \
$(MAKE) -C $$x $@ ; \
done
Expand Down

0 comments on commit 2d9f9e3

Please sign in to comment.