]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/main.c (grub_set_prefix_and_root): Set variable
authorMatthew Garrett <mjg@redhat.com>
Thu, 14 Nov 2013 14:53:32 +0000 (15:53 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Thu, 14 Nov 2013 14:53:32 +0000 (15:53 +0100)
cmdpath to firmware directory.

ChangeLog
grub-core/kern/main.c

index a7e144694725e6e723724f04c1990f2f919dc93c..efbef2dd01c0af4be9f3fec97c605788a1edbe28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-14  Matthew Garrett  <mjg@redhat.com>
+
+       * grub-core/kern/main.c (grub_set_prefix_and_root): Set variable
+       cmdpath to firmware directory.
+
 2013-11-14  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/efi/efi.c (grub_efi_get_filename): Reset the pointer
index 19dc9885af9903eaad4ebf70ad2d344c55af3b42..9cad0c4485cccfc7684f3ae5e8a6e9864a7912cf 100644 (file)
@@ -125,6 +125,21 @@ grub_set_prefix_and_root (void)
 
   grub_register_variable_hook ("root", 0, grub_env_write_root);
 
+  grub_machine_get_bootlocation (&fwdevice, &fwpath);
+
+  if (fwdevice)
+    {
+      char *cmdpath;
+
+      cmdpath = grub_xasprintf ("(%s)%s", fwdevice, fwpath ? : "");
+      if (cmdpath)
+       {
+         grub_env_set ("cmdpath", cmdpath);
+         grub_env_export ("cmdpath");
+         grub_free (cmdpath);
+       }
+    }
+
   if (prefix)
     {
       char *pptr = NULL;
@@ -142,8 +157,6 @@ grub_set_prefix_and_root (void)
       if (pptr[0])
        path = grub_strdup (pptr);
     }
-  if ((!device || device[0] == ',' || !device[0]) || !path)
-    grub_machine_get_bootlocation (&fwdevice, &fwpath);
 
   if (!device && fwdevice)
     device = fwdevice;