Build the ISO as part of the makefile
Change-Id: Id2be52de5c8b86af1ca76cb0e70cd0ed80bac3a2
This commit is contained in:
parent
039d0ad335
commit
c60e97f59d
|
@ -5,4 +5,5 @@
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
BUILD/*
|
BUILD/*
|
||||||
output
|
output
|
||||||
|
suppack/xenserver-suppack
|
||||||
*~
|
*~
|
||||||
|
|
6
Makefile
6
Makefile
|
@ -17,7 +17,10 @@ rpm: output/${RPM_NAME}
|
||||||
|
|
||||||
docs: $(DOC_NAMES:%=output/${PLUGIN_NAME}-${PLUGIN_VERSION}-%.pdf)
|
docs: $(DOC_NAMES:%=output/${PLUGIN_NAME}-${PLUGIN_VERSION}-%.pdf)
|
||||||
|
|
||||||
${BUILDROOT}/${PLUGIN_NAME}: ${BRANDING}
|
iso: plugin_source/deployment_scripts/patchset/xenhost
|
||||||
|
suppack/build-xenserver-suppack.sh
|
||||||
|
|
||||||
|
${BUILDROOT}/${PLUGIN_NAME}: ${BRANDING} iso
|
||||||
mkdir -p ${BUILDROOT}/${PLUGIN_NAME}
|
mkdir -p ${BUILDROOT}/${PLUGIN_NAME}
|
||||||
cp -r plugin_source/* ${BUILDROOT}/${PLUGIN_NAME}
|
cp -r plugin_source/* ${BUILDROOT}/${PLUGIN_NAME}
|
||||||
find ${BUILDROOT}/${PLUGIN_NAME} -type f -print0 | \
|
find ${BUILDROOT}/${PLUGIN_NAME} -type f -print0 | \
|
||||||
|
@ -27,6 +30,7 @@ ${BUILDROOT}/${PLUGIN_NAME}: ${BRANDING}
|
||||||
-e s/@PLUGIN_NAME@/${PLUGIN_NAME}/g {} \
|
-e s/@PLUGIN_NAME@/${PLUGIN_NAME}/g {} \
|
||||||
-e s/@PLUGIN_VERSION@/${PLUGIN_VERSION}/g {} \
|
-e s/@PLUGIN_VERSION@/${PLUGIN_VERSION}/g {} \
|
||||||
-e s/@PLUGIN_REVISION@/${PLUGIN_REVISION}/g {}
|
-e s/@PLUGIN_REVISION@/${PLUGIN_REVISION}/g {}
|
||||||
|
cp suppack/xenapi-plugins-*.iso ${BUILDROOT}/${PLUGIN_NAME}/deployment_scripts/
|
||||||
|
|
||||||
${BUILDROOT}/doc/source ${BUILDROOT}/doc/Makefile: ${BRANDING}
|
${BUILDROOT}/doc/source ${BUILDROOT}/doc/Makefile: ${BRANDING}
|
||||||
mkdir -p ${BUILDROOT}/doc
|
mkdir -p ${BUILDROOT}/doc
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
# build-xenserver-suppack.sh
|
|
||||||
|
|
||||||
This script is used to build iso for XenServer Dom0 xapi plugin.
|
|
||||||
|
|
||||||
It will build both Nova and Neutron Dom0 plugin RPM packages firstly,
|
|
||||||
and then make them in one ISO.
|
|
||||||
|
|
||||||
|
|
||||||
## usage:
|
|
||||||
|
|
||||||
#####./build-xenserver-suppack.sh $xcp-version $xs-build $os-git-branch $os-plugin-version
|
|
||||||
|
|
||||||
* xcp-version: Xen cloud platform version which can be used for this plugin
|
|
||||||
|
|
||||||
* xs-build: XenServer build number
|
|
||||||
|
|
||||||
* os-git-branch: OpenStack branch that's used for building this plugin
|
|
||||||
|
|
||||||
* os-plugin-version: OpenStack XenServer Dom0 plguin version
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*NOTE: If no input parameters given, default values are used*
|
|
||||||
|
|
||||||
*xcp-version: 1.9.0
|
|
||||||
|
|
||||||
*xs-build: 90233c*
|
|
||||||
|
|
||||||
*os-git-branch: stable/liberty*
|
|
||||||
|
|
||||||
*os-plugin-version: 2015.1*
|
|
||||||
|
|
||||||
*os-release: liberty*
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,30 @@
|
||||||
|
# build-xenserver-suppack.sh
|
||||||
|
|
||||||
|
This script is used to build iso for XenServer Dom0 xapi plugin.
|
||||||
|
|
||||||
|
It will build both Nova and Neutron Dom0 plugin RPM packages firstly,
|
||||||
|
and then make them in one ISO.
|
||||||
|
|
||||||
|
|
||||||
|
## usage:
|
||||||
|
|
||||||
|
#####./build-xenserver-suppack.sh OS_RELEASE PLATFORM_VERSION XS_BUILD XS_PLUGIN_VERSION
|
||||||
|
|
||||||
|
* OS_RELEASE: OpenStack branch that's used for building this plugin
|
||||||
|
|
||||||
|
* PLATFORM_VERSION: Xen cloud platform version which can be used for this plugin
|
||||||
|
|
||||||
|
* XS_BUILD: XenServer build number
|
||||||
|
|
||||||
|
* XS_PLUGIN_VERSION: OpenStack XenServer Dom0 plguin version
|
||||||
|
|
||||||
|
|
||||||
|
*NOTE: If no input parameters given, default values are used*
|
||||||
|
|
||||||
|
*OS_RELEASE: mitaka
|
||||||
|
|
||||||
|
*PLATFORM_VERSION: 1.9
|
||||||
|
|
||||||
|
*XS_BUILD: 90233c
|
||||||
|
|
||||||
|
*XS_PLUGIN_VERSION: 2015.1
|
|
@ -17,7 +17,6 @@ set -eux
|
||||||
|
|
||||||
THIS_FILE=$(readlink -f $0)
|
THIS_FILE=$(readlink -f $0)
|
||||||
FUELPLUG_UTILS_ROOT=$(dirname $THIS_FILE)
|
FUELPLUG_UTILS_ROOT=$(dirname $THIS_FILE)
|
||||||
DEPLOYMENT_SCRIPT_ROOT=$(dirname $FUELPLUG_UTILS_ROOT)
|
|
||||||
cd $FUELPLUG_UTILS_ROOT
|
cd $FUELPLUG_UTILS_ROOT
|
||||||
rm -rf xenserver-suppack
|
rm -rf xenserver-suppack
|
||||||
mkdir -p xenserver-suppack && cd xenserver-suppack
|
mkdir -p xenserver-suppack && cd xenserver-suppack
|
||||||
|
@ -26,29 +25,39 @@ mkdir -p xenserver-suppack && cd xenserver-suppack
|
||||||
# =============================================
|
# =============================================
|
||||||
# Configurable items
|
# Configurable items
|
||||||
|
|
||||||
# xenserver version info
|
# OpenStack release
|
||||||
PLATFORM_VERSION=${1:-"1.9"}
|
OS_RELEASE=${1:-"mitaka"}
|
||||||
XS_BUILD=${2:-"90233c"}
|
|
||||||
|
|
||||||
# branch info
|
# xenserver version info
|
||||||
GITBRANCH=${3:-"origin/stable/liberty"}
|
PLATFORM_VERSION=${2:-"1.9"}
|
||||||
|
XS_BUILD=${3:-"90233c"}
|
||||||
|
|
||||||
# nova and neutron xenserver dom0 plugin version
|
# nova and neutron xenserver dom0 plugin version
|
||||||
XS_PLUGIN_VERSION=${4:-"2015.1"}
|
XS_PLUGIN_VERSION=${4:-"2015.1"}
|
||||||
|
|
||||||
# OpenStack release
|
# branch info
|
||||||
OS_RELEASE=${5:-"liberty"}
|
GITBRANCH="origin/stable/$OS_RELEASE"
|
||||||
|
|
||||||
# repository info
|
# repository info
|
||||||
NOVA_GITREPO="https://git.openstack.org/openstack/nova"
|
NOVA_GITREPO="https://git.openstack.org/openstack/nova"
|
||||||
NEUTRON_GITREPO="https://git.openstack.org/openstack/neutron"
|
NEUTRON_GITREPO="https://git.openstack.org/openstack/neutron"
|
||||||
DDK_ROOT_URL="http://copper.eng.hq.xensource.com/builds/ddk-xs6_2.tgz"
|
|
||||||
RPM_BUILDER_REPO="https://github.com/citrix-openstack/xenserver-nova-suppack-builder"
|
RPM_BUILDER_REPO="https://github.com/citrix-openstack/xenserver-nova-suppack-builder"
|
||||||
|
|
||||||
# Update system and install dependencies
|
# Update system and install dependencies
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# =============================================
|
||||||
|
# Install suppack builder
|
||||||
|
set +e
|
||||||
|
rpm -q supp-pack-build-2.1.0-xs55.noarch &> /dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
rpm -i http://coltrane.uk.xensource.com/usr/groups/release/XenServer-7.x/XS-7.0/RTM-125380/binary-packages/RPMS/domain0/RPMS/noarch/supp-pack-build-2.1.0-xs55.noarch.rpm
|
||||||
|
fi
|
||||||
|
rpm -q xcp-python-libs-1.9.0-159.noarch &> /dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
rpm -i http://coltrane.uk.xensource.com/usr/groups/release/XenServer-7.x/XS-7.0/RTM-125380/binary-packages/RPMS/domain0/RPMS/noarch/xcp-python-libs-1.9.0-159.noarch.rpm
|
||||||
|
fi
|
||||||
|
set -e
|
||||||
# =============================================
|
# =============================================
|
||||||
# Check out rpm packaging repo
|
# Check out rpm packaging repo
|
||||||
rm -rf xenserver-nova-suppack-builder
|
rm -rf xenserver-nova-suppack-builder
|
||||||
|
@ -65,14 +74,15 @@ git clone "$NOVA_GITREPO" nova
|
||||||
cd nova
|
cd nova
|
||||||
git checkout -b mos_nova "$GITBRANCH"
|
git checkout -b mos_nova "$GITBRANCH"
|
||||||
# patch xenhost as this file is not merged into this release
|
# patch xenhost as this file is not merged into this release
|
||||||
cp $DEPLOYMENT_SCRIPT_ROOT/patchset/xenhost plugins/xenserver/xenapi/etc/xapi.d/plugins/
|
cp $FUELPLUG_UTILS_ROOT/../plugin_source/deployment_scripts/patchset/xenhost plugins/xenserver/xenapi/etc/xapi.d/plugins/
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
cp -r xenserver-nova-suppack-builder/plugins/xenserver/xenapi/* nova/plugins/xenserver/xenapi/
|
cp -r xenserver-nova-suppack-builder/plugins/xenserver/xenapi/* nova/plugins/xenserver/xenapi/
|
||||||
cd nova/plugins/xenserver/xenapi/contrib
|
cd nova/plugins/xenserver/xenapi/contrib
|
||||||
./build-rpm.sh $XS_PLUGIN_VERSION
|
./build-rpm.sh $XS_PLUGIN_VERSION
|
||||||
cd $FUELPLUG_UTILS_ROOT/xenserver-suppack/
|
cd $FUELPLUG_UTILS_ROOT/
|
||||||
RPMFILE=$(find -name "openstack-xen-plugins-*.noarch.rpm" -print)
|
RPMFILE=$(find -name "openstack-xen-plugins-*.noarch.rpm" -print)
|
||||||
|
cd xenserver-suppack
|
||||||
|
|
||||||
|
|
||||||
# =============================================
|
# =============================================
|
||||||
|
@ -87,23 +97,17 @@ cp -r xenserver-nova-suppack-builder/neutron/* \
|
||||||
neutron/neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/
|
neutron/neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/
|
||||||
cd neutron/neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/contrib
|
cd neutron/neutron/plugins/ml2/drivers/openvswitch/agent/xenapi/contrib
|
||||||
./build-rpm.sh $XS_PLUGIN_VERSION
|
./build-rpm.sh $XS_PLUGIN_VERSION
|
||||||
cd $FUELPLUG_UTILS_ROOT/xenserver-suppack/
|
cd $FUELPLUG_UTILS_ROOT/
|
||||||
|
|
||||||
NEUTRON_RPMFILE=$(find -name "openstack-neutron-xen-plugins-*.noarch.rpm" -print)
|
NEUTRON_RPMFILE=$(find -name "openstack-neutron-xen-plugins-*.noarch.rpm" -print)
|
||||||
|
|
||||||
|
|
||||||
# =============================================
|
# =============================================
|
||||||
# Create Supplemental pack
|
# Create Supplemental pack
|
||||||
rm -rf suppack
|
rm -rf suppack
|
||||||
mkdir suppack
|
mkdir -p suppack
|
||||||
|
|
||||||
DDKROOT=$(mktemp -d)
|
tee buildscript.py << EOF
|
||||||
|
|
||||||
wget -qO - "$DDK_ROOT_URL" | sudo tar -xzf - -C "$DDKROOT"
|
|
||||||
|
|
||||||
sudo mkdir $DDKROOT/mnt/host
|
|
||||||
sudo mount --bind $(pwd) $DDKROOT/mnt/host
|
|
||||||
|
|
||||||
sudo tee $DDKROOT/buildscript.py << EOF
|
|
||||||
from xcp.supplementalpack import *
|
from xcp.supplementalpack import *
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
|
@ -124,14 +128,10 @@ setup(originator='xcp', name='xenapi-plugins-$OS_RELEASE', product='XenServer',
|
||||||
outdir=options.outdir, output=['iso'])
|
outdir=options.outdir, output=['iso'])
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
sudo chroot $DDKROOT python buildscript.py \
|
python buildscript.py \
|
||||||
--pdn=xenserverplugins \
|
--pdn=xenserverplugins \
|
||||||
--pdv=$OS_RELEASE \
|
--pdv=$OS_RELEASE \
|
||||||
--bld=0 \
|
--bld=0 \
|
||||||
--out=/mnt/host/suppack \
|
--out=$FUELPLUG_UTILS_ROOT \
|
||||||
/mnt/host/$RPMFILE \
|
$FUELPLUG_UTILS_ROOT/$RPMFILE \
|
||||||
/mnt/host/$NEUTRON_RPMFILE
|
$FUELPLUG_UTILS_ROOT/$NEUTRON_RPMFILE
|
||||||
|
|
||||||
# Cleanup
|
|
||||||
sudo umount $DDKROOT/mnt/host
|
|
||||||
sudo rm -rf "$DDKROOT"
|
|
Loading…
Reference in New Issue