diff --git a/.gitignore b/.gitignore
index e5d06cdf0..893951706 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
# ignore the documentation build files
docs/build
+# Ignore the temporary file for creating the Release version
+Release.save*
diff --git a/README.rst b/README.rst
index 797f7ba55..883a8aeb8 100644
--- a/README.rst
+++ b/README.rst
@@ -8,7 +8,7 @@ Documentation
xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/
-|docs_latest| |docs_2123| |docs_2122| |docs_212| |docs_211|
+|docs_latest| |docs_2131| |docs_2130| |docs_212| |docs_211|
Open Source License
-------------------
@@ -22,21 +22,21 @@ Developers
Developers and prospective contributors are encouraged to read the `Developers Guide `_
In particular the `GitHub `_ related subsection.
-.. |docs_2123| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.3
- :alt: 2.12.3 documentation status
+.. |docs_2131| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.1
+ :alt: 2.13.1 documentation status
:scale: 100%
- :target: http://xcat-docs.readthedocs.io/en/2.12.3/
-
-.. |docs_2122| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.2
- :alt: 2.12.2 documentation status
+ :target: http://xcat-docs.readthedocs.io/en/2.13.1/
+
+.. |docs_2130| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.0
+ :alt: 2.13.0 documentation status
:scale: 100%
- :target: http://xcat-docs.readthedocs.io/en/2.12.2/
+ :target: http://xcat-docs.readthedocs.io/en/2.13.0/
-.. |docs_212| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.0
- :alt: 2.12.0 documentation status
+.. |docs_212| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12
+ :alt: 2.12 documentation status
:scale: 100%
- :target: http://xcat-docs.readthedocs.io/en/2.12.0/
-
+ :target: http://xcat-docs.readthedocs.io/en/2.12/
+
.. |docs_211| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.11
:alt: 2.11 documentation status
:scale: 100%
diff --git a/Release b/Release
new file mode 100644
index 000000000..a33a0ed75
--- /dev/null
+++ b/Release
@@ -0,0 +1 @@
+snap000000000000
diff --git a/Version b/Version
index 56beced9a..0e83a9a9c 100644
--- a/Version
+++ b/Version
@@ -1 +1 @@
-2.12.4
+2.13.2
diff --git a/build-ubunturepo b/build-ubunturepo
index 6eae01394..5c078b0dd 100755
--- a/build-ubunturepo
+++ b/build-ubunturepo
@@ -4,7 +4,7 @@
# Author: Leonardo Tonetto (tonetto@linux.vnet.ibm.com)
# Revisor: Arif Ali (aali@ocf.co.uk)
#
-#
+#
# Getting Started:
# - Clone the xcat-core git repository int a directory called /src/xcat-core, where
# is the same name as the release dir it is uploaded to xcat.org (e.g devel, 2.9, 2.10)
@@ -15,21 +15,21 @@
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not
# actually build xcat, just uploads the most recent snap build to http://xcat.org/files/xcat/ .
# If not specified, a snap build is assumed, which uploads to https://xcat.org/files/xcat/
-# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this
-# build is a GA candidate build, not to be released yet. This will result in the tarball
+# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this
+# build is a GA candidate build, not to be released yet. This will result in the tarball
# being uploaded to http://xcat.org/files/xcat/repos/apt
-# (but the tarball file name will be like a released tarball, not a snap build).
+# (but the tarball file name will be like a released tarball, not a snap build).
# When you are ready to release this build, use PROMOTE=1 without PREGA
-# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in
+# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in
# prep for a release.
# UP=0 or UP=1 - override the default upload behavior
# LOG= - provide an LOG file option to redirect some output into log file
#
-# For the dependency packages 1. All the xcat dependency deb packages should be uploaded to
+# For the dependency packages 1. All the xcat dependency deb packages should be uploaded to
# "pokgsa/projects/x/xcat/build/ubuntu/xcat-dep/debs/" on GSA
# 2. run ./build-ubunturepo -d
#
-# 3. the built xcat-dep deb packages tarball can be found in "../../xcat-dep"
+# 3. the built xcat-dep deb packages tarball can be found in "../../xcat-dep"
# related to the path of this script
############################
printusage()
@@ -39,10 +39,10 @@ printusage()
echo " -d : Create the xcat-dep repo."
}
# For the purpose of getting the distribution name
-if [[ ! -f /etc/lsb-release ]]; then
+if [[ ! -f /etc/lsb-release ]]; then
echo "ERROR: Could not find /etc/lsb-release, is this script executed on a Ubuntu machine?"
exit 1
-fi
+fi
. /etc/lsb-release
# Check the necessary packages before starting the build
@@ -84,7 +84,7 @@ do
r) r_flag=1
genesis_rpm_path="$OPTARG"
;;
- ?) printusage
+ ?) printusage
exit 2
;;
esac
@@ -96,6 +96,13 @@ if [ -z "$c_flag" -a -z "$d_flag" ];then
exit 2
fi
+USER="xcat"
+SERVER="xcat.org"
+FILES_PATH="files"
+FRS="/var/www/${SERVER}/${FILES_PATH}"
+APT_DIR="${FRS}/xcat"
+APT_REPO_DIR="${APT_DIR}/repos/apt"
+
if [ "$c_flag" -a "$d_flag" ];then
printusage
exit 2
@@ -122,7 +129,7 @@ fi
export HOME=/root
WGET_CMD="wget"
-if [ ! -z ${LOG} ]; then
+if [ ! -z ${LOG} ]; then
WGET_CMD="wget -o ${LOG}"
fi
@@ -204,13 +211,13 @@ then
build_string="Snap_Build"
cur_date=`date +%Y%m%d%H%M`
pkg_version="${ver}-${pkg_type}${cur_date}"
-
+
if [ ! -d ../../$package_dir_name ];then
mkdir -p "../../$package_dir_name"
fi
packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT xCATsn xCAT-test xCAT-buildkit xCAT-vlan xCAT-confluent xCAT-probe"
target_archs=(amd64 ppc64el)
- for file in `echo $packages`
+ for file in $packages
do
file_low=`echo $file | tr '[A-Z]' '[a-z]'`
if [ "$file" = "xCAT" -o "$file" = "xCAT-genesis-scripts" ]; then
@@ -218,13 +225,14 @@ then
else
target_archs="all"
fi
- for target_arch in `echo $target_archs`
+ for target_arch in $target_archs
do
if grep -q $file $update_log || [ "$BUILDALL" == 1 -o "$file" = "perl-xCAT" ]; then
rm -f ../../$package_dir_name/${file_low}_*.$target_arch.deb
#genesis scripts package, don't remove genesis amd64 files
#rm -f ../../$package_dir_name/${file_low}-amd64_*.deb
cd $file
+ CURDIR=$(pwd)
dch -v $pkg_version -b -c debian/changelog $build_string
if [ "$target_arch" = "all" ]; then
#xcat probe use some functions shipped by xCAT, for below reasons we need to copy files to xCAT-probe directory
@@ -232,24 +240,43 @@ then
#2 don't maintain two files for each script
#3 symbolic link can't work during package
if [ $file_low = "xcat-probe" ]; then
- CURDIR=$(pwd)
mkdir -p ${CURDIR}/lib/perl/xCAT/
cp -f ${CURDIR}/../perl-xCAT/xCAT/NetworkUtils.pm ${CURDIR}/lib/perl/xCAT/
cp -f ${CURDIR}/../perl-xCAT/xCAT/GlobalDef.pm ${CURDIR}/lib/perl/xCAT/
cp -f ${CURDIR}/../perl-xCAT/xCAT/ServiceNodeUtils.pm ${CURDIR}/lib/perl/xCAT/
fi
- dpkg-buildpackage -uc -us
+ CURDIR=$(pwd)
+ cp ${CURDIR}/debian/control ${CURDIR}/debian/control.save.998
+ # Magic string used here
+ sed -i -e "s#>= 2.13-snap000000000000#= ${pkg_version}#g" ${CURDIR}/debian/control
+ dpkg-buildpackage -rfakeroot -uc -us
+ mv ${CURDIR}/debian/control.save.998 ${CURDIR}/debian/control
else
if [ "$file" = "xCAT-genesis-scripts" ]; then
- CURDIR=$(pwd)
echo "Rename control file to build pkg: mv ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control"
- mv ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control
+ cp ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control
+ elif [ "$file" = "xCAT" ]; then
+ # shipping bmcsetup and getipmi scripts as part of postscripts
+ files=("bmcsetup" "getipmi")
+ for f in "${files[@]}"; do
+ cp ${CURDIR}/../xCAT-genesis-scripts/bin/$f ${CURDIR}/postscripts/$f
+ sed -i "s/xcat.genesis.$f/$f/g" ${CURDIR}/postscripts/$f
+ done
fi
- dpkg-buildpackage -uc -us -a$target_arch
+ CURDIR=$(pwd)
+ cp ${CURDIR}/debian/control ${CURDIR}/debian/control.save.998
+ # Magic string used here
+ sed -i -e "s#>= 2.13-snap000000000000#= ${pkg_version}#g" ${CURDIR}/debian/control
+ dpkg-buildpackage -rfakeroot -uc -us -a$target_arch
+ mv ${CURDIR}/debian/control.save.998 ${CURDIR}/debian/control
if [ "$file" = "xCAT-genesis-scripts" ]; then
- CURDIR=$(pwd)
echo "Move control file back: mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch}"
- mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch}
+ rm ${CURDIR}/debian/control
+ elif [ "$file" = "xCAT" ]; then
+ files=("bmcsetup" "getipmi")
+ for f in "${files[@]}"; do
+ rm -f ${CURDIR}/postscripts/$f
+ done
fi
fi
rc=$?
@@ -310,7 +337,7 @@ Label: xcat-core bazaar repository
Codename: $dist
Architectures: $tmp_out_arch
Components: main
-Description: Repository automatically genereted conf
+Description: Repository automatically genereted conf
SignWith: yes
__EOF__
@@ -350,12 +377,12 @@ __EOF__
chmod 775 mklocalrepo.sh
- #create the xcat-core.list file
+ #create the xcat-core.list file
cd ../
if ! grep xcat /etc/group ; then
groupadd xcat
- fi
+ fi
chgrp -R root xcat-core
chmod -R g+w xcat-core
@@ -381,7 +408,7 @@ then
#the path of ubuntu xcat-dep deb packages on GSA
GSA="/gsa/pokgsa/projects/x/xcat/build/ubuntu/xcat-dep"
-
+
if [ ! -d $GSA ]; then
echo "build-ubunturepo: It appears that you do not have gsa installed to access the xcat-dep pkgs."
exit 1;
@@ -393,10 +420,10 @@ then
echo "Syncing RPMs from $GSA/ to $local_dep_repo_path/../ ..."
rsync -ilrtpu --delete $GSA/ $local_dep_repo_path/../
- if [ $? -ne 0 ]; then
+ if [ $? -ne 0 ]; then
echo "Error from rsync, cannot continue!"
exit 1
- fi
+ fi
#clean all old files
if [ -e $local_dep_repo_path ];then
@@ -420,7 +447,7 @@ Label: xcat-dep bazaar repository
Codename: $dist
Architectures: $tmp_out_arch
Components: main
-Description: Repository automatically genereted conf
+Description: Repository automatically genereted conf
SignWith: yes
__EOF__
@@ -474,6 +501,32 @@ __EOF__
chgrp root $dep_tar_name
chmod g+w $dep_tar_name
+ # Decide whether to upload or not (default NOT to upload)
+ if [ "$UP" != "1" ]; then
+ echo "Upload not specified, Done! (rerun with UP=1, to upload)"
+ cd $old_pwd
+ exit 0
+ fi
+
+ #upload the dep packages
+ i=0
+ echo "Uploading debs from xcat-dep to ${APT_REPO_DIR}/xcat-dep/ ..."
+ while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete xcat-dep $USER@${SERVER}:${APT_REPO_DIR}/
+ do : ; done
+
+ #upload the tarball
+ i=0
+ echo "Uploading $dep_tar_name to ${APT_DIR}/xcat-dep/2.x_Ubuntu/ ..."
+ while [ $((i+=1)) -le 5 ] && ! rsync -v --force $dep_tar_name $USER@${SERVER}:${APT_DIR}/xcat-dep/2.x_Ubuntu/
+ do : ; done
+
+ #upload the README file
+ cd debs
+ i=0
+ echo "Uploading README to ${APT_DIR}/xcat-dep/2.x_Ubuntu/ ..."
+ while [ $((i+=1)) -le 5 ] && ! rsync -v --force README $USER@${SERVER}:${APT_DIR}/xcat-dep/2.x_Ubuntu/
+ do : ; done
+
cd $old_pwd
exit 0
fi
diff --git a/buildcore.sh b/buildcore.sh
index d9e7a7899..77b44068b 100755
--- a/buildcore.sh
+++ b/buildcore.sh
@@ -8,7 +8,7 @@
# - On AIX: Install openssl and openssh installp pkgs and run updtvpkg. Install from http://www.perzl.org/aix/ :
# apr, apr-util, bash, bzip2, db4, expat, gdbm, gettext, glib2, gmp, info, libidn, neon, openssl (won't
# conflict with the installp version - but i don't think you need this), pcre, perl-DBD-SQLite, perl-DBI,
-# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib.
+# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib.
# Install wget from http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html
# - Run this script from the xcat-core directory. It will create the other directories that are needed.
#
@@ -24,7 +24,7 @@
# (but the tarball file name will be like a released tarball, not a snap build). When you are ready to
# release this build, use PROMOTE=1 without PREGA
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
-# UP=0 or UP=1 - override the default upload behavior
+# UP=0 or UP=1 - override the default upload behavior
# GITUP= - control which rpms get built by specifying a coregitup file
# EMBED= - the environment for which a minimal version of xcat should be built, e.g. zvm or flex
# VERBOSE=1 - to see lots of verbose output
@@ -35,14 +35,17 @@
# The following environment variables can be modified if you need
#
+SCRIPT=$(readlink -f $0)
+SCRIPTPATH=`dirname $SCRIPT`
+
UPLOADUSER=litingt
USER=xcat
SERVER=xcat.org
FILES_PATH="files"
-FRS=/var/www/${SERVER}/${FILES_PATH}
+FRS="/var/www/${SERVER}/${FILES_PATH}"
RELEASE=github.com/xcat2/xcat-core/releases
-YUMDIR=$FRS
+YUMDIR="${FRS}"
YUMREPOURL="http://${SERVER}/${FILES_PATH}/xcat/repos/yum"
if [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
@@ -71,8 +74,8 @@ ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-test xCAT-buildkit xCAT xCATsn
ZVMBUILD="perl-xCAT xCAT-server xCAT-UI"
ZVMLINK="xCAT-client xCAT xCATsn"
# xCAT and xCATsn have PCM specific configuration - conserver-xcat, syslinux-xcat
-# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON)
-# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON)
+# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON)
+# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON)
PCMBUILD="xCAT xCAT-server xCAT-client xCATsn"
PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 xCAT-vlan xCAT-probe"
# Note: for FSM, the FlexCAT rpm is built separately from gsa/git
@@ -103,7 +106,7 @@ OSNAME=$(uname)
if [ "$OSNAME" != "AIX" ]; then
GSA=http://pokgsa.ibm.com/projects/x/xcat/build/linux
-
+
if [ "$(id -u)" == "0" ]; then
# Get a lock, so can not do 2 builds at once
exec 8>/var/lock/xcatbld-$REL.lock
@@ -180,16 +183,42 @@ function setversionvars {
VER=`cat Version`
fi
XCATVER=$VER
- export XCATVER
+ #export XCATVER
SHORTVER=`echo $VER|cut -d. -f 1,2`
SHORTSHORTVER=`echo $VER|cut -d. -f 1`
BUILD_TIME=`date`
BUILD_MACHINE=`hostname`
COMMIT_ID=`git rev-parse --short HEAD`
+ XCAT_RELEASE="snap$(date '+%Y%m%d%H%M')"
+ echo "$XCAT_RELEASE" >Release
}
+RELEASE_FILE="${SCRIPTPATH}/Release"
+RELEASE_FILE_SAVE="${RELEASE_FILE}.save.998"
-if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting
+function internal_backup()
+{
+ # Create a backup for file `Release'
+ if [ ! -f "${RELEASE_FILE_SAVE}" ]
+ then
+ mv "${RELEASE_FILE}" "${RELEASE_FILE_SAVE}"
+ cp "${RELEASE_FILE_SAVE}" "${RELEASE_FILE}"
+ fi
+}
+
+function internal_cleanup()
+{
+ # Restore file `Release'
+ if [ -f "${RELEASE_FILE_SAVE}" ]
+ then
+ mv "${RELEASE_FILE_SAVE}" "${RELEASE_FILE}"
+ fi
+}
+
+internal_backup
+trap internal_cleanup 0
+
+if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting ### @LINE460 ###
# we are doing a snap build
CORE="core-snap"
if [ "$OSNAME" = "AIX" ]; then
@@ -214,33 +243,27 @@ else
echo "Error: Could not determine rpmbuild's root directory."
exit 2
fi
- #echo "source=$source"
fi
-#
-# If no pre-defined update file is provided, do a "git pull" to try and detect
+#
+# If no pre-defined update file is provided, do a "git pull" to try and detect
# if anything has changed in the source directories
-#
+#
SOMETHINGCHANGED=0
if [ "$GIT" = "1" ]; then
- #
- # To enable local sandbox build, GITPULL is disabled by default.
+ #
+ # To enable local sandbox build, GITPULL is disabled by default.
#
if [ "$GITPULL" = "1" ] || [ ${PWD} == *"autobuild"* ]; then
- # TODO: This is really not necessary since the autobuild scripts
- # are building the xcat code in a new directory each time
+ # Do some checking for modified files
MODIFIED_FILES=`git ls-files --modified | tr '\n' ', '`
if [ $MODIFIED_FILES ]; then
- echo "The following files have been modified in the local repository: $MODIFIED_FILES..."
- echo "Not a clean build, aborting..."
- exit 3
+ echo "WARNING: The following files have been modified in the local repository: $MODIFIED_FILES..."
fi
- # check if there's any modifications to git current repo
+ # Do some checking for untracked files
UNTRACKED_FILES=`git ls-files --others | tr '\n' ', '`
if [ -n "$UNTRACKED_FILES" ]; then
- echo "The following files are not tracked in git: $UNTRACKED_FILES..."
- echo "Not a clean build, aborting..."
- exit 3
+ echo "WARNING: The following files are not tracked in git: $UNTRACKED_FILES..."
fi
if [ -z "$GITUP" ]; then
if [ ! -z "$COMMITID" ]; then
@@ -339,7 +362,7 @@ if [ "$OSNAME" != "AIX" ]; then
fi
# Build the xCAT and xCATsn rpms for all platforms
-for rpmname in xCAT xCATsn; do
+for rpmname in xCAT xCATsn; do
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then
UPLOAD=1
@@ -402,48 +425,49 @@ fi
# Prepare the RPMs for pkging and upload
WGET_CMD="wget"
-if [ ! -z ${LOG} ]; then
+if [ ! -z ${LOG} ]; then
WGET_CMD="wget -o ${LOG}"
fi
# get gpg keys in place
if [ "$OSNAME" != "AIX" ]; then
if [ -z "$RPMSIGN" -o "$RPMSIGN" == "1" ]; then
- mkdir -p $HOME/.gnupg
- for i in pubring.gpg secring.gpg trustdb.gpg; do
- if [ ! -f $HOME/.gnupg/$i ] || [ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then
- rm -f $HOME/.gnupg/$i
- ${WGET_CMD} -P $HOME/.gnupg $GSA/keys/$i
- chmod 600 $HOME/.gnupg/$i
+ mkdir -p $HOME/.gnupg
+ for i in pubring.gpg secring.gpg trustdb.gpg; do
+ if [ ! -f $HOME/.gnupg/$i ] ||
+ [ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then
+ rm -f $HOME/.gnupg/$i
+ ${WGET_CMD} -P $HOME/.gnupg $GSA/keys/$i
+ chmod 600 $HOME/.gnupg/$i
+ fi
+ done
+ # tell rpm to use gpg to sign
+ MACROS=$HOME/.rpmmacros
+ if ! $GREP '%_signature gpg' $MACROS 2>/dev/null; then
+ echo '%_signature gpg' >> $MACROS
fi
- done
- # tell rpm to use gpg to sign
- MACROS=$HOME/.rpmmacros
- if ! $GREP '%_signature gpg' $MACROS 2>/dev/null; then
- echo '%_signature gpg' >> $MACROS
+ if ! $GREP '%_gpg_name' $MACROS 2>/dev/null; then
+ echo '%_gpg_name xCAT Security Key' >> $MACROS
+ fi
+ echo "Signing RPMs..."
+ build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
+ build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
+ createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5
+ createrepo --checksum sha $SRCDIR
+ rm -f $SRCDIR/repodata/repomd.xml.asc
+ rm -f $DESTDIR/repodata/repomd.xml.asc
+ gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
+ gpg -a --detach-sign $SRCDIR/repodata/repomd.xml
+ if [ ! -f $DESTDIR/repodata/repomd.xml.key ]; then
+ ${WGET_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
+ fi
+ if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then
+ ${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
+ fi
+ else
+ createrepo --checksum sha $DESTDIR
+ createrepo --checksum sha $SRCDIR
fi
- if ! $GREP '%_gpg_name' $MACROS 2>/dev/null; then
- echo '%_gpg_name xCAT Security Key' >> $MACROS
- fi
- echo "Signing RPMs..."
- build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
- build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
- createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5
- createrepo --checksum sha $SRCDIR
- rm -f $SRCDIR/repodata/repomd.xml.asc
- rm -f $DESTDIR/repodata/repomd.xml.asc
- gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
- gpg -a --detach-sign $SRCDIR/repodata/repomd.xml
- if [ ! -f $DESTDIR/repodata/repomd.xml.key ]; then
- ${WGET_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
- fi
- if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then
- ${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
- fi
- else
- createrepo --checksum sha $DESTDIR
- createrepo --checksum sha $SRCDIR
- fi
fi
# set group and permissions correctly on the built rpms
@@ -455,7 +479,7 @@ chmod -R g+w $DESTDIR
chgrp -R $SYSGRP $SRCDIR
chmod -R g+w $SRCDIR
-else # end of very long if-not-promote
+else # end of very long if-not-promote ### @LINE193 ###
# we are only promoting (not building)
setversionvars
setbranch
@@ -490,7 +514,7 @@ EOF
#!/bin/sh
cd `dirname $0`
REPOFILE=`basename xCAT-*.repo`
-if [[ $REPOFILE == "xCAT-*.repo" ]]; then
+if [[ $REPOFILE == "xCAT-*.repo" ]]; then
echo "ERROR: For xcat-dep, please execute $0 in the correct / subdirectory"
exit 1
fi
@@ -498,10 +522,10 @@ fi
# default to RHEL yum, if doesn't exist try Zypper
#
DIRECTORY="/etc/yum.repos.d"
-if [[ ! -d ${DIRECTORY} ]]; then
- DIRECTORY="/etc/zypp/repos.d"
+if [ ! -d "$DIRECTORY" ]; then
+ DIRECTORY="/etc/zypp/repos.d"
fi
-sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > ${DIRECTORY}/$REPOFILE
+sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > "$DIRECTORY/$REPOFILE"
cd -
EOF2
chmod 775 mklocalrepo.sh
@@ -521,6 +545,7 @@ fi
#
BUILDINFO=$XCATCORE/buildinfo
echo "VERSION=$VER" > $BUILDINFO
+echo "RELEASE=$XCAT_RELEASE" >> $BUILDINFO
echo "BUILD_TIME=$BUILD_TIME" >> $BUILDINFO
echo "BUILD_MACHINE=$BUILD_MACHINE" >> $BUILDINFO
echo "COMMIT_ID=$COMMIT_ID" >> $BUILDINFO
@@ -545,7 +570,7 @@ if [ -n "$UP" ] && [ "$UP" == 0 ]; then
fi
#else we will continue
-# Upload the individual RPMs to xcat.org
+# Upload the individual RPMs to xcat.org
if [ "$OSNAME" = "AIX" ]; then
YUM=aix
else
@@ -561,13 +586,13 @@ if [ "$REL" = "devel" -o "$PREGA" != 1 ]; then
do : ; done
fi
-# Upload the individual source RPMs to xcat.org
+# Upload the individual source RPMs to xcat.org
i=0
echo "Uploading src RPMs from $SRCD to $YUMDIR/$YUM/$REL$EMBEDDIR/ ..."
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $SRCD $USER@$SERVER:$YUMDIR/$YUM/$REL$EMBEDDIR/
do : ; done
-# Upload the tarball to xcat.org
+# Upload the tarball to xcat.org
if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then
# upload tarball to FRS area
i=0
diff --git a/docs/source/advanced/kit/custom/build/createkit.rst b/docs/source/advanced/kit/custom/build/createkit.rst
index 6543a1779..4061fbef4 100644
--- a/docs/source/advanced/kit/custom/build/createkit.rst
+++ b/docs/source/advanced/kit/custom/build/createkit.rst
@@ -56,7 +56,7 @@ The ``buildkit.conf`` file is a sample file that contains a description of all t
kitlicense=ILAN <== the default kit license string is "EPL"
kitdeployparams=pe.env <== pe.env has to define in the other_files dir.
-**kitrepo** --- This stanza defines a Kit Package Repository. There must be at least one kitrepo stanza in a kit build file. If this kit need to support multiple OSes, user should create a separate repository for each OS. Also, no two repositories can be defined with the same OS name, major/minor version, and arch. ::
+**kitrepo** --- This stanza defines a Kit Package Repository. There must be at least one kitrepo stanza in a kit build file. If this kit need to support multiple OSes, user should create a separate repository for each OS. Also, no two repositories can be defined with the same OS name, major version, and arch. ::
kitrepo:
kitrepoid=rhels6_x86_64
@@ -70,6 +70,14 @@ The ``buildkit.conf`` file is a sample file that contains a description of all t
osmajorversion=11
osarch=x86_64
+minor version can be support following format: ::
+
+ osminorversion=2 <<-- minor version has to be exactly matched to 2
+ osminorversion=>=2 <<-- minor version can be 2 or greater than 2
+ osminorversion=<=2 <<-- minor version can be 2 or less than 2
+ osminorversion=>2 <<-- minor version has to be greater than 2
+ osminorversion=<2 <<-- minor version has to be less than 2
+
**kitcomponent** --- This stanza defines one Kit Component. A kitcomponent definition is a way of specifying a subset of the product Kit that may be installed into an xCAT osimage. A kitcomponent may or may not be dependent on other kitcomponents.If user want to build a component which supports multiple OSes, need to create one kitcomponent stanza for each OS. ::
kitcomponent:
diff --git a/docs/source/advanced/networks/edgecore_switches/index.rst b/docs/source/advanced/networks/edgecore_switches/index.rst
new file mode 100644
index 000000000..0c897d340
--- /dev/null
+++ b/docs/source/advanced/networks/edgecore_switches/index.rst
@@ -0,0 +1,7 @@
+ONIE Compatible Bare Metal Switches
+===================================
+
+.. toctree::
+ :maxdepth: 2
+
+ onie_switches.rst
diff --git a/docs/source/advanced/networks/edgecore_switches/onie_switches.rst b/docs/source/advanced/networks/edgecore_switches/onie_switches.rst
new file mode 100644
index 000000000..ba079c23c
--- /dev/null
+++ b/docs/source/advanced/networks/edgecore_switches/onie_switches.rst
@@ -0,0 +1,135 @@
+ONIE compatible bare metal switch
+=================================
+
+The ONIE [1]_. compatible bare metal switches(abbreviated as "ONIE switch") from vendors such as Mellanox or Edgecore are often used as top-of-rack switches in the cluster. Usually, the switches are shipped with a Cumulus Network OS(https://cumulusnetworks.com) and a license pre-installed. In some cases, user may get whitebox switch hardware with a standalone Cumulus installer and license file. This documentation presents a typical workflow on how to setup ONIE switch from white box, then configure and manage the switch with xCAT.
+
+.. [1] Open Network Install Environment: Created by Cumulus Networks, Inc. in 2012, the Open Network Install Environment (ONIE) Project is a small operating system, pre-installed as firmware on bare metal network switches, that provides an environment for automated operating system provisioning.
+
+Create an ONIE switch object
+-------------------------------
+
+The ONIE switch object can be created with the "onieswitch" template shipped in xCAT, the ip address and mac of the switch management ethernet port should be specified : ::
+
+ mkdef edgecoresw1 --template onieswitch arch=armv71 ip=192.168.5.191 mac=8C:EA:1B:12:CA:40
+
+Provision the Cumulus OS on ONIE switch
+---------------------------------------
+
+To provision Cumulus OS, the Cumulus installation file, a binary shipped with the switch, should be saved in a directory exported in the http server.
+
+Run ``chdef`` to specify the "provmethod" attribute of the switch object to the full path of the installation file: ::
+
+ chdef edgecoresw1 netboot=onie provmethod="/install/custom/sw/edgecore/cumulus-linux-3.1.0-bcm-armel-1471981017.dc7e2adzfb43f6b.bin"
+
+Run ``makedhcp`` to prepare the DHCP/BOOTP lease. ::
+
+ makedhcp -a edgecoresw1
+
+The command or operation to start the provision dependes on the status of switch:
+
+1. If the switch is a white box without Cumulus OS installed, simply connect the management ethernet port of the switch to xCAT management node, then power on the switch.
+
+2. If a Cumulus OS has been installed on the switch, you need to login to the switch(the default user is ``cumulus`` and the password is ``CumulusLinux!``) and run a batch of commands: ::
+
+ sudo onie-select -i
+ sudo reboot
+
+If the passwordless-ssh of "root" has been enabled, the commands can be issued with: ::
+
+ xdsh edgecoresw1 "/usr/cumulus/bin/onie-select -i -f;reboot"
+
+After reboot, the switch will enter ONIE install mode and begin the installation. The provision might take about 50 minutes.
+
+
+Switch Configuration
+--------------------
+
+Enable the passwordless ssh for "root"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In a newly installed Cumulus OS, a default user ``cumulus`` will be created, the switch can be accessed via ssh with the default password ``CumulusLinux!``.
+
+The passwordless ssh access of "root" should be enabled with the script ``/opt/xcat/share/xcat/scripts/configonie`` ::
+
+ /opt/xcat/share/xcat/scripts/configonie --switches edgecoresw1 --ssh
+
+After the passwordless access for "root" is setup successfully, the switch can be managed with the node management commands such as ``xdsh``, ``xdcp`` and ``updatenode``, etc.
+
+Licence file installation
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+On the newly installed switch, only the serial console and the management ethernet port are enabled. To activate the data ports, the licence file shipped with the switch should be installed: ::
+
+ xdcp edgecoresw1 /install/custom/sw/edgecore/licensefile.txt /tmp
+ xdsh edgecoresw1 "/usr/cumulus/bin/cl-license -i /tmp/licensefile.txt"
+
+To check whether the license file is installed successfully: ::
+
+ ~: xdsh edgecoresw1 /usr/cumulus/bin/cl-license
+ edgecoresw1: xxx@xx.com|xxxxxxxxxxxxxxx
+
+Reboot the switch to apply the licence file: ::
+
+ xdsh edgecoresw1 reboot
+
+Enable SNMP
+~~~~~~~~~~~
+
+The snmpd in the switch is not enabled by default, xCAT ships a postscript to enable it: ::
+
+ updatenode edgecoresw1 -P enablesnmp
+
+
+Switch Discovery
+----------------
+
+The ONIE switch can be scaned and discovered with ``switchdiscover`` ::
+
+ ~: switchdiscover --range 192.168.23.1-10
+ Discovering switches using nmap for 192.168.23.1-10. It may take long time...
+ ip name vendor mac
+ ------------ ------------ ------------ ------------
+ 192.168.23.1 edgecoresw1 Edgecore switch 8C:EA:1B:12:CA:40
+ Switch discovered: edgecoresw1
+
+Once SNMP on the ONIE switch is enabled, the ONIE switch can be discovered with "snmp" method: ::
+
+ ~: switchdiscover --range 192.168.23.1-10 -s snmp
+ Discovering switches using snmpwalk for 192.168.23.1-10 ....
+ ip name vendor mac
+ ------------ ------------ ------------ ------------
+ 192.168.23.1 edgecoresw1 Linux edgecoresw1 4.1.0-cl-2-iproc #1 SMP Debian 4.1.25-1+cl3u4 (2016-08-13) armv7l 8c:ea:1b:12:ca:40
+ Switch discovered: edgecoresw1
+
+
+Switch Management
+-----------------
+
+File Dispatch
+~~~~~~~~~~~~~
+
+The files can be dispatched to ONIE switches with ``xdcp`` ::
+
+ xdcp edgecoresw1
+
+Refer to :doc:`xdcp manpage ` for details.
+
+Remote Commands
+~~~~~~~~~~~~~~~
+
+Commands can be run on ONIE switches remotely with ``xdsh`` ::
+
+ xdsh edgecoresw1
+
+Refer to :doc:`xdsh manpage ` for details.
+
+Run scripts remotely
+~~~~~~~~~~~~~~~~~~~~
+
+The scripts under "/install/postscripts" can be run on ONIE switches with ``updatenode -P`` ::
+
+ updatenode edgecoresw1 -P