|
|
d41074 |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
a85e8e |
From: Peter Jones <pjones@redhat.com>
|
|
|
a85e8e |
Date: Wed, 24 May 2017 15:02:40 -0400
|
|
|
d41074 |
Subject: [PATCH] set rootpath
|
|
|
a85e8e |
|
|
|
a85e8e |
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
a85e8e |
---
|
|
|
a85e8e |
grub-core/net/bootp.c | 20 ++++++++++++++++++++
|
|
|
a85e8e |
1 file changed, 20 insertions(+)
|
|
|
a85e8e |
|
|
|
a85e8e |
diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
|
|
|
d41074 |
index d47ad80a2ad..249ca0c2dc6 100644
|
|
|
a85e8e |
--- a/grub-core/net/bootp.c
|
|
|
a85e8e |
+++ b/grub-core/net/bootp.c
|
|
|
a85e8e |
@@ -398,11 +398,31 @@ grub_net_configure_by_dhcp_ack (const char *name,
|
|
|
a85e8e |
if (*path)
|
|
|
a85e8e |
{
|
|
|
a85e8e |
char *slash;
|
|
|
a85e8e |
+ int root_path_len;
|
|
|
a85e8e |
slash = grub_strrchr (*path, '/');
|
|
|
a85e8e |
if (slash)
|
|
|
a85e8e |
*slash = 0;
|
|
|
a85e8e |
else
|
|
|
a85e8e |
**path = 0;
|
|
|
a85e8e |
+ root_path_len = grub_strlen (*path);
|
|
|
a85e8e |
+ if (root_path_len >= 9 &&
|
|
|
a85e8e |
+ !grub_strcasecmp (&(*path)[root_path_len - 9], "/efi/boot"))
|
|
|
a85e8e |
+ {
|
|
|
a85e8e |
+ char *root_path;
|
|
|
a85e8e |
+ grub_print_error ();
|
|
|
a85e8e |
+ if (root_path_len - 9 == 0)
|
|
|
a85e8e |
+ {
|
|
|
a85e8e |
+ root_path_len = 1;
|
|
|
a85e8e |
+ root_path = grub_xasprintf ("/");
|
|
|
a85e8e |
+ }
|
|
|
a85e8e |
+ else
|
|
|
a85e8e |
+ {
|
|
|
a85e8e |
+ root_path_len -= 9;
|
|
|
a85e8e |
+ root_path = grub_strndup (*path, root_path_len);
|
|
|
a85e8e |
+ }
|
|
|
a85e8e |
+ grub_env_set_net_property (name, "rootpath",
|
|
|
a85e8e |
+ root_path, root_path_len);
|
|
|
a85e8e |
+ }
|
|
|
a85e8e |
}
|
|
|
a85e8e |
}
|
|
|
a85e8e |
grub_net_add_ipv4_local (inter, mask);
|