* 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>
+
+ * 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.
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
+}
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}