When I changed the grub-pc postinstall script like this the grub-pc package configured on lucid with virtio disk:
$ diff -u grub-pc.postinst.DIST grub-pc.postinst --- grub-pc.postinst.DIST 2010-05-05 15:37:19.000000000 -0400 +++ grub-pc.postinst 2010-05-10 09:39:12.361704621 -0400 @@ -19,16 +19,18 @@ cached_available_ids= available_ids() { - local id path + local id path diskby
if [ "$cached_available_ids" ]; then echo "$cached_available_ids" return fi
- [ -d /dev/disk/by-id ] || return + for diskby in /dev/disk/by-id /dev/disk/by-uuid; do + [ -d "$diskby" ] && break + done cached_available_ids="$( - for path in /dev/disk/by-id/*; do + for path in "$diskby"/* ; do [ -e "$path" ] || continue printf '%s %s\n' "$path" "$(readlink -f "$path")" done | sort -k2 -s -u | cut -d' ' -f1 @@ -45,6 +47,10 @@ echo "$id" return 0 fi + if [ "$(readlink -f "$id" | sed -e 's/.$//')" = "$(readlink -f "$1")" ]; then + echo "$id" + return 0 + fi done return 1 }
When I changed the grub-pc postinstall script like this the grub-pc package configured on lucid with virtio disk:
$ diff -u grub-pc. postinst. DIST grub-pc.postinst postinst. DIST 2010-05-05 15:37:19.000000000 -0400 available_ ids=
--- grub-pc.
+++ grub-pc.postinst 2010-05-10 09:39:12.361704621 -0400
@@ -19,16 +19,18 @@
cached_
available_ids()
{
- local id path
+ local id path diskby
if [ "$cached_ available_ ids" ]; then available_ ids"
echo "$cached_
return
fi
- [ -d /dev/disk/by-id ] || return available_ ids="$(
+ for diskby in /dev/disk/by-id /dev/disk/by-uuid; do
+ [ -d "$diskby" ] && break
+ done
cached_
- for path in /dev/disk/by-id/*; do
+ for path in "$diskby"/* ; do
[ -e "$path" ] || continue
printf '%s %s\n' "$path" "$(readlink -f "$path")"
done | sort -k2 -s -u | cut -d' ' -f1
@@ -45,6 +47,10 @@
echo "$id"
return 0
fi
+ if [ "$(readlink -f "$id" | sed -e 's/.$//')" = "$(readlink -f "$1")" ]; then
+ echo "$id"
+ return 0
+ fi
done
return 1
}