GithubHelp home page GithubHelp logo

rhboot / efivar Goto Github PK

View Code? Open in Web Editor NEW
215.0 215.0 102.0 1.63 MB

Tools and libraries to work with EFI variables

License: GNU Lesser General Public License v2.1

Makefile 6.22% C 93.67% Shell 0.10%

efivar's People

Contributors

0x501d avatar awilfox avatar cigaes avatar cwhuang avatar dcantrell avatar dlrobertson avatar doughdemon avatar falbrechtskirchinger avatar floppym avatar frozencemetery avatar gabrielmajeri avatar hjl-tools avatar jtojnar avatar lcp avatar lersek avatar lipidity avatar lsandov1 avatar marler8997 avatar martinezjavier avatar nabijaczleweli avatar ncopa avatar nicholasbishop avatar nvinson avatar ozbenh avatar rbisewski avatar schallee avatar sergiidmytruk avatar tedbrandston avatar trofi avatar vathpela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

efivar's Issues

efivar link failure

On current master, efivar fails to link due to -L. being removed from ccldflags.

gcc -O2 -g -I/home/floppym/src/efivar/src/include/efivar/  -specs=/home/floppym/src/efivar/gcc.specs         -o efivar efivar.c -lefivar -ldl -lpopt
/usr/lib/gcc/x86_64-pc-linux-gnu/5.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lefivar
collect2: error: ld returned 1 exit status

If a previous version of libefivar is installed, the link succeeds, but efivar gets linked against the wrong library.

Make fails: /usr/bin/ld: cannot find -lpopt

Currently working on building an LFS system that will boot UEFI. I've installed the popt-1.16 file as listed in the book: http://www.linuxfromscratch.org/blfs/view/cvs/general/popt.html

I've also been following this guide:http://www.linuxfromscratch.org/hints/downloads/files/lfs-uefi.txt

Namely the following commands:
Compile the package:
sed 's|-O0|-Os|g' -i Make.defaults
sed 's|-rpath=$(TOPDIR)/src/|-rpath=$(libdir)|g'
-i src/test/Makefile
make libdir="/usr/lib/" bindir="/usr/bin/"
mandir="/usr/share/man/"
includedir="/usr/include/" V=1 -j1

however it fails at:

root:/sources/efivar#
make libdir="/usr/lib/" bindir="/usr/bin/"
mandir="/usr/share/man/"
includedir="/usr/include/" V=1 -j1

make[1]: Entering directory '/sources/efivar/src'
make -f /sources/efivar/src/Make.deps deps SOURCES="crc32.c creator.c disk.c gpt.c linux.c loadopt.c dp.c dp-acpi.c dp-hw.c dp-media.c dp-message.c efivarfs.c error.c export.c guid.c guids.S guid-symbols.c lib.c vars.c makeguids.c guid.c include/efivar/efivar-guids.h include/efivar/efivar.h include/efivar/efiboot.h include/efivar/efiboot-loadopt.h include/efivar/efivar-dp.h include/efivar/efiboot-creator.h include/efivar/efivar-guids.h guid-symbols.c efivar.c"
make[2]: Entering directory '/sources/efivar/src'
make[2]: Nothing to be done for 'deps'.
make[2]: Leaving directory '/sources/efivar/src'
gcc -O2 -flto -g3 -I/sources/efivar/src/include/efivar/ -specs=/sources/efivar/gcc.specs -L. -static -o efivar-static efivar.c dp.static.o dp-acpi.static.o dp-hw.static.o dp-media.static.o dp-message.static.o efivarfs.static.o error.static.o export.static.o guid.static.o guids.static.o guid-symbols.static.o lib.static.o vars.static.o -ldl -lpopt
/usr/bin/ld: cannot find -lpopt
collect2: error: ld returned 1 exit status
make[1]: *** [/sources/efivar/Make.rules:17: efivar-static] Error 1
make[1]: Leaving directory '/sources/efivar/src'
make: *** [Makefile:11: all] Error 2

So i've never even run the:

Install the package:
make -j1 V=1 DESTDIR="${pkgdir}/" libdir="/usr/lib/"
bindir="/usr/bin/" mandir="/usr/share/man"
includedir="/usr/include/" install

  install -v -D -m0755 src/test/tester /usr/bin/efivar-tester

Below I've confimed these exist:

root:/sources/efivar# ls /usr/lib64 | grep libpopt.so
libpopt.so
libpopt.so.0
libpopt.so.0.0.0

Multiple definitions "efi_set_variable" in utf8len funtion ?

shell:
$ cp -p Make.defaults Make.defaults.dist
$ sed 's|-O2|-Os|g' -i Make.defaults
$ cp -p src/test/Makefile src/test/Makefile.dist
$ sed 's|-rpath=$(TOPDIR)/src/|-rpath=$(libdir)|g'
$ -i src/test/Makefile
$ make libdir="/usr/lib/" bindir="/usr/bin/"
$ mandir="/usr/share/man/"
$ includedir="/usr/include/" V=1 -j1
:
-Wl,--version-script=libefivar.map
-o libefivar.so dp.o dp-acpi.o dp-hw.o dp-media.o dp-message.o efivarfs.o error.o export.o guid.o guids.o guid-symbols.o lib.o vars.o -ldl
/tmp/ccJxKHhA.ltrans0.ltrans.o:在函数‘utf8len’中:
/sources/efivar-30/src/ucs2.h:53: efi_set_variable 的多重定义
/tmp/ccJxKHhA.ltrans0.ltrans.o:/sources/efivar-30/src/lib.c:77:第一次在此定义
collect2: error:ld return 1
make[1]: *** [/sources/efivar-30/Make.rules:20:libefivar.so] error 1
make[1]: 离开目录“/sources/efivar-30/src”
make: *** [Makefile:11:all] error 2

Treat ENOSPC as EFI_OUT_OF_RESOURCES when writing a variable

Just wanted to make sure this didn't get lost from RH bugzilla. Back when Matt Domsch was maintaining efibootmgr, he suggested a patch to treat an ENOSPC from the kernel as EFI_OUT_OF_RESOURCES rather than EFI_INVALID_PARAMETER when attempting to write a variable. Obviously the current code is rather different, but I think the idea of the patch may still be valid/useful. I think efivar (not efibootmgr) is the appropriate place for it now, right?

Incorrect handling of device major/minor

This was reported through Debian (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844237)

Part of the code in linux.c uses "st_rdev >> 8" and "st_rdev & 0xFF" to find
the major and minor device number for the disk to install. It was correct a
long time ago but it has been quite some time that both major and minor can
exceed 8 bits. The libc provides macros to extract the major and minor;
another part of the same file uses these macros. Furthermore, the field
containing the minor is declared as unsigned char, making it 8 bits.

The result is a failure to prepare boot variables, making grub-install fail
for example, for a device with a minor >= 256. The device I needed to use
was 179:256. Running with strace showed an attempt to access
/sys/dev/block/4275:0 instead of /sys/dev/block/179:256 that would have been
correct considering the previous system call was fstat() showing
"st_rdev=makedev(179, 256)". You can notice that 179+256*16 = 4275.

This is the patch that was submitted:

diff -ru orig/efivar-30/src/linux.c efivar-30/src/linux.c
--- orig/efivar-30/src/linux.c	2016-10-03 18:29:32.000000000 +0200
+++ efivar-30/src/linux.c	2016-11-13 16:55:17.001150388 +0100
@@ -55,7 +55,7 @@
 	char *linkbuf;
 	ssize_t rc;
 
-	rc = sysfs_readlink(&linkbuf, "/sys/dev/block/%"PRIu64":%hhu",
+	rc = sysfs_readlink(&linkbuf, "/sys/dev/block/%"PRIu64":%"PRIu32,
 		      info->major, info->minor);
 	if (rc < 0)
 		return -1;
@@ -913,11 +913,11 @@
 		return 1;
 	}
 	if (S_ISBLK(buf.st_mode)) {
-		info->major = buf.st_rdev >> 8;
-		info->minor = buf.st_rdev & 0xFF;
+		info->major = major(buf.st_rdev);
+		info->minor = minor(buf.st_rdev);
 	} else if (S_ISREG(buf.st_mode)) {
-		info->major = buf.st_dev >> 8;
-		info->minor = buf.st_dev & 0xFF;
+		info->major = major(buf.st_dev);
+		info->minor = minor(buf.st_dev);
 	} else {
 		printf("Cannot stat non-block or non-regular file\n");
 		return 1;
diff -ru orig/efivar-30/src/linux.h efivar-30/src/linux.h
--- orig/efivar-30/src/linux.h	2016-10-03 18:29:32.000000000 +0200
+++ efivar-30/src/linux.h	2016-11-13 16:47:30.773353757 +0100
@@ -75,7 +75,7 @@
 	unsigned int disknum;
 	unsigned char part;
 	uint64_t major;
-	unsigned char minor;
+	uint32_t minor;
 	uint32_t edd10_devicenum;
 
 	struct pci_root_info pci_root;

Improve error message if no `BootOrder` variable is there

On my system there currently no variable BootOrder. The error message should be improved and maybe even suggest what the implications are. (This is an Asus U38N laptop with the latest UEFI version and using its interface I am unable to create any boot entries for some time now. No idea if it started after having deleted all other entries.)

$ sudo efibootmgr -V
version 0.6.1
$ git describe
Release_0_6_0-60-gb3deec9   
$ sudo efibootmgr -v
Timeout: 0 seconds
show_boot_order(): No such file or directory
$ ls -lh /sys/firmware/efi/vars/
insgesamt 0
drwxr-xr-x 2 root root 0 Feb 16 19:10 AcpiGlobalVariable-af9ffd67-ec10-488a-9dfc-6cbf5ee22c2e
drwxr-xr-x 2 root root 0 Feb 16 19:10 AEDID-75860b2c-f315-4ff1-9e19-029ad0129dba
drwxr-xr-x 2 root root 0 Feb 16 19:10 AmdAcpiVar-79941ecd-ed36-49d0-8124-e4c31ac75cd4
drwxr-xr-x 2 root root 0 Feb 16 19:10 AMIMemInfo-43387991-1223-7645-b5bb-aa7675c5c8ef
drwxr-xr-x 2 root root 0 Feb 16 19:10 AMITSESetup-c811fa38-42c8-4579-a9bb-60e94eddfb34
drwxr-xr-x 2 root root 0 Feb 16 19:10 ASUSSetupDefault-f1920447-7a78-4c0d-a028-ba9d003985e8
drwxr-xr-x 2 root root 0 Feb 16 19:10 ASUSTPType-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 BootOptionSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 ConIn-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 ConInDev-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 ConOut-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 ConOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 CpuS3Resume-30b98b95-dfa3-4501-a3ce-e38c186384a0
drwxr-xr-x 2 root root 0 Feb 16 19:10 db-d719b2cb-3d3a-4596-a3bc-dad00e67656f
drwxr-xr-x 2 root root 0 Feb 16 19:10 dbx-d719b2cb-3d3a-4596-a3bc-dad00e67656f
drwxr-xr-x 2 root root 0 Feb 16 19:10 DefaultBootOrder-45cf35f6-0d6e-4d04-856a-0370a5b16f53
--w------- 1 root root 0 Feb 16 19:10 del_var
drwxr-xr-x 2 root root 0 Feb 16 19:10 DriverHealthCount-7459a7d4-6533-4480-bba7-79e25a4443c9
drwxr-xr-x 2 root root 0 Feb 16 19:10 DriverHlthEnable-0885f288-418c-4be1-a6af-8bad61da08fe
drwxr-xr-x 2 root root 0 Feb 16 19:10 ErrOut-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 ErrOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 FastEfiBootOption-b540a530-6978-4da7-91cb-7207d764d262
drwxr-xr-x 2 root root 0 Feb 16 19:10 FirstSetup-4c23059f-4137-4dd3-9c10-8b97a83ffdef
drwxr-xr-x 2 root root 0 Feb 16 19:10 FPDT_Variable-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 GPTHDD_PRESENT-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 HobRomImage-dde1bc72-d45e-4209-ab85-14462d2f5074
drwxr-xr-x 2 root root 0 Feb 16 19:10 KEK-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 Lang-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 LangCodes-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 LegacyGroup-a56074db-65fe-45f7-bd21-2d2bdd8e9652
drwxr-xr-x 2 root root 0 Feb 16 19:10 MDSMTBL-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemCeil.-01368881-c4ad-4b1d-b631-d57a8ec8db6b
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemChecksum-c3a4e49f-485f-4fd6-a2ea-2bc87455ad4b
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemContext-c3a4e49f-485f-4fd6-a2ea-2bc87455ad4b
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemContextNv-c3a4e49f-485f-4fd6-a2ea-2bc87455ad4b
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemoryS3SaveNv-b1cfc482-4cb2-4cee-9b00-ce2579ec7186
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemoryS3SaveVol-0a51b41d-de21-43fe-be27-d6dbc9efd104
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemoryS3SaveVolLength-0a51b41d-de21-43fe-be27-d6dbc9efd104
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemoryTypeInformation-4c19049f-4137-4dd3-9c10-8b97a83ffdfa
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemRestoreConfigId-01368881-c4ad-4b1d-b631-d57a8ec8db6b
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemRestoreCpuId-01368881-c4ad-4b1d-b631-d57a8ec8db6b
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemRestoreSerialLength-01368881-c4ad-4b1d-b631-d57a8ec8db6b
drwxr-xr-x 2 root root 0 Feb 16 19:10 MemRestoreTime-01368881-c4ad-4b1d-b631-d57a8ec8db6b
drwxr-xr-x 2 root root 0 Feb 16 19:10 ModuleVersion-01368881-c4ad-4b1d-b631-d57a8ec8db6b
drwxr-xr-x 2 root root 0 Feb 16 19:10 MonotonicCounter-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 NBMemoryLength-490216c0-076a-44d3-a536-ace05c90e386
drwxr-xr-x 2 root root 0 Feb 16 19:10 NetworkStackVar-d1405d16-7afc-4695-bb12-41459d3695a2
--w------- 1 root root 0 Feb 16 19:10 new_var
drwxr-xr-x 2 root root 0 Feb 16 19:10 OA3MSDMvariable-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 OHCI1RestoreData-e966c438-b841-2d6e-8137-09b1f51e2d78
drwxr-xr-x 2 root root 0 Feb 16 19:10 OHCI2RestoreData-e966c438-b841-2d6e-8137-09b1f51e2d78
drwxr-xr-x 2 root root 0 Feb 16 19:10 OsIndications-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 OsIndicationsSupported-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 PK-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 PlatformLang-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 PlatformLangCodes-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 PreviousMemoryTypeInformation-4c19049f-4137-4dd3-9c10-8b97a83ffdfa
drwxr-xr-x 2 root root 0 Feb 16 19:10 RegisterPwrBtnHook-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 RSCInfoAddresss-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 S3SS-4bafc2b4-02dc-4104-b236-d6f1b98d9e84
drwxr-xr-x 2 root root 0 Feb 16 19:10 SbNvramVar-393c4833-402f-4bd5-bf5a-1f5cd8681444
drwxr-xr-x 2 root root 0 Feb 16 19:10 SB_USB_POINT-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 SetupCpuFeatures-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
drwxr-xr-x 2 root root 0 Feb 16 19:10 Setup-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
drwxr-xr-x 2 root root 0 Feb 16 19:10 SetupMode-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 SignatureSupport-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 SpdBypassData-01368881-c4ad-4b1d-b631-d57a8ec8db6b
drwxr-xr-x 2 root root 0 Feb 16 19:10 SpdBypassSerial-01368881-c4ad-4b1d-b631-d57a8ec8db6b
drwxr-xr-x 2 root root 0 Feb 16 19:10 StdDefaults-4599d26f-1a11-49b8-b91f-858745cff824
drwxr-xr-x 2 root root 0 Feb 16 19:10 TcgInternalSyncFlag-f3ed95df-828e-41c7-bca0-16c41965a634
drwxr-xr-x 2 root root 0 Feb 16 19:10 Timeout-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 USBCHARGE_VAR-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
drwxr-xr-x 2 root root 0 Feb 16 19:10 UsbMassDevNum-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
drwxr-xr-x 2 root root 0 Feb 16 19:10 UsbMassDevValid-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9
drwxr-xr-x 2 root root 0 Feb 16 19:10 USB_POINT-8be4df61-93ca-11d2-aa0d-00e098032b8c
drwxr-xr-x 2 root root 0 Feb 16 19:10 UsbSupport-ec87d643-eba4-4bb5-a1e5-3f3e36b20da9

efivar-guids.h: No such file or directory

x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fomit-frame-pointer -fno-stack-protector -Werror -Wall -Wsign-compare -Wstrict-aliasing -std=gnu11 -fshort-wchar -fPIC -flto -fvisibility=hidden -D_GNU_SOURCE -I/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/src/include/efivar/     -c -o guid.o guid.c
In file included from dp-acpi.c:23:0:
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/src/include/efivar/efivar.h:39:26: fatal error: efivar-guids.h: No such file or directory
 #include <efivar-guids.h>
                          ^
compilation terminated.
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/Make.rules:24: recipe for target 'dp-acpi.o' failed
make[1]: *** [dp-acpi.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from dp-hw.c:22:0:
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/src/include/efivar/efivar.h:39:26: fatal error: efivar-guids.h: No such file or directory
 #include <efivar-guids.h>
                          ^
compilation terminated.
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/Make.rules:24: recipe for target 'dp-hw.o' failed
make[1]: *** [dp-hw.o] Error 1
In file included from dp-media.c:23:0:
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/src/include/efivar/efivar.h:39:26: fatal error: efivar-guids.h: No such file or directory
 #include <efivar-guids.h>
                          ^
compilation terminated.
In file included from dp-message.c:24:0:
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/src/include/efivar/efivar.h:39:26: fatal error: efivar-guids.h: No such file or directory
 #include <efivar-guids.h>
                          ^
compilation terminated.
In file included from dp.c:23:0:
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/src/include/efivar/efivar.h:39:26: fatal error: efivar-guids.h: No such file or directory
 #include <efivar-guids.h>
                          ^
compilation terminated.
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/Make.rules:24: recipe for target 'dp-media.o' failed
make[1]: *** [dp-media.o] Error 1
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/Make.rules:24: recipe for target 'dp-message.o' failed
make[1]: *** [dp-message.o] Error 1
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/Make.rules:24: recipe for target 'dp.o' failed
make[1]: *** [dp.o] Error 1
In file included from export.c:24:0:
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/src/include/efivar/efivar.h:39:26: fatal error: efivar-guids.h: No such file or directory
 #include <efivar-guids.h>
                          ^
compilation terminated.
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/Make.rules:24: recipe for target 'export.o' failed
make[1]: *** [export.o] Error 1
In file included from lib.h:22:0,
                 from efivarfs.c:32:
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/src/include/efivar/efivar.h:39:26: fatal error: efivar-guids.h: No such file or directory
 #include <efivar-guids.h>
                          ^
compilation terminated.
In file included from guid.c:23:0:
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/src/include/efivar/efivar.h:39:26: fatal error: efivar-guids.h: No such file or directory
 #include <efivar-guids.h>
                          ^
compilation terminated.
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/Make.rules:24: recipe for target 'efivarfs.o' failed
make[1]: *** [efivarfs.o] Error 1
/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/Make.rules:24: recipe for target 'guid.o' failed
make[1]: *** [guid.o] Error 1
make[1]: Leaving directory '/tmp/portage/sys-libs/efivar-9999/work/efivar-9999/src'
Makefile:10: recipe for target 'all' failed
make: *** [all] Error 2

redundant redeclaration in efivar 27

In compiling fwupd 0.7.3 on Ubuntu with efivar 27, noticed this warning pop up:

In file included from fu-provider-dell.h:28:0,
from fu-main.c:59:
/usr/include/efivar/efivar.h:108:25: warning: redundant redeclaration of ‘efi_guid_zero’ [-Wredundant-decls]
extern const efi_guid_t efi_guid_zero;
^
In file included from /usr/include/efivar/efivar.h:42:0,
from fu-provider-dell.h:28,
from fu-main.c:59:
/usr/include/efivar/efivar-guids.h:5:25: note: previous declaration of ‘efi_guid_zero’ was here
extern const efi_guid_t efi_guid_zero attribute((visibility ("default")));
^

lib.o:(*IND*+0x0): multiple definition of `efi_set_variable'

I'm hitting a weird failure when building using ld.bfd without -flto in CFLAGS. Adding -flto lets it work.

This is with gcc-5.4.0 and binutils-2.26.1.

floppym@naomi efivar % CFLAGS= make efivar
make -C src efivar
make[1]: Entering directory '/home/floppym/src/efivar/src'
make -f /home/floppym/src/efivar/src/Make.deps deps SOURCES="crc32.c creator.c disk.c gpt.c linux.c loadopt.c dp.c dp-acpi.c dp-hw.c dp-media.c dp-message.c efivarfs.c error.c export.c guid.c guids.S guid-symbols.c lib.c vars.c makeguids.c guid.c include/efivar/efivar-guids.h include/efivar/efivar.h include/efivar/efiboot.h include/efivar/efiboot-loadopt.h include/efivar/efivar-dp.h include/efivar/efiboot-creator.h include/efivar/efivar-guids.h guid-symbols.c efivar.c"
make[2]: Entering directory '/home/floppym/src/efivar/src'
make[2]: Nothing to be done for 'deps'.
make[2]: Leaving directory '/home/floppym/src/efivar/src'
gcc  -I/home/floppym/src/efivar/src/include/efivar/  -specs=/home/floppym/src/efivar/gcc.specs   -L.       -shared \
  -Wl,-soname,libefivar.so.1 \
  -Wl,--version-script=libefivar.map \
  -o libefivar.so dp.o dp-acpi.o dp-hw.o dp-media.o dp-message.o efivarfs.o error.o export.o guid.o guids.o guid-symbols.o lib.o vars.o -ldl -lpopt
lib.o:(*IND*+0x0): multiple definition of `efi_set_variable'
lib.o:lib.c:(.text+0x463): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [/home/floppym/src/efivar/Make.rules:20: libefivar.so] Error 1
make[1]: Leaving directory '/home/floppym/src/efivar/src'
make: *** [Makefile:21: efivar] Error 2

warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Building efivar-0.20 with -Wstrict-aliasing produces several warnings.

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * dp-media.c:37:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * dp-message.c:577:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * dp-message.c:578:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * dp-message.c:585:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 * dp-message.c:586:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Cannot build from fresh clone

When building, the efivar-guids.h is missing from /usr/include and the Makefile doesn't make it. Manually cd'ing into src/ and running make include/efivar/efivar-guids.h doesn't work either because of -ldl being a make dependency.

It seems to me that efivar-guids.h should be made before a build and should not use the system one since it will be a previous version.

efi_variable_import has confusing documentation.

I find the documentation on the return value of efi_variable_import very confusing. The first explanation makes sense. The second seem to contradict the first and is very confusing. From looking at the code, unless the function return -1, it will return the input size - 4 which seem like it cannot be 0 at all, making the first entry incorrect.

The two entries in the man pages:

efi_variable_import() returns 0 on success, and -1 on failure. In cases where it cannot parse the data, errno will be set to EINVAL. In cases where memory has been exhausted, errno will be set to ENOMEM.

efi_variable_import() returns the size of the buffer data on success, or a negative value in the case of an error. If data or size parameters are not provided, this function will return how much storage is a caller must allocate. Otherwise, this function will use the storage provided in data; if size is less than the needed space, the buffer will not be modified, and the return value will be the difficiency in size.

efivar-tester failed

I am not sure if it means something but when I run efivar-tester, it failed at a stage:

About to test empty
testing efi_set_variable()
testing efi_get_variable_size()
testing efi_get_variable()
testing efi_get_variable_attributes()
testing efi_del_variable()
testing efi_set_variable() with too many arguments
testing efi_append_variable()
testing efi_get_variable()
testing efi_del_variable()
About to test one
testing efi_set_variable()
testing efi_get_variable_size()
testing efi_get_variable()
testing efi_get_variable_attributes()
testing efi_del_variable()
testing efi_set_variable() with too many arguments
FAIL: "one"(line 169) (-1) set test failed: Invalid argument

make test failures with Ovmf x64

With an Ovmf x64 build from 4123bd7bf7c70998353b187b593dc992e0dcb146,
under Debian Jessie (freshly updated today). Logs generated with 'strace -o -s 2048 ./tester', running as root.
Tests fail both with efivarfs mounted and not mounted, but differently at least in the case of the current efivars master.

efivars-0.15-debian, efivarfs not mounted
https://gist.github.com/leiflindholm/020ae403d5d710e3ac99

efivars d774e36, efivarfs not mounted
https://gist.github.com/leiflindholm/9154cd0497304fb1bb84

efivars-0.15-debian, efivarfs mounted
https://gist.github.com/leiflindholm/4afea5e6b6707f6bc4a8

efivars d774e36, efivarfs mounted
https://gist.github.com/leiflindholm/5b1bc9159371296990ab

efivar 30: FAIL: "tentwentyfour"(line 197) (-1) append test failed: No space left on device

I am attempting to build efaivar 30, following the guidelines from:

http://www.linuxfromscratch.org/hints/downloads/files/lfs-uefi.txt

and am doing so on top of a LFS 7.10 build.

The only change I have made to the notes in the LFS hint has been to
modify the patch to the Make.defaults file, because the current efivar
optimisation is controlled by a different variable to that in the 0.12
Make.defaults, vis:

0.12   CFLAGS  ?= -O0 -g
30     OPTIMIZE ?= -O2 -flto

so I have built efivars with

OPTIMIZE ?= -Os -flto

I note that it doesn't build the tester by default, however when I

cd src
make test

the tester gets built, but running it gives me:

...
About to test thirtythree
testing efi_set_variable()
testing efi_get_variable_size()
testing efi_get_variable()
testing efi_get_variable_attributes()
testing efi_del_variable()
testing efi_append_variable()
testing efi_get_variable()
testing efi_del_variable()
About to test tentwentyfour
testing efi_set_variable()
testing efi_get_variable_size()
testing efi_get_variable()
testing efi_get_variable_attributes()
testing efi_del_variable()
testing efi_append_variable()
FAIL: "tentwentyfour"(line 197) (-1) append test failed: No space left on device
make: *** [Makefile:18: test] Error 1

At the time I ran this, I had

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       9.8G  3.6G  5.7G  39% /
devtmpfs        7.5G     0  7.5G   0% /dev
tmpfs           7.5G  432K  7.5G   1% /run
/dev/sda1       199M   13M  186M   7% /boot/efi

and I note that the tentwentfour test is using size of 1024
and that size of 33 test worked.

                {.name= "thirtythree", .size = 33, .result= 0 },
                {.name= "tentwentyfour", .size = 1024, .result= 0},
                {.name= "tentwentyfive", .size = 1025, .result= 0},
                {.name= "", .size = 0, .result= 0}

What is the size being reffered to here?

I'm assuming it's not just the size of the EFI boot partition though, as that's not
required (IIRC) to be much more than what I have ?

FYI, this is a 4.7.2 kernel, that's been compiled, as has efivars, with GCC 6.2.0,
and the full LFS OS environment is descibed here

http://linuxfromscratch.org/lfs/view/stable/

A grep for EFI in the current kernel config shows

CONFIG_EFI_PARTITION=y
CONFIG_EFI=y
CONFIG_EFI_STUB=y
# CONFIG_EFI_MIXED is not set
CONFIG_FB_EFI=y
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
# EFI (Extensible Firmware Interface) Support
CONFIG_EFI_VARS=y
CONFIG_EFI_ESRT=y
CONFIG_EFI_RUNTIME_MAP=y
# CONFIG_EFI_FAKE_MEMMAP is not set
CONFIG_EFI_RUNTIME_WRAPPERS=y
# CONFIG_EFI_BOOTLOADER_CONTROL is not set
# CONFIG_EFI_CAPSULE_LOADER is not set
CONFIG_EFIVAR_FS=m
# CONFIG_EARLY_PRINTK_EFI is not set
# CONFIG_EFI_PGT_DUMP is not set

although I note, as detailed in the hint, that CONFIG_EFI_VARS
being set (this came from an almost pristine 'make defconfig' kernel
build before I started building efivars) can cause problems, however,
I note that the tests up to size 33 work.

I do intend to rebuild the kernel to match the hint's settings though,
but thought, in light of the tests that have run, to flag this up anyway.

The hardware, FWIW, is a

Gigabyte F2A88XM-D3H mATX AMD A88X

Any clues ?

Build failure: util.h:52:23: error: comparison between signed and unsigned integer expressions

efivar 27 with GCC 4.9.3

$ make
make[1]: Entering directory '/var/tmp/efivar-27/src'
gcc -O2 -g3 -I/var/tmp/efivar-27/src/include/efivar/  -specs=/var/tmp/efivar-27/gcc.specs  -L.      -DEFIVAR_BUILD_ENVIRONMENT -o makeguids makeguids.c guid.c -ldl 
./makeguids guids.txt guids.bin names.bin \
    guid-symbols.c include/efivar/efivar-guids.h
33 lines
make -f /var/tmp/efivar-27/src/Make.deps deps SOURCES="crc32.c creator.c disk.c gpt.c linux.c loadopt.c dp.c dp-acpi.c dp-hw.c dp-media.c dp-message.c efivarfs.c error.c export.c guid.c guids.S guid-symbols.c lib.c vars.c makeguids.c guid.c include/efivar/efivar.h include/efivar/efiboot.h include/efivar/efiboot-loadopt.h include/efivar/efivar-dp.h include/efivar/efiboot-creator.h include/efivar/efivar-guids.h guid-symbols.c efivar.c"
...
make[2]: Leaving directory '/var/tmp/efivar-27/src'
gcc -O2 -g3 -I/var/tmp/efivar-27/src/include/efivar/  -specs=/var/tmp/efivar-27/gcc.specs  -fPIC  -c -o dp.o dp.c
In file included from dp.c:27:0:
dp.c: In function ‘efidp_duplicate_extra’:
util.h:52:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   _ret = _limit - (a) > (b);   \
                       ^
util.h:106:17: note: in expansion of macro ‘int_add’
          int *: int_add(a,b,c),   \
                 ^
dp.c:78:6: note: in expansion of macro ‘add’
  if (add(sz, extra, &plus)) {
      ^
util.h:62:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   _ret = _limit - (a) > (b);   \
                       ^
util.h:107:18: note: in expansion of macro ‘long_add’
          long *: long_add(a,b,c),   \
                  ^
dp.c:78:6: note: in expansion of macro ‘add’
  if (add(sz, extra, &plus)) {
      ^
dp.c: In function ‘efidp_append_path’:
util.h:85:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   _ret = _limit - (a) > (b);   \
                       ^
util.h:108:27: note: in expansion of macro ‘ulong_add’
          unsigned long *: ulong_add(a,b,c))
                           ^
dp.c:164:6: note: in expansion of macro ‘add’
  if (add(lsz, rsz, &newsz)) {
      ^
dp.c: In function ‘efidp_append_node’:
util.h:52:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   _ret = _limit - (a) > (b);   \
                       ^
util.h:106:17: note: in expansion of macro ‘int_add’
          int *: int_add(a,b,c),   \
                 ^
dp.c:221:7: note: in expansion of macro ‘add’
   if (add(rsz, sizeof(end_entire), &newsz)) {
       ^
util.h:62:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   _ret = _limit - (a) > (b);   \
                       ^
util.h:107:18: note: in expansion of macro ‘long_add’
          long *: long_add(a,b,c),   \
                  ^
dp.c:221:7: note: in expansion of macro ‘add’
   if (add(rsz, sizeof(end_entire), &newsz)) {
       ^
util.h:85:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   _ret = _limit - (a) > (b);   \
                       ^
util.h:108:27: note: in expansion of macro ‘ulong_add’
          unsigned long *: ulong_add(a,b,c))
                           ^
dp.c:257:6: note: in expansion of macro ‘add’
  if (add(lsz, rsz, &newsz) || add(newsz, sizeof(end_entire), &newsz)) {
      ^
util.h:52:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   _ret = _limit - (a) > (b);   \
                       ^
util.h:106:17: note: in expansion of macro ‘int_add’
          int *: int_add(a,b,c),   \
                 ^
dp.c:257:31: note: in expansion of macro ‘add’
  if (add(lsz, rsz, &newsz) || add(newsz, sizeof(end_entire), &newsz)) {
                               ^
util.h:62:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   _ret = _limit - (a) > (b);   \
                       ^
util.h:107:18: note: in expansion of macro ‘long_add’
          long *: long_add(a,b,c),   \
                  ^
dp.c:257:31: note: in expansion of macro ‘add’
  if (add(lsz, rsz, &newsz) || add(newsz, sizeof(end_entire), &newsz)) {
                               ^
cc1: all warnings being treated as errors

efibootmgr fails to set the timeout

[root@localhost ~]# efibootmgr -t 10
Could not set Timeout: Invalid argument

efibootmgr uses efivar to set the EFI global variable timeout. When tries to set the value, this github code tries to delete the variable. UEFI firmware returns a error EFI_WRITE_PROTECTED since it has this variable has the default value.

efivar may need to set the variable without deleting or honor the return status of the delete request

Does not compile with LLVM/clang

Hi,
version 0.23 does not compile with LLVM/clang-3.8.0

  • /usr/bin/make -j8 -O libdir=/usr/lib64 bindir=/usr/bin mandir=/usr/share/man 'ccldflag=-Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -flto -Wl,-O2 -Wl,--no-undefined -flto ' V=1 -j1
    make[1]: Entering directory '/builddir/build/BUILD/efivar-0.23/src'
    /usr/bin/clang -Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -flto -I/builddir/build/BUILD/efivar-0.23/src/include/efivar/ -L. -Os -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -flto -Wl,-O2 -Wl,--no-undefined -flto -DEFIVAR_BUILD_ENVIRONMENT -o makeguids makeguids.c guid.c -ldl
    /builddir/build/BUILD/efivar-0.23/Make.rules:13: recipe for target 'makeguids' failed
    make[1]: Leaving directory '/builddir/build/BUILD/efivar-0.23/src'
    Makefile:10: recipe for target 'all' failed
    In file included from makeguids.c:26:
    /builddir/build/BUILD/efivar-0.23/src/include/efivar/efivar.h:86:16: warning: unknown attribute 'artificial' ignored [-Wunknown-attributes]
    attribute((artificial))
    ^
    /builddir/build/BUILD/efivar-0.23/src/include/efivar/efivar.h:92:6: error: use of unknown builtin 'builtin_va_arg_pack_len' [-Wimplicit-function-declaration]
    if (__builtin_va_arg_pack_len() != 0 &&
    ^
    /builddir/build/BUILD/efivar-0.23/src/include/efivar/efivar.h:103:20: error: use of unknown builtin '__builtin_va_arg_pack' [-Wimplicit-function-declaration]
    attributes, __builtin_va_arg_pack());
    ^
    /builddir/build/BUILD/efivar-0.23/src/include/efivar/efivar.h:103:20: note: did you mean '__builtin_va_arg_pack_len'?
    /builddir/build/BUILD/efivar-0.23/src/include/efivar/efivar.h:92:6: note: '__builtin_va_arg_pack_len' declared here
    if (__builtin_va_arg_pack_len() != 0 &&
    ^
    1 warning and 2 errors generated.
    In file included from guid.c:23:
    /builddir/build/BUILD/efivar-0.23/src/include/efivar/efivar.h:86:16: warning: unknown attribute '__artificial
    ' ignored [-Wunknown-attributes]
    attribute((artificial))
    ^
    /builddir/build/BUILD/efivar-0.23/src/include/efivar/efivar.h:92:6: error: use of unknown builtin '__builtin_va_arg_pack_len' [-Wimplicit-function-declaration]
    if (__builtin_va_arg_pack_len() != 0 &&
    ^
    /builddir/build/BUILD/efivar-0.23/src/include/efivar/efivar.h:103:20: error: use of unknown builtin '__builtin_va_arg_pack' [-Wimplicit-function-declaration]
    attributes, __builtin_va_arg_pack());
    ^
    /builddir/build/BUILD/efivar-0.23/src/include/efivar/efivar.h:103:20: note: did you mean '__builtin_va_arg_pack_len'?
    /builddir/build/BUILD/efivar-0.23/src/include/efivar/efivar.h:92:6: note: '__builtin_va_arg_pack_len' declared here
    if (__builtin_va_arg_pack_len() != 0 &&
    ^
    guid.c:61:8: warning: implicit declaration of function 'asprintf' is invalid in C99 [-Wimplicit-function-declaration]
    rc = asprintf(&ret, GUID_FORMAT,
    ^
    2 warnings and 2 errors generated.
    make[1]: *** [makeguids] Error 1
    make: *** [all] Error 2
    RPM build errors:
    error: Bad exit status from /var/tmp/rpm-tmp.42846 (%build)
    Bad exit status from /var/tmp/rpm-tmp.42846 (%build)
    Child returncode was: 1
    EXCEPTION: Command failed. See logs for output.

    ['bash', '--login', '-c', 'rpmbuild -bb --target x86_64 --without uclibc --nodeps builddir/build/SPECS/efivar.spec']

    Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/mock_urpm/trace_decorator.py", line 70, in trace
    result = func(_args, *_kw)
    File "/usr/lib/python2.7/site-packages/mock_urpm/util.py", line 402, in do
    raise mock_urpm.exception.Error, ("Command failed. See logs for output.\n # %s" % (command,), child.returncode)
    Error: Command failed. See logs for output.

    ['bash', '--login', '-c', 'rpmbuild -bb --target x86_64 --without uclibc --nodeps builddir/build/SPECS/efivar.spec']

    LEAVE do --> EXCEPTION RAISED

compiling with -Wdeclaration-after-statement shows warnings

When compiling fwupd with the dell provider enabled, it uses efivar and these warnings show up.

In file included from /usr/include/efivar/efivar.h:172:0,
                 from fu-provider-dell.h:26,
                 from fu-main.c:59:
/usr/include/efivar/efivar-dp.h: In function ‘efidp_next_node’:
/usr/include/efivar/efivar-dp.h:739:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  ssize_t sz = efidp_node_size(in);
  ^
/usr/include/efivar/efivar-dp.h: In function ‘efidp_next_instance’:
/usr/include/efivar/efivar-dp.h:756:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  ssize_t sz = efidp_node_size(in);
  ^
/usr/include/efivar/efivar-dp.h: In function ‘efidp_get_next_end’:
/usr/include/efivar/efivar-dp.h:793:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   ssize_t sz;
   ^
/usr/include/efivar/efivar-dp.h: In function ‘efidp_instance_size’:
/usr/include/efivar/efivar-dp.h:855:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   int rc = efidp_next_node(dpi, &next);
   ^

Build fails on Ubuntu 14.04 due to -fvisibility=hidden

gcc -O2 -g -Werror -Wall -Wsign-compare -Wstrict-aliasing -std=gnu11 -fshort-wchar -fPIC -flto -fvisibility=hidden -D_GNU_SOURCE -I/home/bor/src/efivar/src/include/efivar/  -Wmaybe-uninitialized     -fno-merge-constants -Wl,--fatal-warnings,--no-allow-shlib-undefined,--default-symver -Wl,-O2 -Wl,--no-undefined-version   -shared \
      -Wl,-soname,libefivar.so.0 \
      -o libefivar.so dp.o dp-acpi.o dp-hw.o dp-media.o dp-message.o efivarfs.o export.o guid.o guids.o guid-symbols.o lib.o vars.o
...
gcc -O2 -g -Werror -Wall -Wsign-compare -Wstrict-aliasing -std=gnu11 -fshort-wchar -fPIC -flto -fvisibility=hidden -D_GNU_SOURCE -I/home/bor/src/efivar/src/include/efivar/  -Wmaybe-uninitialized      -fno-merge-constants -Wl,--fatal-warnings,--no-allow-shlib-undefined,--default-symver -Wl,-O2 -Wl,--no-undefined-version  -L.  -o efivar efivar.c -lefivar -ldl -lpopt  
/tmp/ccFxlG6z.ltrans0.ltrans.o: In function `main':
/home/bor/src/efivar/src/efivar.c:335: undefined reference to `efi_well_known_guids_end'
/home/bor/src/efivar/src/efivar.c:335: undefined reference to `efi_well_known_guids'

Removing -fvisibility=hidden "fixes" it. Apparently some directive is needed to reset hidden visibility for some symbols in assembly, but I am not expert enough here.

gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
GNU ld (GNU Binutils for Ubuntu) 2.24

Error building: undefined version: libefiboot.so.0

When building with the latest commit, I am getting the following build error:

gcc -O2 -flto -g3 -I/home/ec2-user/src/efivar/src/include/efivar/  -specs=/home/ec2-user/src/efivar/gcc.specs  -L.   -Wl,-z,muldefs     -shared \
  -Wl,-soname,libefiboot.so.1 \
  -Wl,--version-script=libefiboot.map \
  -o libefiboot.so crc32.o creator.o disk.o gpt.o linux.o loadopt.o -lefivar
/usr/bin/ld: efi_va_generate_file_device_path_from_esp: undefined version: libefiboot.so.0
/usr/bin/ld: failed to set dynamic section sizes: Bad value
collect2: error: ld returned 1 exit status

Any ideas what is going on?

dlopen/dlysm usage

The guid.c code is .. puzzling, to say the least.

efivar supports a static build target, so I'm curious as to why dlopen + dlysm are being used? With glibc that generates a compiler warning, and other libcs would not like that in the least..

Adding a statically compiled efivar

Hi, I wanted to run efivar on an x86 android installation and I managed to do that by building a static binary.

Here is a patch which adds the compilation of an efivar-static executable:
http://ao2.it/tmp/add-efivar-static.patch

The patch contains two separate commits, please apply it with git am, the first commit contains some Makefile cleanups.

Thanks,
Antonio

addition of -Werror causing efivar 0.21 to fail to build on Debian unstable

904ffda adds -Werror to cflags. However, that causes efivar to fail to build on Debian unstable:

linux.c: In function 'make_mac_path':
linux.c:850:9: error: missing braces around initializer [-Werror=missing-braces]
struct ifreq ifr = { 0, };
^
linux.c:850:9: error: (near initialization for 'ifr.ifr_ifrn') [-Werror=missing-braces]
cc1: all warnings being treated as errors
make[3]: *** [linux.o] Error 1
/«PKGBUILDDIR»/Make.rules:17: recipe for target 'linux.o' failed
make[3]: Leaving directory '/«PKGBUILDDIR»/src'
make[2]: *** [src] Error 2
Makefile:13: recipe for target 'src' failed
make[2]: Leaving directory '/«PKGBUILDDIR»'

If I modify Make.defaults to remove -Werror, the build succeeds.

i386 issues with sizes

Hi!

As mentioned on irc (and in http://bugs.debian.org/773007), I've been playing with i386 EFI a little and things seems broken. I'm using qemu-system-i386 and the binary OVMF build (ia32, r15214). I've been initially trying with the Debian-packaged versions of efivar and efibootmgr, but I've also reproduced exactly the same issues using current git checkouts too.

Blatantly, the kernel/EFI underneath us is using 32 bits for the DataSize variable in the efi_variable_t struct, but the efivar code in src/vars.c is forcing the use of uint64_t for DataSize. See http://www.einval.com/~steve/tmp/efivar/ for debug from this. I'd attach the files here directly, but I don't see any way to do that here. :-/

I'm using 3.16 in my qemu test system:
Linux debian 3.16.0-4-686-pae #1 SMP Debian 3.16.7-2 (2014-11-06) i686 GNU/Linux

Using:

LD_LIBRARY_PATH=$PWD/src strace -f -o strace.broken -s2048 ./src/efivar -p -n 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder

I've dumped the current boot order, and it's wrong - see bootorder. I've hexdumped the raw efivar file for comparison (see hexdump), and you can see the blatant DataSize difference.

Clearly the kernel is exposing the raw variables from OVMF using 32-bit sizes. Older versions of efibootmgr work correctly with this. Has there been a change in newer kernels to rewrite the "raw" variables when output through sys/firmware/efi/efivars or something?

linux/nvme.h has been renamed in linux 4.4

When building with linux 4.4 headers, one will hit this:

gcc -O2 -g -Werror -Wall -Wsign-compare -Wstrict-aliasing -std=gnu11 -fshort-wchar -fPIC -flto -fvisibility=hidden -D_GNU_SOURCE -I/home/floppym/src/efivar/src/include/efivar/  -Wmaybe-uninitialized   -c -o linux.o linux.c
linux.c:25:24: fatal error: linux/nvme.h: No such file or directory
compilation terminated.

See kernel commit 9d99a8dda154f38307d43d9c9aa504bd3703d596.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9d99a8dda154f38307d43d9c9aa504bd3703d596

`make test` fails

The first test fails for me in master.

$ make test
[…]
./tester
About to test empty
testing efi_set_variable()
About to test one
testing efi_set_variable()
FAIL: "one"(line 107) (-1) set test failed: Invalid argument

__bswap_constant_XX is not portable

While compiling efivar for Adélie Linux, a new distribution focused on security and reliability using the musl libc, we reached a compiler error:

guid-symbols.c:13:25: error: implicit declaration of function '__bswap_constant_16' [-Werror=implicit-function-declaration]
 #define cpu_to_be16(n) (__bswap_constant_16(n))
                         ^
guid-symbols.c:21:93: note: in expansion of macro 'cpu_to_be16'
 efi_guid_t efi_guid_zero = {cpu_to_le32(0x00000000),cpu_to_le16(0x0000),cpu_to_le16(0x0000),cpu_to_be16(0x0000),{0x00,0x00,0x00,0x00,0x00,0x00}};
                                                                                             ^~~~~~~~~~~
guid-symbols.c:13:24: error: initializer element is not constant
 #define cpu_to_be16(n) (__bswap_constant_16(n))
                        ^
guid-symbols.c:21:93: note: in expansion of macro 'cpu_to_be16'
 efi_guid_t efi_guid_zero = {cpu_to_le32(0x00000000),cpu_to_le16(0x0000),cpu_to_le16(0x0000),cpu_to_be16(0x0000),{0x00,0x00,0x00,0x00,0x00,0x00}};
                                                                                             ^~~~~~~~~~~

This is caused by the usage of non-portable macro __bswap_constant_16 (and apparently _bswap_constant_32).

This can be resolved using something like what is found in this LGPL-2.1 project: analogdevicesinc/libiio@9c6c6a4

export.c:22:19: fatal error: uchar.h: No such file or directory

Hi,
I tried to compile the current snapshot (fetched) but it fails on Debian wiht:

gcc -O0 -g -Wall -Wsign-compare -std=gnu11 -fshort-wchar -fPIC -fvisibility=hidden -D_GNU_SOURCE -I/root/efivar-master/src/include/efivar/  -Wmaybe-uninitialized  -c -o export.o export.c
export.c:22:19: fatal error: uchar.h: No such file or directory
compilation terminated.
make[1]: *** [export.o] Error 1
make[1]: Leaving directory `/root/efivar-master/src'
$ find . -name uchar.h
$

efivar-0.21 fails to create boot entry when device min number > 127

No need to reproduce I guess, just see into linux.c:62:

set_disk_and_part_name(struct disk_info *info)

rc = sysfs_readlink(&linkbuf, "/sys/dev/block/%"PRIu64":%hhd",
info->major, info->minor);

%hhd prints unsigned info->minor as signed, which causes wrong device path if info->minor is greater than 127:

lsblk | grep sdj

sdj 8:144 1 29.8G 0 disk
├─sdj1 8:145 1 1G 0 part /boot
└─sdj2 8:146 1 28.8G 0 part /

strace efibootmgr -c -d /dev/sdj -p 1 -L … -l … -u … :
open("/dev/sdj", O_RDONLY) = 3
fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(8, 144), ...}) = 0
readlink("/sys/dev/block/8:-112", 0x7ffd5a0f9080, 4096) = -1 ENOENT

simple patch:

--- src/linux.c.old 2015-08-24 16:34:13.606782416 +0600
+++ src/linux.c 2015-08-24 16:34:21.366845626 +0600
@@ -59,7 +59,7 @@
char *linkbuf;
ssize_t rc;

- rc = sysfs_readlink(&linkbuf, "/sys/dev/block/%"PRIu64":%hhd",

  •   rc = sysfs_readlink(&linkbuf, "/sys/dev/block/%"PRIu64":%hhu",
                    info->major, info->minor);
      if (rc < 0)
              return -1;
    

Compilation with CLANG

Hi,

We are working on compiling efivar on CLANG (for Android-N). We are facing an issue with the variable argument handling in efi_set_variable() as CLANG does not support __builtin_va_arg_pack functions.

What do you suggest as a definitive fix ?

We can provide a patch either

  • fixes the optional parameter as mandatory, which will break the compatibility for some code
  • with some #ifdef code suppress the handling of this parameter in CLANG (and can show eventual warning)

Thank you for your suggestion,

Regards,

efibootmgr --unicode option fails with "Invalid argument" error

When attempting to add a new boot entry with efibootmgr, and passing extra command line arguments with the --unicode option, the operation fails with an "Invalid argument" error.

For example:

# efibootmgr -c -d /dev/sdc -p 1 -L 'Debian' -l '\efi\debian\vmlinuz.efi' --unicode 'root=/dev/sdc2 ro initrd=\efi\debian\initrd.img'
efibootmgr: Could not set variable: Invalid argument
efibootmgr: Could not prepare boot variable: Invalid argument

The problem was first noticed with the Debian unstable packages, but reproduced with efibootmgr v0.12 and efivar v0.20 tarballs downloaded from GitHub.

A little digging suggests that the problem is over-zealous call validation in efivar's efi_loadopt_create(). On line 39 of loadopt.c, there is a test of the call parameters:

if (!description || (!optional_data && optional_data_size != 0))

However, in efibootmgr's make_boot_var(), there is a call:

needed = make_linux_load_option(&boot->data, &boot->data_size, NULL, sz);

which results in efi_loadopt_create() being called with optional_data == NULL and optional_data_size != 0 when the -u option is used. The call appears to be correct, as make_boot_var() uses the returned value to allocate a buffer for a later call.

Removing the tests on optional_data and optional_data_size allows the new boot entry operation to complete.

(Adding the new boot entry to the boot order also fails - I have yet to investigate that problem.)

Nick.

Quality Assurance issue

Hello,

a Quality Assurance issue was reported by the build system of my Gentoo Linux tinderbox [1] while building a Gentoo package containing your software.

Such reported issues are sometimes correct.
Otherwise just drop this mail.
OTOH it would be interesting why the issue is wrong.

QA: other
QA Notice: Package triggers severe warnings which indicate that it
may exhibit random runtime failures.
dp-media.c:37:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
dp-message.c:577:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
dp-message.c:578:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
dp-message.c:585:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
dp-message.c:586:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
Please do not file a Gentoo bug and instead report the above QA
issues directly to the upstream developers of this software.
Homepage: https://github.com/rhinstaller/efivar

Create a 0.24 release

Hi,

There are problems that have been fixed since 0.23 was released that have been fixed in master. Could you issue a new release for them here and update in rawhide too?

fwupd/fwupd#46 was reported, and at least suspected to be caused by missing fixes for NVMe.

make_pci_path failed due to sysfs file name

In efivar/src/linux.c, in function make_pci_path, the source tries to read the sysfs file for uid with:
rc = read_sysfs_file(&fbuf, "/sys/devices/pci%4x:%02x/firmware_node/uid", root_domain, root_bus);
which results in "/sys/devices/pci 0:00/firmware_node/uid" with root_domain & root_bus =0.

Unfortunately, the real path is the following:
/sys/devices/pci0000:00/firmware_node/uid

So the correct format should be (root_domain formatted on 4 digits minimum):
rc = read_sysfs_file(&fbuf, "/sys/devices/pci%04x:%02x/firmware_node/uid", root_domain, root_bus);

Cedric

Explicit dependency on -ldl is missing from libefivar.so

Jared has been issuing updated releases of efivar in Debian, and I'm working on getting it into Ubuntu. I've found that the way the toolchain is configured on Ubuntu at least pesign fails to build.

/usr/bin/gcc -L../libdpe       -pie -fPIE -Wl,-z,relro,-z,now -o efisiglist efisiglist.o siglist.o -lpopt -luuid  -lnss3 -lnssutil3 -lsmime3 -lssl3 -lplds4 -lplc4 -lnspr4    -lefivar -ldl   -lpthread
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libefivar.so: undefined reference to `dlopen'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libefivar.so: undefined reference to `dlclose'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libefivar.so: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status

Adjusting the order of -ldl in that command invocation doesn't fix the problem.

Looking more closely, the dynamic libraries needed by libefivar.so don't call out a dependency on libdl.

$ ldd src/libefivar.so
linux-vdso.so.1 =>  (0x00007fffec1a1000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff39b2c2000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff39b8ce000)

Fail more informatively when failing to set a variable

As per Red Hat #952644, it's a known problem in the old efibootmgr that when it calls set_variable() and that fails, efibootmgr just fails silently. This means that downstream we get lots of bug reports that are fairly useless unless we can get the reporters to post their kernel logs - all we know is efibootmgr failed, for some reason.

As per IRC this morning, it sounds like the kernel is now returning useful enough information that efivar could fail more informatively in this case:

<pjones> adamw: eh, the errors we get back should be something we can work with actually, at least in linus's current tree (where I just looked)
<pjones> we just aren't yet.
<adamw> even in efivar?
<pjones> yeah

then efibootmgr, and consequently the whole anaconda/libreport military-industrial complex, could also fail more informatively, and we would all curse at bugzilla slightly less.

efivar 26: errors when trying to build from source

My compile params are:

bindir=/usr/$(exhost --target)/bin
includedir=/usr/$(exhost --target)/include
libdir=/usr/$(exhost --target)/lib
prefix=/usr/$(exhost --target)
CROSS_COMPILE=$(exhost --tool-prefix)
BINTARGETS=efivar
STATICLIBTARGETS=

When trying to build efivar 26 I get the following error:

x86_64-pc-linux-gnu-cc -pipe -O2 -march=native -I/var/tmp/paludis/build/sys-boot-efivar-26/work/efivar-26/src/include/efivar/    -L.      -pipe -O2 -march=native -shared \
  -Wl,-soname,libefivar.so.26 \
  -Wl,--version-script=libefivar.map \
  -o libefivar.so dp.o dp-acpi.o dp-hw.o dp-media.o dp-message.o efivarfs.o error.o export.o guid.o guids.o guid-symbols.o lib.o vars.o -ldl 
make[1]: Leaving directory '/var/tmp/paludis/build/sys-boot-efivar-26/work/efivar-26/src'
lib.o:(*IND*+0x0): multiple definition of `efi_set_variable'
lib.o:lib.c:(.text+0xf0): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [/var/tmp/paludis/build/sys-boot-efivar-26/work/efivar-26/Make.rules:20: libefivar.so] Error 1
make: *** [Makefile:11: all] Error 2

When I apply a patch found at openembedded (source: https://github.com/openembedded/meta-openembedded/blob/master/meta-oe/recipes-extended/efivar/efivar/allow-multi-definitions-for-native.patch ) I get the following error:

x86_64-pc-linux-gnu-cc -pipe -O2 -march=native -I/var/tmp/paludis/build/sys-boot-efivar-26/work/efivar-26/src/include/efivar/    -L.      -pipe -O2 -march=native -shared \
  -Wl,-soname,libefiboot.so.26 \
  -Wl,--version-script=libefiboot.map \
  -Wl,-z,muldefs \
  -o libefiboot.so crc32.o creator.o disk.o gpt.o linux.o loadopt.o -lefivar 
x86_64-pc-linux-gnu-cc -pipe -O2 -march=native -I/var/tmp/paludis/build/sys-boot-efivar-26/work/efivar-26/src/include/efivar/    -L.      -pipe -O2 -march=native -o efivar efivar.c -lefivar -ldl -lpopt

Error:
  * In program cave perform install --hooks --managed-output --output-exclusivity with-others =sys-boot/efivar-26:0::arbor --destination installed --x-of-y 1 of 1:
  * When installing 'sys-boot/efivar-26:0::arbor':
  * When running an ebuild command on 'sys-boot/efivar-26:0::arbor':
  * Install failed for 'sys-boot/efivar-26:0::arbor' (paludis::ActionFailedError)

make[1]: Leaving directory '/var/tmp/paludis/build/sys-boot-efivar-26/work/efivar-26/src'
./libefivar.so: undefined reference to `strdupa'
collect2: error: ld returned 1 exit status
make[1]: *** [/var/tmp/paludis/build/sys-boot-efivar-26/work/efivar-26/Make.rules:13: efivar] Error 1
make: *** [Makefile:11: all] Error 2

The file path inside the EFI variable "fwupdate-xxxx" is created incorrectly.

To reproduce this issue, please follow these steps.

  1. Create 2 partitions on a USB key or SSD
  2. The first partition is FAT (/dev/sda1), with the following layout:
/EFI
  + boot/
  + bootx64.efi
  + <dir>/ //<dir> is controlled by fwupdate during build time
    + fw/
    + fwupdate.efi
  • The second partition is EXT3/4 (/dev/sda2) and rootfs is in it.
  • Boot the Linux kernel with the following kernel commands:
root=/dev/sda2 rw rootwait
  • Login to Linux system. Run the following commands:
$ mkdir /boot/efi
$ mount /dev/sda1 /boot/efi
$ fwupdmgr install firmware.cab
$ cd /sys/firmware/efi/efivars
$ hexdump -C fwupdate-*

The dumped file path contains an invalid file path.

The attached patch for efivar explains why this issue happens. For example, if /dev/sda1 has been mounted at another place prior to running "mount /dev/sda1 /boot/efi", e.g, /media/sda1, then the generated file path in fwupdate-* variable (and the BootXXXX variable which contains the path to fwupdate.efi) will be corrupted.

Note: if /dev/sda1 has been mounted at /boot/efi, please manually umount it and then mount it to /media/sda1 then mount it again at /boot/efi.

The patch is attached:

From 8bd7845e95baf2d5e1b296cca2718426d8f4e120 Mon Sep 17 00:00:00 2001
From: Lans Zhang <jia.zhang@windriver.com>
Date: Sat, 26 Sep 2015 14:00:04 +0800
Subject: [PATCH] Fix getting back a wrong relpath

If a device is mounted at morn than one mount points, the relpath
may be created with unexpected result because there is no compare
before doing it.

Signed-off-by: Lans Zhang <jia.zhang@windriver.com>

---
 src/creator.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/creator.c b/src/creator.c
index 1244cb8..c33b935 100644
--- a/src/creator.c
+++ b/src/creator.c
@@ -116,6 +116,8 @@ find_file(const char * const filepath, char **devicep, char **relpathp)
                errno = ENAMETOOLONG;
                goto err;
            }
+           if (strncmp(linkbuf, me->mnt_dir, mntlen))
+               continue;
            *devicep = strdup(me->mnt_fsname);
            if (!*devicep)
                goto err;
-- 
1.9.1

efivar fails to build with 4.8.x

For example:
On Ubuntu 14.04.4 LTS \n \l

$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

| dp.c: In function ‘efidp_duplicate_extra’:
| dp.c:78:2: warning: implicit declaration of function ‘_Generic’ [-Wimplicit-function-declaration]
| if (add(sz, extra, &plus)) {
| ^
| In file included from dp.c:27:0:
| util.h:109:10: error: expected expression before ‘int’
| int *: int_add(a,b,c),
| ^
| dp.c:78:6: note: in expansion of macro ‘add’
| if (add(sz, extra, &plus)) {
| ^
| dp.c:65:58: warning: unused parameter ‘extra’ [-Wunused-parameter]
| efidp_duplicate_extra(const_efidp dp, efidp *out, size_t extra)
| ^

Compliation warnings when compiling with clang

When compiling projects with clang, this warning is shown anytime efivar-dp.h is included.

In file included from /usr/include/efivar/efivar.h:210:
/usr/include/efivar/efivar-dp.h:791:16: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
__attribute__((__artificial__))
               ^
/usr/include/efivar/efivar-dp.h:796:7: warning: nonnull parameter 'dp' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
        if (!dp) {
            ~^~
/usr/include/efivar/efivar-dp.h:804:16: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
__attribute__((__artificial__))
               ^
/usr/include/efivar/efivar-dp.h:809:7: warning: nonnull parameter 'dp' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
        if (!dp) {
            ~^~
/usr/include/efivar/efivar-dp.h:817:16: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
__attribute__((__artificial__))
               ^
/usr/include/efivar/efivar-dp.h:823:7: warning: nonnull parameter 'dn' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
        if (!dn || dn->length < 4) {
            ~^~
/usr/include/efivar/efivar-dp.h:831:16: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
__attribute__((__artificial__))
               ^
/usr/include/efivar/efivar-dp.h:857:16: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
__attribute__((__artificial__))
               ^
/usr/include/efivar/efivar-dp.h:885:16: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
__attribute__((__artificial__))
               ^
/usr/include/efivar/efivar-dp.h:916:16: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
__attribute__((__artificial__))
               ^
/usr/include/efivar/efivar-dp.h:946:16: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
__attribute__((__artificial__))
               ^
/usr/include/efivar/efivar-dp.h:953:7: warning: nonnull parameter 'dp' will evaluate to 'true' on first encounter [-Wpointer-bool-conversion]
        if (!dp) {
            ~^~
/usr/include/efivar/efivar-dp.h:987:16: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
__attribute__((__artificial__))
               ^
/usr/include/efivar/efivar-dp.h:1016:16: warning: unknown attribute '__artificial__' ignored [-Wunknown-attributes]
__attribute__((__artificial__))
               ^

Build failure with gold linker

Building efivar with ld.gold fails.

To reproduce, configure binutils with --enable-gold=default, or add -fuse-ld=gold to LDFLAGS when compiling efivar.

This is with binutils-2.26.1.

% export LDFLAGS="-fuse-ld=gold"
% make efivar
make -C src efivar
make[1]: Entering directory '/home/floppym/src/efivar/src'
gcc -O2 -g3 -I/home/floppym/src/efivar/src/include/efivar/  -specs=/home/floppym/src/efivar/gcc.specs  -L.  -fuse-ld=gold    -DEFIVAR_BUILD_ENVIRONMENT -o makeguids makeguids.c guid.c -ldl 
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld.gold: -PIE: unknown option
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld.gold: use the --help option for usage information
collect2: error: ld returned 1 exit status
make[1]: *** [/home/floppym/src/efivar/Make.rules:13: makeguids] Error 1
make[1]: Leaving directory '/home/floppym/src/efivar/src'
make: *** [Makefile:21: efivar] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.