dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

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

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