a5bd9f6
From 321ac40b339af9820d4f9df7d301524a3b9ffbbe Mon Sep 17 00:00:00 2001
a5bd9f6
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
a5bd9f6
Date: Sun, 24 Mar 2013 13:11:19 +0100
a5bd9f6
Subject: [PATCH 228/364] 	* util/grub-mkconfig_lib.in
a5bd9f6
 (prepare_grub_to_access_device): Fix 	handling of multi-device filesystems.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog                 |  5 +++++
a5bd9f6
 util/grub-mkconfig_lib.in | 16 +++++++---------
a5bd9f6
 2 files changed, 12 insertions(+), 9 deletions(-)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index 6fab49f..4df000e 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,5 +1,10 @@
a5bd9f6
 2013-03-24  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
 
a5bd9f6
+	* util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Fix
a5bd9f6
+	handling of multi-device filesystems.
a5bd9f6
+
a5bd9f6
+2013-03-24  Vladimir Serbinenko  <phcoder@gmail.com>
a5bd9f6
+
a5bd9f6
 	* grub-core/Makefile.core.def (vbe): Disable on coreboot and multiboot
a5bd9f6
 	platforms.
a5bd9f6
 
a5bd9f6
diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
a5bd9f6
index e560dd7..b48e2af 100644
a5bd9f6
--- a/util/grub-mkconfig_lib.in
a5bd9f6
+++ b/util/grub-mkconfig_lib.in
a5bd9f6
@@ -115,9 +115,7 @@ EOF
a5bd9f6
 
a5bd9f6
 prepare_grub_to_access_device ()
a5bd9f6
 {
a5bd9f6
-  device="$1"
a5bd9f6
-
a5bd9f6
-  partmap="`"${grub_probe}" --device "${device}" --target=partmap`"
a5bd9f6
+  partmap="`"${grub_probe}" --device "$@" --target=partmap`"
a5bd9f6
   for module in ${partmap} ; do
a5bd9f6
     case "${module}" in
a5bd9f6
       netbsd | openbsd)
a5bd9f6
@@ -128,30 +126,30 @@ prepare_grub_to_access_device ()
a5bd9f6
   done
a5bd9f6
 
a5bd9f6
   # Abstraction modules aren't auto-loaded.
a5bd9f6
-  abstraction="`"${grub_probe}" --device "${device}" --target=abstraction`"
a5bd9f6
+  abstraction="`"${grub_probe}" --device "$@" --target=abstraction`"
a5bd9f6
   for module in ${abstraction} ; do
a5bd9f6
     echo "insmod ${module}"
a5bd9f6
   done
a5bd9f6
 
a5bd9f6
-  fs="`"${grub_probe}" --device "${device}" --target=fs`"
a5bd9f6
+  fs="`"${grub_probe}" --device "$@" --target=fs`"
a5bd9f6
   for module in ${fs} ; do
a5bd9f6
     echo "insmod ${module}"
a5bd9f6
   done
a5bd9f6
 
a5bd9f6
   if [ x$GRUB_CRYPTODISK_ENABLE = xy ]; then
a5bd9f6
-      for uuid in "`"${grub_probe}" --device "${device}" --target=cryptodisk_uuid`"; do
a5bd9f6
+      for uuid in "`"${grub_probe}" --device "$@" --target=cryptodisk_uuid`"; do
a5bd9f6
 	  echo "cryptomount -u $uuid"
a5bd9f6
       done
a5bd9f6
   fi
a5bd9f6
 
a5bd9f6
   # If there's a filesystem UUID that GRUB is capable of identifying, use it;
a5bd9f6
   # otherwise set root as per value in device.map.
a5bd9f6
-  fs_hint="`"${grub_probe}" --device "${device}" --target=compatibility_hint`"
a5bd9f6
+  fs_hint="`"${grub_probe}" --device "$@" --target=compatibility_hint`"
a5bd9f6
   if [ "x$fs_hint" != x ]; then
a5bd9f6
     echo "set root='$fs_hint'"
a5bd9f6
   fi
a5bd9f6
-  if fs_uuid="`"${grub_probe}" --device "${device}" --target=fs_uuid 2> /dev/null`" ; then
a5bd9f6
-    hints="`"${grub_probe}" --device "${device}" --target=hints_string 2> /dev/null`" || hints=
a5bd9f6
+  if fs_uuid="`"${grub_probe}" --device "$@" --target=fs_uuid 2> /dev/null`" ; then
a5bd9f6
+    hints="`"${grub_probe}" --device "$@" --target=hints_string 2> /dev/null`" || hints=
a5bd9f6
     echo "if [ x\$feature_platform_search_hint = xy ]; then"
a5bd9f6
     echo "  search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
a5bd9f6
     echo "else"
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6