After hours and hours trying to get grub-probe to do the right thing,
I've decided to temporarily work around it instead. Package is still
compiling, but hand-applied changes to the installed scripts allowed
me to run update-grub on multipath-enabled system. Patch:
# Device containing our /boot partition. Usually the same as GRUB_DEVICE.
GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`"
-GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true
+#GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true
+GRUB_DEVICE_BOOT_UUID="`blkid ${GRUB_DEVICE_BOOT} | sed -e 's/ /\n/g' | grep UUID | cut -d \\" -f 2`"
# Filesystem for the device containing our userland. Used for stuff like
# choosing Hurd filesystem module.
-GRUB_FS="`${grub_probe} --target=fs / 2> /dev/null || echo unknown`"
+#GRUB_FS="`${grub_probe} --target=fs / 2> /dev/null || echo unknown`"
+GRUB_FS="`blkid ${GRUB_DEVICE} | sed -e 's/ /\n/g' | grep TYPE | cut -d \\" -f 2`"
if test -f ${sysconfdir}/default/grub ; then
. ${sysconfdir}/default/grub
diff -Nur -x '*.orig' -x '*~' grub2-mp1/util/grub-mkconfig_lib.in grub2-mp1.new/util/grub-mkconfig_lib.in
--- grub2-mp1/util/grub-mkconfig_lib.in 2010-12-10 10:53:15.000000000 -0500
+++ grub2-mp1.new/util/grub-mkconfig_lib.in 2010-12-10 22:38:15.778704576 -0500
@@ -65,9 +65,9 @@
fi
# abort if file is in a filesystem we can't read
- if ${grub_probe} -t fs $path > /dev/null 2>&1 ; then : ; else
- return 1
- fi
+ #if ${grub_probe} -t fs $path > /dev/null 2>&1 ; then : ; else
+ # return 1
+ #fi
return 0
}
@@ -108,20 +108,23 @@
device=$1
# Abstraction modules aren't auto-loaded.
- abstraction="`${grub_probe} --device ${device} --target=abstraction`"
+ #abstraction="`${grub_probe} --device ${device} --target=abstraction`"
+ abstraction=""
for module in ${abstraction} ; do
echo "insmod ${module}"
done
- fs="`${grub_probe} --device ${device} --target=fs`"
+ #fs="`${grub_probe} --device ${device} --target=fs`"
+ fs="`blkid ${device} | sed -e 's/ /\n/g' | grep TYPE | cut -d \\" -f 2`"
for module in ${fs} ; do
echo "insmod ${module}"
done
# If there's a filesystem UUID that GRUB is capable of identifying, use it;
# otherwise set root as per value in device.map.
- echo "set root='`${grub_probe} --device ${device} --target=drive`'"
- if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
+ #echo "set root='`${grub_probe} --device ${device} --target=drive`'"
+ #if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
+ if fs_uuid="`blkid ${device} | sed -e 's/ /\n/g' | grep UUID | cut -d \\" -f 2`"; then
echo "search --no-floppy --fs-uuid --set ${fs_uuid}"
fi
}
After hours and hours trying to get grub-probe to do the right thing,
I've decided to temporarily work around it instead. Package is still
compiling, but hand-applied changes to the installed scripts allowed
me to run update-grub on multipath-enabled system. Patch:
diff -Nur -x '*.orig' -x '*~' grub2-mp1/ util/grub- mkconfig. in grub2-mp1. new/util/ grub-mkconfig. in util/grub- mkconfig. in 2010-12-10 10:53:15.000000000 -0500 new/util/ grub-mkconfig. in 2010-12-10 22:36:19.658999131 -0500
--- grub2-mp1/
+++ grub2-mp1.
@@ -120,15 +120,18 @@
# Device containing our userland. Typically used for root= parameter. "`${grub_ probe} --target=device /`" UUID="` ${grub_ probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true DEVICE_ UUID="` ${grub_ probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true UUID="` blkid ${GRUB_DEVICE} | sed -e 's/ /\n/g' | grep UUID | cut -d \\" -f 2`"
GRUB_DEVICE=
-GRUB_DEVICE_
+#GRUB_
+GRUB_DEVICE_
# Device containing our /boot partition. Usually the same as GRUB_DEVICE. BOOT="` ${grub_ probe} --target=device /boot`" BOOT_UUID= "`${grub_ probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true DEVICE_ BOOT_UUID= "`${grub_ probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true BOOT_UUID= "`blkid ${GRUB_DEVICE_BOOT} | sed -e 's/ /\n/g' | grep UUID | cut -d \\" -f 2`"
GRUB_DEVICE_
-GRUB_DEVICE_
+#GRUB_
+GRUB_DEVICE_
# Filesystem for the device containing our userland. Used for stuff like "`${grub_ probe} --target=fs / 2> /dev/null || echo unknown`" FS="`${ grub_probe} --target=fs / 2> /dev/null || echo unknown`"
# choosing Hurd filesystem module.
-GRUB_FS=
+#GRUB_
+GRUB_FS="`blkid ${GRUB_DEVICE} | sed -e 's/ /\n/g' | grep TYPE | cut -d \\" -f 2`"
if test -f ${sysconfdir} /default/ grub ; then /default/ grub util/grub- mkconfig_ lib.in grub2-mp1. new/util/ grub-mkconfig_ lib.in util/grub- mkconfig_ lib.in 2010-12-10 10:53:15.000000000 -0500 new/util/ grub-mkconfig_ lib.in 2010-12-10 22:38:15.778704576 -0500
. ${sysconfdir}
diff -Nur -x '*.orig' -x '*~' grub2-mp1/
--- grub2-mp1/
+++ grub2-mp1.
@@ -65,9 +65,9 @@
fi
# abort if file is in a filesystem we can't read
- if ${grub_probe} -t fs $path > /dev/null 2>&1 ; then : ; else
- return 1
- fi
+ #if ${grub_probe} -t fs $path > /dev/null 2>&1 ; then : ; else
+ # return 1
+ #fi
return 0
}
@@ -108,20 +108,23 @@
device=$1
# Abstraction modules aren't auto-loaded. "`${grub_ probe} --device ${device} --target= abstraction` " "`${grub_ probe} --device ${device} --target= abstraction` "
- abstraction=
+ #abstraction=
+ abstraction=""
for module in ${abstraction} ; do
echo "insmod ${module}"
done
- fs="`${grub_probe} --device ${device} --target=fs`"
+ #fs="`${grub_probe} --device ${device} --target=fs`"
+ fs="`blkid ${device} | sed -e 's/ /\n/g' | grep TYPE | cut -d \\" -f 2`"
for module in ${fs} ; do
echo "insmod ${module}"
done
# If there's a filesystem UUID that GRUB is capable of identifying, use it; ${grub_ probe} --device ${device} --target=drive`'" "`${grub_ probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then ${grub_ probe} --device ${device} --target=drive`'" "`${grub_ probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then
# otherwise set root as per value in device.map.
- echo "set root='`
- if fs_uuid=
+ #echo "set root='`
+ #if fs_uuid=
+ if fs_uuid="`blkid ${device} | sed -e 's/ /\n/g' | grep UUID | cut -d \\" -f 2`"; then
echo "search --no-floppy --fs-uuid --set ${fs_uuid}"
fi
}