From 91ddc0b4ad127521dd5c19ddfc3ccd6b2bfc5bba Mon Sep 17 00:00:00 2001 From: Jeff Schroeder Date: Tue, 24 Jun 2008 19:23:21 -0700 Subject: [PATCH] Add support to create wui appliance under Ubuntu Signed-off-by: Jeff Schroeder --- wui-appliance/create-wui-appliance.sh | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/wui-appliance/create-wui-appliance.sh b/wui-appliance/create-wui-appliance.sh index 116d572..ac13805 100755 --- a/wui-appliance/create-wui-appliance.sh +++ b/wui-appliance/create-wui-appliance.sh @@ -122,7 +122,7 @@ gen_fake_managed_node() { restart destroy - /usr/bin/qemu-kvm + $KVM_BINARY @@ -155,7 +155,7 @@ gen_app() { restart destroy - /usr/bin/qemu-kvm + $KVM_BINARY @@ -179,8 +179,20 @@ if [ $( id -u ) -ne 0 ]; then fi # now make sure the packages we need are installed -rpm -q libvirt -q kvm -q virt-manager -q virt-viewer >& /dev/null -if [ $? -ne 0 ]; then +if [ -e /etc/redhat-release ]; then + PACKAGES="libvirt kvm virt-manager virt-viewer" + CHECK=$(rpm $(printf " -q %s " "$PACKAGES") &> /dev/null; echo $?) + KVM_BINARY=/usr/bin/qemu-kvm +elif [ -e /etc/debian_version ]; then + # Works in Ubuntu 8.04. Still needs testing in Debian + PACKAGES="libvirt0 libvirt-bin kvm qemu virt-manager virt-viewer" + CHECK=$(dpkg -l $PACKAGES &> /dev/null; echo $?) + KVM_BINARY=/usr/bin/kvm +else + die "Not a supported system" +fi + +if [ $CHECK -ne 0 ]; then # one of the previous packages wasn't installed; bail out die "Must have the libvirt, kvm, virt-manager, and virt-viewer packages installed" fi -- 1.5.4.3