]> git.proxmox.com Git - grub2.git/commitdiff
* util/grub-mkconfig_lib.in (uses_abstraction): New function.
authorColin Watson <cjwatson@ubuntu.com>
Fri, 2 Jul 2010 11:32:05 +0000 (12:32 +0100)
committerColin Watson <cjwatson@ubuntu.com>
Fri, 2 Jul 2010 11:32:05 +0000 (12:32 +0100)
* util/grub.d/10_linux.in: Use it to check for LVM, so that
LVM-on-RAID is handled correctly.

ChangeLog
util/grub-mkconfig_lib.in
util/grub.d/10_linux.in

index badca6588dd7781e1f730bf18af6aa8b062733bd..fc139b4caf31a395e08705279f408b2d400ace39 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-02  Colin Watson  <cjwatson@ubuntu.com>
+
+       * util/grub-mkconfig_lib.in (uses_abstraction): New function.
+       * util/grub.d/10_linux.in: Use it to check for LVM, so that
+       LVM-on-RAID is handled correctly.
+
 2010-07-02  Colin Watson  <cjwatson@ubuntu.com>
 
        * docs/grub.texi (Changes from GRUB Legacy): New section.
index bdd2b8c6f55138a027e1b84f21a8923ce17a38be..9a77d1bdf749bc9c880c3f885cfa6b2aac782079 100644 (file)
@@ -190,3 +190,15 @@ version_find_latest ()
 gettext_quoted () {
   $gettext "$@" | sed "s/'/'\\\\''/g"
 }
+
+uses_abstraction () {
+  device=$1
+
+  abstraction="`${grub_probe} --device ${device} --target=abstraction`"
+  for module in ${abstraction}; do
+    if test "x${module}" = "x$2"; then
+      return 0
+    fi
+  done
+  return 1
+}
index 2e0143df28d4efa175dc00d78483735d99378926..14b85c7f131ef3b513154a0d7fe3b125de26c0ef 100644 (file)
@@ -45,7 +45,7 @@ esac
 
 if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
     || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
-    || [ "x`grub-probe -t abstraction --device ${GRUB_DEVICE}`" = "xlvm"  ] ; then
+    || uses_abstraction "${GRUB_DEVICE}" lvm; then
   LINUX_ROOT_DEVICE=${GRUB_DEVICE}
 else
   LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}