mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Add check for some cli programs
Add check for faketime and vhd-util for xen export.
This commit is contained in:
parent
de44a77878
commit
29c39e8f4e
@ -63,17 +63,24 @@ vboxmanage modifyhd $hdd_uuid --compact
|
||||
rm -fr dist *.ova *.vhd *.vdi *.qcow* *.bz2
|
||||
mkdir dist
|
||||
|
||||
# Export for Xen
|
||||
which faketime >/dev/null 2>&1 && which vhd-util >/dev/null 2>&1
|
||||
if [ $? == 0 ]; then
|
||||
set -e
|
||||
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
|
||||
bzip2 $appliance-$build_date-$branch-xen.vhd
|
||||
echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2"
|
||||
else
|
||||
echo "** Skipping $appliance export for Xen: faketime or vhd-util command is missing. **"
|
||||
echo "** faketime source code is available from https://github.com/wolfcw/libfaketime **"
|
||||
fi
|
||||
|
||||
# Exit shell if exporting fails for any format
|
||||
set -e
|
||||
|
||||
# Export for Xen
|
||||
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
|
||||
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 -format vdi "$hdd_path" raw.img
|
||||
qemu-img convert -f raw -c -O qcow2 raw.img $appliance-$build_date-$branch-kvm.qcow2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user