Compare commits

..

1 Commits

Author SHA1 Message Date
547ad31bc8 Add configbridge script
* Allows to add linuxbridge
* Allows to add OVS bridges
* taken from xHRM script and modified
2015-02-17 04:00:39 +00:00
135 changed files with 1201 additions and 2030 deletions

View File

@ -27,7 +27,6 @@
# 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
@ -95,7 +94,8 @@ curdir=`pwd`
#define the dep source code path, core build target path and dep build target path
local_core_repo_path="$curdir/../../xcat-core"
local_dep_repo_path="$curdir/../../xcat-dep/xcat-dep"
xcat_dep_path="$curdir/../../../xcat-dep/src/xcat-dep"
local_dep_repo_path="$curdir/../../../xcat-dep/xcat-dep"
#define the url used for creating the source list file
#define the upload dir used for uploading packages
@ -112,18 +112,13 @@ 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_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name
wget -P $HOME/.gnupg $gsa_url/keys/$key_name
chmod 600 $HOME/.gnupg/$key_name
fi
done
@ -225,7 +220,6 @@ 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

View File

@ -36,10 +36,9 @@
# 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=litingt
UPLOADUSER=bp-sawyers
FRS=/home/frs/project/x/xc/xcat
# These are the rpms that should be built for each kind of xcat build
@ -50,7 +49,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 xCAT-genesis-scripts-ppc64 xCAT-vlan"
PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64"
# Note: for FSM, the FlexCAT rpm is built separately from gsa/git
FSMBUILD="perl-xCAT xCAT-client xCAT-server"
FSMLINK=""
@ -86,19 +85,21 @@ 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
# This is so rpm and gpg will know home, even in sudo
export HOME=/root
export HOME=/root # This is so rpm and gpg will know home, even in sudo
fi
# for the git case, query the current branch and set REL (changing master to devel if necessary)
function setbranch {
#git checkout $BRANCH
#REL=`git rev-parse --abbrev-ref HEAD`
REL=`git name-rev --name-only HEAD`
if [ "$REL" = "master" ]; then
REL="devel"
fi
}
if [ "$REL" = "xcat-core" ]; then # using git
if [ "$REL" = "xcat-core" ]; then # using git
GIT=1
setbranch # this changes the REL variable
fi
@ -130,7 +131,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
@ -183,8 +184,7 @@ 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,8 +198,7 @@ if [ "$GIT" = "1" ]; then
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
@ -243,6 +242,7 @@ 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,8 +253,7 @@ 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
@ -282,7 +281,9 @@ 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
@ -344,10 +345,6 @@ 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
@ -355,7 +352,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_CMD} -P $HOME/.gnupg $GSA/keys/$i
wget -P $HOME/.gnupg $GSA/keys/$i
chmod 600 $HOME/.gnupg/$i
fi
done
@ -377,10 +374,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_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
wget -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
fi
if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then
${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
wget -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
fi
fi

View File

@ -19,7 +19,7 @@
# VERBOSE=1 - to see lots of verbose output
# you can change this if you need to
UPLOADUSER=litingt
UPLOADUSER=bp-sawyers
FRS=/home/frs/project/x/xc/xcat
OSNAME=$(uname)

12
makerpm
View File

@ -23,18 +23,6 @@ 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

View File

@ -2509,12 +2509,13 @@ 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=$nicname:$mac";
$net_params->{ifname} = "ifname=$nodebootif:$mac";
} elsif ($mac) {
$net_params->{ksdevice} = "ksdevice=$mac";
$net_params->{BOOTIF} = "BOOTIF=$mac";

View File

@ -996,72 +996,6 @@ 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
@ -1327,13 +1261,6 @@ 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.
@ -1346,8 +1273,7 @@ sub gen_chain_for_profiles{
}
}
#run bmcsetups.
#PowerNV nodes can't use 'runcmd=bmcsetup' to set BMC.
if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig and $netboot ne 'petitboot'){
if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig){
if (index($final_chain, "runcmd=bmcsetup") == -1){
$final_chain = 'runcmd=bmcsetup,'.$final_chain.':reboot4deploy';
}
@ -1417,6 +1343,7 @@ sub get_netboot_attr{
{
return 0, "Hardware profile not defined in DB."
}
$hardwareprofile =~ s/^__HardwareProfile_//;
}
else
{
@ -1449,55 +1376,41 @@ 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 | 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
# 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
my %netboot_dict = ( 'x86_64' => 'xnba',
'ppc64' => {
'rhels' => {
'7' => 'grub2',
'*' => 'yaboot',
},
'pkvm' => 'petitboot',
'*' => 'yaboot',
},
'ppc64le' => {
'*' => {
'*' => {
'*' => 'grub2',
'ipmi' => 'petitboot',
'IBM_PowerNV' => 'petiboot',
'*' => 'grub2',
},
},
},
);
my $condition_array_ref = [$os_arch, $os_name, $os_major_version, $mgt];
my $condition_array_ref = [$os_arch, $os_name, $os_major_version, $hardwareprofile];
$netboot = cal_netboot(\%netboot_dict, $condition_array_ref);
if($netboot eq '0')
{
return 0, "Can not get the netboot attribute";
}
else
{
{
return 1, $netboot;
}
}

View File

@ -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. For the kernel options need to be persistent after installation, specify them with prefix "R::"',
'addkcmdline' => 'User specified one or more parameters to be passed to the kernel',
'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. For the kernel options need to be persistent after installation, specify them with prefix "R::". 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. 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. It could be set multiple paths.The multiple paths must be seperated by ",".',
otherpkglist => 'The fully qualified name of the file that stores non-distro package lists that will be included in the image.',
otherpkgdir => 'The base directory where the non-distro packages are stored. 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 could be set multiple paths.The multiple paths must be seperated by ",". 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.',
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.kitreponame',
tabentry => 'kitcomponent.kitrepoid',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'basename',

48
perl-xCAT/xCAT/Utils.pm Normal file → Executable file
View File

@ -1013,11 +1013,10 @@ sub runcmd
}
# store the return string
#push @$outref,$output;
close(PIPE); # This will set the $? properly
}
# now if not streaming process errors
if ($?)
if (($?) && (!defined($stream)))
{
$::RUNCMD_RC = $? >> 8;
my $displayerror = 1;
@ -3430,7 +3429,6 @@ 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 $_) {
@ -3470,7 +3468,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'} !~ /^ppc64/i) {
if ($nodetypehash->{$_}->[0]->{'arch'} ne "ppc64le") {
push @nonppcle, $_;
}
}
@ -3597,8 +3595,6 @@ 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);
@ -3623,12 +3619,9 @@ sub version_cmp {
} elsif ( $b eq '.' ) {
return 1;
} elsif ($a =~ /^\d+$/ and $b =~ /^\d+$/) {
# if ($a =~ /^0/ || $b =~ /^0/) {
# return ($a cmp $b);
# } else {
# return ($a <=> $b);
# }
if($a != $b ){
if ($a =~ /^0/ || $b =~ /^0/) {
return ($a cmp $b);
} else {
return ($a <=> $b);
}
} else {
@ -4125,9 +4118,7 @@ sub restartservice{
return -1;
}
#xCAT::Utils->runcmd($cmd, -1);
system($cmd);
$::RUNCMD_RC=$?;
xCAT::Utils->runcmd($cmd, -1);
return $::RUNCMD_RC;
}
@ -4505,32 +4496,5 @@ 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;

View File

@ -69,11 +69,6 @@ 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

View File

@ -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 "Did not find any section 5 man page, creating dummy pods...\n"; print join('', @lines); }
if ($?) { print "Error running: $cmd\n"; print join('', @lines); }
#my @lines;
#system($cmd);
my @dummyPods;

View File

@ -26,23 +26,7 @@ my $usage = sub {
exit $exitcode;
};
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;
}
if (-f '/etc/os-release') { die "This script doesn't support ubuntu yet.\n"; }
# Process the cmd line args
Getopt::Long::Configure("bundling");

View File

@ -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,13 +40,10 @@ 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); }
@ -57,6 +54,8 @@ 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 @_;
@ -114,14 +113,12 @@ 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: Copying $localfile to $nr:$remotefile\n";
print "Dry run: $cmd\n";
print "Dry run: would copy $localfile to $nr:$remotefile\n";
}
else {
print "Copying $localfile to $nr:$remotefile\n";
runcmd($cmd);
runcmd("xdcp $nr -p $localfile $remotefile");
}
}
}
@ -187,20 +184,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
@ -236,23 +233,6 @@ 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.
@ -272,6 +252,7 @@ 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

View File

@ -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 "Did not find any section 5 man page, creating dummy pods...\n"; print join('', @lines); }
if ($?) { print "Error running: $cmd\n"; print join('', @lines); }
#my @lines;
#system($cmd);
my @dummyPods;

0
xCAT-UI/debian/rules Executable file → Normal file
View File

0
xCAT-buildkit/share/xcat/kits/debian_template/rules Executable file → Normal file
View File

View File

@ -314,38 +314,6 @@ 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
@ -398,6 +366,37 @@ 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)
{
@ -1064,39 +1063,6 @@ 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

View File

@ -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;

View File

@ -180,8 +180,7 @@ if ($::RUNCMD_RC != 0)
exit(1);
}
# check if 9.X release not built by us is installed, setup different
# SLES used default dir
if ( (grep(/postgresql9/, @output)) && ($::linuxos !~ /sles/) ){ # postgresql 9.x
if (grep(/postgresql9/, @output)) { # postgresql 9.x
# figure out which 9.x release and build path
my @parseout= split(/\-/, $output[0]);
my @ptflevel= split ("postgresql9",$parseout[0]);
@ -779,7 +778,7 @@ sub initpgdb
`$cmd`;
if ($::osname eq 'Linux')
{
$cmd = qq~ echo listen_addresses = \\'localhost,$::MN\\' >> $pgconf~;
$cmd = qq~ echo listen_addresses = \\'*\\' >> $pgconf~;
`$cmd`;
}
@ -987,7 +986,7 @@ sub setupxcatdb
$cmd = "/var/lib/pgsql/bin/psql -d $::dbname -U postgres";
} else { # Linux
$cmd = "$::pgcmddir/psql -d $::dbname -U postgres";
if ( ($debianflag) || ($::linuxos =~ /sles/) ){
if ($debianflag){
$cmd = "su - postgres -c '$::pgcmddir/psql -d $::dbname -U postgres'";
}
}

View File

@ -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 --unprivileged --system-dns --send-ip -sP $more_options ".join(' ',@$nodes). " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
open (FPING, "nmap -PE --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/) {

View File

@ -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 => SSL_VERIFY_PEER,
#SSL_verify_mode => 1,
);
die "Connection failure: $!\n" unless ($client);
my %cmdref = (command => 'noderange', noderange => $noderange);

View File

@ -63,11 +63,6 @@ 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",
@ -75,7 +70,6 @@ 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);

View File

@ -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 => SSL_VERIFY_MODE,
#SSL_verify_mode => 1,
);
die "Connection failure: $!\n" unless ($client);
my %cmdref = (command => 'noderange', noderange => $noderange);

View File

@ -52,28 +52,15 @@ if [ -n "$2" ]; then
fi
fi
# 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
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
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

View File

@ -109,9 +109,6 @@ 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;

View File

@ -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 "Did not find any section 5 man page, creating dummy pods...\n"; print join('', @lines); }
if ($?) { print "Error running: $cmd\n"; print join('', @lines); }
#my @lines;
#system($cmd);
my @dummyPods;

View File

@ -1,5 +0,0 @@
xcat-confluent (2.10-snap20150325) unstable; urgency=low
* Initial release
-- root <root@hostname> Wed, 25 Mar 2015 13:41:35 -0400

View File

@ -1 +0,0 @@
9

View File

@ -1,11 +0,0 @@
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

View File

@ -1 +0,0 @@
/opt/confluent/

View File

@ -1,30 +0,0 @@
#!/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

View File

@ -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 "Did not find any section 5 man page, creating dummy pods...\n"; print join('', @lines); }
if ($?) { print "Error running: $cmd\n"; print join('', @lines); }
#my @lines;
#system($cmd);
my @dummyPods;
@ -126,6 +126,7 @@ 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

View File

@ -8,7 +8,6 @@ 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
@ -22,64 +21,9 @@ 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
elif [ $BUILDARCH = "ppc64" ]; then
# and some files are in different directories
if [ `uname -m` = "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
@ -102,11 +46,38 @@ elif [ $BUILDARCH = "ppc64" ]; then
sed -i 's/\/lib\/terminfo\/v\/vt100/\/usr\/share\/terminfo\/v\/vt100/g' $DRACUTMODDIR/install
fi
mkdir -p /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs
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
# run dracut
if [ "$HOSTOS" = "mcp" ]; then
KPATH=`/bin/ls -d /lib/modules/*`
KPATH=`/bin/ls -d /lib/modules/*.x86_64`
KERNELVERSION=`basename $KPATH`
echo Creating the initramfs in /tmp/xcatgenesis.$$.rfs using dracut and kernel $KERNELVERSION ...
else
@ -114,31 +85,31 @@ else
fi
# On Fedora 20 ppc64, dracut uses host-only mode by default
if [ $BUILDARCH = "ppc64" ]; then
if [ `uname -m` = "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/$BUILDARCH/fs ...
cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs
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
zcat /tmp/xcatgenesis.$$.rfs|cpio -dumi
# add the kernel
if [ "$HOSTOS" = "mcp" ]; then
echo Adding kernel /boot/vmlinuz-* ...
cp /boot/vmlinuz-* /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/kernel
cp /boot/vmlinuz-*.x86_64 /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/kernel
else
echo Adding kernel /boot/vmlinuz-$BUILDARCH ...
cp /boot/vmlinuz-`uname -r` /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/kernel
echo Adding kernel /boot/vmlinuz-`uname -r` ...
cp /boot/vmlinuz-`uname -r` /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/kernel
fi
cd -
# create tar file
echo Tarring /tmp/xcatgenesis.$$/opt into ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 ...
echo Tarring /tmp/xcatgenesis.$$/opt into ~/rpmbuild/SOURCES/xCAT-genesis-base-`uname -m`.tar.bz2 ...
cd /tmp/xcatgenesis.$$
tar jcf ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 opt
tar jcf ~/rpmbuild/SOURCES/xCAT-genesis-base-`uname -m`.tar.bz2 opt
# build the rpm
echo Building xCAT-genesis-base rpm from ~/rpmbuild/SOURCES/xCAT-genesis-base-$BUILDARCH.tar.bz2 and $DIR/xCAT-genesis-base.spec ...
echo Building xCAT-genesis-base rpm from ~/rpmbuild/SOURCES/xCAT-genesis-base-`uname -m`.tar.bz2 and $DIR/xCAT-genesis-base.spec ...
rpmbuild -ba $DIR/xCAT-genesis-base.spec
rm -rf $DRACUTMODDIR

View File

@ -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 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 /usr/bin/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

View File

@ -1,6 +1,6 @@
#!/bin/bash
instmods nfs sunrpc
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 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 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,4 +9,3 @@ 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

View File

@ -7,7 +7,6 @@ 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

View File

@ -117,7 +117,6 @@ 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}'`
@ -127,14 +126,8 @@ 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
@ -152,68 +145,54 @@ 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
if [ -z "$bootnic" ]; then
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
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
# 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
/bin/bash
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
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
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))
sleep 2
tries=$(($tries+1))
done
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
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
(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
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
@ -235,7 +214,16 @@ 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 Executable file → Normal file
View File

View File

@ -3,5 +3,4 @@ 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

View File

@ -34,6 +34,5 @@ opt/xcat/xdsh/Context
opt/xcat/ws
etc/init.d
etc/xcat
etc/apache2/conf-enabled
etc/apache2/conf-available
etc/apache2/conf.d
opt/xcat/share/doc/packages/xCAT-server

View File

@ -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-enabled/xcat-ws.conf
rm -f /etc/apache2/conf.d/xcat-ws.conf
;;
*)

5
xCAT-server/debian/rules Executable file → Normal file
View File

@ -66,10 +66,9 @@ 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-available/xcat-ws.conf
cat $(PWD)/xCAT-wsapi/xcat-ws.conf.ubuntu >> $(buildroot)/etc/apache2/conf-available/xcat-ws.conf
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
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

View File

@ -518,13 +518,6 @@ 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;
@ -552,8 +545,6 @@ 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;

View File

@ -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,7 +250,6 @@ 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;
@ -663,66 +662,6 @@ 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;
@ -827,19 +766,11 @@ 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{
# 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;
}
$pkgdir=$_;
}
}

View File

@ -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, -1, 1);
$retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args, "--noupdateinitrd"]}, $request_command, 0, 2);
}
else
{
$retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args]}, $request_command, -1, 1);
$retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args]}, $request_command, 0, 2);
}
log_cmd_return($current_cmd, $retref, $callback);
log_cmd_return($retref);
}
}
@ -212,37 +212,24 @@ sub setrsp_progress
=head3 log_cmd_return
Description: Log commands return ref into log files.
Args: $command - current command name
$return - command return ref.
Args: $return - command return ref.
=cut
#-------------------------------------------------------
sub log_cmd_return
{
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;
}
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));
}
}
if($errmsg)
{
$callback->({
error=>[$errmsg],
errorcode=>[1]
});
}
}
}
1;

View File

@ -11,7 +11,6 @@ BEGIN
}
}
use lib "$::XCATROOT/lib/perl";
#use Net::SNMP qw(:snmp INTEGER);
use xCAT::Table;
@ -2005,7 +2004,7 @@ sub getmacs {
}
my @macs = ();
(my $code,my @orig_macs)=inv($node, 'mac');
(my $code,my @orig_macs)=inv('mac');
my $ignore_gen_mac = 0;
foreach my $mac (@orig_macs) {
if ($mac =~ /(.*) -> (.*)/) {
@ -2114,7 +2113,6 @@ sub getmacs {
}
sub inv {
my $node = shift;
my @invitems;
my $data;
my @output;
@ -2241,67 +2239,50 @@ sub inv {
$updatehash{serial}=$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;
}
}
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;
}
}
}
if ($updatetable and $updatehash{mtm}) {
}
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}) {
#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;
@ -3735,7 +3716,7 @@ sub bladecmd {
} elsif ($command eq "getmacs") {
return getmacs($node, @args);
} elsif ($command eq "rinv") {
return inv($node, @args);
return inv(@args);
} elsif ($command eq "reventlog") {
return eventlog(@args);
} elsif ($command eq "rscan") {

View File

@ -347,39 +347,6 @@ 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) {
@ -412,7 +379,6 @@ 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();

View File

@ -221,18 +221,16 @@ 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>;
@ -438,7 +436,8 @@ sub copycd
}
}
sub mkinstall {
sub mkinstall
{
xCAT::MsgUtils->message("S","Doing debian mkinstall");
my $request = shift;
my $callback = shift;
@ -489,13 +488,16 @@ 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;
@ -513,115 +515,111 @@ 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) {
$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;
}
}
$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) {
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;
}
}
}
$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;
$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=$_;
}
}
}
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) {
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";
@ -638,7 +636,7 @@ sub mkinstall {
my @missingparms;
unless ($os) {
if ($imagename) {
if ($imagename) {
push @missingparms,"osimage.osvers";
}
else {
@ -655,7 +653,7 @@ sub mkinstall {
}
}
unless ($profile) {
if ($imagename) {
if ($imagename) {
push @missingparms,"osimage.profile";
}
else {
@ -666,7 +664,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") {
@ -679,42 +677,46 @@ 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;
@ -726,8 +728,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";
@ -737,31 +739,33 @@ 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
@ -790,37 +794,50 @@ 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};
}
my $kcmdline = "nofb utf8 auto url=http://" . $instserver . "/install/autoinst/" . $node;
#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;
#}
$kcmdline .= " xcatd=".$instserver;
$kcmdline .= " mirror/http/hostname=".$instserver;
if ($maxmem) {
$kcmdline.=" mem=$maxmem";
}
# 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);
my $net_params = xCAT::NetworkUtils->gen_net_boot_params($ent->{installnic},$ent->{primarynic},$macent->{mac});
if (exists($net_params->{nicname})) {
$kcmdline .= " netcfg/choose_interface=". $net_params->{nicname};
} elsif (exists($net_params->{mac})) {
@ -828,8 +845,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;
@ -839,49 +856,74 @@ 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";
# 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
# 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

View File

@ -19,10 +19,6 @@ 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;
@ -37,8 +33,6 @@ sub handled_commands {
}
}
my $parent_fd;
# The hash includes all valid attribute for quering
my %QUERY_ATTRS = (
'savingstatus' => 1,
@ -338,36 +332,6 @@ 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;
@ -381,7 +345,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}) && defined($ppcentry->{nodetype}) && $ppcentry->{nodetype} =~ /fsp/) {
if (defined($ppcentry->{parent})) {
$cec2fsp->{$ppcentry->{parent}} .= "$ppcentry->{node},";
}
}
@ -419,113 +383,37 @@ sub process_request {
xCAT::MsgUtils->message("E", {data => ["$node: Cannot find HCP"]}, $callback);
return 1;
}
# 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;
}
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:
@ -765,8 +653,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)|(Can't connect to)/) {
xCAT::MsgUtils->message("E", {data => ["$node: Couldn't connect to server [$http_params->{ip}]."]}, $callback);
if ($ret->{msg} =~ /Couldn't connect to server/) {
xCAT::MsgUtils->message("E", data => ["$node: Couldn not connect to server [$http_params->{ip}]."], $callback);
return 10;
} else {
xCAT::MsgUtils->message("E", {data => ["$node: $ret->{msg}"]}, $callback);

View File

@ -122,7 +122,7 @@ sub handled_commands{
return {
copycd => 'esx',
mknetboot => "nodetype:os=(esxi.*)",
mkinstall => "nodetype:os=(esxi[56].*)",
mkinstall => "nodetype:os=(esxi5.*)",
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 =~ /esxi[56]/) { #going to tweak boot.cfg for install and default stateless case
if ($distname =~ /esxi5/) { #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 =~ /esxi[56]/) {
} elsif ($osver =~ /esxi5/) {
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 =~ /esxi[56]/ and -e "$::XCATROOT/share/xcat/netboot/esxi/xcat-ipv6.json") {
} elsif ($osver =~ /esxi5/ 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 =~ /esxi[56]/ and -e "$::XCATROOT/share/xcat/netboot/esxi/39.ipv6fixup") {
} elsif ($osver =~ /esxi5/ 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 =~ /esxi[56]/ and -e "$::XCATROOT/share/xcat/netboot/esxi/48.esxifixup") {
if ($osver =~ /esxi5/ 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 =~ /esxi[56]/) { #we need boot.cfg.stateles
}elsif ($osver =~ /esxi5/) { #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");

View File

@ -168,36 +168,12 @@ 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'};

View File

@ -201,7 +201,7 @@ sub geninitrd {
return;
}
} elsif ($arch =~ /ppc/) {
if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(rh.*)|(fedora.*)|(SL.*)|(pkvm.*)/) {
if ($osvers =~ /(^ol[0-9].*)|(centos.*)|(rh.*)|(fedora.*)|(SL.*)/) {
$kernelpath = "$tftppath/vmlinuz";
copy("$pkgdir/ppc/ppc64/vmlinuz", $kernelpath);
if (-r "$pkgdir/ppc/ppc64/ramdisk.image.gz") {

View File

@ -132,29 +132,17 @@ sub setstate {
$kern->{kcmdline} =~ s/!myipfn!/$ipfn/g;
}
}
my $addkcmdline;
if ($kern->{addkcmdline}) {
$addkcmdline .= $kern->{addkcmdline}." ";
$kern->{kcmdline} .= " ".$kern->{addkcmdline};
}
if($linuximghash and $linuximghash->{'addkcmdline'})
{
unless($linuximghash->{'boottarget'})
{
$addkcmdline .= $linuximghash->{'addkcmdline'}." ";
$kern->{kcmdline} .= " ".$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") {

View File

@ -26,7 +26,6 @@ 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;
@ -1230,8 +1229,6 @@ 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";
@ -1255,15 +1252,15 @@ sub getrvidparms_imm2 {
$response = $browser->request(GET $baseurl."data/logout");
return;
}
$response = $browser->request(GET $baseurl."designs/imm/viewer(".$host.'@'.$ip6mode.'@'.time().'@1@0@1@jnlp)');
$response = $browser->request(GET $baseurl."designs/imm/viewer(".$sessdata->{ipmisession}->{bmc}.'@'.$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(".$host.'@'.$httpport.'@'.$ip6mode.'@'.time().'@1@0@1@jnlp'.'@USERID@0@0@0@0'.')');
$response = $browser->request(GET $baseurl."designs/imm/viewer(".$sessdata->{ipmisession}->{bmc}.'@'.$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(".$host.'@'.$httpport.'@'.$ip6mode.'@'.time().'@1@0@1@jnlp'.'@USERID@0@0@0@0@0'.')');
$response = $browser->request(GET $baseurl."designs/imm/viewer(".$sessdata->{ipmisession}->{bmc}.'@'.$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;
}
@ -2577,41 +2574,31 @@ 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) { #skip non fru sdr stuff
unless ($sdr->rec_type == 0x11 and $sdr->fru_type == 0x10) { #skip non fru sdr stuff and frus I don't understand
next;
}
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_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 (scalar @{$sessdata->{dimmfru}}) {
$sessdata->{currfrusdr} = shift @{$sessdata->{dimmfru}};
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->{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}};
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;
}
$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);
}
fru_initted($sessdata);
}
sub get_frusize {
my $fruid=shift;
@ -2878,29 +2865,17 @@ sub add_fruhash {
}
if (scalar @{$sessdata->{dimmfru}}) {
$sessdata->{currfrusdr} = shift @{$sessdata->{dimmfru}};
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->{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}};
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;
}
$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);
}
fru_initted($sessdata);
}
sub readcurrfrudevice {
@ -3101,15 +3076,8 @@ 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..$endidx];
@currarea=@{$bytes}[$curridx..($curridx+$currsize-1)];
$fruhash->{board} = parseboard(@currarea);
}
}

View File

@ -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,13 +2748,9 @@ 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) and
($allosiotherpkgdir->{otherpkgdir} eq $otherpkgdir))
or ($allkitcomp ne $kitcomponent) ) {
if ( $allosikitcomp->{imagename} ne $osimage or $allkitcomp ne $kitcomponent ) {
$newosikitcomponents{$allkitcomp} = 1;
}
}

View File

@ -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
{

View File

@ -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("4096","M",1024);
$addmemory{$target}+=getUnits("512","M",1024);
}
$hyphash{$target}->{nodes}->{$node}=1;
delete $orphash->{$node};

View File

@ -194,9 +194,6 @@ 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

View File

@ -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 --unprivileged -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 -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 --unprivileged -PE -n --send-ip -p $ports,3001 $more_options ".join(' ',@ips). " 2> /dev/null|") or die("Can't start nmap: $!");
open($fping,"nmap -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 ([^ ]*)/) {

View File

@ -402,13 +402,6 @@ 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);

View File

@ -471,7 +471,6 @@ 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();
@ -500,10 +499,6 @@ Usage:
{
$switch_mode = 1;
}
if(defined($hostinfo_dict{$mynode}{'vmhost'}))
{
$powerkvm_mode = 1;
}
}
# cannot mix switch discovery with mac import
@ -540,20 +535,6 @@ 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.
@ -814,8 +795,6 @@ Usage:
$nodecurrprofiles{'networkprofile'} = $group;
}elsif ($group =~ /__HardwareProfile/){
$nodecurrprofiles{'hardwareprofile'} = $group;
}elsif ($group =~ /__Hypervisor/){
next;
}else{
$nodecurrprofiles{'groups'} .= $group.",";
}
@ -860,22 +839,6 @@ 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
@ -890,10 +853,7 @@ 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'}){
@ -903,12 +863,7 @@ 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'}){
@ -918,24 +873,23 @@ 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;
if ($is_kvm_hypv) {
$updatenodeshash{$_}{'groups'} .= ",__Hypervisor_kvm";
}
if($new_netboot){
$updatenodereshash{$_}{'netboot'} = $new_netboot;
}
$updatenodereshash{$_}{'netboot'} = $new_netboot;
}
#update DataBase.
@ -2055,9 +2009,6 @@ 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';
@ -2155,7 +2106,6 @@ 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) ){
@ -2468,18 +2418,11 @@ 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 node information file. You must use a new MAC address.\n";
$errmsg .= "MAC address $node_entry{$_} already exists in the database or in the nodeinfo 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{
@ -2488,7 +2431,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 node information file.\n";
$errmsg .= "IP address $node_entry{$_} already exists in the database or in the nodeinfo 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 {
@ -2531,7 +2474,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 node information 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 nodeinfo file. You must use a new switch port.\n";
}else{
# after checking, add this one into all_switchports
$all_switchports{$switch_port} = 0;
@ -2607,7 +2550,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 node information 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 nodeinfo file. You must use a new CEC name and LPAR id.\n";
}else{
$alllparids{$cec_name}{$lpar_id} = 0;
}
@ -2622,7 +2565,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 node information file.\n";
$errmsg .= "IP address $nic_ip already exists in the database or in the nodeinfo 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 {
@ -2634,13 +2577,8 @@ sub validate_node_entry{
}elsif ($_ eq "vmhost") {
# Support PowerKVM vms
my $vm_host= $node_entry{"vmhost"};
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";
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";
}
}else{
$errmsg .= "Invalid attribute $_ specified\n";
@ -2668,7 +2606,7 @@ sub setrsp_invalidrecords
my $rsp;
# The total number of invalid records.
$rsp->{error} = ["Errors found in node information file"];
$rsp->{error} = ["Errors found in nodeinfo file"];
$rsp->{errorcode} = [2];
$rsp->{invalid_records_num}->[0] = scalar @$recordsref;

View File

@ -108,16 +108,6 @@ 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);

View File

@ -1621,17 +1621,10 @@ sub copycd
);
unless ($mntpath)
{
# $mntpath needs to be specified for this plugin
#this plugin needs $mntpath...
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/)
{

View File

@ -119,17 +119,6 @@ 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]);

View File

@ -127,32 +127,18 @@ sub setstate {
$kern->{kcmdline} =~ s/!myipfn!/$ipfn/g;
}
}
my $addkcmdline;
if ($kern->{addkcmdline}) {
$addkcmdline .= $kern->{addkcmdline}." ";
$kern->{kcmdline} .= " ".$kern->{addkcmdline};
}
if($linuximghash and $linuximghash->{'addkcmdline'})
{
unless($linuximghash->{'boottarget'})
unless($linuximghash->{'boottarget'})
{
$addkcmdline .= $linuximghash->{'addkcmdline'}." ";
}
$kern->{kcmdline} .= " ".$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") {

View File

@ -153,14 +153,9 @@ else {
#commit all the changes
foreach (keys %tables) {
if (exists($tableupdates{$_})) {
my $rc = $tables{$_}->setAttribs(\%keyhash,\%{$tableupdates{$_}});
if ($rc) {
$::exitcode = 1;
}
$tables{$_}->setAttribs(\%keyhash,\%{$tableupdates{$_}});
}
$tables{$_}->commit;
}
}
if ($::exitcode) {
exit $::exitcode;
}

View File

@ -2201,7 +2201,6 @@ 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

View File

@ -75,7 +75,7 @@ key --skip
# --useLilo
# --md5pass <crypted MD5 password for GRUB>
#
#KICKSTARTBOOTLOADER#
bootloader
#
# install or upgrade

View File

@ -76,7 +76,8 @@ clearpart --all --initlabel
# --useLilo
# --md5pass <crypted MD5 password for GRUB>
#
#KICKSTARTBOOTLOADER#
bootloader
#
# install or upgrade
#
@ -150,5 +151,4 @@ reboot
%end
%post
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat#
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rhels7#
%end

View File

@ -76,8 +76,7 @@ clearpart --all --initlabel
# --useLilo
# --md5pass <crypted MD5 password for GRUB>
#
#KICKSTARTBOOTLOADER#
bootloader
#
# install or upgrade
@ -152,5 +151,4 @@ reboot
%end
%post
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat#
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rhels7#
%end

View File

@ -78,7 +78,8 @@ part / --size 1 --grow --fstype ext4 --ondisk sda
# --useLilo
# --md5pass <crypted MD5 password for GRUB>
#
#KICKSTARTBOOTLOADER#
bootloader
#
# install or upgrade
#

View File

@ -74,7 +74,8 @@ key --skip
# --useLilo
# --md5pass <crypted MD5 password for GRUB>
#
#KICKSTARTBOOTLOADER#
bootloader
#
# install or upgrade
#

View File

@ -46,15 +46,7 @@ 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=${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
export PRINIC=`ifconfig -a|grep -i "hwaddr ${karg#*=01:}"|awk '{print $1}'`
fi
done
if [ -z "$PRINIC" ]; then
@ -65,8 +57,7 @@ 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=`ip -o link|grep -i "$PRINIC"|awk '{print $2}'|sed s/://`
export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'`
fi
echo 'export PRINIC='"$PRINIC" > /mnt/tmp/prinicsetting
]]>

View File

@ -1,13 +0,0 @@
#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

View File

@ -218,12 +218,6 @@ 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

View File

@ -182,12 +182,6 @@ 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

View File

@ -5,7 +5,7 @@
<bootloader>
<write_bootloader config:type="boolean">true</write_bootloader>
<activate config:type="boolean">true</activate>
<kernel_parameters>#XCATVAR:PERSKCMDLINE#</kernel_parameters>
<kernel_parameters></kernel_parameters>
<lba_support config:type="boolean">false</lba_support>
<linear config:type="boolean">false</linear>
<location>mbr</location>

View File

@ -5,7 +5,7 @@
<bootloader>
<write_bootloader config:type="boolean">true</write_bootloader>
<activate config:type="boolean">true</activate>
<kernel_parameters>#XCATVAR:PERSKCMDLINE#</kernel_parameters>
<kernel_parameters></kernel_parameters>
<lba_support config:type="boolean">false</lba_support>
<linear config:type="boolean">false</linear>
<location>mbr</location>

View File

@ -5,7 +5,7 @@
<bootloader>
<write_bootloader config:type="boolean">true</write_bootloader>
<activate config:type="boolean">true</activate>
<kernel_parameters>#XCATVAR:PERSKCMDLINE#</kernel_parameters>
<kernel_parameters></kernel_parameters>
<lba_support config:type="boolean">false</lba_support>
<linear config:type="boolean">false</linear>
<location>mbr</location>

View File

@ -5,7 +5,7 @@
<bootloader>
<write_bootloader config:type="boolean">true</write_bootloader>
<activate config:type="boolean">true</activate>
<kernel_parameters>#XCATVAR:PERSKCMDLINE#</kernel_parameters>
<kernel_parameters></kernel_parameters>
<lba_support config:type="boolean">false</lba_support>
<linear config:type="boolean">false</linear>
<location>mbr</location>

View File

@ -24,11 +24,6 @@ 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:

View File

@ -1,15 +0,0 @@
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

View File

@ -1 +0,0 @@
compute.ubuntu14.04.2.ppc64el.pkglist

View File

@ -1,15 +0,0 @@
bash
nfs-common
openssl
isc-dhcp-client
libc-bin
linux-image-generic
openssh-server
openssh-client
wget
vim
ntp
rsync
busybox-static
gawk
dnsutils

View File

@ -1 +0,0 @@
compute.ubuntu14.04.ppc64el.pkglist

View File

@ -1 +0,0 @@
compute.tmpl

View File

@ -1,21 +0,0 @@
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

View File

@ -1 +0,0 @@
compute.tmpl

View File

@ -1,21 +0,0 @@
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

View File

@ -22,11 +22,7 @@ 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

View File

@ -77,12 +77,10 @@ export UPDATENODE
NTYPE=$NTYPE
export NTYPE
MACMAC=#TABLE:mac:$NODE:mac#
export MACMAC
MACADDRESS=$MACADDRESS
MACADDRESS=#TABLE:mac:$NODE:mac#
export MACADDRESS
## vlan related items. vlan may not be configured.
#VLAN_VARS_EXPORT#

View File

View File

View File

View File

View File

View File

@ -934,8 +934,7 @@ sub mkinitrd_dracut {
if ($dracutver > "033") {
$additional_options .= " -N";
}
!system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver")
or die("Error: failed to generate the initial ramdisk for $mode.\n");
system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver");
print "the initial ramdisk for $mode is generated successfully.\n";
move("$rootimg_dir/tmp/initrd.$$.gz", "$destdir/initrd-$mode.gz");
}

View File

@ -918,8 +918,8 @@ foreach my $dn (@ndrivers) {
system("chroot $rootimg_dir depmod $kernelver");
if ($dracutmode) {
mkinitrd_dracut("stateless");
mkinitrd_dracut("statelite");
mkinitrd_dracut("stateless");
} else {
my @drivers; # backup of @ndrivers
push @drivers, @ndrivers;
@ -1072,8 +1072,7 @@ sub mkinitrd_dracut {
$additional_options .= " -N";
}
!system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver")
or die("Error: failed to generate the initial ramdisk for $mode.\n");
system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver");
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