]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-08-23 Vladimir Serbinenko <phcoder@gmail.com>
authorphcoder <phcoder@localhost>
Sun, 23 Aug 2009 15:27:07 +0000 (15:27 +0000)
committerphcoder <phcoder@localhost>
Sun, 23 Aug 2009 15:27:07 +0000 (15:27 +0000)
* 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.

ChangeLog
commands/search.c
util/grub-mkconfig_lib.in

index a2cc07f9a2a14646e66bc3fd9cdefd2c9134f740..a00842cecf2c685a8358b270844ea5bdf420dfb5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
 2009-08-23  Colin Watson  <cjwatson@ubuntu.com>
 
        * util/grub-mkconfig.in: Export GRUB_DISABLE_OS_PROBER.
index d10b51abf3ae6f457e13ec7de18e29fb74287776..0cfd0ebbc732216a057d20b77c9d660689fa3407 100644 (file)
@@ -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);
 
index 3585a68ef4ec6f66214bd96e033c98030b03b93c..2385b0878a8009a88285a0e4391e090a0e4772ef 100644 (file)
@@ -140,6 +140,11 @@ prepare_grub_to_access_device ()
     echo "insmod ${module}"
   done
 
+  fs="`${grub_probe} --device ${device} --target=fs`"
+  for module in ${fs} ; do
+    echo "insmod ${module}"
+  done
+
   # If there's a filesystem UUID that GRUB is capable of identifying, use it;
   # otherwise set root as per value in device.map.
   echo "set root=`${grub_probe} --device ${device} --target=drive`"