SHA256
1
0
forked from pool/efibootmgr

All changes to patches are effectively white-space/offset, with the

exception of 'efibootmgr-0.6.0-write-unique-id-once.diff', which
wasn't "released" yet.

OBS-URL: https://build.opensuse.org/package/show/Base:System/efibootmgr?expand=0&rev=12
This commit is contained in:
Raymund Will 2014-01-23 21:54:12 +00:00 committed by Git OBS Bridge
parent 005b0540c9
commit b17df973dc
7 changed files with 135 additions and 23 deletions

View File

@ -1,3 +1,17 @@
From: Raymund Will <rw@suse.com>
Subject: Make default '--loader' build-time configurable.
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'
and used as default without '--loader'.
Simply use
make OS_VENDOR=redhat EFI_LOADER=grub.efi
to get the previous value. :)
Signed-off-by: Raymund Will <rw@suse.com>
---
Makefile | 4 ++++
src/efibootmgr/efibootmgr.c | 12 ++++++++----
@ -28,7 +42,7 @@
/*
- efibootmgr.c - Manipulates EFI variables as exported in /proc/efi/vars
+ efibootmgr.c - Manipulates EFI variables as exported in
+ /sys/firmware/efi/vars (previously as /proc/efi/vars)
+ /sys/firmware/efi/vars (previously was /proc/efi/vars)
Copyright (C) 2001-2004 Dell, Inc. <Matt_Domsch@dell.com>
@ -46,12 +60,12 @@
#endif
+#ifndef DEFAULT_LOADER
+#define DEFAULT_LOADER "\\EFI\\redhat\\grub.efi"
+#define DEFAULT_LOADER "unknown (fix Makefile!)"
+#endif
typedef struct _var_entry {
struct dirent *name;
@@ -787,7 +791,7 @@ usage()
@@ -786,7 +790,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");
@ -60,7 +74,7 @@
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");
@@ -815,7 +819,7 @@ set_default_opts()
@@ -814,7 +818,7 @@ set_default_opts()
opts.active = -1; /* Don't set it */
opts.timeout = -1; /* Don't set it */
opts.edd10_devicenum = 0x80;

View File

@ -1,10 +1,18 @@
From: Raymund Will <rw@suse.com>
Subject: Print EFI status on failed '--create'.
References: bnc#811767
Otherwise it's probably noticed only much too late.
Reported-by: Frederic Crozat <fcrozat@suse.com>
Signed-off-by: Raymund Will <rw@suse.com>
---
src/efibootmgr/efibootmgr.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/src/efibootmgr/efibootmgr.c
+++ b/src/efibootmgr/efibootmgr.c
@@ -275,6 +275,7 @@ make_boot_var(list_t *boot_list)
@@ -279,6 +279,7 @@ make_boot_var(list_t *boot_list)
status = create_variable(&boot->var_data);
if (status != EFI_SUCCESS) {
@ -12,7 +20,7 @@
free(boot);
return NULL;
}
@@ -1133,6 +1134,9 @@ main(int argc, char **argv)
@@ -1137,6 +1138,9 @@ main(int argc, char **argv)
}
show_boot_order();
show_boot_vars();

View File

@ -1,3 +1,49 @@
From: Raymund Will <rw@suse.com>
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 <rw@suse.com>
---
src/lib/disk.c | 10 +++++++++-
src/lib/efi.c | 4 +++-

View File

@ -1,10 +1,27 @@
From: Raymund Will <rw@suse.com>
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 <lisa.mitchell@hp.com>
Signed-off-by: Raymund Will <rw@suse.com>
---
src/efibootmgr/efibootmgr.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/src/efibootmgr/efibootmgr.c
+++ b/src/efibootmgr/efibootmgr.c
@@ -608,10 +608,10 @@ is_current_boot_entry(int b)
@@ -612,10 +612,10 @@ is_current_boot_entry(int b)
}
@ -17,7 +34,7 @@
int num, rc;
for (i=0; i<length && *buffer; i++) {
@@ -619,12 +619,12 @@ parse_boot_order(char *buffer, uint16_t
@@ -623,12 +623,12 @@ parse_boot_order(char *buffer, uint16_t
if (rc == 1) order[i] = num & 0xFFFF;
else {
fprintf(stderr,"\nInvalid hex characters in boot order: %s\n\n",buffer);
@ -32,7 +49,7 @@
}
/* Advance to the comma */
@@ -647,7 +647,7 @@ set_boot_order()
@@ -651,7 +651,7 @@ set_boot_order()
fill_var(&boot_order, "BootOrder");
boot_order.DataSize = parse_boot_order(opts.bootorder, n, 1024/sizeof(uint16_t)) * sizeof(uint16_t);

View File

@ -1,5 +1,15 @@
Write "unique_mbr_signature" only once to MBR!
From: Raymund Will <rw@suse.com>
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 <rw@suse.com>
---
src/lib/disk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@ -11,7 +21,7 @@ Write "unique_mbr_signature" only once to MBR!
}
- else if (opts.write_signature) {
+ else if (!mbr->unique_mbr_signature) {
+ else if (!mbr->unique_mbr_signature && opts.write_signature) {
/* MBR Signatures must be unique for the
EFI Boot Manager

View File

@ -1,10 +1,25 @@
-------------------------------------------------------------------
Thu Jan 23 21:16:04 UTC 2014 - rw@suse.de
- Add headers to refreshed patches and properly reflect them.
-------------------------------------------------------------------
Thu Dec 19 15:59:44 UTC 2013 - rw@suse.de
- Update version number to 0.6.0,
- Integrate SLE11 patches. [bnc#830784]
- Update version number to 0.6.0.
- Stop '--write-signature' overwriting unique signature.
(efibootmgr-0.6.0-fail-visibly.diff,
efibootmgr-0.6.0-set_boot_order.diff)
- Fix gcc warnings.
(efibootmgr-0.6.0-gcc-Wall.diff)
- Make default '--loader' build-time configurable.
(efibootmgr-0.6.0-derhat.diff)
- Don't let '--write-signature' overwrite unique signatures.
(efibootmgr-0.6.0-write-unique-id-once.diff)
- Drop obsolete patches
(efibootmgr-0.5.4.diff,
efibootmgr-0.5.4-catchup.diff,
efibootmgr-0.5.4-sector-size.diff)
-------------------------------------------------------------------
Wed Mar 27 21:05:20 UTC 2013 - rw@suse.com
@ -20,11 +35,13 @@ Wed Mar 27 16:00:41 UTC 2013 - rw@suse.com
-------------------------------------------------------------------
Tue Feb 12 16:38:47 UTC 2013 - rw@suse.com
- Apply critical upstream fixes
o for memory leaking variable creation. [bnc#746324]
o to improve spec conformance by removing device path padding.
o to work around broken Apple firmware.
- efibootmgr-0.5.4-catchup.diff: Apply critical upstream fixes
o for memory leaking variable creation. [bnc#746324]
o to improve spec conformance by removing device path padding.
o to work around broken Apple firmware.
- efibootmgr-0.5.4-sector-size.diff:
Allow hard disk sector sizes not equal to 512. [bnc#711830]
-------------------------------------------------------------------
Tue Jun 12 16:51:40 UTC 2012 - mgorse@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package efibootmgr
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -24,10 +24,10 @@ Version: 0.6.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-derhat.diff
Patch1: %{name}-0.6.0-set_boot_order.diff
Patch2: %{name}-0.6.0-fail-visibly.diff
Patch3: %{name}-0.6.0-gcc-Wall.diff
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
BuildRoot: %{_tmppath}/%{name}-%{version}-build