[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 13/19] use fw_path prefix when fallback searching for grub con
From: |
Robbie Harwood |
Subject: |
[PATCH v4 13/19] use fw_path prefix when fallback searching for grub config |
Date: |
Mon, 9 Jan 2023 18:30:39 -0500 |
From: Mark Salter <msalter@redhat.com>
When PXE booting via UEFI firmware, grub was searching for grub.cfg in
the fw_path directory where the grub application was found. If that
didn't exist, a fallback search would look for config file names based
on MAC and IP address. However, the search would look in the prefix
directory which may not be the same fw_path. This patch changes that
behavior to use the fw_path directory for the fallback search. Only if
fw_path is NULL will the prefix directory be searched.
Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
---
grub-core/normal/main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
index a557ba5c9c..dfdfd56e06 100644
--- a/grub-core/normal/main.c
+++ b/grub-core/normal/main.c
@@ -322,7 +322,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__
((unused)),
char *config;
const char *prefix, *fw_path;
- fw_path = grub_env_get ("fw_path");
+ prefix = fw_path = grub_env_get ("fw_path");
if (fw_path)
{
config = grub_xasprintf ("%s/grub.cfg", fw_path);
@@ -345,7 +345,8 @@ grub_cmd_normal (struct grub_command *cmd __attribute__
((unused)),
}
}
- prefix = grub_env_get ("prefix");
+ if (!prefix)
+ prefix = grub_env_get ("prefix");
if (prefix)
{
grub_size_t config_len;
--
2.39.0
- [PATCH v4 00/19] UEFI networking support including ipv6 + dhcpv6, Robbie Harwood, 2023/01/09
- [PATCH v4 01/19] Revert "net/http: Allow use of non-standard TCP/IP ports", Robbie Harwood, 2023/01/09
- [PATCH v4 04/19] efinet: add structures for PXE messages, Robbie Harwood, 2023/01/09
- [PATCH v4 10/19] efinet: also use the firmware acceleration for http, Robbie Harwood, 2023/01/09
- [PATCH v4 02/19] net: read bracketed ipv6 addrs and port numbers, Robbie Harwood, 2023/01/09
- [PATCH v4 11/19] efi/http: match protocol+hostname of boot url in root_url, Robbie Harwood, 2023/01/09
- [PATCH v4 14/19] Try mac/guid/etc before grub.cfg on tftp config files, Robbie Harwood, 2023/01/09
- [PATCH v4 06/19] bootp: Process DHCPACK packet during HTTP Boot, Robbie Harwood, 2023/01/09
- [PATCH v4 12/19] Add fw_path variable to detect config file on efi, Robbie Harwood, 2023/01/09
- [PATCH v4 13/19] use fw_path prefix when fallback searching for grub config,
Robbie Harwood <=
- [PATCH v4 08/19] efinet: set DNS server from UEFI protocol, Robbie Harwood, 2023/01/09
- [PATCH v4 05/19] grub.texi: Add net_bootp6 doumentation, Robbie Harwood, 2023/01/09
- [PATCH v4 15/19] Prepend prefix when HTTP path is relative, Robbie Harwood, 2023/01/09
- [PATCH v4 16/19] efi/http: Enclose literal IPv6 addresses in square brackets, Robbie Harwood, 2023/01/09
- [PATCH v4 17/19] http: Prepend prefix when the HTTP path is relative, Robbie Harwood, 2023/01/09
- [PATCH v4 03/19] efinet + bootp: add net_bootp6 command supporting dhcpv6, Robbie Harwood, 2023/01/09
- [PATCH v4 18/19] normal/main: Discover the device to read the config from as a fallback, Robbie Harwood, 2023/01/09
- [PATCH v4 19/19] efinet: Add DHCP proxy support, Robbie Harwood, 2023/01/09
- [PATCH v4 07/19] efinet Configure network from UEFI device path, Robbie Harwood, 2023/01/09
- [PATCH v4 09/19] Support UEFI networking protocols, Robbie Harwood, 2023/01/09