OSDN Git Service

android-x86/external-efibootmgr.git
9 years agoGet rid of a lot of DP stuff that efivar does now.
Peter Jones [Tue, 31 Mar 2015 14:55:35 +0000 (10:55 -0400)]
Get rid of a lot of DP stuff that efivar does now.

9 years agoGet run of unparse_path() and unparse_raw()
Peter Jones [Mon, 2 Mar 2015 20:23:47 +0000 (15:23 -0500)]
Get run of unparse_path() and unparse_raw()

We don't use these any more.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake show_boot_vars use efivars DP formatting code.
Peter Jones [Fri, 27 Feb 2015 18:31:11 +0000 (13:31 -0500)]
Make show_boot_vars use efivars DP formatting code.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoDon't depend on vendor-defined calloc(n, 0) behavior.
Peter Jones [Mon, 12 Jan 2015 19:15:24 +0000 (14:15 -0500)]
Don't depend on vendor-defined calloc(n, 0) behavior.

If we don't have any boot variables, we know that 0 is free, so just
return that.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoTest a couple of pointers for NULL-ness.
Peter Jones [Mon, 12 Jan 2015 19:09:23 +0000 (14:09 -0500)]
Test a couple of pointers for NULL-ness.

In both of these cases buf is NULL if and only if the size is also 0,
and thus we'll fail the test anyway, but coverify isn't noticing that.
And I'm tired of talking to a piece of software about its deficiencies.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoFree some stuff in error pathways.
Peter Jones [Mon, 12 Jan 2015 19:03:06 +0000 (14:03 -0500)]
Free some stuff in error pathways.

This is just to make covscan gripe less.  These variables are legitimate
leaks, though the program is just going to exit afterward anyway.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoDon't malloc(0).
Peter Jones [Mon, 12 Jan 2015 19:05:17 +0000 (14:05 -0500)]
Don't malloc(0).

This is covscan noticing that we're starting at 0 hunks instead of 1
hunk, and that means the first allocation is of 0 bytes, which is inane.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoFix buffer overflow when remove_from_boot_order removes nothing
Lenny Szubowicz [Tue, 6 Jan 2015 16:17:01 +0000 (11:17 -0500)]
Fix buffer overflow when remove_from_boot_order removes nothing

Deleting a boot entry via "-b xxxx -B" also attempts to remove
that entry from boot order via a call to remove_from_boot_order.
Although unusual, it's possible that the entry being deleted is
not in boot order. Correct the handling of this case in
remove_from_boot_order, which malloc's space for the new boot
order list wrongly assuming that at least one entry will be
removed. However, if no entry is removed, then 2 bytes are
overwritten beyond the malloc'ed space. This can result in heap
corruption and possible termination via a SIGABRT if the
corruption is detected by the heap allocation routines.

While there, simplify the routine to do the removal of boot
entries in place in the original data buffer, skip the
unnecessary BootOrder variable update if nothing got removed,
and free the malloc'ed boot_order struct on the way out.

Resolves: RH BZ 1168019

Signed-off-by: Lenny Szubowicz <lszubowi@redhat.com>
9 years agoSkip unreadable variables, but don't exit when we do so.
Daniel Jared Dominguez [Thu, 18 Dec 2014 19:35:27 +0000 (14:35 -0500)]
Skip unreadable variables, but don't exit when we do so.

Old versions of efibootmgr and libefivar0 allowed the installation of
necessary EFI boot entries on the affected systems. It seems that an old
libefivar0 did not report read errors.

Then libefivar0 started to crash on unreadable variables (see Debian bug
764386). Since that bug has been fixed, efibootmgr doesn't crash
anymore, but the read errors are reported and efibootmgr always fails
with an input/output error.

Resolves: debian bug 768880

Signed-off-by: Jan Echternach <jan@goneko.de>
Signed-off-by: Daniel Jared Dominguez <Jared_Dominguez@Dell.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake IPv6 network paths print correctly.
Peter Jones [Tue, 16 Dec 2014 15:01:10 +0000 (10:01 -0500)]
Make IPv6 network paths print correctly.

This should fix issue #13 .

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake IPv4() device paths print correctly.
Peter Jones [Tue, 16 Dec 2014 14:59:53 +0000 (09:59 -0500)]
Make IPv4() device paths print correctly.

We need to give the size to snprintf, not the offset.  The offset is
zero, so it'll only ever tell us the buffer size we need, even if we
have a reasonable buffer.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake the optional_data_len size signed.
Peter Jones [Tue, 16 Dec 2014 14:57:27 +0000 (09:57 -0500)]
Make the optional_data_len size signed.

Steve McIntyre's testing on i386 with efivars using the legacy path
(i.e. not efivarfs) also found a bug here - we're checking
optional_data_len for negative error values, but it's unsigned.  We're
not going to have 4GB of optional loader data, so just make it signed.

This should fix Issue #21 .

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoFix MAC() device path printing.
Peter Jones [Fri, 12 Dec 2014 21:01:00 +0000 (16:01 -0500)]
Fix MAC() device path printing.

67491a308 accidentally made it print MAC(MAC( .

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoPrint a better message if BootOrder is unset.
Peter Jones [Thu, 11 Dec 2014 15:18:37 +0000 (10:18 -0500)]
Print a better message if BootOrder is unset.

This resolves issue #7 .

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoDon't name something efi_variable_t; that namespace is used by efivar.
Peter Jones [Thu, 11 Dec 2014 14:37:00 +0000 (09:37 -0500)]
Don't name something efi_variable_t; that namespace is used by efivar.

Newer efivar has efi_variable_t as a type for its import/export api
(which efibootmgr can use at some point), so don't make a type with that
name internally here.

This fixes github issue #20

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoUpdate version to 0.10
Peter Jones [Tue, 21 Oct 2014 20:17:27 +0000 (16:17 -0400)]
Update version to 0.10

- Fix "-n" and friends not being assigned/checked right sometimes from
  0.10.0-1
- Generate more archives to avoid people using github's, because
  they're just bad.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoDo even more absurd stuff to avoid github's terrible tarballs.
Peter Jones [Tue, 21 Oct 2014 20:14:54 +0000 (16:14 -0400)]
Do even more absurd stuff to avoid github's terrible tarballs.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoActually /set/ the values we're using to the results of parsing the number.
Peter Jones [Tue, 21 Oct 2014 20:02:13 +0000 (16:02 -0400)]
Actually /set/ the values we're using to the results of parsing the number.

This should fix https://github.com/vathpela/efibootmgr/issues/18

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoDon't check if '-n' is a current boot entry so early.
Peter Jones [Tue, 21 Oct 2014 19:01:03 +0000 (15:01 -0400)]
Don't check if '-n' is a current boot entry so early.

We haven't made the list yet, so it'll always be wrong.

This should fix part of https://github.com/vathpela/efibootmgr/issues/18

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoAudit error checking in main().
Peter Jones [Mon, 20 Oct 2014 18:34:17 +0000 (14:34 -0400)]
Audit error checking in main().

Previously, one return value wound up not being checked at all,
resulting in https://github.com/vathpela/efibootmgr/issues/14 , and
several weren't checked as they should have been.

Sorry about that.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake the version 0.10.0
Peter Jones [Mon, 20 Oct 2014 16:21:02 +0000 (12:21 -0400)]
Make the version 0.10.0

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake all the other places we're parsing XXXX also do a better job.
Peter Jones [Mon, 20 Oct 2014 16:15:26 +0000 (12:15 -0400)]
Make all the other places we're parsing XXXX also do a better job.

This is related to https://github.com/vathpela/efibootmgr/issues/12 .

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake -o's behavior actually match the documented behavior.
Peter Jones [Mon, 20 Oct 2014 16:04:34 +0000 (12:04 -0400)]
Make -o's behavior actually match the documented behavior.

Also make it a bit better and reporting errors.

This should actually resolve
https://github.com/vathpela/efibootmgr/issues/12 .

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoDon't error on unset BootOrder when we're trying to add to or rm from it.
Peter Jones [Wed, 15 Oct 2014 14:28:13 +0000 (10:28 -0400)]
Don't error on unset BootOrder when we're trying to add to or rm from it.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoProduce a slightly more succinct error when we get -EPERM on the disk.
Peter Jones [Wed, 15 Oct 2014 14:16:55 +0000 (10:16 -0400)]
Produce a slightly more succinct error when we get -EPERM on the disk.

Because one error message is enough.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoDon't call EPERM "not found" when deleting variables.
Peter Jones [Wed, 15 Oct 2014 14:09:13 +0000 (10:09 -0400)]
Don't call EPERM "not found" when deleting variables.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agomanpage lists option '--test' which doesn't seem to exist
D. Jared Dominguez [Tue, 14 Oct 2014 21:24:02 +0000 (16:24 -0500)]
manpage lists option '--test' which doesn't seem to exist

I'm passing along this bug report from Debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=759714

Here's a quick fix:

9 years agoAdd more error messages and better return codes.
Peter Jones [Wed, 15 Oct 2014 13:20:04 +0000 (09:20 -0400)]
Add more error messages and better return codes.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoOne more place we're not printing the error code.
Peter Jones [Tue, 14 Oct 2014 21:15:43 +0000 (17:15 -0400)]
One more place we're not printing the error code.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoFix a segfault in append_extra_args_ascii()
Peter Jones [Tue, 14 Oct 2014 21:09:37 +0000 (17:09 -0400)]
Fix a segfault in append_extra_args_ascii()

How that worked at all before was beyond me.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoMake a few more return paths print some modicum of error message.
Peter Jones [Tue, 14 Oct 2014 19:09:56 +0000 (15:09 -0400)]
Make a few more return paths print some modicum of error message.

Signed-off-by: Peter Jones <pjones@redhat.com>
9 years agoDon't define our own ioctls unless we have to.
Peter Jones [Fri, 10 Oct 2014 21:09:51 +0000 (17:09 -0400)]
Don't define our own ioctls unless we have to.

The way it was, BLKGETSIZE64 wound up being 0x80041272 instead of the
0x80081272 it should be on -m32 builds.  4 isn't the size of 64 bits, so
that results in integer overflow into who knows what space on the stack,
and when we compare it to our gpt header, it's also just plain wrong.

This is all madness, of course, the kernel has exported all of this
stuff since the ancient past.  Use that instead.

Signed-off-by: Peter Jones <pjones@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoLinux kernel versions aren't always 3-tuples any more.
Peter Jones [Fri, 10 Oct 2014 20:42:08 +0000 (16:42 -0400)]
Linux kernel versions aren't always 3-tuples any more.

So we need to handle "3.10" as a version number correctly.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoClarify -o parameters.
Peter Jones [Wed, 8 Oct 2014 18:08:27 +0000 (14:08 -0400)]
Clarify -o parameters.

Clarify the values that can be given to -o, as it has led to some minor
confusion.

Resolves: https://github.com/vathpela/efibootmgr/issues/12

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoRelease 0.9.0
Peter Jones [Thu, 25 Sep 2014 18:00:18 +0000 (14:00 -0400)]
Release 0.9.0

I really should get rid of the third section of the version numbers.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoDon't pass uninitialized data to efi_guid_to_str().
Peter Jones [Thu, 25 Sep 2014 16:46:43 +0000 (12:46 -0400)]
Don't pass uninitialized data to efi_guid_to_str().

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoDon't leak our partition table structures.
Peter Jones [Wed, 10 Sep 2014 21:03:23 +0000 (17:03 -0400)]
Don't leak our partition table structures.

Covscan once more.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoCheck lseek() for errors.
Peter Jones [Wed, 10 Sep 2014 20:56:49 +0000 (16:56 -0400)]
Check lseek() for errors.

Covscan.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoCheck open()s return correctly.
Peter Jones [Wed, 10 Sep 2014 20:50:08 +0000 (16:50 -0400)]
Check open()s return correctly.

Covscan.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoCheck malloc() return.
Peter Jones [Wed, 10 Sep 2014 20:49:51 +0000 (16:49 -0400)]
Check malloc() return.

Covscan.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMake a free non-conditional since the condition can't be ture.
Peter Jones [Wed, 10 Sep 2014 20:24:03 +0000 (16:24 -0400)]
Make a free non-conditional since the condition can't be ture.

Covscan again.  I wonder if it'll complain about this.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoHandle the case where there are no EFI variables.
Peter Jones [Wed, 10 Sep 2014 20:22:21 +0000 (16:22 -0400)]
Handle the case where there are no EFI variables.

So we're on an EFI machine with no variables, eh covscan?

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoDon't reuse a pointer to static data and free conditionally.
Peter Jones [Wed, 10 Sep 2014 20:20:04 +0000 (16:20 -0400)]
Don't reuse a pointer to static data and free conditionally.

Instead, use a second pointer and free that, because poor covscan can't
figure out what's going on.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoDon't free something that shouldn't ever be non-NULL.
Peter Jones [Wed, 10 Sep 2014 20:15:27 +0000 (16:15 -0400)]
Don't free something that shouldn't ever be non-NULL.

Instead, check and error if it's non-NULL.

(Covscan, which got this completely wrong.)

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoCovscan can't tell that we're not filling a buffer...
Peter Jones [Wed, 10 Sep 2014 20:07:02 +0000 (16:07 -0400)]
Covscan can't tell that we're not filling a buffer...

Because the pattern here is:

rc = func_call(buf, buflen)
if (rc < 0)
return error;
buflen = rc;
buf = calloc(1, buflen)
if (!buf)
return error;
rc = func_call(buf, buflen);

Covscan thinks the first func_call() might actually be doing something
to buf.  It isn't, but that's not obvious.  So make it NULL and 0
instead of buf and buflen on the first call.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoGet rid of an invalid comparison.
Peter Jones [Wed, 10 Sep 2014 20:02:58 +0000 (16:02 -0400)]
Get rid of an invalid comparison.

Covscan.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoTry to avoid covscan freaking out about sscanf with %n.
Peter Jones [Wed, 10 Sep 2014 19:57:26 +0000 (15:57 -0400)]
Try to avoid covscan freaking out about sscanf with %n.

covscan says:

 5. efibootmgr-0.8.0/src/lib/disk.c:96:tainted_data_argument â€“ Calling
 function "fgets(char * restrict, int, FILE * restrict)" taints argument
 "line".
 10. efibootmgr-0.8.0/src/lib/disk.c:103:vararg_transitive â€“ Call to
 "sscanf(char const * restrict, char const * restrict, ...)" with
 tainted argument "line" taints "major".
 11. efibootmgr-0.8.0/src/lib/disk.c:103:vararg_transitive â€“ Call to
 "sscanf(char const * restrict, char const * restrict, ...)" with
 tainted argument "line" taints "scanned".
 13. efibootmgr-0.8.0/src/lib/disk.c:103:tainted_data â€“ Using tainted
 variable "scanned" as an index into an array "line".

I *think* that's really complaining that if sscanf fails before
processing %n, then "scanned" is indeterminate here.  So I've assigned
it to 0.

Either way, if any of that goes wrong, the code's going to completely
fail.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFix an error path not checking the return right in make_linux_load_option
Peter Jones [Wed, 10 Sep 2014 19:47:57 +0000 (15:47 -0400)]
Fix an error path not checking the return right in make_linux_load_option

Covscan once again.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMake sure data created for load options is freed.
Peter Jones [Wed, 10 Sep 2014 19:46:04 +0000 (15:46 -0400)]
Make sure data created for load options is freed.

Covscan... may not be right about this one.  But it's better to be sure.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFix some minor memory leaks.
Peter Jones [Wed, 10 Sep 2014 19:40:29 +0000 (15:40 -0400)]
Fix some minor memory leaks.

Well, one and not really another.  Covscan is /almost/ a great tool.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFix another leaked fd.
Peter Jones [Wed, 10 Sep 2014 19:34:12 +0000 (15:34 -0400)]
Fix another leaked fd.

Covscan some more.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoDon't leak our socket's fd when determining network info.
Peter Jones [Wed, 10 Sep 2014 19:32:59 +0000 (15:32 -0400)]
Don't leak our socket's fd when determining network info.

Covscan again.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMake the return path something coverity can actually understand.
Peter Jones [Wed, 10 Sep 2014 19:29:43 +0000 (15:29 -0400)]
Make the return path something coverity can actually understand.

It was *correct* before, but there's no reason to do it that weird way.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFix a bad allocation size.
Peter Jones [Wed, 10 Sep 2014 19:27:02 +0000 (15:27 -0400)]
Fix a bad allocation size.

Covscan found this.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoRelease 0.8.0
Peter Jones [Tue, 9 Sep 2014 15:18:09 +0000 (11:18 -0400)]
Release 0.8.0

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years ago[man] Make option names match what efibootmgr actually provides.
Peter Jones [Tue, 2 Sep 2014 13:41:08 +0000 (09:41 -0400)]
[man] Make option names match what efibootmgr actually provides.

Related: rhbz#948844

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFix some minor errors cppcheck found.
Peter Jones [Fri, 1 Aug 2014 12:57:17 +0000 (08:57 -0400)]
Fix some minor errors cppcheck found.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMove TODO stuff to 0.9
Peter Jones [Fri, 1 Aug 2014 12:44:46 +0000 (08:44 -0400)]
Move TODO stuff to 0.9

Wound up doing some work that's more important than the stuff in the
TODO, so it's all getting moved out to 0.9

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoClean up some whitespace.
Peter Jones [Fri, 1 Aug 2014 12:36:49 +0000 (08:36 -0400)]
Clean up some whitespace.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoAdd the ability to clean up duplicates in BootOrder
Peter Jones [Fri, 1 Aug 2014 12:23:34 +0000 (08:23 -0400)]
Add the ability to clean up duplicates in BootOrder

This adds -D (--remove-dups), which iterates BootOrder and keeps only
the first of any number it finds.  Duplicate entries can happen as a
result of an interaction between fallback.efi and some system firmware,
and this option provides an easy workaround to fix it.

Resolves: rhbz#1097396

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFix some leaked memory that shows up in valgrind.
Peter Jones [Fri, 1 Aug 2014 12:03:49 +0000 (08:03 -0400)]
Fix some leaked memory that shows up in valgrind.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoDon't leak memory in remove_from_boot_order()
Peter Jones [Fri, 1 Aug 2014 09:37:05 +0000 (05:37 -0400)]
Don't leak memory in remove_from_boot_order()

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoDon't pass around a format specifier when we don't need to.
Peter Jones [Fri, 1 Aug 2014 08:56:18 +0000 (04:56 -0400)]
Don't pass around a format specifier when we don't need to.

Current code has the format specifier in a function that doesn't
otherwise know about the format, and passes it in to a function that
does.

And it's always been like this.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoCompare should respect the size of the data it compares.
groxxda [Thu, 31 Jul 2014 16:37:37 +0000 (18:37 +0200)]
Compare should respect the size of the data it compares.

10 years agoUse PRIx64 in nvme parsing.
Peter Jones [Tue, 22 Jul 2014 14:11:39 +0000 (10:11 -0400)]
Use PRIx64 in nvme parsing.

This should fix https://github.com/vathpela/efibootmgr/issues/6 , though
I don't know if it'll actually make nvme work.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoClang uses C99 semantics by default for inline keyword.
Daniel Jared Dominguez [Tue, 8 Jul 2014 01:50:50 +0000 (20:50 -0500)]
Clang uses C99 semantics by default for inline keyword.

It's most straightforward not to state get_scsi_idlun is inline.

Signed-off-by: Daniel Jared Dominguez <Jared_Dominguez@Dell.com>
10 years agoVariable "needed" should be of type ssize_t as that's how it's used.
Daniel Jared Dominguez [Mon, 7 Jul 2014 19:18:27 +0000 (14:18 -0500)]
Variable "needed" should be of type ssize_t as that's how it's used.

Signed-off-by: Daniel Jared Dominguez <Jared_Dominguez@Dell.com>
10 years agodata_size in construct_boot_order/set_boot_order is of type size_t, so fix a couple...
Daniel Jared Dominguez [Mon, 7 Jul 2014 19:09:15 +0000 (14:09 -0500)]
data_size in construct_boot_order/set_boot_order is of type size_t, so fix a couple of comparisons involving it.

Signed-off-by: Daniel Jared Dominguez <Jared_Dominguez@Dell.com>
10 years agoFix typo in compare function.
Daniel Jared Dominguez [Mon, 7 Jul 2014 19:02:22 +0000 (14:02 -0500)]
Fix typo in compare function.

Signed-off-by: Daniel Jared Dominguez <Jared_Dominguez@Dell.com>
10 years agoRemove unused function var_num_from_name.
Daniel Jared Dominguez [Mon, 7 Jul 2014 18:58:56 +0000 (13:58 -0500)]
Remove unused function var_num_from_name.

Signed-off-by: Daniel Jared Dominguez <Jared_Dominguez@Dell.com>
10 years agoMitigate apple setting invalid attribute bits in boot variables.
Peter Jones [Tue, 17 Jun 2014 18:05:31 +0000 (14:05 -0400)]
Mitigate apple setting invalid attribute bits in boot variables.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoWe don't actually have docbook hooked up to the builds, so ditch it.
Peter Jones [Mon, 16 Jun 2014 18:26:05 +0000 (14:26 -0400)]
We don't actually have docbook hooked up to the builds, so ditch it.

Frankly I'm more comfortable maintaining groff anyway, but right now
they just get out of sync all the time.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoOnly free hard drive signatures if we've allocated them.
Peter Jones [Mon, 5 May 2014 20:09:09 +0000 (16:09 -0400)]
Only free hard drive signatures if we've allocated them.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoRemove bogus test for optional data length bounds.
Peter Jones [Tue, 29 Apr 2014 15:31:15 +0000 (11:31 -0400)]
Remove bogus test for optional data length bounds.

We're getting the size from subtracting from the actual limit; it can't
be over the limit, and it's not related to the variable we're comparing
it to anyway.

Not sure how I came up with that logic, but it sure is wrong.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMake nvme work with "-e 3".
Peter Jones [Mon, 14 Apr 2014 21:19:57 +0000 (17:19 -0400)]
Make nvme work with "-e 3".

This will force a long-form NVME device path.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoAdd support for displaying NVME device paths.
Peter Jones [Mon, 14 Apr 2014 20:49:12 +0000 (16:49 -0400)]
Add support for displaying NVME device paths.

This doesn't actually let you /use/ them yet, but it does show them if
they're there.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoGet a lot more picky with our compiler warnings.
Peter Jones [Mon, 14 Apr 2014 20:39:42 +0000 (16:39 -0400)]
Get a lot more picky with our compiler warnings.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFilenames and github - the worst of both worlds.
Peter Jones [Wed, 2 Apr 2014 14:04:52 +0000 (10:04 -0400)]
Filenames and github - the worst of both worlds.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoCall it 0.7
Peter Jones [Tue, 1 Apr 2014 18:53:43 +0000 (14:53 -0400)]
Call it 0.7

This has been around for a while, and it's not going to get any more
testing without some exposure.  Let's give it a shot.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFix device path size and allocation in make_file_path_device_path()
Peter Jones [Thu, 13 Mar 2014 01:31:45 +0000 (21:31 -0400)]
Fix device path size and allocation in make_file_path_device_path()

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFix a missing error return.
Peter Jones [Thu, 6 Mar 2014 20:05:58 +0000 (15:05 -0500)]
Fix a missing error return.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoAdd a --keep option to preserve the old BootOrder entries when using -o.
Peter Jones [Fri, 7 Feb 2014 18:33:17 +0000 (13:33 -0500)]
Add a --keep option to preserve the old BootOrder entries when using -o.

So basically if you've got a boot order of:

0000,0001,0018,001A,0019

And you do "efibootmgr -o 001A --keep", you'll get:

001A,0000,0001,0018,0019

And if you subsequently do "efibootmgr -o 0002 --keep" you'll get:

0002,001A,0000,0001,0018,0019

This is to work around a buggy firmware reported in rhbz#889509 ,
which will erroneously try to re-populate BootOrder /and create new
Boot#### entries to do so/ if you supply a BootOrder without the
defaults in it.

This firmware is garbage.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoAdd SATA(x,y,z) device path unparsing.
Peter Jones [Thu, 6 Feb 2014 15:08:24 +0000 (10:08 -0500)]
Add SATA(x,y,z) device path unparsing.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoGet the correct size for device path in our optional data blob.
Peter Jones [Wed, 5 Feb 2014 19:26:00 +0000 (14:26 -0500)]
Get the correct size for device path in our optional data blob.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoAdd some requires to our spec file for efivar-libs and efivar-devel.
Peter Jones [Wed, 5 Feb 2014 18:46:53 +0000 (13:46 -0500)]
Add some requires to our spec file for efivar-libs and efivar-devel.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMake Vendor-Defined Message paths show up the same way as in "bcfg boot dump".
Peter Jones [Wed, 5 Feb 2014 18:46:10 +0000 (13:46 -0500)]
Make Vendor-Defined Message paths show up the same way as in "bcfg boot dump".

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMake FvFile show up the same way it does in "bcfg boot dump".
Peter Jones [Wed, 5 Feb 2014 18:45:39 +0000 (13:45 -0500)]
Make FvFile show up the same way it does in "bcfg boot dump".

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoHandle bogus malformed variables somewhat more gracefully.
Peter Jones [Wed, 5 Feb 2014 05:38:20 +0000 (00:38 -0500)]
Handle bogus malformed variables somewhat more gracefully.

Because previously we tried to dump what it was saying, but that really
just means crashing.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoFix gpg path in "make archive".
Peter Jones [Wed, 5 Feb 2014 05:09:17 +0000 (00:09 -0500)]
Fix gpg path in "make archive".

Still pointed at .tar.gz while everything else says .tar.bz2

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMake the man page not mention proc, and make it mention efivarfs.
Peter Jones [Wed, 5 Feb 2014 04:53:22 +0000 (23:53 -0500)]
Make the man page not mention proc, and make it mention efivarfs.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoMerge the old TODO and the new one.
Peter Jones [Wed, 5 Feb 2014 04:50:19 +0000 (23:50 -0500)]
Merge the old TODO and the new one.

Oops.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoUpdate urls in README.
Peter Jones [Wed, 5 Feb 2014 04:47:26 +0000 (23:47 -0500)]
Update urls in README.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoUpdate TODO.
Peter Jones [Wed, 5 Feb 2014 04:40:01 +0000 (23:40 -0500)]
Update TODO.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoGet rid of the 1024-byte limit on ESP file path.
Peter Jones [Wed, 5 Feb 2014 04:26:47 +0000 (23:26 -0500)]
Get rid of the 1024-byte limit on ESP file path.

Not that I think 1024 was something we were going to hit there, but...

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoHandle some other device paths.
Peter Jones [Wed, 5 Feb 2014 04:02:25 +0000 (23:02 -0500)]
Handle some other device paths.

Add support for Vendor-Defined Messaging Device Paths as well as
FVFILE() and FVVOL()

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoGet rid of 1024-byte limit for displaying variables as well.
Peter Jones [Wed, 5 Feb 2014 03:39:00 +0000 (22:39 -0500)]
Get rid of 1024-byte limit for displaying variables as well.

This basically makes all of unparse_path() and its derivatives into
snprintf()-like functions, so we don't have to have static buffers.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoAdd a TODO here so I can keep track of what is yet to be done.
Peter Jones [Tue, 4 Feb 2014 23:51:45 +0000 (18:51 -0500)]
Add a TODO here so I can keep track of what is yet to be done.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoTypo fix.
Peter Jones [Tue, 10 Sep 2013 18:46:00 +0000 (14:46 -0400)]
Typo fix.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoCorrectly fill out sa_family for MAC address device types.
Peter Jones [Tue, 10 Sep 2013 15:25:41 +0000 (11:25 -0400)]
Correctly fill out sa_family for MAC address device types.

Signed-off-by: Peter Jones <pjones@redhat.com>
10 years agoHandle virtio network devices.
Peter Jones [Fri, 6 Sep 2013 18:49:28 +0000 (14:49 -0400)]
Handle virtio network devices.

Just like virtio scsi devices, look up their bus/device/function by the
virtio device instead of the traditional way.

Signed-off-by: Peter Jones <pjones@redhat.com>
Tested-and-reviewed-by: Laszlo Ersek <lersek@redhat.com>