Skip to content

Commit e22a7d7

Browse files
committed
Revert "Implement --uri option for use with --ifname"
This reverts commit 5ce076c. This commit uses functionality which is not present in efivar-39. See #204.
1 parent 9dc1f01 commit e22a7d7

File tree

4 files changed

+28
-34
lines changed

4 files changed

+28
-34
lines changed

efibootmgr.spec.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Group: System Environment/Base
66
License: GPLv2+
77
URL: https://github.com/rhboot/%{name}/
88
BuildRequires: git, popt-devel
9-
BuildRequires: efivar-libs >= 39-1, efivar-devel >= 39-1
9+
BuildRequires: efivar-libs >= 30-1, efivar-devel >= 30-1
1010
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXXXX)
1111
# EFI/UEFI don't exist on PPC
1212
ExclusiveArch: %{ix86} x86_64 aarch64 arm

src/efi.c

+22-25
Original file line numberDiff line numberDiff line change
@@ -174,40 +174,37 @@ make_linux_load_option(uint8_t **data, size_t *data_size,
174174
efidp dp = NULL;
175175

176176
if (opts.iface && opts.ip_version == EFIBOOTMGR_IPV4) {
177-
needed = efi_generate_ipv4_device_path_with_uri(
178-
NULL, 0, opts.iface,
179-
opts.local_ip_addr,
180-
opts.remote_ip_addr,
181-
opts.gateway_ip_addr,
182-
opts.ip_netmask,
183-
opts.ip_local_port,
184-
opts.ip_remote_port,
185-
opts.ip_protocol,
186-
opts.ip_addr_origin,
187-
opts.uri);
177+
needed = efi_generate_ipv4_device_path(NULL, 0, opts.iface,
178+
opts.local_ip_addr,
179+
opts.remote_ip_addr,
180+
opts.gateway_ip_addr,
181+
opts.ip_netmask,
182+
opts.ip_local_port,
183+
opts.ip_remote_port,
184+
opts.ip_protocol,
185+
opts.ip_addr_origin);
188186
if (needed < 0) {
189-
efi_error("efi_generate_ipv4_device_path_with_uri() = %zd (failed)",
187+
efi_error("efi_generate_ipv4_device_path() = %zd (failed)",
190188
needed);
191189
return -1;
192190
}
193191
if (data_size && *data_size) {
194192
dp = malloc(needed);
195193

196-
needed = efi_generate_ipv4_device_path_with_uri(
197-
(uint8_t *)dp, needed,
198-
opts.iface,
199-
opts.local_ip_addr,
200-
opts.remote_ip_addr,
201-
opts.gateway_ip_addr,
202-
opts.ip_netmask,
203-
opts.ip_local_port,
204-
opts.ip_remote_port,
205-
opts.ip_protocol,
206-
opts.ip_addr_origin,
207-
opts.uri);
194+
needed = efi_generate_ipv4_device_path(
195+
(uint8_t *)dp, needed,
196+
opts.iface,
197+
opts.local_ip_addr,
198+
opts.remote_ip_addr,
199+
opts.gateway_ip_addr,
200+
opts.ip_netmask,
201+
opts.ip_local_port,
202+
opts.ip_remote_port,
203+
opts.ip_protocol,
204+
opts.ip_addr_origin);
208205
if (needed < 0) {
209206
free(dp);
210-
efi_error("efi_generate_ipv4_device_path_with_uri() = %zd (failed)",
207+
efi_error("efi_generate_ipv4_device_path() = %zd (failed)",
211208
needed);
212209
return -1;
213210
}

src/efibootmgr.c

+5-7
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,7 @@ usage()
14001400
printf("\t-f | --reconnect Re-connect devices after driver is loaded.\n");
14011401
printf("\t-F | --no-reconnect Do not re-connect devices after driver is loaded.\n");
14021402
printf("\t-g | --gpt Force disk with invalid PMBR to be treated as GPT.\n");
1403-
printf("\t-i | --iface name Create a netboot entry for the named interface (IPv4+DHCP support only).\n");
1403+
printf("\t-i | --iface name Create a netboot entry for the named interface.\n");
14041404
printf("\t-I | --index number When creating an entry, insert it in bootorder at specified position (default: 0).\n");
14051405
printf("\t-j | --json Enable JSON output\n");
14061406
printf("\t --uri Uri Specify an Uri (for use with --iface option).\n");
@@ -1475,7 +1475,6 @@ parse_opts(int argc, char **argv)
14751475
{"iface", required_argument, 0, 'i'},
14761476
{"index", required_argument, 0, 'I'},
14771477
{"json", no_argument, 0, 'j'},
1478-
{"uri", required_argument, 0, 0},
14791478
{"keep", no_argument, 0, 'k'},
14801479
{"loader", required_argument, 0, 'l'},
14811480
{"label", required_argument, 0, 'L'},
@@ -1762,8 +1761,6 @@ parse_opts(int argc, char **argv)
17621761
opts.abbreviate_path != EFIBOOTMGR_PATH_ABBREV_FILE)
17631762
errx(41, "contradicting --full-dev-path/--file-dev-path/-e options");
17641763
opts.abbreviate_path = EFIBOOTMGR_PATH_ABBREV_FILE;
1765-
} else if (!strcmp(long_options[option_index].name, "uri")) {
1766-
opts.uri = optarg;
17671764
} else {
17681765
usage();
17691766
exit(1);
@@ -1806,9 +1803,6 @@ main(int argc, char **argv)
18061803

18071804
verbose = opts.verbose;
18081805

1809-
if (opts.uri && !opts.iface)
1810-
errx(25, "--uri is supported only with --iface option.");
1811-
18121806
if (opts.sysprep && opts.driver)
18131807
errx(25, "--sysprep and --driver may not be used together.");
18141808

@@ -1923,6 +1917,10 @@ main(int argc, char **argv)
19231917
}
19241918

19251919
if (opts.delete_bootnext) {
1920+
if (!is_current_entry(opts.delete_bootnext))
1921+
errorx(17, "Boot entry %04X does not exist",
1922+
opts.delete_bootnext);
1923+
19261924
ret = efi_del_variable(EFI_GLOBAL_GUID, "BootNext");
19271925
if (ret < 0)
19281926
error(10, "Could not delete BootNext");

src/include/efibootmgr.h

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ typedef struct {
6060
uint16_t ip_remote_port;
6161
uint16_t ip_protocol;
6262
uint8_t ip_addr_origin;
63-
char *uri;
6463

6564
char *loader;
6665
unsigned char *label;

0 commit comments

Comments
 (0)