diff --git a/ChangeLog b/ChangeLog index badca6588..fc139b4ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-07-02 Colin Watson + + * 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 * docs/grub.texi (Changes from GRUB Legacy): New section. diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index bdd2b8c6f..9a77d1bdf 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -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 +} diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 2e0143df2..14b85c7f1 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -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}