diff --git a/.gitignore b/.gitignore index 1e629343..8f4237b5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,11 +2,16 @@ .*.h.P .*.d .*.sw? +.gdb_history *~ *.a *.bin -*.env +*.C +/.cache/ +*.cer *.E +*.env +*.esl *.o *.map *.pc @@ -17,6 +22,7 @@ *.strace *.tar.* *.var +compile_commands.json core.* cov-int vgcore.* diff --git a/Makefile b/Makefile index 7a4ac8c6..66f15a54 100644 --- a/Makefile +++ b/Makefile @@ -9,18 +9,13 @@ include $(TOPDIR)/src/include/scan-build.mk SUBDIRS := src docs -all : | efivar.spec src/include/version.mk -all : +all : | efivar.spec src/include/version.mk prep +all clean install prep : @set -e ; for x in $(SUBDIRS) ; do \ $(MAKE) -C $$x $@ ; \ done -install : - @set -e ; for x in $(SUBDIRS) ; do \ - $(MAKE) -C $$x $@ ; \ - done - -abidw abicheck efivar efivar-static static: +abicheck abidw efivar efivar-static static : | all $(MAKE) -C src $@ abiupdate : @@ -28,10 +23,13 @@ abiupdate : $(MAKE) -C src abiclean abixml $(SUBDIRS) : - $(MAKE) -C $@ + $(MAKE) -C $@ all brick : all - @set -e ; for x in $(SUBDIRS) ; do $(MAKE) -C $${x} test ; done + @echo -n $(info this is the rule for brick PWD:$(PWD) MAKECMDGOALS:$(MAKECMDGOALS)) + @set -e ; for x in $(SUBDIRS) ; do \ + $(MAKE) -C $${x} test ; \ + done a : @if [ $${EUID} != 0 ]; then \ @@ -39,16 +37,12 @@ a : exit 1 ; \ fi -.PHONY: $(SUBDIRS) a brick abiupdate - GITTAG = $(shell bash -c "echo $$(($(VERSION) + 1))") efivar.spec : | Makefile src/include/version.mk -clean : - @set -e ; for x in $(SUBDIRS) ; do \ - $(MAKE) -C $$x $@ ; \ - done +clean : clean-toplevel +clean-toplevel: @rm -vf efivar.spec vgcore.* core.* test : all @@ -83,4 +77,9 @@ archive: abicheck bumpver abidw tag efivar.spec @rm -rf /tmp/efivar-$(GITTAG) @echo "The archive is in efivar-$(GITTAG).tar.bz2" +.PHONY: $(SUBDIRS) +.PHONY: a abiclean abicheck abidw abiupdate all archive +.PHONY: brick bumpver clean clean-toplevel +.PHONY: efivar efivar-static +.PHONY: install prep tag test test-archive .NOTPARALLEL: diff --git a/docs/Makefile b/docs/Makefile index 2f6fc89b..24d96bf5 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -40,6 +40,8 @@ all : clean : +prep : + test : install : diff --git a/efivar.spec.in b/efivar.spec.in index 180e5374..ecf0895d 100644 --- a/efivar.spec.in +++ b/efivar.spec.in @@ -2,13 +2,21 @@ Name: efivar Version: @@VERSION@@ Release: 1%{?dist} Summary: Tools to manage UEFI variables -License: LGPLv2.1 -URL: https://github.com/rhinstaller/efivar +License: LGPL-2.1 +URL: https://github.com/rhboot/efivar Requires: %{name}-libs = %{version}-%{release} -ExclusiveArch: %{ix86} x86_64 aarch64 - -BuildRequires: git glibc-static libabigail -Source0: https://github.com/rhboot/efivar/archive/%{version}.tar.gz +ExclusiveArch: %{efi} + +BuildRequires: efi-srpm-macros +BuildRequires: gcc +BuildRequires: git +BuildRequires: glibc-static +BuildRequires: libabigail +BuildRequires: mandoc +BuildRequires: make +# please don't fix this to reflect github's incomprehensible url that goes +# to a different tarball. +Source0: https://github.com/rhboot/efivar/releases/download/%{version}/efivar-%{version}.tar.bz2 %description efivar provides a simple command line interface to the UEFI variable facility. @@ -38,23 +46,20 @@ git config --unset user.email git config --unset user.name %build -make LIBDIR=%{_libdir} BINDIR=%{_bindir} CFLAGS="$RPM_OPT_FLAGS -flto" LDFLAGS="$RPM_LD_FLAGS -flto" +%define _lto_cflags %{nil} + +make LIBDIR=%{_libdir} BINDIR=%{_bindir} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" %install -rm -rf $RPM_BUILD_ROOT %makeinstall - -%clean -rm -rf $RPM_BUILD_ROOT +install -m 0644 src/abignore %{buildroot}%{_includedir}/efivar/.abignore %check %ifarch x86_64 make abicheck %endif -%post libs -p /sbin/ldconfig - -%postun libs -p /sbin/ldconfig +%ldconfig_scriptlets libs %files %{!?_licensedir:%global license %%doc} diff --git a/src/Makefile b/src/Makefile index a286dfbb..debda257 100644 --- a/src/Makefile +++ b/src/Makefile @@ -21,18 +21,27 @@ LIBEFIVAR_SOURCES = crc32.c dp.c dp-acpi.c dp-hw.c dp-media.c dp-message.c \ lib.c vars.c LIBEFIVAR_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(LIBEFIVAR_SOURCES))) EFIVAR_SOURCES = efivar.c +EFIVAR_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(EFIVAR_SOURCES))) GENERATED_SOURCES = include/efivar/efivar-guids.h guid-symbols.c -MAKEGUIDS_SOURCES = makeguids.c guid.c +MAKEGUIDS_SOURCES = makeguids.c +MAKEGUIDS_OBJECTS = $(patsubst %.S,%.o,$(patsubst %.c,%.o,$(MAKEGUIDS_SOURCES))) +MAKEGUIDS_OUTPUT = guids.bin names.bin $(GENERATED_SOURCES) + ALL_SOURCES=$(LIBEFIBOOT_SOURCES) $(LIBEFIVAR_SOURCES) $(MAKEGUIDS_SOURCES) \ $(sort $(wildcard include/efivar/*.h)) $(GENERATED_SOURCES) $(EFIVAR_SOURCES) +ifneq ($(MAKECMDGOALS),clean) $(call deps-of,$(ALL_SOURCES)) : | deps -include $(call deps-of,$(ALL_SOURCES)) +endif all : $(TARGETS) static : $(STATICTARGETS) +$(BINTARGETS) : | $(LIBTARGETS) $(PCTARGETS) +$(STATICTARGETS) : | $(STATICLIBTARGETS) $(PCTARGETS) + abiclean : @rm -vf $(patsubst %.so,%.abixml,$@) @@ -44,13 +53,6 @@ abidw : $(patsubst %.so,%.abixml,$(LIBTARGETS)) abicheck : $(patsubst %.so,%.abicheck,$(LIBTARGETS)) -./guid-symbols.c : include/efivar/efivar-guids.h -./guids.bin : include/efivar/efivar-guids.h -./names.bin : include/efivar/efivar-guids.h -include/efivar/efivar-guids.h : makeguids guids.txt - ./makeguids guids.txt guids.bin names.bin \ - guid-symbols.c include/efivar/efivar-guids.h - makeguids : CPPFLAGS=$(HOST_CPPFLAGS) makeguids : LIBS=dl makeguids : CC=$(HOSTCC) @@ -58,11 +60,30 @@ makeguids : CCLD=$(HOSTCCLD) makeguids : CFLAGS=$(HOST_CFLAGS) makeguids : LDFLAGS=$(HOST_LDFLAGS) makeguids : CCLDFLAGS=$(HOST_CCLDFLAGS) -makeguids : $(MAKEGUIDS_SOURCES) +makeguids : $(MAKEGUIDS_OBJECTS) + +$(MAKEGUIDS_OUTPUT) : makeguids +$(MAKEGUIDS_OUTPUT) : guids.txt + @set -e ; \ + missing=no ; \ + for x in $$(cat guids.txt | awk '{ print $$2 }' | grep -v ^zz) ; do \ + if ! grep -q "efi_guid_$${x}" libefivar.map.in ; then \ + echo missing symbol "efi_guid_$${x}" ; \ + missing=yes ; \ + fi ; \ + done ; \ + if [ "$${missing}" != "no" ]; then \ + exit 1 ; \ + fi + ./makeguids guids.txt guids.bin names.bin \ + guid-symbols.c include/efivar/efivar-guids.h + +guids.o : | makeguids +guids.o : guids.S guids.bin names.bin -guids.o : guids.S | guids.bin names.bin +prep : makeguids $(GENERATED_SOURCES) -$(LIBEFIVAR_OBJECTS) $(LIBEFIBOOT_OBJECTS) : | $(GENERATED_SOURCES) +$(LIBEFIVAR_OBJECTS) $(LIBEFIBOOT_OBJECTS) : prep libefivar.a : | $(GENERATED_SOURCES) libefivar.a : $(patsubst %.o,%.static.o,$(LIBEFIVAR_OBJECTS)) @@ -72,10 +93,10 @@ libefivar.so : | $(GENERATED_SOURCES) libefivar.map libefivar.so : LIBS=dl libefivar.so : MAP=libefivar.map -efivar : efivar.c | libefivar.so +efivar : $(EFIVAR_OBJECTS) | libefivar.so efivar : LIBS=efivar dl -efivar-static : efivar.c $(patsubst %.o,%.static.o,$(LIBEFIVAR_OBJECTS)) +efivar-static : $(EFIVAR_OBJECTS) $(patsubst %.o,%.static.o,$(LIBEFIVAR_OBJECTS)) efivar-static : | $(GENERATED_SOURCES) efivar-static : LIBS=dl @@ -112,14 +133,15 @@ install : all $(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/efivar $(foreach x, $(sort $(wildcard $(TOPDIR)/src/include/efivar/*.h)), $(INSTALL) -m 644 $(x) $(DESTDIR)$(INCLUDEDIR)/efivar/$(notdir $(x));) $(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR) - $(foreach x, $(BINTARGETS), $(INSTALL) -m 755 $(x) $(DESTDIR)$(BINDIR);) + $(foreach x, $(filter-out %-test,$(BINTARGETS)), $(INSTALL) -m 755 $(x) $(DESTDIR)$(BINDIR);) test : all $(MAKE) -C test $@ -.PHONY: test deps abiclean abixml +.PHONY: abiclean abicheck abidw abixml all +.PHONY: clean deps install test .SECONDARY : libefivar.so.1.$(VERSION) libefivar.so.1 .SECONDARY : libefiboot.so.1.$(VERSION) libefiboot.so.1 -.SECONDARY : include/efivar/efivar-guids.h guid-symbols.c +.SECONDARY : $(GENERATED_SOURCES) .INTERMEDIATE : guids.bin names.bin -.PRECIOUS : guid-symbols.o makeguids +.PRECIOUS : makeguids diff --git a/src/guid.c b/src/guid.c index 0d6ed981..676a70b4 100644 --- a/src/guid.c +++ b/src/guid.c @@ -19,7 +19,7 @@ extern const efi_guid_t efi_guid_zero; int NONNULL(1, 2) PUBLIC efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b) { - return memcmp(a, b, sizeof (efi_guid_t)); + return efi_guid_cmp_(a, b); } int NONNULL(1) PUBLIC @@ -35,11 +35,7 @@ efi_guid_is_empty(const efi_guid_t *guid) int NONNULL(1, 2) PUBLIC efi_str_to_guid(const char *s, efi_guid_t *guid) { - int rc; - rc = text_to_guid(s, guid); - if (rc < 0) - efi_error("text_to_guid(\"%s\",...)", s); - return rc; + return efi_str_to_guid_(s, guid); } int NONNULL(1) PUBLIC @@ -91,7 +87,7 @@ cmpguidp(const void *p1, const void *p2) struct guidname *gn1 = (struct guidname *)p1; struct guidname *gn2 = (struct guidname *)p2; - return memcmp(&gn1->guid, &gn2->guid, sizeof (gn1->guid)); + return efi_guid_cmp_(&gn1->guid, &gn2->guid); } static int NONNULL(1, 2) @@ -100,7 +96,7 @@ cmpnamep(const void *p1, const void *p2) struct guidname *gn1 = (struct guidname *)p1; struct guidname *gn2 = (struct guidname *)p2; - return memcmp(gn1->name, gn2->name, sizeof (gn1->name)); + return strncmp(gn1->name, gn2->name, sizeof (gn1->name)); } static int NONNULL(1, 2) diff --git a/src/guid.h b/src/guid.h index f384bccb..198a7009 100644 --- a/src/guid.h +++ b/src/guid.h @@ -169,6 +169,44 @@ struct guidname { char name[256]; }; +static inline int +efi_int_cmp_(uint64_t a, uint64_t b) +{ + if (a < b) + return -1; + if (a > b) + return 1; + return 0; +} + +static inline int NONNULL(1, 2) +efi_guid_cmp_(const efi_guid_t *a, const efi_guid_t *b) +{ + if (a->a != b->a) + return efi_int_cmp_(a->a, b->a); + if (a->b != b->b) + return efi_int_cmp_(a->b, b->b); + if (a->c != b->c) + return efi_int_cmp_(a->c, b->c); + if (a->d != b->d) + return efi_int_cmp_(be16_to_cpu(a->d), be16_to_cpu(b->d)); + for (size_t i = 0; i < sizeof(a->e)/sizeof(a->e[0]); i++) { + if (a->e[i] != b->e[i]) + return efi_int_cmp_(a->e[i], b->e[i]); + } + return 0; +} + +static inline int NONNULL(1, 2) +efi_str_to_guid_(const char *s, efi_guid_t *guid) +{ + int rc; + rc = text_to_guid(s, guid); + if (rc < 0) + efi_error("text_to_guid(\"%s\",...)", s); + return rc; +} + #endif /* LIBEFIVAR_GUID */ // vim:fenc=utf-8:tw=75:noet diff --git a/src/include/defaults.mk b/src/include/defaults.mk index 511f4dae..a889a2e7 100644 --- a/src/include/defaults.mk +++ b/src/include/defaults.mk @@ -7,6 +7,7 @@ INCLUDEDIR ?= $(PREFIX)/include BINDIR ?= $(EXEC_PREFIX)/bin PCDIR ?= $(LIBDIR)/pkgconfig DESTDIR ?= +PKGS ?= CROSS_COMPILE ?= COMPILER ?= gcc @@ -19,12 +20,15 @@ $(call set-if-undefined,CCLD,$(CC)) $(call set-if-undefined,HOSTCC,$(COMPILER)) $(call set-if-undefined,HOSTCCLD,$(HOSTCC)) -OPTIMIZE_GCC = -flto +# temporary, see https://sourceware.org/bugzilla/show_bug.cgi?id=28264 +#OPTIMIZE_GCC = -flto +OPTIMIZE_GCC = OPTIMIZE ?= -Og $(call family,OPTIMIZE) DEBUGINFO ?= -g3 WARNINGS_GCC ?= WARNINGS_CCC_ANALYZER ?= $(WARNINGS_GCC) WARNINGS ?= -Wall -Wextra $(call family,WARNINGS) +ERRORS_GCC ?= ERRORS ?= -Werror $(call family,ERRORS) CPPFLAGS ?= override _CPPFLAGS := $(CPPFLAGS) @@ -77,6 +81,7 @@ HOST_CPPFLAGS ?= $(CPPFLAGS) override _HOST_CPPFLAGS := $(HOST_CPPFLAGS) override HOST_CPPFLAGS = $(_HOST_CPPFLAGS) \ -DEFIVAR_BUILD_ENVIRONMENT $(HOST_MARCH) +HOST_CFLAGS_GCC ?= HOST_CFLAGS_CLANG ?= HOST_CFLAGS ?= $(CFLAGS) $(call family,HOST_CFLAGS) override _HOST_CFLAGS := $(HOST_CFLAGS) @@ -107,8 +112,6 @@ RANLIB := $(CROSS_COMPILE)$(COMPILER)-ranlib ABIDW := abidw ABIDIFF := abidiff -PKGS = - LDLIBS=$(foreach lib,$(LIBS),-l$(lib)) $(call pkg-config-ldlibs) COMMIT_ID=$(shell git log -1 --pretty=%H 2>/dev/null || echo master) diff --git a/src/include/deps.mk b/src/include/deps.mk index 3c824314..b33a926f 100644 --- a/src/include/deps.mk +++ b/src/include/deps.mk @@ -7,10 +7,12 @@ include $(TOPDIR)/src/include/rules.mk include $(TOPDIR)/src/include/defaults.mk .%.d : %.c - $(CC) $(CFLAGS) $(CPPFLAGS) -MM -MG -MF $@ $^ + @$(CC) $(CFLAGS) $(CPPFLAGS) -MM -MG -MF $@ $^ + @sed -i 's/:/: |/g' $@ .%.d : %.S - $(CC) $(CFLAGS) $(CPPFLAGS) -MM -MG -MF $@ $^ + @$(CC) $(CFLAGS) $(CPPFLAGS) -MM -MG -MF $@ $^ + @sed -i 's/:/: |/g' $@ SOURCES ?= diff --git a/src/include/rules.mk b/src/include/rules.mk index 99a6329e..6357d2ab 100644 --- a/src/include/rules.mk +++ b/src/include/rules.mk @@ -21,12 +21,12 @@ family = $(foreach FAMILY_SUFFIX,$(FAMILY_SUFFIXES),$($(1)_$(FAMILY_SUFFIX))) % : %.c -% : %.c - $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) -o $@ $^ $(LDLIBS) +% : %.o + $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) -o $@ $(sort $^) $(LDLIBS) %-static : CCLDFLAGS+=-static -%-static : %.c - $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) -o $@ $^ $(LDLIBS) +%-static : %.o + $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) -o $@ $(sort $^) $(LDLIBS) %.so : $(CCLD) $(CCLDFLAGS) $(CPPFLAGS) $(SOFLAGS) \ diff --git a/src/libefiboot.abixml b/src/libefiboot.abixml index ab75cbbe..7f82c016 100644 --- a/src/libefiboot.abixml +++ b/src/libefiboot.abixml @@ -1,4 +1,4 @@ - + @@ -22,1828 +22,2341 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - + + - - + + + + + - - + + - - + + - - + + - - + + - - + + - - + + + + - - + + - - + + + + - - + + - - + + - - + + - - + + - - + + + + - - + + - - + + - - + + - - + + + + - - + + - - + + - - + + - - + + - - + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + - - + + - - + + - - + + - - + + - - + + + + - - + + - - + + - - + + - - + + + + - - + + - - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + - - + + - - + + - - + + - - + + - - + + + + - - + + - + - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - + + + + + + + + + + + - - + + + + + + - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - + - - + + - + + - + - + - - + + + + + + + + - + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - - + + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - - - - - - - + + - + - + - - - - - - - + + - + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - - + + - + - + - + - + - - - - - - - + + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - - + + - + - + - + - + - - + + - + - + - - + + - + - + - + - - - - - - - + + - + - + - + - + - + - + - + - + - + - - - - - - - - + + - + - + - + - + - + - + - + - + - + - - - - - - - + + - + - + - - + + - + - + - + - + - + - + - - - - - - - - + + + - - + + - - + + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - + - - + + - + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - + - - + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + - + - + - - + + - + - + - + - + - + - + - + - - + + - + - + - + - + - - + + - + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - + - - - - - + + + + - - + + - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - + + - - + + - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + - - + + - - - - + + - - + + - - + + - - + + - - + + - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - - - + - - + + - - + + - + + + - - - - - - - - - - - - - + - + + - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + + + - - + + - - + + - - + + + - + - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + - - - - - - - - - - - - - - - - - diff --git a/src/libefivar.abixml b/src/libefivar.abixml index 2dbb8387..32b84c06 100644 --- a/src/libefivar.abixml +++ b/src/libefivar.abixml @@ -1,7 +1,7 @@ - + - + @@ -22,12 +22,12 @@ - + - + @@ -75,7 +75,9 @@ + + @@ -114,1918 +116,2324 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - - + + + - - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - + + + - + - + - + - - + + - + - + - - + + - + - + - + - + - - + + - + - + - + - - - - - - - + + - + - + - - + + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - - - - - - - + + - + - + - - - - - - - + + - + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - - + + - + - + - + - + - - - - - - - + + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - - - - - - - + + - + - + - - + + - + - + - + - + - - + + - + - + - - + + - + - + - + - - - - - - - + + - + - + - + - + - + - + - + - + - + - - - - - - - - + + - + - + - + - + - + - + - + - + - + - - - - - - - + + - + - + - - + + - + - + - + - + - + - + - - - - - - - - + + + - - + + - - + + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - + - + - - + + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - + - - + + - + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - + - - + + - + - + - + - - - - - - - - - - - - - - - - - + + - + - - - - - + + - - - - - - - - - + + - + - - - - - - - - - - + - + - + - + - + - + - - + + - + - + - + - + - - + + - + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - - + + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + + + + + + + + - - + + + - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + diff --git a/src/libefivar.map.in b/src/libefivar.map.in index 54bfb765..94e3370f 100644 --- a/src/libefivar.map.in +++ b/src/libefivar.map.in @@ -135,7 +135,9 @@ LIBEFIVAR_1.38 { global: efi_error_pop; efi_set_loglevel; efi_get_libefivar_version; + efi_guid_auto_created_boot_option; efi_guid_grub; + efi_guid_external_management; efi_variable_alloc; efi_variable_export_dmpstore; } LIBEFIVAR_1.37; diff --git a/src/makeguids.c b/src/makeguids.c index 2648a121..ffe6eeea 100644 --- a/src/makeguids.c +++ b/src/makeguids.c @@ -14,6 +14,7 @@ #include #include "efivar.h" +#include "guid.h" efi_guid_t const efi_guid_zero = {0}; efi_guid_t const efi_guid_empty = {0}; @@ -29,7 +30,7 @@ cmpguidp(const void *p1, const void *p2) struct guidname *gn1 = (struct guidname *)p1; struct guidname *gn2 = (struct guidname *)p2; - return memcmp(&gn1->guid, &gn2->guid, sizeof (gn1->guid)); + return efi_guid_cmp_(&gn1->guid, &gn2->guid); } static int @@ -38,7 +39,7 @@ cmpnamep(const void *p1, const void *p2) struct guidname *gn1 = (struct guidname *)p1; struct guidname *gn2 = (struct guidname *)p2; - return memcmp(gn1->name, gn2->name, sizeof (gn1->name)); + return strncmp(gn1->name, gn2->name, sizeof (gn1->name)); } struct guid_aliases { @@ -158,7 +159,7 @@ main(int argc, char *argv[]) *end = '\0'; efi_guid_t guid; - rc = efi_str_to_guid(guidstr, &guid); + rc = efi_str_to_guid_(guidstr, &guid); if (rc < 0) err(1, "makeguids: \"%s\": 4 invalid data on line %d", argv[1], line);