SHA256
1
0
forked from pool/efibootmgr

Accepting request 1069049 from home:gary_lin:branches:Base:System

- Update to v18

OBS-URL: https://build.opensuse.org/request/show/1069049
OBS-URL: https://build.opensuse.org/package/show/Base:System/efibootmgr?expand=0&rev=50
This commit is contained in:
Marcus Meissner 2023-03-13 13:56:29 +00:00 committed by Git OBS Bridge
parent e8d262ee50
commit c249f986aa
5 changed files with 73 additions and 58 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:22a95ebe0d5c9fb2915b3a100450f8f37484d1dbb8b296f55b343cc84f10397d
size 41643

3
efibootmgr-18.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2b195f912aa353f0d11f21f207684c91460fbc37f9a4f2673e63e5e32d108b10
size 40439

View File

@ -13,10 +13,11 @@ This does unfortunately require an API-change of efivar!
Signed-off-by: Raymund Will <rw@suse.com> Signed-off-by: Raymund Will <rw@suse.com>
--- ---
diff -ru old/src/efibootmgr.c new/src/efibootmgr.c Index: efibootmgr-18/src/efibootmgr.c
--- old/src/efibootmgr.c 2018-06-10 22:12:10.000000000 +0200 ===================================================================
+++ new/src/efibootmgr.c 2021-08-03 11:57:25.435196489 +0200 --- efibootmgr-18.orig/src/efibootmgr.c
@@ -617,6 +617,146 @@ +++ efibootmgr-18/src/efibootmgr.c
@@ -664,6 +664,146 @@ delete_label(const char *prefix, const u
return 0; return 0;
} }
@ -40,7 +41,7 @@ diff -ru old/src/efibootmgr.c new/src/efibootmgr.c
+ pathlen = efi_loadopt_pathlen(load_option, + pathlen = efi_loadopt_pathlen(load_option,
+ entry->data_size); + entry->data_size);
+ path = efi_loadopt_path(load_option, entry->data_size); + path = efi_loadopt_path(load_option, entry->data_size);
+ rc = efidp_format_device_path(text_path, 1024, + rc = efidp_format_device_path((unsigned char *)text_path, 1024,
+ path, pathlen); + path, pathlen);
+ +
+ if (rc < 0 || rc > 1024) + if (rc < 0 || rc > 1024)
@ -163,26 +164,26 @@ diff -ru old/src/efibootmgr.c new/src/efibootmgr.c
static void static void
set_var_nums(const char *prefix, list_t *list) set_var_nums(const char *prefix, list_t *list)
{ {
@@ -1236,7 +1376,9 @@ @@ -1397,7 +1537,9 @@ usage()
printf("\t-a | --active sets bootnum active\n"); printf("\t-a | --active Set bootnum active.\n");
printf("\t-A | --inactive sets bootnum inactive\n"); printf("\t-A | --inactive Set bootnum inactive.\n");
printf("\t-b | --bootnum XXXX modify BootXXXX (hex)\n"); printf("\t-b | --bootnum XXXX Modify BootXXXX (hex).\n");
- printf("\t-B | --delete-bootnum delete bootnum\n"); - printf("\t-B | --delete-bootnum Delete bootnum.\n");
+ printf("\t-B | --delete-bootnum delete bootnum (specified with -b)\n"); + printf("\t-B | --delete-bootnum delete bootnum (specified with -b)\n");
+ printf("\t --delete delete entry by bootnum (-b), by UUID (-P)\n"); + printf("\t --delete delete entry by bootnum (-b), by UUID (-P)\n");
+ printf("\t or by disk+partition[+file] (-d -p -l)\n"); + printf("\t or by disk+partition[+file] (-d -p -l)\n");
printf("\t-c | --create create new variable bootnum and add to bootorder\n"); printf("\t-c | --create Create new variable bootnum and add to bootorder at index (-I).\n");
printf("\t-C | --create-only create new variable bootnum and do not add to bootorder\n"); printf("\t-C | --create-only Create new variable bootnum and do not add to bootorder.\n");
printf("\t-D | --remove-dups remove duplicate values from BootOrder\n"); printf("\t-d | --disk disk Disk containing boot loader (defaults to /dev/sda).\n");
@@ -1263,6 +1405,7 @@ @@ -1420,6 +1562,7 @@ usage()
printf("\t-o | --bootorder XXXX,YYYY,ZZZZ,... explicitly set BootOrder (hex)\n"); printf("\t-o | --bootorder XXXX,YYYY,ZZZZ,... Explicitly set BootOrder (hex).\n");
printf("\t-O | --delete-bootorder delete BootOrder\n"); printf("\t-O | --delete-bootorder Delete BootOrder.\n");
printf("\t-p | --part part partition containing loader (defaults to 1 on partitioned devices)\n"); printf("\t-p | --part part Partition containing loader (defaults to 1 on partitioned devices).\n");
+ printf("\t-P | --part-uuid UUID select all variables for given partition UUID\n"); + printf("\t-P | --part-uuid UUID select all variables for given partition UUID\n");
printf("\t-q | --quiet be quiet\n"); printf("\t-q | --quiet Be quiet.\n");
printf("\t-t | --timeout seconds set boot manager timeout waiting for user input.\n"); printf("\t-r | --driver Operate on Driver variables, not Boot Variables.\n");
printf("\t-T | --delete-timeout delete Timeout.\n"); printf("\t-t | --timeout seconds Set boot manager timeout waiting for user input.\n");
@@ -1288,6 +1431,7 @@ @@ -1447,6 +1590,7 @@ set_default_opts()
opts.label = (unsigned char *)"Linux"; opts.label = (unsigned char *)"Linux";
opts.disk = "/dev/sda"; opts.disk = "/dev/sda";
opts.part = -1; opts.part = -1;
@ -190,24 +191,24 @@ diff -ru old/src/efibootmgr.c new/src/efibootmgr.c
} }
static void static void
@@ -1310,6 +1454,7 @@ @@ -1470,6 +1614,7 @@ parse_opts(int argc, char **argv)
{"delete-bootnum", no_argument, 0, 'B'}, {"delete-bootnum", no_argument, 0, 'B'},
{"create", no_argument, 0, 'c'}, {"create", no_argument, 0, 'c'},
{"create-only", no_argument, 0, 'C'}, {"create-only", no_argument, 0, 'C'},
+ {"delete", no_argument, 0, 2}, + {"delete", no_argument, 0, 2},
{"remove-dups", no_argument, 0, 'D'},
{"disk", required_argument, 0, 'd'}, {"disk", required_argument, 0, 'd'},
{"iface", required_argument, 0, 'i'}, {"remove-dups", no_argument, 0, 'D'},
@@ -1342,7 +1487,7 @@ {"edd", required_argument, 0, 'e'},
@@ -1508,7 +1653,7 @@ parse_opts(int argc, char **argv)
}; };
c = getopt_long (argc, argv, c = getopt_long(argc, argv,
- "AaBb:cCDd:e:E:gH:i:l:L:M:m:n:No:Op:qt:TuU:v::Vw" - "aAb:BcCd:De:E:fFgi:kl:L:m:M:n:No:Op:qrt:Tuv::Vwy@:h",
+ "AaBb:cCDd:e:E:gH:i:l:L:M:m:n:No:Op:P:qt:TuU:v::Vw" + "aAb:BcCd:De:E:fFgi:kl:L:m:M:n:No:Op:P:qrt:Tuv::Vwy@:h",
"@:hry", long_options, &option_index);
long_options, &option_index);
if (c == -1) if (c == -1)
@@ -1390,11 +1535,16 @@ break;
@@ -1561,11 +1706,16 @@ parse_opts(int argc, char **argv)
opts.create = 1; opts.create = 1;
opts.no_order = 1; opts.no_order = 1;
break; break;
@ -224,7 +225,7 @@ diff -ru old/src/efibootmgr.c new/src/efibootmgr.c
break; break;
case 'e': case 'e':
rc = sscanf(optarg, "%d", &snum); rc = sscanf(optarg, "%d", &snum);
@@ -1434,6 +1584,9 @@ @@ -1627,6 +1777,9 @@ parse_opts(int argc, char **argv)
break; break;
case 'l': case 'l':
opts.loader = optarg; opts.loader = optarg;
@ -234,7 +235,7 @@ diff -ru old/src/efibootmgr.c new/src/efibootmgr.c
break; break;
case 'L': case 'L':
opts.label = (unsigned char *)optarg; opts.label = (unsigned char *)optarg;
@@ -1498,6 +1651,17 @@ @@ -1707,6 +1860,17 @@ parse_opts(int argc, char **argv)
else else
errorx(37, "invalid numeric value %s\n", errorx(37, "invalid numeric value %s\n",
optarg); optarg);
@ -252,11 +253,11 @@ diff -ru old/src/efibootmgr.c new/src/efibootmgr.c
break; break;
case 'q': case 'q':
opts.quiet = 1; opts.quiet = 1;
@@ -1622,9 +1786,24 @@ @@ -1843,9 +2007,24 @@ main(int argc, char **argv)
set_var_nums(prefices[mode], &entry_list); set_var_nums(prefices[mode], &entry_list);
if (opts.delete) { if (opts.delete) {
- if (opts.num == -1) - if (opts.num == -1 && opts.explicit_label == 0) {
+ if (opts.part_uuid) { + if (opts.part_uuid) {
+ ret = delete_by_uuid(prefices[mode], opts.part_uuid, + ret = delete_by_uuid(prefices[mode], opts.part_uuid,
+ (opts.delete & 8) ? opts.loader : NULL); + (opts.delete & 8) ? opts.loader : NULL);
@ -272,27 +273,26 @@ diff -ru old/src/efibootmgr.c new/src/efibootmgr.c
+ } else if (opts.delete > 1) + } else if (opts.delete > 1)
+ errorx(3, "Disk and partition must be specified " + errorx(3, "Disk and partition must be specified "
+ "(see the --delete option)."); + "(see the --delete option).");
+ else if (opts.num == -1) + else if (opts.num == -1 && opts.explicit_label == 0) {
errorx(3, "You must specify an entry to delete " errorx(3,
- "(see the -b option)."); - "You must specify an entry to delete (see the -b option or -L option).");
+ "(e.g. with the -b option)."); + "You must specify an entry to delete (e.g. with the -b option or -L option).");
else { } else {
ret = delete_var(prefices[mode], opts.num); if (opts.num != -1) {
if (ret < 0) ret = delete_var(prefices[mode], opts.num);
Only in new/src: efibootmgr.c.orig Index: efibootmgr-18/src/include/efibootmgr.h
Only in new/src: efibootmgr.c.rej ===================================================================
diff -ru old/src/include/efibootmgr.h new/src/include/efibootmgr.h --- efibootmgr-18.orig/src/include/efibootmgr.h
--- old/src/include/efibootmgr.h 2018-06-10 22:12:10.000000000 +0200 +++ efibootmgr-18/src/include/efibootmgr.h
+++ new/src/include/efibootmgr.h 2021-08-03 11:56:14.638896535 +0200 @@ -66,6 +66,7 @@ typedef struct {
@@ -60,6 +60,7 @@
int keep_old_entries; int keep_old_entries;
char *testfile; char *testfile;
char *extra_opts_file; char *extra_opts_file;
+ char *part_uuid; + char *part_uuid;
uint32_t part; uint32_t part;
int edd_version; int abbreviate_path;
uint32_t edd10_devicenum; uint32_t edd10_devicenum;
@@ -70,7 +71,7 @@ @@ -77,7 +78,7 @@ typedef struct {
int below4g; int below4g;
int above4g; int above4g;
int deduplicate; int deduplicate;

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue Dec 20 06:17:48 UTC 2022 - Gary Ching-Pang Lin <glin@suse.com>
- Update to v18
* fixed the simple run example
* Restore activation error message in efibootmgr
* remove-dupes: update error message
* Fix typo in manual page
* README: Note efivarfs as the current required kernel module
* Fix possible read out of bounds in ucs2_to_utf8
* Add code of conduct
* Fix help messages
* Add option for insertion location of new entries
- Rebase efibootmgr-delete-multiple.diff
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Aug 3 10:03:52 UTC 2021 - Paolo Stivanin <info@paolostivanin.com> Tue Aug 3 10:03:52 UTC 2021 - Paolo Stivanin <info@paolostivanin.com>

View File

@ -1,7 +1,7 @@
# #
# spec file for package efibootmgr # spec file for package efibootmgr
# #
# Copyright (c) 2021 SUSE LLC # Copyright (c) 2022 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -17,13 +17,13 @@
Name: efibootmgr Name: efibootmgr
Version: 17 Version: 18
Release: 0 Release: 0
Summary: EFI Boot Manager Summary: EFI Boot Manager
License: GPL-2.0-or-later License: GPL-2.0-or-later
Group: System/Boot Group: System/Boot
URL: https://github.com/rhinstaller/efibootmgr URL: https://github.com/rhinstaller/efibootmgr
Source: https://github.com/rhboot/efibootmgr/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source: https://github.com/rhboot/efibootmgr/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.bz2
Patch0: %{name}-delete-multiple.diff Patch0: %{name}-delete-multiple.diff
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: pkgconfig(efiboot) >= 31 BuildRequires: pkgconfig(efiboot) >= 31