Control: tags -1 patch

Hi

The bug has been introduced with this upstream commit

commit 588744d0dc655177d5883bdcb8f72ff5160109ed
Author: Vladimir 'phcoder' Serbinenko <phco...@gmail.com>
Date:   Mon Oct 14 18:27:29 2013 +0200

        * util/grub-probe.c (probe): Separate different drives in hint-str
        by spaces and not newlines.
        * util/grub-mkconfig_lib.in: Handle multidevice filesystem.

http://anonscm.debian.org/gitweb/?p=pkg-grub/grub.git;a=commitdiff;h=588744d0dc655177d5883bdcb8f72ff5160109ed

Which makes uses_abstraction() fail to recognize lvm2.

Reverting this commit, as in the rebased attachment, fixes the problem 
for me on 10+ systems; this patch could be reduced further to the IFS 
changes in uses_abstraction().

Regards
        Stefan Lippers-Hollmann
From 8e4f8abcf253a36b6e4e2094fed8d776f787edca Mon Sep 17 00:00:00 2001
From: Stefan Lippers-Hollmann <s....@gmx.de>
Date: Thu, 13 Mar 2014 17:28:17 +0100
Subject: [PATCH] Revert "	* util/grub-probe.c (probe): Separate
 different drives in hint-str"

This reverts commit 588744d0dc655177d5883bdcb8f72ff5160109ed, as this
commit breaks the lvm2 detection in uses_abstraction().

---
 util/grub-mkconfig_lib.in | 33 ++++++++++-----------------------
 util/grub-probe.c         |  5 +----
 2 files changed, 11 insertions(+), 27 deletions(-)

--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -120,10 +120,7 @@ EOF
 
 prepare_grub_to_access_device ()
 {
-  old_ifs="$IFS"
-  IFS='
-'
-  partmap="`"${grub_probe}" --device $@ --target=partmap`"
+  partmap="`"${grub_probe}" --device "$@" --target=partmap`"
   for module in ${partmap} ; do
     case "${module}" in
       netbsd | openbsd)
@@ -150,37 +147,36 @@ prepare_grub_to_access_device ()
   esac
 
   # 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"
 
   if [ "x${loop_file}" != x ]; then
     loop_mountpoint="$(awk '"'${loop_file}'" ~ "^"$2 && $2 != "/" { print $2 }' /proc/mounts | tail -n1)"
@@ -193,16 +189,12 @@ prepare_grub_to_access_device ()
 
 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 |sed 's, ,_,g'
+    echo "$device"
   fi
-  IFS="$old_ifs"
 }
 
 grub_file_is_not_garbage ()
@@ -310,18 +302,13 @@ 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
 }
 
--- a/util/grub-probe.c
+++ b/util/grub-probe.c
@@ -479,10 +479,7 @@ probe (const char *path, char **device_n
 	      grub_util_fprint_full_disk_name (stdout, map, dev);
 	      printf ("' ");
 	    }
-	  if (curdrive[1])
-	    printf (" ");
-	  else
-	    printf ("\n");
+	  printf ("\n");
 
 	  grub_device_close (dev);
 	  continue;

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to