diff --git a/efibootmgr-0.11.0-check-boot-order.diff b/efibootmgr-0.11.0-check-boot-order.diff new file mode 100644 index 0000000..e576c2a --- /dev/null +++ b/efibootmgr-0.11.0-check-boot-order.diff @@ -0,0 +1,16 @@ +--- + src/efibootmgr/efibootmgr.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/src/efibootmgr/efibootmgr.c ++++ b/src/efibootmgr/efibootmgr.c +@@ -467,6 +467,9 @@ remove_from_boot_order(uint16_t num) + } + } + ++ if (new_i == 0) ++ return efi_del_variable(EFI_GLOBAL_GUID, "BootOrder"); ++ + /* Now new_data has what we need */ + free(boot_order->data); + boot_order->data = (uint8_t *)new_data; diff --git a/efibootmgr-0.6.0-derhat.diff b/efibootmgr-0.11.0-derhat.diff similarity index 84% rename from efibootmgr-0.6.0-derhat.diff rename to efibootmgr-0.11.0-derhat.diff index 291ce6d..b5ced79 100644 --- a/efibootmgr-0.6.0-derhat.diff +++ b/efibootmgr-0.11.0-derhat.diff @@ -1,7 +1,7 @@ From: Raymund Will Subject: Make default '--loader' build-time configurable. - -Each distribution uses a specific 'vendor'-directory in the + +Each distribution uses a specific 'vendor'-directory in the 'efi' directory on the EFI System Partition to store their EFI loader. There's little use in hardcoding the value for just one in 'efibootmgr', which is displayed in '--help' @@ -13,8 +13,8 @@ to get the previous value. :) Signed-off-by: Raymund Will --- - Makefile | 4 ++++ - src/efibootmgr/efibootmgr.c | 12 ++++++++---- + Makefile | 4 ++++ + src/efibootmgr/efibootmgr.c | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) --- a/Makefile @@ -25,15 +25,15 @@ Signed-off-by: Raymund Will + OS_VENDOR := vendor + EFI_LOADER := boot.efi + - SIGNING_KEY := jordan_hargrave - RELEASE_DATE := "23-Jan-2013" + SIGNING_KEY := pjones RELEASE_MAJOR := 0 -@@ -10,6 +13,7 @@ - RELEASE_STRING := $(RELEASE_NAME)-$(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)$(RELEASE_EXTRALEVEL) + RELEASE_MINOR := 11 +@@ -8,6 +11,7 @@ + RELEASE_STRING := $(RELEASE_NAME)-$(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL) - CFLAGS = $(EXTRA_CFLAGS) -DEFIBOOTMGR_VERSION=\"$(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)$(RELEASE_EXTRALEVEL)\" \ + CFLAGS = $(EXTRA_CFLAGS) -DEFIBOOTMGR_VERSION=\"$(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)\" \ + -DDEFAULT_LOADER=\"\\\\efi\\\\$(OS_VENDOR)\\\\$(EFI_LOADER)\" \ - -Wall -g -D_FILE_OFFSET_BITS=64 + -Wsign-compare -Wall -Werror -g -D_FILE_OFFSET_BITS=64 MODULES := src --- a/src/efibootmgr/efibootmgr.c @@ -55,7 +55,7 @@ Signed-off-by: Raymund Will The EFI_DEVICE_PATH will look something like: ACPI device path, length 12 bytes Hardware Device Path, PCI, length 6 bytes -@@ -55,6 +56,9 @@ +@@ -59,6 +60,9 @@ #define EFIBOOTMGR_VERSION "unknown (fix Makefile!)" #endif @@ -64,8 +64,8 @@ Signed-off-by: Raymund Will +#endif typedef struct _var_entry { - struct dirent *name; -@@ -786,7 +790,7 @@ usage() + char *name; +@@ -965,7 +969,7 @@ usage() printf("\t-g | --gpt force disk with invalid PMBR to be treated as GPT\n"); printf("\t-H | --acpi_hid XXXX set the ACPI HID (used with -i)\n"); printf("\t-i | --iface name create a netboot entry for the named interface\n"); @@ -74,7 +74,7 @@ Signed-off-by: Raymund Will printf("\t-L | --label label Boot manager display label (defaults to \"Linux\")\n"); printf("\t-n | --bootnext XXXX set BootNext to XXXX (hex)\n"); printf("\t-N | --delete-bootnext delete BootNext\n"); -@@ -814,7 +818,7 @@ set_default_opts() +@@ -993,7 +997,7 @@ set_default_opts() opts.active = -1; /* Don't set it */ opts.timeout = -1; /* Don't set it */ opts.edd10_devicenum = 0x80; diff --git a/efibootmgr-0.11.0.tar.gz b/efibootmgr-0.11.0.tar.gz new file mode 100644 index 0000000..d950ede --- /dev/null +++ b/efibootmgr-0.11.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c569f654d22788881a2b76f84eb9d708de2d91664689a5cfe8bed61ad134be42 +size 62328 diff --git a/efibootmgr-0.6.0-check-boot-order.diff b/efibootmgr-0.6.0-check-boot-order.diff deleted file mode 100644 index 2a53fe2..0000000 --- a/efibootmgr-0.6.0-check-boot-order.diff +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c -index 7ea1887..b01a05a 100644 ---- a/src/efibootmgr/efibootmgr.c -+++ b/src/efibootmgr/efibootmgr.c -@@ -380,6 +380,9 @@ remove_from_boot_order(uint16_t num) - } - } - -+ if (new_i == 0) -+ return delete_variable(&boot_order); -+ - /* Now new_data has what we need */ - new_data_size = new_i * sizeof(uint16_t); - memset(&(boot_order.Data), 0, boot_order.DataSize); diff --git a/efibootmgr-0.6.0-fail-visibly.diff b/efibootmgr-0.6.0-fail-visibly.diff deleted file mode 100644 index cfc553d..0000000 --- a/efibootmgr-0.6.0-fail-visibly.diff +++ /dev/null @@ -1,34 +0,0 @@ -From: Raymund Will -Subject: Print EFI status on failed operations. -References: bnc#811767 - -Otherwise it's probably noticed only much too late. - -V2: Produce failure output for '--create' as well. - -Reported-by: Frederic Crozat -Signed-off-by: Raymund Will ---- - src/efibootmgr/efibootmgr.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/src/efibootmgr/efibootmgr.c -+++ b/src/efibootmgr/efibootmgr.c -@@ -279,6 +279,7 @@ make_boot_var(list_t *boot_list) - - status = create_variable(&boot->var_data); - if (status != EFI_SUCCESS) { -+ fprintf (stderr,"\n\nrequested operation failed: status=%lx\n\n", status); - free(boot); - return NULL; - } -@@ -1137,6 +1138,9 @@ main(int argc, char **argv) - } - show_boot_order(); - show_boot_vars(); -+ } else if (ret > 1) { -+ /* only print efi_status_t values as others already have a message! */ -+ fprintf (stderr,"\n\nrequested operation failed: status=%lx\n\n", ret); - } - } - free_dirents(boot_names, num_boot_names); diff --git a/efibootmgr-0.6.0-gcc-Wall.diff b/efibootmgr-0.6.0-gcc-Wall.diff deleted file mode 100644 index 9e72377..0000000 --- a/efibootmgr-0.6.0-gcc-Wall.diff +++ /dev/null @@ -1,124 +0,0 @@ -From: Raymund Will -Subject: Fix all gcc warnings. - -+ cc -Wall -g -D_FILE_OFFSET_BITS=64 -Isrc/lib -Isrc/include \ - -c -o src/lib/disk.o src/lib/disk.c -src/lib/disk.c: In function 'disk_get_ide_pci': -src/lib/disk.c:195:9: warning: variable 'read_count' set but not used - [-Wunused-but-set-variable] -src/lib/disk.c: In function 'disk_get_partition_info': -src/lib/disk.c:468:8: warning: variable 'offset' set but not used - [-Wunused-but-set-variable] -+ cc -Wall -g -D_FILE_OFFSET_BITS=64 -Isrc/lib -Isrc/include \ - -c -o src/lib/efi.o src/lib/efi.c -src/lib/efi.c: In function 'is_parent_bridge': -src/lib/efi.c:311:16: warning: variable 'primary' set but not used - [-Wunused-but-set-variable] -src/lib/efi.c: In function 'make_disk_load_option': -src/lib/efi.c:536:10: warning: pointer targets in passing argument 5 of - 'make_harddrive_device_path' differ in signedness [-Wpointer-sign] -src/lib/efi.c:418:1: note: expected 'uint8_t *' but argument is of - type 'char *' -+ cc -Wall -g -D_FILE_OFFSET_BITS=64 -Isrc/lib -Isrc/include \ - -c -o src/lib/gpt.o src/lib/gpt.c -src/lib/gpt.c: In function 'compare_gpts': -src/lib/gpt.c:401:24: warning: format '%lx' expects argument of type 'long - unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat] -src/lib/gpt.c:401:24: warning: format '%lx' expects argument of type 'long - unsigned int', but argument 4 has type 'long long unsigned int' [-Wformat] -src/lib/gpt.c:409:24: warning: format '%lx' expects argument of type 'long - unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat] -src/lib/gpt.c:409:24: warning: format '%lx' expects argument of type 'long - unsigned int', but argument 4 has type 'long long unsigned int' [-Wformat] -src/lib/gpt.c:417:24: warning: format '%lx' expects argument of type 'long - unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat] -src/lib/gpt.c:417:24: warning: format '%lx' expects argument of type 'long - unsigned int', but argument 4 has type 'long long unsigned int' [-Wformat] -src/lib/gpt.c:425:24: warning: format '%lx' expects argument of type 'long - unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat] -src/lib/gpt.c:425:24: warning: format '%lx' expects argument of type 'long - unsigned int', but argument 4 has type 'long long unsigned int' [-Wformat] -src/lib/gpt.c:462:10: warning: format '%lx' expects argument of type 'long - unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat] -src/lib/gpt.c:470:10: warning: format '%lx' expects argument of type 'long - unsigned int', but argument 3 has type 'long long unsigned int' [-Wformat] - -Signed-off-by: Raymund Will ---- - src/lib/disk.c | 10 +++++++++- - src/lib/efi.c | 4 +++- - src/lib/gpt.c | 9 +++++++++ - 3 files changed, 21 insertions(+), 2 deletions(-) - ---- a/src/lib/disk.c -+++ b/src/lib/disk.c -@@ -211,6 +211,7 @@ disk_get_ide_pci(int fd, - read_count = read(procfd, infoline, sizeof(infoline)-1); - close(procfd); - -+ infoline[(read_count < 0) ? 0 : read_count] = 0; - num_scanned = sscanf(infoline, - "pci bus %x device %x vid %*x did %*x channel %*x", - &b, &d); -@@ -375,7 +376,10 @@ msdos_disk_get_partition_info (int fd, l - - /* Write it to the disk */ - lseek(fd, 0, SEEK_SET); -- write(fd, mbr, sizeof(*mbr)); -+ rc = write(fd, mbr, sizeof(*mbr)); -+ if (rc == -1) { -+ perror("write unique MBR signature"); -+ } - - } - *(uint32_t *)signature = mbr->unique_mbr_signature; -@@ -478,6 +482,10 @@ disk_get_partition_info (int fd, - memset(mbr_sector, '\0', mbr_size); - - offset = lseek(fd, 0, SEEK_SET); -+ if (offset) { -+ rc=1; -+ goto error_free_mbr; -+ } - this_bytes_read = read(fd, mbr_sector, mbr_size); - if (this_bytes_read < sizeof(*mbr)) { - rc=1; ---- a/src/lib/efi.c -+++ b/src/lib/efi.c -@@ -316,6 +316,8 @@ is_parent_bridge(struct pci_dev *p, unsi - primary=pci_read_byte(p, PCI_PRIMARY_BUS); - secondary=pci_read_byte(p, PCI_SECONDARY_BUS); - -+ if (primary == 0xFF) -+ /* return NULL*/; /* don't care!? */ - - if (secondary != target_bus) - return NULL; -@@ -416,7 +418,7 @@ make_scsi_device_path(void *dest, uint16 - - static uint16_t - make_harddrive_device_path(void *dest, uint32_t num, uint64_t start, uint64_t size, -- uint8_t *signature, -+ char *signature, - uint8_t mbr_type, uint8_t signature_type) - { - HARDDRIVE_DEVICE_PATH p; ---- a/src/lib/gpt.c -+++ b/src/lib/gpt.c -@@ -32,7 +32,16 @@ - #include - #include - #include -+#if 0 -+/* don't use kernel headers! */ - #include -+#else -+#include -+#define __le16_to_cpu le16toh -+#define __le32_to_cpu le32toh -+#define __le64_to_cpu le64toh -+#define __cpu_to_le32 htole32 -+#endif - #include "crc32.h" - #include "disk.h" - #include "gpt.h" diff --git a/efibootmgr-0.6.0-set_boot_order.diff b/efibootmgr-0.6.0-set_boot_order.diff deleted file mode 100644 index 4e7e9cd..0000000 --- a/efibootmgr-0.6.0-set_boot_order.diff +++ /dev/null @@ -1,60 +0,0 @@ -From: Raymund Will -Subject: Fix '--bootorder' handling. -References: bnc#810899 - -Elisa Mitchell wrote: -> If efibootmgr -o is called with a boot order number that does not exist -> in the list you get when you execute efibootmgr, it is supposed to test -> for an invalid DataSize parameter and exit. In fact, the test conducted -> will never fail, even on invalid data, and the command will always take -> the path to make the firmware call, passing FW an invalid DataSize value, -> which can lead to panics, hangs, uninterruptible command hangs. - -Even if not every firmware panics over such an "invalid DataSize value", -it's still a bug, which should be addressed. - -Reported-by: Elisa Mitchell -Signed-off-by: Raymund Will ---- - src/efibootmgr/efibootmgr.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - ---- a/src/efibootmgr/efibootmgr.c -+++ b/src/efibootmgr/efibootmgr.c -@@ -612,10 +612,10 @@ is_current_boot_entry(int b) - } - - --static int -+static unsigned long - parse_boot_order(char *buffer, uint16_t *order, int length) - { -- int i; -+ unsigned long i; - int num, rc; - - for (i=0; i -Subject: Don't let '--write-signature' overwrite unique signatures. -References: bnc# - -Using '--write-signature' on an MBR-partitioned disk always overwrites -the previous signature, even if it was already unique. -While not using GPT is against the spec, it still works most of the time. -The issue is, that excessively writing new entries to NVRAM (and incidentally -breaking all old references to the partition in question) was found to -bring trouble to certain systems. - -Signed-off-by: Raymund Will ---- - src/lib/disk.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/src/lib/disk.c -+++ b/src/lib/disk.c -@@ -353,7 +353,7 @@ msdos_disk_get_partition_info (int fd, l - printf("******************************************************\n\n"); - - } -- else if (opts.write_signature) { -+ else if (!mbr->unique_mbr_signature && opts.write_signature) { - - /* MBR Signatures must be unique for the - EFI Boot Manager diff --git a/efibootmgr-0.6.0.tar.gz b/efibootmgr-0.6.0.tar.gz deleted file mode 100644 index e8ca2da..0000000 --- a/efibootmgr-0.6.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1c9b0852df7932c410865e296a38fe66e39a26e10c9c1a7ff34fca87f3e25f53 -size 64995 diff --git a/efibootmgr.changes b/efibootmgr.changes index f5d5a3d..7b4fcfa 100644 --- a/efibootmgr.changes +++ b/efibootmgr.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Wed Oct 29 03:51:49 UTC 2014 - glin@suse.com + +- Update version number to 0.11.0 +- Rebase patches + (efibootmgr-0.11.0-derhat.diff, + efibootmgr-0.11.0-check-boot-order.diff) +- Drop efibootmgr-0.6.0-set_boot_order.diff since the data size of + the variable is handled properly now +- Drop efibootmgr-0.6.0-fail-visibly.diff since err() and warn() + are introduced to show more meaningful messages +- Drop upstreamed patch + (efibootmgr-0.6.0-gcc-Wall.diff, + efibootmgr-0.6.0-write-unique-id-once.diff) + ------------------------------------------------------------------- Tue Sep 9 13:24:25 UTC 2014 - schwab@suse.de diff --git a/efibootmgr.spec b/efibootmgr.spec index ac7da80..6b73aaf 100644 --- a/efibootmgr.spec +++ b/efibootmgr.spec @@ -20,18 +20,15 @@ Name: efibootmgr Summary: EFI Boot Manager License: GPL-2.0+ Group: System/Boot -Version: 0.6.0 +Version: 0.11.0 Release: 0 Url: http://linux.dell.com/efibootmgr/ Source: http://linux.dell.com/%{name}/%{name}-%{version}/%{name}-%{version}.tar.gz -Patch0: %{name}-0.6.0-gcc-Wall.diff -Patch1: %{name}-0.6.0-derhat.diff -Patch2: %{name}-0.6.0-set_boot_order.diff -Patch3: %{name}-0.6.0-fail-visibly.diff -Patch4: %{name}-0.6.0-write-unique-id-once.diff -Patch5: %{name}-0.6.0-check-boot-order.diff +Patch1: %{name}-0.11.0-derhat.diff +Patch2: %{name}-0.11.0-check-boot-order.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: efivar-devel BuildRequires: pciutils-devel BuildRequires: zlib-devel ExclusiveArch: ia64 x86_64 aarch64 @@ -44,12 +41,8 @@ information about the EFI can be found at %prep %setup -q -%patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 %build LOADER="grub.efi" # default loader