From 1c6e1012dc8d741eb6e66f5c329561a3482cdbd8 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Tue, 11 Jun 2013 18:00:14 +0530 Subject: [PATCH] Fix the build system VM job When both systemvmtemplate64 and systemvmtemplate are present the grep match fails and returns (non-deterministically) the 64bit appliance instead of the 32bit one. Fix this by matching the path separater as well. Signed-off-by: Prasanna Santhanam --- tools/appliance/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index 0216c067a45..b546c3f8f55 100644 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -46,7 +46,7 @@ done # Get appliance uuids machine_uuid=`vboxmanage showvminfo $appliance | grep UUID | head -1 | awk '{print $2}'` hdd_uuid=`vboxmanage showvminfo $appliance | grep vdi | head -1 | awk '{print $8}' | cut -d ')' -f 1` -hdd_path=`vboxmanage list hdds | grep $appliance | grep vdi | cut -c 14-` +hdd_path=`vboxmanage list hdds | grep "$appliance\/" | grep vdi | cut -c 14-` # Remove any shared folder shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host` @@ -67,7 +67,7 @@ mkdir dist set -e # Export for Xen -vboxmanage internalcommands converttoraw "$hdd_path" img.raw +vboxmanage internalcommands converttoraw -format vdi "$hdd_path" img.raw faketime '2010-01-01' vhd-util convert -s 0 -t 1 -i img.raw -o stagefixed.vhd faketime '2010-01-01' vhd-util convert -s 1 -t 2 -i stagefixed.vhd -o $appliance-$build_date-$branch-xen.vhd rm *.bak @@ -75,7 +75,7 @@ bzip2 $appliance-$build_date-$branch-xen.vhd echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2" # Export for KVM -vboxmanage internalcommands converttoraw "$hdd_path" raw.img +vboxmanage internalcommands converttoraw -format vdi "$hdd_path" raw.img qemu-img convert -f raw -c -O qcow2 raw.img $appliance-$build_date-$branch-kvm.qcow2 rm raw.img bzip2 $appliance-$build_date-$branch-kvm.qcow2