Imported Debian patch 0.5.1-1 debian/0.5.1-1
authorBdale Garbee <bdale@gag.com>
Thu, 10 Mar 2005 18:27:00 +0000 (11:27 -0700)
committerBdale Garbee <bdale@gag.com>
Tue, 20 May 2008 05:06:20 +0000 (23:06 -0600)
AUTHORS
Makefile
debian/changelog
debian/copyright
doc/ChangeLog
efibootmgr.spec
src/efibootmgr/efibootmgr.c
src/lib/efi.c

diff --git a/AUTHORS b/AUTHORS
index bd8127de5416fe3f412433856f4ab68764627f5a..40dd42500e390a057dcbdfcd9f9bd145387f75c4 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -16,3 +16,7 @@ dann frazier <dannf@debian.org>
 Joshua Giles <Joshua_Giles@dell.com>
 - walk the PCI path inserting parent bridge device path components for
   network boot and EDD30 entries.
+
+Alex Williamson <alex.williamson@hp.com>
+- Patch to efi.c and efibootmgr.c for handling BootXXXX values
+  using uppercase hex rather than lowercase, per EFI 1.10 spec.
index 854277e8389cf1e083e63f0dc99f3c9a6fc07bc9..23bc9d893b09e63c5145656733045584b0c4bc2f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,9 @@
   default: all
 
-  RELEASE_DATE := "26-Aug-2004"
+  RELEASE_DATE := "08-Mar-2005"
   RELEASE_MAJOR := 0
   RELEASE_MINOR := 5
-  RELEASE_SUBLEVEL := 0
+  RELEASE_SUBLEVEL := 1
   RELEASE_EXTRALEVEL :=
   RELEASE_NAME := efibootmgr
   RELEASE_STRING := $(RELEASE_NAME)-$(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_SUBLEVEL)$(RELEASE_EXTRALEVEL)
index a7025e5539bd4bdc022bde4613c0ce91c810128e..1ceec3d0beed15a1304421a2efb11ca323b5a125 100644 (file)
@@ -1,3 +1,9 @@
+efibootmgr (0.5.1-1) unstable; urgency=low
+
+  * new upstream version. 
+
+ -- Bdale Garbee <bdale@gag.com>  Thu, 10 Mar 2005 11:27:00 -0700
+
 efibootmgr (0.5.0-1) unstable; urgency=low
 
   * new upstream version.  No code changes from 0.5.0-test4, which I called
index 384460059eae1ce233619e54be5baccbf3191173..c074f19a2bcc1fff5282a6d233880d69216a427f 100644 (file)
@@ -7,7 +7,7 @@ Upstream Author: Matt Domsch <Matt_Domsch@Dell.com>
 
 Copyright:
 
-  Copyright (C) 2001-2003 Dell Computer Corporation <Matt_Domsch@dell.com>
+  Copyright (C) 2001-2005 Dell Computer Corporation <Matt_Domsch@dell.com>
 
   efibootmgr is distributed under the GPL.
 
index 906bc6f3d7d8cad49539f386977609c6d94e9199..2780443abbc4e6b1fa24382636d93c2122f6e8a1 100644 (file)
@@ -1,3 +1,10 @@
+* Tue Mar 08 2005 Matt Domsch <Matt_Domsch@dell.com>
+- applied patch from Alex Williamson for handling BootXXXX values
+  using uppercase hex rather than lowercase, per EFI 1.10 spec.
+- this also allows the full 65k boot entries, rather than requiring all
+  entries to begin with a zero.
+- v0.5.1 released
+
 * Thu Aug 26 2004 Matt Domsch <Matt_Domsch@dell.com>
 - v0.5.0-test4 released as v0.5.0 with no code changes
 
index 45627e9169c25f4bd872dfaf14b7474e28101715..5a8b832ee80108b9428bc1b0cfec6b70d3c3e999 100644 (file)
@@ -1,14 +1,15 @@
 Summary: EFI Boot Manager
 Name: efibootmgr
-Version: 0.4.1
+Version: 0.5.0
 Release: 0
 Group: System Environment/Base
 Copyright: GPL
-Vendor: Dell Computer Corporation www.dell.com
+Vendor: Dell linux.dell.com
 Packager: Matt Domsch <Matt_Domsch@dell.com>
 
 
-Source0: http://domsch.com/linux/ia64/efibootmgr/efibootmgr-%{version}.tar.gz
+Source0: http://linux.dell.com/efibootmgr/permalink/efibootmgr-%{version}.tar.gz
+Source1: http://linux.dell.com/efibootmgr/permalink/efibootmgr-%{version}.tar.gz.sign
 
 %description
 efibootmgr displays and allows the user to edit the Intel Extensible
@@ -32,5 +33,8 @@ install --group=root --owner=root --mode 444 src/man/man8/efibootmgr.8 $RPM_BUIL
 
     
 %changelog
+* Thu Aug 24 2004 Matt Domsch <Matt_Domsch@dell.com>
+- new home linux.dell.com
+
 * Fri May 18 2001 Matt Domsch <Matt_Domsch@dell.com>
 - See doc/ChangeLog
index 1aa3595e38253686e430c4f6c7ac86df1679b033..5058f922baaad4c1dab4e5e1873ed62e12c6936e 100644 (file)
@@ -32,6 +32,7 @@
 
 #define _GNU_SOURCE
 
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -215,8 +216,8 @@ warn_duplicate_name(list_t *boot_list)
                        boot->var_data.Data;
                if (!efichar_char_strcmp(opts.label,
                                         load_option->description)) {
-                       fprintf(stderr, "** Warning ** : Boot%04x has same label %s\n",
-                              boot->num,
+                       fprintf(stderr, "** Warning ** : %.8s has same label %s\n",
+                              boot->name->d_name,
                               opts.label);
                }
        }
@@ -228,9 +229,21 @@ make_boot_var(list_t *boot_list)
 {
        var_entry_t *boot;
        int free_number;
+       list_t *pos;
 
-       if (opts.bootnum == -1) free_number = find_free_boot_var(boot_list);
-       else                    free_number = opts.bootnum;
+       if (opts.bootnum == -1)
+               free_number = find_free_boot_var(boot_list);
+       else {
+               list_for_each(pos, boot_list) {
+                       boot = list_entry(pos, var_entry_t, list);
+                       if (boot->num == opts.bootnum) {
+                               fprintf(stderr, "** Warning ** : bootnum %04X "
+                                       "already exists\n", opts.bootnum);
+                               return NULL;
+                       }
+               }
+               free_number = opts.bootnum;
+       }
 
        if (free_number == -1) return NULL;
 
@@ -398,13 +411,20 @@ delete_boot_var(uint16_t num)
        list_t *pos, *n;
        var_entry_t *boot;
 
-       snprintf(name, sizeof(name), "Boot%04x", num);
+       snprintf(name, sizeof(name), "Boot%04X", num);
        memset(&var, 0, sizeof(var));
        fill_var(&var, name);
        status = delete_variable(&var);
 
-       if (status) return status;
+       /* For backwards compatibility, try to delete abcdef entries as well */
+       if (status) {
+               snprintf(name, sizeof(name), "Boot%04x", num);
+               memset(&var, 0, sizeof(var));
+               fill_var(&var, name);
+               status = delete_variable(&var);
+       }
 
+       if (status) return status;
        list_for_each_safe(pos, n, &boot_entry_list) {
                boot = list_entry(pos, var_entry_t, list);
                if (boot->num == num) {
@@ -424,11 +444,27 @@ set_var_nums(const char *pattern, list_t *list)
        list_t *pos;
        var_entry_t *var;
        int num=0, rc;
+       char *name;
+       int warn=0;
 
        list_for_each(pos, list) {
                var = list_entry(pos, var_entry_t, list);
                rc = sscanf(var->name->d_name, pattern, &num);
-               if (rc == 1) var->num = num;
+               if (rc == 1) {
+                       var->num = num;
+                       name = var->name->d_name; /* shorter name */
+                       if ((isalpha(name[4]) && islower(name[4])) ||
+                           (isalpha(name[5]) && islower(name[5])) ||
+                           (isalpha(name[6]) && islower(name[6])) ||
+                           (isalpha(name[7]) && islower(name[7]))) {
+                               fprintf(stderr, "** Warning ** : %.8s is not "
+                                       "EFI 1.10 compliant (lowercase hex in name)\n", name);
+                               warn++;
+                       }
+               }
+       }
+       if (warn) {
+               fprintf(stderr, "** Warning ** : please recreate these using efibootmgr to remove this warning.\n");
        }
 }
 
@@ -528,7 +564,7 @@ unparse_boot_order(uint16_t *order, int length)
        int i;
        printf("BootOrder: ");
        for (i=0; i<length; i++) {
-               printf("%04x", order[i]);
+               printf("%04X", order[i]);
                if (i < (length-1))
                        printf(",");
        }
@@ -586,7 +622,11 @@ show_boot_vars()
                                load_option->description, sizeof(description));
                memset(text_path, 0, sizeof(text_path));
                path = load_option_path(load_option);
-               printf("Boot%04x", boot->num);
+               if (boot->name)
+                       printf("%.8s", boot->name->d_name);
+               else
+                       printf("Boot%04X", boot->num);
+
                if (load_option->attributes & LOAD_OPTION_ACTIVE)
                        printf("* ");
                else    printf("  ");
@@ -790,7 +830,7 @@ parse_opts(int argc, char **argv)
                        opts.delete_boot = 1;
                        break;
                case 'b':
-                       rc = sscanf(optarg, "%x", &num);
+                       rc = sscanf(optarg, "%X", &num);
                        if (rc == 1) opts.bootnum = num;
                        break;
                case 'c':
@@ -920,7 +960,7 @@ main(int argc, char **argv)
        if (!opts.testfile) {
                num_boot_names = read_boot_var_names(&boot_names);
                read_vars(boot_names, num_boot_names, &boot_entry_list);
-               set_var_nums("Boot%04x-%*s", &boot_entry_list);
+               set_var_nums("Boot%04X-%*s", &boot_entry_list);
 
                if (opts.delete_boot) {
                        if (opts.bootnum == -1)
@@ -972,11 +1012,11 @@ main(int argc, char **argv)
                if (!opts.quiet) {
                        num = read_boot_u16("BootNext");
                        if (num != -1 ) {
-                               printf("BootNext: %04x\n", num);
+                               printf("BootNext: %04X\n", num);
                        }
                        num = read_boot_u16("BootCurrent");
                        if (num != -1) {
-                               printf("BootCurrent: %04x\n", num);
+                               printf("BootCurrent: %04X\n", num);
                        }
                        num = read_boot_u16("Timeout");
                        if (num != -1) {
index 26c144a347bd6fcab745051466d5d543b8502021..ac782c9b0edc4c3d5c7afc70f32579bfa04aea25 100644 (file)
@@ -20,8 +20,9 @@
 
 #define _FILE_OFFSET_BITS 64
 
-typedef unsigned long long u64;        /* hack to allow include of ethtool.h */
+typedef unsigned long long u64;       /* hack to allow include of ethtool.h */
 
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -173,9 +174,12 @@ create_or_edit_variable(efi_variable_t *var)
 static int
 select_boot_var_names(const struct dirent *d)
 {
-       int num, rc;
-       rc = sscanf(d->d_name, "Boot0%03x-%*s", &num);
-       return rc;
+       if (!strncmp(d->d_name, "Boot", 4) &&
+           isxdigit(d->d_name[4]) && isxdigit(d->d_name[5]) &&
+           isxdigit(d->d_name[6]) && isxdigit(d->d_name[7]) &&
+           d->d_name[8] == '-')
+               return 1;
+       return 0;
 }
 
 int
@@ -718,7 +722,7 @@ make_linux_efi_variable(efi_variable_t *var,
        memset(buffer,    0, sizeof(buffer));
 
        /* VariableName needs to be BootXXXX */
-       sprintf(buffer, "Boot%04x", free_number);
+       sprintf(buffer, "Boot%04X", free_number);
 
        efichar_from_char(var->VariableName, buffer, 1024);