From 9fa7924242c6dd10d6437914018116a177c7c1c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 21 Apr 2010 11:57:49 +0200 Subject: [PATCH] detect configured virtio initrds on SUSE systems automatically (unbreak kvm support on appliance) --- build | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build b/build index 917c9db..c4d7c6d 100755 --- a/build +++ b/build @@ -934,6 +934,18 @@ if [ "$VM_TYPE" = 'kvm' -a -z "$RUNNING_IN_VM" ]; then qemu_kernel="$VM_KERNEL" fi + # check if a SUSE system with virtio initrd is running + if [ -z "$VM_INITRD" -a -e /etc/sysconfig/kernel ]; then + a=$( source /etc/sysconfig/kernel; echo $INITRD_MODULES ) + have_virtio_pci="" + have_virtio_blk="" + for i in $a; do + [ "$i" == "virtio_pci" ] && have_virtio_pci="1" + [ "$i" == "virtio_blk" ] && have_virtio_blk="1" + done + [ -n "$have_virtio_pci" -a -n "$have_virtio_blk" ] && VM_INITRD="/boot/initrd" + fi + if [ -n "$VM_INITRD" ]; then qemu_initrd="$VM_INITRD" kvm_virtio=1 -- 2.7.4