]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-probe.c (probe): Separate different drives in hint-str
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 14 Oct 2013 16:27:29 +0000 (18:27 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 14 Oct 2013 16:27:29 +0000 (18:27 +0200)
by spaces and not newlines.
* util/grub-mkconfig_lib.in: Handle multidevice filesystem.

ChangeLog
util/grub-mkconfig_lib.in
util/grub-probe.c

index 3e0715c3824af48e4221da9fcb10f9082d6461dc..66e23341b377754f0eda8fdf0db65b2fb438f0a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-14  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-probe.c (probe): Separate different drives in hint-str
+       by spaces and not newlines.
+       * util/grub-mkconfig_lib.in: Handle multidevice filesystem.
+
 2013-10-14  Andrey Borzenkov <arvidjaar@gmail.com>
 
        * grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name):
index 98d8a77060dc1b44d552e0bc16930d1200e78ac7..a9cf7fc554b1bcaa6303dfec7165237afe6375f4 100644 (file)
@@ -117,7 +117,10 @@ EOF
 
 prepare_grub_to_access_device ()
 {
-  partmap="`"${grub_probe}" --device "$@" --target=partmap`"
+  old_ifs="$IFS"
+  IFS='
+'
+  partmap="`"${grub_probe}" --device $@ --target=partmap`"
   for module in ${partmap} ; do
     case "${module}" in
       netbsd | openbsd)
@@ -128,46 +131,51 @@ prepare_grub_to_access_device ()
   done
 
   # Abstraction modules aren't auto-loaded.
-  abstraction="`"${grub_probe}" --device "$@" --target=abstraction`"
+  abstraction="`"${grub_probe}" --device $@ --target=abstraction`"
   for module in ${abstraction} ; do
     echo "insmod ${module}"
   done
 
-  fs="`"${grub_probe}" --device "$@" --target=fs`"
+  fs="`"${grub_probe}" --device $@ --target=fs`"
   for module in ${fs} ; do
     echo "insmod ${module}"
   done
 
   if [ x$GRUB_ENABLE_CRYPTODISK = xy ]; then
-      for uuid in "`"${grub_probe}" --device "$@" --target=cryptodisk_uuid`"; do
+      for uuid in "`"${grub_probe}" --device $@ --target=cryptodisk_uuid`"; do
          echo "cryptomount -u $uuid"
       done
   fi
 
   # If there's a filesystem UUID that GRUB is capable of identifying, use it;
   # otherwise set root as per value in device.map.
-  fs_hint="`"${grub_probe}" --device "$@" --target=compatibility_hint`"
+  fs_hint="`"${grub_probe}" --device $@ --target=compatibility_hint`"
   if [ "x$fs_hint" != x ]; then
     echo "set root='$fs_hint'"
   fi
-  if fs_uuid="`"${grub_probe}" --device "$@" --target=fs_uuid 2> /dev/null`" ; then
-    hints="`"${grub_probe}" --device "$@" --target=hints_string 2> /dev/null`" || hints=
+  if fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then
+    hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints=
     echo "if [ x\$feature_platform_search_hint = xy ]; then"
     echo "  search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
     echo "else"
     echo "  search --no-floppy --fs-uuid --set=root ${fs_uuid}"
     echo "fi"
   fi
+  IFS="$old_ifs"
 }
 
 grub_get_device_id ()
 {
+  old_ifs="$IFS"
+  IFS='
+'
   device="$1"
-  if fs_uuid="`"${grub_probe}" --device "${device}" --target=fs_uuid 2> /dev/null`" ; then
+  if fs_uuid="`"${grub_probe}" --device ${device} --target=fs_uuid 2> /dev/null`" ; then
     echo "$fs_uuid";
   else
-    echo "$device"
+    echo $device |sed 's, ,_,g'
   fi
+  IFS="$old_ifs"
 }
 
 grub_file_is_not_garbage ()
@@ -274,13 +282,18 @@ gettext_printf () {
 
 uses_abstraction () {
   device="$1"
+  old_ifs="$IFS"
+  IFS='
+'
 
-  abstraction="`"${grub_probe}" --device "${device}" --target=abstraction`"
+  abstraction="`"${grub_probe}" --device ${device} --target=abstraction`"
   for module in ${abstraction}; do
     if test "x${module}" = "x$2"; then
+      IFS="$old_ifs"
       return 0
     fi
   done
+  IFS="$old_ifs"
   return 1
 }
 
index 22d89842d5c75897593ae8fd9dc89972a23e203c..47482f8b6e1ea71d9f34bbed100f18a7cced43e2 100644 (file)
@@ -555,7 +555,10 @@ probe (const char *path, char **device_names, char delim)
              print_full_name (map, dev);
              printf ("' ");
            }
-         printf ("\n");
+         if (curdrive[1])
+           printf (" ");
+         else
+           printf ("\n");
 
          grub_device_close (dev);
          continue;