Compare commits
400 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c6b43f60f | |||
| d569677196 | |||
| f17024abe5 | |||
| ec114e2fde | |||
| 7a33da03de | |||
| 1138ab87d4 | |||
| 0a226feef7 | |||
| efa051a181 | |||
| d5ef187fe1 | |||
| bfee3cf96a | |||
| 6801e064cf | |||
| db6fc2c563 | |||
| 89f238f5cd | |||
| cdb7aa0ab6 | |||
| 91a1736e61 | |||
| 3e02ce0e4f | |||
| e2e7c0b35c | |||
| beadfcd627 | |||
| dfd91e4d4a | |||
| 64af7cbc19 | |||
| 2d555c821a | |||
| 786cfde0a8 | |||
| e1c60cb830 | |||
| b7daccfe36 | |||
| 571487bf46 | |||
| 85b4be21c5 | |||
| aca5b290c2 | |||
| 97e50a2aae | |||
| 4a30157492 | |||
| c72f824670 | |||
| e30d85bf2d | |||
| 1d37352e85 | |||
| c0e81dc8ad | |||
| bd67c19612 | |||
| 0768e46b91 | |||
| c1a25ac668 | |||
| 3995fae3b6 | |||
| 2d0f36801a | |||
| 66e30f3a17 | |||
| cb415007ba | |||
| 0a89522d18 | |||
| 8990dc25ff | |||
| c256f1c0fe | |||
| c5e3b1a06d | |||
| acbcc58858 | |||
| be6a71e607 | |||
| f69b6ac018 | |||
| 7ace2412fe | |||
| ea3431f5a7 | |||
| 8360cddd12 | |||
| d3043285f2 | |||
| 28d75b347f | |||
| 9a639e015e | |||
| ce4e807a04 | |||
| e05b6c62b2 | |||
| e705fc08e9 | |||
| 8f37638f66 | |||
| e0b1400489 | |||
| fb0028623a | |||
| 528ecb3e56 | |||
| b5afe5e3b9 | |||
| 525d1dcb63 | |||
| e01282f5eb | |||
| a1fdfce779 | |||
| 85e66bdcfc | |||
| 2d9139705f | |||
| e927682f24 | |||
| 69812d996a | |||
| ff67a1d864 | |||
| a9e5f73abd | |||
| 9e26b11fe2 | |||
| ef9db848fd | |||
| a2c0e85f08 | |||
| 265cbde35b | |||
| 9eda055ddd | |||
| ce3ea63680 | |||
| 83e983106c | |||
| 30d3984998 | |||
| 1e1b6417d7 | |||
| d8824a068f | |||
| 70414d2b08 | |||
| 236a415bf7 | |||
| 4c82d3101f | |||
| 4c2f0c2ceb | |||
| 6b9baa15e5 | |||
| f93460d4f6 | |||
| b5f73f7a23 | |||
| 43c44ee347 | |||
| 25eb443587 | |||
| e899e3d62b | |||
| 52620d3edd | |||
| d7987c5e46 | |||
| e9441739a0 | |||
| abf400572b | |||
| 5cabc2b9ef | |||
| 1d11ddb65f | |||
| 03eb28bb46 | |||
| 430d5c0c09 | |||
| ea966447d6 | |||
| 1533cf185c | |||
| 749cf2f240 | |||
| c06c616558 | |||
| 7dbd6aaf3e | |||
| 51fe0df1c4 | |||
| 045b83d76d | |||
| 3d8c237a01 | |||
| 5ac785b6f6 | |||
| 4768f5adba | |||
| 18193f31a4 | |||
| aad6c3c311 | |||
| 42ae915878 | |||
| e5755dbc64 | |||
| 4b2e5beb12 | |||
| ee48169642 | |||
| f20e77dd93 | |||
| cdf3b7aeb2 | |||
| 1a2383d9f8 | |||
| 037f32bd54 | |||
| 61158bbfcf | |||
| 6a8534a0f6 | |||
| f19761ef71 | |||
| a4187efcb2 | |||
| 922921a739 | |||
| cee8a7a73b | |||
| 474c298630 | |||
| 0575001ef2 | |||
| 3ceb5fe7e4 | |||
| d00ded29a2 | |||
| 4312042e2a | |||
| d129856a4f | |||
| 5c1c601119 | |||
| a2a91cdd21 | |||
| 4940906c05 | |||
| b857a25081 | |||
| 83bed2cb04 | |||
| 079665a651 | |||
| bd38609ba1 | |||
| 5777cd4dd7 | |||
| bab48dbc50 | |||
| 6c1a840369 | |||
| 2830bab937 | |||
| eda584a0f5 | |||
| 67787dad86 | |||
| 4c6b234e13 | |||
| d095c0fc5f | |||
| cab8191379 | |||
| 586c212d93 | |||
| 8d8c38d3b4 | |||
| c9778bf3f7 | |||
| 029df230d6 | |||
| 1eb4411009 | |||
| d4e79d7a95 | |||
| 3bcdc5e371 | |||
| cfed625f4c | |||
| c6672270ea | |||
| f0161a5c45 | |||
| 2d6b18cfc9 | |||
| eb3ccaa773 | |||
| de9fbe4f82 | |||
| 0a4d227a2d | |||
| 9d374c1421 | |||
| ef8f762590 | |||
| 95c6a3d93d | |||
| c519c111ec | |||
| 717cd66082 | |||
| 4a572f5015 | |||
| 0344b08ba1 | |||
| 4bde0a0ded | |||
| c602006c04 | |||
| 7eaed897e8 | |||
| 16642a0810 | |||
| 4337554e71 | |||
| 1dc28f2540 | |||
| 43826a511a | |||
| 57707391b4 | |||
| f211c92b82 | |||
| 17abb515db | |||
| 3c81f67a62 | |||
| 221a44d1bd | |||
| 45fb564db6 | |||
| 5a4e5a3559 | |||
| 2fbdba3fe3 | |||
| c4e7fe9f02 | |||
| df466fe7b6 | |||
| 8df12f9219 | |||
| bc44b57b73 | |||
| dea73cdb01 | |||
| 621ad77911 | |||
| 29945eb0d1 | |||
| 111782a728 | |||
| 4b09b8f926 | |||
| d07d624b01 | |||
| 10ad3b6945 | |||
| 46ad21d88c | |||
| 2de350cf80 | |||
| 2ce147d84b | |||
| e05797bb60 | |||
| 774c178272 | |||
| 5f8ed93998 | |||
| 50445cdc26 | |||
| 4de0a47920 | |||
| c4c942fbab | |||
| 5d3e1f3d53 | |||
| fbfe3777b4 | |||
| 907b14ba9d | |||
| ede3d3ced7 | |||
| e59dc8a9ce | |||
| f5ed6658ec | |||
| 2abdf800d9 | |||
| 180eb62560 | |||
| e6a50b4215 | |||
| e2aa75569f | |||
| a0d1d5b41a | |||
| 80b20c444f | |||
| 15447d0398 | |||
| 51d4c30e4a | |||
| 7ab0cf1ffd | |||
| 20ff90225a | |||
| 04e63c307e | |||
| 6d6ab9b951 | |||
| 9765d32dc6 | |||
| 86b29b0edb | |||
| 4613a85c23 | |||
| f2eb32b3c9 | |||
| 93bcbc5e71 | |||
| 361cd8c42b | |||
| 6ae785af6e | |||
| a288b88bd9 | |||
| 1e797ed26b | |||
| 89dba8092d | |||
| 2195f9261e | |||
| 87a957642f | |||
| a5fd918ba7 | |||
| 7f90243337 | |||
| 11ecff91d4 | |||
| d342bab175 | |||
| 9c367350c9 | |||
| 002b2ec9df | |||
| 59e4b3df05 | |||
| 2bdbf688ab | |||
| 845774a571 | |||
| 8612355df9 | |||
| 002d093a37 | |||
| b787fc643b | |||
| 0073bfd6b3 | |||
| 09d423997e | |||
| 9a7dba6d86 | |||
| 7d2ad45443 | |||
| 1c2f665993 | |||
| 706eca1ef7 | |||
| 0d195918e3 | |||
| dc488dfc08 | |||
| 2a5ae3d1b4 | |||
| acd8d676c1 | |||
| 01f1a52525 | |||
| 46a89fa1c6 | |||
| d53284d914 | |||
| e36f3e5684 | |||
| 17ae3213cd | |||
| 111793e3a6 | |||
| f9069a18e0 | |||
| a0bb9e1665 | |||
| 92ecdf8b0b | |||
| 2c8c8257a8 | |||
| e706f5cbd4 | |||
| 37c015a7ca | |||
| 200e369d5d | |||
| a9829ab17b | |||
| b6ff220b06 | |||
| 6b2012900a | |||
| e5011c3919 | |||
| 72cf13e8e3 | |||
| 2c6158570b | |||
| 5be856cddc | |||
| cbf108f8b8 | |||
| 6e9b41d4bc | |||
| 0f17710b39 | |||
| 0308e63ef4 | |||
| 6a8f62a2ac | |||
| 05bc99e483 | |||
| d9725518d8 | |||
| 6116ea5bd7 | |||
| 9aacc4d203 | |||
| b79f6bb7ee | |||
| 651e259871 | |||
| 889ef5508e | |||
| dee47b2c55 | |||
| 39230d1672 | |||
| a5a4feb798 | |||
| 5a21746fe8 | |||
| b22f425c3e | |||
| 56684fb6da | |||
| d49c882778 | |||
| e166962d49 | |||
| a19b640ba4 | |||
| 9581e25412 | |||
| a035d397ce | |||
| 6208b57203 | |||
| 05687101ee | |||
| 9d01a63782 | |||
| 73eae21f3c | |||
| dabd5d5f09 | |||
| bcfacb1dbf | |||
| bbd1498272 | |||
| 311a25a05a | |||
| cece5458f9 | |||
| 816d98fb73 | |||
| 2192c8e148 | |||
| 2e9d460772 | |||
| 3c4b71e06a | |||
| adfb223fd4 | |||
| 38b5874b32 | |||
| 2142411c43 | |||
| b9034410a9 | |||
| a840161de9 | |||
| 3d98c4fe6e | |||
| 2b61bf2c91 | |||
| 200373f48d | |||
| 6bbbfeff81 | |||
| ba1cadb6e9 | |||
| 68f86b703b | |||
| 413f6c0010 | |||
| a3caf9e5aa | |||
| b5d6951f62 | |||
| 1c1e78bf89 | |||
| 116e770bfb | |||
| bf2aa12fd3 | |||
| afe5dd5024 | |||
| dbdd43de8d | |||
| cfcca53716 | |||
| 85828d24aa | |||
| bd812ab851 | |||
| daf319a402 | |||
| 9154b2edc9 | |||
| e69cdc2d5f | |||
| d5c6ad426c | |||
| 4650f29bb7 | |||
| 6329990417 | |||
| 1acb9398d6 | |||
| fa89345a5c | |||
| bb1f68f440 | |||
| b4ad09c0ce | |||
| 3535bd753d | |||
| b6e467acff | |||
| a838da18d7 | |||
| 40dc51dd1b | |||
| 8bc4dd7476 | |||
| 04268e1f5d | |||
| f942046a68 | |||
| 24003e0910 | |||
| 1e2c70f859 | |||
| 1f69def767 | |||
| a60ce4d483 | |||
| 4b7181dfee | |||
| f9f370cd5f | |||
| 8b1334a3d6 | |||
| 23f7cd6d36 | |||
| 3f986ecf29 | |||
| 2a55eb6ee5 | |||
| 6f0b9a6eec | |||
| 0835970d7f | |||
| d2e361331a | |||
| 52db6d0e9a | |||
| 204d1a8df5 | |||
| cad9eca293 | |||
| 612b2d8098 | |||
| efed7f2b66 | |||
| 5f6ccbff86 | |||
| 12bf36dfc0 | |||
| ab2cfba24a | |||
| c4dc675a87 | |||
| fde574046e | |||
| 8fbae2dfa7 | |||
| 48872e61fd | |||
| a215989fb3 | |||
| 11c5f32f0e | |||
| 15616a151e | |||
| fa783ea9b7 | |||
| 8066ec5c07 | |||
| e665d1dad8 | |||
| 318d33b9b1 | |||
| eda83f4580 | |||
| 23625b7a48 | |||
| af9c8731ee | |||
| ae99ef1a30 | |||
| 5b29162989 | |||
| a6eea2c977 | |||
| 9c69cb198a | |||
| 8efa7cdd67 | |||
| f6c999796f | |||
| 3f6d09e554 | |||
| 615363b332 | |||
| c2238857f4 | |||
| 602854999a | |||
| 72f1715eb0 | |||
| 2af0eff7ed | |||
| 4a241ef34e | |||
| 8c58adf552 | |||
| 6baabbe7bc | |||
| 4c5f1d54d6 |
+259
-155
@@ -1,264 +1,368 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
# Update GSA Ubuntu Repositories or create a local repository
|
||||
#
|
||||
# Author: Leonardo Tonetto (tonetto@linux.vnet.ibm.com)
|
||||
# Revisor: Arif Ali (aali@ocf.co.uk)
|
||||
#
|
||||
# After running this script, add the following line to
|
||||
# /etc/apt/sources.list for local repository
|
||||
# deb file://<core_repo_path>/xcat-core/ maverick main
|
||||
# deb file://<dep_repo_path>/xcat-dep/ maverick main
|
||||
#
|
||||
# Getting Started:
|
||||
# - Check out the xcat-core svn repository (either the trunk or a branch) into
|
||||
# a dir called <rel>/src/xcat-core, where <rel> is the same as the release dir it will be
|
||||
# uploaded to in sourceforge (e.g. devel, or 2.3).
|
||||
# - You probably also want to put root's pub key from the build machine onto sourceforge for
|
||||
# the upload user listed below, so you don't have to keep entering pw's. You can do this
|
||||
# at https://sourceforge.net/account/ssh
|
||||
# - make sure reprepro is installed on the build machine
|
||||
# - Run this script from the local svn repository you just created. It will create the other directories that are needed.
|
||||
|
||||
# Usage: attr=value attr=value ... ./build-ubunturepo { -c | -d }
|
||||
# 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 https://sourceforge.net/projects/xcat/files/xcat/ .
|
||||
# If not specified, a snap build is assumed, which uploads to https://sourceforge.net/projects/xcat/files/yum/
|
||||
# or https://sourceforge.net/projects/xcat/files/aix/.
|
||||
# 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
|
||||
# https://sourceforge.net/projects/xcat/files/yum/ or https://sourceforge.net/projects/xcat/files/aix/
|
||||
# (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
|
||||
#
|
||||
# For the dependency packages 1. please run the build-debs-all in xcat-dep svn first( there is usage detail in that script)
|
||||
# 2. run ./build-ubunturepo -d
|
||||
#
|
||||
############################
|
||||
printusage()
|
||||
{
|
||||
printf "Usage: %s {-c | -d} \n" $(basename $0) >&2
|
||||
echo " -c : Build the xcat core packages and create the repo"
|
||||
echo " -d : Create the xcat dep repo. Building the xcat dep packages can refer \"build-debs-all\" from svn"
|
||||
}
|
||||
# For the purpose of getting the distribution name
|
||||
. /etc/lsb-release
|
||||
|
||||
# Supported distributions
|
||||
dists="maverick natty oneiric precise "
|
||||
dists="maverick natty oneiric precise"
|
||||
|
||||
a_flag= # automatic flag - only update if repo was updated
|
||||
c_flag= # xcat-core (trunk-delvel) path
|
||||
d_flag= # xcat-dep (trunk) path
|
||||
u_flag= # gsa user-id
|
||||
p_flag= # gsa passwd
|
||||
local_flag= # build the repository localy
|
||||
r_flag= #genesis base rpm package path
|
||||
|
||||
while getopts 'c:d:u:p:l:a' OPTION
|
||||
while getopts 'cdr:' OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
c) c_flag=1
|
||||
xcat_core_path="$OPTARG"
|
||||
;;
|
||||
d) d_flag=1
|
||||
xcat_dep_path="$OPTARG"
|
||||
;;
|
||||
u) u_flag=1
|
||||
gsa_id="$OPTARG"
|
||||
;;
|
||||
p) p_flag=1
|
||||
gsa_passwd="$OPTARG"
|
||||
;;
|
||||
l) local_flag=1
|
||||
local_repo_path="$OPTARG"
|
||||
;;
|
||||
a) a_flag=1
|
||||
;;
|
||||
|
||||
?) printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] { -l <local-repo_path> | [-u <gsa_id> -p <gsa_passwd>] } [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
r) r_flag=1
|
||||
genesis_rpm_path="$OPTARG"
|
||||
;;
|
||||
?) printusage
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
if [ -z "$c_flag" -a -z "$d_flag" ]
|
||||
then
|
||||
printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] { -l <local-repo_path> | [-u <gsa_id> -p <gsa_passwd>] } [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
exit 2
|
||||
fi
|
||||
if [ ! -d $xcat_core_path ]
|
||||
then
|
||||
printf "%s: No such directory\n" "$xcat_core_path" >&2
|
||||
if [ -z "$c_flag" -a -z "$d_flag" ];then
|
||||
printusage
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$d_flag" ]
|
||||
then
|
||||
if [ ! -d $xcat_dep_path ]
|
||||
then
|
||||
printf "%s: No such directory\n" "$xcat_dep_path" >&2
|
||||
exit 2
|
||||
fi
|
||||
if [ "$c_flag" -a "$d_flag" ];then
|
||||
printusage
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$local_flag" ]
|
||||
then
|
||||
repo_xcat_core_path=$local_repo_path"/xcat-core"
|
||||
repo_xcat_dep_path=$local_repo_path"/xcat-dep"
|
||||
uploader="bp-sawyers"
|
||||
# Find where this script is located to set some build variables
|
||||
old_pwd=`pwd`
|
||||
cd `dirname $0`
|
||||
curdir=`pwd`
|
||||
|
||||
#define the dep source code path, core build target path and dep build target path
|
||||
local_core_repo_path="$curdir/../../xcat-core"
|
||||
xcat_dep_path="$curdir/../../../xcat-dep/src/xcat-dep"
|
||||
local_dep_repo_path="$curdir/../../../xcat-dep/xcat-dep"
|
||||
|
||||
#define the url used for creating the source list file
|
||||
#define the upload dir used for uploading packages
|
||||
sf_repo_url="https://sourceforge.net/projects/xcat/files/ubuntu"
|
||||
sf_dir="/home/frs/project/x/xc/xcat"
|
||||
|
||||
if [ "$PROMOTE" = 1 ]; then
|
||||
upload_dir="xcat-core"
|
||||
tar_name="xcat-core-$ver.tar.bz2"
|
||||
else
|
||||
if [ -z "$u_flag" ]
|
||||
then
|
||||
if [ "$p_flag" ]
|
||||
then
|
||||
printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] { -l <local-repo_path> | [-u <gsa_id> -p <gsa_passwd>] } [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
exit 2
|
||||
fi
|
||||
echo -n "GSA id: "
|
||||
read gsa_id
|
||||
echo -n "GSA password: "
|
||||
stty -echo; read gsa_passwd; stty echo;
|
||||
echo ""; echo "";
|
||||
fi
|
||||
|
||||
repo_xcat_core_path="`pwd`/gsa-repo_temp/xcat-core"
|
||||
repo_xcat_dep_path="`pwd`/gsa-repo_temp/xcat-dep"
|
||||
upload_dir="core-snap"
|
||||
tar_name="core-debs-snap.tar.bz2"
|
||||
fi
|
||||
|
||||
if [ "$a_flag" ]
|
||||
then
|
||||
touch svcupdate.trace
|
||||
SVCUP='svcupdate.trace'
|
||||
svn update $xcat_core_path 1> $SVCUP 2>&1
|
||||
if ! grep 'Tree is up to date' $SVCUP
|
||||
then
|
||||
update_core=1
|
||||
else
|
||||
update_core=
|
||||
fi
|
||||
rm -f $SVCUP
|
||||
else
|
||||
update_core=1
|
||||
#use flock to only one person build at the same time
|
||||
# Get a lock, so can not do 2 builds at once
|
||||
exec 8>/var/lock/xcatbld.lock
|
||||
if ! flock -n 8; then
|
||||
echo "Can't get lock /var/lock/xcatbld.lock. Someone else must be doing a build right now. Exiting...."
|
||||
exit 1
|
||||
fi
|
||||
if [ "$c_flag" -a "$update_core" ]
|
||||
|
||||
export HOME=/root
|
||||
|
||||
#sync the gpg key to the build machine local
|
||||
gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux
|
||||
mkdir -p $HOME/.gnupg
|
||||
for key_name in pubring.gpg secring.gpg trustdb.gpg; do
|
||||
if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then
|
||||
rm -f $HOME/.gnupg/$key_name
|
||||
wget -P $HOME/.gnupg $gsa_url/keys/$key_name
|
||||
chmod 600 $HOME/.gnupg/$key_name
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$c_flag" ]
|
||||
then
|
||||
# strip the /src/xcat-core from the end of the dir to get the next dir up and use as the release
|
||||
if [ -z "$REL" ]; then
|
||||
t=${curdir%/src/xcat-core}
|
||||
REL=`basename $t`
|
||||
fi
|
||||
|
||||
#get the version
|
||||
echo "svn --quiet update Version"
|
||||
svn --quiet up Version
|
||||
ver=`cat Version`
|
||||
short_ver=`cat Version|cut -d. -f 1,2`
|
||||
short_short_ver=`cat Version|cut -d. -f 1`
|
||||
|
||||
#TODO: define the core path and tarball name
|
||||
tarball_name="core-debs-snap.tar.bz2"
|
||||
|
||||
#update the code from svn
|
||||
svn_up_log="../coresvnup"
|
||||
echo "svn update > $svn_up_log"
|
||||
svn update > $svn_up_log
|
||||
|
||||
#makesure the code change status
|
||||
code_change=0
|
||||
if ! grep -q 'At revision' $svn_up_log;then
|
||||
code_change=1
|
||||
fi
|
||||
|
||||
if [ $code_change == 0 -a "$UP" != 1 -a "$BUILDALL" != 1 ]; then
|
||||
echo "Nothing new detected"
|
||||
exit 0
|
||||
fi
|
||||
echo "###############################"
|
||||
echo "# Building xcat-core packages #"
|
||||
echo "###############################"
|
||||
|
||||
CMD_PATH=`pwd`
|
||||
cd $xcat_core_path
|
||||
./build-debs-all "snap" "Nightly_Builds"
|
||||
#the package type: local | snap | alpha
|
||||
#the build introduce stirng
|
||||
pkg_type="snap"
|
||||
build_string="Snap_Build"
|
||||
cur_date=`date +%Y%m%d`
|
||||
pkg_version="${short_ver}-${pkg_type}${cur_date}"
|
||||
|
||||
if [ ! -d ../../debs ];then
|
||||
mkdir -p "../../debs"
|
||||
fi
|
||||
packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test"
|
||||
|
||||
for file in `echo $packages`
|
||||
do
|
||||
file_low=`echo $file | tr '[A-Z]' '[a-z]'`
|
||||
if grep -q $file $svn_up_log || [ "$BUILDALL" == 1 ]; then
|
||||
rm -f ../../debs/${file_low}_*.deb
|
||||
#only for genesis package
|
||||
rm -f ../../debs/${file_low}-amd64_*.deb
|
||||
cd $file
|
||||
dch -v $pkg_version -b -c debian/changelog $build_string
|
||||
dpkg-buildpackage -uc -us
|
||||
rc=$?
|
||||
if [ $rc -gt 0 ]; then
|
||||
echo "Error: $file build package failed exit code $rc"
|
||||
fi
|
||||
cd -
|
||||
find $file -maxdepth 3 -type d -name "${file_low}*" | grep debian | xargs rm -rf
|
||||
find $file -maxdepth 3 -type f -name "files" | grep debian | xargs rm -rf
|
||||
mv ${file_low}* ../../debs/
|
||||
fi
|
||||
done
|
||||
|
||||
find ../../debs/* ! -name *.deb | xargs rm -f
|
||||
|
||||
echo "#################################"
|
||||
echo "# Creating xcat-core repository #"
|
||||
echo "#################################"
|
||||
|
||||
if [ -d $repo_xcat_core_path ]; then
|
||||
rm -rf $repo_xcat_core_path
|
||||
#clean the repo directory
|
||||
if [ -e $local_core_repo_path ]; then
|
||||
rm -rf $local_core_repo_path
|
||||
fi
|
||||
mkdir -p $repo_xcat_core_path/conf
|
||||
|
||||
find . -iname '*.deb' -exec mv {} $repo_xcat_core_path \;
|
||||
|
||||
rm -rf debs/
|
||||
cd $CMD_PATH
|
||||
|
||||
rm -rf $repo_xcat_core_path/conf/distributions
|
||||
mkdir -p $local_core_repo_path
|
||||
cd $local_core_repo_path
|
||||
mkdir conf
|
||||
|
||||
for dist in $dists; do
|
||||
cat << __EOF__ >> $repo_xcat_core_path/conf/distributions
|
||||
cat << __EOF__ >> conf/distributions
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-core bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: amd64 i386
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
SignWith: yes
|
||||
|
||||
__EOF__
|
||||
done
|
||||
|
||||
cat << __EOF__ > $repo_xcat_core_path/conf/options
|
||||
cat << __EOF__ > conf/options
|
||||
verbose
|
||||
ask-passphrase
|
||||
basedir .
|
||||
__EOF__
|
||||
|
||||
#import the deb packages into the repo
|
||||
for dist in $dists; do
|
||||
for file in `ls $repo_xcat_core_path/*.deb`; do
|
||||
reprepro -b $repo_xcat_core_path includedeb $dist $file;
|
||||
for file in `ls ../debs/*.deb`; do
|
||||
reprepro -b ./ includedeb $dist $file;
|
||||
done
|
||||
done
|
||||
|
||||
mv $xcat_core_path/latest_version $repo_xcat_core_path/xcat-core_latest-build
|
||||
|
||||
cat << '__EOF__' > $repo_xcat_core_path/mklocalrepo.sh
|
||||
#create the mklocalrepo script
|
||||
cat << __EOF__ > mklocalrepo.sh
|
||||
. /etc/lsb-release
|
||||
cd `dirname $0`
|
||||
echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-core.list
|
||||
__EOF__
|
||||
|
||||
chmod 775 $repo_xcat_core_path/mklocalrepo.sh
|
||||
rm -rf $repo_xcat_core_path/*.deb
|
||||
chmod 775 mklocalrepo.sh
|
||||
|
||||
if [ -z "$local_flag" ]
|
||||
then
|
||||
echo "###############################"
|
||||
echo "# Updating GSA xcat-core repo #"
|
||||
echo "###############################"
|
||||
lftp -e "mirror -R --delete-first $repo_xcat_core_path /projects/i/ipl-xcat/ubuntu/; exit;" -u $gsa_id,$gsa_passwd -p 22 sftp://ausgsa.ibm.com
|
||||
fi ### if [ -z "$local_flag" ]
|
||||
fi ### if [ "$a_flag" ]
|
||||
#create the xcat-core.list file
|
||||
#echo "deb ${sf_repo_url}/${REL}/${upload_dir}/ precise main" > xcat-core.list
|
||||
|
||||
if [ "$a_flag" -a "$d_flag" ]
|
||||
then
|
||||
touch svcupdate.trace
|
||||
SVCUP='svcupdate.trace'
|
||||
svn update $xcat_dep_path 1> $SVCUP 2>&1
|
||||
if ! grep 'Tree is up to date' $SVCUP
|
||||
then
|
||||
update_dep=1
|
||||
else
|
||||
update_dep=
|
||||
cd ../
|
||||
if ! grep xcat /etc/group ; then
|
||||
groupadd xcat
|
||||
fi
|
||||
|
||||
chgrp -R xcat xcat-core
|
||||
chmod -R g+w xcat-core
|
||||
|
||||
#build the tar ball
|
||||
tar -hjcf $tar_name xcat-core
|
||||
chgrp xcat $tar_name
|
||||
chmod g+w $tar_name
|
||||
|
||||
if [ ! -e core-snap ]; then
|
||||
ln -s xcat-core core-snap
|
||||
fi
|
||||
rm -f $SVCUP
|
||||
else
|
||||
update_dep=1
|
||||
|
||||
# Decide whether to upload or not
|
||||
if [ "$UP" != 1 ]; then
|
||||
echo "No need to upload"
|
||||
cd $old_pwd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#upload the deb packages
|
||||
if [ "$REL" = "devel" -o "$PREGA" != 1 ]; then
|
||||
i=0
|
||||
echo "Uploading RPMs from $upload_dir to ${sf_dir}/ubuntu/${REL}/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $upload_dir ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/${REL}/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
#upload the tar ball
|
||||
if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then
|
||||
echo "";
|
||||
else
|
||||
i=0
|
||||
echo "Uploading $tar_name to ${sf_dir}/ubuntu/${REL}/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $tar_name ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/${REL}/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
cd $old_pwd
|
||||
fi
|
||||
if [ "$d_flag" -a "$update_dep" ]
|
||||
|
||||
if [ "$d_flag" ]
|
||||
then
|
||||
echo "##############################"
|
||||
echo "# Building xcat-dep packages #"
|
||||
echo "##############################"
|
||||
|
||||
CMD_PATH=`pwd`
|
||||
cd $xcat_dep_path
|
||||
./build-debs-all "snap" "Nightly_Builds"
|
||||
|
||||
echo "################################"
|
||||
echo "# Creating xcat-dep repository #"
|
||||
echo "################################"
|
||||
rm -rf $repo_xcat_dep_path
|
||||
mkdir -p $repo_xcat_dep_path/conf
|
||||
find $xcat_dep_path -iname '*.deb' -exec cp {} $repo_xcat_dep_path \;
|
||||
|
||||
rm -rf $repo_xcat_core_path/conf/distributions
|
||||
#clean all old files
|
||||
if [ -e $local_dep_repo_path ];then
|
||||
rm -rf $local_dep_repo_path
|
||||
fi
|
||||
mkdir -p $local_dep_repo_path
|
||||
cd $local_dep_repo_path
|
||||
mkdir conf
|
||||
|
||||
#create the conf/distributions file
|
||||
for dist in $dists; do
|
||||
cat << __EOF__ >> $repo_xcat_dep_path/conf/distributions
|
||||
cat << __EOF__ >> conf/distributions
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-dep bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: i386 amd64
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
SignWith: yes
|
||||
|
||||
__EOF__
|
||||
done
|
||||
done
|
||||
|
||||
cat << __EOF__ > $repo_xcat_dep_path/conf/options
|
||||
cat << __EOF__ > conf/options
|
||||
verbose
|
||||
ask-passphrase
|
||||
basedir .
|
||||
__EOF__
|
||||
|
||||
for dist in $dists; do
|
||||
for file in `ls $repo_xcat_dep_path/*.deb`; do
|
||||
reprepro -b $repo_xcat_dep_path includedeb $dist $file;
|
||||
for file in `ls ../debs/*.deb`; do
|
||||
reprepro -b ./ includedeb $dist $file;
|
||||
done
|
||||
done
|
||||
|
||||
cat << '__EOF__' > $repo_xcat_dep_path/mklocalrepo.sh
|
||||
cat << '__EOF__' > mklocalrepo.sh
|
||||
. /etc/lsb-release
|
||||
cd `dirname $0`
|
||||
echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-dep.list
|
||||
__EOF__
|
||||
|
||||
chmod 775 $repo_xcat_dep_path/mklocalrepo.sh
|
||||
rm -rf $repo_xcat_dep_path/*.deb
|
||||
chmod 775 mklocalrepo.sh
|
||||
|
||||
if [ -z "$local_flag" ]
|
||||
then
|
||||
echo "##############################"
|
||||
echo "# Updating GSA xcat-dep repo #"
|
||||
echo "##############################"
|
||||
lftp -e "mirror -R --delete-first $repo_xcat_dep_path /projects/i/ipl-xcat/ubuntu/; exit;" -u $gsa_id,$gsa_passwd -p 22 sftp://ausgsa.ibm.com
|
||||
fi ### if [ -z "$local_flag" ]
|
||||
fi ### if [ "$d_flag" -a "$a_flag"]
|
||||
#echo ""deb ${sf_repo_url}/xcat-dep/ precise main"" > xcat-dep.list
|
||||
|
||||
if [ -z "$local_flag" ] # delete the temp repo after upload is done
|
||||
then
|
||||
rm -rf ./gsa-repo_temp
|
||||
cd ..
|
||||
if ! grep xcat /etc/group ; then
|
||||
groupadd xcat
|
||||
fi
|
||||
|
||||
chgrp -R xcat xcat-dep
|
||||
chmod -R g+w xcat-dep
|
||||
|
||||
#create the tar ball
|
||||
dep_tar_name=xcat-dep-ubuntu.tar.bz
|
||||
tar -hjcf $dep_tar_name xcat-dep
|
||||
chgrp xcat $dep_tar_name
|
||||
chmod g+w $dep_tar_name
|
||||
|
||||
if [ "$UP" != 1 ];then
|
||||
echo "No need to upload the dep packages"
|
||||
cd $old_pwd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#upload the dep packages
|
||||
i=0
|
||||
echo "Uploading debs from xcat-dep to ${sf_dir}/ubuntu/xcat-dep/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete xcat-dep ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/
|
||||
do : ; done
|
||||
#upload the tarball
|
||||
cd $old_pwd
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
+50
-78
@@ -19,7 +19,6 @@
|
||||
# directories that are needed.
|
||||
|
||||
# Usage: buildcore.sh [attr=value attr=value ...]
|
||||
# Before running buildcore.sh, you must change the local git repo to the branch you want built, using: git checkout <branch>
|
||||
# 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 https://sourceforge.net/projects/xcat/files/xcat/ .
|
||||
# If not specified, a snap build is assumed, which uploads to https://sourceforge.net/projects/xcat/files/yum/
|
||||
@@ -32,7 +31,7 @@
|
||||
# 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
|
||||
# SVNUP=<filename> - control which rpms get built by specifying a coresvnup file
|
||||
# GITUP=<filename> - control which rpms get built by specifying a coregitup file
|
||||
# FRSYUM=0 - put the yum repo and snap builds in the old project web area instead of the FRS area.
|
||||
# EMBED=<embedded-environment> - 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
|
||||
|
||||
@@ -85,24 +84,15 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
export HOME=/root # This is so rpm and gpg will know home, even in sudo
|
||||
fi
|
||||
|
||||
# for the git case, query the current branch and set REL (changing master to devel if necessary)
|
||||
function setbranch {
|
||||
#git checkout $BRANCH
|
||||
#REL=`git rev-parse --abbrev-ref HEAD`
|
||||
REL=`git name-rev --name-only HEAD`
|
||||
if [ "$REL" = "master" ]; then
|
||||
REL="devel"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$REL" = "xcat-core" ]; then # using git
|
||||
GIT=1
|
||||
setbranch # this changes the REL variable
|
||||
# this is needed only when we are transitioning the yum over to frs
|
||||
if [ "$FRSYUM" != 0 ]; then
|
||||
YUMDIR=$FRS
|
||||
YUMREPOURL="https://sourceforge.net/projects/xcat/files/yum"
|
||||
else
|
||||
YUMDIR=htdocs
|
||||
YUMREPOURL="http://xcat.sourceforge.net/yum"
|
||||
fi
|
||||
|
||||
YUMDIR=$FRS
|
||||
YUMREPOURL="https://sourceforge.net/projects/xcat/files/yum"
|
||||
|
||||
# Set variables based on which type of build we are doing
|
||||
if [ -n "$EMBED" ]; then
|
||||
EMBEDDIR="/$EMBED"
|
||||
@@ -126,12 +116,27 @@ else
|
||||
fi
|
||||
|
||||
XCATCORE="xcat-core" # core-snap is a sym link to xcat-core
|
||||
|
||||
if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms
|
||||
DESTDIR=../../$REL$EMBEDDIR/$XCATCORE
|
||||
echo "svn --quiet up Version"
|
||||
svn --quiet up Version
|
||||
VER=`cat Version`
|
||||
SHORTVER=`cat Version|cut -d. -f 1,2`
|
||||
SHORTSHORTVER=`cat Version|cut -d. -f 1`
|
||||
if [ "$PROMOTE" = 1 ]; then
|
||||
CORE="xcat-core"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-$VER.tar.gz
|
||||
else
|
||||
TARNAME=xcat-core-$VER.tar.bz2
|
||||
fi
|
||||
else
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
CORE="core-snap"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-snap.tar.gz
|
||||
else
|
||||
TARNAME=core-rpms-snap.tar.bz2
|
||||
fi
|
||||
fi
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
SRCD=core-snap-srpms
|
||||
|
||||
# currently aix builds ppc rpms, but someday it should build noarch
|
||||
@@ -141,21 +146,8 @@ else
|
||||
NOARCH=noarch
|
||||
fi
|
||||
|
||||
function setversionvars {
|
||||
VER=`cat Version`
|
||||
SHORTVER=`cat Version|cut -d. -f 1,2`
|
||||
SHORTSHORTVER=`cat Version|cut -d. -f 1`
|
||||
}
|
||||
|
||||
|
||||
if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting
|
||||
# we are doing a snap build
|
||||
CORE="core-snap"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-snap.tar.gz
|
||||
else
|
||||
TARNAME=core-rpms-snap.tar.bz2
|
||||
fi
|
||||
mkdir -p $DESTDIR
|
||||
SRCDIR=$DESTDIR/../$SRCD
|
||||
mkdir -p $SRCDIR
|
||||
@@ -176,32 +168,16 @@ else
|
||||
#echo "source=$source"
|
||||
fi
|
||||
|
||||
# If they have not given us a premade update file, do an svn update or git pull and capture the results
|
||||
SOMETHINGCHANGED=0
|
||||
if [ "$GIT" = "1" ]; then # using git
|
||||
if [ -z "$GITUP" ]; then
|
||||
GITUP=../coregitup
|
||||
echo "git pull > $GITUP"
|
||||
git pull > $GITUP
|
||||
fi
|
||||
if ! $GREP 'Already up-to-date' $GITUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
else # using svn
|
||||
GIT=0
|
||||
if [ -z "$SVNUP" ]; then
|
||||
SVNUP=../coresvnup
|
||||
echo "svn up > $SVNUP"
|
||||
svn up > $SVNUP
|
||||
fi
|
||||
if ! $GREP 'At revision' $SVNUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
# copy the SVNUP variable to GITUP so the rest of the script doesnt have to worry whether we did svn or git
|
||||
GITUP=$SVNUP
|
||||
# If they have not given us a premade update file, do an svn update and capture the results
|
||||
if [ -z "$SVNUP" ]; then
|
||||
SVNUP=../coresvnup
|
||||
echo "svn up > $SVNUP"
|
||||
svn up > $SVNUP
|
||||
fi
|
||||
SOMETHINGCHANGED=0
|
||||
if ! $GREP 'At revision' $SVNUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
|
||||
setversionvars
|
||||
|
||||
# Function for making the noarch rpms
|
||||
function maker {
|
||||
@@ -218,7 +194,7 @@ function maker {
|
||||
}
|
||||
|
||||
# If anything has changed, we should always rebuild perl-xCAT
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # Use to be: $GREP perl-xCAT $GITUP; then
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # Use to be: $GREP perl-xCAT $SVNUP; then
|
||||
if [[ " $EMBEDBUILD " = *\ perl-xCAT\ * ]]; then
|
||||
UPLOAD=1
|
||||
maker perl-xCAT
|
||||
@@ -234,7 +210,7 @@ for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xC
|
||||
#if [ "$EMBED" = "zvm" -a "$rpmname" != "xCAT-server" -a "$rpmname" != "xCAT-UI" ]; then continue; fi # for zvm embedded env only need to build server and UI
|
||||
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
|
||||
if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-buildkit" ]; then continue; fi # do not build xCAT-buildkit on aix
|
||||
if $GREP $rpmname $GITUP || [ "$BUILDALL" == 1 ]; then
|
||||
if $GREP $rpmname $SVNUP || [ "$BUILDALL" == 1 ]; then
|
||||
UPLOAD=1
|
||||
maker $rpmname
|
||||
fi
|
||||
@@ -249,7 +225,7 @@ done
|
||||
# The mknb cmd combines them at install time.
|
||||
if [ "$OSNAME" != "AIX" ]; then
|
||||
if [[ " $EMBEDBUILD " = *\ xCAT-genesis-scripts\ * ]]; then
|
||||
if $GREP xCAT-genesis-scripts $GITUP || [ "$BUILDALL" == 1 ]; then
|
||||
if $GREP xCAT-genesis-scripts $SVNUP || [ "$BUILDALL" == 1 ]; then
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
./makerpm xCAT-genesis-scripts x86_64 "$EMBED"
|
||||
@@ -268,14 +244,14 @@ fi
|
||||
for rpmname in xCAT xCATsn; do
|
||||
#if [ "$EMBED" = "zvm" ]; then break; fi
|
||||
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $SVNUP; then
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
./makerpm $rpmname "$EMBED"
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname"; fi
|
||||
else
|
||||
for arch in x86_64 ppc64 s390x; do
|
||||
for arch in x86_64 i386 ppc64 s390x; do
|
||||
./makerpm $rpmname $arch "$EMBED"
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname-$arch"; fi
|
||||
done
|
||||
@@ -348,8 +324,8 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
echo "Signing RPMs..."
|
||||
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(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
|
||||
createrepo $DESTDIR
|
||||
createrepo $SRCDIR
|
||||
rm -f $SRCDIR/repodata/repomd.xml.asc
|
||||
rm -f $DESTDIR/repodata/repomd.xml.asc
|
||||
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
|
||||
@@ -378,17 +354,7 @@ chmod -R g+w $DESTDIR
|
||||
chgrp -R xcat $SRCDIR
|
||||
chmod -R g+w $SRCDIR
|
||||
|
||||
else # end of very long if-not-promote
|
||||
# we are only promoting (not building)
|
||||
setversionvars
|
||||
setbranch
|
||||
CORE="xcat-core"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-$VER.tar.gz
|
||||
else
|
||||
TARNAME=xcat-core-$VER.tar.bz2
|
||||
fi
|
||||
fi
|
||||
fi # end of very long if-not-promote
|
||||
|
||||
cd $DESTDIR
|
||||
|
||||
@@ -493,5 +459,11 @@ if [ "$OSNAME" != "AIX" -a "$REL" = "devel" -a "$PROMOTE" != 1 -a -z "$EMBED" ];
|
||||
i=0
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag -r opt/xcat/share/doc/man1 opt/xcat/share/doc/man3 opt/xcat/share/doc/man5 opt/xcat/share/doc/man7 opt/xcat/share/doc/man8 $UPLOADUSER,xcat@web.sourceforge.net:htdocs/
|
||||
do : ; done
|
||||
|
||||
# extract and upload the tools readme
|
||||
rpm2cpio ../$XCATCORE/xCAT-server-*.$NOARCH.rpm | cpio -id ./opt/xcat/share/xcat/tools/README.html
|
||||
i=0
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag opt/xcat/share/xcat/tools/README.html $UPLOADUSER,xcat@web.sourceforge.net:htdocs/tools/
|
||||
do : ; done
|
||||
cd ..
|
||||
fi
|
||||
|
||||
@@ -24,7 +24,7 @@ function makenoarch {
|
||||
else # linux
|
||||
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $EMBEDTXT..."
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
|
||||
rm -f $RPMROOT/SRPMS/xCAT-server-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
||||
rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz
|
||||
RC=$?
|
||||
fi
|
||||
|
||||
+61
-51
@@ -157,61 +157,69 @@ B<tabedit> or B<chtab> commands. They can be viewed using B<nodels> or B<tabdum
|
||||
|
||||
Alternatively, the xCAT database can be viewed and edited as logical objects, instead of flat tables.
|
||||
In this mode, xCAT takes care of which table each attribute should go in. To treat the database
|
||||
as logical object definitions, use the commands: lsdef, mkdef, chdef, rmdef. See Object Definitions
|
||||
as logical object definitions, use the commands: B<lsdef>, B<mkdef>, B<chdef>, B<rmdef>. See Object Definitions
|
||||
below.
|
||||
|
||||
xCAT allows the use of different database applications, depending on the needs of your cluster.
|
||||
The default database is SQLite, which is a daemonless, zero-config database. But you could instead
|
||||
choose to use something like postgresql for greater scalability and remote access in the
|
||||
hierarchical/service node case. To use a different database or a different location, create
|
||||
the file /etc/xcat/cfgloc.
|
||||
See the appropriate xCAT docuementation for the format of the file for the database you choose.
|
||||
The following example is for PostgreSQL:
|
||||
the file /etc/xcat/cfgloc. See the appropriate xCAT docuementation for the format of the file for the database you choose.
|
||||
The following example /etc/xcat/cfgloc file is for PostgreSQL:
|
||||
|
||||
|
||||
=over 4
|
||||
|
||||
=item Pg:dbname=xcat;host=<mgmtnode>|<pgadminuserid>|<pgadminpasswd>
|
||||
Pg:dbname=xcat;host=<mgmtnode>|<pgadminuserid>|<pgadminpasswd>
|
||||
|
||||
where mgmtnode is the hostname of the management node adapter on the cluster side, and the pgadminuserid and pgadminpasswd are the database admin and password.
|
||||
|
||||
=back
|
||||
=head2 GROUPS AND REGULAR EXPRESSIONS IN TABLES
|
||||
|
||||
The xCAT database spans a number of tables, some with records associated with particular nodes
|
||||
(such as nodelist and nodehm) and others that do not have a direct relationship with any given node.
|
||||
The tables not associated with a given node are straightforward, the data is stored and retrieved
|
||||
as-is from the database without interpretation, and without any generic inheritance
|
||||
(though some calling code may implement inheritance for specific fields, for example
|
||||
nodehm.power inheriting from nodehm.mgt).
|
||||
|
||||
The tables with records typically retrieved by node name have some extra features to enable a more
|
||||
The xCAT database has a number of tables, some with rows that are keyed by node name
|
||||
(such as noderes and nodehm) and others that are not keyed by node name (for example, the policy table).
|
||||
The tables that are keyed by node name have some extra features that enable a more
|
||||
template-based style to be used:
|
||||
|
||||
Any group name can be used in lieu of a node name in the node field, and that record will then
|
||||
be taken to be applicable to any node in that group. If a field is requested for a specific node,
|
||||
and either a record doesn't exist specifically for that nodename or a record exists, but has no
|
||||
definition for the requested field, that node's groups are then used to search for
|
||||
records. If multiple records could apply from two different groups, the precedence is
|
||||
the order the groups are specified in the nodelist table for that node. This is nearly identical to
|
||||
most xCAT 1.x tab file conventions. This is useful in tables such as noderes, where typical
|
||||
configurations have exactly the same field values for large sets of nodes.
|
||||
Any group name can be used in lieu of a node name in the node field, and that row will then
|
||||
provide "default" attribute values for any node in that group. A row with a specific node name
|
||||
can then override one or more attribute values for that specific node. For example, if the nodehm table contains:
|
||||
|
||||
xCAT 2 extends the above to be made useful where a field will vary for every node with a given tag,
|
||||
but in ways that would be trivial to describe. If a field is of the format /I<pattern>/I<replacement>/,
|
||||
it is taken to be a perl regular expression, to be performed on the nodename. For example, the bmc field
|
||||
of the ipmi table might be B</\z/-bmc/> for a record with node=ipmi to specify that the BMC hostname is derived
|
||||
by appending B<-bmc> to the end of the nodename of every node in the ipmi group.
|
||||
#node,power,mgt,cons,termserver,termport,conserver,serialport,serialspeed,serialflow,getmac,cmdmapping,comments,disable
|
||||
"mygroup",,"ipmi",,,,,,"19200",,,,,
|
||||
"node1",,,,,,,,"115200",,,,,
|
||||
|
||||
As an extension to the above, a regular expression extended with arithmetic operators is available,
|
||||
by using the format |I<pattern>|I<replacement>|. This behaves similarly to the above, but () enclosed parts
|
||||
in I<replacement> are taken to signify arithmetic operations and substituted in. All operations are integer
|
||||
arithmetic, so 5/4 would come out as 1. The typical perl positional variables are available in such expressions.
|
||||
In the above example, the node group called mygroup sets mgt=ipmi and serialspeed=19200. Any nodes that are in this group
|
||||
will have those attribute values, unless overridden. For example, if node2 is a member of mygroup, it will automatically
|
||||
inherit these attribute values (even though it is not explicitly listed in this table). In the case of node1 above, it
|
||||
inherits mgt=ipmi, but overrides the serialspeed to be 115200, instead of 19200. A useful, typical way to use this
|
||||
capability is to create a node group for your nodes and for all the attribute values that are the same for every node,
|
||||
set them at the group level. Then you only have to set attributes for each node that vary from node to node.
|
||||
|
||||
For example, if you have many blades in your cluster and their hostnames have a regular
|
||||
pattern of blade1, blade2, etc., and your BladeCenter management modules also have a hostname
|
||||
pattern of amm1, amm2, etc., then your B<mp> table could be expressed by the following single row:
|
||||
xCAT extends the group capability so that it can also be used for attribute values that vary from node to node
|
||||
in a very regular pattern. For example, if in the ipmi table you want the bmc attribute to be set to whatever the nodename is with
|
||||
"-bmc" appended to the end of it, then use this in the ipmi table:
|
||||
|
||||
"blade","|\D+(\d+)|amm(($1-1)/14+1)|","|\D+(\d+)|(($1-1)%14+1)|",,
|
||||
#node,bmc,bmcport,taggedvlan,bmcid,username,password,comments,disable
|
||||
"compute","/\z/-bmc/",,,,,,,
|
||||
|
||||
In this example, "compute" is a node group that contains all of the compute nodes. The 2nd attribute (bmc) is a regular
|
||||
expression that is similar to a substitution pattern. The 1st part "\z" matches the end of the node name and substitutes "-bmc", effectively appending it to the node name.
|
||||
|
||||
Another example is if node1 is to have IP address 10.0.0.1, node2 is to have IP address 10.0.0.2, etc.,
|
||||
then this could be represented in the hosts table with the single row:
|
||||
|
||||
#node,ip,hostnames,otherinterfaces,comments,disable
|
||||
"compute","|node(\d+)|10.0.0.($1+0)|",,,,
|
||||
|
||||
In this example, the regular expression in the ip attribute uses "|" to separate the 1st and 2nd part. This means that
|
||||
xCAT will allow arithmetic operations in the 2nd part. In the 1st part, "(\d+)", will match the number part of the node
|
||||
name and put that in a variable called $1. The 2nd part
|
||||
is what value to give the ip attribute. In this case it will set it to the string "10.0.0." and the number that is
|
||||
in $1. (Zero is added to $1 just to remove any leading zeroes.)
|
||||
|
||||
A more involved example is with the mp table. If your blades have node names node01, node02, etc., and your chassis
|
||||
node names are cmm01, cmm02, etc., then you might have an mp table like:
|
||||
|
||||
#node,mpa,id,nodetype,comments,disable
|
||||
"blade","|\D+(\d+)|cmm(sprintf('%02d',($1-1)/14+1))|","|\D+(\d+)|(($1-1)%14+1)|",,
|
||||
|
||||
Before you panic, let me explain each column:
|
||||
|
||||
@@ -221,32 +229,34 @@ Before you panic, let me explain each column:
|
||||
|
||||
This is a group name. In this example, we are assuming that all of your blades belong to this
|
||||
group. Each time the xCAT software accesses the B<mp> table to get the management module and slot number
|
||||
of a specific blade (e.g. B<blade20>), this row will match (because B<blade20> is in the B<blade> group).
|
||||
Once this row is matched for B<blade20>, then the processing described in the following items will take
|
||||
of a specific blade (e.g. B<node20>), this row will match (because B<node20> is in the B<blade> group).
|
||||
Once this row is matched for B<node20>, then the processing described in the following items will take
|
||||
place.
|
||||
|
||||
=item B<|\D+(\d+)|amm(($1-1)/14+1)|>
|
||||
=item B<|\D+(\d+)|cmm(sprintf('%02d',($1-1)/14+1))|>
|
||||
|
||||
This is a perl substitution pattern that will produce the value for the second column of the table (the
|
||||
management module hostname).
|
||||
The text B<\D+(\d+)> between the 1st two vertical bars is
|
||||
management module hostname). The text B<\D+(\d+)> between the 1st two vertical bars is
|
||||
a regular expression that matches the node
|
||||
name that was searched for in this table (in this example B<blade20>). The text that matches
|
||||
name that was searched for in this table (in this example B<node20>). The text that matches
|
||||
within the 1st set of parentheses is set to $1. (If there was a 2nd set of parentheses, it would
|
||||
be set to $2, and so on.) In our case, the \D+ matches the non-numeric part of the name
|
||||
(B<blade>) and the \d+ matches the numeric part (B<20>). So $1 is set to B<20>. The text B<amm(($1-1)/14+1)> between the
|
||||
2nd and 3rd vertical bars produces the string that should be used as the value
|
||||
for this column in a hypothetical row for blade20. Since $1 is set to 20, the expression B<($1-1)/14+1> equals
|
||||
19/14 + 1, which equals 2. Therefore the whole string is B<amm2>, which will be used as the hostname
|
||||
(B<node>) and the B<\d+> matches the numeric part (B<20>). So $1 is set to B<20>. The text B<cmm(sprintf('%02d',($1-1)/14+1))> between the
|
||||
2nd and 3rd vertical bars produces the string that should be used as the value for the mpa attribute for node20.
|
||||
Since $1 is set to 20, the expression B<($1-1)/14+1> equals
|
||||
19/14 + 1, which equals 2. (The division is integer division,
|
||||
so 19/14 equals 1. Fourteen is used as the divisor, because there are 14 blades in each chassis.) The value of 2 is then passed into sprintf() with a format string to add a leading
|
||||
zero, if necessary, to always make the number two digits. Lastly the string B<cmm> is added to the beginning,
|
||||
making the resulting string B<cmm02>, which will be used as the hostname
|
||||
of the management module.
|
||||
|
||||
=item B<|\D+(\d+)|(($1-1)%14+1)|>
|
||||
|
||||
This item is similar to the one above. This substituion pattern will produce the value for
|
||||
the 3rd column (the BladeCenter chassis slot number for this blade). Because this row was
|
||||
the match for B<blade20>, the parentheses
|
||||
the 3rd column (the chassis slot number for this blade). Because this row was
|
||||
the match for B<node20>, the parentheses
|
||||
within the 1st set of vertical bars will set $1 to 20. Since % means modulo division, the
|
||||
expression B<($1-1)%14+1> will evaluate to 6.
|
||||
expression B<($1-1)%14+1> will evaluate to B<6>.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
+18
-10
@@ -1,26 +1,34 @@
|
||||
#!/bin/sh
|
||||
# Put the version, svn revision #, and build date into the Version function in Version.pm
|
||||
|
||||
if [ -z "$1" ]
|
||||
if [ -z "$2" ]
|
||||
then
|
||||
echo "modifyUtils: Error: must specify the xCAT version as an argument" >&2
|
||||
echo "modifyUtils: Error: must specify the xCAT version and svn revision number as arguments" >&2
|
||||
exit
|
||||
fi
|
||||
|
||||
VER=$1
|
||||
SVNREF="svn r$2, "
|
||||
|
||||
#SVNINFO=`svn info 2>/dev/null|grep Revision`
|
||||
#/bin/echo -e $SVNINFO
|
||||
#if [ $? -ne 0 -a -f .svninfo ]; then
|
||||
# SVNINFO=`cat .svninfo 2>/dev/null|grep Revision`
|
||||
#fi
|
||||
#if [ $? -eq 0 ]
|
||||
# then
|
||||
# SVNREF="svn r"`echo $SVNINFO|awk '{print $2}'`", "
|
||||
# else
|
||||
# SVNREF=""
|
||||
# fi
|
||||
|
||||
BUILDDATE=`date`
|
||||
#echo ". '(built $BUILDDATE)'"
|
||||
#echo ". '(${SVNREF}built $BUILDDATE)'"
|
||||
|
||||
if [ "$(uname)" = "AIX" ]
|
||||
then
|
||||
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
|
||||
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
|
||||
mv xCAT/Version.pm.new xCAT/Version.pm
|
||||
else
|
||||
if [ -f "/etc/debian_version" ];then
|
||||
FILENAME="debian/perl-xcat/opt/xcat/lib/perl/xCAT/Version.pm"
|
||||
else
|
||||
FILENAME="xCAT/Version.pm"
|
||||
fi
|
||||
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ $FILENAME
|
||||
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm
|
||||
fi
|
||||
|
||||
@@ -25,6 +25,7 @@ Includes xCAT::Table, xCAT::NodeRange, among others.
|
||||
|
||||
%define zvm %(if [ "$zvm" = "1" ];then echo 1; else echo 0; fi)
|
||||
%define fsm %(if [ "$fsm" = "1" ];then echo 1; else echo 0; fi)
|
||||
%define svninfo %(svn info | grep Revision | awk '{print $2}')
|
||||
|
||||
%prep
|
||||
%setup -q -n perl-xCAT
|
||||
@@ -36,7 +37,7 @@ Includes xCAT::Table, xCAT::NodeRange, among others.
|
||||
%if %fsm
|
||||
%else
|
||||
# Modify the Version() function in xCAT/Utils.pm to automatically have the correct version
|
||||
./modifyUtils %{version}
|
||||
./modifyUtils %{version} %{svninfo}
|
||||
|
||||
# Build the pod version of the man pages for each DB table. It puts them in the man5 and man7 subdirs.
|
||||
# Then convert the pods to man pages and html pages.
|
||||
|
||||
@@ -433,7 +433,7 @@ sub plugin_command {
|
||||
$usesiteglobal = 1;
|
||||
}
|
||||
foreach (@nodes) { #Specified a specific plugin, not a table lookup
|
||||
$handler_hash{$sent->{value}}->{$_} = 1;
|
||||
$handler_hash{$::XCATSITEVALS{$sitekey}}->{$_} = 1;
|
||||
}
|
||||
}
|
||||
} elsif ($hdlspec =~ /:/) { #Specificed a table lookup path for plugin name
|
||||
@@ -998,7 +998,7 @@ sub handle_response {
|
||||
}
|
||||
#print "in handle_response\n";
|
||||
# Handle errors
|
||||
if ($rsp->{errorcode}) {
|
||||
if (defined($rsp->{errorcode})) {
|
||||
if (ref($rsp->{errorcode}) eq 'ARRAY') {
|
||||
foreach my $ecode (@{$rsp->{errorcode}}) {
|
||||
$xCAT::Client::EXITCODE |= $ecode;
|
||||
@@ -1012,22 +1012,38 @@ sub handle_response {
|
||||
#print "printing error\n";
|
||||
if (ref($rsp->{error}) eq 'ARRAY') {
|
||||
foreach my $text (@{$rsp->{error}}) {
|
||||
print STDERR "Error: $text\n";
|
||||
if ($rsp->{NoErrorPrefix}) {
|
||||
print STDERR "$text\n";
|
||||
} else {
|
||||
print STDERR "Error: $text\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
print ("Error: ".$rsp->{error}."\n");
|
||||
if ($rsp->{NoErrorPrefix}) {
|
||||
print STDERR ($rsp->{error}."\n");
|
||||
} else {
|
||||
print STDERR ("Error: ".$rsp->{error}."\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($rsp->{warning}) {
|
||||
#print "printing warning\n";
|
||||
if (ref($rsp->{warning}) eq 'ARRAY') {
|
||||
foreach my $text (@{$rsp->{warning}}) {
|
||||
print STDERR "Warning: $text\n";
|
||||
if ($rsp->{NoWarnPrefix}) {
|
||||
print STDERR "$text\n";
|
||||
} else {
|
||||
print STDERR "Warning: $text\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
print ("Warning: ".$rsp->{warning}."\n");
|
||||
if ($rsp->{NoWarnPrefix}) {
|
||||
print STDERR ($rsp->{warning}."\n");
|
||||
} else {
|
||||
print STDERR ("Warning: ".$rsp->{warning}."\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($rsp->{info}) {
|
||||
|
||||
+11
-13
@@ -8,6 +8,7 @@ use File::stat;
|
||||
use File::Copy;
|
||||
use xCAT::Usage;
|
||||
use Thread qw/yield/;
|
||||
use Storable qw/store_fd fd_retrieve/;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@@ -29,19 +30,18 @@ sub forward_data {
|
||||
my $rfh;
|
||||
my $rc = @ready_fds;
|
||||
foreach $rfh (@ready_fds) {
|
||||
my $data;
|
||||
if ($data = <$rfh>) {
|
||||
while ($data !~ /ENDOFFREEZE6sK4ci/) {
|
||||
$data .= <$rfh>;
|
||||
}
|
||||
my $responses;
|
||||
eval {
|
||||
$responses = fd_retrieve($rfh);
|
||||
};
|
||||
if ($@ and $@ =~ /^Magic number checking on storable file/) { #this most likely means we ran over the end of available input
|
||||
$fds->remove($rfh);
|
||||
close($rfh);
|
||||
} else {
|
||||
eval { print $rfh "ACK\n"; }; #Ignore ack loss due to child giving up and exiting, we don't actually explicitly care about the acks
|
||||
my $responses=thaw($data);
|
||||
foreach (@$responses) {
|
||||
$callback->($_);
|
||||
}
|
||||
} else {
|
||||
$fds->remove($rfh);
|
||||
close($rfh);
|
||||
}
|
||||
}
|
||||
yield(); #Try to avoid useless iterations as much as possible
|
||||
@@ -62,8 +62,7 @@ sub send_data {
|
||||
foreach(@_) {
|
||||
my %output;
|
||||
if (ref($_) eq HASH) {
|
||||
print $out freeze([$_]);
|
||||
print $out "\nENDOFFREEZE6sK4ci\n";
|
||||
store_fd([$_],$out);
|
||||
yield();
|
||||
waitforack($out);
|
||||
next;
|
||||
@@ -97,8 +96,7 @@ sub send_data {
|
||||
} else {
|
||||
$output{node}->[0]->{data}->[0]->{contents}->[0]=$text;
|
||||
}
|
||||
print $out freeze([\%output]);
|
||||
print $out "\nENDOFFREEZE6sK4ci\n";
|
||||
store_fd([\%output],$out);
|
||||
yield();
|
||||
waitforack($out);
|
||||
}
|
||||
|
||||
@@ -2150,7 +2150,7 @@ sub getchildren
|
||||
$::RUNCMD_RC = 1;
|
||||
return undef;
|
||||
}
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype','hcp']);
|
||||
foreach my $entry ( @ps ) {
|
||||
my $p = $entry->{parent};
|
||||
my $c = $entry->{node};
|
||||
@@ -2161,13 +2161,19 @@ sub getchildren
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PPCHASH{$p}}, $c;
|
||||
}
|
||||
elsif ($t eq 'blade') {
|
||||
push @{$PPCHASH{$c}}, $entry->{hcp};
|
||||
}
|
||||
} else { # go look in the nodetype table to find nodetype
|
||||
my $type = getnodetype($c);
|
||||
my $type = getnodetype($c, "ppc");
|
||||
if ( $type eq 'fsp' or $type eq 'bpa')
|
||||
{
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PPCHASH{$p}}, $c;
|
||||
}
|
||||
elsif ($type eq "blade") {
|
||||
push @{$PPCHASH{$c}}, $entry->{hcp};
|
||||
}
|
||||
}
|
||||
} # not $p and $c
|
||||
}
|
||||
@@ -2592,4 +2598,170 @@ sub judge_node
|
||||
|
||||
return $flag;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 expandnicsattr
|
||||
Expand the nics related attributes into the readable format,
|
||||
for example, the nicsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
expanded format:
|
||||
nicsips.eth0=1.1.1.1|2.1.1.1
|
||||
nicsips.eth1=3.1.1.1|4.1.1.1
|
||||
|
||||
Arguments:
|
||||
nicsattr value, like niccsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
nicnames: only return the value for specific nics, like "eth0,eth1"
|
||||
Returns:
|
||||
expanded format, like:
|
||||
nicsips.eth0=1.1.1.1|2.1.1.1
|
||||
nicsips.eth1=3.1.1.1|4.1.1.1
|
||||
Error:
|
||||
none
|
||||
|
||||
Example:
|
||||
my $nicsstr = xCAT::DBobjUtils->expandnicsattr($attrval);
|
||||
|
||||
Comments:
|
||||
none
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub expandnicsattr()
|
||||
{
|
||||
my $nicstr = shift;
|
||||
if (($nicstr) && ($nicstr =~ /xCAT::/))
|
||||
{
|
||||
$nicstr = shift;
|
||||
}
|
||||
my $nicnames = shift;
|
||||
|
||||
my $ret;
|
||||
|
||||
$nicstr =~ /^(.*?)=(.*?)$/;
|
||||
|
||||
#Attribute: nicips, nichostnamesuffix, etc.
|
||||
my $nicattr = $1;
|
||||
|
||||
# Value: eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
my $nicval=$2;
|
||||
|
||||
# $nicarr[0]: eth0!1.1.1.1|2.1.1.1
|
||||
# $nicarr[1]: eth1!3.1.1.1|4.1.1.1
|
||||
my @nicarr = split(/,/, $nicval);
|
||||
|
||||
foreach my $nicentry (@nicarr)
|
||||
{
|
||||
#nicentry: eth0!1.1.1.1|2.1.1.1
|
||||
# $nicv[0]: eth0
|
||||
# $nicv[1]: 1.1.1.1|2.1.1.1
|
||||
my @nicv = split(/!/, $nicentry);
|
||||
|
||||
# only return nic* attr for these specific nics
|
||||
if ($nicnames)
|
||||
{
|
||||
my @nics = split(/,/, $nicnames);
|
||||
if ($nicv[0])
|
||||
{
|
||||
# Do not need to return the nic attr for this nic
|
||||
if (!grep(/^$nicv[0]$/, @nics))
|
||||
{
|
||||
next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ignore the line that does not have nicname or value
|
||||
if ($nicv[0] && $nicv[1])
|
||||
{
|
||||
$ret .= " $nicattr.$nicv[0]=$nicv[1]\n";
|
||||
}
|
||||
}
|
||||
|
||||
chomp($ret);
|
||||
return $ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 collapsenicsattr
|
||||
Collapse the nics related attributes into the database format,
|
||||
for example,
|
||||
nicsips.eth0=1.1.1.1|2.1.1.1
|
||||
nicsips.eth1=3.1.1.1|4.1.1.1
|
||||
|
||||
the collapsed format:
|
||||
nicsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
|
||||
The collapse will be done against the hash %::FILEATTRS or %::CLIATTRS,
|
||||
remove the nicips.thx attributes from %::FILEATTRS or %::CLIATTRS,
|
||||
add the collapsed info nicips into %::FILEATTRS or %::CLIATTRS.
|
||||
|
||||
Arguments:
|
||||
$::FILEATTRS{$objname} or $::CLIATTRS{$objname}
|
||||
$objname
|
||||
|
||||
Returns:
|
||||
None, update %::FILEATTRS or %::CLIATTRS directly
|
||||
|
||||
Error:
|
||||
none
|
||||
|
||||
Example:
|
||||
xCAT::DBobjUtils->collapsenicsattr($nodeattrhash);
|
||||
|
||||
Comments:
|
||||
none
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub collapsenicsattr()
|
||||
{
|
||||
my $nodeattrhash = shift;
|
||||
if (($nodeattrhash) && ($nodeattrhash =~ /xCAT::/))
|
||||
{
|
||||
$nodeattrhash = shift;
|
||||
}
|
||||
my $objname = shift;
|
||||
|
||||
my %nicattrs = ();
|
||||
foreach my $nodeattr (keys %{$nodeattrhash})
|
||||
{
|
||||
# e.g nicips.eth0
|
||||
# do not need to handle nic attributes without the postfix .ethx,
|
||||
# it will be overwritten by the attributes with the postfix .ethx,
|
||||
if ($nodeattr =~ /^(nic\w+)\.(\w+)$/)
|
||||
{
|
||||
if ($1 && $2)
|
||||
{
|
||||
# chdef <noderange> nicips.eth2= to remove the definition for eth2
|
||||
# in this case, the $nodeattrhash->{'nicips.eth0'} is blank
|
||||
if ($nodeattrhash->{$nodeattr})
|
||||
{
|
||||
# $nicattrs{nicips}{eth0} = "1.1.1.1|1.2.1.1"
|
||||
$nicattrs{$1}{$2} = $nodeattrhash->{$nodeattr};
|
||||
}
|
||||
|
||||
# remove nicips.eth0 from the %::FILEATTRS
|
||||
delete $nodeattrhash->{$nodeattr};
|
||||
}
|
||||
}
|
||||
}
|
||||
# $nicattrs{'nicips'}{'eth0'} = "1.1.1.1|1.2.1.1"
|
||||
# $nicattrs{'nicips'}{'eth1'} = "2.1.1.1|2.2.1.1"
|
||||
foreach my $nicattr (keys %nicattrs)
|
||||
{
|
||||
my @tmparray = ();
|
||||
foreach my $nicname (keys %{$nicattrs{$nicattr}})
|
||||
{
|
||||
# eth0!1.1.1.1|1.2.1.1
|
||||
push @tmparray, "$nicname!$nicattrs{$nicattr}{$nicname}";
|
||||
}
|
||||
# eth0!1.1.1.1|1.2.1.1,eth1!2.1.1.1|2.2.1.1
|
||||
$nodeattrhash->{$nicattr} = join(',', @tmparray);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
+55
-26
@@ -592,6 +592,7 @@ sub _execute_dsh
|
||||
xCAT::MsgUtils->message("D", $rsp, $::CALLBACK);
|
||||
$rsp = {};
|
||||
push @{$rsp->{error}}, @{$error_buffers{$user_target}};
|
||||
$rsp->{NoErrorPrefix} = 1;
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK,0);
|
||||
}
|
||||
}
|
||||
@@ -607,6 +608,7 @@ sub _execute_dsh
|
||||
xCAT::MsgUtils->message("D", $rsp, $::CALLBACK);
|
||||
$rsp = {};
|
||||
push @{$rsp->{error}}, @{$error_buffers{$user_target}};
|
||||
$rsp->{NoErrorPrefix} = 1;
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK,0);
|
||||
|
||||
}
|
||||
@@ -815,7 +817,7 @@ sub fork_fanout_dcp
|
||||
my @dcp_command;
|
||||
my $rsyncfile;
|
||||
|
||||
if (!$$target_properties{'localhost'})
|
||||
if (!$$target_properties{'localhost'}) # this is to a remote host
|
||||
{
|
||||
my $target_type = $$target_properties{'type'};
|
||||
|
||||
@@ -837,6 +839,7 @@ sub fork_fanout_dcp
|
||||
|
||||
$rcp_config{'preserve'} = $$options{'preserve'};
|
||||
$rcp_config{'recursive'} = $$options{'recursive'};
|
||||
$rcp_config{'sudo'} = $$options{'sudo'};
|
||||
|
||||
if ($$options{'pull'})
|
||||
{
|
||||
@@ -869,21 +872,25 @@ sub fork_fanout_dcp
|
||||
my $localhost=0; # this is from the MN to another node
|
||||
@dcp_command =
|
||||
$remoteshell->remote_copy_command(\%rcp_config, $remote_copy);
|
||||
# add sudo for non-root users
|
||||
if ($$options{'sudo'}) {
|
||||
unshift (@dcp_command,'sudo');
|
||||
}
|
||||
|
||||
}
|
||||
else # this is the local host ( running on the Management Node)
|
||||
{
|
||||
if ($$options{'destDir_srcFile'}{$user_target})
|
||||
{
|
||||
my $target_type = $$target_properties{'type'};
|
||||
my $target_type = $$target_properties{'type'};
|
||||
|
||||
my %rcp_config = ();
|
||||
my %rcp_config = ();
|
||||
|
||||
my $remote_copy;
|
||||
my $rsh_extension = 'RSH';
|
||||
my $remote_copy;
|
||||
my $rsh_extension = 'RSH';
|
||||
|
||||
if ($target_type eq 'node')
|
||||
{
|
||||
if ($target_type eq 'node')
|
||||
{
|
||||
$remote_copy =
|
||||
$$options{'node-rcp'}{$$target_properties{'context'}}
|
||||
|| $$target_properties{'remote-copy'};
|
||||
@@ -891,10 +898,10 @@ sub fork_fanout_dcp
|
||||
($remote_copy =~ /\/rsync$/) && ($rsh_extension = 'RSYNC');
|
||||
$rcp_config{'options'} =
|
||||
$$options{'node-options'}{$$target_properties{'context'}};
|
||||
}
|
||||
}
|
||||
|
||||
$rcp_config{'preserve'} = $$options{'preserve'};
|
||||
$rcp_config{'recursive'} = $$options{'recursive'};
|
||||
$rcp_config{'preserve'} = $$options{'preserve'};
|
||||
$rcp_config{'recursive'} = $$options{'recursive'};
|
||||
|
||||
|
||||
$rcp_config{'src-file'} = $$options{'source'};
|
||||
@@ -905,20 +912,19 @@ sub fork_fanout_dcp
|
||||
$rcp_config{'destDir_srcFile'} =
|
||||
$$options{'destDir_srcFile'}{$user_target};
|
||||
|
||||
#eval "require RemoteShell::$rsh_extension";
|
||||
eval "require xCAT::$rsh_extension";
|
||||
my $remoteshell = "xCAT::$rsh_extension";
|
||||
# HERE: Build the dcp command based on the arguments
|
||||
my $localhost=1; # this is on the MN to the MN
|
||||
@dcp_command =
|
||||
eval "require xCAT::$rsh_extension";
|
||||
my $remoteshell = "xCAT::$rsh_extension";
|
||||
# HERE: Build the dcp command based on the arguments
|
||||
my $localhost=1; # this is on the MN to the MN
|
||||
@dcp_command =
|
||||
$remoteshell->remote_copy_command(\%rcp_config, $remote_copy,$localhost);
|
||||
|
||||
}
|
||||
else # just a copy not a sync
|
||||
{
|
||||
}
|
||||
else # just a copy not a sync
|
||||
{
|
||||
@dcp_command =
|
||||
('/bin/cp', '-r', $$options{'source'}, $$options{'target'});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $rsp = {};
|
||||
@@ -1034,6 +1040,28 @@ sub fork_fanout_dsh
|
||||
|
||||
if ($$options{'environment'})
|
||||
{
|
||||
# if we are on a servicenode need to get the environment file
|
||||
# from the SNsyncfiledir, not local
|
||||
if (xCAT::Utils->isServiceNode()) {
|
||||
my $newenvfile;
|
||||
my $synfiledir = "/var/xcat/syncfiles"; #default
|
||||
|
||||
# get the directory on the servicenode to and add to filepath
|
||||
my @syndir= xCAT::TableUtils->get_site_attribute("SNsyncfiledir");
|
||||
if ($syndir[0])
|
||||
{
|
||||
$synfiledir = $syndir[0];
|
||||
}
|
||||
$newenvfile = $synfiledir;
|
||||
$newenvfile .= $$options{'environment'};
|
||||
$$options{'environment'} = $newenvfile;
|
||||
}
|
||||
if (!(-e $$options{'environment'}))
|
||||
{
|
||||
my $rsp={};
|
||||
$rsp->{error}->[0] = "File $$options{'environment'} does not exist";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
}
|
||||
push @dsh_command,
|
||||
"$$options{'pre-command'} . $$options{'environment'} ; $$options{'command'}$$options{'post-command'}";
|
||||
}
|
||||
@@ -1163,13 +1191,13 @@ sub fork_fanout_dsh
|
||||
if ($$options{'execute'})
|
||||
{
|
||||
# first build the scp command to copy the file to execute
|
||||
# down to the node into /tmp/*.dsh
|
||||
# down to the node into /tmp/*.dsh
|
||||
my $rsp = {};
|
||||
$rsp->{data}->[0] = "TRACE: Execute option specified.";
|
||||
$dsh_trace && (xCAT::MsgUtils->message("I", $rsp, $::CALLBACK));
|
||||
|
||||
my %exe_rcp_config = ();
|
||||
$tmp_cmd_file = POSIX::tmpnam . ".dsh";
|
||||
$tmp_cmd_file = POSIX::tmpnam . ".dsh";
|
||||
|
||||
my ($exe_cmd, @args) = @{$$options{'execute'}};
|
||||
my $chmod_cmd = "";
|
||||
@@ -4216,7 +4244,7 @@ sub usage_dcp
|
||||
{
|
||||
### usage message
|
||||
my $usagemsg1 = " xdcp -h \n xdcp -q\n xdcp -V \n xdcp <noderange>\n";
|
||||
my $usagemsg2 = " [-B bypass] [-c] [-f fanout] [-l user_ID]\n";
|
||||
my $usagemsg2 = " [-B bypass] [-c] [-f fanout] [-l user_ID] [--sudo]\n";
|
||||
my $usagemsg3 =
|
||||
" [-m] [-o options] [-p] [-P] [-q] [-Q] [-r node_remote_copy]\n";
|
||||
my $usagemsg4 =
|
||||
@@ -4325,7 +4353,8 @@ sub parse_and_run_dcp
|
||||
'T|trace' => \$options{'trace'},
|
||||
'V|version' => \$options{'version'},
|
||||
'devicetype=s' => \$options{'devicetype'},
|
||||
'nodestatus|nodestatus' => \$options{'nodestatus'},
|
||||
'nodestatus|nodestatus' => \$options{'nodestatus'},
|
||||
'sudo|sudo' => \$options{'sudo'},
|
||||
'X:s' => \$options{'ignore_env'}
|
||||
)
|
||||
)
|
||||
@@ -4570,8 +4599,8 @@ sub parse_and_run_dcp
|
||||
close FILE;
|
||||
# now put the original syncfile on the queue to sync to the SN's
|
||||
$rc =
|
||||
&parse_rsync_input_file_on_MN(\@nodelist, \%options, $tmpsyncfile,
|
||||
$::SYNCSN, $synfiledir,$nodesyncfiledir);
|
||||
&parse_rsync_input_file_on_MN(\@nodelist, \%options,$tmpsyncfile,
|
||||
$::SYNCSN, $synfiledir,$nodesyncfiledir);
|
||||
# cleanup
|
||||
my $cmd = "rm $tmpsyncfile";
|
||||
my @output = xCAT::Utils->runcmd($cmd, 0);
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
package xCAT::DiscoveryUtils;
|
||||
|
||||
use strict;
|
||||
use XML::Simple;
|
||||
$XML::Simple::PREFERRED_PARSER='XML::Parser';
|
||||
|
||||
use xCAT::MsgUtils;
|
||||
|
||||
=head3 update_discovery_data
|
||||
Update the discovery data from the xcat request to discoverydata table to indicate the discovery events
|
||||
arg1 - the request
|
||||
|
||||
=cut
|
||||
|
||||
sub update_discovery_data {
|
||||
my $class = shift;
|
||||
my $request = shift;
|
||||
|
||||
my %disdata;
|
||||
my %otherdata;
|
||||
|
||||
unless ($request->{'uuid'}->[0]) {
|
||||
xCAT::MsgUtils->message("S", "Discovery Error: Found a node without uuid");
|
||||
}
|
||||
|
||||
if ($request->{'discoverymethod'}->[0]) {
|
||||
$disdata{'method'} = $request->{'discoverymethod'}->[0];
|
||||
} else {
|
||||
$disdata{'method'} = "undef";
|
||||
}
|
||||
|
||||
#discoverytime
|
||||
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
|
||||
my $currtime = sprintf("%02d-%02d-%04d %02d:%02d:%02d",
|
||||
$mon + 1, $mday, $year + 1900, $hour, $min, $sec);
|
||||
$disdata{'discoverytime'} = $currtime;
|
||||
|
||||
foreach my $attr (keys %$request) {
|
||||
if ($attr =~ /^(command|discoverymethod|_xcat|cacheonly|noderange|environment)/) {
|
||||
next;
|
||||
} elsif ($attr =~ /^(node|uuid|arch|cpucount|cputype|memory|mtm|serial)$/) {
|
||||
$disdata{$attr} = $request->{$attr}->[0];
|
||||
} elsif ($attr eq 'nic') {
|
||||
# Set the nics attributes
|
||||
foreach my $nic (@{$request->{nic}}) {
|
||||
my $nicname = $nic->{'devname'}->[0];
|
||||
foreach my $nicattr (keys %$nic) {
|
||||
my $tbattr;
|
||||
if ($nicattr eq 'driver') {
|
||||
$tbattr = "nicdriver";
|
||||
} elsif ($nicattr eq 'ip4address') {
|
||||
$tbattr = "nicipv4";
|
||||
} elsif ($nicattr eq 'hwaddr') {
|
||||
$tbattr = "nichwaddr";
|
||||
} elsif ($nicattr eq 'pcidev') {
|
||||
$tbattr = "nicpci";
|
||||
} elsif ($nicattr eq 'location') {
|
||||
$tbattr = "nicloc";
|
||||
} elsif ($nicattr eq 'onboardeth') {
|
||||
$tbattr = "niconboard";
|
||||
} elsif ($nicattr eq 'firmdesc') {
|
||||
$tbattr = "nicfirm";
|
||||
} elsif ($nicattr =~ /^(switchname|switchaddr|switchdesc|switchport)$/) {
|
||||
$tbattr = $nicattr;
|
||||
}
|
||||
|
||||
if ($tbattr) {
|
||||
if ($disdata{$tbattr}) {
|
||||
$disdata{$tbattr} .= ','.$nicname.'!'.$nic->{$nicattr}->[0];
|
||||
} else {
|
||||
$disdata{$tbattr} = $nicname.'!'.$nic->{$nicattr}->[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
# store to otherdata for the not parsed attributes
|
||||
$otherdata{$attr} = $request->{$attr};
|
||||
}
|
||||
}
|
||||
|
||||
if (keys %otherdata) {
|
||||
$disdata{'otherdata'} = XMLout(\%otherdata,RootName=>'discoveryotherdata' ,NoAttr=>1);
|
||||
}
|
||||
|
||||
my $distab = xCAT::Table->new('discoverydata');
|
||||
if ($distab) {
|
||||
$distab->setAttribs({uuid=>$request->{'uuid'}->[0]},\%disdata);
|
||||
$distab->close();
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -67,7 +67,7 @@ sub getHcpAttribs
|
||||
}
|
||||
}
|
||||
|
||||
my @ps = $tabs->{ppc}->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
my @ps = $tabs->{ppc}->getAllNodeAttribs(['node','parent','nodetype','hcp']);
|
||||
for my $entry ( @ps ) {
|
||||
my $tmp_parent = $entry->{parent};
|
||||
my $tmp_node = $entry->{node};
|
||||
@@ -76,6 +76,9 @@ sub getHcpAttribs
|
||||
push @{$ppchash{$tmp_parent}{children}}, $tmp_node;
|
||||
#push @{$ppchash{$tmp_parent}}, $tmp_node;
|
||||
}
|
||||
if (defined($tmp_node) && defined($tmp_type) && ($tmp_type eq "blade") && defined($entry->{hcp})) {
|
||||
push @{$ppchash{$tmp_node}{children}}, $entry->{hcp};
|
||||
}
|
||||
|
||||
#if(exists($ppchash{$tmp_node})) {
|
||||
# if( defined($tmp_type) ) {
|
||||
@@ -173,6 +176,8 @@ sub getIPaddress
|
||||
#the $nodetocheck is its' hcp. So set $nodetocheck to $parent variable.
|
||||
#And then get the FSPs IPs for the CEC.
|
||||
$parent = $nodetocheck;
|
||||
} elsif ($type eq "blade") {
|
||||
return $ppc->{$nodetocheck}->{children}->[0];
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ sub powercmd {
|
||||
if($action =~ /^lowpower$/) { $action = "cec_on_low_power"; }
|
||||
#if($action =~ /^cycle$/) {$action = "cec_reboot";}
|
||||
if($action =~ /^cycle$/) {$action = "reset";}
|
||||
if($action !~ /^cec_on_autostart$/ && $action !~ /^cec_off$/ && $action !~ /^cec_on_low_power$/ && $action !~ /^onstandby$/ && $action !~ /^reboot_service_processor$/ && $action !~ /^reset$/) {
|
||||
if($action !~ /^cec_on_autostart$/ && $action !~ /^cec_off$/ && $action !~ /^cec_on_low_power$/ && $action !~ /^onstandby$/ && $action !~ /^reboot_service_processor$/ && $action !~ /^reset$/ && $action !~ /^sms$/) {
|
||||
push @output, [$node_name, "\'$action\' command not supported for $$d[4]", -1 ];
|
||||
return (\@output);
|
||||
}
|
||||
|
||||
@@ -116,6 +116,9 @@ sub enumerate_lcds {
|
||||
} else {
|
||||
my @array = split(/\n/, $data);
|
||||
foreach my $a (@array) {
|
||||
if ($a !~ /:\s?[^\s]*\s?[0|1]/) {
|
||||
next;
|
||||
}
|
||||
my @t = split(/:/, $a);
|
||||
my $name = $t[0];
|
||||
$data = $t[1];
|
||||
@@ -429,8 +432,10 @@ sub lcds {
|
||||
}
|
||||
}
|
||||
|
||||
if( $type =~ /lpar|blade/ ) {
|
||||
if( $type eq "lpar" ) {
|
||||
$action = "query_lcds";
|
||||
} elsif ($type eq "blade") {
|
||||
$action = "pblade_query_lcds";
|
||||
} else {
|
||||
$action = "cec_query_lcds";
|
||||
}
|
||||
|
||||
@@ -2196,7 +2196,6 @@ sub isValidHostname
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 isValidFQDN
|
||||
|
||||
@@ -99,7 +99,7 @@ sub mkhwconn_parse_args
|
||||
#my $nodetype_hash = $nodetypetab->getNodeAttribs( $node,[qw(nodetype)]);
|
||||
my $node_parent_hash = $ppctab->getNodeAttribs( $node,[qw(parent)]);
|
||||
#$nodetype = $nodetype_hash->{nodetype};
|
||||
$nodetype = xCAT::DBobjUtils->getnodetype($node);
|
||||
$nodetype = xCAT::DBobjUtils->getnodetype($node,"ppc");
|
||||
$node_parent = $node_parent_hash->{parent};
|
||||
if ( !$nodetype )
|
||||
{
|
||||
@@ -107,7 +107,7 @@ sub mkhwconn_parse_args
|
||||
next;
|
||||
} else
|
||||
{
|
||||
unless ( $nodetype =~ /^(fsp|bpa|frame|cec|hmc)$/)
|
||||
unless ( $nodetype =~ /^(blade|fsp|bpa|frame|cec|hmc)$/)
|
||||
{
|
||||
return ( usage("Node type is incorrect. \n"));
|
||||
}
|
||||
@@ -486,8 +486,9 @@ sub mkhwconn
|
||||
# Get IP address
|
||||
############################
|
||||
my $cnode;
|
||||
my $ntype = xCAT::DBobjUtils::getnodetype($node_name);
|
||||
if ($ntype =~ /^(cec|frame)$/)
|
||||
#my $ntype = xCAT::DBobjUtils::getnodetype($node_name);
|
||||
my $ntype = $$d[4];
|
||||
if ($ntype =~ /^(cec|frame|blade)$/)
|
||||
{
|
||||
$cnode = xCAT::DBobjUtils::getchildren($node_name, $opt->{port});
|
||||
} else {
|
||||
@@ -518,12 +519,17 @@ sub mkhwconn
|
||||
next;
|
||||
}
|
||||
|
||||
my ( undef,undef,$mtms,undef,$type) = @$d;
|
||||
my ( undef,undef,$mtms,undef,$type,$bpa) = @$d;
|
||||
my ($user, $passwd);
|
||||
if ( exists $opt->{P})
|
||||
{
|
||||
($user, $passwd) = ('HMC', $opt->{P});
|
||||
}
|
||||
elsif ($type eq "blade") {
|
||||
$user = "USERID";
|
||||
($user, $passwd) = xCAT::PPCdb::credentials( $bpa, $type, $user);
|
||||
$type = "cec";
|
||||
}
|
||||
else
|
||||
{
|
||||
($user, $passwd) = xCAT::PPCdb::credentials( $node_name, $type,'HMC');
|
||||
@@ -707,7 +713,7 @@ sub rmhwconn
|
||||
my $d = $node_hash->{$node_name};
|
||||
|
||||
my ( undef,undef,undef,undef,$type) = @$d;
|
||||
|
||||
if ($type eq "blade") {$type = "cec";}
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
@@ -724,10 +730,19 @@ sub rmhwconn
|
||||
|
||||
my @ips;
|
||||
foreach my $entry ( @$nodes_found ) {
|
||||
if ( $entry =~ /$mtm\*$serial/) {
|
||||
$entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
push @ips, $1;
|
||||
if ($entry =~ /type_model_serial_num=([^,]*),/) {
|
||||
my $match_mtm1 = $1;
|
||||
my $match_mtm2 = $match_mtm1;
|
||||
$match_mtm2 =~ s/\-//;
|
||||
if ($match_mtm1 =~ /$mtm\*$serial/ || $match_mtm2 =~ /$mtm\*$serial/) {
|
||||
$entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
push @ips, $1;
|
||||
}
|
||||
}
|
||||
#if ( $entry =~ /$mtm\*$serial/) {
|
||||
# $entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
# push @ips, $1;
|
||||
#}
|
||||
}
|
||||
if (!@ips)
|
||||
{
|
||||
|
||||
@@ -541,56 +541,6 @@ sub get_allnode_singleattrib_hash
|
||||
return \%allrecords;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 get_db_swtiches
|
||||
Description : Get all records of switch config from a table, then return a string list.
|
||||
Arguments : $tabname - the table name.
|
||||
Returns : Reference of the records hash.
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub get_db_switches
|
||||
{
|
||||
my $class = shift;
|
||||
my $table = xCAT::Table->new("switches");
|
||||
my @attribs = ("switch");
|
||||
my @entries = $table->getAllAttribs(@attribs);
|
||||
$table->close();
|
||||
my %allrecords;
|
||||
foreach (@entries)
|
||||
{
|
||||
if ($_->{'switch'}){
|
||||
$allrecords{$_->{'switch'}} = 0;
|
||||
}
|
||||
}
|
||||
return \%allrecords;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 get_db_swtichports
|
||||
Description : Get all records of switch config from a table, then return a string list.
|
||||
Arguments : $tabname - the table name.
|
||||
Returns : Reference of the records hash.
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub get_db_switchports
|
||||
{
|
||||
my $class = shift;
|
||||
my $table = xCAT::Table->new("switch");
|
||||
my @attribs = ("switch", "port");
|
||||
my @entries = $table->getAllAttribs(@attribs);
|
||||
$table->close();
|
||||
my %allrecords;
|
||||
foreach (@entries)
|
||||
{
|
||||
$allrecords{$_->{'switch'} . "_" . $_->{'port'}} = 0;
|
||||
}
|
||||
return \%allrecords;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 is_discover_started
|
||||
|
||||
+13
-1
@@ -98,13 +98,21 @@ sub remote_copy_command
|
||||
{
|
||||
if (-e ("/usr/bin/rsync")) {
|
||||
if (($usersh == 0) || ($localhost == 1)) { # using ssh, or local
|
||||
if ($$config{'sudo'}){
|
||||
$sync_opt = '--rsync-path=sudo /usr/bin/rsync ';
|
||||
} else {
|
||||
$sync_opt = '--rsync-path /usr/bin/rsync ';
|
||||
}
|
||||
} else {
|
||||
$sync_opt = '--rsh /bin/rsh --rsync-path /usr/bin/rsync ';
|
||||
}
|
||||
} else {
|
||||
if (($usersh == 0) || ($localhost == 1)) { # using ssh, or local
|
||||
$sync_opt = '--rsync-path /usr/local/bin/rsync ';
|
||||
if ($$config{'sudo'}){
|
||||
$sync_opt = '--rsync-path=sudo /usr/local/bin/rsync ';
|
||||
} else {
|
||||
$sync_opt = '--rsync-path=/usr/local/bin/rsync ';
|
||||
}
|
||||
} else {
|
||||
$sync_opt = '--rsh /bin/rsh --rsync-path /usr/local/bin/rsync ';
|
||||
}
|
||||
@@ -112,7 +120,11 @@ sub remote_copy_command
|
||||
}
|
||||
else #linux
|
||||
{
|
||||
if ($$config{'sudo'}) {
|
||||
$sync_opt = '--rsync-path=\'sudo /usr/bin/rsync\' ';
|
||||
} else {
|
||||
$sync_opt = '--rsync-path /usr/bin/rsync ';
|
||||
}
|
||||
}
|
||||
# if only syncing the service node or
|
||||
# (no postscripts and no append lines) then do not
|
||||
|
||||
@@ -90,7 +90,7 @@ sub dodiscover {
|
||||
}
|
||||
}
|
||||
my $printinfo = join(",", @printip);
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback} and !$args{nomsg} );
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype);
|
||||
}
|
||||
@@ -170,12 +170,12 @@ sub dodiscover {
|
||||
$interval = time() - $startinterval;
|
||||
if ($args{Time} and $args{Count}) {
|
||||
if ($rspcount >= $args{Count} or $interval >= $args{Time}) {
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
last;
|
||||
}
|
||||
}
|
||||
if ($sendcount > $retrytime and $rspcount1 == 0) {
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
last;
|
||||
}
|
||||
#########################
|
||||
@@ -184,8 +184,8 @@ sub dodiscover {
|
||||
if ( $interval > $retryinterval){#* (2**$sendcount))) { #double time
|
||||
$sendcount++;
|
||||
$startinterval = time();
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback} and !$args{nomsg});
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype);
|
||||
}
|
||||
|
||||
+118
-35
@@ -61,7 +61,7 @@ statelite => {
|
||||
#seriously evaluate wider support of multi-domain environments, will leave them
|
||||
#commented rather than tempt people to try with an expectation that it could work.
|
||||
domain => {
|
||||
cols => [qw(node ou authdomain comments disable)],
|
||||
cols => [qw(node ou authdomain adminuser adminpassword type comments disable)],
|
||||
keys => ['node'],
|
||||
table_desc => 'Mapping of nodes to domain attributes',
|
||||
descriptions => {
|
||||
@@ -70,6 +70,9 @@ domain => {
|
||||
# the above column is unimplemented by anything, so leave it out for this pass
|
||||
ou => 'For an LDAP described machine account (i.e. Active Directory), the orginaztional unit to place the system. If not set, defaults to cn=Computers,dc=your,dc=domain',
|
||||
authdomain => 'If a node should participate in an AD domain or Kerberos realm distinct from domain indicated in site, this field can be used to specify that',
|
||||
adminuser => 'Allow a node specific indication of Administrative user. Most will want to just use passwd table to indicate this once rather than by node.',
|
||||
adminpassword => 'Allow a node specific indication of Administrative user password for the domain. Most will want to ignore this in favor of passwd table.',
|
||||
type => 'Type, if any, of authentication domain to manipulate. The only recognized value at the moment is activedirectory.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@@ -261,20 +264,24 @@ virtsd => {
|
||||
},
|
||||
|
||||
storage => {
|
||||
cols => [qw(node osvolume comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_descr => "Node storage resources",
|
||||
descriptions => {
|
||||
'node' => 'The node name',
|
||||
osvolume => "Specification of what storage to place the node OS image onto. Examples include:
|
||||
localdisk (Install to first non-FC attached disk)
|
||||
usbdisk (Install to first USB mass storage deice seen)
|
||||
wwn=0x50000393c813840c (Install to storage device with given WWN)
|
||||
WARNING: This is as yet unimplemented by the stock OS deployment templates
|
||||
WARNING: SAS SAN devices may be considered to be 'localdisk' class.
|
||||
The default behavior if unspecified is presumed to be 'localdisk'",
|
||||
}
|
||||
},
|
||||
cols => [qw(node osvolume size state storagepool fcprange volumetag comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_descr => 'Node storage resources',
|
||||
descriptions => {
|
||||
node => 'The node name',
|
||||
osvolume => "Specification of what storage to place the node OS image onto. Examples include:
|
||||
localdisk (Install to first non-FC attached disk)
|
||||
usbdisk (Install to first USB mass storage device seen)
|
||||
wwn=0x50000393c813840c (Install to storage device with given WWN)",
|
||||
size => 'Size of the volume. Examples include: 10G, 1024M.',
|
||||
state => 'State of the volume. The valid values are: free, used, and allocated',
|
||||
storagepool => 'Name of storage pool where the volume is assigned.',
|
||||
fcprange => 'A range of acceptable fibre channels that the volume can use. Examples include: 3B00-3C00;4B00-4C00.',
|
||||
volumetag => 'A specific tag used to identify the volume in the autoyast or kickstart template.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
}
|
||||
},
|
||||
websrv => {
|
||||
cols => [qw(node port username password comments disable)],
|
||||
keys => [qw(node)],
|
||||
@@ -338,7 +345,7 @@ chain => {
|
||||
node => 'The node name or group name.',
|
||||
currstate => 'The current or next chain step to be executed on this node by xCAT-genesis. Set by xCAT during node discovery or as a result of nodeset.',
|
||||
currchain => 'The chain steps still left to do for this node. This attribute will be automatically adjusted by xCAT while xCAT-genesis is running on the node (either during node discovery or a special operation like firmware update). During node discovery, this attribute is initialized from the chain attribute and updated as the chain steps are executed.',
|
||||
chain => 'A comma-delimited chain of actions to be performed automatically when this node is discovered. ("Discovered" means a node booted, but xCAT and DHCP did not recognize the MAC of this node. In this case, xCAT initiates the discovery process, the last step of which is to run the operations listed in this chain attribute.) Valid values: discover, boot or reboot, install or netboot, runcmd=<cmd>, runimage=<URL>, shell, standby. (Default - same as no chain). Example, for BMC machines use: runcmd=bmcsetup,shell.',
|
||||
chain => 'A comma-delimited chain of actions to be performed automatically when this node is discovered. ("Discovered" means a node booted, but xCAT and DHCP did not recognize the MAC of this node. In this situation, xCAT initiates the discovery process, the last step of which is to run the operations listed in this chain attribute, one by one.) Valid values: boot or reboot, install or netboot, runcmd=<cmd>, runimage=<URL>, shell, standby. (Default - same as no chain - it will do only the discovery.). Example, for BMC machines use: runcmd=bmcsetup,shell.',
|
||||
ondiscover => 'This attribute is currently not used by xCAT. The "nodediscover" operation is always done during node discovery.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
@@ -580,7 +587,7 @@ nodepos => {
|
||||
},
|
||||
},
|
||||
noderes => {
|
||||
cols => [qw(node servicenode netboot tftpserver tftpdir nfsserver monserver nfsdir installnic primarynic discoverynics cmdinterface xcatmaster current_osimage next_osimage nimserver routenames comments disable)],
|
||||
cols => [qw(node servicenode netboot tftpserver tftpdir nfsserver monserver nfsdir installnic primarynic discoverynics cmdinterface xcatmaster current_osimage next_osimage nimserver routenames nameservers comments disable)],
|
||||
keys => [qw(node)],
|
||||
tablespace =>'XCATTBS16K',
|
||||
table_desc => 'Resources and settings to use when installing nodes.',
|
||||
@@ -602,6 +609,7 @@ noderes => {
|
||||
next_osimage => 'Not currently used. The name of the osimage data object that represents the OS image that will be installed on the node the next time it is deployed.',
|
||||
nimserver => 'Not used for now. The NIM server for this node (as known by this node).',
|
||||
routenames => 'A comma separated list of route names that refer to rows in the routes table. These are the routes that should be defined on this node when it is deployed.',
|
||||
nameservers => 'An optional node/group specific override for name server list. Most people want to stick to site or network defined nameserver configuration.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@@ -697,8 +705,8 @@ linuximage => {
|
||||
template => 'The fully qualified name of the template file that is used to create the kick start file for diskful installation.',
|
||||
boottarget => 'The name of the boottarget definition. When this attribute is set, xCAT will use the kernel, initrd and kernel params defined in the boottarget definition instead of the default.',
|
||||
addkcmdline=> 'User specified arguments to be passed to the kernel. The user arguments are appended to xCAT.s default kernel arguments. This attribute is ignored if linuximage.boottarget is set.',
|
||||
pkglist => 'The fully qualified name of the file that stores the distro packages list that will be included in the image.',
|
||||
pkgdir => 'The name of the directory where the distro packages are stored.',
|
||||
pkglist => 'The fully qualified name of the file that stores the distro packages list that will be included in the image. Make sure that if the pkgs in the pkglist have dependency pkgs, the dependency pkgs should be found in one of the pkgdir',
|
||||
pkgdir => 'The name of the directory where the distro packages are stored. It could be set multiple paths.The multiple paths must be seperated by ",". The first path in the value of osimage.pkgdir must be the OS base pkg dir path, such as pkgdir=/install/rhels6.2/x86_64,/install/updates . In the os base pkg path, there are default repository data. And in the other pkg path(s), the users should make sure there are repository data. If not, use "createrepo" command to create them. ',
|
||||
otherpkglist => 'The fully qualified name of the file that stores non-distro package lists that will be included in the image.',
|
||||
otherpkgdir => 'The base directory where the non-distro packages are stored.',
|
||||
exlist => 'The fully qualified name of the file that stores the file names and directory names that will be excluded from the image during packimage command. It is used for diskless image only.',
|
||||
@@ -889,7 +897,7 @@ site => {
|
||||
" failed nodes for any xCAT commands. See the 'noderange' manpage for\n".
|
||||
" details on supported formats.\n\n".
|
||||
" forwarders: The DNS servers at your site that can provide names outside of the\n".
|
||||
" cluster. The makedns command will configuire the DNS on the management\n".
|
||||
" cluster. The makedns command will configure the DNS on the management\n".
|
||||
" node to forward requests it does not know to these servers.\n".
|
||||
" Note that the DNS servers on the service nodes will ignore this value\n".
|
||||
" and always be configured to forward requests to the management node.\n\n".
|
||||
@@ -1038,6 +1046,8 @@ site => {
|
||||
" and node requests, e.g. to get postscripts. Default is 64.\n\n".
|
||||
" xcatdport: The port used by the xcatd daemon for client/server communication.\n\n".
|
||||
" xcatiport: The port used by xcatd to receive install status updates from nodes.\n\n",
|
||||
" xcatsslversion: The ssl version by xcatd. Default is SSLv3.\n\n",
|
||||
" xcatsslciphers: The ssl cipher by xcatd. Default is 3DES.\n\n",
|
||||
value => 'The value of the attribute specified in the "key" column.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
@@ -1216,7 +1226,7 @@ routes => {
|
||||
routename => 'Name used to identify this route.',
|
||||
net => 'The network address.',
|
||||
mask => 'The network mask.',
|
||||
ifname => '(optional) The interface name of the management node facing the gateway.',
|
||||
ifname => 'The interface name that facing the gateway. It is optional for IPv4 routes, but it is required for IPv6 routes.',
|
||||
gateway => 'The gateway that routes the ip traffic from the mn to the nodes. It is usually a service node.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
@@ -1261,29 +1271,27 @@ nics => {
|
||||
nicips => 'Comma-separated list of IP addresses per NIC. To specify one ip address per NIC:
|
||||
<nic1>!<ip1>,<nic2>!<ip2>,..., for example, eth0!10.0.0.100,ib0!11.0.0.100
|
||||
To specify multiple ip addresses per NIC:
|
||||
<nic1>!<ip1>|<ip2>,<nic2>!<ip1>|<ip2>,..., for example, eth0!10.0.0.100|fd55::214:5eff:fe15:849b,ib0!11.0.0.100|2001::214:5eff:fe15:849a
|
||||
<nic1>!<ip1>|<ip2>,<nic2>!<ip1>|<ip2>,..., for example, eth0!10.0.0.100|fd55::214:5eff:fe15:849b,ib0!11.0.0.100|2001::214:5eff:fe15:849a. The xCAT object definition commands support to use nicips.<nicname> as the sub attributes.
|
||||
Note: The primary IP address must also be stored in the hosts.ip attribute. The nichostnamesuffixes should specify one hostname suffix for each ip address.',
|
||||
nichostnamesuffixes => 'Comma-separated list of hostname suffixes per NIC.
|
||||
If only one ip address is associated with each NIC:
|
||||
<nic1>!<ext1>,<nic2>!<ext2>,..., for example, eth0!-eth0,ib0!-ib0
|
||||
If multiple ip addresses are associcated with each NIC:
|
||||
<nic1>!<ext1>|<ext2>,<nic2>!<ext1>|<ext2>,..., for example, eth0!-eth0|-eth0-ipv6,ib0!-ib0|-ib0-ipv6.',
|
||||
nictypes => 'Comma-separated list of NIC types per NIC. <nic1>!<type1>,<nic2>!<type2>, e.g. eth0!Ethernet,ib0!Infiniband',
|
||||
niccustomscripts => 'Comma-separated list of custom scripts per NIC. <nic1>!<script1>,<nic2>!<script2>, e.g. eth0!configeth eth0, ib0!configib ib0
|
||||
<nic1>!<ext1>|<ext2>,<nic2>!<ext1>|<ext2>,..., for example, eth0!-eth0|-eth0-ipv6,ib0!-ib0|-ib0-ipv6.
|
||||
The xCAT object definition commands support to use nichostnamesuffixes.<nicname> as the sub attributes.
|
||||
Note: According to DNS rules a hostname must be a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-),and period (.). When you are specifying "nichostnamesuffixes" or "nicaliases" make sure the resulting hostnames will conform to this naming convention',
|
||||
nictypes => 'Comma-separated list of NIC types per NIC. <nic1>!<type1>,<nic2>!<type2>, e.g. eth0!Ethernet,ib0!Infiniband. The xCAT object definition commands support to use nictypes.<nicname> as the sub attributes.',
|
||||
niccustomscripts => 'Comma-separated list of custom scripts per NIC. <nic1>!<script1>,<nic2>!<script2>, e.g. eth0!configeth eth0, ib0!configib ib0. The xCAT object definition commands support to use niccustomscripts.<nicname> as the sub attribute
|
||||
.',
|
||||
nicnetworks => 'Comma-separated list of networks connected to each NIC.
|
||||
If only one ip address is associated with each NIC:
|
||||
<nic1>!<network1>,<nic2>!<network2>, for example, eth0!10_0_0_0-255_255_0_0, ib0!11_0_0_0-255_255_0_0
|
||||
If multiple ip addresses are associated with each NIC:
|
||||
<nic1>!<network1>|<network2>,<nic2>!<network1>|<network2>, for example, eth0!10_0_0_0-255_255_0_0|fd55:faaf:e1ab:336::/64,ib0!11_0_0_0-255_255_0_0|2001:db8:1:0::/64
|
||||
',
|
||||
nicaliases => 'NOT YET IMPLEMENTED.
|
||||
|
||||
Comma-separated list of aliases for each NIC.
|
||||
|
||||
Format: eth0!<alias>,eth1!<alias1>|<alias2>
|
||||
For example: eth0!moe,eth1!larry|curly',
|
||||
|
||||
<nic1>!<network1>|<network2>,<nic2>!<network1>|<network2>, for example, eth0!10_0_0_0-255_255_0_0|fd55:faaf:e1ab:336::/64,ib0!11_0_0_0-255_255_0_0|2001:db8:1:0::/64. The xCAT object definition commands support to use nicnetworks.<nicname> as the sub attributes.',
|
||||
nicaliases => 'Comma-separated list of hostname aliases for each NIC.
|
||||
Format: eth0!<alias list>,eth1!<alias1 list>|<alias2 list>
|
||||
For multiple aliases per nic use a space-separated list.
|
||||
For example: eth0!moe larry curly,eth1!tom|jerry',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@@ -1332,7 +1340,7 @@ osdistroupdate => {
|
||||
},
|
||||
},
|
||||
kit => {
|
||||
cols => [qw(kitname basename description version ostype isinternal kitdeployparams kitdir comments disable)],
|
||||
cols => [qw(kitname basename description version release ostype isinternal kitdeployparams kitdir comments disable)],
|
||||
keys => [qw(kitname)],
|
||||
table_desc => 'This table stores all kits added to the xCAT cluster.',
|
||||
descriptions => {
|
||||
@@ -1340,6 +1348,7 @@ kit => {
|
||||
basename => 'The kit base name',
|
||||
description => 'The Kit description.',
|
||||
version => 'The kit version',
|
||||
release => 'The kit release',
|
||||
ostype => 'The kit OS type. Linux or AIX.',
|
||||
isinternal => 'A flag to indicated if the Kit is internally used. When set to 1, the Kit is internal. If 0 or undefined, the kit is not internal.',
|
||||
kitdeployparams => 'The file containing the default deployment parameters for this Kit. These parameters are added to the OS Image definition.s list of deployment parameters when one or more Kit Components from this Kit are added to the OS Image.',
|
||||
@@ -1389,6 +1398,42 @@ kitcomponent => {
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
discoverydata => {
|
||||
cols => [qw(uuid node method discoverytime arch cpucount cputype memory mtm serial nicdriver nicipv4 nichwaddr nicpci nicloc niconboard nicfirm switchname switchaddr switchdesc switchport otherdata comments disable)],
|
||||
keys => [qw(uuid)],
|
||||
tablespace =>'XCATTBS32K',
|
||||
table_desc => 'Discovery data which sent from genesis.',
|
||||
types => {
|
||||
otherdata => 'VARCHAR(2048)',
|
||||
},
|
||||
descriptions => {
|
||||
uuid => 'The uuid of the node which send out the discovery request.',
|
||||
node => 'The node name which assigned to the discovered node.',
|
||||
method => 'The method which handled the discovery request. The method could be one of: switch, blade, profile, sequential.',
|
||||
discoverytime => 'The last time that xCAT received the discovery message.',
|
||||
arch => 'The architecture of the discovered node. e.g. x86_64.',
|
||||
cpucount => 'The cpu number of the discovered node. e.g. 32.',
|
||||
cputype => 'The cpu type of the discovered node. e.g. Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz',
|
||||
memory => 'The memory size of the discovered node. e.g. 198460852',
|
||||
mtm => 'The machine type model of the discovered node. e.g. 786310X',
|
||||
serial => 'The serial number of the discovered node. e.g. 1052EFB',
|
||||
nicdriver => 'The driver of the nic. The value should be comma separated <nic name!driver name>. e.g. eth0!be2net,eth1!be2net',
|
||||
nicipv4 => 'The ipv4 address of the nic. The value should be comma separated <nic name!ipv4 address>. e.g. eth0!10.0.0.212/8',
|
||||
nichwaddr => 'The hardware address of the nic. The should will be comma separated <nic name!hardware address>. e.g. eth0!34:40:B5:BE:DB:B0,eth1!34:40:B5:BE:DB:B4',
|
||||
nicpci => 'The pic device of the nic. The value should be comma separated <nic name!pci device>. e.g. eth0!0000:0c:00.0,eth1!0000:0c:00.1',
|
||||
nicloc => 'The location of the nic. The value should be comma separated <nic name!nic location>. e.g. eth0!Onboard Ethernet 1,eth1!Onboard Ethernet 2',
|
||||
niconboard => 'The onboard info of the nic. The value should be comma separated <nic name!onboard info>. e.g. eth0!1,eth1!2',
|
||||
nicfirm => 'The firmware description of the nic. The value should be comma separated <nic name!fimware description>. e.g. eth0!ServerEngines BE3 Controller,eth1!ServerEngines BE3 Controller',
|
||||
switchname => 'The switch name which the nic connected to. The value should be comma separated <nic name!switch name>. e.g. eth0!c909f06sw01',
|
||||
switchaddr => 'The address of the switch which the nic connected to. The value should be comma separated <nic name!switch address>. e.g. eth0!192.168.70.120',
|
||||
switchdesc => 'The description of the switch which the nic connected to. The value should be comma separated <nic name!switch description>. e.g. eth0!IBM Flex System Fabric EN4093 10Gb Scalable Switch, flash image: version 7.2.6, boot image: version 7.2.6',
|
||||
switchport => 'The port of the switch that the nic connected to. The value should be comma separated <nic name!switch port>. e.g. eth0!INTA2',
|
||||
otherdata => 'The left data which is not parsed to specific attributes (The complete message comes from genesis)',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
|
||||
); # end of tabspec definition
|
||||
|
||||
|
||||
@@ -1565,6 +1610,10 @@ my @nodeattrs = (
|
||||
{attr_name => 'netboot',
|
||||
tabentry => 'noderes.netboot',
|
||||
access_tabentry => 'noderes.node=attr:node',
|
||||
},
|
||||
{attr_name => 'nameservers',
|
||||
tabentry => 'noderes.nameservers',
|
||||
access_tabentry => 'noderes.node=attr:node',
|
||||
},
|
||||
{attr_name => 'routenames',
|
||||
tabentry => 'noderes.routenames',
|
||||
@@ -2089,6 +2138,36 @@ my @nodeattrs = (
|
||||
access_tabentry => 'nics.node=attr:node',
|
||||
},
|
||||
######################
|
||||
# prodkey table #
|
||||
######################
|
||||
{attr_name => 'productkey',
|
||||
tabentry => 'prodkey.key',
|
||||
access_tabentry => 'prodkey.node=attr:node',
|
||||
},
|
||||
######################
|
||||
# domain table #
|
||||
######################
|
||||
{attr_name => 'ou',
|
||||
tabentry => 'domain.ou',
|
||||
access_tabentry => 'domain.node=attr:node',
|
||||
},
|
||||
{attr_name => 'domainadminuser',
|
||||
tabentry => 'domain.adminuser',
|
||||
access_tabentry => 'domain.node=attr:node',
|
||||
},
|
||||
{attr_name => 'domainadminpassword',
|
||||
tabentry => 'domain.adminpassword',
|
||||
access_tabentry => 'domain.node=attr:node',
|
||||
},
|
||||
{attr_name => 'authdomain',
|
||||
tabentry => 'domain.authdomain',
|
||||
access_tabentry => 'domain.node=attr:node',
|
||||
},
|
||||
{attr_name => 'domaintype',
|
||||
tabentry => 'domain.type',
|
||||
access_tabentry => 'domain.node=attr:node',
|
||||
},
|
||||
######################
|
||||
# storage table #
|
||||
######################
|
||||
{attr_name => 'osvolume',
|
||||
@@ -3115,6 +3194,10 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
|
||||
tabentry => 'kit.version',
|
||||
access_tabentry => 'kit.kitname=attr:kitname',
|
||||
},
|
||||
{attr_name => 'release',
|
||||
tabentry => 'kit.release',
|
||||
access_tabentry => 'kit.kitname=attr:kitname',
|
||||
},
|
||||
{attr_name => 'ostype',
|
||||
tabentry => 'kit.ostype',
|
||||
access_tabentry => 'kit.kitname=attr:kitname',
|
||||
|
||||
@@ -28,7 +28,7 @@ use strict;
|
||||
Input: service nodename
|
||||
Output: Masternode, OS and ARCH
|
||||
Example:
|
||||
xCAT::ServiceNodeUtils->readSNInfo;
|
||||
my $retdata = xCAT::ServiceNodeUtils->readSNInfo;
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -81,18 +81,18 @@ sub readSNInfo
|
||||
|
||||
Checks the service node table in the database to see
|
||||
if input Service should be setup on the
|
||||
input service node
|
||||
input service node or Management Node (used by AAsn.pm)
|
||||
|
||||
Input:servicenodename,ipaddres(s) and hostnames of service node
|
||||
Output:
|
||||
array of services to setup for this service node
|
||||
hash of services to setup for this service node
|
||||
Globals:
|
||||
$::RUNCMD_RC = 0; good
|
||||
$::RUNCMD_RC = 1; error
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
@servicestosetup=xCAT::ServiceNodeUtils->isServiceReq($servicenodename, @serviceip) { blah; }
|
||||
$servicestosetup=xCAT::ServiceNodeUtils->isServiceReq($servicenodename, @serviceip) { blah; }
|
||||
|
||||
=cut
|
||||
|
||||
@@ -131,8 +131,14 @@ sub isServiceReq
|
||||
return; # do not setup anything
|
||||
}
|
||||
|
||||
my @process_service_list = ();
|
||||
# Are we on the MN
|
||||
my $mname;
|
||||
if (xCAT::Utils->isMN()) {
|
||||
my @nodeinfo = xCAT::NetworkUtils->determinehostname;
|
||||
$mname = pop @nodeinfo; # get hostname
|
||||
}
|
||||
|
||||
my $servicehash;
|
||||
# read all the nodes from the table, for each service
|
||||
foreach my $service (@services)
|
||||
{
|
||||
@@ -152,18 +158,36 @@ sub isServiceReq
|
||||
# value 1 or yes then we setup the service
|
||||
if (($value eq "1") || ($value eq "YES"))
|
||||
{
|
||||
push @process_service_list,
|
||||
$service; # found service to setup
|
||||
$servicehash->{$service} = "1";
|
||||
} else {
|
||||
$servicehash->{$service} = "0";
|
||||
}
|
||||
}
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
# if the ftpserver attribute is not defined in the service node table
|
||||
# and we are on
|
||||
# the Linux management node, we need to look at site.vsftp
|
||||
# if the tftpserver attribute is not defined, then we default it 1
|
||||
if (($mname) && (xCAT::Utils->isLinux())) {
|
||||
if (!exists($servicehash->{'ftpserver'})) {
|
||||
my @tmp = xCAT::TableUtils->get_site_attribute("vsftp");
|
||||
if ($tmp[0] && ($tmp[0] !~ /0|NO|No|no|N|n/ )) {
|
||||
$servicehash->{'ftpserver'} = 1;
|
||||
}
|
||||
}
|
||||
if (!exists($servicehash->{'tftpserver'})) {
|
||||
$servicehash->{'tftpserver'} = 1;
|
||||
}
|
||||
}
|
||||
$servicenodetab->close;
|
||||
|
||||
$::RUNCMD_RC = 0;
|
||||
return @process_service_list;
|
||||
return $servicehash;
|
||||
|
||||
}
|
||||
|
||||
|
||||
+28
-30
@@ -36,7 +36,7 @@
|
||||
package xCAT::Table;
|
||||
use xCAT::MsgUtils;
|
||||
use Sys::Syslog;
|
||||
use Storable qw/freeze thaw/;
|
||||
use Storable qw/freeze thaw store_fd fd_retrieve/;
|
||||
use IO::Socket;
|
||||
#use Data::Dumper;
|
||||
use POSIX qw/WNOHANG/;
|
||||
@@ -92,8 +92,6 @@ sub dbc_call {
|
||||
sub dbc_submit {
|
||||
my $request = shift;
|
||||
$request->{'wantarray'} = wantarray();
|
||||
my $data = freeze($request);
|
||||
$data.= "\nENDOFFREEZEQFVyo4Cj6Q0v\n";
|
||||
my $clisock;
|
||||
my $tries=300;
|
||||
while($tries and !($clisock = IO::Socket::UNIX->new(Peer => $dbsockpath, Type => SOCK_STREAM, Timeout => 120) ) ) {
|
||||
@@ -105,22 +103,20 @@ sub dbc_submit {
|
||||
use Carp qw/cluck/;
|
||||
cluck();
|
||||
}
|
||||
print $clisock $data;
|
||||
$data="";
|
||||
store_fd($request,$clisock);
|
||||
#print $clisock $data;
|
||||
my $data="";
|
||||
my $lastline="";
|
||||
while (read($clisock,$lastline,32768)) { #$lastline ne "ENDOFFREEZEQFVyo4Cj6Q0j\n" and $lastline ne "*XCATBUGDETECTED*76e9b54341\n") { #index($lastline,"ENDOFFREEZEQFVyo4Cj6Q0j") < 0) {
|
||||
# $lastline = <$clisock>;
|
||||
$data .= $lastline;
|
||||
}
|
||||
my $retdata = fd_retrieve($clisock);
|
||||
close($clisock);
|
||||
if ($lastline =~ m/\*XCATBUGDETECTED\*76e9b54341\n\z/) { #if it was an error
|
||||
if (ref $retdata eq "SCALAR") { #bug detected
|
||||
#in the midst of the operation, die like it used to die
|
||||
my $err;
|
||||
$data =~ /\*XCATBUGDETECTED\*:(.*):\*XCATBUGDETECTED\*/s;
|
||||
$$retdata =~ /\*XCATBUGDETECTED\*:(.*):\*XCATBUGDETECTED\*/s;
|
||||
$err = $1;
|
||||
die $err;
|
||||
}
|
||||
my @returndata = @{thaw($data)};
|
||||
my @returndata = @{$retdata};
|
||||
if (wantarray) {
|
||||
return @returndata;
|
||||
} else {
|
||||
@@ -201,8 +197,7 @@ sub init_dbworker {
|
||||
xCAT::MsgUtils->message("S","xcatd: possible BUG encountered by xCAT DB worker ".$err);
|
||||
if ($currcon) {
|
||||
eval { #avoid hang by allowin client to die too
|
||||
print $currcon "*XCATBUGDETECTED*:$err:*XCATBUGDETECTED*\n";
|
||||
print $currcon "*XCATBUGDETECTED*76e9b54341\n";
|
||||
store_fd("*XCATBUGDETECTED*:$err:*XCATBUGDETECTED*\n",$currcon);
|
||||
$clientset->remove($currcon);
|
||||
close($currcon);
|
||||
};
|
||||
@@ -230,13 +225,14 @@ sub handle_dbc_conn {
|
||||
my $client = shift;
|
||||
my $clientset = shift;
|
||||
my $data;
|
||||
if ($data = <$client>) {
|
||||
my $lastline;
|
||||
while ($lastline ne "ENDOFFREEZEQFVyo4Cj6Q0v\n") { #$data !~ /ENDOFFREEZEQFVyo4Cj6Q0v/) {
|
||||
$lastline = <$client>;
|
||||
$data .= $lastline;
|
||||
}
|
||||
my $request = thaw($data);
|
||||
my $request;
|
||||
eval {
|
||||
$request = fd_retrieve($client);
|
||||
};
|
||||
if ($@ and $@ =~ /^Magic number checking on storable file/) { #this most likely means we ran over the end of available input
|
||||
$clientset->remove($client);
|
||||
close($client);
|
||||
} elsif ($request) {
|
||||
my $response;
|
||||
my @returndata;
|
||||
if ($request->{'wantarray'}) {
|
||||
@@ -244,12 +240,7 @@ sub handle_dbc_conn {
|
||||
} else {
|
||||
@returndata = (scalar(handle_dbc_request($request)));
|
||||
}
|
||||
$response = freeze(\@returndata);
|
||||
# $response .= "\nENDOFFREEZEQFVyo4Cj6Q0j\n";
|
||||
print $client $response;
|
||||
$clientset->remove($client);
|
||||
close($client);
|
||||
} else { #Connection terminated, clean up
|
||||
store_fd(\@returndata,$client);
|
||||
$clientset->remove($client);
|
||||
close($client);
|
||||
}
|
||||
@@ -2280,17 +2271,16 @@ sub getNodeAttribs
|
||||
#skip undefined values, save time
|
||||
next;
|
||||
}
|
||||
|
||||
if ($datum->{$attrib} =~ /^\/[^\/]*\/[^\/]*\/$/)
|
||||
{
|
||||
my $exp = substr($datum->{$attrib}, 1);
|
||||
chop $exp;
|
||||
my @parts = split('/', $exp, 2);
|
||||
my $retval = $node;
|
||||
my $retval = $node;
|
||||
$retval =~ s/$parts[0]/$parts[1]/;
|
||||
$datum->{$attrib} = $retval;
|
||||
}
|
||||
elsif ($datum->{$attrib} =~ /^\|.*\|.*\|$/)
|
||||
elsif ($datum->{$attrib} =~ /^\|.*\|$/)
|
||||
{
|
||||
|
||||
#Perform arithmetic and only arithmetic operations in bracketed issues on the right.
|
||||
@@ -2300,6 +2290,14 @@ sub getNodeAttribs
|
||||
my $exp = substr($datum->{$attrib}, 1);
|
||||
chop $exp;
|
||||
my @parts = split('\|', $exp, 2);
|
||||
my $arraySize = @parts;
|
||||
if ($arraySize < 2) { # easy regx, generate lhs from node
|
||||
my $lhs;
|
||||
my @numbers = $node =~ m/[\D0]*(\d+)/g;
|
||||
$lhs = '[\D0]*(\d+)' x scalar(@numbers);
|
||||
$lhs .= '.*$';
|
||||
unshift(@parts,$lhs);
|
||||
}
|
||||
my $curr;
|
||||
my $next;
|
||||
my $prev;
|
||||
|
||||
@@ -19,6 +19,7 @@ if ($^O =~ /^aix/i) {
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use strict;
|
||||
require xCAT::Table;
|
||||
use File::Path;
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
=head3
|
||||
|
||||
@@ -60,7 +60,7 @@ my %usage = (
|
||||
BMC specific:
|
||||
rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|lcds|summary|all}",
|
||||
"reventlog" =>
|
||||
"Usage: reventlog <noderange> [all|clear|<number of entries to retrieve>] [-V|--verbose]
|
||||
"Usage: reventlog <noderange> [all [-s]|clear|<number of entries to retrieve> [-s]] [-V|--verbose]
|
||||
reventlog [-h|--help|-v|--version]",
|
||||
"rinv" =>
|
||||
"Usage:
|
||||
@@ -261,7 +261,7 @@ my %usage = (
|
||||
rmvm [-p] [-f]",
|
||||
"lsslp" =>
|
||||
"Usage: lsslp [-h|--help|-v|--version]
|
||||
lsslp [<noderange>][-V|--verbose][-i ip[,ip..]][-w][-r|-x|-z][-n][-I][-s FRAME|CEC|MM|IVM|RSA|HMC|CMM]
|
||||
lsslp [<noderange>][-V|--verbose][-i ip[,ip..]][-w][-r|-x|-z][-n][-I][-s FRAME|CEC|MM|IVM|RSA|HMC|CMM|IMM2|FSP]
|
||||
[-t tries][--vpdtable][-C counts][-T timeout][--flexdiscover]",
|
||||
"rflash" =>
|
||||
"Usage:
|
||||
@@ -327,7 +327,7 @@ my %usage = (
|
||||
or
|
||||
updatenode <noderange> [-V|--verbose] [-k|--security] [-s|--sn]
|
||||
or
|
||||
updatenode <noderange> [-V|--verbose] [-F|--sync | -f|--snsync] [-l|--user[username]] [-S|--sw]
|
||||
updatenode <noderange> [-V|--verbose] [-F|--sync | -f|--snsync] [-l|--user[username]] [--fanout=[fanout value]] [-S|--sw]
|
||||
[-P|--scripts [script1,script2,...]] [-s|--sn]
|
||||
[-A|--updateallsw] [-c|--cmdlineonly] [-d alt_source_dir]
|
||||
[attr=val [attr=val...]]
|
||||
@@ -342,8 +342,12 @@ Options:
|
||||
|
||||
[-F|--sync] Perform File Syncing.
|
||||
|
||||
[--fanout] Allows you to assign the fanout value for the command.
|
||||
See xdsh/xdcp fanout parameter in the man page.
|
||||
|
||||
[-f|--snsync] Performs File Syncing to the service nodes that service
|
||||
the nodes in the noderange.
|
||||
|
||||
[-l|--user] User name to run the updatenode command. It overrides the
|
||||
current user which is the default.
|
||||
|
||||
|
||||
+168
-9
@@ -1334,7 +1334,6 @@ sub runxcmd_output
|
||||
if (defined($resp->{error}))
|
||||
{
|
||||
push @$::xcmd_outref, @{$resp->{error}};
|
||||
$::RUNCMD_RC = 1;
|
||||
}
|
||||
if (defined($resp->{errorcode}))
|
||||
{
|
||||
@@ -1386,7 +1385,6 @@ sub runxcmd_output2
|
||||
if (defined($resp->{error}))
|
||||
{
|
||||
push @{$::xcmd_outref_hash->{error}}, @{$resp->{error}};
|
||||
$::RUNCMD_RC = 1;
|
||||
}
|
||||
if (defined($resp->{errorcode}))
|
||||
{
|
||||
@@ -2068,7 +2066,8 @@ sub CheckVersion
|
||||
=head3 osver
|
||||
Returns the os and version of the System you are running on
|
||||
Arguments:
|
||||
none
|
||||
$type: which type of os infor you want. Supported values are:
|
||||
all,os,version,release
|
||||
Returns:
|
||||
0 - ok
|
||||
Globals:
|
||||
@@ -2085,9 +2084,16 @@ sub CheckVersion
|
||||
#-------------------------------------------------------------------------------
|
||||
sub osver
|
||||
{
|
||||
my $type = shift;
|
||||
if ($type =~ /xCAT::Utils/)
|
||||
{
|
||||
$type = shift;
|
||||
}
|
||||
|
||||
my $osver = "unknown";
|
||||
my $os = '';
|
||||
my $ver = '';
|
||||
my $rel = '';
|
||||
my $line = '';
|
||||
my @lines;
|
||||
my $relfile;
|
||||
@@ -2098,14 +2104,31 @@ sub osver
|
||||
close($relfile);
|
||||
chomp($line);
|
||||
$os = "rh";
|
||||
my $verrel=$line;
|
||||
$ver=$line;
|
||||
$ver=~ tr/\.//;
|
||||
$ver =~ s/[^0-9]*([0-9]+).*/$1/;
|
||||
if ( $type ) {
|
||||
$verrel =~ s/[^0-9]*([0-9.]+).*/$1/;
|
||||
($ver,$rel) = split /\./, $verrel;
|
||||
} else {
|
||||
$ver=~ tr/\.//;
|
||||
$ver =~ s/[^0-9]*([0-9]+).*/$1/;
|
||||
}
|
||||
if ($line =~ /AS/) { $os = 'rhas' }
|
||||
elsif ($line =~ /ES/) { $os = 'rhes' }
|
||||
elsif ($line =~ /WS/) { $os = 'rhws' }
|
||||
elsif ($line =~ /Server/) { $os = 'rhserver' }
|
||||
elsif ($line =~ /Client/) { $os = 'rhclient' }
|
||||
elsif ($line =~ /Server/) {
|
||||
if ( $type ) {
|
||||
$os = 'rhels';
|
||||
} else {
|
||||
$os = 'rhserver';
|
||||
}
|
||||
} elsif ($line =~ /Client/) {
|
||||
if ( $type ) {
|
||||
$os = 'rhel';
|
||||
} else {
|
||||
$os = 'rhclient';
|
||||
}
|
||||
}
|
||||
elsif (-f "/etc/fedora-release") { $os = 'rhfc' }
|
||||
}
|
||||
elsif (-f "/etc/SuSE-release")
|
||||
@@ -2120,6 +2143,10 @@ sub osver
|
||||
$ver =~ tr/\.//;
|
||||
$ver =~ s/[^0-9]*([0-9]+).*/$1/;
|
||||
|
||||
$rel = $lines[2];
|
||||
$ver =~ tr/\.//;
|
||||
$rel =~ s/[^0-9]*([0-9]+).*/$1/;
|
||||
|
||||
#print "ver: $ver\n";
|
||||
}
|
||||
elsif (-f "/etc/UnitedLinux-release")
|
||||
@@ -2177,8 +2204,21 @@ sub osver
|
||||
close($relfile);
|
||||
}
|
||||
}
|
||||
$os = "$os" . "$ver";
|
||||
return ($os);
|
||||
if ( $type and $type =~ /all/ ) {
|
||||
if ( $rel ) {
|
||||
return( "$os" . "," . "$ver" . ".$rel" );
|
||||
} else {
|
||||
return( "$os" . "," . "$ver" );
|
||||
}
|
||||
} elsif ( $type and $type =~ /os/ ) {
|
||||
return( $os );
|
||||
} elsif ( $type and $type =~ /version/ ) {
|
||||
return( $ver );
|
||||
} elsif ( $type and $type =~ /release/ ) {
|
||||
return( $rel );
|
||||
} else {
|
||||
return ("$os" . "$ver");
|
||||
}
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -3116,4 +3156,123 @@ sub noderangecontainsMn
|
||||
}
|
||||
}
|
||||
|
||||
=head3 filter_nodes
|
||||
##########################################################################
|
||||
# Fliter the nodes to specific groups
|
||||
# For specific command, figure out the node lists which should be handled by blade.pm, fsp.pm or ipmi.pm
|
||||
# mp group: the nodes will be handled by blade.pm
|
||||
# fsp group: the nodes will be handled by fsp.pm
|
||||
# bmc group: the nodes will be handled by ipmi.pm
|
||||
# For rspconfig network, the NGP ppc blade will be included in the group of mp, othewise in the fsp group
|
||||
# For getmacs -D, the NGP ppc blade will be included in the group of common fsp, otherwise in the mp group
|
||||
# For renergy command, NGP blade will be moved to mp group
|
||||
##########################################################################
|
||||
=cut
|
||||
|
||||
sub filter_nodes{
|
||||
my ($class, $req, $mpnodes, $fspnodes, $bmcnodes, $nohandle) = @_;
|
||||
|
||||
my (@nodes,@args,$cmd);
|
||||
if (defined($req->{'node'})) {
|
||||
@nodes = @{$req->{'node'}};
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
if (defined($req->{'command'})) {
|
||||
$cmd = $req->{'command'}->[0];
|
||||
}
|
||||
if (defined($req->{'arg'})) {
|
||||
@args = @{$req->{'arg'}};
|
||||
}
|
||||
# get the nodes in the mp table
|
||||
my $mptabhash;
|
||||
my $mptab = xCAT::Table->new("mp");
|
||||
if ($mptab) {
|
||||
$mptabhash = $mptab->getNodesAttribs(\@nodes, ['mpa','nodetype']);
|
||||
}
|
||||
|
||||
# get the nodes in the ppc table
|
||||
my $ppctabhash;
|
||||
my $ppctab = xCAT::Table->new("ppc");
|
||||
if ($ppctab) {
|
||||
$ppctabhash = $ppctab->getNodesAttribs(\@nodes,['hcp']);
|
||||
}
|
||||
|
||||
# get the nodes in the ipmi table
|
||||
my $ipmitabhash;
|
||||
my $ipmitab = xCAT::Table->new("ipmi");
|
||||
if ($ipmitab) {
|
||||
$ipmitabhash = $ipmitab->getNodesAttribs(\@nodes,['bmc']);
|
||||
}
|
||||
|
||||
my (@mp, @ngpfsp, @ngpbmc, @commonfsp, @commonbmc, @unknow);
|
||||
|
||||
# if existing in both 'mpa' and 'ppc', a ngp power blade
|
||||
# if existing in both 'mpa' and 'ipmi', a ngp x86 blade
|
||||
# if only in 'ppc', a common power node
|
||||
# if only in 'ipmi', a common x86 node
|
||||
foreach (@nodes) {
|
||||
if (defined ($mptabhash->{$_}->[0]) && defined ($mptabhash->{$_}->[0]->{'mpa'})) {
|
||||
if (defined ($ppctabhash->{$_}->[0]) && defined ($ppctabhash->{$_}->[0]->{'hcp'})) {
|
||||
# flex power node
|
||||
push @ngpfsp, $_;
|
||||
next;
|
||||
} elsif (defined ($ipmitabhash->{$_}->[0]) && defined ($ipmitabhash->{$_}->[0]->{'bmc'})) {
|
||||
# flex x86 node
|
||||
push @ngpbmc, $_;
|
||||
next;
|
||||
}
|
||||
else {
|
||||
# Non flex blade, but blade node
|
||||
push @mp, $_;
|
||||
next;
|
||||
}
|
||||
} elsif (defined ($ppctabhash->{$_}->[0]) && defined ($ppctabhash->{$_}->[0]->{'hcp'})) {
|
||||
# common power node
|
||||
push @commonfsp, $_;
|
||||
} elsif (defined ($ipmitabhash->{$_}->[0]) && defined ($ipmitabhash->{$_}->[0]->{'bmc'})) {
|
||||
# common bmc node
|
||||
push @commonbmc, $_;
|
||||
} else {
|
||||
push @unknow, $_;
|
||||
}
|
||||
}
|
||||
|
||||
push @{$mpnodes}, @mp;#blade.pm
|
||||
push @{$fspnodes}, @commonfsp;
|
||||
push @{$bmcnodes}, @commonbmc;
|
||||
if (@args && ($cmd eq "rspconfig")) {
|
||||
if (!(grep /^(cec_off_policy|pending_power_on_side)/, @args)) {
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
if (grep /^(network=)/, @args) {
|
||||
push @{$mpnodes}, @ngpbmc;
|
||||
}
|
||||
} else {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
}
|
||||
} elsif($cmd eq "getmacs") {
|
||||
if (@args && (grep /^-D$/,@args)) {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
} else {
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
}
|
||||
} elsif ($cmd eq "rvitals") {
|
||||
if (@args && (grep /^lcds$/,@args)) {
|
||||
push @{$fspnodes},@ngpfsp;
|
||||
} else {
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
}
|
||||
} elsif ($cmd eq "renergy") {
|
||||
push @{$mpnodes}, @ngpbmc;
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
} else {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
}
|
||||
|
||||
push @{$nohandle}, @unknow;
|
||||
|
||||
## TRACE_LINE print "Nodes filter: nodetype [commp:@mp,ngpp:@ngpfsp,comfsp:@commonfsp]. mpnodes [@{$mpnodes}], fspnodes [@{$fspnodes}], bmcnodes [@{$bmcnodes}]\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -16,6 +16,7 @@ require Exporter;
|
||||
"1310229985.226287" => "centos6",
|
||||
"1323560292.885204" => "centos6.2",
|
||||
"1341569670.539525" => "centos6.3",#x86
|
||||
"1362445555.957609" => "centos6.4",#x86_64
|
||||
"1176234647.982657" => "centos5",
|
||||
"1156364963.862322" => "centos4.4",
|
||||
"1178480581.024704" => "centos4.5",
|
||||
@@ -45,6 +46,8 @@ require Exporter;
|
||||
"1269260915.992102" => "rhels5.5", #i386
|
||||
"1269263646.691048" => "rhels5.5", #x86_64
|
||||
"1328205744.315196" => "rhels5.8", #x86_64
|
||||
"1354216429.587870" => "rhels5.9", #x86_64
|
||||
"1354214009.518521" => "rhels5.9", #ppc64
|
||||
"1285193176.460470" => "rhels6", #x86_64
|
||||
"1285192093.430930" => "rhels6", #ppc64
|
||||
"1305068199.328169" => "rhels6.1", #x86_64
|
||||
@@ -54,6 +57,8 @@ require Exporter;
|
||||
"1339641244.734735" => "rhels6.3", #ppc64
|
||||
"1339640147.274118" => "rhels6.3", #x86_64
|
||||
"1339638991.532890" => "rhels6.3", #i386
|
||||
"1359576752.435900" => "rhels6.4", #x86_64
|
||||
"1359576196.686790" => "rhels6.4", #ppc64
|
||||
"1285193176.593806" => "rhelhpc6", #x86_64
|
||||
"1305067719.718814" => "rhelhpc6.1",#x86_64
|
||||
"1321545261.599847" => "rhelhpc6.2",#x86_64
|
||||
|
||||
@@ -468,6 +468,7 @@ sub grantVSwitch {
|
||||
|
||||
# Use SMAPI EXEC
|
||||
my $out = `ssh $user\@$hcp "$sudo $dir/smcli Virtual_Network_Vswitch_Set -T SYSTEM -n $vswitchId -I $userId"`;
|
||||
xCAT::zvmUtils->printSyslog("grantVSwitch- ssh $user\@$hcp $sudo $dir/smcli Virtual_Network_Vswitch_Set -T SYSTEM -n $vswitchId -I $userId");
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
# If return string contains 'Done' - Operation was successful
|
||||
@@ -564,6 +565,7 @@ sub smapiFlashCopy {
|
||||
# Use SMAPI EXEC to flash copy
|
||||
my $cmd = '\"' . "CMD=FLASHCOPY $srcId $srcAddr 0 END $tgtId $tgtAddr 0 END" . '\"';
|
||||
my $out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $hcpUserId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("smapiFlashCopy- ssh $user\@$hcp $sudo $dir/smcli xCAT_Commands_IUO -T $hcpUserId -c $cmd");
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
@@ -656,14 +658,18 @@ sub purgeReader {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
xCAT::zvmUtils->printSyslog("sudoer:$user zHCP:$hcp sudo:$sudo");
|
||||
|
||||
my $out;
|
||||
if (xCAT::zvmUtils->smapi4xcat($user, $hcp)) {
|
||||
# Use SMAPI EXEC to purge reader
|
||||
my $cmd = '\"' . "CMD=PURGE $userId RDR ALL" . '\"';
|
||||
$out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $userId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("smcli xCAT_Commands_IUO -T $userId -c $cmd");
|
||||
} else {
|
||||
# Purge reader using CP
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp purge $userId rdr all"`;
|
||||
xCAT::zvmUtils->printSyslog("/sbin/vmcp purge $userId rdr all");
|
||||
}
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
@@ -695,14 +701,18 @@ sub sendCPCmd {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
xCAT::zvmUtils->printSyslog("sudoer:$user zHCP:$hcp sudo:$sudo");
|
||||
|
||||
my $out;
|
||||
if (xCAT::zvmUtils->smapi4xcat($user, $hcp)) {
|
||||
# Use SMAPI EXEC to send command
|
||||
$cmd = '\"' . "CMD=SEND CP $userId " . uc($cmd) . '\"';
|
||||
$out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $userId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("smcli xCAT_Commands_IUO -T $userId -c $cmd");
|
||||
} else {
|
||||
# Send CP command to given user
|
||||
$out = `ssh $user\@$hcp "$sudo /sbin/vmcp send cp $userId $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("/sbin/vmcp send cp $userId $cmd");
|
||||
}
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
@@ -286,8 +286,40 @@ sub printLn {
|
||||
|
||||
# Print string
|
||||
my $rsp;
|
||||
my $type = "I";
|
||||
if ($str =~ m/error/i) { # Set to print error if the string contains error
|
||||
$type = "E";
|
||||
}
|
||||
|
||||
$rsp->{data}->[0] = "$str";
|
||||
xCAT::MsgUtils->message( "I", $rsp, $callback );
|
||||
xCAT::MsgUtils->message( $type, $rsp, $callback );
|
||||
# xCAT::MsgUtils->message( "S", $str ); # Print to syslog
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 printSyslog
|
||||
|
||||
Description : Print a string to syslog
|
||||
Arguments : String
|
||||
Returns : Nothing
|
||||
Example : xCAT::zvmUtils->printSyslog($str);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub printSyslog {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $str ) = @_;
|
||||
|
||||
# Prepend where this message came from
|
||||
$str = $class . " " . $str;
|
||||
|
||||
# Print string
|
||||
xCAT::MsgUtils->message( "S", $str );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -483,7 +515,7 @@ sub getIfcfgByNic {
|
||||
foreach (@parms) {
|
||||
|
||||
# If the network file contains the NIC address
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo cat $_" | grep "$nic"`;
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo cat $_" | egrep -i "$nic"`;
|
||||
if ($out) {
|
||||
|
||||
# Return network file path
|
||||
|
||||
+109
-29
@@ -731,7 +731,7 @@ function configGroupPanel(data) {
|
||||
// Create table
|
||||
var tableId = panelId + 'Datatable';
|
||||
var table = new DataTable(tableId);
|
||||
table.init(['<input type="checkbox" onclick="selectAllCheckbox(event, $(this))">', 'Name', 'Selectable', 'IP', 'Hostname', 'Network', 'Description']);
|
||||
table.init(['<input type="checkbox" onclick="selectAllCheckbox(event, $(this))">', 'Name', 'Selectable', 'IP', 'Hostname', 'Description']);
|
||||
|
||||
// Insert groups into table
|
||||
var nodePos = 0;
|
||||
@@ -787,12 +787,6 @@ function configGroupPanel(data) {
|
||||
desc = jQuery.trim(desc);
|
||||
}
|
||||
|
||||
// Save network
|
||||
if (tmp[j].indexOf('network:') > -1) {
|
||||
network = tmp[j].replace('network:', '');
|
||||
network = jQuery.trim(network);
|
||||
}
|
||||
|
||||
// Is the group selectable?
|
||||
if (tmp[j].indexOf('selectable:') > -1) {
|
||||
selectable = tmp[j].replace('selectable:', '');
|
||||
@@ -802,7 +796,7 @@ function configGroupPanel(data) {
|
||||
}
|
||||
|
||||
// Columns are: name, selectable, network, and description
|
||||
var cols = new Array(name, selectable, ip, hostname, network, desc);
|
||||
var cols = new Array(name, selectable, ip, hostname, desc);
|
||||
|
||||
// Add remove button where id = user name
|
||||
cols.unshift('<input type="checkbox" name="' + name + '"/>');
|
||||
@@ -851,10 +845,9 @@ function configGroupPanel(data) {
|
||||
var selectable = cols.eq(2).text();
|
||||
var ip = cols.eq(3).text();
|
||||
var hostnames = cols.eq(4).text();
|
||||
var network = cols.eq(5).text();
|
||||
var description = cols.eq(6).text();
|
||||
var description = cols.eq(5).text();
|
||||
|
||||
editGroupDialog(group, selectable, ip, hostnames, network, description);
|
||||
editGroupDialog(group, selectable, ip, hostnames, description);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -913,9 +906,10 @@ function groupDialog() {
|
||||
var selectable = $('<div><label>Selectable:</label><input type="checkbox" name="selectable" title="Select if you want this group to appear on the self service portal"/></div>');
|
||||
var ip = $('<div><label>IP:</label><input type="text" name="ip" title="The IP address of the nodes, usually given as a regular expression, e.g. |ihost(\d+)|10.1.1.($1+0)|"/></div>');
|
||||
var hostnames = $('<div><label>Hostnames:</label><input type="text" name="hostnames" title="The hostname of the nodes, usually given as a regular expression, e.g. |(.*)|($1).sourceforge.net|"/></div>');
|
||||
var network = $('<div><label>Network:</label><input type="text" name="network" title="The groups network and its subnet mask, e.g. 10.1.1.0/24"/></div>');
|
||||
var comments = $('<div><label>Description:</label><input type="text" name="comments" title="A description of the group"/></div>');
|
||||
groupForm.append(group, selectable, ip, hostnames, network, comments);
|
||||
var ipPool = $('<div><label style="vertical-align: top;">IP pool:</label><textarea name="ip_pool" title="A pool of node names, IP addresses, and hostnames that can be chosen from for a newly provisioned virtual machine. An entry in the pool could be: ihost12,10.1.2.12,ihost12.endicott.ibm.com. A newline separates each entry."/></div>');
|
||||
|
||||
groupForm.append(group, selectable, ip, hostnames, comments, ipPool);
|
||||
|
||||
// Generate tooltips
|
||||
groupForm.find('div input[title],textarea[title],select[title]').tooltip({
|
||||
@@ -945,7 +939,7 @@ function groupDialog() {
|
||||
close: function(){
|
||||
$(this).remove();
|
||||
},
|
||||
width: 400,
|
||||
width: 600,
|
||||
buttons: {
|
||||
"Ok": function() {
|
||||
// Remove any warning messages
|
||||
@@ -956,12 +950,12 @@ function groupDialog() {
|
||||
var selectable = $(this).find('input[name="selectable"]');
|
||||
var ip = $(this).find('input[name="ip"]');
|
||||
var hostnames = $(this).find('input[name="hostnames"]');
|
||||
var network = $(this).find('input[name="network"]');
|
||||
var comments = $(this).find('input[name="comments"]');
|
||||
var ipPool = $(this).find('textarea[name=ip_pool]').val();
|
||||
|
||||
// Check that group attributes are provided before continuing
|
||||
var ready = 1;
|
||||
var inputs = new Array(group, ip, hostnames, network);
|
||||
var inputs = new Array(group, ip, hostnames);
|
||||
for (var i in inputs) {
|
||||
if (!inputs[i].val()) {
|
||||
inputs[i].css('border-color', 'red');
|
||||
@@ -980,6 +974,10 @@ function groupDialog() {
|
||||
'Close': function() {$(this).dialog("close");}
|
||||
});
|
||||
|
||||
// A newline at the end of IP pool is needed
|
||||
ipPool = ipPool.replace(/^\s+|\s+$/g, '');
|
||||
ipPool += '\n';
|
||||
|
||||
// Set default description
|
||||
if (!comments.val())
|
||||
comments.val('No description');
|
||||
@@ -988,12 +986,12 @@ function groupDialog() {
|
||||
var args = "updategroup;" + group.val() + ";'" + ip.val() + "';'" + hostnames.val() + "';";
|
||||
|
||||
if (selectable.attr("checked"))
|
||||
args += "'description:" + comments.val() + "|network:" + network.val() + "|selectable:yes";
|
||||
args += "'description:" + comments.val() + "|selectable:yes";
|
||||
else
|
||||
args += "'description:" + comments.val() + "|network:" + network.val() + "|selectable:no";
|
||||
args += "'description:" + comments.val() + "|selectable:no";
|
||||
|
||||
// Add image to xCAT
|
||||
$.ajax( {
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
@@ -1005,6 +1003,37 @@ function groupDialog() {
|
||||
|
||||
success : updatePanel
|
||||
});
|
||||
|
||||
// Write IP pool file to /var/tmp
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'write',
|
||||
tgt : '/var/tmp/' + group.val() + '.pool',
|
||||
args : '',
|
||||
cont : ipPool,
|
||||
msg : dialogId + ';' + group.val()
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
var args = data.msg.split(';');
|
||||
|
||||
// Create profile in xCAT
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'mkippool;' + args[1],
|
||||
msg : args[0]
|
||||
},
|
||||
|
||||
success: updatePanel
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
"Cancel": function() {
|
||||
@@ -1021,10 +1050,9 @@ function groupDialog() {
|
||||
* @param iSelectable Is group selectable from the service page
|
||||
* @param iIp Group IP regex
|
||||
* @param iHostnames Group hostnames regex
|
||||
* @param iNetwork Group network, e.g. 10.1.2.0/24
|
||||
* @param iComments Group description
|
||||
*/
|
||||
function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iComments) {
|
||||
function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iComments) {
|
||||
// Create form to add profile
|
||||
var dialogId = 'createGroup-' + iGroup;
|
||||
var groupForm = $('<div id="' + dialogId + '" class="form"></div>');
|
||||
@@ -1037,15 +1065,32 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
var selectable = $('<div><label>Selectable:</label><input type="checkbox" name="selectable" title="Select if you want this group to appear on the self service portal"/></div>');
|
||||
var ip = $('<div><label>IP:</label><input type="text" name="ip" title="The IP address for the group, usually given as a regular expression, e.g. |ihost(\d+)|10.1.1.($1+0)|"/></div>');
|
||||
var hostnames = $('<div><label>Hostnames:</label><input type="text" name="hostnames" title="The hostname for the group, usually given as a regular expression, e.g. |(.*)|($1).sourceforge.net|"/></div>');
|
||||
var network = $('<div><label>Network:</label><input type="text" name="network" title="The groups network and its subnet mask, e.g. 10.1.1.0/24"/></div>');
|
||||
var comments = $('<div><label>Description:</label><input type="text" name="comments" title="A description of the group"/></div>');
|
||||
groupForm.append(group, selectable, ip, hostnames, network, comments);
|
||||
var ipPool = $('<div><label style="vertical-align: top;">IP pool:</label><textarea name="ip_pool" title="A pool of node names, IP addresses, and hostnames that can be chosen from for a newly provisioned virtual machine."/></div>');
|
||||
|
||||
groupForm.append(group, selectable, ip, hostnames, comments, ipPool);
|
||||
|
||||
// Query IP pool based on group name
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'lsippool;' + iGroup,
|
||||
msg : dialogId
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
// Populate textarea with IP pool entries
|
||||
$('#' + data.msg).find('textarea[name="ip_pool"]').val(data.rsp[0]);
|
||||
}
|
||||
});
|
||||
|
||||
// Fill in group attributes
|
||||
groupForm.find('input[name="group"]').val(iGroup);
|
||||
groupForm.find('input[name="ip"]').val(iIp);
|
||||
groupForm.find('input[name="hostnames"]').val(iHostnames);
|
||||
groupForm.find('input[name="network"]').val(iNetwork);
|
||||
groupForm.find('input[name="comments"]').val(iComments);
|
||||
if (iSelectable == "yes")
|
||||
groupForm.find('input[name="selectable"]').attr('checked', 'checked');
|
||||
@@ -1078,7 +1123,7 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
close: function(){
|
||||
$(this).remove();
|
||||
},
|
||||
width: 400,
|
||||
width: 600,
|
||||
buttons: {
|
||||
"Ok": function() {
|
||||
// Remove any warning messages
|
||||
@@ -1089,12 +1134,12 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
var selectable = $(this).find('input[name="selectable"]');
|
||||
var ip = $(this).find('input[name="ip"]');
|
||||
var hostnames = $(this).find('input[name="hostnames"]');
|
||||
var network = $(this).find('input[name="network"]');
|
||||
var comments = $(this).find('input[name="comments"]');
|
||||
var ipPool = $(this).find('textarea[name=ip_pool]').val();
|
||||
|
||||
// Check that group attributes are provided before continuing
|
||||
var ready = 1;
|
||||
var inputs = new Array(group, ip, hostnames, network);
|
||||
var inputs = new Array(group, ip, hostnames);
|
||||
for (var i in inputs) {
|
||||
if (!inputs[i].val()) {
|
||||
inputs[i].css('border-color', 'red');
|
||||
@@ -1113,6 +1158,10 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
'Close': function() {$(this).dialog("close");}
|
||||
});
|
||||
|
||||
// A newline at the end of IP pool is needed
|
||||
ipPool = ipPool.replace(/^\s+|\s+$/g, '');
|
||||
ipPool += '\n';
|
||||
|
||||
// Set default description
|
||||
if (!comments.val())
|
||||
comments.val('No description');
|
||||
@@ -1121,9 +1170,9 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
var args = "updategroup;" + group.val() + ";'" + ip.val() + "';'" + hostnames.val() + "';";
|
||||
|
||||
if (selectable.attr("checked"))
|
||||
args += "'description:" + comments.val() + "|network:" + network.val() + "|selectable:yes";
|
||||
args += "'description:" + comments.val() + "|selectable:yes";
|
||||
else
|
||||
args += "'description:" + comments.val() + "|network:" + network.val() + "|selectable:no";
|
||||
args += "'description:" + comments.val() + "|selectable:no";
|
||||
|
||||
// Add image to xCAT
|
||||
$.ajax( {
|
||||
@@ -1138,6 +1187,37 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
|
||||
success : updatePanel
|
||||
});
|
||||
|
||||
// Write IP pool file to /var/tmp
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'write',
|
||||
tgt : '/var/tmp/' + group.val() + '.pool',
|
||||
args : '',
|
||||
cont : ipPool,
|
||||
msg : dialogId + ';' + group.val()
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
var args = data.msg.split(';');
|
||||
|
||||
// Create profile in xCAT
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'mkippool;' + args[1],
|
||||
msg : args[0]
|
||||
},
|
||||
|
||||
success: updatePanel
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
"Cancel": function() {
|
||||
|
||||
+34
-17
@@ -33,7 +33,7 @@ zvmPlugin.prototype.loadConfigPage = function(tabId) {
|
||||
|
||||
// Create accordion panel for images
|
||||
var imgSection = $('<div id="zvmConfigImages"></div>');
|
||||
var imgLnk = $('<h3><a href="#">Images</a></h3>').click(function () {
|
||||
var imgLnk = $('<h3><a href="#">Templates</a></h3>').click(function () {
|
||||
// Do not load panel again if it is already loaded
|
||||
if ($('#zvmConfigImages').find('.dataTables_wrapper').length)
|
||||
return;
|
||||
@@ -67,7 +67,7 @@ zvmPlugin.prototype.loadConfigPage = function(tabId) {
|
||||
*
|
||||
* @param node Node to clone
|
||||
*/
|
||||
zvmPlugin.prototype.serviceClone = function(node) {
|
||||
zvmPlugin.prototype.serviceClone = function(node) {
|
||||
var owner = $.cookie('xcat_username');
|
||||
var group = getUserNodeAttr(node, 'groups');
|
||||
|
||||
@@ -95,7 +95,7 @@ zvmPlugin.prototype.loadServiceProvisionPage = function(tabId) {
|
||||
|
||||
// Create provision table
|
||||
var provTable = $('<table id="select-table" style="margin: 10px;"></table');
|
||||
var provHeader = $('<thead class="ui-widget-header"> <th>zVM</th> <th>Group</th> <th>Image</th></thead>');
|
||||
var provHeader = $('<thead class="ui-widget-header"> <th>zVM</th> <th>Group</th> <th>Template</th> <th>Image</th></thead>');
|
||||
var provBody = $('<tbody></tbody>');
|
||||
var provFooter = $('<tfoot></tfoot>');
|
||||
provTable.append(provHeader, provBody, provFooter);
|
||||
@@ -108,16 +108,18 @@ zvmPlugin.prototype.loadServiceProvisionPage = function(tabId) {
|
||||
// Create row to contain selections
|
||||
var provRow = $('<tr></tr>');
|
||||
provBody.append(provRow);
|
||||
// Create columns for zVM, group, and image
|
||||
// Create columns for zVM, group, template, and image
|
||||
var zvmCol = $('<td style="vertical-align: top;"></td>');
|
||||
provRow.append(zvmCol);
|
||||
var groupCol = $('<td style="vertical-align: top;"></td>');
|
||||
provRow.append(groupCol);
|
||||
var imageCol = $('<td style="vertical-align: top;"></td>');
|
||||
provRow.append(imageCol);
|
||||
var tmplCol = $('<td style="vertical-align: top;"></td>');
|
||||
provRow.append(tmplCol);
|
||||
var imgCol = $('<td style="vertical-align: top;"></td>');
|
||||
provRow.append(imgCol);
|
||||
|
||||
provRow.children('td').css({
|
||||
'min-width': '250px'
|
||||
'min-width': '200px'
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -130,23 +132,38 @@ zvmPlugin.prototype.loadServiceProvisionPage = function(tabId) {
|
||||
|
||||
var hcp = $('#select-table tbody tr:eq(0) td:eq(0) input[name="hcp"]:checked').val();
|
||||
var group = $('#select-table tbody tr:eq(0) td:eq(1) input[name="group"]:checked').val();
|
||||
var img = $('#select-table tbody tr:eq(0) td:eq(2) input[name="image"]:checked').val();
|
||||
var tmpl = $('#select-table tbody tr:eq(0) td:eq(2) input[name="image"]:checked').val();
|
||||
var img = $('#select-table tbody tr:eq(0) td:eq(3) input[name="master"]:checked').val();
|
||||
var owner = $.cookie('xcat_username');
|
||||
|
||||
if (!hcp || !group || !img) {
|
||||
if (img && !group) {
|
||||
// Show warning message
|
||||
var warn = createWarnBar('You need to select a group');
|
||||
warn.prependTo($(this).parent());
|
||||
} else if (!img && (!hcp || !group || !tmpl)) {
|
||||
// Show warning message
|
||||
var warn = createWarnBar('You need to select an option for each column');
|
||||
var warn = createWarnBar('You need to select a zHCP, group, and image');
|
||||
warn.prependTo($(this).parent());
|
||||
} else {
|
||||
// Begin by creating VM
|
||||
createzVM(tabId, group, hcp, img, owner);
|
||||
if (img) {
|
||||
// Begin by clonning VM
|
||||
|
||||
// Submit request to clone VM
|
||||
// webportal clonezlinux [src node] [group] [owner]
|
||||
var iframe = createIFrame('lib/srv_cmd.php?cmd=webportal&tgt=&args=clonezlinux;' + img + ';' + group + ';' + owner + '&msg=&opts=flush');
|
||||
iframe.prependTo($('#zvmProvisionTab'));
|
||||
} else {
|
||||
// Begin by creating VM
|
||||
createzVM(tabId, group, hcp, tmpl, owner);
|
||||
}
|
||||
}
|
||||
});
|
||||
provForm.append(provisionBtn);
|
||||
|
||||
// Load zVMs, groups, and images into their respective columns
|
||||
// Load zVMs, groups, template, and image into their respective columns
|
||||
loadSrvGroups(groupCol);
|
||||
loadOSImages(imageCol);
|
||||
loadOSImages(tmplCol);
|
||||
loadGoldenImages(imgCol);
|
||||
|
||||
// Get zVM host names
|
||||
if (!$.cookie('zvms')){
|
||||
@@ -2557,7 +2574,7 @@ zvmPlugin.prototype.loadLogPage = function(node) {
|
||||
setChkBox.append('Set options');
|
||||
|
||||
// Create log options input
|
||||
var logOpt = $('<li><label>Log options:</label><input type="text" name="logOpt"/></li>');
|
||||
var logOpt = $('<li><label style="width: 80px; vertical-align: top;">Log options:</label><textarea name="logOpt"></textarea></li>');
|
||||
logOpt.hide();
|
||||
optsList.append(logOpt);
|
||||
|
||||
@@ -2570,7 +2587,7 @@ zvmPlugin.prototype.loadLogPage = function(node) {
|
||||
tgtLog.toggle();
|
||||
});
|
||||
|
||||
setChkBox.bind('click', function(event) {
|
||||
setChkBox.find('input').bind('click', function(event) {
|
||||
logOpt.toggle();
|
||||
});
|
||||
|
||||
@@ -2637,7 +2654,7 @@ zvmPlugin.prototype.loadLogPage = function(node) {
|
||||
// If it is set options
|
||||
if (opt == 'o') {
|
||||
// Append options
|
||||
optStr += ';' + $('#' + newTabId + ' input[name=logOpt]').val();
|
||||
optStr += ';' + $('#' + newTabId + ' textarea[name=logOpt]').val();
|
||||
}
|
||||
|
||||
// Append ; to end of string
|
||||
|
||||
+109
-24
@@ -1246,7 +1246,10 @@ function openAddProcDialog(node) {
|
||||
function openAddDiskDialog(node, hcp) {
|
||||
// Get list of disk pools
|
||||
var cookie = $.cookie(hcp + 'diskpools');
|
||||
var pools = cookie.split(',');
|
||||
var pools = new Array();
|
||||
if (cookie) {
|
||||
pools = cookie.split(',');
|
||||
}
|
||||
|
||||
// Create form to add disk
|
||||
var addDiskForm = $('<div class="form"></div>');
|
||||
@@ -1406,7 +1409,10 @@ function openAddDiskDialog(node, hcp) {
|
||||
function openAddZfcpDialog(node, hcp, zvm) {
|
||||
// Get list of disk pools
|
||||
var cookie = $.cookie(hcp + 'zfcppools');
|
||||
var pools = cookie.split(',');
|
||||
var pools = new Array();
|
||||
if (cookie) {
|
||||
pools = cookie.split(',');
|
||||
}
|
||||
|
||||
// Create form to add disk
|
||||
var addZfcpForm = $('<div class="form"></div>');
|
||||
@@ -2011,7 +2017,7 @@ function openAddScsi2SystemDialog(hcp) {
|
||||
hcp2zvm = getHcpZvmHash();
|
||||
|
||||
// Create info bar
|
||||
var info = createInfoBar('Dynamically add an SCSI disk to a running z/VM system.');
|
||||
var info = createInfoBar('Dynamically add an SCSI disk to a running z/VM system as an EDEV.');
|
||||
addS2SForm.append(info);
|
||||
|
||||
var system = $('<div><label>z/VM system:</label></div>');
|
||||
@@ -2024,7 +2030,7 @@ function openAddScsi2SystemDialog(hcp) {
|
||||
systemSelect.append($('<option value="' + hcp2zvm[hcp] + '">' + hcp2zvm[hcp] + '</option>'));
|
||||
}
|
||||
|
||||
var devNo = $('<div><label>FCP device:</label><input type="text" name="devNo" maxlength="4" title="The SCSI disk device number"/></div>');
|
||||
var devNo = $('<div><label>Device number:</label><input type="text" name="devNo" maxlength="4" title="The SCSI disk device number"/></div>');
|
||||
var devPathLabel = $('<label>Device paths:</label>');
|
||||
var devPathCount = 1;
|
||||
var pathDiv = $('<div class="devPath" style="margin-left:125px;"></div>');
|
||||
@@ -2369,7 +2375,11 @@ function openRemoveScsiDialog(hcp) {
|
||||
*/
|
||||
function openAddNicDialog(node, hcp) {
|
||||
// Get network names
|
||||
var networks = $.cookie(hcp + 'networks').split(',');
|
||||
var cookie = $.cookie(hcp + 'networks');
|
||||
var networks = new Array();
|
||||
if (cookie) {
|
||||
networks = cookie.split(',');
|
||||
}
|
||||
|
||||
// Create form to add NIC
|
||||
var addNicForm = $('<div class="form"></div>');
|
||||
@@ -3426,6 +3436,18 @@ function loadDiskPoolTable(data) {
|
||||
openAddPageSpoolDialog(hcp);
|
||||
});
|
||||
|
||||
// Add EDEV to system
|
||||
var addEdevLnk = $('<a>Add EDEV</a>');
|
||||
addEdevLnk.bind('click', function(event){
|
||||
openAddScsi2SystemDialog(hcp);
|
||||
});
|
||||
|
||||
// Remove EDEV
|
||||
var removeEdevLnk = $('<a>Remove EDEV</a>');
|
||||
removeEdevLnk.bind('click', function(event){
|
||||
openRemoveScsiDialog(hcp);
|
||||
});
|
||||
|
||||
// Indicate disk is to be shared with various users
|
||||
var shareLnk = $('<a>Share disk</a>');
|
||||
shareLnk.bind('click', function(event){
|
||||
@@ -3435,7 +3457,7 @@ function loadDiskPoolTable(data) {
|
||||
|
||||
// Advanced menu
|
||||
var advancedLnk = '<a>Advanced</a>';
|
||||
var advancedMenu = createMenu([addEckdLnk, addPageSpoolLnk, shareLnk]);
|
||||
var advancedMenu = createMenu([addEckdLnk, addPageSpoolLnk, addEdevLnk, removeEdevLnk, shareLnk]);
|
||||
|
||||
// Create action bar
|
||||
var actionBar = $('<div id="zvmDiskResourceActions" class="actionBar"></div>').css("width", "450px");
|
||||
@@ -3588,28 +3610,12 @@ function loadZfcpPoolTable(data) {
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Add SCSI to system
|
||||
var addScsiLnk = $('<a>Add SCSI</a>');
|
||||
addScsiLnk.bind('click', function(event){
|
||||
openAddScsi2SystemDialog(hcp);
|
||||
});
|
||||
|
||||
// Remove SCSI
|
||||
var removeScsiLnk = $('<a>Remove SCSI</a>');
|
||||
removeScsiLnk.bind('click', function(event){
|
||||
openRemoveScsiDialog(hcp);
|
||||
});
|
||||
|
||||
// Advanced menu
|
||||
var advancedLnk = '<a>Advanced</a>';
|
||||
var advancedMenu = createMenu([addScsiLnk, removeScsiLnk]);
|
||||
|
||||
|
||||
// Create action bar
|
||||
var actionBar = $('<div id="zFcpResourceActions" class="actionBar"></div>').css("width", "450px");
|
||||
|
||||
// Create an action menu
|
||||
var actionsMenu = createMenu([addLnk, removeLnk, refreshLnk, [advancedLnk, advancedMenu]]);
|
||||
var actionsMenu = createMenu([addLnk, removeLnk, refreshLnk]);
|
||||
actionsMenu.superfish();
|
||||
actionsMenu.css('display', 'inline-block');
|
||||
actionBar.append(actionsMenu);
|
||||
@@ -5569,6 +5575,9 @@ function loadOSImages(col) {
|
||||
$(this).children('input:radio').attr('checked', 'checked');
|
||||
$(this).parents('td').find('div').attr('class', 'ui-state-default');
|
||||
$(this).attr('class', 'ui-state-active');
|
||||
|
||||
$('#select-table tbody tr:eq(0) td:eq(3) input[name="master"]').attr('checked', '');
|
||||
$('#select-table tbody tr:eq(0) td:eq(3) input[name="master"]').parents('td').find('div').attr('class', 'ui-state-default');
|
||||
});
|
||||
radio = $('<input type="radio" name="image" value="' + name + '"/>').css('display', 'none');
|
||||
imgBlock.append(radio, $('<span style="font-weight: normal;"><b>' + name + '</b>: ' + desc + '</span>'));
|
||||
@@ -5581,6 +5590,60 @@ function loadOSImages(col) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load golden images into column
|
||||
*
|
||||
* @param col Table column where master copies will be placed
|
||||
*/
|
||||
function loadGoldenImages(col) {
|
||||
// Get group names and description and append to group column
|
||||
if (!$.cookie('srv_goldenimages')) {
|
||||
var infoBar = createInfoBar('No selectable master copies available');
|
||||
col.append(infoBar);
|
||||
return;
|
||||
}
|
||||
|
||||
var imgNames = $.cookie('srv_goldenimages').split(',');
|
||||
|
||||
var imgBlock, radio, args, name, desc;
|
||||
for (var i in imgNames) {
|
||||
args = imgNames[i].split(':');
|
||||
name = args[0];
|
||||
desc = args[1];
|
||||
|
||||
// Create block for each image
|
||||
imgBlock = $('<div class="ui-state-default"></div>').css({
|
||||
'border': '1px solid',
|
||||
'max-width': '200px',
|
||||
'margin': '5px auto',
|
||||
'padding': '5px',
|
||||
'display': 'block',
|
||||
'vertical-align': 'middle',
|
||||
'cursor': 'pointer',
|
||||
'white-space': 'normal'
|
||||
}).click(function(){
|
||||
$(this).children('input:radio').attr('checked', 'checked');
|
||||
$(this).parents('td').find('div').attr('class', 'ui-state-default');
|
||||
$(this).attr('class', 'ui-state-active');
|
||||
|
||||
// Un-select zVM and image
|
||||
$('#select-table tbody tr:eq(0) td:eq(2) input[name="image"]').attr('checked', '');
|
||||
$('#select-table tbody tr:eq(0) td:eq(2) input[name="image"]').parents('td').find('div').attr('class', 'ui-state-default');
|
||||
|
||||
$('#select-table tbody tr:eq(0) td:eq(0) input[name="hcp"]').attr('checked', '');
|
||||
$('#select-table tbody tr:eq(0) td:eq(0) input[name="hcp"]').parents('td').find('div').attr('class', 'ui-state-default');
|
||||
});
|
||||
radio = $('<input type="radio" name="master" value="' + name + '"/>').css('display', 'none');
|
||||
imgBlock.append(radio, $('<span style="font-weight: normal;"><b>' + name + '</b>: ' + desc + '</span>'));
|
||||
imgBlock.children('span').css({
|
||||
'display': 'block',
|
||||
'margin': '5px',
|
||||
'text-align': 'left'
|
||||
});
|
||||
col.append(imgBlock);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a cookie for zVM host names (service page)
|
||||
*
|
||||
@@ -5603,6 +5666,28 @@ function setzVMCookies(data) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a cookie for master copies (service page)
|
||||
*
|
||||
* @param data Data from HTTP request
|
||||
*/
|
||||
function setGoldenImagesCookies(data) {
|
||||
if (data.rsp[0].length) {
|
||||
var copies = new Array();
|
||||
var tmp = data.rsp[0].split(",");
|
||||
for ( var i = 0; i < tmp.length; i++) {
|
||||
if (tmp[i] != null && tmp[i] != "") {
|
||||
copies.push(tmp[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Set cookie to expire in 60 minutes
|
||||
var exDate = new Date();
|
||||
exDate.setTime(exDate.getTime() + (240 * 60 * 1000));
|
||||
$.cookie('srv_goldenimages', copies, { expires: exDate });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a cookie for disk pool names of a given node
|
||||
*
|
||||
|
||||
@@ -239,22 +239,38 @@ function loadServiceProvisionPage(tabId) {
|
||||
title = 'z/VM';
|
||||
|
||||
// Get zVM host names
|
||||
if (!$.cookie('zvms')){
|
||||
$.ajax( {
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webportal',
|
||||
tgt : '',
|
||||
args : 'lszvm',
|
||||
msg : ''
|
||||
},
|
||||
$.ajax({
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
data : {
|
||||
cmd : 'webportal',
|
||||
tgt : '',
|
||||
args : 'lszvm',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
setzVMCookies(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
success : function(data) {
|
||||
setzVMCookies(data);
|
||||
}
|
||||
});
|
||||
|
||||
// Get master copies for clone
|
||||
$.ajax({
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
data : {
|
||||
cmd : 'webportal',
|
||||
tgt : '',
|
||||
args : 'lsgoldenimages',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
setGoldenImagesCookies(data);
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1077,11 +1093,27 @@ function setUserNodes(data) {
|
||||
// where column names are: node, os, arch, profile, provmethod, supportedarchs, nodetype, comments, disable
|
||||
var cols = data.rsp[i].split(',');
|
||||
var node = cols[0].replace(new RegExp('"', 'g'), '');
|
||||
var owner = cols[7].replace(new RegExp('"', 'g'), '');
|
||||
owner = owner.replace('owner:', '');
|
||||
|
||||
if (owner == userName) {
|
||||
usrNodes.push(node);
|
||||
// Comments can contain the owner and description
|
||||
var comments = new Array();
|
||||
if (cols[7].indexOf(';') > -1) {
|
||||
comments = cols[7].replace(new RegExp('"', 'g'), '').split(';');
|
||||
} else {
|
||||
comments.push(cols[7].replace(new RegExp('"', 'g'), ''));
|
||||
}
|
||||
|
||||
// Extract the owner
|
||||
var owner;
|
||||
for (var j in comments) {
|
||||
if (comments[j].indexOf('owner:') > -1) {
|
||||
owner = comments[j].replace('owner:', '');
|
||||
|
||||
if (owner == userName) {
|
||||
usrNodes.push(node);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // End of for
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ function submit_request($req, $skipVerify, $opts_array){
|
||||
syslog(LOG_INFO, "Sending request: $cmd $nr");
|
||||
stream_set_blocking($fp, 0); // Set as non-blocking
|
||||
fwrite($fp,$req->asXML()); // Send XML to xcatd
|
||||
set_time_limit(900); // Set 15 minutes timeout (for long running requests)
|
||||
set_time_limit(3600); // Set 15 minutes timeout (for long running requests)
|
||||
// The default is 30 seconds which is too short for some requests
|
||||
|
||||
// Turn on output buffering
|
||||
|
||||
@@ -91,7 +91,7 @@ function submit_request($req, $skipVerify, $opts_array){
|
||||
syslog(LOG_INFO, "Sending request: $cmd $nr");
|
||||
stream_set_blocking($fp, 0); // Set as non-blocking
|
||||
fwrite($fp,$req->asXML()); // Send XML to xcatd
|
||||
set_time_limit(900); // Set 15 minutes timeout (for long running requests)
|
||||
set_time_limit(3600); // Set 15 minutes timeout (for long running requests)
|
||||
// The default is 30 seconds which is too short for some requests
|
||||
|
||||
// Turn on output buffering
|
||||
|
||||
@@ -70,6 +70,9 @@ sub process_request {
|
||||
'deleteuser' => \&web_deleteuser,
|
||||
'mkzprofile' => \&web_mkzprofile,
|
||||
'rmzprofile' => \&web_rmzprofile,
|
||||
'mkippool' => \&web_mkippool,
|
||||
'rmippool' => \&web_rmippool,
|
||||
'lsippool' => \&web_lsippool,
|
||||
'updateosimage' => \&web_updateosimage,
|
||||
'rmosimage' => \&web_rmosimage,
|
||||
'updategroup' => \&web_updategroup,
|
||||
@@ -2241,10 +2244,11 @@ sub web_graphinfo {
|
||||
}
|
||||
}
|
||||
|
||||
@missinfoarray = (@missinfoarray, @unsupportarray);
|
||||
foreach (@missinfoarray) {
|
||||
$missretstr = $missretstr . $_ . ':linux:other;';
|
||||
}
|
||||
|
||||
|
||||
# Combine all information into a string
|
||||
my $retstr = $pretstr . $bladeretstr . $xretstr . $missretstr;
|
||||
if ($retstr) {
|
||||
@@ -2369,6 +2373,7 @@ sub web_mkzprofile() {
|
||||
`echo "$var=$size" >> /var/opt/xcat/profiles/$profile.conf`;
|
||||
|
||||
# Move directory entry into /var/opt/xcat/profiles from /var/tmp
|
||||
`mkdir -p /var/opt/xcat/profiles`;
|
||||
`mv /var/tmp/$profile.direct /var/opt/xcat/profiles`;
|
||||
|
||||
my $info = "Profile successfully created/updated";
|
||||
@@ -2394,6 +2399,60 @@ sub web_rmzprofile() {
|
||||
$callback->( { info => $info } );
|
||||
}
|
||||
|
||||
sub web_mkippool() {
|
||||
|
||||
# Create group IP pool
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
|
||||
# Get profile
|
||||
my $group = $request->{arg}->[1];
|
||||
|
||||
# Move directory entry into /var/opt/xcat/ippool from /var/tmp
|
||||
`mkdir -p /var/opt/xcat/ippool`;
|
||||
`mv /var/tmp/$group.pool /var/opt/xcat/ippool`;
|
||||
|
||||
my $info = "IP pool successfully created/updated";
|
||||
$callback->( { info => $info } );
|
||||
}
|
||||
|
||||
sub web_rmippool() {
|
||||
|
||||
# Delete group IP pool
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
|
||||
# Get profile
|
||||
my $group = $request->{arg}->[1];
|
||||
my @groups = split( ',', $group );
|
||||
|
||||
# Delete IP pool under /var/opt/xcat/ippool
|
||||
foreach (@groups) {
|
||||
`rm -rf /var/opt/xcat/ippool/$_.pool`;
|
||||
}
|
||||
|
||||
my $info = "IP pool successfully deleted";
|
||||
$callback->( { info => $info } );
|
||||
}
|
||||
|
||||
sub web_lsippool() {
|
||||
|
||||
# List IP pool
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
|
||||
# Get profile
|
||||
my $group = $request->{arg}->[1];
|
||||
|
||||
# IP pool contained in /var/opt/xcat/ippool where a file exists per group
|
||||
my $entries;
|
||||
if ( !(`test -e /var/opt/xcat/ippool/$group.pool && echo Exists`) ) {
|
||||
$entries = "No IP pool found!";
|
||||
} else {
|
||||
# List IP pool under /var/opt/xcat/ippool
|
||||
$entries = `cat /var/opt/xcat/ippool/$group.pool`;
|
||||
}
|
||||
|
||||
$callback->( { info => $entries } );
|
||||
}
|
||||
|
||||
sub web_updateosimage() {
|
||||
|
||||
# Add OS image to xCAT table
|
||||
@@ -2464,6 +2523,7 @@ sub web_rmgroup() {
|
||||
# Delete user from xCAT passwd and policy tables
|
||||
foreach (@names) {
|
||||
`chtab -d node=$_ hosts`;
|
||||
`rm -rf /var/opt/xcat/ippool/$_.pool`;
|
||||
}
|
||||
|
||||
my $info = "Group successfully deleted";
|
||||
|
||||
@@ -40,7 +40,8 @@ sub process_request {
|
||||
'clonezlinux' => \&clonezlinux,
|
||||
'genhostip' => \&genhostip,
|
||||
'getmaxvm' => \&getmaxvm,
|
||||
'getuserprivilege' => \&getuserprivilege
|
||||
'getuserprivilege' => \&getuserprivilege,
|
||||
'lsgoldenimages' => \&lsgoldenimages
|
||||
);
|
||||
|
||||
# Check if the request is authorized
|
||||
@@ -214,12 +215,13 @@ sub provzlinux {
|
||||
|
||||
# Create VM
|
||||
# e.g. webportal provzlinux [group] [hcp] [image]
|
||||
my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
if (!$base_digit) {
|
||||
println( $callback, "(Error) Failed to generate node name" );
|
||||
# my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
my ($node, $ip, $hostname) = findfreenode( $callback, $group );
|
||||
if (!$node) {
|
||||
println( $callback, "Unable to find a free node, IP, and hostname for $group from the IP pool" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
my $userid = $node;
|
||||
|
||||
# Set node definitions
|
||||
@@ -231,9 +233,9 @@ sub provzlinux {
|
||||
$out = `mkdef -t node -o $node userid=$userid hcp=$hcp mgt=zvm groups=$group,all`;
|
||||
}
|
||||
println( $callback, "$out" );
|
||||
|
||||
|
||||
# Set nodetype definitions
|
||||
$out = `chtab node=$node noderes.netboot=zvm nodetype.nodetype=osi nodetype.provmethod=install nodetype.os=$os nodetype.arch=$arch nodetype.profile=$profile nodetype.comments="owner:$owner"`;
|
||||
$out = `chtab node=$node hosts.ip=$ip hosts.hostnames=$hostname noderes.netboot=zvm nodetype.nodetype=osi nodetype.provmethod=install nodetype.os=$os nodetype.arch=$arch nodetype.profile=$profile nodetype.comments="owner:$owner"`;
|
||||
|
||||
# Create user directory entry replacing LXUSR with user ID
|
||||
# Use /opt/zhcp/conf/default.direct on zHCP as the template
|
||||
@@ -673,7 +675,13 @@ sub clonezlinux {
|
||||
|
||||
# Create VM
|
||||
# e.g. webportal provzlinux [group] [hcp] [image]
|
||||
my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
# my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
my ($node, $ip, $hostname) = findfreenode( $callback, $group );
|
||||
if (!$node) {
|
||||
println( $callback, "Unable to find a free node, IP, and hostname for $group from the IP pool" );
|
||||
return;
|
||||
}
|
||||
|
||||
my $userid = $node;
|
||||
|
||||
# Set node definitions
|
||||
@@ -681,7 +689,7 @@ sub clonezlinux {
|
||||
println( $callback, "$out" );
|
||||
|
||||
# Set nodetype definitions
|
||||
$out = `chtab node=$node noderes.netboot=zvm nodetype.nodetype=osi nodetype.provmethod=install nodetype.os=$os nodetype.arch=$arch nodetype.profile=$profile nodetype.comments="owner:$owner"`;
|
||||
$out = `chtab node=$node hosts.ip=$ip hosts.hostnames=$hostname noderes.netboot=zvm nodetype.nodetype=osi nodetype.provmethod=install nodetype.os=$os nodetype.arch=$arch nodetype.profile=$profile nodetype.comments="owner:$owner"`;
|
||||
|
||||
# Update hosts table and DNS
|
||||
sleep(5); # Time needed to update /etc/hosts
|
||||
@@ -715,8 +723,9 @@ sub genhostip {
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
my $group = $request->{arg}->[1];
|
||||
|
||||
my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
println( $callback, "$node: $ip" );
|
||||
# my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
my ($node, $ip, $hostname) = findfreenode( $callback, $group );
|
||||
println( $callback, "$node: $ip, $hostname" );
|
||||
}
|
||||
|
||||
sub getmaxvm {
|
||||
@@ -781,4 +790,86 @@ sub getuserprivilege {
|
||||
|
||||
$callback->( { data => "Privilege: $privilege" } );
|
||||
}
|
||||
|
||||
sub lsgoldenimages {
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
|
||||
# Find the golden image that can be cloned by searching nodetype table for nodetype.provmethod=clone
|
||||
my $clones = "";
|
||||
my $comments = "";
|
||||
my $description = "";
|
||||
my @args;
|
||||
|
||||
# Look in 'policy' table
|
||||
my $tab = xCAT::Table->new( 'nodetype', -create => 1, -autocommit => 0 );
|
||||
my @results = $tab->getAllAttribsWhere( "provmethod='clone'", 'node', 'comments' );
|
||||
foreach (@results) {
|
||||
if ($_->{'node'}) {
|
||||
$clones .= $_->{'node'} . ": ";
|
||||
|
||||
$comments = $_->{'comments'};
|
||||
@args = split(';', $comments);
|
||||
foreach (@args) {
|
||||
if ($_ =~ m/description:/i) {
|
||||
$description = $_;
|
||||
$description =~ s/description://g;
|
||||
$description =~ s/\s*$//; # Trim right
|
||||
$description =~ s/^\s*//; # Trim left
|
||||
} else {
|
||||
$description = "No comments";
|
||||
}
|
||||
}
|
||||
|
||||
$clones .= $description . ",";
|
||||
}
|
||||
}
|
||||
|
||||
# Delete last comma
|
||||
$clones = substr($clones, 0, -1);
|
||||
|
||||
$callback->( { data => $clones } );
|
||||
}
|
||||
|
||||
sub findfreenode {
|
||||
# Generate node name based on given group
|
||||
my ( $callback, $group ) = @_;
|
||||
|
||||
# IP pool contained in /var/opt/xcat/ippool where a file exists per group
|
||||
if ( !(`test -e /var/opt/xcat/ippool/$group.pool && echo Exists`) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
# IP pool group format: node, IP, hostname
|
||||
# It would look similar to:
|
||||
# ihost10,10.1.136.10,ihost10.endicott.ibm.com
|
||||
# ihost11,10.1.136.11,ihost11.endicott.ibm.com
|
||||
# ihost12,10.1.136.12,ihost12.endicott.ibm.com
|
||||
my $node;
|
||||
my $ipaddr;
|
||||
my $hostname;
|
||||
|
||||
my $out = `cat /var/opt/xcat/ippool/$group.pool | grep -v "#"`;
|
||||
my @entries = split( /\n/, $out );
|
||||
if (@entries < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
my $found = 0;
|
||||
foreach(@entries) {
|
||||
# Grab the 1st free entry found
|
||||
($node, $ipaddr, $hostname) = split(/,/, $_);
|
||||
if ($node && $ipaddr && $hostname) {
|
||||
|
||||
# Check against xCAT tables, /etc/hosts, and ping to see if hostname is already used
|
||||
if (`nodels $node` || `cat /etc/hosts | grep "$ipaddr "` || !(`ping -c 4 $ipaddr` =~ m/100% packet loss/)) {
|
||||
next;
|
||||
} else {
|
||||
$found = 1;
|
||||
return ($node, $ipaddr, $hostname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
1;
|
||||
+995
-245
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
xcat-buildkit (2.9) precise; urgency=low
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- root <root@ubuntu> Fri, 01 Mar 2013 14:05:43 +0800
|
||||
@@ -0,0 +1 @@
|
||||
5
|
||||
@@ -0,0 +1,11 @@
|
||||
Source: xcat-buildkit
|
||||
Section: admin
|
||||
Priority: extra
|
||||
Maintainer: xu qing <qxuqxu@cn.ibm.com>
|
||||
Build-Depends: debhelper (>= 5)
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
Package: xcat-buildkit
|
||||
Architecture: all
|
||||
Depends: dpkg-dev, devscripts, debhelper
|
||||
Description: xCAT-buildkit provides the buildkit tool and sample kit files to build an xCAT kit.
|
||||
@@ -0,0 +1,88 @@
|
||||
Eclipse Public License - v 1.0
|
||||
|
||||
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
|
||||
1. DEFINITIONS
|
||||
|
||||
"Contribution" means:
|
||||
|
||||
a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
|
||||
b) in the case of each subsequent Contributor:
|
||||
|
||||
i) changes to the Program, and
|
||||
|
||||
ii) additions to the Program;
|
||||
|
||||
where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
|
||||
|
||||
"Contributor" means any person or entity that distributes the Program.
|
||||
|
||||
"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
|
||||
|
||||
"Program" means the Contributions distributed in accordance with this Agreement.
|
||||
|
||||
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
|
||||
|
||||
2. GRANT OF RIGHTS
|
||||
|
||||
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
|
||||
|
||||
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
|
||||
|
||||
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
|
||||
|
||||
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
|
||||
|
||||
3. REQUIREMENTS
|
||||
|
||||
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
|
||||
|
||||
a) it complies with the terms and conditions of this Agreement; and
|
||||
|
||||
b) its license agreement:
|
||||
|
||||
i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
|
||||
|
||||
ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
|
||||
|
||||
iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
|
||||
|
||||
iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
|
||||
|
||||
When the Program is made available in source code form:
|
||||
|
||||
a) it must be made available under this Agreement; and
|
||||
|
||||
b) a copy of this Agreement must be included with each copy of the Program.
|
||||
|
||||
Contributors may not remove or alter any copyright notices contained within the Program.
|
||||
|
||||
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
|
||||
|
||||
4. COMMERCIAL DISTRIBUTION
|
||||
|
||||
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
|
||||
|
||||
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
|
||||
|
||||
5. NO WARRANTY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
|
||||
|
||||
6. DISCLAIMER OF LIABILITY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. GENERAL
|
||||
|
||||
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
|
||||
|
||||
If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
|
||||
|
||||
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
|
||||
|
||||
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
|
||||
|
||||
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
opt/xcat/share/xcat/kits/kit_template
|
||||
opt/xcat/share/xcat/kits/debian_template
|
||||
opt/xcat/bin
|
||||
opt/xcat/lib/perl/xCAT
|
||||
opt/xcat/share/man/man1
|
||||
opt/xcat/share/doc/man1
|
||||
opt/xcat/share/doc/packages/xCAT-buildkit
|
||||
@@ -0,0 +1 @@
|
||||
LICENSE.html
|
||||
@@ -0,0 +1,7 @@
|
||||
share/man/man1/* opt/xcat/share/man/man1/
|
||||
share/doc/man1/* opt/xcat/share/doc/man1/
|
||||
share/xcat/kits/kit_template/* opt/xcat/share/xcat/kits/kit_template/
|
||||
share/xcat/kits/debian_template/* opt/xcat/share/xcat/kits/debian_template/
|
||||
lib/perl/xCAT/* opt/xcat/lib/perl/xCAT/
|
||||
bin/* opt/xcat/bin/
|
||||
LICENSE.html opt/xcat/share/doc/packages/xCAT-buildkit/
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
export DH_COMPAT=5
|
||||
|
||||
|
||||
build:
|
||||
pwd
|
||||
mkdir -p share/man/man1
|
||||
mkdir -p share/doc/man1
|
||||
pod2man pods/man1/buildkit.1.pod > share/man/man1/buildkit.1
|
||||
pod2html pods/man1/buildkit.1.pod > share/doc/man1/buildkit.1.html
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -d
|
||||
|
||||
install:
|
||||
pwd
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdirs
|
||||
dh_install -X".svn"
|
||||
chmod 444 debian/xcat-buildkit/opt/xcat/share/man/man1/*
|
||||
chmod 644 debian/xcat-buildkit/opt/xcat/share/doc/man1/*
|
||||
find debian/xcat-buildkit/opt/xcat/share/xcat/kits -type d -exec chmod 755 {} \;
|
||||
find debian/xcat-buildkit/opt/xcat/share/xcat/kits -type f -exec chmod 644 {} \;
|
||||
find debian/xcat-buildkit/opt/xcat/lib/perl/xCAT -type d -exec chmod 755 {} \;
|
||||
find debian/xcat-buildkit/opt/xcat/lib/perl/xCAT -type f -exec chmod 644 {} \;
|
||||
chmod -R 755 debian/xcat-buildkit/opt/xcat/bin/*
|
||||
find debian/xcat-buildkit/opt/xcat/share/doc/packages/xCAT-buildkit -type f -exec chmod 644 {} \;
|
||||
dh_link
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
dh_installchangelogs
|
||||
dh_compress
|
||||
dh_installdeb
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch:
|
||||
pwd
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
@@ -0,0 +1 @@
|
||||
1.0
|
||||
@@ -633,6 +633,20 @@ sub osver
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif (-f "/etc/debian_version") #possible debian
|
||||
{
|
||||
if (open($relfile, "<", "/etc/issue")){
|
||||
$line = <$relfile>;
|
||||
if ( $line =~ /debian.*/i){
|
||||
$os = "debian";
|
||||
my $relfile1;
|
||||
open($relfile1, "<", "/etc/debian_version");
|
||||
$ver = <$relfile1>;
|
||||
close($relfile1);
|
||||
}
|
||||
close($relfile);
|
||||
}
|
||||
}
|
||||
$os = "$os" . "," . "$ver";
|
||||
return ($os);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ B<buildkit> [B<-V> | B<--verbose>] B<cleantar>
|
||||
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<cleanall>
|
||||
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<addpkgs> I<kit_tarfile> {B<-p> | B<--pkgdir>} I<package_directory>
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<addpkgs> I<kit_tarfile> {B<-p> | B<--pkgdir>} {B<-k> | B<--kitversion> I<version>} {B<-r> | B<--kitrelease> I<release>} I<package_directory>
|
||||
|
||||
B<command> [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>]
|
||||
|
||||
@@ -74,10 +74,14 @@ List the repos defined in your buildkit configuration file:
|
||||
|
||||
=item 8.
|
||||
|
||||
For each reponame listed, build the repository. Note that if you need to build repositories for OS distributions or versions that do not match the current system, you may need to copy your kit template directory to an appropriate server to build that repository, and then copy the results back to your main build server.
|
||||
For each reponame listed, build the repository. Note that if you need to build repositories for OS distributions, versions, or architectures that do not match the current system, you may need to copy your kit template directory to an appropriate server to build that repository, and then copy the results back to your main build server.
|
||||
|
||||
buildkit buildrepo repo_name
|
||||
|
||||
or, you can build all of the repos at one time if there are no OS or architecture dependencies for kitcomponent package builds or kitpackage builds:
|
||||
|
||||
buildkit buildrepo all
|
||||
|
||||
=item 9.
|
||||
|
||||
Build the kit tar file:
|
||||
@@ -123,19 +127,19 @@ Reads the buildkit.conf file from the current directory, and deletes all the pac
|
||||
|
||||
=item B<buildtar>
|
||||
|
||||
Reads the buildkit.conf file from the current directory, validates that all kit repositories have been built, and builds the Kit tar file <cwd>/build/I<kitname>.tar.bz2.
|
||||
Reads the buildkit.conf file from the current directory, validates that all kit repositories have been built, and builds the Kit tar file <cwd>/I<kitname>.tar.bz2.
|
||||
|
||||
=item B<cleantar>
|
||||
|
||||
Reads the buildkit.conf file from the current directory, deletes the Kit tar <cwd>/build/I<kitname>.tar.bz2, and deletes all files in the build work directory <cwd>/build/I<kitname>.
|
||||
Reads the buildkit.conf file from the current directory, deletes the Kit tar <cwd>/I<kitname>.tar.bz2, and deletes all files in the build work directory <cwd>/build/I<kitname>.
|
||||
|
||||
=item B<cleanall>
|
||||
|
||||
Equivalent to running B<buildkit cleanrepo all> and B<buildkit cleantar>.
|
||||
|
||||
=item B<addpkgs> I<kit_tarfile> {B<-p> | B<--pkgdir>} I<package_directory>
|
||||
=item B<addpkgs> I<kit_tarfile> {B<-p> | B<--pkgdir>} {B<-k> | B<--kitversion> I<version>} {B<-r> | B<--kitrelease> I<release>} I<package_directory>
|
||||
|
||||
Add product package rpms to a previously built kit tar file. This is used for product kits that are built and shipped separately from the product packages.
|
||||
Add product package rpms to a previously built kit tar file. This is used for incomplete product kits that are built and shipped separately from the product packages, and are identified with a I<kit_tarfile> name of I<kitname>.B<NEED_PRODUCT_PKGS.tar.bz2>. Optionally, change the kit release and version values when building the new kit tarfile. If kitcomponent version and/or release values are defaulted to the kit values, those will also be changed and new kitcomponent rpms will be built. If kit or kitcomponent scripts, plugins, or other files specify name, release, or version substitution strings, these will all be replaced with the new values when built into the new complete kit tarfile I<cwd>/I<new_kitname>.B<tar.bz2>.
|
||||
|
||||
=back
|
||||
|
||||
@@ -169,7 +173,7 @@ To create the sample kit shipped with the xCAT-buildkit rpm on a RHELS 6.3 serve
|
||||
vi buildkit.conf
|
||||
buildkit chkconfig
|
||||
buildkit listrepo
|
||||
buildkit buildrepo rhels6.3
|
||||
buildkit buildrepo all
|
||||
buildkit buildtar
|
||||
|
||||
=item 2.
|
||||
@@ -199,7 +203,7 @@ To clean up all kit build files, including a previously built kit tar file, run
|
||||
|
||||
<cwd>/build/I<kitname>/kit.conf
|
||||
|
||||
<cwd>/build/I<kitname>.tar.bz2
|
||||
<cwd>/I<kitname>.tar.bz2
|
||||
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<<<INSERT_kitcomponent_basename_HERE>>> (1.0) precise; urgency=low
|
||||
|
||||
* Kit component package build.
|
||||
|
||||
-- root <root@ubuntu> Fri, 01 Mar 2013 14:05:43 +0800
|
||||
@@ -0,0 +1 @@
|
||||
5
|
||||
@@ -0,0 +1,11 @@
|
||||
Source: <<<INSERT_kitcomponent_basename_HERE>>>
|
||||
Section: admin
|
||||
Priority: extra
|
||||
Maintainer: xcatkit <root@ubuntu>
|
||||
Build-Depends: debhelper (>= 5)
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
Package: <<<INSERT_kitcomponent_basename_HERE>>>
|
||||
Architecture: all
|
||||
Depends: <<<INSERT_kitcomponent_ospkgdeps_HERE>>>,<<<INSERT_kitcomponent_kitpkgdeps_HERE>>>,<<<INSERT_kitcomponent_kitcompdeps_HERE>>>
|
||||
Description: <<<INSERT_kitcomponent_desc_HERE>>>
|
||||
+6
-8
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# postinst script for xcat-genesis
|
||||
# postinst script for aaa
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
@@ -20,13 +20,11 @@ set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
if [ -f /tmp/xCAT-genesis_upgrade.tmp ];then
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
. /etc/profile.d/xcat.sh
|
||||
mknb x86_64
|
||||
fi
|
||||
rm /tmp/xCAT-genesis_upgrade.tmp
|
||||
fi
|
||||
<<<INSERT_kitcomponent_postinstall_script_HERE>>>
|
||||
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]
|
||||
<<<INSERT_kitcomponent_postupgrade_script_HERE>>>
|
||||
rm /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>>
|
||||
fi
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
# postrm script for aaa
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postrm> `remove'
|
||||
# * <postrm> `purge'
|
||||
# * <old-postrm> `upgrade' <new-version>
|
||||
# * <new-postrm> `failed-upgrade' <old-version>
|
||||
# * <new-postrm> `abort-install'
|
||||
# * <new-postrm> `abort-install' <old-version>
|
||||
# * <new-postrm> `abort-upgrade' <old-version>
|
||||
# * <disappearer's-postrm> `disappear' <overwriter>
|
||||
# <overwriter-version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
;;
|
||||
|
||||
remove|purge)
|
||||
<<<INSERT_kitcomponent_postuninstall_script_HERE>>>
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# preinst script for aaa
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <new-preinst> `install'
|
||||
# * <new-preinst> `install' <old-version>
|
||||
# * <new-preinst> `upgrade' <old-version>
|
||||
# * <old-preinst> `abort-upgrade' <new-version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
install)
|
||||
<<<INSERT_kitcomponent_preinstall_script_HERE>>>
|
||||
;;
|
||||
|
||||
upgrade)
|
||||
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]
|
||||
<<<INSERT_kitcomponent_preupgrade_script_HERE>>>
|
||||
fi
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "preinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
# prerm script for aaa
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <prerm> `remove'
|
||||
# * <old-prerm> `upgrade' <new-version>
|
||||
# * <new-prerm> `failed-upgrade' <old-version>
|
||||
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
|
||||
# * <deconfigured's-prerm> `deconfigure' `in-favour'
|
||||
# <package-being-installed> <version> `removing'
|
||||
# <conflicting-package> <version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
remove)
|
||||
<<<INSERT_kitcomponent_preuninstall_script_HERE>>>
|
||||
;;
|
||||
|
||||
upgrade)
|
||||
touch /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>>
|
||||
;;
|
||||
|
||||
deconfigure)
|
||||
;;
|
||||
|
||||
failed-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "prerm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
export DH_COMPAT=5
|
||||
|
||||
build:
|
||||
pwd
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -d
|
||||
|
||||
install:
|
||||
pwd
|
||||
dh_install
|
||||
|
||||
binary-indep: build install
|
||||
dh_installchangelogs
|
||||
dh_compress
|
||||
dh_installdeb
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary-arch:
|
||||
pwd
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
@@ -0,0 +1 @@
|
||||
1.0
|
||||
@@ -0,0 +1,219 @@
|
||||
# Kit Build File
|
||||
#
|
||||
# This file was initially auto-generated by the buildkit CLI command.
|
||||
# To create a new kit, the user should modify this file accordingly.
|
||||
# Refer to the buildkit manpage for further details.
|
||||
#
|
||||
|
||||
# kit: This section defines general info for the Kit.
|
||||
# There must be exactly one kit section in a kit build file.
|
||||
#
|
||||
# kit attributes:
|
||||
# basename (mandatory) Kit base name. e.g., kit-lsf
|
||||
# description (optional) Kit description.
|
||||
# version (mandatory) Kit version. e.g., 1.0
|
||||
# release (optional) Kit release. e.g., 1
|
||||
# ostype (mandatory) Kit OS type. Must be Linux.
|
||||
# AIX is currently not supported.
|
||||
# isinternal (optional) PCM use only.
|
||||
# Indicate if Kit is for internal use.
|
||||
# Use 1 for yes, 0 for no. Default: 0
|
||||
# kitdeployparams (optional) Filename containing a list of kit deployment
|
||||
# parameters, relative to
|
||||
# <Kit Build Directory>/other_files
|
||||
# kitlicense (mandatory) Kit license string to be built into all
|
||||
# kitcomponent packages
|
||||
# kittarfilename (optional) Filename.tar.bz2 to be used for the generated
|
||||
# kit. Default is <basename>-<version>-<ostype>.tar.bz2
|
||||
kit:
|
||||
basename=chef
|
||||
description=Kit for installing chef server, client and workstation
|
||||
version=1.0
|
||||
release=1
|
||||
ostype=Linux
|
||||
kitlicense=EPL
|
||||
|
||||
|
||||
# kitrepo: This section defines a Kit Package Repository.
|
||||
# There must be at least one kitrepo section in a kit build file.
|
||||
# If you want to support multiple OSes, you should create a separate
|
||||
# repo for each OS. Also, no two repos can be defined with the same
|
||||
# OS name, major/minor version and arch. For example, you cannot have
|
||||
# two repos for RHEL 6.2 x86_64 in the same kit.
|
||||
#
|
||||
# kitrepo attributes:
|
||||
# kitrepoid (mandatory) Kit package repository ID.
|
||||
# Must be unique within this file.
|
||||
# osbasename (mandatory) OS distro base name. e.g., rhels.
|
||||
# osmajorversion (mandatory) OS major version. e.g., 6
|
||||
# osminorversion (optional) OS minor version.
|
||||
# osarch (mandatory) OS architecture. e.g., x86_64
|
||||
# compat_osbasenames (optional) Comma-separated list of compatible
|
||||
# OS distro base names. e.g., centos
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=rhels6_x86_64
|
||||
osbasename=rhels
|
||||
osmajorversion=6
|
||||
#osminorversion=
|
||||
osarch=x86_64
|
||||
|
||||
#compat_osbasenames=
|
||||
|
||||
|
||||
# kitcomponent: This section defines one Kit Component.
|
||||
# There can be zero or more kitcomponent sections.
|
||||
# If you want to build a component which supports multiple OSes,
|
||||
# you should create one kitcomponent section for each OS.
|
||||
# Also, no two components in a kit can be defined with the same
|
||||
# base name.
|
||||
# You can define multiple kit components with the same base name
|
||||
# only if each kit component using this base name meets these
|
||||
# requirements:
|
||||
# - Each kit component must be defined with the same version
|
||||
# and release number
|
||||
# - Each kit component must be defined with a unique kitrepoid
|
||||
|
||||
#
|
||||
# kitcomponent attributes:
|
||||
# basename (mandatory) Kit component base name
|
||||
# description (optional) Kit component description
|
||||
# version (optional) Kit component version. If not set, defaults
|
||||
# to kit version
|
||||
# release (optional) Kit component release. If not set, defaults
|
||||
# to kit release. Error if both are not set.
|
||||
# serverroles (mandatory) Comma-separated list of servers that this
|
||||
# component can install on. Valid values:
|
||||
# mgtnode,servicenode,compute,login,storage,utility
|
||||
# kitrepoid (mandatory) The ID of the kit package repository this
|
||||
# component belongs to
|
||||
# kitcompdeps (optional) Comma-separated list of kit component
|
||||
# dependencies. These kit components can be included in
|
||||
# this kit or in other kits.
|
||||
# ospkgdeps (optional) Comma-separated list of OS package dependencies
|
||||
# These packages must be shipped with the OS distro.
|
||||
# kitpkgdeps (optional) Comma-separated list of kit package names that
|
||||
# will be listed as "REQUIRES" when building this kit
|
||||
# component. Each package must be defined in a separate
|
||||
# kitpackage section. Each package must be in the same
|
||||
# kitrepo as this kit component.
|
||||
# non_native_pkgs (optional)
|
||||
# Comma-separated list of non-native package
|
||||
# paths that will be included as files in this kit
|
||||
# component. All filenames are relative to
|
||||
# <Kit Build Directory>/source_packages and may contain
|
||||
# wildcards. If a filename is prefixed by 'EXTERNALPKGS:'
|
||||
# the file will not be built into the kit tarfile, but
|
||||
# will need to be added later with a 'buildkit addpkgs'
|
||||
# command.
|
||||
# Files will be placed in
|
||||
# /opt/xcat/kits/<kitbasename>/<kitcomponent_name>
|
||||
# when the kitcomponent package is deployed to an
|
||||
# OS image.
|
||||
# Kit component deployment scripts must be specified
|
||||
# to manage these files.
|
||||
# driverpacks (optional) Comma-separated list of driver package filenames
|
||||
# Each driverpack must be defined in a separate kitpackage
|
||||
# section.
|
||||
# exlist (optional) Exclude list file for stateless image, relative
|
||||
# to <Kit Build Directory>/other_files
|
||||
# Kit component deployment scripts (optional) Each attribute specifies
|
||||
# script path relative to <Kit Build Directory>/scripts
|
||||
# Script attributes:
|
||||
# preinstall, postinstall, preuninstall, postuninstall,
|
||||
# preupgrade, postupgrade, postbootscripts,
|
||||
# genimage_postinstall
|
||||
kitcomponent:
|
||||
basename=chef_server_kit
|
||||
description=For installing chef server
|
||||
version=1.0
|
||||
release=1
|
||||
serverroles=mgtnode
|
||||
kitrepoid=rhels6_x86_64
|
||||
kitpkgdeps=chef-server
|
||||
#postinstall=server.post
|
||||
postbootscripts=server.post
|
||||
|
||||
kitcomponent:
|
||||
basename=chef_client_kit
|
||||
description=For installing chef client
|
||||
version=1.0
|
||||
release=1
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_x86_64
|
||||
kitpkgdeps=chef
|
||||
#postinstall=client.post
|
||||
postbootscripts=client.post
|
||||
|
||||
kitcomponent:
|
||||
basename=chef_workstation_kit
|
||||
description=For installing chef workstation
|
||||
version=1.0
|
||||
release=1
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_x86_64
|
||||
kitpkgdeps=chef
|
||||
#postinstall=workstation.post
|
||||
postbootscripts=workstation.post
|
||||
|
||||
|
||||
|
||||
# kitpackage: This section defines one Kit Package, and how to build it.
|
||||
# There can be zero or more kitpackage sections.
|
||||
# All filenames should be relative paths to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# If you want to build a package which can run on multiple OSes,
|
||||
# you have two options:
|
||||
# 1. Build a separate package for each OS you want to support.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# per supported OS.
|
||||
# 2. Build one package that can run on multiple OSes.
|
||||
# If you are building an RPM package, you are responsible for
|
||||
# creating an RPM spec file that can run on multiple OSes.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# which contains multiple kitrepoid lines.
|
||||
#
|
||||
# kitpackage attributes:
|
||||
# filename (mandatory) Package filename.
|
||||
# kitrepoid (mandatory) A comma-separated list of kit reponames this package
|
||||
# belongs to. If multiple repos are defined, the package will
|
||||
# be built for the first repo only. For the other repos,
|
||||
# a symlink is created to the package built for the first repo.
|
||||
# Package build methods (optional)
|
||||
# Define how to build the packages.
|
||||
# If you don't specify a build method, the default behavior is
|
||||
# to assume the package is pre-built under
|
||||
# <Kit Build Directory>/source_packages
|
||||
# All files in this section are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# There are four methods to build packages.
|
||||
# 1. Use pre-built RPM package
|
||||
# The filename may contain wildcards to avoid needing to
|
||||
# specify an explicit package version-release filename.
|
||||
# isexternalpkg: 'no'|'0', 'yes'|'1' (default: 'no')
|
||||
# Indicates whether the RPM package will be added to the
|
||||
# the kit tar file now as part of the kit build process,
|
||||
# or whether the customer will need to separately
|
||||
# obtain the RPM pacakage and add it to the kit tar file
|
||||
# using 'buildkit addpkgs'
|
||||
# rpm_prebuiltdir: If isexternalpkg=no, path to directory
|
||||
# containing pre-built RPM package
|
||||
# 2. Build RPM from spec + src dir
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srcdir: Path to source directory.
|
||||
# 3. Build RPM from spec + src tarball
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srctarball: Path to source tarball.
|
||||
# 4. Build RPM from source RPM
|
||||
# rpm_srpm: Path to source RPM package.
|
||||
kitpackage:
|
||||
filename=chef-server-*
|
||||
kitrepoid=rhels6_x86_64
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=rhels6/x86_64
|
||||
|
||||
kitpackage:
|
||||
filename=chef-11*
|
||||
kitrepoid=rhels6_x86_64
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=rhels6/x86_64
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#=head1 client.post
|
||||
#=head2 This command configures the chef client on a xCAT node. It is used
|
||||
# as a post installation script for chef_client_kit.rpm.
|
||||
#=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ "$NODESETSTATE" = "install" ]; then
|
||||
#prevent getting called during full install bootup
|
||||
#because the function will be called in the rpm %post section instead
|
||||
exit 0
|
||||
else
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
#configure the chef client configuration files
|
||||
/xcatpost/config_chef_client "$@"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#=head1 server.post
|
||||
#=head2 This command configures the chef server on a xCAT server or node.
|
||||
# It is used as a post install script for chef_server_kit.rpm
|
||||
#=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ "$NODESETSTATE" = "install" ]; then
|
||||
#prevent getting called during full install bootup
|
||||
#because the function will be called in the rpm %post section instead
|
||||
exit 0
|
||||
else
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
#Now configure the chef server
|
||||
/xcatpost/config_chef_server
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#=head1 workstation.post
|
||||
#=head2 This command configures the chef workstation on a xCAT node. It is used
|
||||
# as a post installation script for chef_workstation_kit.rpm.
|
||||
#=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ "$NODESETSTATE" = "install" ]; then
|
||||
#prevent getting called during full install bootup
|
||||
#because the function will be called in the rpm %post section instead
|
||||
exit 0
|
||||
else
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
#configure the chef workstation configuration files
|
||||
/xcatpost/config_chef_workstation "$@"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
# Kit Build File
|
||||
#
|
||||
# This file was initially auto-generated by the buildkit CLI command.
|
||||
# To create a new kit, the user should modify this file accordingly.
|
||||
# Refer to the buildkit manpage for further details.
|
||||
#
|
||||
|
||||
# kit: This section defines general info for the Kit.
|
||||
# There must be exactly one kit section in a kit build file.
|
||||
#
|
||||
# kit attributes:
|
||||
# basename (mandatory) Kit base name. e.g., kit-lsf
|
||||
# description (optional) Kit description.
|
||||
# version (mandatory) Kit version. e.g., 1.0
|
||||
# ostype (mandatory) Kit OS type. Must be Linux.
|
||||
# AIX is currently not supported.
|
||||
# isinternal (optional) PCM use only.
|
||||
# Indicate if Kit is for internal use.
|
||||
# Use 1 for yes, 0 for no. Default: 0
|
||||
# kitdeployparams (optional) Filename containing a list of kit deployment
|
||||
# parameters, relative to
|
||||
# <Kit Build Directory>/other_files
|
||||
kit:
|
||||
basename=xlc
|
||||
description=XLC12 for Linux
|
||||
version=12.1.0.0
|
||||
ostype=Linux
|
||||
kitlicense=ILAN
|
||||
# kitdeployparams=sample/kitdeployparams.lst
|
||||
|
||||
|
||||
# kitrepo: This section defines a Kit Package Repository.
|
||||
# There must be at least one kitrepo section in a kit build file.
|
||||
# If you want to support multiple OSes, you should create a separate
|
||||
# repo for each OS. Also, no two repos can be defined with the same
|
||||
# OS name, major/minor version and arch. For example, you cannot have
|
||||
# two repos for RHEL 6.2 ppc64 in the same kit.
|
||||
#
|
||||
# kitrepo attributes:
|
||||
# kitrepoid (mandatory) Kit package repository ID.
|
||||
# Must be unique within this file.
|
||||
# osbasename (mandatory) OS distro base name. e.g., rhels.
|
||||
# osmajorversion (mandatory) OS major version. e.g., 6
|
||||
# osminorversion (optional) OS minor version.
|
||||
# osarch (mandatory) OS architecture. e.g., ppc64
|
||||
# compat_osbasenames (optional) Comma-separated list of compatible
|
||||
# OS distro base names. e.g., centos
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=rhels6_ppc64
|
||||
osbasename=rhels
|
||||
osmajorversion=6
|
||||
osarch=ppc64
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=sles11_ppc64
|
||||
osbasename=sles
|
||||
osmajorversion=11
|
||||
osarch=ppc64
|
||||
|
||||
|
||||
# kitcomponent: This section defines one Kit Component.
|
||||
# There can be zero or more kitcomponent sections.
|
||||
# If you want to build a component which supports multiple OSes,
|
||||
# you should create one kitcomponent section for each OS.
|
||||
# Also, no two components in a kit can be defined with the same
|
||||
# base name.
|
||||
# You can define multiple kit components with the same base name
|
||||
# only if each kit component using this base name meets these
|
||||
# requirements:
|
||||
# - Each kit component must be defined with the same version
|
||||
# and release number
|
||||
# - Each kit component must be defined with a unique kitrepoid
|
||||
|
||||
#
|
||||
# kitcomponent attributes:
|
||||
# basename (mandatory) Kit component base name
|
||||
# description (optional) Kit component description
|
||||
# version (mandatory) Kit component version
|
||||
# release (mandatory) Kit component release
|
||||
# serverroles (mandatory) Comma-separated list of servers that this
|
||||
# component can install on. Valid values:
|
||||
# mgtnode,servicenode,compute,loginnode,storagenode
|
||||
# kitrepoid (mandatory) The ID of the kit package repository this
|
||||
# component belongs to
|
||||
# kitcompdeps (optional) Comma-separated list of kit component
|
||||
# dependencies. These kit components can be included in
|
||||
# this kit or in other kits.
|
||||
# ospkgdeps (optional) Comma-separated list of OS package dependencies
|
||||
# These packages must be shipped with the OS distro.
|
||||
# kitpkgdeps (optional) Comma-separated list of kit package names that
|
||||
# will be listed as "REQUIRES" when building this kit
|
||||
# component. Each package must be defined in a separate
|
||||
# kitpackage section. Each package must be in the same
|
||||
# kitrepo as this kit component.
|
||||
# non_native_pkgs (optional) TBD -- NOT SUPPORTED YET!
|
||||
# Comma-separated list of non-native package
|
||||
# paths that will be included as files in this kit
|
||||
# component. All filenames are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# Kit component deployment scripts must be specified
|
||||
# to manage these files.
|
||||
# driverpacks (optional) Comma-separated list of driver package filenames
|
||||
# Each driverpack must be defined in a separate kitpackage
|
||||
# section.
|
||||
# exlist (optional) Exclude list file for stateless image, relative
|
||||
# to <Kit Build Directory>/other_files
|
||||
# Kit component deployment scripts (optional) Each attribute specifies
|
||||
# script path relative to <Kit Build Directory>/scripts
|
||||
# Script attributes:
|
||||
# preinstall, postinstall, preuninstall, postuninstall,
|
||||
# preupgrade, postupgrade, postbootscripts
|
||||
kitcomponent:
|
||||
basename=xlc_compute
|
||||
description=XLC12 for compute nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vac.lic >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,rhels_xlc_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
kitcomponent:
|
||||
basename=xlc_loginnode
|
||||
description=XLC12 for login nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=loginnode
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vac.lic >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,rhels_xlc_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlc_compute
|
||||
description=Minimal XLC12 packages for compute nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,rhels_min_xlc_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
kitcomponent:
|
||||
basename=xlc_compute
|
||||
description=XLC12 for compute nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vac.lic >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,sles_xlc_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
kitcomponent:
|
||||
basename=xlc_loginnode
|
||||
description=XLC12 for login nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=loginnode
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vacpp.help.pdf >= 12.1.0.0,vacpp.lib >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,sles_xlc_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlc_compute
|
||||
description=Minimal XLC12 packages for compute nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,sles_min_xlc_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
|
||||
# kitpackage: This section defines one Kit Package, and how to build it.
|
||||
# There can be zero or more kitpackage sections.
|
||||
# All filenames should be relative paths to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# If you want to build a package which can run on multiple OSes,
|
||||
# you have two options:
|
||||
# 1. Build a separate package for each OS you want to support.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# per supported OS.
|
||||
# 2. Build one package that can run on multiple OSes.
|
||||
# If you are building an RPM package, you are responsible for
|
||||
# creating an RPM spec file that can run on multiple OSes.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# which contains multiple kitrepoid lines.
|
||||
#
|
||||
# kitpackage attributes:
|
||||
# filename (mandatory) Package filename
|
||||
# kitrepoid (mandatory) The repo(s) this package belongs to.
|
||||
# If multiple repos are defined, the package will be built for
|
||||
# the first repo only. For the other repos, a symlink is created
|
||||
# to the package built for the first repo.
|
||||
# Package build methods (optional)
|
||||
# Define how to build the packages.
|
||||
# If you don't specify a build method, the default behavior is
|
||||
# to assume the package is pre-built under
|
||||
# <Kit Build Directory>/source_packages
|
||||
# All files in this section are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# There are four methods to build packages.
|
||||
# 1. Use pre-built RPM package
|
||||
# isexternalpkg: 'no'|'0', 'yes'|'1' (default: 'no')
|
||||
# Indicates whether the RPM package will be added to the
|
||||
# the kit tar file now as part of the kit build process,
|
||||
# or whether the customer will need to separately
|
||||
# obtain the RPM pacakage and add it to the kit tar file
|
||||
# using 'buildkit addpkgs'
|
||||
# rpm_prebuiltdir: If isexternalpkg=yes, path to directory
|
||||
# containing pre-built RPM package
|
||||
# 2. Build RPM from spec + src dir
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srcdir: Path to source directory.
|
||||
# 3. Build RPM from spec + src tarball
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srctarball: Path to source tarball.
|
||||
# 4. Build RPM from source RPM
|
||||
# rpm_srpm: Path to source RPM package.
|
||||
kitpackage:
|
||||
filename=vac.cmp-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vac.lib-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vac.lic-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.cmp-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.help.pdf-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.lib-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.man-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.rte-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.rte.lnk-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.samples-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
./opt/ibmcmp/msg/*
|
||||
+./opt/ibmcmp/msg/en_US*
|
||||
|
||||
./opt/ibmcmp/vac/*/crt/include*
|
||||
./opt/ibmcmp/vac/*/include*
|
||||
./opt/ibmcmp/vac/*/msg/*
|
||||
+./opt/ibmcmp/vac/*/msg/en_US*
|
||||
./opt/ibmcmp/vac/*/lap/LI_*
|
||||
./opt/ibmcmp/vac/*/lap/LA_*
|
||||
./opt/ibmcmp/vac/*/lap/license/*.txt
|
||||
|
||||
./opt/ibmcmp/vacpp/*/include*
|
||||
./opt/ibmcmp/vacpp/*/msg/*
|
||||
+./opt/ibmcmp/vacpp/*/msg/en_US*
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Image Profile Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during image profile operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# This kit plugin is passed the name of an image profile.
|
||||
# We need to determine which kits is used by this
|
||||
# image profile to decide if this plugin should run or not.
|
||||
|
||||
my $imgprofilename = $request->{arg}->[0];
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $args = $request->{arg};
|
||||
|
||||
if($command eq 'kitimagevalidatecomps') {
|
||||
kitimagevalidatecomps($callback, $args);
|
||||
}
|
||||
elsif ($command eq 'kitimageimport') {
|
||||
kitimageimport($callback, $args);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimagevalidatecomps
|
||||
|
||||
This command is called to validate new changes to an
|
||||
image profile's kit component list before the changes
|
||||
are committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimagevalidatecomps {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
my $newcomplist = $args->[1];
|
||||
my @newcomplist = ();
|
||||
if (defined($newcomplist)) {
|
||||
@newcomplist = split(/,/, $newcomplist);
|
||||
}
|
||||
my $newosdistro = $args->[2];
|
||||
my $newosdistroupdate = $args->[3];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimagevalidatecomps";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimageimport
|
||||
|
||||
This command is called after changes to an image profile
|
||||
have been committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimageimport {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimageimport";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Node Management Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during node management operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $nodes = $request->{node};
|
||||
|
||||
# This kit plugin is passed a list of node names.
|
||||
# We need to determine which kits are used by these
|
||||
# nodes to decide if this plugin should run or not.
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Get the nodes using this plugin's kit
|
||||
$nodes = $kitdata->{$PLUGIN_KITNAME};
|
||||
|
||||
|
||||
if($command eq 'kitnodeadd') {
|
||||
kitnodeadd($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnoderemove') {
|
||||
kitnoderemove($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnodeupdate') {
|
||||
kitnodeupdate($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnoderefresh') {
|
||||
kitnoderefresh($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnodefinished') {
|
||||
kitnodefinished($callback);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodeadd
|
||||
|
||||
This command is called when one or more nodes are added
|
||||
to the cluster.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodeadd {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodeadd";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnoderemove
|
||||
|
||||
This command is called when one or more nodes are
|
||||
removed from the cluster.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnoderemove {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnoderemove";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodeupdate
|
||||
|
||||
This command is called when the configuration of one
|
||||
or more nodes are updated.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodeupdate {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodeupdate";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnoderefresh
|
||||
|
||||
This command is called when node-related configuration
|
||||
files are updated.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnoderefresh {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnoderefresh";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodefinished
|
||||
|
||||
This command is called at the end of a node management
|
||||
operation.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodefinished {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodefinished";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
xCAT-buildkit/share/xcat/kits/kit_build/compiler/partial_xlc12-Linux/scripts/rhels_xlc_login_install
Executable
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Sample script to accept licenses for the IBM vacpp compilers
|
||||
# For Linux:
|
||||
# Assumes all compiler software has been installed
|
||||
|
||||
OS=`uname`
|
||||
if [ $OS != "AIX" ]; then
|
||||
cd $installroot/
|
||||
vacpp_script=`find opt/ibmcmp/vacpp -name new_install -print`
|
||||
|
||||
if [ -n $installroot ]; then
|
||||
# Being run from a stateful install postscript or stateless postbootscript.
|
||||
if [ -n "$vacpp_script" ] ; then
|
||||
echo 1 | chroot $installroot /$vacpp_script
|
||||
fi
|
||||
else
|
||||
# Being run from a stateful install postscript postbootscript.
|
||||
if [ -n "$vacpp_script" ] ; then
|
||||
echo 1 | $vacpp_script
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,327 @@
|
||||
# Kit Build File
|
||||
#
|
||||
# This file was initially auto-generated by the buildkit CLI command.
|
||||
# To create a new kit, the user should modify this file accordingly.
|
||||
# Refer to the buildkit manpage for further details.
|
||||
#
|
||||
|
||||
# kit: This section defines general info for the Kit.
|
||||
# There must be exactly one kit section in a kit build file.
|
||||
#
|
||||
# kit attributes:
|
||||
# basename (mandatory) Kit base name. e.g., kit-lsf
|
||||
# description (optional) Kit description.
|
||||
# version (mandatory) Kit version. e.g., 1.0
|
||||
# ostype (mandatory) Kit OS type. Must be Linux.
|
||||
# AIX is currently not supported.
|
||||
# isinternal (optional) PCM use only.
|
||||
# Indicate if Kit is for internal use.
|
||||
# Use 1 for yes, 0 for no. Default: 0
|
||||
# kitdeployparams (optional) Filename containing a list of kit deployment
|
||||
# parameters, relative to
|
||||
# <Kit Build Directory>/other_files
|
||||
kit:
|
||||
basename=xlf
|
||||
description=XLF14 for Linux
|
||||
version=14.1.0.0
|
||||
ostype=Linux
|
||||
kitlicense=ILAN
|
||||
# kitdeployparams=sample/kitdeployparams.lst
|
||||
|
||||
|
||||
# kitrepo: This section defines a Kit Package Repository.
|
||||
# There must be at least one kitrepo section in a kit build file.
|
||||
# If you want to support multiple OSes, you should create a separate
|
||||
# repo for each OS. Also, no two repos can be defined with the same
|
||||
# OS name, major/minor version and arch. For example, you cannot have
|
||||
# two repos for RHEL 6.2 ppc64 in the same kit.
|
||||
#
|
||||
# kitrepo attributes:
|
||||
# kitrepoid (mandatory) Kit package repository ID.
|
||||
# Must be unique within this file.
|
||||
# osbasename (mandatory) OS distro base name. e.g., rhels.
|
||||
# osmajorversion (mandatory) OS major version. e.g., 6
|
||||
# osminorversion (optional) OS minor version.
|
||||
# osarch (mandatory) OS architecture. e.g., ppc64
|
||||
# compat_osbasenames (optional) Comma-separated list of compatible
|
||||
# OS distro base names. e.g., centos
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=rhels6_ppc64
|
||||
osbasename=rhels
|
||||
osmajorversion=6
|
||||
osarch=ppc64
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=sles11_ppc64
|
||||
osbasename=sles
|
||||
osmajorversion=11
|
||||
osarch=ppc64
|
||||
|
||||
|
||||
# kitcomponent: This section defines one Kit Component.
|
||||
# There can be zero or more kitcomponent sections.
|
||||
# If you want to build a component which supports multiple OSes,
|
||||
# you should create one kitcomponent section for each OS.
|
||||
# Also, no two components in a kit can be defined with the same
|
||||
# base name.
|
||||
# You can define multiple kit components with the same base name
|
||||
# only if each kit component using this base name meets these
|
||||
# requirements:
|
||||
# - Each kit component must be defined with the same version
|
||||
# and release number
|
||||
# - Each kit component must be defined with a unique kitrepoid
|
||||
|
||||
#
|
||||
# kitcomponent attributes:
|
||||
# basename (mandatory) Kit component base name
|
||||
# description (optional) Kit component description
|
||||
# version (mandatory) Kit component version
|
||||
# release (mandatory) Kit component release
|
||||
# serverroles (mandatory) Comma-separated list of servers that this
|
||||
# component can install on. Valid values:
|
||||
# mgtnode,service,compute,login,storage
|
||||
# kitrepoid (mandatory) The ID of the kit package repository this
|
||||
# component belongs to
|
||||
# kitcompdeps (optional) Comma-separated list of kit component
|
||||
# dependencies. These kit components can be included in
|
||||
# this kit or in other kits.
|
||||
# ospkgdeps (optional) Comma-separated list of OS package dependencies
|
||||
# These packages must be shipped with the OS distro.
|
||||
# kitpkgdeps (optional) Comma-separated list of kit package names that
|
||||
# will be listed as "REQUIRES" when building this kit
|
||||
# component. Each package must be defined in a separate
|
||||
# kitpackage section. Each package must be in the same
|
||||
# kitrepo as this kit component.
|
||||
# non_native_pkgs (optional) TBD -- NOT SUPPORTED YET!
|
||||
# Comma-separated list of non-native package
|
||||
# paths that will be included as files in this kit
|
||||
# component. All filenames are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# Kit component deployment scripts must be specified
|
||||
# to manage these files.
|
||||
# driverpacks (optional) Comma-separated list of driver package filenames
|
||||
# Each driverpack must be defined in a separate kitpackage
|
||||
# section.
|
||||
# exlist (optional) Exclude list file for stateless image, relative
|
||||
# to <Kit Build Directory>/other_files
|
||||
# Kit component deployment scripts (optional) Each attribute specifies
|
||||
# script path relative to <Kit Build Directory>/scripts
|
||||
# Script attributes:
|
||||
# preinstall, postinstall, preuninstall, postuninstall,
|
||||
# preupgrade, postupgrade, postbootscripts
|
||||
kitcomponent:
|
||||
basename=xlf_compute
|
||||
description=XLF14 for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_login
|
||||
description=XLF14 for login nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=login
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_xlf_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlf_compute
|
||||
description=Minimal XLF14 packages for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_min_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_compute
|
||||
description=XLF14 for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_login
|
||||
description=XLF14 for login nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=login
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_xlf_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlf_compute
|
||||
description=Minimal XLF14 packages for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_min_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
# kitpackage: This section defines one Kit Package, and how to build it.
|
||||
# There can be zero or more kitpackage sections.
|
||||
# All filenames should be relative paths to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# If you want to build a package which can run on multiple OSes,
|
||||
# you have two options:
|
||||
# 1. Build a separate package for each OS you want to support.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# per supported OS.
|
||||
# 2. Build one package that can run on multiple OSes.
|
||||
# If you are building an RPM package, you are responsible for
|
||||
# creating an RPM spec file that can run on multiple OSes.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# which contains multiple kitrepoid lines.
|
||||
#
|
||||
# kitpackage attributes:
|
||||
# filename (mandatory) Package filename
|
||||
# kitrepoid (mandatory) The repo(s) this package belongs to.
|
||||
# If multiple repos are defined, the package will be built for
|
||||
# the first repo only. For the other repos, a symlink is created
|
||||
# to the package built for the first repo.
|
||||
# Package build methods (optional)
|
||||
# Define how to build the packages.
|
||||
# If you don't specify a build method, the default behavior is
|
||||
# to assume the package is pre-built under
|
||||
# <Kit Build Directory>/source_packages
|
||||
# All files in this section are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# There are four methods to build packages.
|
||||
# 1. Use pre-built RPM package
|
||||
# isexternalpkg: 'no'|'0', 'yes'|'1' (default: 'no')
|
||||
# Indicates whether the RPM package will be added to the
|
||||
# the kit tar file now as part of the kit build process,
|
||||
# or whether the customer will need to separately
|
||||
# obtain the RPM pacakage and add it to the kit tar file
|
||||
# using 'buildkit addpkgs'
|
||||
# rpm_prebuiltdir: If isexternalpkg=yes, path to directory
|
||||
# containing pre-built RPM package
|
||||
# 2. Build RPM from spec + src dir
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srcdir: Path to source directory.
|
||||
# 3. Build RPM from spec + src tarball
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srctarball: Path to source tarball.
|
||||
# 4. Build RPM from source RPM
|
||||
# rpm_srpm: Path to source RPM package.
|
||||
kitpackage:
|
||||
filename=xlf.cmp-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.help.pdf-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.lib-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.lic-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.man-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.msg.rte-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.rte-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.rte.lnk-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.samples-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlmass.lib-7.1.0.0-120322.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.lib-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.msg.rte-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.rte-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
./opt/ibmcmp/msg/*
|
||||
+./opt/ibmcmp/msg/en_US*
|
||||
|
||||
./opt/ibmcmp/xlmass/*/include*
|
||||
./opt/ibmcmp/xlsmp/*/include*
|
||||
./opt/ibmcmp/xlhelp*
|
||||
|
||||
./opt/ibmcmp/xlf/*/include*
|
||||
./opt/ibmcmp/xlf/*/msg/*
|
||||
+./opt/ibmcmp/xlf/*/msg/en_US*
|
||||
./opt/ibmcmp/xlf/*/lap/LA_*
|
||||
./opt/ibmcmp/xlf/*/lap/LI_*
|
||||
./opt/ibmcmp/xlf/*/lap/license/*.txt
|
||||
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Image Profile Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during image profile operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# This kit plugin is passed the name of an image profile.
|
||||
# We need to determine which kits is used by this
|
||||
# image profile to decide if this plugin should run or not.
|
||||
|
||||
my $imgprofilename = $request->{arg}->[0];
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $args = $request->{arg};
|
||||
|
||||
if($command eq 'kitimagevalidatecomps') {
|
||||
kitimagevalidatecomps($callback, $args);
|
||||
}
|
||||
elsif ($command eq 'kitimageimport') {
|
||||
kitimageimport($callback, $args);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimagevalidatecomps
|
||||
|
||||
This command is called to validate new changes to an
|
||||
image profile's kit component list before the changes
|
||||
are committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimagevalidatecomps {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
my $newcomplist = $args->[1];
|
||||
my @newcomplist = ();
|
||||
if (defined($newcomplist)) {
|
||||
@newcomplist = split(/,/, $newcomplist);
|
||||
}
|
||||
my $newosdistro = $args->[2];
|
||||
my $newosdistroupdate = $args->[3];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimagevalidatecomps";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimageimport
|
||||
|
||||
This command is called after changes to an image profile
|
||||
have been committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimageimport {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimageimport";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Node Management Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during node management operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $nodes = $request->{node};
|
||||
|
||||
# This kit plugin is passed a list of node names.
|
||||
# We need to determine which kits are used by these
|
||||
# nodes to decide if this plugin should run or not.
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Get the nodes using this plugin's kit
|
||||
$nodes = $kitdata->{$PLUGIN_KITNAME};
|
||||
|
||||
|
||||
if($command eq 'kitnodeadd') {
|
||||
kitnodeadd($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnoderemove') {
|
||||
kitnoderemove($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnodeupdate') {
|
||||
kitnodeupdate($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnoderefresh') {
|
||||
kitnoderefresh($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnodefinished') {
|
||||
kitnodefinished($callback);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodeadd
|
||||
|
||||
This command is called when one or more nodes are added
|
||||
to the cluster.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodeadd {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodeadd";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnoderemove
|
||||
|
||||
This command is called when one or more nodes are
|
||||
removed from the cluster.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnoderemove {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnoderemove";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodeupdate
|
||||
|
||||
This command is called when the configuration of one
|
||||
or more nodes are updated.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodeupdate {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodeupdate";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnoderefresh
|
||||
|
||||
This command is called when node-related configuration
|
||||
files are updated.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnoderefresh {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnoderefresh";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodefinished
|
||||
|
||||
This command is called at the end of a node management
|
||||
operation.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodefinished {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodefinished";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
xCAT-buildkit/share/xcat/kits/kit_build/compiler/partial_xlf14-Linux/scripts/rhels_xlf_login_install
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Sample script to accept licenses for the IBM xlf compilers
|
||||
# For Linux:
|
||||
# Assumes all compiler software has been installed
|
||||
|
||||
OS=`uname`
|
||||
if [ $OS != "AIX" ]; then
|
||||
cd $installroot/
|
||||
xlf_script=`find opt/ibmcmp/xlf -name new_install -print`
|
||||
|
||||
if [ -n $installroot ]; then
|
||||
# Being run from a stateful install postscript or stateless postbootscript.
|
||||
if [ -n "$xlf_script" ] ; then
|
||||
echo 1 | chroot $installroot /$xlf_script
|
||||
fi
|
||||
else
|
||||
# Being run from a stateful install postscript postbootscript.
|
||||
if [ -n "$xlf_script" ] ; then
|
||||
echo 1 | $xlf_script
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,340 @@
|
||||
# Kit Build File
|
||||
#
|
||||
# This file was initially auto-generated by the buildkit CLI command.
|
||||
# To create a new kit, the user should modify this file accordingly.
|
||||
# Refer to the buildkit manpage for further details.
|
||||
#
|
||||
|
||||
# kit: This section defines general info for the Kit.
|
||||
# There must be exactly one kit section in a kit build file.
|
||||
#
|
||||
# kit attributes:
|
||||
# basename (mandatory) Kit base name. e.g., kit-lsf
|
||||
# description (optional) Kit description.
|
||||
# version (mandatory) Kit version. e.g., 1.0
|
||||
# ostype (mandatory) Kit OS type. Must be Linux.
|
||||
# AIX is currently not supported.
|
||||
# isinternal (optional) PCM use only.
|
||||
# Indicate if Kit is for internal use.
|
||||
# Use 1 for yes, 0 for no. Default: 0
|
||||
# kitdeployparams (optional) Filename containing a list of kit deployment
|
||||
# parameters, relative to
|
||||
# <Kit Build Directory>/other_files
|
||||
kit:
|
||||
basename=xlf
|
||||
description=XLF14 for Linux
|
||||
version=14.1.0.0
|
||||
ostype=Linux
|
||||
kitlicense=ILAN
|
||||
# kitdeployparams=sample/kitdeployparams.lst
|
||||
|
||||
|
||||
# kitrepo: This section defines a Kit Package Repository.
|
||||
# There must be at least one kitrepo section in a kit build file.
|
||||
# If you want to support multiple OSes, you should create a separate
|
||||
# repo for each OS. Also, no two repos can be defined with the same
|
||||
# OS name, major/minor version and arch. For example, you cannot have
|
||||
# two repos for RHEL 6.2 ppc64 in the same kit.
|
||||
#
|
||||
# kitrepo attributes:
|
||||
# kitrepoid (mandatory) Kit package repository ID.
|
||||
# Must be unique within this file.
|
||||
# osbasename (mandatory) OS distro base name. e.g., rhels.
|
||||
# osmajorversion (mandatory) OS major version. e.g., 6
|
||||
# osminorversion (optional) OS minor version.
|
||||
# osarch (mandatory) OS architecture. e.g., ppc64
|
||||
# compat_osbasenames (optional) Comma-separated list of compatible
|
||||
# OS distro base names. e.g., centos
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=rhels6_ppc64
|
||||
osbasename=rhels
|
||||
osmajorversion=6
|
||||
osarch=ppc64
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=sles11_ppc64
|
||||
osbasename=sles
|
||||
osmajorversion=11
|
||||
osarch=ppc64
|
||||
|
||||
|
||||
# kitcomponent: This section defines one Kit Component.
|
||||
# There can be zero or more kitcomponent sections.
|
||||
# If you want to build a component which supports multiple OSes,
|
||||
# you should create one kitcomponent section for each OS.
|
||||
# Also, no two components in a kit can be defined with the same
|
||||
# base name.
|
||||
# You can define multiple kit components with the same base name
|
||||
# only if each kit component using this base name meets these
|
||||
# requirements:
|
||||
# - Each kit component must be defined with the same version
|
||||
# and release number
|
||||
# - Each kit component must be defined with a unique kitrepoid
|
||||
|
||||
#
|
||||
# kitcomponent attributes:
|
||||
# basename (mandatory) Kit component base name
|
||||
# description (optional) Kit component description
|
||||
# version (mandatory) Kit component version
|
||||
# release (mandatory) Kit component release
|
||||
# serverroles (mandatory) Comma-separated list of servers that this
|
||||
# component can install on. Valid values:
|
||||
# mgtnode,service,compute,login,storage
|
||||
# kitrepoid (mandatory) The ID of the kit package repository this
|
||||
# component belongs to
|
||||
# kitcompdeps (optional) Comma-separated list of kit component
|
||||
# dependencies. These kit components can be included in
|
||||
# this kit or in other kits.
|
||||
# ospkgdeps (optional) Comma-separated list of OS package dependencies
|
||||
# These packages must be shipped with the OS distro.
|
||||
# kitpkgdeps (optional) Comma-separated list of kit package names that
|
||||
# will be listed as "REQUIRES" when building this kit
|
||||
# component. Each package must be defined in a separate
|
||||
# kitpackage section. Each package must be in the same
|
||||
# kitrepo as this kit component.
|
||||
# non_native_pkgs (optional) TBD -- NOT SUPPORTED YET!
|
||||
# Comma-separated list of non-native package
|
||||
# paths that will be included as files in this kit
|
||||
# component. All filenames are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# Kit component deployment scripts must be specified
|
||||
# to manage these files.
|
||||
# driverpacks (optional) Comma-separated list of driver package filenames
|
||||
# Each driverpack must be defined in a separate kitpackage
|
||||
# section.
|
||||
# exlist (optional) Exclude list file for stateless image, relative
|
||||
# to <Kit Build Directory>/other_files
|
||||
# Kit component deployment scripts (optional) Each attribute specifies
|
||||
# script path relative to <Kit Build Directory>/scripts
|
||||
# Script attributes:
|
||||
# preinstall, postinstall, preuninstall, postuninstall,
|
||||
# preupgrade, postupgrade, postbootscripts
|
||||
kitcomponent:
|
||||
basename=xlf_compute
|
||||
description=XLF14 for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_login
|
||||
description=XLF14 for login nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=login
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_xlf_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlf_compute
|
||||
description=Minimal XLF14 packages for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_min_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_compute
|
||||
description=XLF14 for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_login
|
||||
description=XLF14 for login nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=login
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_xlf_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlf_compute
|
||||
description=Minimal XLF14 packages for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_min_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
# kitpackage: This section defines one Kit Package, and how to build it.
|
||||
# There can be zero or more kitpackage sections.
|
||||
# All filenames should be relative paths to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# If you want to build a package which can run on multiple OSes,
|
||||
# you have two options:
|
||||
# 1. Build a separate package for each OS you want to support.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# per supported OS.
|
||||
# 2. Build one package that can run on multiple OSes.
|
||||
# If you are building an RPM package, you are responsible for
|
||||
# creating an RPM spec file that can run on multiple OSes.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# which contains multiple kitrepoid lines.
|
||||
#
|
||||
# kitpackage attributes:
|
||||
# filename (mandatory) Package filename
|
||||
# kitrepoid (mandatory) The repo(s) this package belongs to.
|
||||
# If multiple repos are defined, the package will be built for
|
||||
# the first repo only. For the other repos, a symlink is created
|
||||
# to the package built for the first repo.
|
||||
# Package build methods (optional)
|
||||
# Define how to build the packages.
|
||||
# If you don't specify a build method, the default behavior is
|
||||
# to assume the package is pre-built under
|
||||
# <Kit Build Directory>/source_packages
|
||||
# All files in this section are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# There are four methods to build packages.
|
||||
# 1. Use pre-built RPM package
|
||||
# isexternalpkg: 'no'|'0', 'yes'|'1' (default: 'no')
|
||||
# Indicates whether the RPM package will be added to the
|
||||
# the kit tar file now as part of the kit build process,
|
||||
# or whether the customer will need to separately
|
||||
# obtain the RPM pacakage and add it to the kit tar file
|
||||
# using 'buildkit addpkgs'
|
||||
# rpm_prebuiltdir: If isexternalpkg=no, path to directory
|
||||
# containing pre-built RPM package
|
||||
# 2. Build RPM from spec + src dir
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srcdir: Path to source directory.
|
||||
# 3. Build RPM from spec + src tarball
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srctarball: Path to source tarball.
|
||||
# 4. Build RPM from source RPM
|
||||
# rpm_srpm: Path to source RPM package.
|
||||
kitpackage:
|
||||
filename=xlf.cmp-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.help.pdf-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.lib-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.lic-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.man-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.msg.rte-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.rte-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.rte.lnk-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.samples-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlmass.lib-7.1.0.0-120322.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.lib-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.msg.rte-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.rte-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
./opt/ibmcmp/msg/*
|
||||
+./opt/ibmcmp/msg/en_US*
|
||||
|
||||
./opt/ibmcmp/xlmass/*/include*
|
||||
./opt/ibmcmp/xlsmp/*/include*
|
||||
./opt/ibmcmp/xlhelp*
|
||||
|
||||
./opt/ibmcmp/xlf/*/include*
|
||||
./opt/ibmcmp/xlf/*/msg/*
|
||||
+./opt/ibmcmp/xlf/*/msg/en_US*
|
||||
./opt/ibmcmp/xlf/*/lap/LA_*
|
||||
./opt/ibmcmp/xlf/*/lap/LI_*
|
||||
./opt/ibmcmp/xlf/*/lap/license/*.txt
|
||||
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Image Profile Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during image profile operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# This kit plugin is passed the name of an image profile.
|
||||
# We need to determine which kits is used by this
|
||||
# image profile to decide if this plugin should run or not.
|
||||
|
||||
my $imgprofilename = $request->{arg}->[0];
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $args = $request->{arg};
|
||||
|
||||
if($command eq 'kitimagevalidatecomps') {
|
||||
kitimagevalidatecomps($callback, $args);
|
||||
}
|
||||
elsif ($command eq 'kitimageimport') {
|
||||
kitimageimport($callback, $args);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimagevalidatecomps
|
||||
|
||||
This command is called to validate new changes to an
|
||||
image profile's kit component list before the changes
|
||||
are committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimagevalidatecomps {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
my $newcomplist = $args->[1];
|
||||
my @newcomplist = ();
|
||||
if (defined($newcomplist)) {
|
||||
@newcomplist = split(/,/, $newcomplist);
|
||||
}
|
||||
my $newosdistro = $args->[2];
|
||||
my $newosdistroupdate = $args->[3];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimagevalidatecomps";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimageimport
|
||||
|
||||
This command is called after changes to an image profile
|
||||
have been committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimageimport {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimageimport";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Node Management Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during node management operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $nodes = $request->{node};
|
||||
|
||||
# This kit plugin is passed a list of node names.
|
||||
# We need to determine which kits are used by these
|
||||
# nodes to decide if this plugin should run or not.
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Get the nodes using this plugin's kit
|
||||
$nodes = $kitdata->{$PLUGIN_KITNAME};
|
||||
|
||||
|
||||
if($command eq 'kitnodeadd') {
|
||||
kitnodeadd($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnoderemove') {
|
||||
kitnoderemove($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnodeupdate') {
|
||||
kitnodeupdate($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnoderefresh') {
|
||||
kitnoderefresh($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnodefinished') {
|
||||
kitnodefinished($callback);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodeadd
|
||||
|
||||
This command is called when one or more nodes are added
|
||||
to the cluster.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodeadd {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodeadd";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnoderemove
|
||||
|
||||
This command is called when one or more nodes are
|
||||
removed from the cluster.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnoderemove {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnoderemove";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodeupdate
|
||||
|
||||
This command is called when the configuration of one
|
||||
or more nodes are updated.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodeupdate {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodeupdate";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnoderefresh
|
||||
|
||||
This command is called when node-related configuration
|
||||
files are updated.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnoderefresh {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnoderefresh";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodefinished
|
||||
|
||||
This command is called at the end of a node management
|
||||
operation.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodefinished {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodefinished";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Sample script to accept licenses for the IBM xlf compilers
|
||||
# For Linux:
|
||||
# Assumes all compiler software has been installed
|
||||
|
||||
OS=`uname`
|
||||
if [ $OS != "AIX" ]; then
|
||||
cd $installroot/
|
||||
xlf_script=`find opt/ibmcmp/xlf -name new_install -print`
|
||||
|
||||
if [ -n $installroot ]; then
|
||||
# Being run from a stateful install postscript or stateless postbootscript.
|
||||
if [ -n "$xlf_script" ] ; then
|
||||
echo 1 | chroot $installroot /$xlf_script
|
||||
fi
|
||||
else
|
||||
# Being run from a stateful install postscript postbootscript.
|
||||
if [ -n "$xlf_script" ] ; then
|
||||
echo 1 | $xlf_script
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,294 @@
|
||||
# Kit Build File
|
||||
#
|
||||
# This file was initially auto-generated by the buildkit CLI command.
|
||||
# To create a new kit, the user should modify this file accordingly.
|
||||
# Refer to the buildkit manpage for further details.
|
||||
#
|
||||
|
||||
# kit: This section defines general info for the Kit.
|
||||
# There must be exactly one kit section in a kit build file.
|
||||
#
|
||||
# kit attributes:
|
||||
# basename (mandatory) Kit base name. e.g., kit-lsf
|
||||
# description (optional) Kit description.
|
||||
# version (mandatory) Kit version. e.g., 1.0
|
||||
# ostype (mandatory) Kit OS type. Must be Linux.
|
||||
# AIX is currently not supported.
|
||||
# isinternal (optional) PCM use only.
|
||||
# Indicate if Kit is for internal use.
|
||||
# Use 1 for yes, 0 for no. Default: 0
|
||||
# kitdeployparams (optional) Filename containing a list of kit deployment
|
||||
# parameters, relative to
|
||||
# <Kit Build Directory>/other_files
|
||||
kit:
|
||||
basename=essl
|
||||
description=essl for Linux
|
||||
version=5.1.1
|
||||
ostype=Linux
|
||||
kitlicense=ILAN
|
||||
kitdeployparams=essl.env
|
||||
|
||||
|
||||
# kitrepo: This section defines a Kit Package Repository.
|
||||
# There must be at least one kitrepo section in a kit build file.
|
||||
# If you want to support multiple OSes, you should create a separate
|
||||
# repo for each OS. Also, no two repos can be defined with the same
|
||||
# OS name, major/minor version and arch. For example, you cannot have
|
||||
# two repos for RHEL 6.2 ppc64 in the same kit.
|
||||
#
|
||||
# kitrepo attributes:
|
||||
# kitrepoid (mandatory) Kit package repository ID.
|
||||
# Must be unique within this file.
|
||||
# osbasename (mandatory) OS distro base name. e.g., rhels.
|
||||
# osmajorversion (mandatory) OS major version. e.g., 6
|
||||
# osminorversion (optional) OS minor version.
|
||||
# osarch (mandatory) OS architecture. e.g., ppc64
|
||||
# compat_osbasenames (optional) Comma-separated list of compatible
|
||||
# OS distro base names. e.g., centos
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=rhels6_ppc64
|
||||
osbasename=rhels
|
||||
osmajorversion=6
|
||||
osarch=ppc64
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=sles11_ppc64
|
||||
osbasename=sles
|
||||
osmajorversion=11
|
||||
osarch=ppc64
|
||||
|
||||
|
||||
# kitcomponent: This section defines one Kit Component.
|
||||
# There can be zero or more kitcomponent sections.
|
||||
# If you want to build a component which supports multiple OSes,
|
||||
# you should create one kitcomponent section for each OS.
|
||||
# Also, no two components in a kit can be defined with the same
|
||||
# base name.
|
||||
# You can define multiple kit components with the same base name
|
||||
# only if each kit component using this base name meets these
|
||||
# requirements:
|
||||
# - Each kit component must be defined with the same version
|
||||
# and release number
|
||||
# - Each kit component must be defined with a unique kitrepoid
|
||||
|
||||
#
|
||||
# kitcomponent attributes:
|
||||
# basename (mandatory) Kit component base name
|
||||
# description (optional) Kit component description
|
||||
# version (mandatory) Kit component version
|
||||
# release (mandatory) Kit component release
|
||||
# serverroles (mandatory) Comma-separated list of servers that this
|
||||
# component can install on. Valid values:
|
||||
# mgtnode,servicenode,compute,loginnode,storagenode
|
||||
# kitrepoid (mandatory) The ID of the kit package repository this
|
||||
# component belongs to
|
||||
# kitcompdeps (optional) Comma-separated list of kit component
|
||||
# dependencies. These kit components can be included in
|
||||
# this kit or in other kits.
|
||||
# ospkgdeps (optional) Comma-separated list of OS package dependencies
|
||||
# These packages must be shipped with the OS distro.
|
||||
# kitpkgdeps (optional) Comma-separated list of kit package names that
|
||||
# will be listed as "REQUIRES" when building this kit
|
||||
# component. Each package must be defined in a separate
|
||||
# kitpackage section. Each package must be in the same
|
||||
# kitrepo as this kit component.
|
||||
# non_native_pkgs (optional) TBD -- NOT SUPPORTED YET!
|
||||
# Comma-separated list of non-native package
|
||||
# paths that will be included as files in this kit
|
||||
# component. All filenames are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# Kit component deployment scripts must be specified
|
||||
# to manage these files.
|
||||
# driverpacks (optional) Comma-separated list of driver package filenames
|
||||
# Each driverpack must be defined in a separate kitpackage
|
||||
# section.
|
||||
# exlist (optional) Exclude list file for stateless image, relative
|
||||
# to <Kit Build Directory>/other_files
|
||||
# Kit component deployment scripts (optional) Each attribute specifies
|
||||
# script path relative to <Kit Build Directory>/scripts
|
||||
# Script attributes:
|
||||
# preinstall, postinstall, preuninstall, postuninstall,
|
||||
# preupgrade, postupgrade, postbootscripts
|
||||
kitcomponent:
|
||||
basename=essl_compute
|
||||
description=essl for compute nodes
|
||||
version=5.1.1
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=bc
|
||||
kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1
|
||||
exlist=essl.exlist
|
||||
|
||||
kitcomponent:
|
||||
basename=essl_loginnode
|
||||
description=essl for login nodes
|
||||
version=5.1.1
|
||||
release=0
|
||||
serverroles=loginnode
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=bc
|
||||
kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1
|
||||
exlist=essl.exlist
|
||||
|
||||
kitcomponent:
|
||||
basename=min_essl_compute
|
||||
description=Minimal essl packages for compute nodes
|
||||
version=5.1.1
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=bc
|
||||
kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1
|
||||
exlist=essl.exlist
|
||||
|
||||
kitcomponent:
|
||||
basename=essl_compute
|
||||
description=essl for compute nodes
|
||||
version=5.1.1
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=bc
|
||||
kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1
|
||||
exlist=essl.exlist
|
||||
|
||||
kitcomponent:
|
||||
basename=essl_loginnode
|
||||
description=essl for compute nodes
|
||||
version=5.1.1
|
||||
release=0
|
||||
serverroles=loginnode
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=bc
|
||||
kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.man >= 5.1.1,essl.msg >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1
|
||||
exlist=essl.exlist
|
||||
|
||||
kitcomponent:
|
||||
basename=min_essl_compute
|
||||
description=Minimal essl packages for compute nodes
|
||||
version=5.1.1
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=bc
|
||||
kitpkgdeps=essl.3232.rte >= 5.1.1,essl.3264.rte >= 5.1.1,essl.6464.rte >= 5.1.1,essl.bg.rte >= 5.1.1,essl.common >= 5.1.1,essl.license >= 5.1.1,essl.rte >= 5.1.1,essl.rte.common >= 5.1.1
|
||||
exlist=essl.exlist
|
||||
|
||||
|
||||
# kitpackage: This section defines one Kit Package, and how to build it.
|
||||
# There can be zero or more kitpackage sections.
|
||||
# All filenames should be relative paths to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# If you want to build a package which can run on multiple OSes,
|
||||
# you have two options:
|
||||
# 1. Build a separate package for each OS you want to support.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# per supported OS.
|
||||
# 2. Build one package that can run on multiple OSes.
|
||||
# If you are building an RPM package, you are responsible for
|
||||
# creating an RPM spec file that can run on multiple OSes.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# which contains multiple kitrepoid lines.
|
||||
#
|
||||
# kitpackage attributes:
|
||||
# filename (mandatory) Package filename
|
||||
# kitrepoid (mandatory) The repo(s) this package belongs to.
|
||||
# If multiple repos are defined, the package will be built for
|
||||
# the first repo only. For the other repos, a symlink is created
|
||||
# to the package built for the first repo.
|
||||
# Package build methods (optional)
|
||||
# Define how to build the packages.
|
||||
# If you don't specify a build method, the default behavior is
|
||||
# to assume the package is pre-built under
|
||||
# <Kit Build Directory>/source_packages
|
||||
# All files in this section are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# There are four methods to build packages.
|
||||
# 1. Use pre-built RPM package
|
||||
# isexternalpkg: 'no'|'0', 'yes'|'1' (default: 'no')
|
||||
# Indicates whether the RPM package will be added to the
|
||||
# the kit tar file now as part of the kit build process,
|
||||
# or whether the customer will need to separately
|
||||
# obtain the RPM pacakage and add it to the kit tar file
|
||||
# using 'buildkit addpkgs'
|
||||
# rpm_prebuiltdir: If isexternalpkg=no, path to directory
|
||||
# containing pre-built RPM package
|
||||
# 2. Build RPM from spec + src dir
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srcdir: Path to source directory.
|
||||
# 3. Build RPM from spec + src tarball
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srctarball: Path to source tarball.
|
||||
# 4. Build RPM from source RPM
|
||||
# rpm_srpm: Path to source RPM package.
|
||||
kitpackage:
|
||||
filename=essl.3232.rte-5.1.1-0.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
kitpackage:
|
||||
filename=essl.3264.rte-5.1.1-0.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
kitpackage:
|
||||
filename=essl.6464.rte-5.1.1-0.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
kitpackage:
|
||||
filename=essl.bg.rte-5.1.1-0.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
kitpackage:
|
||||
filename=essl.common-5.1.1-0.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
kitpackage:
|
||||
filename=essl.license-5.1.1-0.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
kitpackage:
|
||||
filename=essl.man-5.1.1-0.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
kitpackage:
|
||||
filename=essl.msg-5.1.1-0.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
kitpackage:
|
||||
filename=essl.rte-5.1.1-0.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
kitpackage:
|
||||
filename=essl.rte.common-5.1.1-0.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
@@ -0,0 +1 @@
|
||||
#ENV:IBM_ESSL_LICENSE_ACCEPT=yes#
|
||||
@@ -0,0 +1,6 @@
|
||||
./opt/ibmmath/essl/*/FFTW3/include*
|
||||
./opt/ibmmath/essl/*/include*
|
||||
./opt/ibmmath/essl/*/lap/license/*.txt
|
||||
./opt/ibmmath/essl/*/lap/LI_*
|
||||
./opt/ibmmath/essl/*/lap/LA_*
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Image Profile Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during image profile operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# This kit plugin is passed the name of an image profile.
|
||||
# We need to determine which kits is used by this
|
||||
# image profile to decide if this plugin should run or not.
|
||||
|
||||
my $imgprofilename = $request->{arg}->[0];
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $args = $request->{arg};
|
||||
|
||||
if($command eq 'kitimagevalidatecomps') {
|
||||
kitimagevalidatecomps($callback, $args);
|
||||
}
|
||||
elsif ($command eq 'kitimageimport') {
|
||||
kitimageimport($callback, $args);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimagevalidatecomps
|
||||
|
||||
This command is called to validate new changes to an
|
||||
image profile's kit component list before the changes
|
||||
are committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimagevalidatecomps {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
my $newcomplist = $args->[1];
|
||||
my @newcomplist = ();
|
||||
if (defined($newcomplist)) {
|
||||
@newcomplist = split(/,/, $newcomplist);
|
||||
}
|
||||
my $newosdistro = $args->[2];
|
||||
my $newosdistroupdate = $args->[3];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimagevalidatecomps";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimageimport
|
||||
|
||||
This command is called after changes to an image profile
|
||||
have been committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimageimport {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimageimport";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user