# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1211564341 25200
# Node ID 8e103fd87b6b284a9b646e44fbf67441008ba3ba
# Parent 4a5a44d7b857df543af24d59380cb8fdbbb753a4
[TEST] #3 Make RHEL 5 XenFV guest grub conf use hda.
It looks like qemu on RHEL emulates an ide drive, not a scsi drive.
Update from 1 to 2:
-Instead of using distro, use qemu-dm version.
Update from 2 to 3:
-Handle case where qemu-dm is 32 bit, as well as 64 bit.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 4a5a44d7b857 -r 8e103fd87b6b suites/libvirt-cim/images/xmt-makefv.sh
--- a/suites/libvirt-cim/images/xmt-makefv.sh Fri May 30 14:26:38 2008 +0800
+++ b/suites/libvirt-cim/images/xmt-makefv.sh Fri May 23 10:39:01 2008 -0700
@@ -14,6 +14,20 @@
PARTED="parted -s"
TMPMOUNT=/tmp/cimtest_image_temp
SIZE=16
+QEMU_VER=082
+QEMU_FILE=""
+
+if [ -e "/usr/lib64/xen/bin/qemu-dm" ]; then
+ QEMU_FILE="/usr/lib64/xen/bin/qemu-dm"
+elif [ -e "/usr/lib64/xen/bin/qemu-dm" ]; then
+ QEMU_FILE="/usr/lib/xen/bin/qemu-dm"
+fi
+
+if [ -z $QEMU_FILE ]; then
+ CU_QEMU_VER=0
+else
+ CUR_QEMU_VER=`strings $QEMU_FILE | awk '/version [0-9]/ { print $5; }' | sed
's/,//' | sed 's/\.//g'`
+fi
die() {
echo "FAILED: $i" >&2
@@ -110,10 +124,19 @@
timeout 1
title Test Environment
root (hd0,0)
+EOF
+
+if [ $CUR_QEMU_VER -lt $QEMU_VER ]; then
+ cat >>${root}/grub/grub.conf <<EOF
+ kernel /vmlinuz root=/dev/hda1
+ initrd /initrd
+EOF
+else
+ cat >>${root}/grub/grub.conf <<EOF
kernel /vmlinuz root=/dev/sda1
initrd /initrd
EOF
-
+fi
}
ramdisk=$1