Skip to contentSkip to conversation

Current Grub2 & problem with /boot on different drive

DISCUSSION Dean Loros 3 participants 6 messages Sep 22, 2009 – Sep 25, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Dean Loros

author
#1 lore raw

Greetings--

Well Vladimir, the modification to grub.cfg makes a 20sec difference--times went from 3 min 50 sec to 3 min 30 sec--better, but still a "bit" long :) So I would say that option #3 has very little effect & I really do not want to hardcode as per option #2....I am open to "interesting" mods to bring the time down to "normal" levels & It looks like Colin is willing to do some package building in between his busy workweek. So what are your thoughts as how this can be approached?

Date: Mon, 21 Sep 2009 15:58:17 +0100 From: Colin Watson <[email protected]> Subject: Re: Current Grub2 & problem with /boot on different drive To: The development of GRUB 2 <[email protected]>
Message-ID: <[email protected]> Content-Type:
text/plain; charset=us-ascii On Mon, Sep 21, 2009 at 04:22:53PM +0200,

Quoted 11 lines · Vladimir 'phcoder' Serbinenko
Quoted 11 lines
Quoted 9 lines · Colin Watson
Quoted 9 lines · Vladimir 'phcoder' Serbinenko
Quoted 6 lines
Quoted 6 lines

As a workaround for time being you can use one or more of the following:
1) Increase cache size. Can this be done in 1.97?
Change include/grub/disk.h and replace
#define GRUB_DISK_CACHE_NUM 1021
with a bigger number

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

I'm a little baffled. Why does the disk cache size make a difference here? He has four disks - I'd have thought that 1021 would be plenty.

1021 is the number of cached 4KiB blocks and is used in hash calculations. If he has a lot of cache misses it will result in long boot times

Do you have a recommendation for a new value? I can build a test package and ask Dean to try it out.

Signature · 3 lines
Dean Loros
autocrosser at ubuntuforums.org
Performance by Design Ltd.
#2 lore raw

Try attached WIP patch

Quoted 40 lines · Dean Loros

Greetings--

Well Vladimir, the modification to grub.cfg makes a 20sec difference--times went from 3 min 50 sec to 3 min 30 sec--better, but still a "bit" long :) So I would say that option #3 has very little effect & I really do not want to hardcode as per option #2....I am open to "interesting" mods to bring the time down to "normal" levels & It looks like Colin is willing to do some package building in between his busy workweek. So what are your thoughts as how this can be approached?

Date: Mon, 21 Sep 2009 15:58:17 +0100 From: Colin Watson <[email protected]> Subject: Re: Current Grub2 & problem with /boot on different drive To: The development of GRUB 2 <[email protected]>
Message-ID: <[email protected]> Content-Type:
text/plain; charset=us-ascii On Mon, Sep 21, 2009 at 04:22:53PM +0200,

Quoted 21 lines · Vladimir 'phcoder' Serbinenko
Quoted 21 lines
Quoted 15 lines · Colin Watson
Quoted 15 lines · Vladimir 'phcoder' Serbinenko
Quoted 9 lines
Quoted 9 lines

As a workaround for time being you can use one or more of the following:
1) Increase cache size. Can this be done in 1.97?
Change include/grub/disk.h and replace
#define GRUB_DISK_CACHE_NUM 1021
with a bigger number

I'm a little baffled. Why does the disk cache size make a difference here? He has four disks - I'd have thought that 1021 would be plenty.

Quoted 11 lines
Quoted 6 lines
Quoted 4 lines

1021 is the number of cached 4KiB blocks and is used in hash calculations. If he has a lot of cache misses it will result in long boot times

Do you have a recommendation for a new value? I can build a test package and ask Dean to try it out.

commands/search.c +42 -61
index 0cfd0eb..4a4ca6f 100644
@@ -25,29 +25,10 @@
 #include <grub/device.h>
 #include <grub/file.h>
 #include <grub/env.h>
-#include <grub/extcmd.h>
+#include <grub/command.h>
 
-static const struct grub_arg_option options[] =
-  {
-    {"file",		'f', 0, "search devices by a file", 0, 0},
-    {"label",		'l', 0, "search devices by a filesystem label", 0, 0},
-    {"fs-uuid",		'u', 0, "search devices by a filesystem UUID", 0, 0},
-    {"set",		's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING},
-    {"no-floppy",	'n', 0, "do not probe any floppy drive", 0, 0},
-    {0, 0, 0, 0, 0, 0}
-  };
-
-enum options
-  {
-    SEARCH_FILE,
-    SEARCH_LABEL,
-    SEARCH_FS_UUID,
-    SEARCH_SET,
-    SEARCH_NO_FLOPPY,
- };
-
-static void
-search_fs (const char *key, const char *var, int no_floppy, enum options type)
+void
+FUNC_NAME (const char *key, const char *var, int no_floppy)
 {
   int count = 0;
   char *buf = NULL;
@@ -63,7 +44,7 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type)
 	name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9')
       return 0;
 
-    if (type == SEARCH_FILE)
+#ifdef DO_SEARCH_FILE
       {
 	grub_size_t len;
 	char *p;
@@ -84,27 +65,29 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type)
 	    grub_file_close (file);
 	  }
       }
-    else
+#else
       {
-	/* type is SEARCH_FS_UUID or SEARCH_LABEL */
+	/* SEARCH_FS_UUID or SEARCH_LABEL */
 	grub_device_t dev;
 	grub_fs_t fs;
-	int (*compare_fn) (const char *, const char *);
 	char *quid;
 
 	dev = grub_device_open (name);
 	if (dev)
 	  {
 	    fs = grub_fs_probe (dev);
-	    compare_fn =
-	      (type == SEARCH_FS_UUID) ? grub_strcasecmp : grub_strcmp;
 
-	    if (fs && ((type == SEARCH_FS_UUID) ? fs->uuid : fs->label))
+#ifdef DO_SEARCH_FS_UUID
+#define compare_fn grub_strcasecmp
+#define read_fn uuid
+#else
+#define compare_fn grub_strcmp
+#define read_fn label
+#endif
+
+	    if (fs && fs->read_fn)
 	      {
-		if (type == SEARCH_FS_UUID)
-		  fs->uuid (dev, &quid);
-		else
-		  fs->label (dev, &quid);
+		fs->read_fn (dev, &quid);
 
 		if (grub_errno == GRUB_ERR_NONE && quid)
 		  {
@@ -118,6 +101,7 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type)
 	    grub_device_close (dev);
 	  }
       }
+#endif
 
     if (found)
       {
@@ -156,45 +140,42 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type)
 }
 
 static grub_err_t
-grub_cmd_search (grub_extcmd_t cmd, int argc, char **args)
+grub_cmd_do_search (grub_command_t cmd __attribute__ ((unused)), int argc,
+		    char **args)
 {
-  struct grub_arg_list *state = cmd->state;
-  const char *var = 0;
-
   if (argc == 0)
-    return grub_error (GRUB_ERR_INVALID_COMMAND, "no argument specified");
-
-  if (state[SEARCH_SET].set)
-    var = state[SEARCH_SET].arg ? state[SEARCH_SET].arg : "root";
+    return grub_error (GRUB_ERR_BAD_ARGUMENT, "no argument specified");
 
-  if (state[SEARCH_LABEL].set)
-    search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_LABEL);
-  else if (state[SEARCH_FS_UUID].set)
-    search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_FS_UUID);
-  else if (state[SEARCH_FILE].set)
-    search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_FILE);
-  else
-    return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type");
+  FUNC_NAME (args[0], argc == 1 ? 0 : args[1], 0);
 
   return grub_errno;
 }
 
-static grub_extcmd_t cmd;
+static grub_command_t cmd;
 
-GRUB_MOD_INIT(search)
+#if defined (DO_SEARCH_FILE)
+GRUB_MOD_INIT(search_file)
+#elif defined (DO_SEARCH_FS_UUID)
+GRUB_MOD_INIT(search_fs_uuid)
+#else
+GRUB_MOD_INIT(search_fs_label)
+#endif
 {
   cmd =
-    grub_register_extcmd ("search", grub_cmd_search,
-			  GRUB_COMMAND_FLAG_BOTH,
-			  "search [-f|-l|-u|-s|-n] NAME",
-			  "Search devices by file, filesystem label or filesystem UUID."
-			  " If --set is specified, the first device found is"
-			  " set to a variable. If no variable name is"
-			  " specified, \"root\" is used.",
-			  options);
+    grub_register_command (COMMAND_NAME, grub_cmd_do_search,
+			   COMMAND_NAME " NAME [VARIABLE]",
+			   "Search devices by " SEARCH_TARGET "."
+			  " If VARIABLE is specified, the first device found is"
+			  " set to a variable.");
 }
 
-GRUB_MOD_FINI(search)
+#if defined (DO_SEARCH_FILE)
+GRUB_MOD_FINI(search_file)
+#elif defined (DO_SEARCH_FS_UUID)
+GRUB_MOD_FINI(search_fs_uuid)
+#else
+GRUB_MOD_FINI(search_fs_label)
+#endif
 {
-  grub_unregister_extcmd (cmd);
+  grub_unregister_command (cmd);
 }
commands/search_file.c new file +5 -0
new file mode 100644
index 0000000..b13d235
@@ -0,0 +1,5 @@
+#define DO_SEARCH_FILE 1
+#define FUNC_NAME grub_search_file
+#define COMMAND_NAME "search.file"
+#define SEARCH_TARGET "file"
+#include "search.c"
commands/search_label.c new file +5 -0
new file mode 100644
index 0000000..12710f9
@@ -0,0 +1,5 @@
+#define DO_SEARCH_FS_LABEL 1
+#define FUNC_NAME grub_search_fs_label
+#define COMMAND_NAME "search.fs_label"
+#define SEARCH_TARGET "filesystem label"
+#include "search.c"
commands/search_uuid.c new file +5 -0
new file mode 100644
index 0000000..9767d65
@@ -0,0 +1,5 @@
+#define DO_SEARCH_FS_UUID 1
+#define FUNC_NAME grub_search_fs_uuid
+#define COMMAND_NAME "search.fs_uuid"
+#define SEARCH_TARGET "filesystem UUID"
+#include "search.c"
commands/search_wrap.c new file +91 -0

91 lines not on this page · raw message

conf/common.rmk +19 -13
index e18dd10..d18a2f5 100644
@@ -363,8 +363,9 @@ scsi_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # Commands.
 pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod	\
-	ls.mod cmp.mod cat.mod help.mod search.mod loopback.mod	\
-	fs_file.mod fs_uuid.mod configfile.mod echo.mod		\
+	ls.mod cmp.mod cat.mod help.mod search_file.mod \
+	search_fs_uuid.mod search_fs_label.mod search.mod loopback.mod	\
+	configfile.mod echo.mod		\
 	terminfo.mod test.mod blocklist.mod hexdump.mod		\
 	read.mod sleep.mod loadenv.mod crc.mod parttool.mod	\
 	msdospart.mod memrw.mod normal.mod sh.mod lua.mod	\
@@ -437,10 +438,25 @@ help_mod_CFLAGS = $(COMMON_CFLAGS)
 help_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
 # For search.mod.
-search_mod_SOURCES = commands/search.c
+search_mod_SOURCES = commands/search_wrap.c
 search_mod_CFLAGS = $(COMMON_CFLAGS)
 search_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For search.mod.
+search_file_mod_SOURCES = commands/search_file.c
+search_file_mod_CFLAGS = $(COMMON_CFLAGS)
+search_file_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
+# For search.mod.
+search_fs_label_mod_SOURCES = commands/search_label.c
+search_fs_label_mod_CFLAGS = $(COMMON_CFLAGS)
+search_fs_label_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
+# For search.mod.
+search_fs_uuid_mod_SOURCES = commands/search_uuid.c
+search_fs_uuid_mod_CFLAGS = $(COMMON_CFLAGS)
+search_fs_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 # For test.mod.
 test_mod_SOURCES = commands/test.c
 test_mod_CFLAGS = $(COMMON_CFLAGS)
@@ -451,16 +467,6 @@ loopback_mod_SOURCES = disk/loopback.c
 loopback_mod_CFLAGS = $(COMMON_CFLAGS)
 loopback_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
-# For fs_file.mod
-fs_file_mod_SOURCES = disk/fs_file.c
-fs_file_mod_CFLAGS = $(COMMON_CFLAGS)
-fs_file_mod_LDFLAGS = $(COMMON_LDFLAGS)
-
-# For fs_uuid.mod
-fs_uuid_mod_SOURCES = disk/fs_uuid.c
-fs_uuid_mod_CFLAGS = $(COMMON_CFLAGS)
-fs_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS)
-
 # For configfile.mod
 configfile_mod_SOURCES = commands/configfile.c
 configfile_mod_CFLAGS = $(COMMON_CFLAGS)
conf/i386-coreboot.rmk +1 -1
index 09ec778..79c36ee 100644
@@ -108,7 +108,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c	\
 	commands/configfile.c commands/echo.c commands/help.c		\
 	commands/handler.c commands/ls.c commands/test.c 		\
-	commands/search.c commands/blocklist.c commands/hexdump.c	\
+	commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/blocklist.c commands/hexdump.c	\
 	commands/gptsync.c commands/probe.c commands/xnu_uuid.c		\
 	commands/password.c commands/keystatus.c			\
 	lib/hexdump.c commands/i386/cpuid.c				\
conf/i386-efi.rmk +1 -1
index 99ab06f..c9a412a 100644
@@ -36,7 +36,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c 	\
 	commands/configfile.c commands/help.c				\
 	commands/handler.c commands/ls.c commands/test.c 		\
-	commands/search.c commands/hexdump.c lib/hexdump.c		\
+	commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/hexdump.c lib/hexdump.c		\
 	commands/halt.c commands/reboot.c commands/keystatus.c		\
 	commands/i386/cpuid.c						\
 	commands/password.c						\
conf/i386-ieee1275.rmk +1 -1
index 4b640de..6b15b14 100644
@@ -62,7 +62,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c	\
 	commands/configfile.c commands/echo.c commands/help.c		\
 	commands/handler.c commands/ls.c commands/test.c 		\
-	commands/search.c commands/blocklist.c commands/hexdump.c	\
+	commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/blocklist.c commands/hexdump.c	\
 	lib/hexdump.c commands/halt.c commands/reboot.c			\
 	lib/envblk.c commands/loadenv.c					\
 	commands/gptsync.c commands/probe.c  commands/xnu_uuid.c	\
conf/i386-pc.rmk +1 -1
index bf8fbfb..8736422 100644
@@ -120,7 +120,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c	\
 	commands/configfile.c commands/echo.c commands/help.c		\
 	commands/handler.c commands/ls.c commands/test.c 		\
-	commands/search.c commands/blocklist.c commands/hexdump.c	\
+	commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/blocklist.c commands/hexdump.c	\
 	lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c		\
 	lib/envblk.c commands/loadenv.c					\
 	commands/gptsync.c commands/probe.c commands/xnu_uuid.c		\
conf/powerpc-ieee1275.rmk +1 -1
index ee7f9ec..df594cf 100644
@@ -42,7 +42,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \
 util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c 	\
 	commands/configfile.c commands/help.c				\
-	commands/search.c commands/handler.c commands/test.c 		\
+	commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/handler.c commands/test.c 		\
 	commands/ls.c commands/blocklist.c commands/hexdump.c		\
 	lib/hexdump.c commands/halt.c commands/reboot.c 		\
 	lib/envblk.c commands/loadenv.c					\
conf/sparc64-ieee1275.rmk +1 -1
index 62e951a..936d481 100644
@@ -100,7 +100,7 @@ grub_ofpathname_SOURCES = util/sparc64/ieee1275/grub-ofpathname.c \
 util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c 	\
 	commands/configfile.c commands/help.c				\
-	commands/search.c commands/handler.c commands/test.c 		\
+	commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/handler.c commands/test.c 		\
 	commands/ls.c commands/blocklist.c commands/hexdump.c		\
 	lib/hexdump.c commands/halt.c commands/reboot.c 		\
 	lib/envblk.c commands/loadenv.c					\
conf/x86_64-efi.rmk +1 -1
index 934cd72..a17cd59 100644
@@ -34,7 +34,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h
 grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c 	\
 	commands/configfile.c commands/help.c				\
 	commands/handler.c commands/ls.c commands/test.c 		\
-	commands/search.c commands/hexdump.c lib/hexdump.c		\
+	commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/hexdump.c lib/hexdump.c		\
 	commands/halt.c commands/reboot.c				\
 	commands/i386/cpuid.c						\
 	commands/password.c commands/keystatus.c			\
disk/fs_file.c deleted +0 -136

136 lines not on this page · raw message

disk/fs_uuid.c deleted +0 -149

149 lines not on this page · raw message

util/i386/pc/grub-install.in +13 -6
index 8ceb811..7850076 100644
@@ -271,6 +271,7 @@ modules="$modules $disk_module"
 modules="$modules $fs_module $partmap_module $devabstraction_module"
 
 prefix_drive=
+config=
 if [ "x${devabstraction_module}" = "x" ] ; then
     if echo "${install_device}" | grep -qx "(.*)" ; then
       install_drive="${install_device}"
@@ -289,16 +290,16 @@ if [ "x${devabstraction_module}" = "x" ] ; then
           echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
           exit 1
         fi
-        prefix_drive="(UUID=${uuid})"
-        modules="$modules fs_uuid"
+        config="search_fs_uuid ${uuid} root"
+        modules="$modules search_fs_uuid"
     elif [ "x${grub_drive}" != "x${install_drive}" ] ; then
         uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`"
         if [ "x${uuid}" = "x" ] ; then
           echo "You attempted a cross-disk install, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2
           exit 1
         fi
-        prefix_drive="(UUID=${uuid})"
-        modules="$modules fs_uuid"
+        config="search_fs_uuid ${uuid} root"
+        modules="$modules search_fs_uuid"
     fi
 else
     prefix_drive=`$grub_probe --target=drive --device ${grub_device}`
@@ -309,14 +310,20 @@ if [ "x${relative_grubdir}" = "x" ] ; then
     relative_grubdir=/
 fi
 
+config_opt=
+echo $config > ${grubdir}/load.cfg
+if [ x$config != x ]; then
+    config_opt="-c $config "
+fi
+
 if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then
-    $grub_mkimage --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
+    $grub_mkimage ${config_opt} --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
 
     # Now perform the installation.
     $grub_setup ${setup_verbose} ${setup_force} --directory=${grubdir} --device-map=${device_map} \
         ${install_device} || exit 1
 else
-    $grub_mkimage -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
+    $grub_mkimage ${config_opt} -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
 fi
 
 # Prompt the user to check if the device map is correct.
#3 lore raw

patch to replace (UUID=) hack

Quoted 1 line · Vladimir 'phcoder' Serbinenko

Try attached WIP patch

Excellent. This was quite necessary. I have to admit my (UUID=) kludge was a really poor solution (although in that time, the alternatives weren't so straightforwarded).

I'm inclined to allow this for inclusion in 1.97, since it fixes a problem that could be seen as a bug (the overhead can be huge, specially in slow setups).

util/i386/pc/grub-install.in if [ "x${devabstraction_module}" = "x" ] ; then · line 294

Quoted 4 lines
util/i386/pc/grub-install.in +2 -2
-        prefix_drive="(UUID=${uuid})"
-        modules="$modules fs_uuid"
+        config="search_fs_uuid ${uuid} root"
+        modules="$modules search_fs_uuid"

Note we don't need to explicitly include "root" there. This would save 5 bytes, and make the behaviour a bit more consistent (since root is implicit afterwards).

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#4 lore raw

Re: patch to replace (UUID=) hack

Quoted 5 lines · Robert Millan
Quoted 2 lines · Vladimir 'phcoder' Serbinenko

Try attached WIP patch

Quoted 9 lines

Excellent. This was quite necessary. I have to admit my (UUID=) kludge was a really poor solution (although in that time, the alternatives weren't so straightforwarded).

I'm inclined to allow this for inclusion in 1.97, since it fixes a problem that could be seen as a bug (the overhead can be huge, specially in slow setups).

This patch isn't ready yet. grub-install has to be fixed for grub-install for sparc64 too but I have no possibility to test it on sparc64. I haven't tested it on multi-drive config on x86 yet.

Quoted 10 lines

util/i386/pc/grub-install.in if [ "x${devabstraction_module}" = "x" ] ; then · line 294

Quoted 5 lines
util/i386/pc/grub-install.in +2 -2
-        prefix_drive="(UUID=${uuid})"
-        modules="$modules fs_uuid"
+        config="search_fs_uuid ${uuid} root"
+        modules="$modules search_fs_uuid"

Note we don't need to explicitly include "root" there. This would save 5 bytes, and make the behaviour a bit more consistent (since root is implicit afterwards).

If "root" is omitted the found filename is printed on console

#5 lore raw

Re: patch to replace (UUID=) hack

Quoted 10 lines · Vladimir 'phcoder' Serbinenko
Quoted 9 lines · Robert Millan
Quoted 2 lines · Vladimir 'phcoder' Serbinenko

Try attached WIP patch

Excellent. This was quite necessary. I have to admit my (UUID=) kludge was a really poor solution (although in that time, the alternatives weren't so straightforwarded).

Quoted 8 lines
Quoted 5 lines

I'm inclined to allow this for inclusion in 1.97, since it fixes a problem that could be seen as a bug (the overhead can be huge, specially in slow setups).

This patch isn't ready yet. grub-install has to be fixed for grub-install for sparc64 too but I have no possibility to test it on sparc64. I haven't tested it on multi-drive config on x86 yet.

This code duplication is problematic. Would be nice to have those two files unified in long term :-/

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
util/i386/pc/grub-install.in +2 -2
-        prefix_drive="(UUID=${uuid})"
-        modules="$modules fs_uuid"
+        config="search_fs_uuid ${uuid} root"
+        modules="$modules search_fs_uuid"
Quoted 6 lines
Quoted 4 lines

Note we don't need to explicitly include "root" there. This would save 5 bytes, and make the behaviour a bit more consistent (since root is implicit afterwards).

If "root" is omitted the found filename is printed on console

I guess that's because -s wasn't used?

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#6 lore raw

Re: patch to replace (UUID=) hack

Quoted 20 lines · Robert Millan
Quoted 18 lines · Vladimir 'phcoder' Serbinenko
Quoted 16 lines · Robert Millan
Quoted 3 lines · Vladimir 'phcoder' Serbinenko

Try attached WIP patch

Excellent. This was quite necessary. I have to admit my (UUID=) kludge was a really poor solution (although in that time, the alternatives weren't so straightforwarded).

I'm inclined to allow this for inclusion in 1.97, since it fixes a problem that could be seen as a bug (the overhead can be huge, specially in slow setups).

Quoted 9 lines
Quoted 4 lines

This patch isn't ready yet. grub-install has to be fixed for grub-install for sparc64 too but I have no possibility to test it on sparc64. I haven't tested it on multi-drive config on x86 yet.

This code duplication is problematic. Would be nice to have those two files unified in long term :-/

I'm not sure about this. This code deals with sparc-specific stuff and if it's unified with i386-pc it may tend to be broken. But I can't make any definite statement since I'm not familiar with sparc64. CC'ing David Miller.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

util/i386/pc/grub-install.in if [ "x${devabstraction_module}" = "x" ] ; then · line 294

Quoted 6 lines
util/i386/pc/grub-install.in +2 -2
-        prefix_drive="(UUID=${uuid})"
-        modules="$modules fs_uuid"
+        config="search_fs_uuid ${uuid} root"
+        modules="$modules search_fs_uuid"

Note we don't need to explicitly include "root" there. This would save 5 bytes, and make the behaviour a bit more consistent (since root is implicit afterwards).

Quoted 6 lines
Quoted 2 lines

If "root" is omitted the found filename is printed on console

I guess that's because -s wasn't used?

Yes. Using options would drag extcmd.mod without real need (for normal mode "search" with old syntax is still available)