File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,17 +63,24 @@ vboxmanage modifyhd $hdd_uuid --compact
6363rm -fr dist * .ova * .vhd * .vdi * .qcow* * .bz2
6464mkdir dist
6565
66+ # Export for Xen
67+ which faketime > /dev/null 2>&1 && which vhd-util > /dev/null 2>&1
68+ if [ $? == 0 ]; then
69+ set -e
70+ vboxmanage internalcommands converttoraw -format vdi " $hdd_path " img.raw
71+ faketime ' 2010-01-01' vhd-util convert -s 0 -t 1 -i img.raw -o stagefixed.vhd
72+ faketime ' 2010-01-01' vhd-util convert -s 1 -t 2 -i stagefixed.vhd -o $appliance -$build_date -$branch -xen.vhd
73+ rm * .bak
74+ bzip2 $appliance -$build_date -$branch -xen.vhd
75+ echo " $appliance exported for Xen: dist/$appliance -$build_date -$branch -xen.vhd.bz2"
76+ else
77+ echo " ** Skipping $appliance export for Xen: faketime or vhd-util command is missing. **"
78+ echo " ** faketime source code is available from https://github.com/wolfcw/libfaketime **"
79+ fi
80+
6681# Exit shell if exporting fails for any format
6782set -e
6883
69- # Export for Xen
70- vboxmanage internalcommands converttoraw -format vdi " $hdd_path " img.raw
71- faketime ' 2010-01-01' vhd-util convert -s 0 -t 1 -i img.raw -o stagefixed.vhd
72- faketime ' 2010-01-01' vhd-util convert -s 1 -t 2 -i stagefixed.vhd -o $appliance -$build_date -$branch -xen.vhd
73- rm * .bak
74- bzip2 $appliance -$build_date -$branch -xen.vhd
75- echo " $appliance exported for Xen: dist/$appliance -$build_date -$branch -xen.vhd.bz2"
76-
7784# Export for KVM
7885vboxmanage internalcommands converttoraw -format vdi " $hdd_path " raw.img
7986qemu-img convert -f raw -c -O qcow2 raw.img $appliance -$build_date -$branch -kvm.qcow2
You can’t perform that action at this time.
0 commit comments