Compare commits
127 Commits
configbrid
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
896877deb7 | ||
|
bbcfef36e2 | ||
|
cd6c70e22e | ||
|
4d7ca44ef5 | ||
|
9eed5a49df | ||
|
8cce1682ac | ||
|
5019ce2e9f | ||
|
2d5bc5b1e6 | ||
|
43ec8b55ef | ||
|
520a74e3da | ||
|
c4438568d7 | ||
|
6b13006087 | ||
|
2e1c907ca6 | ||
|
9cdbf88346 | ||
|
897192224e | ||
|
5e7021bb80 | ||
|
f5deaf59cb | ||
|
4e8957d984 | ||
|
e959e5a698 | ||
|
2ad95b27e4 | ||
|
3746d974b8 | ||
|
5ac2c0a4d6 | ||
|
33f614b584 | ||
|
6004cc18f1 | ||
|
0e227799b9 | ||
|
060ae4f8c1 | ||
|
88b0009e12 | ||
|
47fd4327b6 | ||
|
33b992ae81 | ||
|
603a07def3 | ||
|
014d8ce183 | ||
|
78bc498a76 | ||
|
c339024112 | ||
|
b769c4b1bc | ||
|
f844701198 | ||
|
cc73b77243 | ||
|
9616e681a5 | ||
|
48ae224911 | ||
|
4d3e209c3e | ||
|
b2a04a221b | ||
|
358e83a5bb | ||
|
b94a492b21 | ||
|
8f298de177 | ||
|
2fd0f59cca | ||
|
3cc5e0cdf4 | ||
|
39bc1e21a6 | ||
|
aa7765accf | ||
|
21204f4dde | ||
|
f02a5e927d | ||
|
b572fc52b4 | ||
|
f8bd32838a | ||
|
506493aa0a | ||
|
419af5ce88 | ||
|
30950ea29e | ||
|
719c6d0de3 | ||
|
28e6939268 | ||
|
e80b5d707e | ||
|
1bce6d44c8 | ||
|
5068a8b99d | ||
|
5371f78dbb | ||
|
9f839cd82f | ||
|
71d4dabbd4 | ||
|
ff3eee61f3 | ||
|
fb02c18853 | ||
|
b0979eafc9 | ||
|
465fc18b2a | ||
|
89f58e514a | ||
|
254f7b7b43 | ||
|
f731fb2ec9 | ||
|
28cb65ebac | ||
|
e2713f9b7b | ||
|
a2fa0c2a28 | ||
|
50a086327b | ||
|
b99e85f108 | ||
|
17b29dcd17 | ||
|
cddf0ba309 | ||
|
8e0a2fe479 | ||
|
7c804caa9e | ||
|
56d468f669 | ||
|
f6ea4a1bbc | ||
|
ecf9564c46 | ||
|
0bd0860cdc | ||
|
d08a231d1a | ||
|
e581247ade | ||
|
6c6994af5a | ||
|
f66b9b9c12 | ||
|
1636b11e4b | ||
|
ebe61dbab5 | ||
|
7333896fcb | ||
|
7ff60abe6e | ||
|
ff2e58e66f | ||
|
c51cfca5e1 | ||
|
793a6c1709 | ||
|
3a65b11326 | ||
|
acd15d4648 | ||
|
d009a51b1c | ||
|
8f90acc07c | ||
|
551bc0ab11 | ||
|
e5cee0d433 | ||
|
9e2ca88638 | ||
|
52f78c5449 | ||
|
85f758bd0d | ||
|
c1eeb2f1ed | ||
|
d381d3e723 | ||
|
f5d79bdaa2 | ||
|
63df86d1a3 | ||
|
798eb16f3b | ||
|
19853bf2d2 | ||
|
6227d2f2b6 | ||
|
4f34aae746 | ||
|
282d1e354d | ||
|
1b7974de07 | ||
|
320d7743d3 | ||
|
1bf4c73c5d | ||
|
c94b02d789 | ||
|
6c44423812 | ||
|
21caa0d9b9 | ||
|
147185c198 | ||
|
32753450ae | ||
|
30f6a66814 | ||
|
350421129d | ||
|
9ec565a908 | ||
|
78cdcc04b3 | ||
|
73ed881e05 | ||
|
0a4c7179c4 | ||
|
a632f3186c | ||
|
733e2bc0cd |
@ -27,6 +27,7 @@
|
||||
# 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
|
||||
# LOG=<filename> - provide an LOG file option to redirect some output into log file
|
||||
#
|
||||
# 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
|
||||
@ -94,8 +95,7 @@ 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"
|
||||
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
|
||||
@ -112,13 +112,18 @@ fi
|
||||
|
||||
export HOME=/root
|
||||
|
||||
WGET_CMD="wget"
|
||||
if [ ! -z ${LOG} ]; then
|
||||
WGET_CMD="wget -o ${LOG}"
|
||||
fi
|
||||
|
||||
#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
|
||||
${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name
|
||||
chmod 600 $HOME/.gnupg/$key_name
|
||||
fi
|
||||
done
|
||||
@ -220,6 +225,7 @@ then
|
||||
rc=$?
|
||||
if [ $rc -gt 0 ]; then
|
||||
echo "Error: $file build package failed exit code $rc"
|
||||
exit $rc
|
||||
fi
|
||||
cd -
|
||||
find $file -maxdepth 3 -type d -name "${file_low}*" | grep debian | xargs rm -rf
|
||||
|
37
buildcore.sh
37
buildcore.sh
@ -36,9 +36,10 @@
|
||||
# GITUP=<filename> - control which rpms get built by specifying a coregitup file
|
||||
# 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
|
||||
# LOG=<filename> - provide an LOG file option to redirect some output into log file
|
||||
|
||||
# you can change this if you need to
|
||||
UPLOADUSER=bp-sawyers
|
||||
UPLOADUSER=litingt
|
||||
FRS=/home/frs/project/x/xc/xcat
|
||||
|
||||
# These are the rpms that should be built for each kind of xcat build
|
||||
@ -49,7 +50,7 @@ ZVMLINK="xCAT-client xCAT xCATsn"
|
||||
# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON)
|
||||
# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON)
|
||||
PCMBUILD="xCAT xCAT-server xCAT-client xCATsn"
|
||||
PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64"
|
||||
PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 xCAT-vlan"
|
||||
# Note: for FSM, the FlexCAT rpm is built separately from gsa/git
|
||||
FSMBUILD="perl-xCAT xCAT-client xCAT-server"
|
||||
FSMLINK=""
|
||||
@ -85,21 +86,19 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
echo "Can't get lock /var/lock/xcatbld-$REL.lock. Someone else must be doing a build right now. Exiting...."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export HOME=/root # This is so rpm and gpg will know home, even in sudo
|
||||
# This is so rpm and gpg will know home, even in sudo
|
||||
export HOME=/root
|
||||
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
|
||||
if [ "$REL" = "xcat-core" ]; then # using git
|
||||
GIT=1
|
||||
setbranch # this changes the REL variable
|
||||
fi
|
||||
@ -131,7 +130,7 @@ 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
|
||||
if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms
|
||||
DESTDIR=../../$REL$EMBEDDIR/$XCATCORE
|
||||
else
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
@ -184,7 +183,8 @@ 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 [ "$GIT" = "1" ]; then
|
||||
# using git
|
||||
if [ -z "$GITUP" ]; then
|
||||
GITUP=../coregitup
|
||||
echo "git pull > $GITUP"
|
||||
@ -198,7 +198,8 @@ if [ "$GIT" = "1" ]; then # using git
|
||||
if ! $GREP 'Already up-to-date' $GITUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
else # using svn
|
||||
else
|
||||
# using svn
|
||||
GIT=0
|
||||
if [ -z "$SVNUP" ]; then
|
||||
SVNUP=../coresvnup
|
||||
@ -242,7 +243,6 @@ fi
|
||||
|
||||
# Build the rest of the noarch rpms
|
||||
for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT-SoftLayer xCAT-vlan xCAT-confluent; do
|
||||
#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 [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-SoftLayer" ]; then continue; fi # do not build xCAT-softlayer on aix
|
||||
@ -253,7 +253,8 @@ for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xC
|
||||
maker $rpmname
|
||||
fi
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
if [ "$rpmname" = "xCAT-client" -o "$rpmname" = "xCAT-server" ]; then # we do not automatically install the rest of the rpms on AIX
|
||||
if [ "$rpmname" = "xCAT-client" -o "$rpmname" = "xCAT-server" ]; then
|
||||
# we do not automatically install the rest of the rpms on AIX
|
||||
echo "rpm -Uvh $rpmname-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
|
||||
fi
|
||||
fi
|
||||
@ -281,9 +282,7 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
fi
|
||||
|
||||
# Build the xCAT and xCATsn rpms for all platforms
|
||||
#for rpmname in xCAT xCATsn xCAT-OpenStack xCAT-OpenStack-baremetal; do
|
||||
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
|
||||
UPLOAD=1
|
||||
@ -345,6 +344,10 @@ fi
|
||||
#else we will continue
|
||||
|
||||
# Prepare the RPMs for pkging and upload
|
||||
WGET_CMD="wget"
|
||||
if [ ! -z ${LOG} ]; then
|
||||
WGET_CMD="wget -o ${LOG}"
|
||||
fi
|
||||
|
||||
# get gpg keys in place
|
||||
if [ "$OSNAME" != "AIX" ]; then
|
||||
@ -352,7 +355,7 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
for i in pubring.gpg secring.gpg trustdb.gpg; do
|
||||
if [ ! -f $HOME/.gnupg/$i ] || [ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then
|
||||
rm -f $HOME/.gnupg/$i
|
||||
wget -P $HOME/.gnupg $GSA/keys/$i
|
||||
${WGET_CMD} -P $HOME/.gnupg $GSA/keys/$i
|
||||
chmod 600 $HOME/.gnupg/$i
|
||||
fi
|
||||
done
|
||||
@ -374,10 +377,10 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
|
||||
gpg -a --detach-sign $SRCDIR/repodata/repomd.xml
|
||||
if [ ! -f $DESTDIR/repodata/repomd.xml.key ]; then
|
||||
wget -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
|
||||
${WGET_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
|
||||
fi
|
||||
if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then
|
||||
wget -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
|
||||
${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
# VERBOSE=1 - to see lots of verbose output
|
||||
|
||||
# you can change this if you need to
|
||||
UPLOADUSER=bp-sawyers
|
||||
UPLOADUSER=litingt
|
||||
|
||||
FRS=/home/frs/project/x/xc/xcat
|
||||
OSNAME=$(uname)
|
||||
|
12
makerpm
12
makerpm
@ -23,6 +23,18 @@ function makenoarch {
|
||||
RC=$?
|
||||
else # linux
|
||||
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $EMBEDTXT..."
|
||||
# TODO: should fix this up, this is a hack for the new build machine
|
||||
if [ $RPMNAME = "xCAT-UI" ]; then
|
||||
# Only if the old compiler.jar file does not exist.....
|
||||
if [ ! -e /xcat2/build/tools/compiler.jar ]; then
|
||||
# look for the dynamic location of the compiler.jar file
|
||||
DIRNAME=`dirname $(readlink -f $0)`
|
||||
COMPILER_JAR=`echo "${DIRNAME%%linux_rpm/*}tools/compiler.jar"`
|
||||
if [ -f $COMPILER_JAR ]; then
|
||||
sed -i "s#/xcat2/build/tools/compiler.jar#${COMPILER_JAR}#g" xCAT-UI/xCAT-UI.spec
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
||||
rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz
|
||||
|
@ -2509,13 +2509,12 @@ sub gen_net_boot_params
|
||||
$net_params->{nicname} = $nicname;
|
||||
$net_params->{mac} = $mac;
|
||||
}
|
||||
|
||||
if ($nicname) {
|
||||
$net_params->{ksdevice} = "ksdevice=$nicname";
|
||||
$net_params->{ip} = "ip=$nicname:dhcp";
|
||||
$net_params->{netdev} = "netdev=$nicname";
|
||||
$net_params->{netdevice} = "netdevice=$nicname";
|
||||
$net_params->{ifname} = "ifname=$nodebootif:$mac";
|
||||
$net_params->{ifname} = "ifname=$nicname:$mac";
|
||||
} elsif ($mac) {
|
||||
$net_params->{ksdevice} = "ksdevice=$mac";
|
||||
$net_params->{BOOTIF} = "BOOTIF=$mac";
|
||||
|
@ -996,6 +996,72 @@ sub is_fsp_node
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 is_kvm_node
|
||||
Description : Judge whether nodes are KVM nodes.
|
||||
Arguments : $hardwareprofile - hardwareprofile name
|
||||
Returns : 1 - KVM nodes
|
||||
0 - Not KVM nodes
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub is_kvm_node
|
||||
{
|
||||
my $class = shift;
|
||||
my $hardwareprofile = shift;
|
||||
|
||||
if (not $hardwareprofile) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#Get hardwareprofile mgt
|
||||
my $nodehmtab = xCAT::Table->new('nodehm');
|
||||
my $mgtentry = $nodehmtab->getNodeAttribs($hardwareprofile, ['mgt']);
|
||||
my $mgt = undef;
|
||||
$mgt = $mgtentry->{'mgt'} if ($mgtentry->{'mgt'});
|
||||
$nodehmtab->close();
|
||||
|
||||
if ($mgt eq 'kvm') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 is_kvm_hypv_node
|
||||
Description : Judge whether nodes are KVM nodes.
|
||||
Arguments : $imageprofile - imageprofile name
|
||||
Returns : 1 - KVM hypervisor nodes
|
||||
0 - Not KVM hypervisor nodes
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub is_kvm_hypv_node
|
||||
{
|
||||
my $class = shift;
|
||||
my $imageprofile = shift;
|
||||
|
||||
# Get provmethod
|
||||
my $provmethod = xCAT::ProfiledNodeUtils->get_imageprofile_prov_method($imageprofile);
|
||||
unless ($provmethod ){
|
||||
return 0;
|
||||
}
|
||||
|
||||
my $osimage_tab = xCAT::Table->new('osimage');
|
||||
my $osimage_tab_entry = $osimage_tab->getAttribs({'imagename'=> $provmethod},('osdistroname'));
|
||||
my $osdistroname = $osimage_tab_entry->{'osdistroname'};
|
||||
$osimage_tab->close();
|
||||
|
||||
if ($osdistroname and $osdistroname =~ /^pkvm/ ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 get_nodes_cmm
|
||||
Description : Get the CMM of nodelist
|
||||
Arguments : $nodelist - the ref of node list array
|
||||
@ -1261,6 +1327,13 @@ sub gen_chain_for_profiles{
|
||||
unless ($netprofileattr){
|
||||
return (1, "Can not get attributes for network profile $netprofile");
|
||||
}
|
||||
|
||||
# Get node's netboot attribute
|
||||
my ($retcode, $retval) = xCAT::ProfiledNodeUtils->get_netboot_attr($imgprofile, $hwprofile);
|
||||
if (not $retcode) {
|
||||
return (1, $retval);
|
||||
}
|
||||
my $netboot = $retval;
|
||||
|
||||
$final_chain = 'osimage='.$provmethod.":--noupdateinitrd";
|
||||
# get the chain attribute from hardwareprofile and insert it to node.
|
||||
@ -1273,7 +1346,8 @@ sub gen_chain_for_profiles{
|
||||
}
|
||||
}
|
||||
#run bmcsetups.
|
||||
if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig){
|
||||
#PowerNV nodes can't use 'runcmd=bmcsetup' to set BMC.
|
||||
if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig and $netboot ne 'petitboot'){
|
||||
if (index($final_chain, "runcmd=bmcsetup") == -1){
|
||||
$final_chain = 'runcmd=bmcsetup,'.$final_chain.':reboot4deploy';
|
||||
}
|
||||
@ -1343,7 +1417,6 @@ sub get_netboot_attr{
|
||||
{
|
||||
return 0, "Hardware profile not defined in DB."
|
||||
}
|
||||
$hardwareprofile =~ s/^__HardwareProfile_//;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1376,41 +1449,55 @@ sub get_netboot_attr{
|
||||
{
|
||||
$os_arch = 'x86_64';
|
||||
}
|
||||
|
||||
# Identify whether this node is PowerKVM or PowerNV if os arch is ppc64le
|
||||
# If hardware profile is defined
|
||||
my $mgt = '*';
|
||||
if ($os_arch eq 'ppc64le' and $hardwareprofile ne '*') {
|
||||
my $nodehmtab = xCAT::Table->new('nodehm');
|
||||
my $nodehmtab_entry = $nodehmtab->getNodeAttribs($hardwareprofile, ['mgt']);
|
||||
if (defined $nodehmtab_entry->{'mgt'}) {
|
||||
$mgt = $nodehmtab_entry->{'mgt'};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Rule for netboot attribute.If update the rule,just update %netboot_dict and @condition_array
|
||||
# It's sequence sensitive: os arch -> os name -> os major version -> hardware profile
|
||||
# Priority | Arch | OS Name | OS Major Version | Hardware Profile | Noderes.netboot |
|
||||
# 1 | x86_64/x86 | * | * | * | xnba |
|
||||
# 2 | ppc64 | rhels | 7 | * | grub2 |
|
||||
# 3 | | * | * | * | yaboot |
|
||||
# 4 | ppc64le/el | * | * | IBM_PowerNV | petiboot |
|
||||
# 5 | | * | * | * | grub2 |
|
||||
# arch osname version hardware netboot
|
||||
# Priority | Arch | OS Name | OS Major Version | Management method | Noderes.netboot |
|
||||
# 1 | x86_64/x86 | * | * | * | xnba |
|
||||
# 2 | ppc64 | rhels | 7 | * | grub2 |
|
||||
# 2 | ppc64 | pkvm | * | * | petitboot |
|
||||
# 3 | | * | * | * | yaboot |
|
||||
# 4 | ppc64le/el | * | * | * | grub2
|
||||
# 4 | ppc64le/el | * | * | ipmi | petitboot
|
||||
# arch osname version hardware netboot
|
||||
my %netboot_dict = ( 'x86_64' => 'xnba',
|
||||
'ppc64' => {
|
||||
'rhels' => {
|
||||
'7' => 'grub2',
|
||||
'*' => 'yaboot',
|
||||
},
|
||||
'pkvm' => 'petitboot',
|
||||
'*' => 'yaboot',
|
||||
},
|
||||
'ppc64le' => {
|
||||
'*' => {
|
||||
'*' => {
|
||||
'IBM_PowerNV' => 'petiboot',
|
||||
'*' => 'grub2',
|
||||
'*' => 'grub2',
|
||||
'ipmi' => 'petitboot',
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
my $condition_array_ref = [$os_arch, $os_name, $os_major_version, $hardwareprofile];
|
||||
my $condition_array_ref = [$os_arch, $os_name, $os_major_version, $mgt];
|
||||
$netboot = cal_netboot(\%netboot_dict, $condition_array_ref);
|
||||
if($netboot eq '0')
|
||||
{
|
||||
return 0, "Can not get the netboot attribute";
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
return 1, $netboot;
|
||||
}
|
||||
}
|
||||
|
@ -326,7 +326,7 @@ bootparams => {
|
||||
'kernel' => 'The kernel that network boot actions should currently acquire and use. Note this could be a chained boot loader such as memdisk or a non-linux boot loader',
|
||||
'initrd' => 'The initial ramdisk image that network boot actions should use (could be a DOS floppy or hard drive image if using memdisk as kernel)',
|
||||
'kcmdline' => 'Arguments to be passed to the kernel',
|
||||
'addkcmdline' => 'User specified one or more parameters to be passed to the kernel',
|
||||
'addkcmdline' => 'User specified one or more parameters to be passed to the kernel. For the kernel options need to be persistent after installation, specify them with prefix "R::"',
|
||||
'dhcpstatements' => 'xCAT manipulated custom dhcp statements (not intended for user manipulation)',
|
||||
'adddhcpstatements' => 'Custom dhcp statements for administrator use (not implemneted yet)',
|
||||
comments => 'Any user-written notes.',
|
||||
@ -754,13 +754,13 @@ linuximage => {
|
||||
imagename => 'The name of this xCAT OS image definition.',
|
||||
template => 'The fully qualified name of the template file that will be used to create the OS installer configuration file for stateful installations (e.g. kickstart for RedHat, autoyast for SLES).',
|
||||
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.',
|
||||
addkcmdline=> 'User specified arguments to be passed to the kernel. The user arguments are appended to xCAT.s default kernel arguments. For the kernel options need to be persistent after installation, specify them with prefix "R::". 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. 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. For ubuntu, multiple mirrors can be specified in the pkgdir attribute, the mirrors must be prefixed by the protocol(http/ssh) and delimited with "," between each other.',
|
||||
otherpkglist => 'The fully qualified name of the file that stores non-distro package lists that will be included in the image.',
|
||||
otherpkglist => 'The fully qualified name of the file that stores non-distro package lists that will be included in the image. It could be set multiple paths.The multiple paths must be seperated by ",".',
|
||||
otherpkgdir => 'The base directory where the non-distro packages are stored. Only 1 local directory supported at present.',
|
||||
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.',
|
||||
postinstall => 'The fully qualified name of the script file that will be run at the end of the genimage command. It is used for diskless image only.',
|
||||
postinstall => 'The fully qualified name of the script file that will be run at the end of the genimage command. It could be set multiple paths.The multiple paths must be seperated by ",". It is used for diskless image only.',
|
||||
rootimgdir => 'The directory name where the image is stored. It is generally used for diskless image. it also can be used in sysclone environment to specify where the image captured from golden client is stored. in sysclone environment, rootimgdir is generally assigned to some default value by xcat, but you can specify your own store directory. just one thing need to be noticed, wherever you save the image, the name of last level directory must be the name of image. for example, if your image name is testimage and you want to save this image under home directoy, rootimgdir should be assigned to value /home/testimage/',
|
||||
kerneldir => 'The directory name where the 3rd-party kernel is stored. It is used for diskless image only.',
|
||||
nodebootif => 'The network interface the stateless/statelite node will boot over (e.g. eth0)',
|
||||
@ -3710,7 +3710,7 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
|
||||
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
|
||||
},
|
||||
{attr_name => 'kitreponame',
|
||||
tabentry => 'kitcomponent.kitrepoid',
|
||||
tabentry => 'kitcomponent.kitreponame',
|
||||
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
|
||||
},
|
||||
{attr_name => 'basename',
|
||||
|
48
perl-xCAT/xCAT/Utils.pm
Executable file → Normal file
48
perl-xCAT/xCAT/Utils.pm
Executable file → Normal file
@ -1013,10 +1013,11 @@ sub runcmd
|
||||
}
|
||||
# store the return string
|
||||
#push @$outref,$output;
|
||||
close(PIPE); # This will set the $? properly
|
||||
}
|
||||
|
||||
# now if not streaming process errors
|
||||
if (($?) && (!defined($stream)))
|
||||
if ($?)
|
||||
{
|
||||
$::RUNCMD_RC = $? >> 8;
|
||||
my $displayerror = 1;
|
||||
@ -3429,6 +3430,7 @@ sub filter_nodes{
|
||||
# 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
|
||||
# if in ipmi and arch =~ /ppc64/, a pp64le node
|
||||
foreach (@nodes) {
|
||||
if (defined ($mptabhash->{$_}->[0]) && defined ($mptabhash->{$_}->[0]->{'mpa'})) {
|
||||
if ($mptabhash->{$_}->[0]->{'mpa'} eq $_) {
|
||||
@ -3468,7 +3470,7 @@ sub filter_nodes{
|
||||
push @commonbmc, $_;
|
||||
# whether is a Power 8 or higher with FSP
|
||||
if (defined ($nodetypehash->{$_}->[0]) && defined ($nodetypehash->{$_}->[0]->{'arch'})) {
|
||||
if ($nodetypehash->{$_}->[0]->{'arch'} ne "ppc64le") {
|
||||
if ($nodetypehash->{$_}->[0]->{'arch'} !~ /^ppc64/i) {
|
||||
push @nonppcle, $_;
|
||||
}
|
||||
}
|
||||
@ -3595,6 +3597,8 @@ sub version_cmp {
|
||||
$ver_a = shift;
|
||||
}
|
||||
my $ver_b = shift;
|
||||
$ver_a =~ s/([-.]0+)+$//;
|
||||
$ver_b =~ s/([-.]0+)+$//;
|
||||
my @array_a = ($ver_a =~ /([-.]|\d+|[^-.\d]+)/g);
|
||||
my @array_b = ($ver_b =~ /([-.]|\d+|[^-.\d]+)/g);
|
||||
|
||||
@ -3619,9 +3623,12 @@ sub version_cmp {
|
||||
} elsif ( $b eq '.' ) {
|
||||
return 1;
|
||||
} elsif ($a =~ /^\d+$/ and $b =~ /^\d+$/) {
|
||||
if ($a =~ /^0/ || $b =~ /^0/) {
|
||||
return ($a cmp $b);
|
||||
} else {
|
||||
# if ($a =~ /^0/ || $b =~ /^0/) {
|
||||
# return ($a cmp $b);
|
||||
# } else {
|
||||
# return ($a <=> $b);
|
||||
# }
|
||||
if($a != $b ){
|
||||
return ($a <=> $b);
|
||||
}
|
||||
} else {
|
||||
@ -4118,7 +4125,9 @@ sub restartservice{
|
||||
return -1;
|
||||
}
|
||||
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
#xCAT::Utils->runcmd($cmd, -1);
|
||||
system($cmd);
|
||||
$::RUNCMD_RC=$?;
|
||||
return $::RUNCMD_RC;
|
||||
}
|
||||
|
||||
@ -4496,5 +4505,32 @@ sub parseMacTabEntry{
|
||||
return $mac_ret;
|
||||
}
|
||||
|
||||
#The splitkcmdline subroutine is used to split the "persistent kernel options"
|
||||
#and "provision-time kernel options" out of the kernel cmdline string
|
||||
#Arguments:
|
||||
# $kcmdline: the native kernel cmdline string
|
||||
#Return value:
|
||||
# a reference of hash with the following KEY-VALUE def:
|
||||
# "persistent" ==> string of persistent kernel options,delimited with space " "
|
||||
# "volatile" ==> string of provision-time kernel options,delimited with space " "
|
||||
sub splitkcmdline{
|
||||
my $kcmdline=shift;
|
||||
if( $kcmdline =~ /xCAT::Utils/) {
|
||||
$kcmdline=shift;
|
||||
}
|
||||
|
||||
my %cmdhash;
|
||||
|
||||
my @cmdlist=split(/[, ]/,$kcmdline);
|
||||
foreach my $cmd (@cmdlist){
|
||||
if($cmd =~ /^R::(.*)$/){
|
||||
$cmdhash{persistent}.="$1 ";
|
||||
}else{
|
||||
$cmdhash{volatile}.="$cmd ";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return \%cmdhash;
|
||||
}
|
||||
1;
|
||||
|
@ -69,6 +69,11 @@ require Exporter;
|
||||
"1384198011.520581" => "rhels6.5", #ppc64
|
||||
"1411733344.627228" => "rhels6.6", #x86_64
|
||||
"1411733344.616389" => "rhels6.6", #ppc64
|
||||
"1399449226.171922" => "rhels7", #x86_64
|
||||
"1399449226.155578" => "rhels7", #ppc64
|
||||
"1424360759.989976" => "rhels7.1", #x86_64
|
||||
"1424360759.878519" => "rhels7.1", #ppc64
|
||||
"1424361409.280138" => "rhels7.1", #ppc64le
|
||||
"1285193176.593806" => "rhelhpc6", #x86_64
|
||||
"1305067719.718814" => "rhelhpc6.1",#x86_64
|
||||
"1321545261.599847" => "rhelhpc6.2",#x86_64
|
||||
|
@ -71,7 +71,7 @@ sub createDummyPods {
|
||||
my $cmd = "grep -r -E 'L<.+\\([57]\\)\\|.+\\.[57]>' " . $poddir;
|
||||
#print "Running cmd: ", $cmd, "\n";
|
||||
my @lines = `$cmd`;
|
||||
if ($?) { print "Error running: $cmd\n"; print join('', @lines); }
|
||||
if ($?) { print "Did not find any section 5 man page, creating dummy pods...\n"; print join('', @lines); }
|
||||
#my @lines;
|
||||
#system($cmd);
|
||||
my @dummyPods;
|
||||
|
@ -26,7 +26,23 @@ my $usage = sub {
|
||||
exit $exitcode;
|
||||
};
|
||||
|
||||
if (-f '/etc/os-release') { die "This script doesn't support ubuntu yet.\n"; }
|
||||
|
||||
my $file = '/etc/os-release';
|
||||
if (-f $file) {
|
||||
#
|
||||
# SLES and RHEL also have /etc/os-release file, so actually need to open the file
|
||||
# and look for Ubuntu in the 'NAME=' lines before declaring Ubuntu
|
||||
#
|
||||
open my $info, $file or die "Could not open $file: $!";
|
||||
while( my $line = <$info>) {
|
||||
if (index($line, 'NAME=') != -1) {
|
||||
if ($line =~ /Ubuntu/i) {
|
||||
die "This script does not support Ubuntu at this time.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
close $info;
|
||||
}
|
||||
|
||||
# Process the cmd line args
|
||||
Getopt::Long::Configure("bundling");
|
||||
|
@ -31,7 +31,7 @@ my $usage = sub {
|
||||
|
||||
# Process the cmd line args
|
||||
Getopt::Long::Configure("bundling");
|
||||
#Getopt::Long::Configure("pass_through");
|
||||
# Getopt::Long::Configure("pass_through");
|
||||
Getopt::Long::Configure("no_pass_through");
|
||||
if (!GetOptions('h|?|help' => \$HELP, 'v|verbose' => \$VERBOSE, 'dryrun' => \$DRYRUN, 'w|waittime=s' => \$WAITTIME, 'a|noautoinst' => \$NOAUTOINST)) { $usage->(1); }
|
||||
|
||||
@ -40,10 +40,13 @@ if (scalar(@ARGV) != 1) { $usage->(1); }
|
||||
if (!defined($WAITTIME)) { $WAITTIME = 75; } # seconds to wait after configuring the nic (to let the switch handle the state change)
|
||||
my $noderange = $ARGV[0];
|
||||
|
||||
#
|
||||
# Run some Node verification before starting pushinitrd
|
||||
#
|
||||
verifyNodeConfiguration($noderange);
|
||||
|
||||
my %bootparms = getBootParms($noderange);
|
||||
|
||||
copyFilesToNodes($noderange, \%bootparms);
|
||||
|
||||
updateGrubOnNodes($noderange, \%bootparms);
|
||||
|
||||
if ($DRYRUN) { exit(0); }
|
||||
@ -54,8 +57,6 @@ if ($bootparms{osimageprovmethod} eq 'sysclone') { copySyscloneFiles(); }
|
||||
|
||||
exit(0);
|
||||
|
||||
sub isRedhat { return (-e '/etc/redhat-release' || -e '/etc/centos-release' || -e '/etc/fedora-release'); }
|
||||
|
||||
# Query the db for the kernel, initrd, and kcmdline attributes of the 1st node in the noderange
|
||||
sub getBootParms {
|
||||
my $nr = shift @_;
|
||||
@ -113,12 +114,14 @@ sub copyFilesToNodes {
|
||||
my $localfile = "/tftpboot/$file";
|
||||
# for the
|
||||
my $remotefile = '/boot/' . remoteFilename($file);
|
||||
my $cmd = "xdcp $nr -p $localfile $remotefile";
|
||||
if ($DRYRUN) {
|
||||
print "Dry run: would copy $localfile to $nr:$remotefile\n";
|
||||
print "Dry run: Copying $localfile to $nr:$remotefile\n";
|
||||
print "Dry run: $cmd\n";
|
||||
}
|
||||
else {
|
||||
print "Copying $localfile to $nr:$remotefile\n";
|
||||
runcmd("xdcp $nr -p $localfile $remotefile");
|
||||
runcmd($cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -184,20 +187,20 @@ sub modifyAutoinstFiles {
|
||||
my $replace = "$sedstring\nchmod 755 $file.new; mv -f $file.new $file";
|
||||
|
||||
# Add a script that gets invoked by the OS after the nic is brought up
|
||||
# Note: this does not work, because midway thru the autoyast process, the if-up.d scripts do not seem to get invoked
|
||||
# so autoyast fails to get the media
|
||||
# these are specific to SLES
|
||||
#my $netdir = '/etc/sysconfig/network';
|
||||
#my $filename = '/etc/sysconfig/network/if-up.d/xcat-sl-wait';
|
||||
#my $mnip = $bootparms->{mnip};
|
||||
#todo: to support rhel, use these values instead
|
||||
#my $netdir='/etc/sysconfig/network-scripts';
|
||||
#my $filename='/sbin/ifup-local';
|
||||
# Note: this does not work, because midway thru the autoyast process, the if-up.d scripts do not seem to get invoked
|
||||
# so autoyast fails to get the media
|
||||
# these are specific to SLES
|
||||
#my $netdir = '/etc/sysconfig/network';
|
||||
#my $filename = '/etc/sysconfig/network/if-up.d/xcat-sl-wait';
|
||||
#my $mnip = $bootparms->{mnip};
|
||||
#todo: to support rhel, use these values instead
|
||||
#my $netdir='/etc/sysconfig/network-scripts';
|
||||
#my $filename='/sbin/ifup-local';
|
||||
#my $replace = qq(
|
||||
#FILENAME=$filename
|
||||
#NETDIR=$netdir
|
||||
#MNIP=$mnip
|
||||
#);
|
||||
#FILENAME=$filename
|
||||
#NETDIR=$netdir
|
||||
#MNIP=$mnip
|
||||
#);
|
||||
# $replace .= q(
|
||||
#cat >$FILENAME << EOF1
|
||||
#MNIP=$MNIP
|
||||
@ -233,6 +236,23 @@ sub modifyAutoinstFiles {
|
||||
}
|
||||
}
|
||||
|
||||
sub verifyNodeConfiguration {
|
||||
my $nr = shift @_;
|
||||
|
||||
my @nodes = runcmd("nodels $nr");
|
||||
chomp(@nodes);
|
||||
|
||||
foreach my $n (@nodes) {
|
||||
# Verify the IP is set for the node
|
||||
my @output = runcmd("nodels $n hosts.ip");
|
||||
chomp($output[0]);
|
||||
my ($junk, $ip) = split(/\s+/, $output[0]);
|
||||
#todo: also support getting the ip from name resolution
|
||||
if (!$ip) {
|
||||
die "Error: The ip attribute must be set for $n.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Copy softlayer specific systemimager post-install scripts to the systemimager location.
|
||||
# These cause si to use static ip and insert a wait into the bring up of the network.
|
||||
@ -252,7 +272,6 @@ sub getNodeIpInfo {
|
||||
chomp($output[0]);
|
||||
my ($junk, $ip) = split(/\s+/, $output[0]);
|
||||
#todo: also support getting the ip from name resolution
|
||||
if (!$ip) { die "Error: the ip attribute must be set for $node.\n"; }
|
||||
|
||||
# find relevant network in the networks table
|
||||
# first get the networks in a hash
|
||||
|
@ -71,7 +71,7 @@ sub createDummyPods {
|
||||
my $cmd = "grep -r -E 'L<.+\\([57]\\)\\|.+\\.[57]>' " . $poddir;
|
||||
#print "Running cmd: ", $cmd, "\n";
|
||||
my @lines = `$cmd`;
|
||||
if ($?) { print "Error running: $cmd\n"; print join('', @lines); }
|
||||
if ($?) { print "Did not find any section 5 man page, creating dummy pods...\n"; print join('', @lines); }
|
||||
#my @lines;
|
||||
#system($cmd);
|
||||
my @dummyPods;
|
||||
|
0
xCAT-UI/debian/rules
Normal file → Executable file
0
xCAT-UI/debian/rules
Normal file → Executable file
0
xCAT-buildkit/share/xcat/kits/debian_template/rules
Normal file → Executable file
0
xCAT-buildkit/share/xcat/kits/debian_template/rules
Normal file → Executable file
@ -314,6 +314,38 @@ if ((($odbconly == 0) && ( $::xcatrunningmysql == 0)) || $::UPDATE || $::SETUPLL
|
||||
# initial setup request, if not already running mysql
|
||||
if (($::INIT) && ($::xcatrunningmysql == 0))
|
||||
{
|
||||
# MySQL not running, then initialize the database
|
||||
if ($::mysqlrunning == 0)
|
||||
{
|
||||
# Add mysql user and group for AIX
|
||||
# Correct directory permissions
|
||||
#
|
||||
&fixinstalldir;
|
||||
|
||||
#
|
||||
# Init mysql db and setup my.cnf
|
||||
#
|
||||
&initmysqldb;
|
||||
|
||||
#
|
||||
# Start MySQL server
|
||||
#
|
||||
&mysqlstart;
|
||||
|
||||
#
|
||||
# Setup MySQL to restart on reboot
|
||||
#
|
||||
&mysqlreboot;
|
||||
|
||||
#
|
||||
# set mysql root password in database
|
||||
#
|
||||
#
|
||||
&setupmysqlroot;
|
||||
}
|
||||
|
||||
# Verify the mysql root password, if it is wrong, do nothing and die.
|
||||
&verifymysqlroot;
|
||||
|
||||
#
|
||||
# Backup current database
|
||||
@ -366,37 +398,6 @@ if (($::INIT) && ($::xcatrunningmysql == 0))
|
||||
exit(1);
|
||||
}
|
||||
|
||||
# MySQL not running, then initialize the database
|
||||
if ($::mysqlrunning == 0)
|
||||
{
|
||||
# Add mysql user and group for AIX
|
||||
# Correct directory permissions
|
||||
#
|
||||
&fixinstalldir;
|
||||
|
||||
#
|
||||
# Init mysql db and setup my.cnf
|
||||
#
|
||||
&initmysqldb;
|
||||
|
||||
#
|
||||
# Start MySQL server
|
||||
#
|
||||
&mysqlstart;
|
||||
|
||||
#
|
||||
# Setup MySQL to restart on reboot
|
||||
#
|
||||
&mysqlreboot;
|
||||
|
||||
#
|
||||
# set mysql root password in database
|
||||
#
|
||||
#
|
||||
&setupmysqlroot;
|
||||
|
||||
}
|
||||
|
||||
# if xcat not already configured to run mysql, then add xcat info to the DB
|
||||
if ($::xcatrunningmysql == 0)
|
||||
{
|
||||
@ -1063,6 +1064,39 @@ sub mysqlreboot
|
||||
|
||||
}
|
||||
|
||||
sub verifymysqlroot
|
||||
{
|
||||
# Verify if mysql has an correct user input root password
|
||||
if ($::osname eq 'AIX')
|
||||
{
|
||||
my $cmd2 =
|
||||
"ulimit -n unlimited; ulimit -m unlimited; ulimit -d unlimited;ulimit -f unlimited; ulimit -s unlimited;";
|
||||
$cmd = $cmd2;
|
||||
$cmd .= "$::installdir/bin/mysqladmin -u root -p$::rootpassword version";
|
||||
}
|
||||
else
|
||||
{
|
||||
$cmd = "/usr/bin/mysqladmin -u root -p$::rootpassword version";
|
||||
}
|
||||
|
||||
my $tmpv = $::VERBOSE;
|
||||
$::VERBOSE = 0;
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
$::VERBOSE = $tmpv;
|
||||
if ($::RUNCMD_RC == 0)
|
||||
{
|
||||
# User has input an correct root passwd. That is fine. Do nothing and go head.
|
||||
return
|
||||
}
|
||||
|
||||
# The password is wrong, warn the user and die.
|
||||
xCAT::MsgUtils->message(
|
||||
"E",
|
||||
"Wrong MySQL root password."
|
||||
);
|
||||
exit 1;
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 setupmysqlroot
|
||||
|
@ -225,7 +225,7 @@ sub asunode {
|
||||
} else {
|
||||
foreach my $a (@_) { $args .= ' ' . xCAT::Utils->quote($a); }
|
||||
}
|
||||
my $cmd = "$::asucmd $args --host $bmc --user $username --password $passwd 2>&1 |";
|
||||
my $cmd = "$::asucmd $args --host '$bmc' --user '$username' --password '$passwd' 2>&1 |";
|
||||
if ($::VERBOSE) { print "forking $cmd\n"; }
|
||||
my $pid = open($$out, $cmd);
|
||||
$pids{$pid} = $node;
|
||||
|
@ -180,7 +180,8 @@ if ($::RUNCMD_RC != 0)
|
||||
exit(1);
|
||||
}
|
||||
# check if 9.X release not built by us is installed, setup different
|
||||
if (grep(/postgresql9/, @output)) { # postgresql 9.x
|
||||
# SLES used default dir
|
||||
if ( (grep(/postgresql9/, @output)) && ($::linuxos !~ /sles/) ){ # postgresql 9.x
|
||||
# figure out which 9.x release and build path
|
||||
my @parseout= split(/\-/, $output[0]);
|
||||
my @ptflevel= split ("postgresql9",$parseout[0]);
|
||||
@ -778,7 +779,7 @@ sub initpgdb
|
||||
`$cmd`;
|
||||
if ($::osname eq 'Linux')
|
||||
{
|
||||
$cmd = qq~ echo listen_addresses = \\'*\\' >> $pgconf~;
|
||||
$cmd = qq~ echo listen_addresses = \\'localhost,$::MN\\' >> $pgconf~;
|
||||
`$cmd`;
|
||||
}
|
||||
|
||||
@ -986,7 +987,7 @@ sub setupxcatdb
|
||||
$cmd = "/var/lib/pgsql/bin/psql -d $::dbname -U postgres";
|
||||
} else { # Linux
|
||||
$cmd = "$::pgcmddir/psql -d $::dbname -U postgres";
|
||||
if ($debianflag){
|
||||
if ( ($debianflag) || ($::linuxos =~ /sles/) ){
|
||||
$cmd = "su - postgres -c '$::pgcmddir/psql -d $::dbname -U postgres'";
|
||||
}
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ sub nmap_pping {
|
||||
my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions");
|
||||
my $more_options = $nmap_options[0];
|
||||
|
||||
open (FPING, "nmap -PE --system-dns --send-ip -sP $more_options ".join(' ',@$nodes). " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
|
||||
open (FPING, "nmap -PE --unprivileged --system-dns --send-ip -sP $more_options ".join(' ',@$nodes). " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
|
||||
my $node;
|
||||
while (<FPING>) {
|
||||
if (/Host (.*) \(.*\) appears to be up/) {
|
||||
|
@ -89,7 +89,7 @@ my $client = IO::Socket::SSL->new(
|
||||
SSL_ca_file => $homedir."/.xcat/ca.pem",
|
||||
SSL_use_cert => 1,
|
||||
%sslargs,
|
||||
#SSL_verify_mode => 1,
|
||||
SSL_verify_mode => SSL_VERIFY_PEER,
|
||||
);
|
||||
die "Connection failure: $!\n" unless ($client);
|
||||
my %cmdref = (command => 'noderange', noderange => $noderange);
|
||||
|
@ -63,6 +63,11 @@ if ($fanout) { # see if they overroad the fanout from the command line
|
||||
(my $noderange,my $destloc) = split(/:/,$ARGV[1]);
|
||||
my @user = getpwuid($>);
|
||||
my $homedir=$user[7];
|
||||
my %sslargs;
|
||||
if (defined($ENV{'XCATSSLVER'})) {
|
||||
$sslargs{SSL_version} = $ENV{'XCATSSLVER'};
|
||||
}
|
||||
|
||||
my $client = IO::Socket::SSL->new(
|
||||
PeerAddr=>$xcathost,
|
||||
SSL_key_file=>$homedir."/.xcat/client-cred.pem",
|
||||
@ -70,6 +75,7 @@ my $client = IO::Socket::SSL->new(
|
||||
SSL_ca_file => $homedir."/.xcat/ca.pem",
|
||||
SSL_use_cert => 1,
|
||||
SSL_verify_mode => 1,
|
||||
%sslargs,
|
||||
);
|
||||
die "Connection failure: $!\n" unless ($client);
|
||||
my %cmdref = (command => 'noderange', noderange => $noderange);
|
||||
|
@ -61,7 +61,7 @@ else {
|
||||
SSL_cert_file=>$homedir."/.xcat/client-cred.pem",
|
||||
SSL_ca_file => $homedir."/.xcat/ca.pem",
|
||||
SSL_use_cert => 1,
|
||||
#SSL_verify_mode => 1,
|
||||
SSL_verify_mode => SSL_VERIFY_MODE,
|
||||
);
|
||||
die "Connection failure: $!\n" unless ($client);
|
||||
my %cmdref = (command => 'noderange', noderange => $noderange);
|
||||
|
@ -52,15 +52,28 @@ if [ -n "$2" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -x "/opt/confluent/bin/confetty" ] || [ -x "/usr/bin/confetty" ] || [ -x "/usr/local/bin/confetty" ]; then
|
||||
#use confluent
|
||||
CONFETTY="confetty"
|
||||
if [ -x "/opt/confluent/bin/confetty" ]; then
|
||||
# xCAT 2.9.1 allows for an option to use confluent as a rcons replacement and only use
|
||||
# confluent if this keyword is defined in the site table. This allows for confluent to
|
||||
# be installed on the xCAT management node and switch between conserver & confluent
|
||||
USE_CONFLUENT=0
|
||||
CONSOLE_SERVICE_KEYWORD=`tabdump site | grep consoleservice | cut -d, -f1 | tr -d '"'`
|
||||
CONSOLE_SERVICE_VALUE=`tabdump site | grep consoleservice | cut -d, -f2 | tr -d '"'`
|
||||
|
||||
if [ "$CONSOLE_SERVICE_KEYWORD" == "consoleservice" ]; then
|
||||
if [ "$CONSOLE_SERVICE_VALUE" == "confluent" ]; then
|
||||
USE_CONFLUENT=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $USE_CONFLUENT == "1" ] && ([ -x "/opt/confluent/bin/confetty" ] || [ -x "/usr/bin/confetty" ] || [ -x "/usr/local/bin/confetty" ]); then
|
||||
#use confluent
|
||||
CONFETTY="confetty"
|
||||
if [ -x "/opt/confluent/bin/confetty" ]; then
|
||||
CONFETTY="/opt/confluent/bin/confetty"
|
||||
fi
|
||||
if [ ! -z "$CONSCONTROLPATH" ]; then
|
||||
CONSCONTROLPATH="-c $CONSCONTROLPATH"
|
||||
fi
|
||||
fi
|
||||
if [ ! -z "$CONSCONTROLPATH" ]; then
|
||||
CONSCONTROLPATH="-c $CONSCONTROLPATH"
|
||||
fi
|
||||
if [ -z "$CONSERVER" ]; then
|
||||
CONSERVER=`nodels $1 nodehm.conserver 2>/dev/null | awk -F: '{print $2}' | tr -d ' '`
|
||||
fi
|
||||
|
@ -109,6 +109,9 @@ if (defined($tilefact)) {
|
||||
system("xterm $xrm -bg black -fg white -title $firstnode -n $firstnode -geometry $sizegeometry+0+0 ".join(" ",@ARGV)." -e /bin/bash -c \"/bin/true ".$ENV{DISPLAY}." $firstnode $firstnode & let SDATE=`date +%s`+5; $mydir/rcons $firstnode ".$conservers{$firstnode}."; if [ \\\$SDATE -gt \\`date +%s\\` ]; then echo Press enter to close; read SDATE; fi \" &");
|
||||
$ENV{CONSCONTROLPATH} = "";
|
||||
my $remainwait = 2;
|
||||
if (-x "/opt/confluent/bin/confetty" or -x "/usr/bin/confetty" or -x "/usr/local/bin/confetty" ) {
|
||||
$remainwait = 10;
|
||||
}
|
||||
while (not -S "/tmp/wconscontrol.$firstnode.$$" and $remainwait > 0) {
|
||||
sleep(0.1);
|
||||
$remainwait -= 0.1;
|
||||
|
@ -72,7 +72,7 @@ sub createDummyPods {
|
||||
my $cmd = "grep -r -E 'L<.+\\([57]\\)\\|.+\\.[57]>' " . $poddir;
|
||||
#print "Running cmd: ", $cmd, "\n";
|
||||
my @lines = `$cmd`;
|
||||
if ($?) { print "Error running: $cmd\n"; print join('', @lines); }
|
||||
if ($?) { print "Did not find any section 5 man page, creating dummy pods...\n"; print join('', @lines); }
|
||||
#my @lines;
|
||||
#system($cmd);
|
||||
my @dummyPods;
|
||||
|
5
xCAT-confluent/debian/changelog
Normal file
5
xCAT-confluent/debian/changelog
Normal file
@ -0,0 +1,5 @@
|
||||
xcat-confluent (2.10-snap20150325) unstable; urgency=low
|
||||
|
||||
* Initial release
|
||||
|
||||
-- root <root@hostname> Wed, 25 Mar 2015 13:41:35 -0400
|
1
xCAT-confluent/debian/compat
Normal file
1
xCAT-confluent/debian/compat
Normal file
@ -0,0 +1 @@
|
||||
9
|
11
xCAT-confluent/debian/control
Normal file
11
xCAT-confluent/debian/control
Normal file
@ -0,0 +1,11 @@
|
||||
Source: xcat-confluent
|
||||
Section: admin
|
||||
Priority: extra
|
||||
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
|
||||
Build-Depends: debhelper (>= 8.0.0)
|
||||
Standards-Version: 3.9.2
|
||||
|
||||
Package: xcat-confluent
|
||||
Architecture: all
|
||||
Depends: xcat-client
|
||||
Description: xCAT integration with confluent systems management server
|
1
xCAT-confluent/debian/dirs
Normal file
1
xCAT-confluent/debian/dirs
Normal file
@ -0,0 +1 @@
|
||||
/opt/confluent/
|
30
xCAT-confluent/debian/rules
Executable file
30
xCAT-confluent/debian/rules
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/make -f
|
||||
# See debhelper(7) (uncomment to enable)
|
||||
# output every command that modifies files on the build system
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
build:
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -d
|
||||
|
||||
install:
|
||||
dh_installdirs
|
||||
cp -r confluent/* debian/xcat-confluent/opt/confluent
|
||||
|
||||
binary-indep: build install
|
||||
|
||||
binary-arch:
|
||||
dh_compress
|
||||
dh_installdeb
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
@ -71,7 +71,7 @@ sub createDummyPods {
|
||||
my $cmd = "grep -r -E 'L<.+\\([57]\\)\\|.+\\.[57]>' " . $poddir;
|
||||
#print "Running cmd: ", $cmd, "\n";
|
||||
my @lines = `$cmd`;
|
||||
if ($?) { print "Error running: $cmd\n"; print join('', @lines); }
|
||||
if ($?) { print "Did not find any section 5 man page, creating dummy pods...\n"; print join('', @lines); }
|
||||
#my @lines;
|
||||
#system($cmd);
|
||||
my @dummyPods;
|
||||
@ -126,7 +126,6 @@ sub getPodList {
|
||||
|
||||
|
||||
# Create the xcat man page that gives a summary description of each xcat cmd.
|
||||
# Not used.
|
||||
sub writesummarypage {
|
||||
my $file = shift; # relative path file name of the man page
|
||||
# the rest of @_ contains the pod files that describe each cmd
|
||||
|
@ -8,6 +8,7 @@ HOSTOS="$1"
|
||||
DIR=`dirname $0`
|
||||
#DIR=`realpath $DIR`
|
||||
DIR=`readlink -f $DIR`
|
||||
BUILDARCH=`uname -m`
|
||||
|
||||
# get the input files for dracut in the right place
|
||||
# Fedora 20 ppc64 uses /usr/lib/dracut/modules.d
|
||||
@ -21,9 +22,64 @@ fi
|
||||
|
||||
mkdir -p $DRACUTMODDIR
|
||||
cp $DIR/* $DRACUTMODDIR
|
||||
|
||||
if [ "$HOSTOS" = "mcp" ]; then
|
||||
#Special handlings for MCP PPC64 platform building.
|
||||
if [ $BUILDARCH = "ppc64" ]; then
|
||||
sed -i 's/dracut_install efibootmgr//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install dmidecode \/usr\/lib64\/libstdc++.so.5//' $DRACUTMODDIR/install
|
||||
sed -i 's/dmidecode//' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib\/ld-linux.so.2/\/usr\/lib64\/ld-2.17.so/' $DRACUTMODDIR/install
|
||||
else
|
||||
sed -i 's/\/lib\/ld-linux.so.2/\/usr\/lib64\/ld-linux-x86-64.so.2/' $DRACUTMODDIR/install
|
||||
fi
|
||||
sed -i 's/mkfs.btrfs//' $DRACUTMODDIR/install
|
||||
sed -i 's/\/etc\/redhat-release/\/etc\/base-release \/etc\/system-release/' $DRACUTMODDIR/install
|
||||
sed -i 's/btrfs//' $DRACUTMODDIR/installkernel
|
||||
|
||||
sed -i 's/\/usr\/bin\/basename/\/bin\/basename/' $DRACUTMODDIR/install
|
||||
|
||||
sed -i 's/\/lib64\/libnss_dns-2.12.so/\/usr\/lib64\/libnss_dns-2.17.so/' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib64\/libnss_dns.so.2/\/usr\/lib64\/libnss_dns.so.2/' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib\/libc.so.6/\/usr\/lib64\/libc.so.6/' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib\/libdl.so.2/\/usr\/lib64\/libdl.so.2/' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib\/libm.so.6/\/usr\/lib64\/libm.so.6/' $DRACUTMODDIR/install
|
||||
sed -i 's/\/usr\/lib\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.19/' $DRACUTMODDIR/install
|
||||
sed -i 's/\/usr\/lib64\/libstdc++.so.5//' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib\/libpthread.so.0/\/usr\/lib64\/libpthread.so.0/' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib\/libncurses.so.5.7/\/usr\/lib64\/libncurses.so.5.9/' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib\/libgcc_s.so.1/\/usr\/lib64\/libgcc_s.so.1/' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib\/libtinfo.so.5.7/\/usr\/lib64\/libtinfo.so.5.9/' $DRACUTMODDIR/install
|
||||
sed -i 's/\/usr\/lib64\/libsasl2.so.2/\/usr\/lib64\/libsasl2.so.3/' $DRACUTMODDIR/install
|
||||
|
||||
sed -i 's/\/lib\/terminfo\/l\/linux/\/usr\/share\/terminfo\/l\/linux/g' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib\/terminfo\/v\/vt100/\/usr\/share\/terminfo\/v\/vt100/g' $DRACUTMODDIR/install
|
||||
|
||||
# these are needed for sysclone, but are not yet in mcp
|
||||
sed -i 's/ bc//' $DRACUTMODDIR/install
|
||||
sed -i 's/ mkdosfs//' $DRACUTMODDIR/install
|
||||
sed -i 's/ rsync//' $DRACUTMODDIR/install
|
||||
sed -i 's/ kexec//' $DRACUTMODDIR/install
|
||||
sed -i 's/ klogd//' $DRACUTMODDIR/install
|
||||
sed -i 's/ mdadm//' $DRACUTMODDIR/install
|
||||
sed -i 's/ mkfs\.xfs//' $DRACUTMODDIR/install
|
||||
sed -i 's/ xfs_db//' $DRACUTMODDIR/install
|
||||
sed -i 's/ mkreiserfs//' $DRACUTMODDIR/install
|
||||
sed -i 's/ reiserfstune//' $DRACUTMODDIR/install
|
||||
sed -i 's/ vconfig//' $DRACUTMODDIR/install
|
||||
sed -i 's/ killall//' $DRACUTMODDIR/install
|
||||
|
||||
# These timezone files are not available in the latest mcp build
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Asia\/Riyadh87//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Asia\/Riyadh88//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Asia\/Riyadh89//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Mideast\/Riyadh87//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Mideast\/Riyadh88//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Mideast\/Riyadh89//' $DRACUTMODDIR/install
|
||||
|
||||
# For ppc64 platform, needs to remove some files,
|
||||
# and some files are in different directories
|
||||
if [ `uname -m` = "ppc64" ]; then
|
||||
# # and some files are in different directories
|
||||
elif [ $BUILDARCH = "ppc64" ]; then
|
||||
sed -i 's/dracut_install efibootmgr//' $DRACUTMODDIR/install
|
||||
sed -i 's/ dmidecode//' $DRACUTMODDIR/install
|
||||
sed -i 's/\/lib\/libncurses.so.5.7/\/lib64\/libncurses.so.5.7/' $DRACUTMODDIR/install
|
||||
@ -46,38 +102,11 @@ if [ `uname -m` = "ppc64" ]; then
|
||||
sed -i 's/\/lib\/terminfo\/v\/vt100/\/usr\/share\/terminfo\/v\/vt100/g' $DRACUTMODDIR/install
|
||||
fi
|
||||
|
||||
if [ "$HOSTOS" = "mcp" ]; then
|
||||
sed -i 's/mkfs.btrfs//' $DRACUTMODDIR/install
|
||||
sed -i 's/\/etc\/redhat-release/\/etc\/base-release \/etc\/system-release/' $DRACUTMODDIR/install
|
||||
sed -i 's/btrfs//' $DRACUTMODDIR/installkernel
|
||||
|
||||
sed -i 's/\/usr\/bin\/basename/\/bin\/basename/' $DRACUTMODDIR/install
|
||||
|
||||
# these are needed for sysclone, but are not yet in mcp
|
||||
sed -i 's/ bc//' $DRACUTMODDIR/install
|
||||
sed -i 's/ mkdosfs//' $DRACUTMODDIR/install
|
||||
sed -i 's/ rsync//' $DRACUTMODDIR/install
|
||||
sed -i 's/ kexec//' $DRACUTMODDIR/install
|
||||
sed -i 's/ klogd//' $DRACUTMODDIR/install
|
||||
sed -i 's/ mdadm//' $DRACUTMODDIR/install
|
||||
sed -i 's/ mkfs\.xfs//' $DRACUTMODDIR/install
|
||||
sed -i 's/ xfs_db//' $DRACUTMODDIR/install
|
||||
sed -i 's/ mkreiserfs//' $DRACUTMODDIR/install
|
||||
sed -i 's/ reiserfstune//' $DRACUTMODDIR/install
|
||||
|
||||
# These timezone files are not available in the latest mcp build
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Asia\/Riyadh87//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Asia\/Riyadh88//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Asia\/Riyadh89//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Mideast\/Riyadh87//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Mideast\/Riyadh88//' $DRACUTMODDIR/install
|
||||
sed -i 's/dracut_install \/usr\/share\/zoneinfo\/posix\/Mideast\/Riyadh89//' $DRACUTMODDIR/install
|
||||
fi
|
||||
mkdir -p /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/fs
|
||||
mkdir -p /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs
|
||||
|
||||
# run dracut
|
||||
if [ "$HOSTOS" = "mcp" ]; then
|
||||
KPATH=`/bin/ls -d /lib/modules/*.x86_64`
|
||||
KPATH=`/bin/ls -d /lib/modules/*`
|
||||
KERNELVERSION=`basename $KPATH`
|
||||
echo Creating the initramfs in /tmp/xcatgenesis.$$.rfs using dracut and kernel $KERNELVERSION ...
|
||||
else
|
||||
@ -85,31 +114,31 @@ else
|
||||
fi
|
||||
|
||||
# On Fedora 20 ppc64, dracut uses host-only mode by default
|
||||
if [ `uname -m` = "ppc64" ]; then
|
||||
if [ $BUILDARCH = "ppc64" ]; then
|
||||
dracut -m "xcat base" -N -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION
|
||||
else
|
||||
dracut -m "xcat base" -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION
|
||||
fi
|
||||
echo Expanding the initramfs into /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/fs ...
|
||||
cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/fs
|
||||
echo Expanding the initramfs into /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs ...
|
||||
cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs
|
||||
zcat /tmp/xcatgenesis.$$.rfs|cpio -dumi
|
||||
|
||||
# add the kernel
|
||||
if [ "$HOSTOS" = "mcp" ]; then
|
||||
echo Adding kernel /boot/vmlinuz-* ...
|
||||
cp /boot/vmlinuz-*.x86_64 /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/kernel
|
||||
cp /boot/vmlinuz-* /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/kernel
|
||||
else
|
||||
echo Adding kernel /boot/vmlinuz-`uname -r` ...
|
||||
cp /boot/vmlinuz-`uname -r` /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/kernel
|
||||
echo Adding kernel /boot/vmlinuz-$BUILDARCH ...
|
||||
cp /boot/vmlinuz-`uname -r` /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/kernel
|
||||
fi
|
||||
cd -
|
||||
|
||||
# create tar file
|
||||
echo Tarring /tmp/xcatgenesis.$$/opt into ~/rpmbuild/SOURCES/xCAT-genesis-base-`uname -m`.tar.bz2 ...
|
||||
echo Tarring /tmp/xcatgenesis.$$/opt into ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 ...
|
||||
cd /tmp/xcatgenesis.$$
|
||||
tar jcf ~/rpmbuild/SOURCES/xCAT-genesis-base-`uname -m`.tar.bz2 opt
|
||||
tar jcf ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 opt
|
||||
|
||||
# build the rpm
|
||||
echo Building xCAT-genesis-base rpm from ~/rpmbuild/SOURCES/xCAT-genesis-base-`uname -m`.tar.bz2 and $DIR/xCAT-genesis-base.spec ...
|
||||
echo Building xCAT-genesis-base rpm from ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 and $DIR/xCAT-genesis-base.spec ...
|
||||
rpmbuild -ba $DIR/xCAT-genesis-base.spec
|
||||
rm -rf $DRACUTMODDIR
|
||||
|
@ -11,7 +11,7 @@ dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient l
|
||||
dracut_install lldptool /lib64/libnss_dns-2.12.so /lib64/libnss_dns.so.2
|
||||
dracut_install poweroff ntpq ntpd hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services
|
||||
dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc
|
||||
dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail /usr/bin/basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements
|
||||
dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements
|
||||
dracut_install dmidecode /usr/lib64/libstdc++.so.6 #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si
|
||||
dracut_install dmidecode /usr/lib64/libstdc++.so.5 #broadcom firmware update links against old lib
|
||||
dracut_install /lib/libpthread.so.0 #32 bit lib because UXSPI will not ship a native 64 bit build
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
instmods nfs sunrpc
|
||||
instmods e1000 e1000e virtio_net igb ines sfc mlx4_en cxgb3 cxgb4 tg3 bnx2 bnx2x bna ixgb ixgbe qlge mptsas mpt2sas mpt3sas ata_piix megaraid_sas virtio_blk ahci ibmaem xhci-hcd sd_mod pmcraid be2net vfat ext3 ext4 btrfs reiserfs usb_storage scsi_wait_scan kvm kvm-intel kvm-amd ipmi_si ipmi_devintf qlcnic xfs
|
||||
instmods e1000 e1000e virtio_net virtio_pci igb ines sfc mlx4_en cxgb3 cxgb4 tg3 bnx2 bnx2x bna ixgb ixgbe qlge mptsas mpt2sas mpt3sas ata_piix megaraid_sas virtio_blk ahci ibmaem xhci-hcd sd_mod pmcraid be2net vfat ext3 ext4 btrfs reiserfs usb_storage scsi_wait_scan kvm kvm-intel kvm-amd ipmi_si ipmi_devintf qlcnic xfs
|
||||
instmods macvlan macvtap 8021q bridge bonding vmxnet3 cpufreq_ondemand acpi-cpufreq powernow-k8 cdc_ether
|
||||
instmods mptctl #LSI firmware management requires this
|
||||
instmods mlx4_ib ib_umad #make the mellanox ib available enough to examine /sys
|
||||
@ -9,3 +9,4 @@ instmods ibmveth # ppc64 virtual ethernet
|
||||
instmods ibmvscsi # ppc64 virtual disk
|
||||
instmods ehea # ppc64 hea ethernet
|
||||
instmods dm-mod #support LVM for sysclone
|
||||
instmods sg # Lenovo thinkserver firmware update support
|
||||
|
@ -7,6 +7,7 @@ echo PS1="'"'[xCAT Genesis running on \H \w]\$ '"'" > /.bash_profile
|
||||
mkdir -p /etc/ssh
|
||||
mkdir -p /var/tmp/
|
||||
mkdir -p /var/empty/sshd
|
||||
sed -i '/^root:x/d' /etc/passwd
|
||||
echo root:x:0:0::/:/bin/bash >> /etc/passwd
|
||||
echo sshd:x:30:30:SSH User:/var/empty/sshd:/sbin/nologin >> /etc/passwd
|
||||
echo rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind:/sbin/nologin >> /etc/passwd
|
||||
|
@ -117,6 +117,7 @@ mask2prefix() {
|
||||
}
|
||||
|
||||
# see if they specified static ip info, otherwise use dhcp
|
||||
XCATPORT=3001
|
||||
for parm in `cat /proc/cmdline`; do
|
||||
key=`echo $parm|awk -F= '{print $1}'`
|
||||
value=`echo $parm|awk -F= '{print $2}'`
|
||||
@ -126,8 +127,14 @@ for parm in `cat /proc/cmdline`; do
|
||||
netmask=$value
|
||||
elif [[ ${key,,} == "gateway" ]]; then
|
||||
gateway=$value
|
||||
elif [[ ${key,,} == "xcatd" ]]; then
|
||||
XCATMASTER=`echo $value |awk -F: '{print $1}'`
|
||||
XCATPORT=`echo $value |awk -F: '{print $2}'`
|
||||
fi
|
||||
done
|
||||
export XCATPORT
|
||||
export XCATMASTER
|
||||
|
||||
if [[ -n $hostip && -n $netmask && -n $gateway && -n $bootnic ]]; then
|
||||
# doing static ip
|
||||
# the device was determined above from the bootif mac, and put in bootnic
|
||||
@ -145,54 +152,68 @@ if [[ -n $hostip && -n $netmask && -n $gateway && -n $bootnic ]]; then
|
||||
sleep 3
|
||||
else
|
||||
echo "Setting IP via DHCP..."
|
||||
# This section is for System P hardware discovery, which won't have a BOOTIF value set
|
||||
tries=0
|
||||
while [ $tries -lt 5 ]; do
|
||||
if [ -z "$bootnic" ]; then
|
||||
ALLUP_NICS=`ip link show | grep -v "^ " | grep "state UP" | awk '{print $2}' | sed -e 's/:$//'|grep -v lo`
|
||||
for tmp1 in $ALLUP_NICS; do
|
||||
bootnic=$tmp1
|
||||
break
|
||||
done
|
||||
else
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
tries=$(($tries+1))
|
||||
done
|
||||
# This section is for System P hardware discovery, which won't have a BOOTIF value set
|
||||
if [ -z "$bootnic" ]; then
|
||||
ALL_NICS=`ip link show | grep -v "^ " | awk '{print $2}' | sed -e 's/:$//' | grep -v lo`
|
||||
for tmp in $ALL_NICS; do
|
||||
bootnic=$tmp
|
||||
break
|
||||
tries=0
|
||||
while [ $tries -lt 100 ]; do
|
||||
ALLUP_NICS=`ip link show | grep -v "^ " | grep "state UP" | awk '{print $2}' | sed -e 's/:$//'|grep -v lo | sort -n -r`
|
||||
for tmp1 in $ALLUP_NICS; do
|
||||
dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$tmp1.pid $tmp1 &
|
||||
dhclient -6 -pf /var/run/dhclient6.$tmp1.pid $tmp1 -lf /var/lib/dhclient/dhclient6.leases &
|
||||
#bootnic=$tmp1
|
||||
#break
|
||||
done
|
||||
if [ ! -z "$ALLUP_NICS" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
tries=$(($tries+1))
|
||||
done
|
||||
fi
|
||||
|
||||
dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$bootnic.pid $bootnic &
|
||||
#we'll kick of IPv6 and IPv4 on all nics, but not wait for them to come up unless doing discovery, to reduce
|
||||
#chances that we'll perform a partial discovery
|
||||
#in other scenarios where downed non-bootnics cause issues, will rely on retries to fix things up
|
||||
dhclient -6 -pf /var/run/dhclient6.$bootnic.pid $bootnic -lf /var/lib/dhclient/dhclient6.leases &
|
||||
NICSTOBRINGUP=`ip link|grep mtu|grep -v LOOPBACK|grep -v $bootnic|grep -v usb|grep -v ,UP|awk -F: '{print $2}'`
|
||||
export NICSTOBRINGUP
|
||||
for nic in $NICSTOBRINGUP; do
|
||||
echo -n "Acquiring network addresses.."
|
||||
while [ -z "$bootnic" ]; do
|
||||
for tmp1 in $ALLUP_NICS; do
|
||||
if ip addr show dev $tmp1|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet > /dev/null; then
|
||||
result=`ping -c1 -I $tmp1 $XCATMASTER 2>&1`
|
||||
if [ $? -eq 0 ]; then
|
||||
bootnic=$tmp1
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
sleep 2
|
||||
done
|
||||
if [ -z "$bootnic" ]; then
|
||||
/bin/bash
|
||||
fi
|
||||
else
|
||||
dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$bootnic.pid $bootnic &
|
||||
#we'll kick of IPv6 and IPv4 on all nics, but not wait for them to come up unless doing discovery, to reduce
|
||||
#chances that we'll perform a partial discovery
|
||||
#in other scenarios where downed non-bootnics cause issues, will rely on retries to fix things up
|
||||
dhclient -6 -pf /var/run/dhclient6.$bootnic.pid $bootnic -lf /var/lib/dhclient/dhclient6.leases &
|
||||
NICSTOBRINGUP=`ip link|grep mtu|grep -v LOOPBACK|grep -v $bootnic|grep -v usb|grep -v ,UP|awk -F: '{print $2}'`
|
||||
export NICSTOBRINGUP
|
||||
for nic in $NICSTOBRINGUP; do
|
||||
(while ! ethtool $nic | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -pf /var/run/dhclient.$nic.pid $nic ) &
|
||||
(while ! ethtool $nic | grep Link\ detected|grep yes > /dev/null; do sleep 5; done; dhclient -cf /etc/dhclient.conf -6 -pf /var/run/dhclient6.$nic.pid -lf /var/lib/dhclient/dhclient6.leases $nic ) &
|
||||
done
|
||||
done
|
||||
|
||||
gripeiter=101
|
||||
echo -n "Acquiring network addresses.."
|
||||
while ! ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet > /dev/null; do
|
||||
sleep 0.1
|
||||
if [ $gripeiter = 1 ]; then
|
||||
echo
|
||||
echo "It seems to be taking a while to acquire an IPv4 address, you may want to check spanning tree..."
|
||||
fi
|
||||
gripeiter=$((gripeiter-1))
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 &
|
||||
|
||||
gripeiter=101
|
||||
echo -n "Acquiring network addresses.."
|
||||
while ! ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet > /dev/null; do
|
||||
sleep 0.1
|
||||
if [ $gripeiter = 1 ]; then
|
||||
echo
|
||||
echo "It seems to be taking a while to acquire an IPv4 address, you may want to check spanning tree..."
|
||||
fi
|
||||
gripeiter=$((gripeiter-1))
|
||||
done
|
||||
echo -n "Acquired IPv4 address on $bootnic: "
|
||||
ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}'
|
||||
ntpd -g -x
|
||||
@ -214,16 +235,7 @@ if [ -f "/usr/sbin/dmidecode" ]; then
|
||||
fi
|
||||
DEVICE=$bootnic
|
||||
export DEVICE
|
||||
XCATPORT=3001
|
||||
export XCATPORT
|
||||
for parm in `cat /proc/cmdline`; do
|
||||
key=`echo $parm|awk -F= '{print $1}'`
|
||||
if [ "$key" = "xcatd" ]; then
|
||||
XCATMASTER=`echo $parm|awk -F= '{print $2}'|awk -F: '{print $1}'`
|
||||
XCATPORT=`echo $parm|awk -F= '{print $2}'|awk -F: '{print $2}'`
|
||||
fi
|
||||
done
|
||||
export XCATMASTER
|
||||
|
||||
if [ "$destiny" != "discover" ]; then #we aren't discoverying, we probably can and should get a cert
|
||||
/bin/getcert $XCATMASTER:$XCATPORT
|
||||
fi
|
||||
|
0
xCAT-nbroot/debian/rules
Normal file → Executable file
0
xCAT-nbroot/debian/rules
Normal file → Executable file
@ -3,4 +3,5 @@ instmods nfs sunrpc
|
||||
instmods e1000 e1000e virtio_net igb ines sfc mlx4_en cxgb3 cxgb4 tg3 bnx2 bnx2x bna ixgb qlge mptsas mpt2sas ata_piix megaraid_sas virtio_blk ahci ibmaem xhci-hcd sd_mod pmcraid be2net ext3 ext4 btrfs reiserfs usb_storage scsi_wait_scan kvm kvm-intel kvm-amd ipmi_si ipmi_devintf
|
||||
instmods macvlan macvtap 8021q bridge bonding vmxnet3 acpi-cpufreq powernow-k8 cdc_ether
|
||||
instmods mptctl #LSI firmware management requires this
|
||||
instmods sg # Lenovo Thinkserver firmware management uses sg interface
|
||||
instmods mlx4_ib ib_umad #make the mellanox ib available enough to examine /sys
|
||||
|
@ -34,5 +34,6 @@ opt/xcat/xdsh/Context
|
||||
opt/xcat/ws
|
||||
etc/init.d
|
||||
etc/xcat
|
||||
etc/apache2/conf.d
|
||||
etc/apache2/conf-enabled
|
||||
etc/apache2/conf-available
|
||||
opt/xcat/share/doc/packages/xCAT-server
|
||||
|
@ -30,7 +30,7 @@ case "$1" in
|
||||
update-rc.d xcatd disable
|
||||
rm -f /usr/sbin/xcatd #remove the symbolic
|
||||
|
||||
rm -f /etc/apache2/conf.d/xcat-ws.conf
|
||||
rm -f /etc/apache2/conf-enabled/xcat-ws.conf
|
||||
;;
|
||||
|
||||
*)
|
||||
|
5
xCAT-server/debian/rules
Normal file → Executable file
5
xCAT-server/debian/rules
Normal file → Executable file
@ -66,9 +66,10 @@ binary-arch:
|
||||
chmod 644 $(rootdir)/lib/perl/xCAT_schema/samples/*
|
||||
chmod 644 $(rootdir)/lib/shfunctions
|
||||
chmod 644 $(rootdir)/share/doc/packages/xCAT-server/*
|
||||
echo "ScriptAlias /xcatws $(prefix)/ws/xcatws.cgi" > $(buildroot)/etc/apache2/conf.d/xcat-ws.conf
|
||||
cat $(PWD)/xCAT-wsapi/xcat-ws.conf.ubuntu >> $(buildroot)/etc/apache2/conf.d/xcat-ws.conf
|
||||
echo "ScriptAlias /xcatws $(prefix)/ws/xcatws.cgi" > $(buildroot)/etc/apache2/conf-available/xcat-ws.conf
|
||||
cat $(PWD)/xCAT-wsapi/xcat-ws.conf.ubuntu >> $(buildroot)/etc/apache2/conf-available/xcat-ws.conf
|
||||
rm -rf $(rootdir)/ws/xcat-ws.conf*
|
||||
ln -s ../conf-available/xcat-ws.conf $(buildroot)/etc/apache2/conf-enabled/xcat-ws.conf
|
||||
# dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
|
@ -518,6 +518,13 @@ sub makescript {
|
||||
## kit and kitcomponent parameter.
|
||||
my $kitcomp_deployparams = getKitcompDeployParams($osimgname,\%image_hash);
|
||||
|
||||
# get mac address for the node
|
||||
my $macaddress;
|
||||
if( defined( $::GLOBAL_TAB_HASH{mac}) && defined( $::GLOBAL_TAB_HASH{mac}{$node}) ) {
|
||||
my $macmac = $::GLOBAL_TAB_HASH{mac}{$node}{mac};
|
||||
$macaddress = xCAT::Utils->parseMacTabEntry($macmac, $node);
|
||||
}
|
||||
|
||||
#ok, now do everything else..
|
||||
#$inc =~ s/#XCATVAR:([^#]+)#/envvar($1)/eg;
|
||||
#$inc =~ s/#ENV:([^#]+)#/envvar($1)/eg;
|
||||
@ -545,6 +552,8 @@ sub makescript {
|
||||
#$inc =~ s/#COMMAND:([^#]+)#/command($1)/eg;
|
||||
$inc =~ s/\$NTYPE/$nodetype/eg;
|
||||
|
||||
$inc =~ s/\$MACADDRESS/$macaddress/eg;
|
||||
|
||||
# This line only is used to compatible with the old code
|
||||
$inc =~ s/#Subroutine:([^:]+)::([^:]+)::([^:]+):([^#]+)#/runsubroutine($1,$2,$3,$4)/eg;
|
||||
|
||||
|
@ -104,7 +104,7 @@ sub subvars {
|
||||
$ENV{NODESTATUS}=$tmp;
|
||||
}
|
||||
|
||||
|
||||
$ENV{PERSKCMDLINE}=getPersistentKcmdline($node);
|
||||
|
||||
#replace the env with the right value so that correct include files can be found
|
||||
$inc =~ s/#ENV:([^#]+)#/envvar($1)/eg;
|
||||
@ -250,6 +250,7 @@ sub subvars {
|
||||
$inc =~ s/#KICKSTARTNET#/kickstartnetwork()/eg;
|
||||
$inc =~ s/#MIRRORSPEC#/mirrorspec()/eg;
|
||||
$inc =~ s/#YAST2NET#/yast2network()/eg;
|
||||
$inc =~ s/#KICKSTARTBOOTLOADER#/kickstartbootloader()/eg;
|
||||
$inc =~ s/#ESXIPV6SETUP#/esxipv6setup()/eg;
|
||||
$inc =~ s/#WINTIMEZONE#/xCAT::TZUtils::get_wintimezone()/eg;
|
||||
$inc =~ s/#WINPRODKEY:([^#]+)#/get_win_prodkey($1)/eg;
|
||||
@ -662,6 +663,66 @@ sub get_node_domain {
|
||||
|
||||
}
|
||||
|
||||
|
||||
#get persistent command options from node and osimage definition
|
||||
sub getPersistentKcmdline {
|
||||
my $lcnode=shift;
|
||||
if ( $lcnode eq 'THISNODE' ){
|
||||
$lcnode=$node;
|
||||
}
|
||||
|
||||
my @nodes=($lcnode);
|
||||
|
||||
my $bptab=xCAT::Table->new('bootparams',-create=>1);
|
||||
my $bphash = $bptab->getNodesAttribs(\@nodes,['addkcmdline']);
|
||||
|
||||
my $typetab=xCAT::Table->new('nodetype',-create=>1);
|
||||
my $typehash=$typetab->getNodesAttribs(\@nodes,['provmethod']);
|
||||
my $linuximgtab=xCAT::Table->new('linuximage',-create=>1);
|
||||
|
||||
my $ent = $typehash->{$lcnode}->[0];
|
||||
my $osimgname = $ent->{'provmethod'};
|
||||
|
||||
my $linuximghash = $linuximgtab->getAttribs({imagename => $osimgname}, 'boottarget', 'addkcmdline');
|
||||
my $kern = $bphash->{$lcnode}->[0];
|
||||
|
||||
my $addkcmdline;
|
||||
if ($kern->{addkcmdline}) {
|
||||
$addkcmdline .= $kern->{addkcmdline}." ";
|
||||
}
|
||||
|
||||
if($linuximghash and $linuximghash->{'addkcmdline'})
|
||||
{
|
||||
unless($linuximghash->{'boottarget'})
|
||||
{
|
||||
$addkcmdline .= $linuximghash->{'addkcmdline'}." ";
|
||||
}
|
||||
}
|
||||
|
||||
my $cmdhashref;
|
||||
if($addkcmdline){
|
||||
$cmdhashref=xCAT::Utils->splitkcmdline($addkcmdline);
|
||||
}
|
||||
|
||||
my $ret="";
|
||||
if($cmdhashref and $cmdhashref->{persistent})
|
||||
{
|
||||
$ret=$cmdhashref->{persistent};
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
sub kickstartbootloader {
|
||||
my $line="bootloader";
|
||||
if($ENV{PERSKCMDLINE}){
|
||||
$line.=" --append=\"".$ENV{PERSKCMDLINE}."\"";
|
||||
}
|
||||
return $line;
|
||||
}
|
||||
|
||||
|
||||
sub esxipv6setup {
|
||||
if (not $::XCATSITEVALS{managedaddressmode} or $::XCATSITEVALS{managedaddressmode} =~ /v4/) { return ""; } # blank line for ipv4 schemes
|
||||
my $v6addr;
|
||||
@ -766,11 +827,19 @@ sub mirrorspec{
|
||||
my $pkgdir;
|
||||
my @mirrors;
|
||||
my @pkgdirlist=split(/,/,$pkgdirval);
|
||||
my $masternode = xCAT::TableUtils->get_site_Master();
|
||||
|
||||
foreach (@pkgdirlist){
|
||||
if($_ =~ /^http|ssh/){
|
||||
push @mirrors,$_;
|
||||
}else{
|
||||
$pkgdir=$_;
|
||||
# If multiple pkgdirs are provided, The first path in the value of osimage.pkgdir
|
||||
if (!$pkgdir) {
|
||||
$pkgdir=$_;
|
||||
}else {
|
||||
my $osuurl = "http://" . $masternode . $_ . " ./";
|
||||
push @mirrors,$osuurl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -180,13 +180,13 @@ sub process_request {
|
||||
$retref = "";
|
||||
if(($current_cmd eq "nodeset") && $noupdate_flag)
|
||||
{
|
||||
$retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args, "--noupdateinitrd"]}, $request_command, 0, 2);
|
||||
$retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args, "--noupdateinitrd"]}, $request_command, -1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args]}, $request_command, 0, 2);
|
||||
$retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args]}, $request_command, -1, 1);
|
||||
}
|
||||
log_cmd_return($retref);
|
||||
log_cmd_return($current_cmd, $retref, $callback);
|
||||
}
|
||||
|
||||
}
|
||||
@ -212,24 +212,37 @@ sub setrsp_progress
|
||||
=head3 log_cmd_return
|
||||
|
||||
Description: Log commands return ref into log files.
|
||||
Args: $return - command return ref.
|
||||
Args: $command - current command name
|
||||
$return - command return ref.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub log_cmd_return
|
||||
{
|
||||
my $return = shift;
|
||||
if ($return){
|
||||
if ($return->{error}){
|
||||
my $errarrayref = $return->{error};
|
||||
xCAT::MsgUtils->message('S', "Command error message:".Dumper($errarrayref));
|
||||
}
|
||||
if ($return->{data}){
|
||||
my $dataarrayref = $return->{data};
|
||||
xCAT::MsgUtils->message('S', "Command output message:".Dumper($dataarrayref));
|
||||
my $command = shift;
|
||||
my $res = shift;
|
||||
my $callback = shift;
|
||||
my $errmsg = undef;
|
||||
|
||||
if($::RUNCMD_RC) {
|
||||
$errmsg = "Command '$command' failed, " . join(',', @$res);
|
||||
}elsif ($command eq 'nodeset') { # Only check output for 'nodeset' command
|
||||
foreach my $line (@$res) {
|
||||
if (($line =~ /kernel cannot be found/) or ($line =~ /stop configuration/) or ($line =~ /failed to set up install resources/)) {
|
||||
$errmsg = "Command '$command' failed, $line.";
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($errmsg)
|
||||
{
|
||||
$callback->({
|
||||
error=>[$errmsg],
|
||||
errorcode=>[1]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -11,6 +11,7 @@ BEGIN
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
#use Net::SNMP qw(:snmp INTEGER);
|
||||
use xCAT::Table;
|
||||
@ -2004,7 +2005,7 @@ sub getmacs {
|
||||
}
|
||||
|
||||
my @macs = ();
|
||||
(my $code,my @orig_macs)=inv('mac');
|
||||
(my $code,my @orig_macs)=inv($node, 'mac');
|
||||
my $ignore_gen_mac = 0;
|
||||
foreach my $mac (@orig_macs) {
|
||||
if ($mac =~ /(.*) -> (.*)/) {
|
||||
@ -2113,6 +2114,7 @@ sub getmacs {
|
||||
}
|
||||
|
||||
sub inv {
|
||||
my $node = shift;
|
||||
my @invitems;
|
||||
my $data;
|
||||
my @output;
|
||||
@ -2239,50 +2241,67 @@ sub inv {
|
||||
$updatehash{serial}=$data;
|
||||
}
|
||||
|
||||
if ($item =~ /^mac/ and $slot !~ /:/) {
|
||||
foreach (0..3) {
|
||||
$data=$session->get([$macoids[$_],$slot]);
|
||||
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
|
||||
if ($data =~ /:/) {
|
||||
push @output,"MAC Address ".($_+1).": ".$data;
|
||||
#print "item=$item, slot=$slot\n";
|
||||
|
||||
if ($item =~ /^mac/) {
|
||||
if ($slot !~ /:/) {
|
||||
foreach (0..3) {
|
||||
$data=$session->get([$macoids[$_],$slot]);
|
||||
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
|
||||
if ($data =~ /:/) {
|
||||
push @output,"MAC Address ".($_+1).": ".$data;
|
||||
}
|
||||
}
|
||||
foreach (0..3) {
|
||||
my $oid=$hsdcmacoids[$_].".$slot";
|
||||
$data=$session->get([$hsdcmacoids[$_],$slot]);
|
||||
|
||||
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
|
||||
if ($data =~ /:/) {
|
||||
push @output,"HS Daughter card MAC Address ".($_+1).": ".$data;
|
||||
}
|
||||
}
|
||||
foreach (0..3) {
|
||||
$data=$session->get([$dcmacoids[$_],$slot]);
|
||||
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
|
||||
if ($data =~ /:/) {
|
||||
push @output,"Daughter card 1 MAC Address ".($_+1).": ".$data;
|
||||
}
|
||||
}
|
||||
foreach (0..3) {
|
||||
$data=$session->get([$sidecardoids[$_],$slot]);
|
||||
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
|
||||
if ($data =~ /:/) {
|
||||
push @output,"Side card MAC Address ".($_+1).": ".$data;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
my $cmd="pasu $node show PXE |grep NicPortMacAddress";
|
||||
my $mac_list = xCAT::Utils->runcmd($cmd, 0, 1);
|
||||
#print "mac_list=$mac_list\n";
|
||||
if (@$mac_list > 0) {
|
||||
foreach my $mac (@$mac_list) {
|
||||
#print "mac=$mac\n";
|
||||
$mac =~ s/^.*PXE.NicPortMacAddress.*(\d+)=(.*)$/"MAC Address $1: $2/;
|
||||
#print "mac=$mac\n";
|
||||
push @output, $mac;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (0..3) {
|
||||
my $oid=$hsdcmacoids[$_].".$slot";
|
||||
$data=$session->get([$hsdcmacoids[$_],$slot]);
|
||||
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
|
||||
if ($data =~ /:/) {
|
||||
push @output,"HS Daughter card MAC Address ".($_+1).": ".$data;
|
||||
}
|
||||
}
|
||||
foreach (0..3) {
|
||||
$data=$session->get([$dcmacoids[$_],$slot]);
|
||||
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
|
||||
if ($data =~ /:/) {
|
||||
push @output,"Daughter card 1 MAC Address ".($_+1).": ".$data;
|
||||
}
|
||||
}
|
||||
foreach (0..3) {
|
||||
$data=$session->get([$sidecardoids[$_],$slot]);
|
||||
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
|
||||
if ($data =~ /:/) {
|
||||
push @output,"Side card MAC Address ".($_+1).": ".$data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($updatetable and $updatehash{mtm}) {
|
||||
}
|
||||
}
|
||||
if ($updatetable and $updatehash{mtm}) {
|
||||
#updatenodegroups
|
||||
my $tmp_pre = xCAT::data::ibmhwtypes::parse_group($updatehash{mtm}) ;
|
||||
if (defined($tmp_pre)) {
|
||||
xCAT::TableUtils->updatenodegroups($currnode, $tmp_pre);
|
||||
}
|
||||
}
|
||||
if ($updatetable and keys %updatehash) {
|
||||
}
|
||||
if ($updatetable and keys %updatehash) {
|
||||
my $vpdtab = xCAT::Table->new('vpd');
|
||||
$vpdtab->setNodeAttribs($currnode,\%updatehash);
|
||||
}
|
||||
return (0,@output);
|
||||
}
|
||||
return (0,@output);
|
||||
}
|
||||
sub power {
|
||||
my $subcommand = shift;
|
||||
@ -3716,7 +3735,7 @@ sub bladecmd {
|
||||
} elsif ($command eq "getmacs") {
|
||||
return getmacs($node, @args);
|
||||
} elsif ($command eq "rinv") {
|
||||
return inv(@args);
|
||||
return inv($node, @args);
|
||||
} elsif ($command eq "reventlog") {
|
||||
return eventlog(@args);
|
||||
} elsif ($command eq "rscan") {
|
||||
|
@ -347,6 +347,39 @@ sub donodeent {
|
||||
}
|
||||
my $ipmiauthdata = xCAT::PasswordUtils::getIPMIAuth(
|
||||
noderange=>\@toconfignodes, ipmihash=>$ipmientries);
|
||||
my $nltab = xCAT::Table->new('nodelist', -create=>0);
|
||||
my $groupdata = {};
|
||||
if ($nltab) {
|
||||
$groupdata = $nltab->getNodesAttribs(\@toconfignodes,
|
||||
[qw/groups/]);
|
||||
}
|
||||
my @cfgroups;
|
||||
foreach (keys %$groupdata) {
|
||||
push @cfgroups, split /,/,$groupdata->{$_}->[0]->{groups};
|
||||
}
|
||||
$confluent->read('/nodegroups/');
|
||||
my $currgroup = $confluent->next_result();
|
||||
my %currgroups;
|
||||
while ($currgroup) {
|
||||
if (exists $currgroup->{item}) {
|
||||
my $groupname = $currgroup->{item}->{href};
|
||||
$groupname =~ s/\/$//;
|
||||
$currgroups{$groupname} = 1;
|
||||
}
|
||||
$currgroup = $confluent->next_result();
|
||||
}
|
||||
foreach (@cfgroups) {
|
||||
if (not exists $currgroups{$_}) {
|
||||
$confluent->create('/nodegroups/', parameters=>{name=>$_});
|
||||
my $rsp = $confluent->next_result();
|
||||
while ($rsp) {
|
||||
if (exists $rsp->{error}) {
|
||||
xCAT::SvrUtils::sendmsg([1,"Confluent error: " . $rsp->{error}],$cb);
|
||||
}
|
||||
$rsp = $confluent->next_result();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Go thru all nodes specified to add them to the file
|
||||
foreach my $node (sort keys %$cfgenthash) {
|
||||
@ -379,6 +412,7 @@ foreach my $node (sort keys %$cfgenthash) {
|
||||
} elsif ($::XCATSITEVALS{'consoleondemand'} and $::XCATSITEVALS{'consoleondemand'} !~ m/^n/) {
|
||||
$parameters{'console.logging'} = 'none';
|
||||
}
|
||||
$parameters{'groups'} = [split /,/,$groupdata->{$node}->[0]->{'groups'}];
|
||||
if (exists $currnodes{$node}) {
|
||||
$confluent->update('/nodes/'.$node.'/attributes/current', parameters=>\%parameters);
|
||||
my $rsp = $confluent->next_result();
|
||||
|
@ -221,16 +221,18 @@ sub copycd
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $copypath || $nonoverwrite ){
|
||||
$callback->({info=> ["copycd on debian/ubuntu doesn't support -p, -w options!"]});
|
||||
return;
|
||||
}
|
||||
|
||||
unless (-r $path . "/.disk/info")
|
||||
{
|
||||
#xCAT::MsgUtils->message("S","The CD doesn't look like a Debian CD, exiting...");
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $copypath || $nonoverwrite )
|
||||
{
|
||||
$callback->({info=> ["copycds on Ubuntu/Debian does not support -p or -w option."]});
|
||||
return;
|
||||
}
|
||||
|
||||
my $dinfo;
|
||||
open($dinfo, $path . "/.disk/info");
|
||||
my $line = <$dinfo>;
|
||||
@ -436,8 +438,7 @@ sub copycd
|
||||
}
|
||||
}
|
||||
|
||||
sub mkinstall
|
||||
{
|
||||
sub mkinstall {
|
||||
xCAT::MsgUtils->message("S","Doing debian mkinstall");
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
@ -488,16 +489,13 @@ sub mkinstall
|
||||
my $site_ent = $ents[0];
|
||||
if (!defined($site_ent) || ($site_ent =~ /no/i) || ($site_ent =~ /0/))
|
||||
{
|
||||
$callback->(
|
||||
{
|
||||
warning => ["The options \"install\", \"netboot\", and \"statelite\" have been deprecated. They should continue to work in this release, but have not been tested as carefully, and some new functions are not available with these options. For full function and support, use \"nodeset <noderange> osimage=<osimage_name>\" instead."],
|
||||
}
|
||||
);
|
||||
$callback->( { warning => ["The options \"install\", \"netboot\", and \"statelite\" have been deprecated. They should continue to work in this release, but have not been tested as carefully, and some new functions are not available with these options. For full function and support, use \"nodeset <noderange> osimage=<osimage_name>\" instead."], });
|
||||
# Do not print this warning message multiple times
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach $node (@nodes)
|
||||
{
|
||||
my $os;
|
||||
@ -515,111 +513,115 @@ sub mkinstall
|
||||
my $osinst;
|
||||
my $ent = $osents{$node}->[0]; #$ostab->getNodeAttribs($node, ['profile', 'os', 'arch']);
|
||||
if ($ent and $ent->{provmethod} and ($ent->{provmethod} ne 'install') and ($ent->{provmethod} ne 'netboot') and ($ent->{provmethod} ne 'statelite')) {
|
||||
$imagename=$ent->{provmethod};
|
||||
if (!exists($img_hash{$imagename})) {
|
||||
if (!$osimagetab) {
|
||||
$osimagetab=xCAT::Table->new('osimage', -create=>1);
|
||||
}
|
||||
(my $ref) = $osimagetab->getAttribs({imagename => $imagename}, 'osvers', 'osarch', 'profile', 'provmethod');
|
||||
if ($ref) {
|
||||
$img_hash{$imagename}->{osver}=$ref->{'osvers'};
|
||||
$img_hash{$imagename}->{osarch}=$ref->{'osarch'};
|
||||
$img_hash{$imagename}->{profile}=$ref->{'profile'};
|
||||
$img_hash{$imagename}->{provmethod}=$ref->{'provmethod'};
|
||||
if (!$linuximagetab) {
|
||||
$linuximagetab=xCAT::Table->new('linuximage', -create=>1);
|
||||
}
|
||||
(my $ref1) = $linuximagetab->getAttribs({imagename => $imagename}, 'template', 'pkgdir', 'pkglist');
|
||||
if ($ref1) {
|
||||
if ($ref1->{'template'}) {
|
||||
$img_hash{$imagename}->{template}=$ref1->{'template'};
|
||||
}
|
||||
if ($ref1->{'pkgdir'}) {
|
||||
$img_hash{$imagename}->{pkgdir}=$ref1->{'pkgdir'};
|
||||
}
|
||||
if ($ref1->{'pkglist'}) {
|
||||
$img_hash{$imagename}->{pkglist}=$ref1->{'pkglist'};
|
||||
}
|
||||
}
|
||||
# if the install template wasn't found, then lets look for it in the default locations.
|
||||
unless($img_hash{$imagename}->{template}){
|
||||
my $pltfrm=getplatform($ref->{'osvers'});
|
||||
my $tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$installroot/custom/install/$pltfrm",
|
||||
$ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'});
|
||||
if (! $tmplfile) {
|
||||
$tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$::XCATROOT/share/xcat/install/$pltfrm",
|
||||
$ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'});
|
||||
}
|
||||
# if we managed to find it, put it in the hash:
|
||||
if($tmplfile){
|
||||
$img_hash{$imagename}->{template}=$tmplfile;
|
||||
}
|
||||
}
|
||||
#if the install pkglist wasn't found, then lets look for it in the default locations
|
||||
unless($img_hash{$imagename}->{pkglist}){
|
||||
my $pltfrm=getplatform($ref->{'osvers'});
|
||||
my $pkglistfile=xCAT::SvrUtils::get_pkglist_file_name("$installroot/custom/install/$pltfrm",
|
||||
$ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'});
|
||||
if (! $pkglistfile) {
|
||||
$pkglistfile=xCAT::SvrUtils::get_pkglist_file_name("$::XCATROOT/share/xcat/install/$pltfrm",
|
||||
$ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'});
|
||||
}
|
||||
# if we managed to find it, put it in the hash:
|
||||
if($pkglistfile){
|
||||
$img_hash{$imagename}->{pkglist}=$pkglistfile;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$callback->(
|
||||
{error => ["The os image $imagename does not exists on the osimage table for $node"],
|
||||
errorcode => [1]});
|
||||
next;
|
||||
}
|
||||
}
|
||||
my $ph=$img_hash{$imagename};
|
||||
$os = $ph->{osver};
|
||||
$arch = $ph->{osarch};
|
||||
$profile = $ph->{profile};
|
||||
$platform=xCAT_plugin::debian::getplatform($os);
|
||||
|
||||
$tmplfile=$ph->{template};
|
||||
$pkgdirval=$ph->{pkgdir};
|
||||
my @pkgdirlist=split(/,/,$pkgdirval);
|
||||
foreach (@pkgdirlist){
|
||||
if($_ =~ /^http|ssh/){
|
||||
push @mirrors,$_;
|
||||
}else{
|
||||
$pkgdir=$_;
|
||||
}
|
||||
|
||||
$imagename=$ent->{provmethod};
|
||||
if (!exists($img_hash{$imagename})) {
|
||||
if (!$osimagetab) {
|
||||
$osimagetab=xCAT::Table->new('osimage', -create=>1);
|
||||
}
|
||||
|
||||
if (!$pkgdir) {
|
||||
$pkgdir="$installroot/$os/$arch";
|
||||
}
|
||||
$pkglistfile=$ph->{pkglist};
|
||||
}
|
||||
else {
|
||||
$os = $ent->{os};
|
||||
$arch = $ent->{arch};
|
||||
$profile = $ent->{profile};
|
||||
$platform=xCAT_plugin::debian::getplatform($os);
|
||||
my $genos = $os;
|
||||
$genos =~ s/\..*//;
|
||||
|
||||
$tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$installroot/custom/install/$platform", $profile, $os, $arch, $genos);
|
||||
if (! $tmplfile) {
|
||||
(my $ref) = $osimagetab->getAttribs({imagename => $imagename}, 'osvers', 'osarch', 'profile', 'provmethod');
|
||||
if ($ref) {
|
||||
$img_hash{$imagename}->{osver}=$ref->{'osvers'};
|
||||
$img_hash{$imagename}->{osarch}=$ref->{'osarch'};
|
||||
$img_hash{$imagename}->{profile}=$ref->{'profile'};
|
||||
$img_hash{$imagename}->{provmethod}=$ref->{'provmethod'};
|
||||
if (!$linuximagetab) {
|
||||
$linuximagetab=xCAT::Table->new('linuximage', -create=>1);
|
||||
}
|
||||
(my $ref1) = $linuximagetab->getAttribs({imagename => $imagename}, 'template', 'pkgdir', 'pkglist');
|
||||
if ($ref1) {
|
||||
if ($ref1->{'template'}) {
|
||||
$img_hash{$imagename}->{template}=$ref1->{'template'};
|
||||
}
|
||||
if ($ref1->{'pkgdir'}) {
|
||||
$img_hash{$imagename}->{pkgdir}=$ref1->{'pkgdir'};
|
||||
}
|
||||
if ($ref1->{'pkglist'}) {
|
||||
$img_hash{$imagename}->{pkglist}=$ref1->{'pkglist'};
|
||||
}
|
||||
}
|
||||
# if the install template wasn't found, then lets look for it in the default locations.
|
||||
unless($img_hash{$imagename}->{template}) {
|
||||
my $pltfrm=getplatform($ref->{'osvers'});
|
||||
my $tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$installroot/custom/install/$pltfrm",
|
||||
$ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'});
|
||||
if (! $tmplfile) {
|
||||
$tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$::XCATROOT/share/xcat/install/$pltfrm",
|
||||
$ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'});
|
||||
}
|
||||
# if we managed to find it, put it in the hash:
|
||||
if($tmplfile) {
|
||||
$img_hash{$imagename}->{template}=$tmplfile;
|
||||
}
|
||||
}
|
||||
#if the install pkglist wasn't found, then lets look for it in the default locations
|
||||
unless($img_hash{$imagename}->{pkglist}) {
|
||||
my $pltfrm=getplatform($ref->{'osvers'});
|
||||
my $pkglistfile=xCAT::SvrUtils::get_pkglist_file_name("$installroot/custom/install/$pltfrm",
|
||||
$ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'});
|
||||
if (! $pkglistfile) {
|
||||
$pkglistfile=xCAT::SvrUtils::get_pkglist_file_name("$::XCATROOT/share/xcat/install/$pltfrm",
|
||||
$ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'});
|
||||
}
|
||||
# if we managed to find it, put it in the hash:
|
||||
if($pkglistfile) {
|
||||
$img_hash{$imagename}->{pkglist}=$pkglistfile;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$callback->(
|
||||
{error => ["The os image $imagename does not exists on the osimage table for $node"],
|
||||
errorcode => [1]});
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
my $ph=$img_hash{$imagename};
|
||||
$os = $ph->{osver};
|
||||
$arch = $ph->{osarch};
|
||||
$profile = $ph->{profile};
|
||||
$platform=xCAT_plugin::debian::getplatform($os);
|
||||
|
||||
$tmplfile=$ph->{template};
|
||||
$pkgdirval=$ph->{pkgdir};
|
||||
my @pkgdirlist=split(/,/,$pkgdirval);
|
||||
foreach (@pkgdirlist) {
|
||||
if($_ =~ /^http|ssh/) {
|
||||
push @mirrors,$_;
|
||||
} else {
|
||||
# If multiple pkgdirs are provided, The first path in the value of osimage.pkgdir
|
||||
# must be the OS base pkg dir path, so use the first path as pkgdir
|
||||
if (!$pkgdir) {
|
||||
$pkgdir=$_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$pkgdir) {
|
||||
$pkgdir="$installroot/$os/$arch";
|
||||
}
|
||||
$pkglistfile=$ph->{pkglist};
|
||||
}
|
||||
else {
|
||||
$os = $ent->{os};
|
||||
$arch = $ent->{arch};
|
||||
$profile = $ent->{profile};
|
||||
$platform=xCAT_plugin::debian::getplatform($os);
|
||||
my $genos = $os;
|
||||
$genos =~ s/\..*//;
|
||||
|
||||
$tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$installroot/custom/install/$platform", $profile, $os, $arch, $genos);
|
||||
if (! $tmplfile) {
|
||||
$tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$::XCATROOT/share/xcat/install/$platform", $profile, $os, $arch, $genos);
|
||||
}
|
||||
|
||||
$pkglistfile=xCAT::SvrUtils::get_pkglist_file_name("$installroot/custom/install/$platform", $profile, $os, $arch, $genos);
|
||||
if (! $pkglistfile) {
|
||||
$pkglistfile=xCAT::SvrUtils::get_pkglist_file_name("$installroot/custom/install/$platform", $profile, $os, $arch, $genos);
|
||||
if (! $pkglistfile) {
|
||||
$pkglistfile=xCAT::SvrUtils::get_pkglist_file_name("$::XCATROOT/share/xcat/install/$platform", $profile, $os, $arch, $genos);
|
||||
}
|
||||
|
||||
$pkgdir="$installroot/$os/$arch";
|
||||
}
|
||||
$pkgdir="$installroot/$os/$arch";
|
||||
}
|
||||
|
||||
if ($arch eq "x86_64") {
|
||||
$darch = "amd64";
|
||||
@ -636,7 +638,7 @@ sub mkinstall
|
||||
|
||||
my @missingparms;
|
||||
unless ($os) {
|
||||
if ($imagename) {
|
||||
if ($imagename) {
|
||||
push @missingparms,"osimage.osvers";
|
||||
}
|
||||
else {
|
||||
@ -653,7 +655,7 @@ sub mkinstall
|
||||
}
|
||||
}
|
||||
unless ($profile) {
|
||||
if ($imagename) {
|
||||
if ($imagename) {
|
||||
push @missingparms,"osimage.profile";
|
||||
}
|
||||
else {
|
||||
@ -664,7 +666,7 @@ sub mkinstall
|
||||
unless ($os and $arch and $profile){
|
||||
$callback->({error => ["Missing ".join(',',@missingparms)." for $node"],
|
||||
errorcode => [1]});
|
||||
next; #No profile
|
||||
next; # No profile
|
||||
}
|
||||
|
||||
unless ( -r "$tmplfile") {
|
||||
@ -677,46 +679,42 @@ sub mkinstall
|
||||
my $tmperr;
|
||||
my $preerr;
|
||||
my $posterr;
|
||||
if ($imagename) {
|
||||
$tmperr="Unable to find template file: $tmplfile";
|
||||
} else {
|
||||
if ($imagename) {
|
||||
$tmperr="Unable to find template file: $tmplfile";
|
||||
} else {
|
||||
$tmperr="Unable to find template in $installroot/custom/install/$platform or $::XCATROOT/share/xcat/install/$platform (for $profile/$os/$arch combination)";
|
||||
}
|
||||
}
|
||||
if (-r "$tmplfile") {
|
||||
$tmperr =
|
||||
xCAT::Template->subvars(
|
||||
$tmplfile,
|
||||
"$installroot/autoinst/" . $node,
|
||||
$node,
|
||||
$pkglistfile,
|
||||
$pkgdir,
|
||||
$platform
|
||||
);
|
||||
xCAT::Template->subvars($tmplfile,
|
||||
"$installroot/autoinst/" . $node,
|
||||
$node,
|
||||
$pkglistfile,
|
||||
$pkgdir,
|
||||
$platform
|
||||
);
|
||||
}
|
||||
|
||||
my $prescript = "$::XCATROOT/share/xcat/install/scripts/pre.$platform";
|
||||
my $postscript = "$::XCATROOT/share/xcat/install/scripts/post.$platform";
|
||||
my $prescript = "$::XCATROOT/share/xcat/install/scripts/pre.$platform";
|
||||
my $postscript = "$::XCATROOT/share/xcat/install/scripts/post.$platform";
|
||||
|
||||
# for powerkvm VM ubuntu LE#
|
||||
if ($arch =~ /ppc64/i and $platform eq "ubuntu") {
|
||||
$prescript = "$::XCATROOT/share/xcat/install/scripts/pre.$platform.ppc64";
|
||||
}
|
||||
# for powerkvm VM ubuntu LE#
|
||||
if ($arch =~ /ppc64/i and $platform eq "ubuntu") {
|
||||
$prescript = "$::XCATROOT/share/xcat/install/scripts/pre.$platform.ppc64";
|
||||
}
|
||||
|
||||
if (-r "$prescript"){
|
||||
$preerr =
|
||||
xCAT::Template->subvars(
|
||||
$prescript,
|
||||
"$installroot/autoinst/" . $node . ".pre",
|
||||
$node
|
||||
);
|
||||
}
|
||||
if (-r "$postscript") {
|
||||
$posterr =
|
||||
xCAT::Template->subvars(
|
||||
$postscript,
|
||||
"$installroot/autoinst/" . $node . ".post",
|
||||
$node
|
||||
);
|
||||
if (-r "$prescript"){
|
||||
$preerr = xCAT::Template->subvars($prescript,
|
||||
"$installroot/autoinst/" . $node . ".pre",
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
if (-r "$postscript") {
|
||||
$posterr = xCAT::Template->subvars($postscript,
|
||||
"$installroot/autoinst/" . $node . ".post",
|
||||
$node
|
||||
);
|
||||
}
|
||||
|
||||
my $errtmp;
|
||||
@ -728,8 +726,8 @@ sub mkinstall
|
||||
|
||||
if ($arch =~ /ppc64/i and !(-e "$pkgdir/install/netboot/initrd.gz")) {
|
||||
$callback->({error => ["The network boot initrd.gz is not found in $pkgdir/install/netboot. This is provided by Ubuntu, please download and retry."],
|
||||
errorcode=>[1]});
|
||||
next;
|
||||
errorcode=>[1]});
|
||||
next;
|
||||
}
|
||||
my $tftpdir = "/tftpboot";
|
||||
|
||||
@ -739,33 +737,31 @@ sub mkinstall
|
||||
my $initrdpath;
|
||||
my $maxmem;
|
||||
|
||||
|
||||
if (
|
||||
(
|
||||
($arch =~ /x86/ and
|
||||
(
|
||||
( -r "$pkgdir/install/netboot/ubuntu-installer/$darch/linux"
|
||||
and $kernpath = "$pkgdir/install/netboot/ubuntu-installer/$darch/linux"
|
||||
and -r "$pkgdir/install/netboot/ubuntu-installer/$darch/initrd.gz"
|
||||
and $initrdpath = "$pkgdir/install/netboot/ubuntu-installer/$darch/initrd.gz"
|
||||
) or
|
||||
( -r "$pkgdir/install/netboot/vmlinuz"
|
||||
and $kernpath = "$pkgdir/install/netboot/vmlinuz"
|
||||
and -r "$pkgdir/install/netboot/initrd.gz"
|
||||
and $initrdpath = "$pkgdir/install/netboot/initrd.gz"
|
||||
(
|
||||
($arch =~ /x86/ and
|
||||
(
|
||||
( -r "$pkgdir/install/netboot/ubuntu-installer/$darch/linux"
|
||||
and $kernpath = "$pkgdir/install/netboot/ubuntu-installer/$darch/linux"
|
||||
and -r "$pkgdir/install/netboot/ubuntu-installer/$darch/initrd.gz"
|
||||
and $initrdpath = "$pkgdir/install/netboot/ubuntu-installer/$darch/initrd.gz"
|
||||
) or
|
||||
( -r "$pkgdir/install/netboot/vmlinuz"
|
||||
and $kernpath = "$pkgdir/install/netboot/vmlinuz"
|
||||
and -r "$pkgdir/install/netboot/initrd.gz"
|
||||
and $initrdpath = "$pkgdir/install/netboot/initrd.gz"
|
||||
)
|
||||
)
|
||||
)
|
||||
) or (
|
||||
) or (
|
||||
$arch =~ /ppc64/i and (
|
||||
-r "$pkgdir/install/vmlinux"
|
||||
and $kernpath = "$pkgdir/install/vmlinux"
|
||||
and -r "$pkgdir/install/netboot/initrd.gz"
|
||||
and $initrdpath = "$pkgdir/install/netboot/initrd.gz"
|
||||
-r "$pkgdir/install/vmlinux"
|
||||
and $kernpath = "$pkgdir/install/vmlinux"
|
||||
and -r "$pkgdir/install/netboot/initrd.gz"
|
||||
and $initrdpath = "$pkgdir/install/netboot/initrd.gz"
|
||||
)
|
||||
)
|
||||
|
||||
)
|
||||
){
|
||||
)
|
||||
){
|
||||
#TODO: driver slipstream, targetted for network.
|
||||
|
||||
# Copy the install resource to /tftpboot and check to only copy once
|
||||
@ -794,50 +790,37 @@ sub mkinstall
|
||||
copyAndAddCustomizations($initrdpath,"$tftppath/initrd.img");
|
||||
}
|
||||
|
||||
#We have a shot...
|
||||
# We have a shot...
|
||||
my $ent = $rents{$node}->[0];
|
||||
# $restab->getNodeAttribs($node,
|
||||
# ['nfsserver', 'primarynic', 'installnic']);
|
||||
my $sent = $hents{$node}->[0];
|
||||
# $hmtab->getNodeAttribs(
|
||||
# $node,
|
||||
# [
|
||||
# 'serialport', 'serialspeed', 'serialflow'
|
||||
# ]
|
||||
# );
|
||||
my $macent = $macents{$node}->[0];
|
||||
my $instserver;
|
||||
if ($ent and $ent->{xcatmaster}){
|
||||
if ($ent and $ent->{xcatmaster}) {
|
||||
$instserver = $ent->{xcatmaster};
|
||||
}
|
||||
else{
|
||||
else {
|
||||
$instserver = '!myipfn!';
|
||||
}
|
||||
|
||||
if ($ent and $ent->{nfsserver})
|
||||
{
|
||||
if ($ent and $ent->{nfsserver}) {
|
||||
$instserver = $ent->{nfsserver};
|
||||
}
|
||||
#if ($platform eq "ubuntu"){
|
||||
# my $kcmdline =
|
||||
# "nofb utf8 auto url=http://"
|
||||
# . $ent->{nfsserver}
|
||||
# . "$installroot/autoinst/"
|
||||
# . $node;
|
||||
#} else
|
||||
#{
|
||||
my $kcmdline = "nofb utf8 auto url=http://"
|
||||
. $instserver
|
||||
. "/install/autoinst/"
|
||||
. $node;
|
||||
#}
|
||||
|
||||
my $kcmdline = "nofb utf8 auto url=http://" . $instserver . "/install/autoinst/" . $node;
|
||||
|
||||
$kcmdline .= " xcatd=".$instserver;
|
||||
$kcmdline .= " mirror/http/hostname=".$instserver;
|
||||
if ($maxmem) {
|
||||
$kcmdline.=" mem=$maxmem";
|
||||
}
|
||||
my $net_params = xCAT::NetworkUtils->gen_net_boot_params($ent->{installnic},$ent->{primarynic},$macent->{mac});
|
||||
|
||||
# parse Mac table to get one mac address in case there are multiples.
|
||||
my $mac;
|
||||
if ($macent->{mac}) {
|
||||
$mac = xCAT::Utils->parseMacTabEntry($macent->{mac},$node);
|
||||
}
|
||||
|
||||
my $net_params = xCAT::NetworkUtils->gen_net_boot_params($ent->{installnic},$ent->{primarynic},$mac);
|
||||
if (exists($net_params->{nicname})) {
|
||||
$kcmdline .= " netcfg/choose_interface=". $net_params->{nicname};
|
||||
} elsif (exists($net_params->{mac})) {
|
||||
@ -845,8 +828,8 @@ sub mkinstall
|
||||
}
|
||||
|
||||
#TODO: dd=<url> for driver disks
|
||||
if (defined($sent->{serialport})){
|
||||
unless ($sent->{serialspeed}){
|
||||
if (defined($sent->{serialport})) {
|
||||
unless ($sent->{serialspeed}) {
|
||||
$callback->({error => ["serialport defined, but no serialspeed for $node in nodehm table"],
|
||||
errorcode => [1]});
|
||||
next;
|
||||
@ -856,74 +839,49 @@ sub mkinstall
|
||||
} else {
|
||||
$kcmdline .= " console=tty0 console=ttyS".$sent->{serialport} . "," . $sent->{serialspeed};
|
||||
}
|
||||
if ($sent->{serialflow} =~ /(hard|cts|ctsrts)/){
|
||||
if ($sent->{serialflow} =~ /(hard|cts|ctsrts)/) {
|
||||
$kcmdline .= "n8r";
|
||||
}
|
||||
} else {
|
||||
$callback->(
|
||||
{
|
||||
warning => ["rcons my not work since no serialport specified"],
|
||||
}
|
||||
);
|
||||
$callback->({ warning => ["rcons my not work since no serialport specified"], });
|
||||
}
|
||||
#$kcmdline .= " noipv6";
|
||||
# add the addkcmdline attribute to the end
|
||||
# of the command, if it exists
|
||||
#my $addkcmd = $addkcmdhash->{$node}->[0];
|
||||
# add the extra addkcmd command info, if in the table
|
||||
#if ($addkcmd->{'addkcmdline'}) {
|
||||
# $kcmdline .= " ";
|
||||
# $kcmdline .= $addkcmd->{'addkcmdline'};
|
||||
#}
|
||||
|
||||
# need to add these in, otherwise aptitude will ask questions
|
||||
$kcmdline .= " locale=en_US";
|
||||
#$kcmdline .= " netcfg/wireless_wep= netcfg/get_hostname= netcfg/get_domain=";
|
||||
$kcmdline .= " locale=en_US";
|
||||
#$kcmdline .= " netcfg/wireless_wep= netcfg/get_hostname= netcfg/get_domain=";
|
||||
|
||||
# default answers as much as possible, we don't want any interactiveness :)
|
||||
$kcmdline .= " priority=critical";
|
||||
$kcmdline .= " priority=critical";
|
||||
|
||||
# Automatically detect all HDD
|
||||
#$kcmdline .= " all-generic-ide irqpoll";
|
||||
# $kcmdline .= " all-generic-ide irqpoll";
|
||||
|
||||
# by default do text based install
|
||||
#$kcmdline .= " DEBIAN_FRONTEND=text";
|
||||
# by default do text based install
|
||||
# $kcmdline .= " DEBIAN_FRONTEND=text";
|
||||
|
||||
# Maybe useful for debugging purposes
|
||||
#
|
||||
#$kcmdline .= " BOOT_DEBUG=3";
|
||||
#$kcmdline .= " DEBCONF_DEBUG=5";
|
||||
|
||||
# I don't need the timeout for ubuntu, but for debian there is a problem with getting dhcp in a timely manner
|
||||
# Maybe useful for debugging purposes
|
||||
#
|
||||
# $kcmdline .= " BOOT_DEBUG=3";
|
||||
# $kcmdline .= " DEBCONF_DEBUG=5";
|
||||
|
||||
# I don't need the timeout for ubuntu, but for debian there is a problem with getting dhcp in a timely manner
|
||||
# safer way to set hostname, avoid problems with nameservers
|
||||
$kcmdline .= " hostname=".$node;
|
||||
|
||||
#from 12.10, the live install changed, so add the live-installer
|
||||
if ( -r "$pkgdir/install/filesystem.squashfs")
|
||||
{
|
||||
$kcmdline .= " live-installer/net-image=http://${instserver}${pkgdir}/install/filesystem.squashfs";
|
||||
}
|
||||
if ( -r "$pkgdir/install/filesystem.squashfs") {
|
||||
$kcmdline .= " live-installer/net-image=http://${instserver}${pkgdir}/install/filesystem.squashfs";
|
||||
}
|
||||
|
||||
$bptab->setNodeAttribs(
|
||||
$node,
|
||||
{
|
||||
kernel => "$rtftppath/vmlinuz",
|
||||
initrd => "$rtftppath/initrd.img",
|
||||
kcmdline => $kcmdline
|
||||
}
|
||||
);
|
||||
$bptab->setNodeAttribs($node, { kernel => "$rtftppath/vmlinuz",
|
||||
initrd => "$rtftppath/initrd.img",
|
||||
kcmdline => $kcmdline });
|
||||
}
|
||||
else{
|
||||
$callback->({error => ["Install image not found in $installroot/$os/$arch"],
|
||||
errorcode => [1]});
|
||||
}
|
||||
}
|
||||
#my $rc = xCAT::TableUtils->create_postscripts_tar();
|
||||
#if ($rc != 0)
|
||||
#{
|
||||
# xCAT::MsgUtils->message("S", "Error creating postscripts tar file.");
|
||||
#}
|
||||
}
|
||||
|
||||
sub mknetboot
|
||||
|
@ -19,6 +19,10 @@ use lib "$::XCATROOT/lib/perl";
|
||||
use strict;
|
||||
use warnings "all";
|
||||
use Getopt::Long;
|
||||
use IO::Socket;
|
||||
use Thread qw(yield);
|
||||
use POSIX "WNOHANG";
|
||||
use Storable qw(store_fd fd_retrieve);
|
||||
|
||||
use xCAT::Usage;
|
||||
use xCAT::CIMUtils;
|
||||
@ -33,6 +37,8 @@ sub handled_commands {
|
||||
}
|
||||
}
|
||||
|
||||
my $parent_fd;
|
||||
|
||||
# The hash includes all valid attribute for quering
|
||||
my %QUERY_ATTRS = (
|
||||
'savingstatus' => 1,
|
||||
@ -332,6 +338,36 @@ sub process_request {
|
||||
|
||||
my $ppcdirect_tab = xCAT::Table->new('ppcdirect', -create=>0);
|
||||
|
||||
my $children; # The number of child process
|
||||
my %sp_children; # Record the pid of child process
|
||||
my $sub_fds = new IO::Select; # Record the parent fd for each child process
|
||||
|
||||
# Set the signal handler for ^c
|
||||
$SIG{TERM} = $SIG{INT} = sub {
|
||||
foreach (keys %sp_children) {
|
||||
kill 2, $_;
|
||||
}
|
||||
$SIG{ALRM} = sub {
|
||||
while (wait() > 0) {
|
||||
yield;
|
||||
}
|
||||
exit @_;
|
||||
};
|
||||
alarm(1); # wait 1s for grace exit
|
||||
};
|
||||
|
||||
# Set the singal handler for child process finished it's work
|
||||
$SIG{CHLD} = sub {
|
||||
my $cpid;
|
||||
while (($cpid = waitpid(-1, WNOHANG)) > 0) {
|
||||
if ($sp_children{$cpid}) {
|
||||
delete $sp_children{$cpid};
|
||||
$children--;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
# Do run each node
|
||||
foreach my $node (@{$request->{node}}) {
|
||||
my $user = $user_default;
|
||||
my $password = $password_default;
|
||||
@ -345,7 +381,7 @@ sub process_request {
|
||||
unless (@ppc_all_entry) {
|
||||
@ppc_all_entry = $ppc_tab->getAllNodeAttribs(['node', 'parent', 'hcp', 'nodetype']);
|
||||
foreach my $ppcentry (@ppc_all_entry) {
|
||||
if (defined($ppcentry->{parent})) {
|
||||
if (defined($ppcentry->{parent}) && defined($ppcentry->{nodetype}) && $ppcentry->{nodetype} =~ /fsp/) {
|
||||
$cec2fsp->{$ppcentry->{parent}} .= "$ppcentry->{node},";
|
||||
}
|
||||
}
|
||||
@ -383,37 +419,113 @@ sub process_request {
|
||||
xCAT::MsgUtils->message("E", {data => ["$node: Cannot find HCP"]}, $callback);
|
||||
return 1;
|
||||
}
|
||||
foreach my $ip (split(',', $hcp_ip)) {
|
||||
unless ($ip) { next; }
|
||||
my $real_ip = xCAT::NetworkUtils->getipaddr($ip);
|
||||
unless ($real_ip) {
|
||||
xCAT::MsgUtils->message("E", {error => ["$node: Cannot get ip for $ip"], errorcode => 1}, $callback);
|
||||
next;
|
||||
}
|
||||
my %args = (
|
||||
node => $node,
|
||||
ip => $real_ip,
|
||||
port => '5989',
|
||||
method => 'POST',
|
||||
user => $user,
|
||||
password => $password);
|
||||
|
||||
if ($verbose) {
|
||||
$args{verbose} = 1;
|
||||
$args{callback} = $callback;
|
||||
xCAT::MsgUtils->message("I", {data => ["$node: Access hcp [$ip], user [$user], passowrd [$password]"]}, $callback);
|
||||
}
|
||||
# call the cim utils to connect to cim server
|
||||
my $ret = run_cim ($request, $callback, \%args);
|
||||
# 0 - success; 1 - cim error; 10 - ip is not pingable; 11 - this ip is a standby fsp
|
||||
unless ($ret == 10 || $ret == 11) {
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
# fork a sub process to handle the communication with service processor
|
||||
$children++;
|
||||
my $cfd;
|
||||
|
||||
# the $parent_fd will be used by &send_rep() to send response from child process to parent process
|
||||
socketpair($parent_fd, $cfd,AF_UNIX,SOCK_STREAM,PF_UNSPEC) or die "socketpair: $!";
|
||||
$cfd->autoflush(1);
|
||||
$parent_fd->autoflush(1);
|
||||
|
||||
my $child = xCAT::Utils->xfork;
|
||||
if ($child == 0) {
|
||||
close($cfd);
|
||||
$0 = $0." for node [$node]";
|
||||
$callback = \&send_rep;
|
||||
foreach my $ip (split(',', $hcp_ip)) {
|
||||
unless ($ip) { next; }
|
||||
my $real_ip = xCAT::NetworkUtils->getipaddr($ip);
|
||||
unless ($real_ip) {
|
||||
xCAT::MsgUtils->message("E", {error => ["$node: Cannot get ip for $ip"], errorcode => [1]}, $callback);
|
||||
next;
|
||||
}
|
||||
my %args = (
|
||||
node => $node,
|
||||
ip => $real_ip,
|
||||
port => '5989',
|
||||
method => 'POST',
|
||||
user => $user,
|
||||
password => $password);
|
||||
|
||||
if ($verbose) {
|
||||
$args{verbose} = 1;
|
||||
$args{callback} = $callback;
|
||||
xCAT::MsgUtils->message("I", {data => ["$node: Access hcp [$ip], user [$user], passowrd [$password]"]}, $callback);
|
||||
}
|
||||
# call the cim utils to connect to cim server
|
||||
my $ret = run_cim ($request, $callback, \%args);
|
||||
# 0 - success; 1 - cim error; 10 - ip is not pingable; 11 - this ip is a standby fsp
|
||||
unless ($ret == 10 || $ret == 11) {
|
||||
last;
|
||||
}
|
||||
}
|
||||
exit(0);
|
||||
} else {
|
||||
# in the main process, record the created child process and add parent fd for the child process to an IO:Select object
|
||||
# the main process will check all the parent fd and receive response
|
||||
$sp_children{$child}=1;
|
||||
close ($parent_fd);
|
||||
$sub_fds->add($cfd);
|
||||
}
|
||||
}
|
||||
|
||||
# receive data from child processes
|
||||
while ($sub_fds->count > 0 or $children > 0) {
|
||||
forward_data($callback,$sub_fds);
|
||||
}
|
||||
while (forward_data($callback,$sub_fds)) {}
|
||||
}
|
||||
|
||||
=head3 send_rep
|
||||
|
||||
DESCRIPTION:
|
||||
Send date from forked child process to parent process.
|
||||
This subroutine will be replace the original $callback in the forked child process
|
||||
|
||||
ARGUMENTS:
|
||||
$resp - The response which generated in xCAT::Utils->message();
|
||||
|
||||
=cut
|
||||
sub send_rep {
|
||||
my $resp=shift;
|
||||
|
||||
unless ($resp) { return; }
|
||||
store_fd($resp,$parent_fd);
|
||||
}
|
||||
|
||||
=head3 forward_data
|
||||
|
||||
DESCRIPTION:
|
||||
Receive data from forked child process and call the original $callback to forward data to xcat client
|
||||
|
||||
=cut
|
||||
sub forward_data {
|
||||
my $callback = shift;
|
||||
my $fds = shift;
|
||||
my @ready_fds = $fds->can_read(1);
|
||||
my $rfh;
|
||||
my $rc = @ready_fds;
|
||||
foreach $rfh (@ready_fds) {
|
||||
my $data;
|
||||
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
|
||||
$callback->($responses);
|
||||
}
|
||||
}
|
||||
yield; #Try to avoid useless iterations as much as possible
|
||||
return $rc;
|
||||
}
|
||||
|
||||
|
||||
=head3 query_pum
|
||||
|
||||
DESCRIPTION:
|
||||
@ -653,8 +765,8 @@ sub run_cim
|
||||
$http_params->{timeout} = 5;
|
||||
my ($ret, $value) = xCAT::CIMUtils->enum_instance($http_params, $cimargs);
|
||||
if ($ret->{rc}) {
|
||||
if ($ret->{msg} =~ /Couldn't connect to server/) {
|
||||
xCAT::MsgUtils->message("E", data => ["$node: Couldn not connect to server [$http_params->{ip}]."], $callback);
|
||||
if ($ret->{msg} =~ /(Couldn't connect to server)|(Can't connect to)/) {
|
||||
xCAT::MsgUtils->message("E", {data => ["$node: Couldn't connect to server [$http_params->{ip}]."]}, $callback);
|
||||
return 10;
|
||||
} else {
|
||||
xCAT::MsgUtils->message("E", {data => ["$node: $ret->{msg}"]}, $callback);
|
||||
|
@ -122,7 +122,7 @@ sub handled_commands{
|
||||
return {
|
||||
copycd => 'esx',
|
||||
mknetboot => "nodetype:os=(esxi.*)",
|
||||
mkinstall => "nodetype:os=(esxi5.*)",
|
||||
mkinstall => "nodetype:os=(esxi[56].*)",
|
||||
rpower => 'nodehm:power,mgt',
|
||||
esxiready => "esx",
|
||||
rsetboot => 'nodehm:power,mgt',
|
||||
@ -4550,7 +4550,7 @@ sub copycd {
|
||||
# let everyone read it
|
||||
#chdir "/tmp";
|
||||
chmod 0755, "$installroot/$distname/$arch";
|
||||
if ($distname =~ /esxi5/) { #going to tweak boot.cfg for install and default stateless case
|
||||
if ($distname =~ /esxi[56]/) { #going to tweak boot.cfg for install and default stateless case
|
||||
if (! -r "$installroot/$distname/$arch/boot.cfg.stateless") {
|
||||
copy("$installroot/$distname/$arch/boot.cfg","$installroot/$distname/$arch/boot.cfg.stateless");
|
||||
my $bootcfg;
|
||||
@ -4644,7 +4644,7 @@ sub makecustomizedmod {
|
||||
my @otherusers = qw/nobody nfsnobody dcui daemon/;
|
||||
if ($osver =~ /esxi4/) {
|
||||
push @otherusers,"vimuser";
|
||||
} elsif ($osver =~ /esxi5/) {
|
||||
} elsif ($osver =~ /esxi[56]/) {
|
||||
push @otherusers,"vpxuser";
|
||||
}
|
||||
print $shadow "root:$password:$dayssince1970:0:99999:7:::\n";
|
||||
@ -4656,18 +4656,18 @@ sub makecustomizedmod {
|
||||
if ($osver =~ /esxi4/ and -e "$::XCATROOT/share/xcat/netboot/esxi/38.xcat-enableipv6") {
|
||||
mkpath($tempdir."/etc/vmware/init/init.d");
|
||||
copy( "$::XCATROOT/share/xcat/netboot/esxi/38.xcat-enableipv6",$tempdir."/etc/vmware/init/init.d/38.xcat-enableipv6");
|
||||
} elsif ($osver =~ /esxi5/ and -e "$::XCATROOT/share/xcat/netboot/esxi/xcat-ipv6.json") {
|
||||
} elsif ($osver =~ /esxi[56]/ and -e "$::XCATROOT/share/xcat/netboot/esxi/xcat-ipv6.json") {
|
||||
mkpath($tempdir."/usr/libexec/jumpstart/plugins/");
|
||||
copy( "$::XCATROOT/share/xcat/netboot/esxi/xcat-ipv6.json",$tempdir."/usr/libexec/jumpstart/plugins/xcat-ipv6.json");
|
||||
}
|
||||
if ($osver =~ /esxi4/ and -e "$::XCATROOT/share/xcat/netboot/esxi/47.xcat-networking") {
|
||||
copy( "$::XCATROOT/share/xcat/netboot/esxi/47.xcat-networking",$tempdir."/etc/vmware/init/init.d/47.xcat-networking");
|
||||
} elsif ($osver =~ /esxi5/ and -e "$::XCATROOT/share/xcat/netboot/esxi/39.ipv6fixup") {
|
||||
} elsif ($osver =~ /esxi[56]/ and -e "$::XCATROOT/share/xcat/netboot/esxi/39.ipv6fixup") {
|
||||
mkpath($tempdir."/etc/init.d");
|
||||
copy( "$::XCATROOT/share/xcat/netboot/esxi/39.ipv6fixup",$tempdir."/etc/init.d/39.ipv6fixup");
|
||||
chmod(0755,"$tempdir/etc/init.d/39.ipv6fixup");
|
||||
}
|
||||
if ($osver =~ /esxi5/ and -e "$::XCATROOT/share/xcat/netboot/esxi/48.esxifixup") {
|
||||
if ($osver =~ /esxi[56]/ and -e "$::XCATROOT/share/xcat/netboot/esxi/48.esxifixup") {
|
||||
mkpath($tempdir."/etc/init.d");
|
||||
copy( "$::XCATROOT/share/xcat/netboot/esxi/48.esxifixup",$tempdir."/etc/init.d/48.esxifixup");
|
||||
chmod(0755,"$tempdir/etc/init.d/48.esxifixup");
|
||||
@ -5105,7 +5105,7 @@ sub cpNetbootImages {
|
||||
}
|
||||
}
|
||||
|
||||
}elsif ($osver =~ /esxi5/) { #we need boot.cfg.stateles
|
||||
}elsif ($osver =~ /esxi[56]/) { #we need boot.cfg.stateles
|
||||
my @filestocopy = ("boot.cfg.$bootmode");
|
||||
if (-r "$srcDir/boot.cfg.$bootmode" or -r "$overridedir/boot.cfg.$bootmode") {
|
||||
@filestocopy = ("boot.cfg.$bootmode");
|
||||
|
@ -168,12 +168,36 @@ sub process_request {
|
||||
return 1;
|
||||
}
|
||||
$pkglist = $ref_linuximage_tab->{'pkglist'};
|
||||
if ($pkglist ne "") {
|
||||
foreach my $file (split ',', $pkglist) {
|
||||
if (! -r $file) {
|
||||
$callback->({error=>["The pkglist specified \'$file\' does not exist!"],errorcode=>[1]});
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$srcdir = $ref_linuximage_tab->{'pkgdir'};
|
||||
|
||||
$srcdir_otherpkgs = $ref_linuximage_tab->{'otherpkgdir'};
|
||||
$otherpkglist = $ref_linuximage_tab->{'otherpkglist'};
|
||||
if ($otherpkglist ne "") {
|
||||
foreach my $file (split ',', $otherpkglist) {
|
||||
if (! -r $file) {
|
||||
$callback->({error=>["The otherpkglist specified \'$file\' does not exist!"],errorcode=>[1]});
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$postinstall_filename = $ref_linuximage_tab->{'postinstall'};
|
||||
if ($postinstall_filename ne "") {
|
||||
foreach my $file (split ',', $postinstall_filename) {
|
||||
if (! -r $file) {
|
||||
$callback->({error=>["The postinstall_filename specified \'$file\' does not exist!"],errorcode=>[1]});
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$destdir = $ref_linuximage_tab->{'rootimgdir'};
|
||||
$rootimg_dir = $ref_linuximage_tab->{'rootimgdir'};
|
||||
$driverupdatesrc = $ref_linuximage_tab->{'driverupdatesrc'};
|
||||
|
@ -201,7 +201,7 @@ sub geninitrd {
|
||||
return;
|
||||
}
|
||||
} elsif ($arch =~ /ppc/) {
|
||||
if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(rh.*)|(fedora.*)|(SL.*)/) {
|
||||
if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(rh.*)|(fedora.*)|(SL.*)|(pkvm.*)/) {
|
||||
$kernelpath = "$tftppath/vmlinuz";
|
||||
copy("$pkgdir/ppc/ppc64/vmlinuz", $kernelpath);
|
||||
if (-r "$pkgdir/ppc/ppc64/ramdisk.image.gz") {
|
||||
|
@ -132,17 +132,29 @@ sub setstate {
|
||||
$kern->{kcmdline} =~ s/!myipfn!/$ipfn/g;
|
||||
}
|
||||
}
|
||||
|
||||
my $addkcmdline;
|
||||
if ($kern->{addkcmdline}) {
|
||||
$kern->{kcmdline} .= " ".$kern->{addkcmdline};
|
||||
$addkcmdline .= $kern->{addkcmdline}." ";
|
||||
}
|
||||
|
||||
if($linuximghash and $linuximghash->{'addkcmdline'})
|
||||
{
|
||||
unless($linuximghash->{'boottarget'})
|
||||
{
|
||||
$kern->{kcmdline} .= " ".$linuximghash->{'addkcmdline'};
|
||||
$addkcmdline .= $linuximghash->{'addkcmdline'}." ";
|
||||
}
|
||||
}
|
||||
|
||||
my $cmdhashref;
|
||||
if($addkcmdline){
|
||||
$cmdhashref=xCAT::Utils->splitkcmdline($addkcmdline);
|
||||
}
|
||||
|
||||
if($cmdhashref and $cmdhashref->{volatile})
|
||||
{
|
||||
$kern->{kcmdline}.=" ".$cmdhashref->{volatile};
|
||||
}
|
||||
|
||||
my $pcfg;
|
||||
unless (-d "$tftpdir/boot/grub2") {
|
||||
|
@ -26,6 +26,7 @@ use xCAT::TableUtils;
|
||||
use xCAT::IMMUtils;
|
||||
use xCAT::ServiceNodeUtils;
|
||||
use xCAT::SvrUtils;
|
||||
use xCAT::NetworkUtils;
|
||||
use xCAT::Usage;
|
||||
use Thread qw(yield);
|
||||
use LWP 5.64;
|
||||
@ -1229,6 +1230,8 @@ sub getrvidparms_imm2 {
|
||||
return;
|
||||
}
|
||||
my $host = $sessdata->{ipmisession}->{bmc};
|
||||
my $hostname;
|
||||
($hostname, $host) = xCAT::NetworkUtils->gethostnameandip($host);
|
||||
my $ip6mode=0;
|
||||
if ($host =~ /:/) { $ip6mode=1; $host = "[".$host."]"; }
|
||||
my $message = "user=".$sessdata->{ipmisession}->{userid}."&password=".$sessdata->{ipmisession}->{password}."&SessionTimeout=1200";
|
||||
@ -1252,15 +1255,15 @@ sub getrvidparms_imm2 {
|
||||
$response = $browser->request(GET $baseurl."data/logout");
|
||||
return;
|
||||
}
|
||||
$response = $browser->request(GET $baseurl."designs/imm/viewer(".$sessdata->{ipmisession}->{bmc}.'@'.$ip6mode.'@'.time().'@1@0@1@jnlp)');
|
||||
$response = $browser->request(GET $baseurl."designs/imm/viewer(".$host.'@'.$ip6mode.'@'.time().'@1@0@1@jnlp)');
|
||||
#arguments are host, then ipv6 or not, then timestamp, then whether to encrypte or not, singleusermode, finally 'notwin32'
|
||||
my $jnlp = $response->content;
|
||||
unless ($jnlp) { #ok, might be the newer syntax...
|
||||
$response = $browser->request(GET $baseurl."designs/imm/viewer(".$sessdata->{ipmisession}->{bmc}.'@'.$httpport.'@'.$ip6mode.'@'.time().'@1@0@1@jnlp'.'@USERID@0@0@0@0'.')');
|
||||
$response = $browser->request(GET $baseurl."designs/imm/viewer(".$host.'@'.$httpport.'@'.$ip6mode.'@'.time().'@1@0@1@jnlp'.'@USERID@0@0@0@0'.')');
|
||||
#arguments are host, then ipv6 or not, then timestamp, then whether to encrypte or not, singleusermode, finally 'notwin32'
|
||||
$jnlp = $response->content;
|
||||
if ($jnlp =~ /Failed to parse ip format for request/) {
|
||||
$response = $browser->request(GET $baseurl."designs/imm/viewer(".$sessdata->{ipmisession}->{bmc}.'@'.$httpport.'@'.$ip6mode.'@'.time().'@1@0@1@jnlp'.'@USERID@0@0@0@0@0'.')');
|
||||
$response = $browser->request(GET $baseurl."designs/imm/viewer(".$host.'@'.$httpport.'@'.$ip6mode.'@'.time().'@1@0@1@jnlp'.'@USERID@0@0@0@0@0'.')');
|
||||
#arguments are host, then ipv6 or not, then timestamp, then whether to encrypte or not, singleusermode, 'notwin32', and one more (unknown)
|
||||
$jnlp = $response->content;
|
||||
}
|
||||
@ -2574,31 +2577,41 @@ sub initfru_zero {
|
||||
$sessdata->{genhwfru} = [];
|
||||
foreach $key (sort {$sdr_hash{$a}->id_string cmp $sdr_hash{$b}->id_string} keys %sdr_hash) {
|
||||
my $sdr = $sdr_hash{$key};
|
||||
unless ($sdr->rec_type == 0x11 and $sdr->fru_type == 0x10) { #skip non fru sdr stuff and frus I don't understand
|
||||
unless ($sdr->rec_type == 0x11) { #skip non fru sdr stuff
|
||||
next;
|
||||
}
|
||||
|
||||
if ($sdr->fru_type == 0x10) { #supported
|
||||
if ($sdr->fru_subtype == 0x1) { #DIMM
|
||||
push @{$sessdata->{dimmfru}},$sdr;
|
||||
} elsif ($sdr->fru_subtype == 0 or $sdr->fru_subtype == 2) {
|
||||
push @{$sessdata->{genhwfru}},$sdr;
|
||||
}
|
||||
if ($sdr->fru_subtype == 0x1) { #DIMM
|
||||
push @{$sessdata->{dimmfru}},$sdr;
|
||||
} elsif ($sdr->fru_subtype == 0 or $sdr->fru_subtype == 2) {
|
||||
push @{$sessdata->{genhwfru}},$sdr;
|
||||
}
|
||||
}
|
||||
if (scalar @{$sessdata->{dimmfru}}) {
|
||||
$sessdata->{currfrusdr} = shift @{$sessdata->{dimmfru}};
|
||||
$sessdata->{currfruid} = $sessdata->{currfrusdr}->sensor_number;
|
||||
$sessdata->{currfrutype}="dimm";
|
||||
$sessdata->{ipmisession}->subcmd(netfn=>0xa,command=>0x10,data=>[$sessdata->{currfruid}],callback=>\&process_currfruid,callback_args=>$sessdata);
|
||||
} elsif (scalar @{$sessdata->{genhwfru}}) {
|
||||
$sessdata->{currfrusdr} = shift @{$sessdata->{genhwfru}};
|
||||
$sessdata->{currfruid} = $sessdata->{currfrusdr}->sensor_number;
|
||||
$sessdata->{currfrutype}="genhw";
|
||||
$sessdata->{ipmisession}->subcmd(netfn=>0xa,command=>0x10,data=>[$sessdata->{currfruid}],callback=>\&process_currfruid,callback_args=>$sessdata);
|
||||
} else {
|
||||
fru_initted($sessdata);
|
||||
while ($sessdata->{currfrusdr}->sensor_number == 0 and scalar @{$sessdata->{dimmfru}}) {
|
||||
$sessdata->{currfrusdr} = shift @{$sessdata->{dimmfru}};
|
||||
}
|
||||
if ($sessdata->{currfrusdr}->sensor_number !=0) {
|
||||
$sessdata->{currfruid} = $sessdata->{currfrusdr}->sensor_number;
|
||||
$sessdata->{currfrutype}="dimm";
|
||||
$sessdata->{ipmisession}->subcmd(netfn=>0xa,command=>0x10,data=>[$sessdata->{currfruid}],callback=>\&process_currfruid,callback_args=>$sessdata);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (scalar @{$sessdata->{genhwfru}}) {
|
||||
$sessdata->{currfrusdr} = shift @{$sessdata->{genhwfru}};
|
||||
while ($sessdata->{currfrusdr}->sensor_number == 0 and scalar @{$sessdata->{genhwfru}}) {
|
||||
$sessdata->{currfrusdr} = shift @{$sessdata->{genhwfru}};
|
||||
}
|
||||
if ($sessdata->{currfrusdr}->sensor_number !=0) {
|
||||
$sessdata->{currfruid} = $sessdata->{currfrusdr}->sensor_number;
|
||||
$sessdata->{currfrutype}="genhw";
|
||||
$sessdata->{ipmisession}->subcmd(netfn=>0xa,command=>0x10,data=>[$sessdata->{currfruid}],callback=>\&process_currfruid,callback_args=>$sessdata);
|
||||
return;
|
||||
}
|
||||
}
|
||||
fru_initted($sessdata);
|
||||
}
|
||||
sub get_frusize {
|
||||
my $fruid=shift;
|
||||
@ -2865,17 +2878,29 @@ sub add_fruhash {
|
||||
}
|
||||
if (scalar @{$sessdata->{dimmfru}}) {
|
||||
$sessdata->{currfrusdr} = shift @{$sessdata->{dimmfru}};
|
||||
$sessdata->{currfruid} = $sessdata->{currfrusdr}->sensor_number;
|
||||
$sessdata->{currfrutype}="dimm";
|
||||
$sessdata->{ipmisession}->subcmd(netfn=>0xa,command=>0x10,data=>[$sessdata->{currfruid}],callback=>\&process_currfruid,callback_args=>$sessdata);
|
||||
} elsif (scalar @{$sessdata->{genhwfru}}) {
|
||||
$sessdata->{currfrusdr} = shift @{$sessdata->{genhwfru}};
|
||||
$sessdata->{currfruid} = $sessdata->{currfrusdr}->sensor_number;
|
||||
$sessdata->{currfrutype}="genhw";
|
||||
$sessdata->{ipmisession}->subcmd(netfn=>0xa,command=>0x10,data=>[$sessdata->{currfruid}],callback=>\&process_currfruid,callback_args=>$sessdata);
|
||||
} else {
|
||||
fru_initted($sessdata);
|
||||
while ($sessdata->{currfrusdr}->sensor_number == 0 and scalar @{$sessdata->{dimmfru}}) {
|
||||
$sessdata->{currfrusdr} = shift @{$sessdata->{dimmfru}};
|
||||
}
|
||||
if ($sessdata->{currfrusdr}->sensor_number != 0) {
|
||||
$sessdata->{currfruid} = $sessdata->{currfrusdr}->sensor_number;
|
||||
$sessdata->{currfrutype}="dimm";
|
||||
$sessdata->{ipmisession}->subcmd(netfn=>0xa,command=>0x10,data=>[$sessdata->{currfruid}],callback=>\&process_currfruid,callback_args=>$sessdata);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (scalar @{$sessdata->{genhwfru}}) {
|
||||
$sessdata->{currfrusdr} = shift @{$sessdata->{genhwfru}};
|
||||
while ($sessdata->{currfrusdr}->sensor_number == 0 and scalar @{$sessdata->{genhwfru}}) {
|
||||
$sessdata->{currfrusdr} = shift @{$sessdata->{genhwfru}};
|
||||
}
|
||||
if ($sessdata->{currfrusdr}->sensor_number != 0) {
|
||||
$sessdata->{currfruid} = $sessdata->{currfrusdr}->sensor_number;
|
||||
$sessdata->{currfrutype}="genhw";
|
||||
$sessdata->{ipmisession}->subcmd(netfn=>0xa,command=>0x10,data=>[$sessdata->{currfruid}],callback=>\&process_currfruid,callback_args=>$sessdata);
|
||||
return;
|
||||
}
|
||||
}
|
||||
fru_initted($sessdata);
|
||||
}
|
||||
|
||||
sub readcurrfrudevice {
|
||||
@ -3076,8 +3101,15 @@ sub parsefru {
|
||||
return "unknown-COULDGUESS",undef;
|
||||
}
|
||||
$currsize=($bytes->[$curridx+1])*8;
|
||||
# some systems have malformed board info
|
||||
# Just in case, give the board area parser access to end
|
||||
# of total area unless product or multirecord is there
|
||||
my $endidx = $#{$bytes};
|
||||
if ($bytes->[4] or $bytes->[5]) {
|
||||
$endidx = $curridx + $currsize - 1;
|
||||
}
|
||||
if ($currsize > 0) {
|
||||
@currarea=@{$bytes}[$curridx..($curridx+$currsize-1)];
|
||||
@currarea=@{$bytes}[$curridx..$endidx];
|
||||
$fruhash->{board} = parseboard(@currarea);
|
||||
}
|
||||
}
|
||||
|
@ -1346,16 +1346,16 @@ sub addkit
|
||||
} else {
|
||||
$rc = system("cp -rf $kitdir/other_files/$_ $installdir/postscripts/");
|
||||
}
|
||||
if($rc && !-e "$installdir/postscripts/$_"){
|
||||
my %rsp;
|
||||
push@{ $rsp{data} }, "Failed to copy scripts from $kitdir/scripts/ to $installdir/postscripts";
|
||||
xCAT::MsgUtils->message( "E", \%rsp, $callback );
|
||||
return 1;
|
||||
}
|
||||
$rc = 0;
|
||||
chmod(0755,"$installdir/postscripts/$_");
|
||||
}
|
||||
|
||||
if($rc){
|
||||
my %rsp;
|
||||
push@{ $rsp{data} }, "Failed to copy scripts from $kitdir/scripts/ to $installdir/postscripts";
|
||||
xCAT::MsgUtils->message( "E", \%rsp, $callback );
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Copying plugins to /opt/xcat/lib/perl/xCAT_plugin/
|
||||
if ( -d "$kitdir/plugins/" ) {
|
||||
|
||||
@ -2748,9 +2748,13 @@ sub rmkitcomp
|
||||
my %newosikitcomponents;
|
||||
foreach my $allosikitcomp (@allosikitcomps) {
|
||||
if ( $allosikitcomp->{kitcomponents} and $allosikitcomp->{imagename} ) {
|
||||
(my $allosiotherpkgdir) = $tabs{linuximage}->getAttribs({imagename=> $allosikitcomp->{imagename}}, 'otherpkgdir');
|
||||
|
||||
my @allkitcomps = split /,/, $allosikitcomp->{kitcomponents};
|
||||
foreach my $allkitcomp ( @allkitcomps ) {
|
||||
if ( $allosikitcomp->{imagename} ne $osimage or $allkitcomp ne $kitcomponent ) {
|
||||
if ( (($allosikitcomp->{imagename} ne $osimage) and
|
||||
($allosiotherpkgdir->{otherpkgdir} eq $otherpkgdir))
|
||||
or ($allkitcomp ne $kitcomponent) ) {
|
||||
$newosikitcomponents{$allkitcomp} = 1;
|
||||
}
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ sub set_sources {
|
||||
my @kernel_rpms = ();
|
||||
if ($ou_entry->{'basename'} =~ /^ubuntu/)
|
||||
{
|
||||
@kernel_rpms = `find $dirpath/pool/main/l/linux/ -name *.deb`;
|
||||
@kernel_rpms = `find $dirpath/pool/main/l/linux/ -name *deb`;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -511,7 +511,7 @@ sub set_sources {
|
||||
my @kernel_rpms = ();
|
||||
if ($od_entry->{'basename'} =~ /ubuntu/)
|
||||
{
|
||||
@kernel_rpms = `find $dirpath/pool/main/l/linux/ -name *.deb`;
|
||||
@kernel_rpms = `find $dirpath/pool/main/l/linux/ -name *deb`;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -532,7 +532,7 @@ sub set_sources {
|
||||
my @kernel_rpms = ();
|
||||
if ($od_entry->{'basename'} =~ /ubuntu/)
|
||||
{
|
||||
@kernel_rpms = `find $dirpath/pool/main/l/linux/ -name *.deb`;
|
||||
@kernel_rpms = `find $dirpath/pool/main/l/linux/ -name *deb`;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2573,7 +2573,7 @@ sub adopt {
|
||||
if ($confdata->{vm}->{$node}->[0]->{memory}) {
|
||||
$addmemory{$target}+=getUnits($confdata->{vm}->{$node}->[0]->{memory},"M",1024);
|
||||
} else {
|
||||
$addmemory{$target}+=getUnits("512","M",1024);
|
||||
$addmemory{$target}+=getUnits("4096","M",1024);
|
||||
}
|
||||
$hyphash{$target}->{nodes}->{$node}=1;
|
||||
delete $orphash->{$node};
|
||||
|
@ -194,6 +194,9 @@ sub process_request {
|
||||
unless ($nent and $nent->{supportedarchs} eq $request->{arch}->[0] and $nent->{arch} eq $request->{arch}->[0]) {
|
||||
$typetab->setNodeAttribs($node,{arch=>$request->{arch}->[0],supportedarchs=>$request->{arch}->[0]});
|
||||
}
|
||||
if ($request->{arch}->[0] =~ /ppc/ and $request->{platform}->[0] =~ /PowerNV/) {
|
||||
$typetab->setNodeAttribs($node,{nodetype=>'mp'});
|
||||
}
|
||||
}
|
||||
my $currboot='';
|
||||
$nrtab = xCAT::Table->new('noderes'); #Attempt to check and set if wrong the netboot method on discovery, if admin omitted
|
||||
|
@ -641,9 +641,9 @@ sub process_request_nmap {
|
||||
|
||||
foreach my $ip6 (0,1) { #first pass, ipv4, second pass ipv6
|
||||
if ($ip6 and scalar(@ip6s)) {
|
||||
open($fping,"nmap -6 -PS$ports,3001 -n --send-ip -p $ports,3001 $more_options ".join(' ',@ip6s). " 2> /dev/null|") or die("Can't start nmap: $!");
|
||||
open($fping,"nmap --unprivileged -6 -PS$ports,3001 -n --send-ip -p $ports,3001 $more_options ".join(' ',@ip6s). " 2> /dev/null|") or die("Can't start nmap: $!");
|
||||
} elsif (not $ip6 and scalar(@ips)) {
|
||||
open($fping,"nmap -PE -n --send-ip -p $ports,3001 $more_options ".join(' ',@ips). " 2> /dev/null|") or die("Can't start nmap: $!");
|
||||
open($fping,"nmap --unprivileged -PE -n --send-ip -p $ports,3001 $more_options ".join(' ',@ips). " 2> /dev/null|") or die("Can't start nmap: $!");
|
||||
} else { next; }
|
||||
while (<$fping>) {
|
||||
if (/Interesting ports on ([^ ]*)[: ]/ or /Nmap scan report for ([^ ]*)/) {
|
||||
|
@ -402,6 +402,13 @@ sub process_request {
|
||||
}
|
||||
if ($errored) { return; }
|
||||
|
||||
# Fix the bug 4611: PowerNV stateful CN provision will hang at reboot stage#
|
||||
if ($args[0] eq 'next') {
|
||||
$sub_req->({command=>['rsetboot'],
|
||||
node=>\@nodes,
|
||||
arg=>['default']});
|
||||
xCAT::MsgUtils->message("S", "xCAT: petitboot netboot: clear node(s): @nodes boot device setting.");
|
||||
}
|
||||
my $bptab=xCAT::Table->new('bootparams',-create=>1);
|
||||
my $bphash = $bptab->getNodesAttribs(\@nodes,['kernel','initrd','kcmdline','addkcmdline']);
|
||||
my $chaintab=xCAT::Table->new('chain',-create=>1);
|
||||
|
@ -471,6 +471,7 @@ Usage:
|
||||
|
||||
my $mac_addr_mode = 0;
|
||||
my $switch_mode = 0;
|
||||
my $powerkvm_mode = 0;
|
||||
# Parse and validate the hostinfo string. The real hostnames will be generated here.
|
||||
xCAT::MsgUtils->message('S', "Parsing hostinfo string and validate it.");
|
||||
my ($hostinfo_dict_ref, $invalid_records_ref) = validate_node_entries();
|
||||
@ -499,6 +500,10 @@ Usage:
|
||||
{
|
||||
$switch_mode = 1;
|
||||
}
|
||||
if(defined($hostinfo_dict{$mynode}{'vmhost'}))
|
||||
{
|
||||
$powerkvm_mode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# cannot mix switch discovery with mac import
|
||||
@ -535,6 +540,20 @@ Usage:
|
||||
$warnstr = "Warning: failed to import some nodes.";
|
||||
setrsp_progress($warnstr);
|
||||
}
|
||||
|
||||
# create default uuid for PowerKVM nodes
|
||||
if ($powerkvm_mode) {
|
||||
my $vpdtab = xCAT::Table->new( 'vpd', -create=>1, -autocommit=>0 );
|
||||
foreach (@nodelist) {
|
||||
my $keyhash;
|
||||
my $updatehash;
|
||||
$keyhash->{'node'} = $_;
|
||||
$updatehash->{'uuid'} = '00000000-0000-0000-0000-000000000000';
|
||||
$vpdtab->setAttribs($keyhash, $updatehash);
|
||||
}
|
||||
$vpdtab->commit;
|
||||
}
|
||||
|
||||
# create switch, port, interface relationship.
|
||||
if($switch_mode){
|
||||
#debug message.
|
||||
@ -795,6 +814,8 @@ Usage:
|
||||
$nodecurrprofiles{'networkprofile'} = $group;
|
||||
}elsif ($group =~ /__HardwareProfile/){
|
||||
$nodecurrprofiles{'hardwareprofile'} = $group;
|
||||
}elsif ($group =~ /__Hypervisor/){
|
||||
next;
|
||||
}else{
|
||||
$nodecurrprofiles{'groups'} .= $group.",";
|
||||
}
|
||||
@ -839,6 +860,22 @@ Usage:
|
||||
if(exists $args_dict{'hardwareprofile'}){
|
||||
$hardwareprofile = $args_dict{'hardwareprofile'};
|
||||
}
|
||||
|
||||
# Verify whether this node is KVM hypervisor node
|
||||
my $is_kvm_hypv = xCAT::ProfiledNodeUtils->is_kvm_hypv_node($imageprofile);
|
||||
|
||||
# Get the netboot attribute for node
|
||||
my $new_netboot = undef;
|
||||
my $latestimgproflie = $imageprofile?$imageprofile:$nodeoldprofiles{'imageprofile'};
|
||||
my $latesthardwareprofile = $hardwareprofile?$hardwareprofile:$nodeoldprofiles{'hardwareprofile'};
|
||||
if ($latestimgproflie){
|
||||
my ($retcode, $retval) = xCAT::ProfiledNodeUtils->get_netboot_attr( $latestimgproflie, $latesthardwareprofile);
|
||||
if (not $retcode) {
|
||||
setrsp_errormsg($retval);
|
||||
return;
|
||||
}
|
||||
$new_netboot = $retval;
|
||||
}
|
||||
|
||||
# After checking, all nodes' profile should be same
|
||||
# Get the new profile with specified ones in args_dict
|
||||
@ -853,7 +890,10 @@ Usage:
|
||||
xCAT::MsgUtils->message('S', "Specified networkprofile is same with current value, ignore.");
|
||||
$networkprofile = undef;
|
||||
}
|
||||
}else{
|
||||
$profile_groups .= $nodeoldprofiles{'networkprofile'}.",";
|
||||
}
|
||||
|
||||
if($hardwareprofile){
|
||||
$profile_groups .= $hardwareprofile . ",";
|
||||
if ($hardwareprofile ne $nodeoldprofiles{'hardwareprofile'}){
|
||||
@ -863,7 +903,12 @@ Usage:
|
||||
xCAT::MsgUtils->message('S', "Specified hardwareprofile is same with current value, ignore.");
|
||||
$hardwareprofile = undef;
|
||||
}
|
||||
}else{
|
||||
if($nodeoldprofiles{'hardwareprofile'}){
|
||||
$profile_groups .= $nodeoldprofiles{'hardwareprofile'}.",";
|
||||
}
|
||||
}
|
||||
|
||||
if($imageprofile){
|
||||
$profile_groups .= $imageprofile . ",";
|
||||
if ($imageprofile ne $nodeoldprofiles{'imageprofile'}){
|
||||
@ -873,23 +918,24 @@ Usage:
|
||||
xCAT::MsgUtils->message('S', "Specified imageprofile is same with current value, ignore.");
|
||||
$imageprofile = undef;
|
||||
}
|
||||
}else{
|
||||
$profile_groups .= $nodeoldprofiles{'imageprofile'}.",";
|
||||
}
|
||||
# make sure there are something changed, otherwise we should quit without any changes.
|
||||
unless ($changeflag){
|
||||
setrsp_infostr("Warning: no profile changes detect.");
|
||||
return;
|
||||
}
|
||||
# Get the netboot attribute for node
|
||||
my ($retcode, $retval) = xCAT::ProfiledNodeUtils->get_netboot_attr($imageprofile, $hardwareprofile);
|
||||
if (not $retcode) {
|
||||
setrsp_errormsg($retval);
|
||||
return;
|
||||
}
|
||||
my $new_netboot = $retval;
|
||||
|
||||
# Update nodes' attributes
|
||||
foreach (@$nodes) {
|
||||
$updatenodeshash{$_}{'groups'} .= $profile_groups;
|
||||
$updatenodereshash{$_}{'netboot'} = $new_netboot;
|
||||
if ($is_kvm_hypv) {
|
||||
$updatenodeshash{$_}{'groups'} .= ",__Hypervisor_kvm";
|
||||
}
|
||||
if($new_netboot){
|
||||
$updatenodereshash{$_}{'netboot'} = $new_netboot;
|
||||
}
|
||||
}
|
||||
|
||||
#update DataBase.
|
||||
@ -2009,6 +2055,9 @@ sub gen_new_hostinfo_dict{
|
||||
# Check whether this is Power env.
|
||||
my $is_fsp = xCAT::ProfiledNodeUtils->is_fsp_node($args_dict{'networkprofile'});
|
||||
|
||||
# Check whether this node is PowerKVM Hypervisor node
|
||||
my $is_kvm_hypv = xCAT::ProfiledNodeUtils->is_kvm_hypv_node($args_dict{'imageprofile'});
|
||||
|
||||
foreach my $item (sort(keys %hostinfo_dict)){
|
||||
# Set Nodes's type:
|
||||
$hostinfo_dict{$item}{"objtype"} = 'node';
|
||||
@ -2106,6 +2155,7 @@ sub gen_new_hostinfo_dict{
|
||||
if (exists $args_dict{'imageprofile'}){$hostinfo_dict{$item}{"groups"} .= ",".$args_dict{'imageprofile'}}
|
||||
if (exists $args_dict{'hardwareprofile'}){$hostinfo_dict{$item}{"groups"} .= ",".$args_dict{'hardwareprofile'}}
|
||||
if (exists $args_dict{'groups'}){$hostinfo_dict{$item}{"groups"} .= ",".$args_dict{'groups'}}
|
||||
if ($is_kvm_hypv) {$hostinfo_dict{$item}{"groups"} .= ",__Hypervisor_kvm"}
|
||||
|
||||
# xCAT limitation: slotid attribute only for power, id is for x.
|
||||
if ((exists $hostinfo_dict{$item}{"slotid"}) && (! $is_fsp) ){
|
||||
@ -2418,11 +2468,18 @@ sub validate_node_entry{
|
||||
# validate if node use FSP network
|
||||
my $is_fsp = xCAT::ProfiledNodeUtils->is_fsp_node($args_dict{'networkprofile'});
|
||||
|
||||
# Check whether this node is a KVM node
|
||||
my $is_kvm = xCAT::ProfiledNodeUtils->is_kvm_node($args_dict{'hardwareprofile'});
|
||||
if (not $node_entry{'vmhost'} and $is_kvm) {
|
||||
# Using kvm hardware profile but not define vmhost in nodeinfo file
|
||||
$errmsg .= "No vmhost specified. Specify a vmhost and set it to the node information file if you are using the default IBM_PowerKVM_Guest hardware profile.\n";
|
||||
}
|
||||
|
||||
# validate each single value.
|
||||
foreach (keys %node_entry){
|
||||
if ($_ eq "mac"){
|
||||
if (exists $allmacsupper{uc($node_entry{$_})}){
|
||||
$errmsg .= "MAC address $node_entry{$_} already exists in the database or in the nodeinfo file. You must use a new MAC address.\n";
|
||||
$errmsg .= "MAC address $node_entry{$_} already exists in the database or in the node information file. You must use a new MAC address.\n";
|
||||
}elsif(! xCAT::NetworkUtils->isValidMAC($node_entry{$_})){
|
||||
$errmsg .= "MAC address $node_entry{$_} is invalid. You must use a valid MAC address.\n";
|
||||
}else{
|
||||
@ -2431,7 +2488,7 @@ sub validate_node_entry{
|
||||
}
|
||||
}elsif ($_ eq "ip"){
|
||||
if (exists $allips{$node_entry{$_}}){
|
||||
$errmsg .= "IP address $node_entry{$_} already exists in the database or in the nodeinfo file.\n";
|
||||
$errmsg .= "IP address $node_entry{$_} already exists in the database or in the node information file.\n";
|
||||
}elsif((xCAT::NetworkUtils->validate_ip($node_entry{$_}))[0]->[0] ){
|
||||
$errmsg .= "IP address $node_entry{$_} is invalid. You must use a valid IP address.\n";
|
||||
}else {
|
||||
@ -2474,7 +2531,7 @@ sub validate_node_entry{
|
||||
# now, we need to check "swith_switchport" string list to avoid duplicate config
|
||||
my $switch_port = $spilist[1] . "_" . $spilist[2];
|
||||
if (exists $all_switchports{$switch_port}){
|
||||
$errmsg .= "Specified switch $spilist[1] and port $spilist[2] already exists in the database or in the nodeinfo file. You must use a new switch port.\n";
|
||||
$errmsg .= "Specified switch $spilist[1] and port $spilist[2] already exists in the database or in the node information file. You must use a new switch port.\n";
|
||||
}else{
|
||||
# after checking, add this one into all_switchports
|
||||
$all_switchports{$switch_port} = 0;
|
||||
@ -2550,7 +2607,7 @@ sub validate_node_entry{
|
||||
}
|
||||
|
||||
if (exists $alllparids{$cec_name}{$lpar_id}){
|
||||
$errmsg .= "The CEC name $cec_name and LPAR id $lpar_id already exist in the database or in the nodeinfo file. You must use a new CEC name and LPAR id.\n";
|
||||
$errmsg .= "The CEC name $cec_name and LPAR id $lpar_id already exist in the database or in the node information file. You must use a new CEC name and LPAR id.\n";
|
||||
}else{
|
||||
$alllparids{$cec_name}{$lpar_id} = 0;
|
||||
}
|
||||
@ -2565,7 +2622,7 @@ sub validate_node_entry{
|
||||
@nic_and_ips = split(/!/, $nic_ips);
|
||||
$nic_ip = $nic_and_ips[1];
|
||||
if (exists $allips{$nic_ip}){
|
||||
$errmsg .= "IP address $nic_ip already exists in the database or in the nodeinfo file.\n";
|
||||
$errmsg .= "IP address $nic_ip already exists in the database or in the node information file.\n";
|
||||
}elsif((xCAT::NetworkUtils->validate_ip($nic_ip))[0]->[0] ){
|
||||
$errmsg .= "IP address $nic_ip is invalid. You must use a valid IP address.\n";
|
||||
}else {
|
||||
@ -2577,8 +2634,13 @@ sub validate_node_entry{
|
||||
}elsif ($_ eq "vmhost") {
|
||||
# Support PowerKVM vms
|
||||
my $vm_host= $node_entry{"vmhost"};
|
||||
if (! exists $allvmhosts{$node_entry{$_}}){
|
||||
$errmsg .= "The VM host name $node_entry{$_} that is specified in the node information file is not defined in the system.\n";
|
||||
if (! exists $allvmhosts{$vm_host}){
|
||||
$errmsg .= "Specified vmhost '$vm_host' is not defined in the system. Specify a correct vmhost.\n";
|
||||
|
||||
}
|
||||
|
||||
if (not $is_kvm) {
|
||||
$errmsg .= "Incorrect vmhost '$vm_host' found in node information file. vmhost must be used together with the IBM_PowerKVM_Guest hardware profile\n";
|
||||
}
|
||||
}else{
|
||||
$errmsg .= "Invalid attribute $_ specified\n";
|
||||
@ -2606,7 +2668,7 @@ sub setrsp_invalidrecords
|
||||
my $rsp;
|
||||
|
||||
# The total number of invalid records.
|
||||
$rsp->{error} = ["Errors found in nodeinfo file"];
|
||||
$rsp->{error} = ["Errors found in node information file"];
|
||||
$rsp->{errorcode} = [2];
|
||||
$rsp->{invalid_records_num}->[0] = scalar @$recordsref;
|
||||
|
||||
|
@ -108,6 +108,16 @@ sub setstate {
|
||||
|
||||
my $kcmdlinehack = ($imgaddkcmdline)?$kern->{addkcmdline}." ".$imgaddkcmdline : $kern->{addkcmdline};
|
||||
|
||||
my $cmdhashref;
|
||||
if($kcmdlinehack){
|
||||
$cmdhashref=xCAT::Utils->splitkcmdline($kcmdlinehack);
|
||||
}
|
||||
|
||||
if($cmdhashref and $cmdhashref->{volatile})
|
||||
{
|
||||
$kcmdlinehack=$cmdhashref->{volatile};
|
||||
}
|
||||
|
||||
|
||||
while ($kcmdlinehack =~ /#NODEATTRIB:([^:#]+):([^:#]+)#/) {
|
||||
my $natab = xCAT::Table->new($1);
|
||||
|
@ -1621,10 +1621,17 @@ sub copycd
|
||||
);
|
||||
unless ($mntpath)
|
||||
{
|
||||
|
||||
#this plugin needs $mntpath...
|
||||
# $mntpath needs to be specified for this plugin
|
||||
return;
|
||||
}
|
||||
|
||||
if ($path) {
|
||||
# if path if specified, clean up removing trailing slash...
|
||||
$path =~ s/\/$//;
|
||||
# and multiple slashes
|
||||
$path =~ s,//*,/,g;
|
||||
}
|
||||
|
||||
if ($distname and $distname !~ /^sles|^suse/)
|
||||
{
|
||||
|
||||
|
@ -119,6 +119,17 @@ sub setstate {
|
||||
|
||||
my $kcmdlinehack = ($imgaddkcmdline)?$kern->{addkcmdline}." ".$imgaddkcmdline : $kern->{addkcmdline};
|
||||
|
||||
my $cmdhashref;
|
||||
if($kcmdlinehack){
|
||||
$cmdhashref=xCAT::Utils->splitkcmdline($kcmdlinehack);
|
||||
}
|
||||
|
||||
if($cmdhashref and $cmdhashref->{volatile})
|
||||
{
|
||||
$kcmdlinehack=$cmdhashref->{volatile};
|
||||
}
|
||||
|
||||
|
||||
while ($kcmdlinehack =~ /#NODEATTRIB:([^:#]+):([^:#]+)#/) {
|
||||
my $natab = xCAT::Table->new($1);
|
||||
my $naent = $natab->getNodeAttribs($node,[$2]);
|
||||
|
@ -127,18 +127,32 @@ sub setstate {
|
||||
$kern->{kcmdline} =~ s/!myipfn!/$ipfn/g;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $addkcmdline;
|
||||
if ($kern->{addkcmdline}) {
|
||||
$kern->{kcmdline} .= " ".$kern->{addkcmdline};
|
||||
$addkcmdline .= $kern->{addkcmdline}." ";
|
||||
}
|
||||
|
||||
|
||||
if($linuximghash and $linuximghash->{'addkcmdline'})
|
||||
{
|
||||
unless($linuximghash->{'boottarget'})
|
||||
unless($linuximghash->{'boottarget'})
|
||||
{
|
||||
$kern->{kcmdline} .= " ".$linuximghash->{'addkcmdline'};
|
||||
}
|
||||
$addkcmdline .= $linuximghash->{'addkcmdline'}." ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
my $cmdhashref;
|
||||
if($addkcmdline){
|
||||
$cmdhashref=xCAT::Utils->splitkcmdline($addkcmdline);
|
||||
}
|
||||
|
||||
if($cmdhashref and $cmdhashref->{volatile})
|
||||
{
|
||||
$kern->{kcmdline}.=" ".$cmdhashref->{volatile};
|
||||
}
|
||||
|
||||
|
||||
my $pcfg;
|
||||
unless (-d "$tftpdir/etc") {
|
||||
|
@ -153,9 +153,14 @@ else {
|
||||
#commit all the changes
|
||||
foreach (keys %tables) {
|
||||
if (exists($tableupdates{$_})) {
|
||||
$tables{$_}->setAttribs(\%keyhash,\%{$tableupdates{$_}});
|
||||
my $rc = $tables{$_}->setAttribs(\%keyhash,\%{$tableupdates{$_}});
|
||||
if ($rc) {
|
||||
$::exitcode = 1;
|
||||
}
|
||||
}
|
||||
$tables{$_}->commit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($::exitcode) {
|
||||
exit $::exitcode;
|
||||
}
|
||||
|
@ -2201,6 +2201,7 @@ sub get_request {
|
||||
$flags |= O_NONBLOCK; #we want sysread to bail on us, select seems to be evil to us still..
|
||||
fcntl($sock,F_SETFL,$flags);
|
||||
my $bytesread;
|
||||
if (!($line) ) { $line = ''; }
|
||||
do { $bytesread=sysread($sock,$line,65536,length($line)) } while ($bytesread);
|
||||
if (length($line)==0) {
|
||||
if (not defined $bytesread and ($! == EAGAIN or $! == ECHILD)) { next; } # ECHILD makes no sense, but some platform does it
|
||||
|
@ -75,7 +75,7 @@ key --skip
|
||||
# --useLilo
|
||||
# --md5pass <crypted MD5 password for GRUB>
|
||||
#
|
||||
bootloader
|
||||
#KICKSTARTBOOTLOADER#
|
||||
|
||||
#
|
||||
# install or upgrade
|
||||
|
@ -76,7 +76,8 @@ clearpart --all --initlabel
|
||||
# --useLilo
|
||||
# --md5pass <crypted MD5 password for GRUB>
|
||||
#
|
||||
bootloader
|
||||
#KICKSTARTBOOTLOADER#
|
||||
|
||||
|
||||
#
|
||||
# install or upgrade
|
||||
@ -151,4 +152,5 @@ reboot
|
||||
%end
|
||||
%post
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat#
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rhels7#
|
||||
%end
|
@ -78,8 +78,7 @@ part / --size 1 --grow --fstype ext4 --ondisk sda
|
||||
# --useLilo
|
||||
# --md5pass <crypted MD5 password for GRUB>
|
||||
#
|
||||
bootloader
|
||||
|
||||
#KICKSTARTBOOTLOADER#
|
||||
#
|
||||
# install or upgrade
|
||||
#
|
||||
|
@ -74,8 +74,7 @@ key --skip
|
||||
# --useLilo
|
||||
# --md5pass <crypted MD5 password for GRUB>
|
||||
#
|
||||
bootloader
|
||||
|
||||
#KICKSTARTBOOTLOADER#
|
||||
#
|
||||
# install or upgrade
|
||||
#
|
||||
|
@ -76,8 +76,7 @@ clearpart --all --initlabel
|
||||
# --useLilo
|
||||
# --md5pass <crypted MD5 password for GRUB>
|
||||
#
|
||||
bootloader
|
||||
|
||||
#KICKSTARTBOOTLOADER#
|
||||
#
|
||||
# install or upgrade
|
||||
#
|
||||
@ -151,4 +150,5 @@ reboot
|
||||
%end
|
||||
%post
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat#
|
||||
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rhels7#
|
||||
%end
|
@ -46,7 +46,15 @@ if [ -z "$PRINIC" ]
|
||||
then
|
||||
for karg in $(cat /proc/cmdline |sed -e 's/-/:/g' -e 's/ /\n/g'); do
|
||||
if [ "${karg%%=*}" = "BOOTIF" ]; then
|
||||
export PRINIC=`ifconfig -a|grep -i "hwaddr ${karg#*=01:}"|awk '{print $1}'`
|
||||
#export PRINIC=`ifconfig -a|grep -i "hwaddr ${karg#*=01:}"|awk '{print $1}'`
|
||||
export PRINIC=${karg#*=01:}
|
||||
export PRINIC=`ip -o link|grep -i "$PRINIC"|awk '{print $2}'|sed s/://`
|
||||
fi
|
||||
if [ "${karg%%=*}" = "netdevice" ]; then
|
||||
export PRINIC="${karg#*=}";
|
||||
if [ "${#PRINIC}" = "20" ]; then
|
||||
export PRINIC=${PRINIC:3:21}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [ -z "$PRINIC" ]; then
|
||||
@ -57,7 +65,8 @@ if [ -z "$PRINIC" ]
|
||||
then
|
||||
export PRINIC=eth0
|
||||
elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+$ ;echo $?` == "0" ]]; then
|
||||
export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'`
|
||||
#export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'`
|
||||
export PRINIC=`ip -o link|grep -i "$PRINIC"|awk '{print $2}'|sed s/://`
|
||||
fi
|
||||
echo 'export PRINIC='"$PRINIC" > /mnt/tmp/prinicsetting
|
||||
]]>
|
||||
|
13
xCAT-server/share/xcat/install/scripts/post.rhels7
Normal file
13
xCAT-server/share/xcat/install/scripts/post.rhels7
Normal file
@ -0,0 +1,13 @@
|
||||
#the nic name might change between the installation and 1st boot
|
||||
#active all the nics with network link during system boot
|
||||
for i in $(find /etc/sysconfig/network-scripts/ifcfg-*|egrep -v ifcfg-lo )
|
||||
do
|
||||
nicname=$(echo $i|awk -F 'ifcfg-' '{print $2}')
|
||||
if ethtool $nicname|grep -E -i "Link detected.*yes" >/dev/null 2>&1
|
||||
then sed -i 's/ONBOOT=no/ONBOOT=yes/' $i
|
||||
fi
|
||||
|
||||
#remove the entry 'HWADDR' from ifcfg-ethx, this is used to skip the
|
||||
#nic name change during the install and first_reboot
|
||||
sed -i '/HWADDR/d' $i
|
||||
done
|
@ -218,6 +218,12 @@ if [ -z "$instdisk" ]; then
|
||||
instdisk=$firstdisk
|
||||
fi
|
||||
fi
|
||||
|
||||
# Could not determine the install disk for whatever reason,
|
||||
# try the default /dev/sda
|
||||
if [ -z "$instdisk" ]; then
|
||||
instdisk="/dev/sda"
|
||||
fi
|
||||
|
||||
|
||||
modprobe ext4 >& /dev/null
|
||||
|
@ -182,6 +182,12 @@ if [ -z "$instdisk" ]; then
|
||||
instdisk=$firstdisk
|
||||
fi
|
||||
fi
|
||||
# Could not determine the install disk for whatever reason,
|
||||
# try the default /dev/sda
|
||||
if [ -z "$instdisk" ]; then
|
||||
instdisk="/dev/sda"
|
||||
fi
|
||||
|
||||
modprobe ext4 >& /dev/null
|
||||
modprobe ext4dev >& /dev/null
|
||||
if grep ext4dev /proc/filesystems > /dev/null; then
|
||||
|
@ -5,7 +5,7 @@
|
||||
<bootloader>
|
||||
<write_bootloader config:type="boolean">true</write_bootloader>
|
||||
<activate config:type="boolean">true</activate>
|
||||
<kernel_parameters></kernel_parameters>
|
||||
<kernel_parameters>#XCATVAR:PERSKCMDLINE#</kernel_parameters>
|
||||
<lba_support config:type="boolean">false</lba_support>
|
||||
<linear config:type="boolean">false</linear>
|
||||
<location>mbr</location>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<bootloader>
|
||||
<write_bootloader config:type="boolean">true</write_bootloader>
|
||||
<activate config:type="boolean">true</activate>
|
||||
<kernel_parameters></kernel_parameters>
|
||||
<kernel_parameters>#XCATVAR:PERSKCMDLINE#</kernel_parameters>
|
||||
<lba_support config:type="boolean">false</lba_support>
|
||||
<linear config:type="boolean">false</linear>
|
||||
<location>mbr</location>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<bootloader>
|
||||
<write_bootloader config:type="boolean">true</write_bootloader>
|
||||
<activate config:type="boolean">true</activate>
|
||||
<kernel_parameters></kernel_parameters>
|
||||
<kernel_parameters>#XCATVAR:PERSKCMDLINE#</kernel_parameters>
|
||||
<lba_support config:type="boolean">false</lba_support>
|
||||
<linear config:type="boolean">false</linear>
|
||||
<location>mbr</location>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<bootloader>
|
||||
<write_bootloader config:type="boolean">true</write_bootloader>
|
||||
<activate config:type="boolean">true</activate>
|
||||
<kernel_parameters></kernel_parameters>
|
||||
<kernel_parameters>#XCATVAR:PERSKCMDLINE#</kernel_parameters>
|
||||
<lba_support config:type="boolean">false</lba_support>
|
||||
<linear config:type="boolean">false</linear>
|
||||
<location>mbr</location>
|
||||
|
@ -24,6 +24,11 @@ d-i netcfg/dhcp_timeout string 120
|
||||
#d-i mirror/udeb/suite string testing
|
||||
|
||||
|
||||
# Use the following option to add additional boot parameters for the
|
||||
# installed system (if supported by the bootloader installer).
|
||||
# Note: options passed to the installer will be added automatically.
|
||||
d-i debian-installer/add-kernel-opts string #XCATVAR:PERSKCMDLINE#
|
||||
|
||||
### Partitioning
|
||||
# This creates a small /boot partition, suitable
|
||||
# swap, and uses the rest of the space for the root partition:
|
||||
|
@ -0,0 +1,15 @@
|
||||
bash
|
||||
nfs-common
|
||||
openssl
|
||||
isc-dhcp-client
|
||||
libc-bin
|
||||
linux-image-generic-lts-utopic
|
||||
openssh-server
|
||||
openssh-client
|
||||
wget
|
||||
vim
|
||||
ntp
|
||||
rsync
|
||||
busybox-static
|
||||
gawk
|
||||
dnsutils
|
@ -0,0 +1 @@
|
||||
compute.ubuntu14.04.2.ppc64el.pkglist
|
@ -0,0 +1,15 @@
|
||||
bash
|
||||
nfs-common
|
||||
openssl
|
||||
isc-dhcp-client
|
||||
libc-bin
|
||||
linux-image-generic
|
||||
openssh-server
|
||||
openssh-client
|
||||
wget
|
||||
vim
|
||||
ntp
|
||||
rsync
|
||||
busybox-static
|
||||
gawk
|
||||
dnsutils
|
@ -0,0 +1 @@
|
||||
compute.ubuntu14.04.ppc64el.pkglist
|
1
xCAT-server/share/xcat/install/ubuntu/cudafull.tmpl
Symbolic link
1
xCAT-server/share/xcat/install/ubuntu/cudafull.tmpl
Symbolic link
@ -0,0 +1 @@
|
||||
compute.tmpl
|
@ -0,0 +1,21 @@
|
||||
bash
|
||||
nfs-common
|
||||
openssl
|
||||
isc-dhcp-client
|
||||
libc-bin
|
||||
openssh-server
|
||||
openssh-client
|
||||
wget
|
||||
vim
|
||||
ntp
|
||||
rsync
|
||||
busybox-static
|
||||
gawk
|
||||
dnsutils
|
||||
|
||||
build-essential
|
||||
dkms
|
||||
|
||||
zlib1g-dev
|
||||
|
||||
cuda
|
1
xCAT-server/share/xcat/install/ubuntu/cudaruntime.tmpl
Symbolic link
1
xCAT-server/share/xcat/install/ubuntu/cudaruntime.tmpl
Symbolic link
@ -0,0 +1 @@
|
||||
compute.tmpl
|
@ -0,0 +1,21 @@
|
||||
bash
|
||||
nfs-common
|
||||
openssl
|
||||
isc-dhcp-client
|
||||
libc-bin
|
||||
openssh-server
|
||||
openssh-client
|
||||
wget
|
||||
vim
|
||||
ntp
|
||||
rsync
|
||||
busybox-static
|
||||
gawk
|
||||
dnsutils
|
||||
|
||||
build-essential
|
||||
dkms
|
||||
|
||||
zlib1g-dev
|
||||
|
||||
cuda-runtime-7-0
|
@ -22,7 +22,11 @@ d-i netcfg/dhcp_timeout string 120
|
||||
#d-i mirror/suite string testing
|
||||
# Suite to use for loading installer components (optional).
|
||||
#d-i mirror/udeb/suite string testing
|
||||
|
||||
|
||||
# Use the following option to add additional boot parameters for the
|
||||
# installed system (if supported by the bootloader installer).
|
||||
# Note: options passed to the installer will be added automatically.
|
||||
d-i debian-installer/add-kernel-opts string #XCATVAR:PERSKCMDLINE#
|
||||
|
||||
### Partitioning
|
||||
# This creates a small /boot partition, suitable
|
||||
|
@ -77,9 +77,11 @@ export UPDATENODE
|
||||
NTYPE=$NTYPE
|
||||
export NTYPE
|
||||
|
||||
MACADDRESS=#TABLE:mac:$NODE:mac#
|
||||
export MACADDRESS
|
||||
MACMAC=#TABLE:mac:$NODE:mac#
|
||||
export MACMAC
|
||||
|
||||
MACADDRESS=$MACADDRESS
|
||||
export MACADDRESS
|
||||
|
||||
## vlan related items. vlan may not be configured.
|
||||
#VLAN_VARS_EXPORT#
|
||||
|
0
xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.exlist
Executable file → Normal file
0
xCAT-server/share/xcat/netboot/rh/compute.rhels6.ppc64.exlist
Executable file → Normal file
0
xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.exlist
Executable file → Normal file
0
xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.exlist
Executable file → Normal file
0
xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.postinstall
Normal file → Executable file
0
xCAT-server/share/xcat/netboot/rh/compute.rhels6.x86_64.postinstall
Normal file → Executable file
0
xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist
Executable file → Normal file
0
xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist
Executable file → Normal file
0
xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.exlist
Executable file → Normal file
0
xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.exlist
Executable file → Normal file
@ -934,7 +934,8 @@ sub mkinitrd_dracut {
|
||||
if ($dracutver > "033") {
|
||||
$additional_options .= " -N";
|
||||
}
|
||||
system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver");
|
||||
!system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver")
|
||||
or die("Error: failed to generate the initial ramdisk for $mode.\n");
|
||||
print "the initial ramdisk for $mode is generated successfully.\n";
|
||||
move("$rootimg_dir/tmp/initrd.$$.gz", "$destdir/initrd-$mode.gz");
|
||||
}
|
||||
|
@ -918,8 +918,8 @@ foreach my $dn (@ndrivers) {
|
||||
system("chroot $rootimg_dir depmod $kernelver");
|
||||
|
||||
if ($dracutmode) {
|
||||
mkinitrd_dracut("statelite");
|
||||
mkinitrd_dracut("stateless");
|
||||
mkinitrd_dracut("statelite");
|
||||
} else {
|
||||
my @drivers; # backup of @ndrivers
|
||||
push @drivers, @ndrivers;
|
||||
@ -1072,7 +1072,8 @@ sub mkinitrd_dracut {
|
||||
$additional_options .= " -N";
|
||||
}
|
||||
|
||||
system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver");
|
||||
!system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver")
|
||||
or die("Error: failed to generate the initial ramdisk for $mode.\n");
|
||||
print "the initial ramdisk for $mode is generated successfully.\n";
|
||||
move("$rootimg_dir/tmp/initrd.$$.gz", "$destdir/initrd-$mode.gz");
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user