* grub-core/kern/main.c (grub_set_prefix_and_root): Set variable
cmdpath to firmware directory.
This commit is contained in:
parent
83e9c273e5
commit
1fe26ab4a0
2 changed files with 20 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue