Blame SOURCES/0131-use-fw_path-prefix-when-fallback-searching-for-grub-.patch

6b3c76
From 3ddb1355db71ac8536b79b6c09808808cde50566 Mon Sep 17 00:00:00 2001
a85e8e
From: Fedora Ninjas <grub2-owner@fedoraproject.org>
a85e8e
Date: Wed, 19 Feb 2014 15:58:43 -0500
6b3c76
Subject: [PATCH 131/261] use fw_path prefix when fallback searching for grub
6b3c76
 config
a85e8e
a85e8e
When PXE booting via UEFI firmware, grub was searching for grub.cfg
a85e8e
in the fw_path directory where the grub application was found. If
a85e8e
that didn't exist, a fallback search would look for config file names
a85e8e
based on MAC and IP address. However, the search would look in the
a85e8e
prefix directory which may not be the same fw_path. This patch
a85e8e
changes that behavior to use the fw_path directory for the fallback
a85e8e
search. Only if fw_path is NULL will the prefix directory be searched.
a85e8e
a85e8e
Signed-off-by: Mark Salter <msalter@redhat.com>
a85e8e
---
a85e8e
 grub-core/normal/main.c | 5 +++--
a85e8e
 1 file changed, 3 insertions(+), 2 deletions(-)
a85e8e
a85e8e
diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c
6b3c76
index f66c03c4c..5e2ac150e 100644
a85e8e
--- a/grub-core/normal/main.c
a85e8e
+++ b/grub-core/normal/main.c
a85e8e
@@ -343,7 +343,7 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
a85e8e
       char *config;
a85e8e
       const char *prefix, *fw_path;
a85e8e
 
a85e8e
-      fw_path = grub_env_get ("fw_path");
a85e8e
+      prefix = fw_path = grub_env_get ("fw_path");
a85e8e
       if (fw_path)
a85e8e
 	{
a85e8e
 	  config = grub_xasprintf ("%s/grub.cfg", fw_path);
a85e8e
@@ -366,7 +366,8 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)),
a85e8e
 	    }
a85e8e
 	}
a85e8e
 
a85e8e
-      prefix = grub_env_get ("prefix");
a85e8e
+      if (! prefix)
a85e8e
+	      prefix = grub_env_get ("prefix");
a85e8e
       if (prefix)
a85e8e
         {
a85e8e
           grub_size_t config_len;
6b3c76
-- 
6b3c76
2.13.5
6b3c76