|
|
@ -7,8 +7,7 @@ SOURCE=''
|
|
|
|
NO_PAKER_INIT=''
|
|
|
|
NO_PAKER_INIT=''
|
|
|
|
NO_PKG_INSTALL=''
|
|
|
|
NO_PKG_INSTALL=''
|
|
|
|
|
|
|
|
|
|
|
|
# Use $PATH to find packer
|
|
|
|
PACKER='/usr/local/bin/packer'
|
|
|
|
PACKER='packer'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
Usage()
|
|
|
|
Usage()
|
|
|
@ -60,10 +59,18 @@ CheckSource "$SOURCE" || { echo "Unknown source: $SOURCE"; exit 1; }
|
|
|
|
|
|
|
|
|
|
|
|
if [ -z "$NO_PKG_INSTALL" ]; then
|
|
|
|
if [ -z "$NO_PKG_INSTALL" ]; then
|
|
|
|
if which dnf &>/dev/null; then
|
|
|
|
if which dnf &>/dev/null; then
|
|
|
|
sudo dnf install edk2-ovmf libvirt libvirt-daemon-kvm ansible-core libnsl
|
|
|
|
sudo dnf install edk2-ovmf libvirt libvirt-daemon-kvm ansible-core
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
[ -z "$NO_PAKER_INIT" ] && $PACKER init -upgrade . || exit 1
|
|
|
|
[ -z "$NO_PAKER_INIT" ] && $PACKER init -upgrade . || exit 1
|
|
|
|
|
|
|
|
|
|
|
|
PACKER_LOG=1 $PACKER build -only=$SOURCE . 2>$PACKER_LOG_FILE || exit 1
|
|
|
|
PACKER_LOG=1 $PACKER build -only=$SOURCE . 2>$PACKER_LOG_FILE || exit 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$SOURCE" = "vmware-iso.msvsphere-9-ovf-x86_64" ]; then
|
|
|
|
|
|
|
|
OUT_DIR='./vmware-iso.msvsphere-9-ovf-x86_64_ovf'
|
|
|
|
|
|
|
|
rm -rf $OUT_DIR
|
|
|
|
|
|
|
|
mkdir $OUT_DIR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/usr/lib/vmware-ovftool/ovftool --machineOutput --X:logFile=./ovftool.log --X:logLevel=verbose --exportFlags=extraconfig --allowExtraConfig --X:vCloudEnableGuestCustomization ./output-msvsphere-9-ovf-x86_64/msvsphere-9.4.vmx $OUT_DIR || exit 1
|
|
|
|
|
|
|
|
fi
|
|
|
|