[efibootmgr] Update to 0.9.0
Peter Jones
pjones at fedoraproject.org
Tue Oct 14 20:34:07 UTC 2014
commit 2911475b8dbaf21292ac624b951478c202f12a54
Author: Peter Jones <pjones at redhat.com>
Date: Tue Oct 14 16:33:50 2014 -0400
Update to 0.9.0
Signed-off-by: Peter Jones <pjones at redhat.com>
...names-and-github-the-worst-of-both-worlds.patch | 26 -
...more-return-paths-print-some-modicum-of-e.patch | 234 ++++++++++
...lot-more-picky-with-our-compiler-warnings.patch | 161 -------
...-support-for-displaying-NVME-device-paths.patch | 60 ---
0004-Make-nvme-work-with-e-3.patch | 188 --------
...ogus-test-for-optional-data-length-bounds.patch | 34 --
...ard-drive-signatures-if-we-ve-allocated-t.patch | 28 --
...tually-have-docbook-hooked-up-to-the-buil.patch | 486 --------------------
...ple-setting-invalid-attribute-bits-in-boo.patch | 65 ---
...-Remove-unused-function-var_num_from_name.patch | 30 --
0010-Fix-typo-in-compare-function.patch | 26 -
...n-construct_boot_order-set_boot_order-is-.patch | 36 --
...eded-should-be-of-type-ssize_t-as-that-s-.patch | 113 -----
...C99-semantics-by-default-for-inline-keywo.patch | 42 --
0014-Use-PRIx64-in-nvme-parsing.patch | 29 --
...uld-respect-the-size-of-the-data-it-compa.patch | 26 -
...around-a-format-specifier-when-we-don-t-n.patch | 51 --
...n-t-leak-memory-in-remove_from_boot_order.patch | 29 --
...e-leaked-memory-that-shows-up-in-valgrind.patch | 96 ----
...ility-to-clean-up-duplicates-in-BootOrder.patch | 164 -------
0020-Clean-up-some-whitespace.patch | 337 --------------
0021-Move-TODO-stuff-to-0.9.patch | 32 --
0022-Fix-some-minor-errors-cppcheck-found.patch | 45 --
efibootmgr.spec | 34 +-
sources | 2 +-
25 files changed, 243 insertions(+), 2131 deletions(-)
---
diff --git a/0001-Make-a-few-more-return-paths-print-some-modicum-of-e.patch b/0001-Make-a-few-more-return-paths-print-some-modicum-of-e.patch
new file mode 100644
index 0000000..1695a24
--- /dev/null
+++ b/0001-Make-a-few-more-return-paths-print-some-modicum-of-e.patch
@@ -0,0 +1,234 @@
+From 9885893340146150df885f091bf17db840619154 Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones at redhat.com>
+Date: Tue, 14 Oct 2014 15:09:56 -0400
+Subject: [PATCH] Make a few more return paths print some modicum of error
+ message.
+
+Signed-off-by: Peter Jones <pjones at redhat.com>
+---
+ src/efibootmgr/efibootmgr.c | 16 ++++++++---
+ src/lib/efi.c | 68 +++++++++++++++++++++++++++++----------------
+ 2 files changed, 56 insertions(+), 28 deletions(-)
+
+diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c
+index 01c1505..5f09b0b 100644
+--- a/src/efibootmgr/efibootmgr.c
++++ b/src/efibootmgr/efibootmgr.c
+@@ -242,16 +242,20 @@ make_boot_var(list_t *boot_list)
+ free_number = opts.bootnum;
+ }
+
+- if (free_number == -1)
++ if (free_number == -1) {
++ fprintf(stderr, "efibootmgr: no available boot variables\n");
+ return NULL;
++ }
+
+ /* Create a new efi_variable_t object
+ and populate it.
+ */
+
+ boot = calloc(1, sizeof(*boot));
+- if (!boot)
++ if (!boot) {
++ fprintf(stderr, "efibootmgr: %m\n");
+ return NULL;
++ }
+ if (make_linux_load_option(&boot->data, &boot->data_size) < 0)
+ goto err_boot_entry;
+ if (append_extra_args(&boot->data, &boot->data_size) < 0)
+@@ -260,8 +264,10 @@ make_boot_var(list_t *boot_list)
+ boot->num = free_number;
+ boot->guid = EFI_GLOBAL_VARIABLE;
+ rc = asprintf(&boot->name, "Boot%04X", free_number);
+- if (rc < 0)
++ if (rc < 0) {
++ fprintf(stderr, "efibootmgr: %m\n");
+ goto err_boot_entry;
++ }
+ boot->attributes = EFI_VARIABLE_NON_VOLATILE |
+ EFI_VARIABLE_BOOTSERVICE_ACCESS |
+ EFI_VARIABLE_RUNTIME_ACCESS;
+@@ -272,8 +278,10 @@ make_boot_var(list_t *boot_list)
+ list_add_tail(&boot->list, boot_list);
+ return boot;
+ err_boot_entry:
+- if (boot->name)
++ if (boot->name) {
++ fprintf(stderr, "Could not set variable %s: %m\n", boot->name);
+ free(boot->name);
++ }
+ if (boot->data)
+ free(boot->data);
+ free(boot);
+diff --git a/src/lib/efi.c b/src/lib/efi.c
+index 7cdc884..4b648fc 100644
+--- a/src/lib/efi.c
++++ b/src/lib/efi.c
+@@ -724,10 +724,13 @@ make_linux_load_option(uint8_t **data, size_t *data_size)
+ uint8_t *buf;
+ ssize_t needed;
+ off_t buf_offset = 0, desc_offset;
++ int rc;
+
+ load_option = calloc(1, sizeof (*load_option));
+- if (load_option == NULL)
++ if (load_option == NULL) {
++ fprintf(stderr, "efibootmgr: %m\n");
+ return -1;
++ }
+ buf = (uint8_t *)load_option;
+ buf_offset = 0;
+
+@@ -755,21 +758,33 @@ make_linux_load_option(uint8_t **data, size_t *data_size)
+ if (opts.iface) {
+ needed = make_net_load_option(opts.iface, NULL, 0);
+ if (needed < 0) {
++ fprintf(stderr, "efibootmgr: could not create load option: %m\n");
+ free(buf);
+ return needed;
+ }
+ buf = extend(load_option, load_option_size, needed);
+- make_net_load_option(opts.iface, buf + buf_offset, needed);
++ rc = make_net_load_option(opts.iface, buf + buf_offset, needed);
+ buf_offset += needed;
++ if (rc < 0) {
++ fprintf(stderr, "efibootmgr: could not create load option: %m\n");
++ free(buf);
++ return rc;
++ }
+ } else {
+ needed = make_disk_load_option(opts.iface, NULL, 0);
+ if (needed < 0) {
++ fprintf(stderr, "efibootmgr: could not create load option: %m\n");
+ free(buf);
+ return needed;
+ }
+ buf = extend(load_option, load_option_size, needed);
+- make_disk_load_option(opts.iface, buf + buf_offset, needed);
++ rc = make_disk_load_option(opts.iface, buf + buf_offset, needed);
+ buf_offset += needed;
++ if (rc < 0) {
++ fprintf(stderr, "efibootmgr: could not create load option: %m\n");
++ free(buf);
++ return rc;
++ }
+ }
+
+ load_option->file_path_list_length = buf_offset - desc_offset;
+@@ -792,8 +807,10 @@ append_extra_args_ascii(uint8_t **data, size_t *data_size)
+ int i;
+ unsigned long usedchars=0;
+
+- if (!data || *data)
++ if (!data || *data) {
++ errno = EINVAL;
+ return -1;
++ }
+
+ for (i=opts.optind; i < opts.argc; i++) {
+ int l = strlen(opts.argv[i]) + 1;
+@@ -829,8 +846,10 @@ append_extra_args_unicode(uint8_t **data, size_t *data_size)
+ int i;
+ unsigned long usedchars=0;
+
+- if (!data || *data)
++ if (!data || *data) {
++ errno = EINVAL;
+ return -1;
++ }
+
+ for (i = opts.optind; i < opts.argc; i++) {
+ int l = strlen(opts.argv[i]) + 1;
+@@ -871,37 +890,31 @@ append_extra_args_file(uint8_t **data, size_t *data_size)
+ size_t maxchars = 0;
+ char *buffer;
+
+- if (!data) {
+- fprintf(stderr, "internal error\n");
+- exit(1);
++ if (!data || *data) {
++ errno = EINVAL;
++ return -1;
+ }
+
+ if (file && strncmp(file, "-", 1))
+ fd = open(file, O_RDONLY);
+
+- if (fd == -1) {
+- perror("Failed to open extra arguments file");
+- exit(1);
+- }
++ if (fd < 0)
++ return -1;
+
+ buffer = malloc(maxchars);
+ do {
+ if (maxchars - appended == 0) {
+ maxchars += 1024;
+ char *tmp = realloc(buffer, maxchars);
+- if (tmp == NULL) {
+- perror("Error reading extra arguments file");
+- exit(1);
+- }
++ if (tmp == NULL)
++ return -1;
+ buffer = tmp;
+ }
+ num_read = read(fd, buffer + appended, maxchars - appended);
+- if (num_read < 0) {
+- perror("Error reading extra arguments file");
+- exit(1);
+- } else if (num_read > 0) {
++ if (num_read < 0)
++ return -1;
++ else if (num_read > 0)
+ appended += num_read;
+- }
+ } while (num_read > 0);
+
+ if (fd != STDIN_FILENO)
+@@ -935,14 +948,18 @@ append_extra_args(uint8_t **data, size_t *data_size)
+
+ if (opts.extra_opts_file) {
+ ret = append_extra_args_file(&new_data, &new_data_size);
+- if (ret < 0)
++ if (ret < 0) {
++ fprintf(stderr, "efibootmgr: append_extra_args: %m\n");
+ return -1;
++ }
+ }
+ if (new_data_size) {
+ ret = add_new_data(data, data_size, new_data, new_data_size);
+ free(new_data);
+- if (ret < 0)
++ if (ret < 0) {
++ fprintf(stderr, "efibootmgr: append_extra_args: %m\n");
+ return -1;
++ }
+ new_data = NULL;
+ new_data_size = 0;
+ }
+@@ -952,6 +969,7 @@ append_extra_args(uint8_t **data, size_t *data_size)
+ else
+ ret = append_extra_args_ascii(&new_data, &new_data_size);
+ if (ret < 0) {
++ fprintf(stderr, "efibootmgr: append_extra_args: %m\n");
+ if (new_data) /* this can't happen, but covscan believes */
+ free(new_data);
+ return -1;
+@@ -960,8 +978,10 @@ append_extra_args(uint8_t **data, size_t *data_size)
+ ret = add_new_data(data, data_size, new_data, new_data_size);
+ free(new_data);
+ new_data = NULL;
+- if (ret < 0)
++ if (ret < 0) {
++ fprintf(stderr, "efibootmgr: append_extra_args: %m\n");
+ return -1;
++ }
+ new_data_size = 0;
+ }
+
+--
+1.9.3
+
diff --git a/efibootmgr.spec b/efibootmgr.spec
index e945057..4e95fff 100644
--- a/efibootmgr.spec
+++ b/efibootmgr.spec
@@ -1,7 +1,7 @@
Summary: EFI Boot Manager
Name: efibootmgr
-Version: 0.7.0
-Release: 5%{?dist}
+Version: 0.9.0
+Release: 1%{?dist}
Group: System Environment/Base
License: GPLv2+
URL: https://github.com/vathpela/%{name}/
@@ -16,29 +16,8 @@ Requires: efivar-libs >= 0.8
Conflicts: elilo < 3.6-6
Obsoletes: elilo < 3.6-6
-Source0: https://github.com/vathpela/%{name}/archive/%{name}-%{version}.tar.bz2
-Patch0001: 0001-Filenames-and-github-the-worst-of-both-worlds.patch
-Patch0002: 0002-Get-a-lot-more-picky-with-our-compiler-warnings.patch
-Patch0003: 0003-Add-support-for-displaying-NVME-device-paths.patch
-Patch0004: 0004-Make-nvme-work-with-e-3.patch
-Patch0005: 0005-Remove-bogus-test-for-optional-data-length-bounds.patch
-Patch0006: 0006-Only-free-hard-drive-signatures-if-we-ve-allocated-t.patch
-Patch0007: 0007-We-don-t-actually-have-docbook-hooked-up-to-the-buil.patch
-Patch0008: 0008-Mitigate-apple-setting-invalid-attribute-bits-in-boo.patch
-Patch0009: 0009-Remove-unused-function-var_num_from_name.patch
-Patch0010: 0010-Fix-typo-in-compare-function.patch
-Patch0011: 0011-data_size-in-construct_boot_order-set_boot_order-is-.patch
-Patch0012: 0012-Variable-needed-should-be-of-type-ssize_t-as-that-s-.patch
-Patch0013: 0013-Clang-uses-C99-semantics-by-default-for-inline-keywo.patch
-Patch0014: 0014-Use-PRIx64-in-nvme-parsing.patch
-Patch0015: 0015-Compare-should-respect-the-size-of-the-data-it-compa.patch
-Patch0016: 0016-Don-t-pass-around-a-format-specifier-when-we-don-t-n.patch
-Patch0017: 0017-Don-t-leak-memory-in-remove_from_boot_order.patch
-Patch0018: 0018-Fix-some-leaked-memory-that-shows-up-in-valgrind.patch
-Patch0019: 0019-Add-the-ability-to-clean-up-duplicates-in-BootOrder.patch
-Patch0020: 0020-Clean-up-some-whitespace.patch
-Patch0021: 0021-Move-TODO-stuff-to-0.9.patch
-Patch0022: 0022-Fix-some-minor-errors-cppcheck-found.patch
+Source0: https://github.com/vathpela/%{name}/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2
+Patch0: 0001-Make-a-few-more-return-paths-print-some-modicum-of-e.patch
%description
%{name} displays and allows the user to edit the Intel Extensible
@@ -49,7 +28,7 @@ http://developer.intel.com/technology/efi/efi.htm and http://uefi.org/.
%prep
%setup -q
git init
-git config user.email "shim-owner at fedoraproject.org"
+git config user.email "%{name}-owner at fedoraproject.org"
git config user.name "Fedora Ninjas"
git add .
git commit -a -q -m "%{version} baseline."
@@ -75,6 +54,9 @@ rm -rf %{buildroot}
%doc README INSTALL COPYING
%changelog
+* Tue Oct 14 2014 Peter Jones <pjones at redhat.com> - 0.9.0-1
+- Update to 0.9.0
+
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.7.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
diff --git a/sources b/sources
index bd528d0..0f9ddb9 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-c973dd88352498f574c3dd8a43654cd2 efibootmgr-0.7.0.tar.bz2
+cee2d8fd87cdc2ea4839455f00e38248 efibootmgr-0.9.0.tar.bz2
More information about the scm-commits
mailing list