Jeff Schroeder
2008-Jun-25 02:29 UTC
[Ovirt-devel] [PATCH trivial] Create developer appliances under Ubuntu
This small patch allows you to create a wui-appliance developer iso image on Ubuntu 8.04. Also available at: http://www.digitalprognosis.com/opensource/patches/ovirt/0001-Add-support-to-create-wui-appliance-under-Ubuntu.patch Note that the instructions on http://ovirt.org/download.html don't work on Ubuntu. Instead of, "virt-viewer developer", "virt-viewer -c qemu:///system developer" was required. Since the latter would likely work on Ubuntu and Fedora you might put it instead of the former. -- Jeff Schroeder Don't drink and derive, alcohol and analysis don't mix. http://www.digitalprognosis.com -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Add-support-to-create-wui-appliance-under-Ubuntu.patch Type: text/x-diff Size: 2122 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20080624/16bf18ec/attachment.bin>
Hugh O. Brock
2008-Jun-25 13:55 UTC
[Ovirt-devel] [PATCH trivial] Create developer appliances under Ubuntu
On Tue, Jun 24, 2008 at 07:29:05PM -0700, Jeff Schroeder wrote:> This small patch allows you to create a wui-appliance developer iso > image on Ubuntu 8.04. > > Also available at: > http://www.digitalprognosis.com/opensource/patches/ovirt/0001-Add-support-to-create-wui-appliance-under-Ubuntu.patch > > Note that the instructions on http://ovirt.org/download.html don't > work on Ubuntu. > > Instead of, "virt-viewer developer", "virt-viewer -c qemu:///system > developer" was required. Since the latter would > likely work on Ubuntu and Fedora you might put it instead of the former. > > > -- > Jeff Schroeder > > Don't drink and derive, alcohol and analysis don't mix. > http://www.digitalprognosis.com> From 91ddc0b4ad127521dd5c19ddfc3ccd6b2bfc5bba Mon Sep 17 00:00:00 2001 > From: Jeff Schroeder <jeffschroeder at computer.org> > Date: Tue, 24 Jun 2008 19:23:21 -0700 > Subject: [PATCH] Add support to create wui appliance under Ubuntu > > Signed-off-by: Jeff Schroeder <jeffschroeder at computer.org> > --- > 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() { > <on_reboot>restart</on_reboot> > <on_crash>destroy</on_crash> > <devices> > - <emulator>/usr/bin/qemu-kvm</emulator> > + <emulator>$KVM_BINARY</emulator> > <interface type='network'> > <mac address='00:16:3e:12:34:$last_mac'/> > <source network='dummybridge'/> > @@ -155,7 +155,7 @@ gen_app() { > <on_reboot>restart</on_reboot> > <on_crash>destroy</on_crash> > <devices> > - <emulator>/usr/bin/qemu-kvm</emulator> > + <emulator>$KVM_BINARY</emulator> > <disk type='file' device='disk'> > <source file='$disk'/> > <target dev='hda'/> > @@ -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 >This looks good to me on its face. Jim, as our resident portability expert, could you comment and ACK if you're happy with it? Take care, --Hugh
Chris Lalancette
2008-Jun-26 14:37 UTC
[Ovirt-devel] [PATCH trivial] Create developer appliances under Ubuntu
Jeff Schroeder wrote:> This small patch allows you to create a wui-appliance developer iso > image on Ubuntu 8.04. > > Also available at: > http://www.digitalprognosis.com/opensource/patches/ovirt/0001-Add-support-to-create-wui-appliance-under-Ubuntu.patch > > Note that the instructions on http://ovirt.org/download.html don't > work on Ubuntu. > > Instead of, "virt-viewer developer", "virt-viewer -c qemu:///system > developer" was required. Since the latter would > likely work on Ubuntu and Fedora you might put it instead of the former.I concur with Alan. Quick smoke-testing shows that it doesn't seem to affect Fedora, and if it helps out with Debian/Ubuntu, I'm all for it. ACK Chris Lalancette
Jim Meyering
2008-Jun-27 18:37 UTC
[Ovirt-devel] [PATCH trivial] Create developer appliances under Ubuntu
"Jeff Schroeder" <jeffschroed at gmail.com> wrote:> This small patch allows you to create a wui-appliance developer iso > image on Ubuntu 8.04....> 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...> # 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" > fiHi Jeff A minor detail: &> is a bashism, so better avoided: $ bash -c '(echo bar 1>&2) &> foo' $ dash -c '(echo bar 1>&2) &> foo' bar Use "> /dev/null 2>&1" instead. A naming suggestion: call the new variable $KVM, since that file needn't be a binary. An efficiency/readability suggestion: don't fork a whole new shell for $CHECK: (which could be usefully renamed) Also, no need to "echo $?". dpkg -l $PACKAGES > /dev/null 2>&1; have_required_packages=$? Very minor readability nit: use single quotes for literals so readers don't wonder if you used double quotes because there are $var or `...` expansions: PACKAGES='libvirt0 libvirt-bin kvm qemu virt-manager virt-viewer' maintainability: since this comment is obviously intended to be temporary, # Works in Ubuntu 8.04. Still needs testing in Debian Mark it with something like "FIXME" so it will less likely to be forgotten. # Works in Ubuntu 8.04. FIXME: test in Debian Finally, please don't add trailing blanks (after "die...\nfi").