2009-08-23 Vladimir Serbinenko <phcoder@gmail.com>
* commands/search.c (search_fs): Try searching without autoload first. * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Load filesystem module explicitly for faster booting.
This commit is contained in:
parent
5174302b55
commit
e9a925da69
3 changed files with 28 additions and 1 deletions
|
@ -51,6 +51,7 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type)
|
|||
{
|
||||
int count = 0;
|
||||
char *buf = NULL;
|
||||
grub_fs_autoload_hook_t saved_autoload;
|
||||
|
||||
auto int iterate_device (const char *name);
|
||||
int iterate_device (const char *name)
|
||||
|
@ -131,7 +132,22 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type)
|
|||
return (found && var);
|
||||
}
|
||||
|
||||
grub_device_iterate (iterate_device);
|
||||
/* First try without autoloading if we're setting variable. */
|
||||
if (var)
|
||||
{
|
||||
saved_autoload = grub_fs_autoload_hook;
|
||||
grub_fs_autoload_hook = 0;
|
||||
grub_device_iterate (iterate_device);
|
||||
|
||||
/* Restore autoload hook. */
|
||||
grub_fs_autoload_hook = saved_autoload;
|
||||
|
||||
/* Retry with autoload if nothing found. */
|
||||
if (grub_errno == GRUB_ERR_NONE && count == 0)
|
||||
grub_device_iterate (iterate_device);
|
||||
}
|
||||
else
|
||||
grub_device_iterate (iterate_device);
|
||||
|
||||
grub_free (buf);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue