OSDN Git Service

android-x86/external-efivar.git
9 years agoExclude the padded NULL when comparing the file size
Gary Ching-Pang Lin [Wed, 24 Jun 2015 09:51:44 +0000 (17:51 +0800)]
Exclude the padded NULL when comparing the file size

In vars_del_variable(), this "if" statement always failed because
read_file() returned the actual file size +1.

if (rc < 0 || (buf_size != sizeof(efi_kernel_variable_64_t) &&
               buf_size != sizeof(efi_kernel_variable_32_t)))

Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
9 years agoRemoved unused code section
Fointard [Mon, 8 Jun 2015 09:52:29 +0000 (11:52 +0200)]
Removed unused code section

As guid is checked line 24, the condition line 38 will never be true.
Thus lines 39 and 40 are never executed.

Signed-off-by: Fointard <cmarpaud@gmail.com>
9 years agoDo a better job of setting SONAME right.
Peter Jones [Wed, 17 Jun 2015 17:16:56 +0000 (13:16 -0400)]
Do a better job of setting SONAME right.

Soname should be libfoo.MAJOR not libfoo.MAJOR.MINOR, and we should have
symlinks for all of those things.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoBump version to 0.20
Peter Jones [Tue, 2 Jun 2015 18:32:44 +0000 (14:32 -0400)]
Bump version to 0.20

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdjust linker order for pkg-config to fix FTBFS on Ubuntu toolchain.
Mario Limonciello [Tue, 2 Jun 2015 04:14:41 +0000 (23:14 -0500)]
Adjust linker order for pkg-config to fix FTBFS on Ubuntu toolchain.

/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
make[2]: *** [efisiglist] Error 1

Signed-off-by: Daniel Jared Dominguez <Jared_Dominguez@Dell.com>
Signed-off-by: Mario Limonciello <Mario_Limonciello@Dell.com>
9 years agoMake sure tester is build with the right link order for libraries.
Mario Limonciello [Tue, 2 Jun 2015 13:33:59 +0000 (09:33 -0400)]
Make sure tester is build with the right link order for libraries.

since libefivar references libdl directly, libdl needs to be after it in
the link order.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoWork around LocateDevicePath() not grokking PcieRoot() devices properly.
Peter Jones [Mon, 1 Jun 2015 20:11:58 +0000 (16:11 -0400)]
Work around LocateDevicePath() not grokking PcieRoot() devices properly.

Basically: PNP0A03 always has to work, so everybody always uses it, so
nobody tests PNP0A08 working, so it doesn't.

So you have to lie to the machine about which hardware you want it to
find things on, because if you tell it the truth, it'll lie to you.

The truth is a lie.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoRectify some missing changelog.
Peter Jones [Thu, 28 May 2015 14:31:15 +0000 (10:31 -0400)]
Rectify some missing changelog.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoUpdate version to 0.19
Peter Jones [Thu, 28 May 2015 13:10:54 +0000 (09:10 -0400)]
Update version to 0.19

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd more TODO
Peter Jones [Thu, 28 May 2015 13:10:36 +0000 (09:10 -0400)]
Add more TODO

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd a efivar-static target
Peter Jones [Thu, 28 May 2015 12:45:18 +0000 (08:45 -0400)]
Add a efivar-static target

This adds a target in the toplevel as well as in src/ for
"efivar-static", which builds a static version of the binary for use on
platforms that don't typically have shared libraries.

Based on a patch from Antonio Ospite <ao2@ao2.it>
Resolves: issue #14

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd some TODO
Peter Jones [Wed, 27 May 2015 18:52:57 +0000 (14:52 -0400)]
Add some TODO

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoGet rid of a bunch of legacy code.
Peter Jones [Thu, 14 May 2015 13:22:30 +0000 (09:22 -0400)]
Get rid of a bunch of legacy code.

We don't need SCSI ioctls and such any more, since we're parsing it all
from sysfs.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake ATA/ATAPI devices work most of the time hopefully.
Peter Jones [Tue, 12 May 2015 20:48:49 +0000 (16:48 -0400)]
Make ATA/ATAPI devices work most of the time hopefully.

Qemu and friends use these sometimes, but there's no good way to tell
them apart from SATA.  We're guessing based on driver name: pata_* or
ata_piix -> ata.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoStart man pages for efidp...
Peter Jones [Mon, 11 May 2015 16:58:37 +0000 (12:58 -0400)]
Start man pages for efidp...

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake loadopt function naming more homogenous.
Peter Jones [Mon, 11 May 2015 14:04:06 +0000 (10:04 -0400)]
Make loadopt function naming more homogenous.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoGet rid of extra _dp_ from efidp_is_multiinstance()
Peter Jones [Mon, 11 May 2015 14:03:05 +0000 (10:03 -0400)]
Get rid of extra _dp_ from efidp_is_multiinstance()

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd stubs for efidp_parse_* since they're in the headers.
Peter Jones [Mon, 11 May 2015 14:01:59 +0000 (10:01 -0400)]
Add stubs for efidp_parse_* since they're in the headers.

These both set errno=ENOSYS and return -1 for now.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoGet rid of our dynamic major code; we get it from sysfs.
Peter Jones [Thu, 7 May 2015 19:09:07 +0000 (15:09 -0400)]
Get rid of our dynamic major code; we get it from sysfs.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoPropogate errors back from efi_generate_*() correctly.
Peter Jones [Thu, 7 May 2015 19:05:46 +0000 (15:05 -0400)]
Propogate errors back from efi_generate_*() correctly.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoDo a better job of figuring out partition numbers.
Peter Jones [Thu, 7 May 2015 19:05:01 +0000 (15:05 -0400)]
Do a better job of figuring out partition numbers.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoLoad options are packed...
Peter Jones [Thu, 7 May 2015 19:04:02 +0000 (15:04 -0400)]
Load options are packed...

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMissed one tiny bit of getting rid of -lpci.
Peter Jones [Thu, 7 May 2015 18:34:58 +0000 (14:34 -0400)]
Missed one tiny bit of getting rid of -lpci.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMinor formatting change in efiboot-loadopt.h
Peter Jones [Wed, 6 May 2015 14:18:23 +0000 (10:18 -0400)]
Minor formatting change in efiboot-loadopt.h

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd some validity checkers for dp and loadopt.
Peter Jones [Wed, 6 May 2015 14:18:10 +0000 (10:18 -0400)]
Add some validity checkers for dp and loadopt.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoFix wrong indent typo.
Peter Jones [Wed, 6 May 2015 13:29:34 +0000 (09:29 -0400)]
Fix wrong indent typo.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years ago-ldl is not a dep.
Peter Jones [Fri, 1 May 2015 21:26:51 +0000 (17:26 -0400)]
-ldl is not a dep.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake "make" failures kill things correctly at the top level.
Peter Jones [Fri, 1 May 2015 21:26:29 +0000 (17:26 -0400)]
Make "make" failures kill things correctly at the top level.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoBump version to 0.18
Peter Jones [Fri, 1 May 2015 15:04:03 +0000 (11:04 -0400)]
Bump version to 0.18

This is release is mostly just to get libefiboot api out there where it
cna be used.

0.19 will be mostly documentation for efiboot and verification that more
obscure device types (nvme, ib, iscsi, fc, fcoe) path generation works.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoI replaced read_file and didn't fix up the callers.
Peter Jones [Thu, 30 Apr 2015 20:41:23 +0000 (16:41 -0400)]
I replaced read_file and didn't fix up the callers.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoThere's really no reason to have make_whole_blockdev_path()
Peter Jones [Thu, 30 Apr 2015 19:46:53 +0000 (15:46 -0400)]
There's really no reason to have make_whole_blockdev_path()

kill it with fire.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd beginnings of network bits.
Peter Jones [Thu, 30 Apr 2015 19:40:21 +0000 (15:40 -0400)]
Add beginnings of network bits.

This gets us exactly far enough to make ipv4 DHCP device paths.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoGet rid of the last caller to get_disk_name()
Peter Jones [Thu, 30 Apr 2015 15:26:28 +0000 (11:26 -0400)]
Get rid of the last caller to get_disk_name()

Since we now have the disk_name here already, we don't need to call it.

Which is good, since it's gone already.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake it so efibootmgr doesn't have to have the full OS path of loader.
Peter Jones [Wed, 29 Apr 2015 18:55:54 +0000 (14:55 -0400)]
Make it so efibootmgr doesn't have to have the full OS path of loader.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake efi_make_load_option() handle device paths a little nicer.
Peter Jones [Wed, 29 Apr 2015 16:26:21 +0000 (12:26 -0400)]
Make efi_make_load_option() handle device paths a little nicer.

1) fix the dp_size storage in the load option so it's the right size
2) work slightly better with the normal measure/allocate two call usage.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAutomatically convert / to \ in file device paths.
Peter Jones [Wed, 29 Apr 2015 16:02:10 +0000 (12:02 -0400)]
Automatically convert / to \ in file device paths.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoGet PCI(e) root creation right.
Peter Jones [Tue, 28 Apr 2015 21:16:58 +0000 (17:16 -0400)]
Get PCI(e) root creation right.

We've always been using a completely bogus value that just happens to be
correct (0 -> generally ignored) on nearly all machines without PCI
domains/segments.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoSimplify our blockdev/pci path creation a bit.
Peter Jones [Tue, 28 Apr 2015 21:16:30 +0000 (17:16 -0400)]
Simplify our blockdev/pci path creation a bit.

There's no reason to have two functions if all one does is call the
other.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd AcpiEx() device path creation.
Peter Jones [Tue, 28 Apr 2015 21:15:37 +0000 (17:15 -0400)]
Add AcpiEx() device path creation.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoEradicate -lpci since we have to parse the sysfs device path anyway.
Peter Jones [Fri, 24 Apr 2015 21:56:47 +0000 (17:56 -0400)]
Eradicate -lpci since we have to parse the sysfs device path anyway.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoFix an off-by-one valgrind found.
Peter Jones [Fri, 24 Apr 2015 20:41:25 +0000 (16:41 -0400)]
Fix an off-by-one valgrind found.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake Sata() and Sas() paths work for the hardware in front of me.
Peter Jones [Fri, 24 Apr 2015 20:41:01 +0000 (16:41 -0400)]
Make Sata() and Sas() paths work for the hardware in front of me.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake efi_generate_file_device_path() free everything it allocates.
Peter Jones [Fri, 24 Apr 2015 20:40:30 +0000 (16:40 -0400)]
Make efi_generate_file_device_path() free everything it allocates.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd a first-edition version of efidp_make_sas()
Peter Jones [Fri, 24 Apr 2015 20:39:07 +0000 (16:39 -0400)]
Add a first-edition version of efidp_make_sas()

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd some more utility functions for reading sysfs crap.
Peter Jones [Fri, 24 Apr 2015 20:37:40 +0000 (16:37 -0400)]
Add some more utility functions for reading sysfs crap.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake read_file() add a terminating NUL.
Peter Jones [Fri, 24 Apr 2015 20:20:21 +0000 (16:20 -0400)]
Make read_file() add a terminating NUL.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years ago*Actually* make Sata() paths work, as long as you have no port multiplier.
Peter Jones [Thu, 23 Apr 2015 21:13:27 +0000 (17:13 -0400)]
*Actually* make Sata() paths work, as long as you have no port multiplier.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake Sata() device paths get generated maybe kinda.
Peter Jones [Thu, 23 Apr 2015 17:39:10 +0000 (13:39 -0400)]
Make Sata() device paths get generated maybe kinda.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd HD() device path generation and debug the whole thing.
Peter Jones [Wed, 22 Apr 2015 17:32:05 +0000 (13:32 -0400)]
Add HD() device path generation and debug the whole thing.

Whew.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd all of device path generation except the HD() part for scsi devices.
Peter Jones [Tue, 14 Apr 2015 21:04:13 +0000 (17:04 -0400)]
Add all of device path generation except the HD() part for scsi devices.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd starting bits for making device paths from real files...
Peter Jones [Thu, 9 Apr 2015 21:13:11 +0000 (17:13 -0400)]
Add starting bits for making device paths from real files...

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd a bunch of load option handling utilities to efiboot.
Peter Jones [Tue, 7 Apr 2015 18:07:52 +0000 (14:07 -0400)]
Add a bunch of load option handling utilities to efiboot.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake ucs2_to_utf8() unsigned and add some more unicode utility functions.
Peter Jones [Tue, 7 Apr 2015 18:05:52 +0000 (14:05 -0400)]
Make ucs2_to_utf8() unsigned and add some more unicode utility functions.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoSplit boot-related stuff off into a second library.
Peter Jones [Thu, 2 Apr 2015 17:28:39 +0000 (13:28 -0400)]
Split boot-related stuff off into a second library.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake all of our API visibility explicit.
Peter Jones [Thu, 2 Apr 2015 14:58:31 +0000 (10:58 -0400)]
Make all of our API visibility explicit.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoBump version to 0.17
Peter Jones [Thu, 12 Mar 2015 14:04:14 +0000 (10:04 -0400)]
Bump version to 0.17

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake efivar.spec depend on Makefile
Peter Jones [Thu, 12 Mar 2015 14:03:59 +0000 (10:03 -0400)]
Make efivar.spec depend on Makefile

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoefidp_hd needs __packed__ .
Peter Jones [Thu, 12 Mar 2015 13:53:22 +0000 (09:53 -0400)]
efidp_hd needs __packed__ .

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake efidp_make_acpi_hid honor the size convention.
Peter Jones [Thu, 12 Mar 2015 13:00:30 +0000 (09:00 -0400)]
Make efidp_make_acpi_hid honor the size convention.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd efidp_make_sata()
Peter Jones [Thu, 12 Mar 2015 12:49:01 +0000 (08:49 -0400)]
Add efidp_make_sata()

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoBetter error checking in efidp_make_file()
Peter Jones [Thu, 12 Mar 2015 12:48:45 +0000 (08:48 -0400)]
Better error checking in efidp_make_file()

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoGet the size on efi_make_file() right.
Peter Jones [Tue, 10 Mar 2015 20:37:29 +0000 (16:37 -0400)]
Get the size on efi_make_file() right.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake efidp_size() treat the return of efidp_next_node() correctly.
Peter Jones [Tue, 10 Mar 2015 19:05:43 +0000 (15:05 -0400)]
Make efidp_size() treat the return of efidp_next_node() correctly.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agomake efidp_type() and efidp_subtype() work as expected.
Peter Jones [Tue, 10 Mar 2015 19:05:21 +0000 (15:05 -0400)]
make efidp_type() and efidp_subtype() work as expected.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake utf8len() and utf8_to_ucs2() actually work.
Peter Jones [Tue, 10 Mar 2015 19:04:54 +0000 (15:04 -0400)]
Make utf8len() and utf8_to_ucs2() actually work.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAudit our size=0 return paths on efidp_make_*()
Peter Jones [Tue, 10 Mar 2015 19:04:31 +0000 (15:04 -0400)]
Audit our size=0 return paths on efidp_make_*()

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoClean up some .h.P files in "make clean"
Peter Jones [Tue, 10 Mar 2015 19:03:17 +0000 (15:03 -0400)]
Clean up some .h.P files in "make clean"

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd some load option handling.
Peter Jones [Tue, 3 Mar 2015 21:28:35 +0000 (16:28 -0500)]
Add some load option handling.

This might actually go back to efibootmgr once all the refactoring is
done.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd some miscelaneous functions for inspecting the current system.
Peter Jones [Tue, 3 Mar 2015 21:21:38 +0000 (16:21 -0500)]
Add some miscelaneous functions for inspecting the current system.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd a bunch more efidp makers
Peter Jones [Tue, 3 Mar 2015 21:18:08 +0000 (16:18 -0500)]
Add a bunch more efidp makers

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake a bunch of efidp node creation functions.
Peter Jones [Mon, 2 Mar 2015 22:02:35 +0000 (17:02 -0500)]
Make a bunch of efidp node creation functions.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake a bunch of efidp node creation functions.
Peter Jones [Mon, 2 Mar 2015 22:02:35 +0000 (17:02 -0500)]
Make a bunch of efidp node creation functions.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoDon't put _SUBTYPE on 2 decls and not all the others.
Peter Jones [Mon, 2 Mar 2015 22:02:11 +0000 (17:02 -0500)]
Don't put _SUBTYPE on 2 decls and not all the others.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd utf8len() and utf8_to_ucs2()
Peter Jones [Mon, 2 Mar 2015 22:01:33 +0000 (17:01 -0500)]
Add utf8len() and utf8_to_ucs2()

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoFinish implementing message device path formatters.
Peter Jones [Mon, 2 Mar 2015 20:08:47 +0000 (15:08 -0500)]
Finish implementing message device path formatters.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd ucs2len() in case we need it later.
Peter Jones [Mon, 2 Mar 2015 19:15:08 +0000 (14:15 -0500)]
Add ucs2len() in case we need it later.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoPrint memory range types as decimal.
Peter Jones [Mon, 2 Mar 2015 19:14:48 +0000 (14:14 -0500)]
Print memory range types as decimal.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoFinish acpi device path formatting.
Peter Jones [Mon, 2 Mar 2015 19:14:33 +0000 (14:14 -0500)]
Finish acpi device path formatting.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoRework our formatting functions for much more simplicity.
Peter Jones [Mon, 2 Mar 2015 16:55:55 +0000 (11:55 -0500)]
Rework our formatting functions for much more simplicity.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd some more device path formatters.
Peter Jones [Fri, 27 Feb 2015 21:34:34 +0000 (16:34 -0500)]
Add some more device path formatters.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd a UsbWwid format printer and make File() somewhat more paranoid.
Peter Jones [Fri, 27 Feb 2015 21:29:03 +0000 (16:29 -0500)]
Add a UsbWwid format printer and make File() somewhat more paranoid.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd a bunch more device path formatters.
Peter Jones [Fri, 27 Feb 2015 20:56:52 +0000 (15:56 -0500)]
Add a bunch more device path formatters.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd an IPv6 printer.
Peter Jones [Fri, 27 Feb 2015 18:48:59 +0000 (13:48 -0500)]
Add an IPv6 printer.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoCall our string formatting functions _format_ not _print_
Peter Jones [Fri, 27 Feb 2015 18:48:37 +0000 (13:48 -0500)]
Call our string formatting functions _format_ not _print_

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agolib.h: Include <limits.h> for NAME_MAX
Felix Janda [Sat, 21 Mar 2015 08:03:31 +0000 (09:03 +0100)]
lib.h: Include <limits.h> for NAME_MAX

9 years agoefivar.h: Use __builtin_va_arg_pack_len consistently
Felix Janda [Sat, 21 Mar 2015 07:54:14 +0000 (08:54 +0100)]
efivar.h: Use __builtin_va_arg_pack_len consistently

Suggested-by: Travis Tilley
9 years agoFix potential pointer dereferencement
Gaelle Nassiet [Mon, 23 Feb 2015 17:05:45 +0000 (18:05 +0100)]
Fix potential pointer dereferencement

Signed-off-by: Gaelle Nassiet <gaellex.nassiet@intel.com>
9 years agoMake an initial allocation for our realloc buffer.
Peter Jones [Tue, 31 Mar 2015 14:34:12 +0000 (10:34 -0400)]
Make an initial allocation for our realloc buffer.

This silences coverity and valgrind, even though it's not strictly
necessary.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agomakeguids: Allocate enough space for outbuf
Felix Janda [Sat, 21 Mar 2015 08:06:01 +0000 (09:06 +0100)]
makeguids: Allocate enough space for outbuf

Previously the array outbuf of struct guidname was given space inlen.
If however the lines of the input file are not completely filled,
this might be less than the necessary lines * sizeof(struct guidname).

Now use a dynamically growing array for simplicity.

Reported-by: Travis Tilley
9 years agoMake the .spec get the version number automatically.
Peter Jones [Fri, 27 Feb 2015 15:59:14 +0000 (10:59 -0500)]
Make the .spec get the version number automatically.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMove our include files to instal in a subdir, and generate the .pc on the fly.
Peter Jones [Fri, 27 Feb 2015 15:50:54 +0000 (10:50 -0500)]
Move our include files to instal in a subdir, and generate the .pc on the fly.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd a bunch of dp printing.
Peter Jones [Thu, 26 Feb 2015 20:34:46 +0000 (15:34 -0500)]
Add a bunch of dp printing.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoFlesh out device path lib some more.
Peter Jones [Tue, 24 Feb 2015 21:42:29 +0000 (16:42 -0500)]
Flesh out device path lib some more.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAdd a bunch of device path library functions.
Peter Jones [Mon, 23 Feb 2015 22:10:38 +0000 (17:10 -0500)]
Add a bunch of device path library functions.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake LIBEFIVAR_OPS let you pick which ops table you get at runtime.
Peter Jones [Thu, 5 Feb 2015 19:06:57 +0000 (14:06 -0500)]
Make LIBEFIVAR_OPS let you pick which ops table you get at runtime.

So we can debug without umount.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoTry to actually discover the size of the vars struct by reading one.
Peter Jones [Thu, 5 Feb 2015 19:04:01 +0000 (14:04 -0500)]
Try to actually discover the size of the vars struct by reading one.

Turns out kernel's commit e33655a38 makes /it/ try to decide which
struct to give based on if CONFIG_COMPAT is on and if the userland
process is using it.  So now we have no idea which thing we'll get.

Since the constant size is the problem in the first place, just try to
read one until we have all its data, and return based on the size.

If they all fail, we determine based on __SIZEOF_POINTER__ == 4 ,
but you're probably not going to get a lot of utility out of the
variables anyway.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAllow guids to be followed with whitespace.
Peter Jones [Tue, 3 Feb 2015 17:00:39 +0000 (12:00 -0500)]
Allow guids to be followed with whitespace.

If a guid is all its own in a string followed by a whitespace character,
we're going to be able to parse it just fine.

It's *really* annoying that there's no LOCAL_C_I_MEAN_IT locale_t
sitting around to be used for things like isspace_l().

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake sure efi_guid_to_id_guid.3 gets installed.
Peter Jones [Thu, 18 Dec 2014 16:04:37 +0000 (11:04 -0500)]
Make sure efi_guid_to_id_guid.3 gets installed.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake efivar's vars.c interface choose between 32 and 64 bit at runtime.
Peter Jones [Tue, 16 Dec 2014 19:31:19 +0000 (14:31 -0500)]
Make efivar's vars.c interface choose between 32 and 64 bit at runtime.

We don't actually know what size the /kernel/ interface will use until
we're executed, because it's defined as "unsigned long", and we don't
know if a 32-bit build will be run on a 32-bit or 64-bit kernel.  So in
this case, we figure it out from uname.

This makes the assumption that all the 64-bit arches we might care about
(ia64, x86_64, and aarch64) have "64" in "uname -m" somewhere, and that
none of the 32-bit architectures do.

This should resolve the conflict between 487a9ea and a01d106, and
resolve issue #12 .

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoThe legacy interface makes DataSize "unsigned long" not uint64_t.
Peter Jones [Tue, 16 Dec 2014 14:48:15 +0000 (09:48 -0500)]
The legacy interface makes DataSize "unsigned long" not uint64_t.

This probably hasn't ever been tested on i386 before, but Steve McIntyre
did and it didn't work, because kernel says "unsigned long" for
DataSize, and we have uint64_t.

This should fix issue #11 .