Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
This commit is contained in:
commit
9af411c290
@ -3633,8 +3633,8 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
|
||||
tabentry => 'kitrepo.kitname',
|
||||
access_tabentry => 'kitrepo.kitreponame=attr:kitreponame',
|
||||
},
|
||||
{attr_name => 'osname',
|
||||
tabentry => 'kitrepo.osname',
|
||||
{attr_name => 'osbasename',
|
||||
tabentry => 'kitrepo.osbasename',
|
||||
access_tabentry => 'kitrepo.kitreponame=attr:kitreponame',
|
||||
},
|
||||
{attr_name => 'osmajorversion',
|
||||
|
@ -103,7 +103,7 @@ else # assume Linux
|
||||
fi
|
||||
if [ ! -e $gpfsprofile.sh ]; then
|
||||
echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh
|
||||
echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh
|
||||
echo 'setenv PATH ${PATH}:/usr/lpp/mmfs/bin' > $gpfsprofile.csh
|
||||
# Turn off LANG support since we did not install other msg catalogs
|
||||
echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh
|
||||
echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh
|
||||
|
@ -17,10 +17,12 @@ set -e
|
||||
case "$1" in
|
||||
install)
|
||||
<<<INSERT_kitcomponent_preinstall_script_HERE>>>
|
||||
echo "preinstall processing"
|
||||
;;
|
||||
|
||||
upgrade)
|
||||
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]; then
|
||||
echo "preupgrade processing"
|
||||
<<<INSERT_kitcomponent_preupgrade_script_HERE>>>
|
||||
fi
|
||||
;;
|
||||
|
@ -20,6 +20,7 @@ set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch> manually'"
|
||||
touch /etc/xcat/genesis-scripts-updated
|
||||
;;
|
||||
|
||||
|
@ -30,30 +30,30 @@ $Getopt::Long::ignorecase = 0;
|
||||
# Globals
|
||||
#
|
||||
|
||||
%::CLIATTRS; # attr=values provided on the command line
|
||||
%::FILEATTRS; # attr=values provided in an input file
|
||||
%::FINALATTRS; # final set of attr=values that are used to set
|
||||
# %::CLIATTRS; # attr=values provided on the command line
|
||||
#%::FILEATTRS; # attr=values provided in an input file
|
||||
#%::FINALATTRS; # final set of attr=values that are used to set
|
||||
# the object
|
||||
|
||||
%::objfilehash; # hash of objects/types based of "-f" option
|
||||
#%::objfilehash; # hash of objects/types based of "-f" option
|
||||
# (list in file)
|
||||
|
||||
%::WhereHash; # hash of attr=val from "-w" option
|
||||
@::AttrList; # list of attrs from "-i" option
|
||||
%::NicsAttrHash; # hash of nics attributes specified with "-i" option
|
||||
#%::WhereHash; # hash of attr=val from "-w" option
|
||||
#@::AttrList; # list of attrs from "-i" option
|
||||
#%::NicsAttrHash; # hash of nics attributes specified with "-i" option
|
||||
# e.g. $::NicsAttrHash{'nicips'} = ("eth0","eth1");
|
||||
|
||||
# object type lists
|
||||
@::clobjtypes; # list of object types derived from the command line.
|
||||
@::fileobjtypes; # list of object types from input file ("-x" or "-z")
|
||||
#@::clobjtypes; # list of object types derived from the command line.
|
||||
#@::fileobjtypes; # list of object types from input file ("-x" or "-z")
|
||||
|
||||
# object name lists
|
||||
@::clobjnames; # list of object names derived from the command line
|
||||
@::fileobjnames; # list of object names from an input file
|
||||
@::objfilelist; # list of object names from the "-f" option
|
||||
@::allobjnames; # combined list
|
||||
#@::clobjnames; # list of object names derived from the command line
|
||||
#@::fileobjnames; # list of object names from an input file
|
||||
#@::objfilelist; # list of object names from the "-f" option
|
||||
#@::allobjnames; # combined list
|
||||
|
||||
@::noderange; # list of nodes derived from command line
|
||||
#@::noderange; # list of nodes derived from command line
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -951,7 +951,7 @@ sub processArgs
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif (@::noderange && (@::clobjtypes[0] eq 'node'))
|
||||
elsif (@::noderange && ($::clobjtypes[0] eq 'node'))
|
||||
{
|
||||
|
||||
# if there's no object list and the type is node then the
|
||||
@ -1278,7 +1278,7 @@ sub defmk
|
||||
{
|
||||
|
||||
# if attr=val on cmd line then could only have one type
|
||||
$::objtype = @::clobjtypes[0];
|
||||
$::objtype = $::clobjtypes[0];
|
||||
|
||||
#
|
||||
# set cli attrs for each object definition
|
||||
@ -1921,7 +1921,7 @@ sub defch
|
||||
{
|
||||
|
||||
# if attr=val on cmd line then could only have one type
|
||||
$::objtype = @::clobjtypes[0];
|
||||
$::objtype = $::clobjtypes[0];
|
||||
|
||||
#
|
||||
# set cli attrs for each object definition
|
||||
@ -2760,7 +2760,7 @@ sub defls
|
||||
my %objhash;
|
||||
|
||||
my @objectlist;
|
||||
@::allobjnames;
|
||||
# @::allobjnames;
|
||||
my @displayObjList;
|
||||
|
||||
my $numtypes = 0;
|
||||
@ -2843,7 +2843,7 @@ sub defls
|
||||
|
||||
if ($::objectsfrom_opto || $::objectsfrom_nr || $::objectsfrom_args)
|
||||
{
|
||||
my $type = @::clobjtypes[0];
|
||||
my $type = $::clobjtypes[0];
|
||||
|
||||
$numtypes = 1;
|
||||
|
||||
@ -3748,7 +3748,7 @@ sub defrm
|
||||
# there can only be one type value
|
||||
if ($::objectsfrom_opto || $::objectsfrom_nr || $::objectsfrom_args)
|
||||
{
|
||||
my $type = @::clobjtypes[0];
|
||||
my $type = $::clobjtypes[0];
|
||||
|
||||
foreach my $obj (sort @::clobjnames)
|
||||
{
|
||||
@ -3873,8 +3873,8 @@ sub defrm
|
||||
$nhash{$m} = 'node';
|
||||
}
|
||||
# Performance: Only call getobjdefs once
|
||||
my @attrs = ('groups');
|
||||
%nodehash = xCAT::DBobjUtils->getobjdefs(\%nhash, 0, \@attrs);
|
||||
@attrs = ('groups');
|
||||
%nodehash = xCAT::DBobjUtils->getobjdefs(\%nhash, 0, \@attrs);
|
||||
if (!(%nodehash))
|
||||
{
|
||||
my $rsp;
|
||||
@ -4222,7 +4222,7 @@ sub initialize_variables
|
||||
%::CLIATTRS = ();
|
||||
%::FILEATTRS = ();
|
||||
%::FINALATTRS = ();
|
||||
%::objfilehash = ();
|
||||
# %::objfilehash = ();
|
||||
%::WhereHash = ();
|
||||
@::AttrList = ();
|
||||
%::NicsAttrHash = ();
|
||||
|
@ -1979,20 +1979,24 @@ sub addkitcomp
|
||||
# Read serverrole from osimage.
|
||||
$os{$osimage}{serverrole} = lc($osimagetable->{'serverrole'});
|
||||
|
||||
} elsif ( !$osimagetable or !$osimagetable->{'osname'} ) {
|
||||
} elsif ( !$osimagetable ) {
|
||||
my %rsp;
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osname' attribute";
|
||||
push@{ $rsp{data} }, "osimage $osimage does not exist";
|
||||
xCAT::MsgUtils->message( "E", \%rsp, $callback );
|
||||
return 1;
|
||||
} elsif ( !$osimagetable->{'osname'} ) {
|
||||
my %rsp;
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osname' attribute";
|
||||
xCAT::MsgUtils->message( "E", \%rsp, $callback );
|
||||
return 1;
|
||||
|
||||
} elsif ( !$osimagetable->{'osvers'} ) {
|
||||
my %rsp;
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osvers' attribute";
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osvers' attribute";
|
||||
xCAT::MsgUtils->message( "E", \%rsp, $callback );
|
||||
return 1;
|
||||
} elsif ( !$osimagetable->{'osarch'} ) {
|
||||
my %rsp;
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osarch' attribute";
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osarch' attribute";
|
||||
xCAT::MsgUtils->message( "E", \%rsp, $callback );
|
||||
return 1;
|
||||
} else {
|
||||
@ -3336,20 +3340,24 @@ sub chkkitcomp
|
||||
# Read serverrole from osimage.
|
||||
$os{$osimage}{serverrole} = lc($osimagetable->{'serverrole'});
|
||||
|
||||
} elsif ( !$osimagetable or !$osimagetable->{'osname'} ) {
|
||||
} elsif ( !$osimagetable ) {
|
||||
my %rsp;
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osname' attribute";
|
||||
push@{ $rsp{data} }, "osimage $osimage does not exist";
|
||||
xCAT::MsgUtils->message( "E", \%rsp, $callback );
|
||||
return 1;
|
||||
} elsif ( !$osimagetable->{'osname'} ) {
|
||||
my %rsp;
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osname' attribute";
|
||||
xCAT::MsgUtils->message( "E", \%rsp, $callback );
|
||||
return 1;
|
||||
|
||||
} elsif ( !$osimagetable->{'osvers'} ) {
|
||||
my %rsp;
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osvers' attribute";
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osvers' attribute";
|
||||
xCAT::MsgUtils->message( "E", \%rsp, $callback );
|
||||
return 1;
|
||||
} elsif ( !$osimagetable->{'osarch'} ) {
|
||||
my %rsp;
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contains a valid 'osarch' attribute";
|
||||
push@{ $rsp{data} }, "osimage $osimage does not contain a valid 'osarch' attribute";
|
||||
xCAT::MsgUtils->message( "E", \%rsp, $callback );
|
||||
return 1;
|
||||
} else {
|
||||
|
@ -53,6 +53,9 @@ sub process_request {
|
||||
if (! $arch) {
|
||||
$callback->({error=>"Need to specify architecture (x86, x86_64 or ppc64)"},{errorcode=>[1]});
|
||||
return;
|
||||
} elsif ( $arch eq "ppc64le" or $arch eq "ppc64el" ) {
|
||||
$callback->({data=>"The arch:$arch is not supported at present, pls use \"ppc64\" instead"});
|
||||
return;
|
||||
}
|
||||
unless (-d "$::XCATROOT/share/xcat/netboot/$arch" or -d "$::XCATROOT/share/xcat/netboot/genesis/$arch") {
|
||||
$callback->({error=>"Unable to find directory $::XCATROOT/share/xcat/netboot/$arch or $::XCATROOT/share/xcat/netboot/genesis/$arch",errorcode=>[1]});
|
||||
|
@ -936,6 +936,8 @@ unless ($pid_UDP) {
|
||||
my $discoctl;
|
||||
my $udpbroker;
|
||||
socketpair($discoctl,$udpbroker,AF_UNIX,SOCK_STREAM,PF_UNSPEC);
|
||||
$udpbroker->autoflush(1);
|
||||
$discoctl->autoflush(1);
|
||||
$pid_disco = xCAT::Utils->xfork;
|
||||
if (!defined $pid_disco) {
|
||||
xCAT::MsgUtils->message("S", "Unable to fork for UDP/TCP");
|
||||
|
@ -149,7 +149,7 @@ then
|
||||
fi
|
||||
|
||||
# remove the nic configuration files which are included in $NIC_IBNICS
|
||||
for nic in echo "$NIC_IBNICS" | tr "," "\n"
|
||||
for nic in `echo "$NIC_IBNICS" | tr "," "\n"`
|
||||
do
|
||||
rm -f $dir/ifcfg-$nic 2>&1 1>/dev/null
|
||||
done
|
||||
|
@ -396,31 +396,36 @@ hasdpkg=0
|
||||
supdatecommand="rpm -Uvh --replacepkgs"
|
||||
sremovecommand="rpm -ev"
|
||||
|
||||
result=`rpm --version 2>/dev/null`
|
||||
#In ubuntu, rpm can be installed, if rpm is installed,ubuntu will use rpm
|
||||
#So dpkg --version should be in front of rpm --version
|
||||
result=`dpkg --version 2>/dev/null`
|
||||
if [ $? -eq 0 ]; then
|
||||
hasrpm=1
|
||||
result=`rpm -q yum`
|
||||
if [ $? -eq 0 ]; then
|
||||
hasyum=1
|
||||
else
|
||||
result=`rpm -q zypper`
|
||||
if [ "$?" = "0" ]; then
|
||||
haszypper=1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
result=`dpkg --version`
|
||||
hasdpkg=1
|
||||
supdatecommand="dpkg -i"
|
||||
sremovecommand="dpkg -r"
|
||||
result=`dpkg -l apt`
|
||||
if [ $? -eq 0 ]; then
|
||||
hasdpkg=1
|
||||
supdatecommand="dpkg -i"
|
||||
sremovecommand="dpkg -r"
|
||||
result=`dpkg -l apt`
|
||||
if [ $? -eq 0 ]; then
|
||||
hasapt=1
|
||||
fi
|
||||
hasapt=1
|
||||
fi
|
||||
else
|
||||
result=`rpm --version 2>/dev/null`
|
||||
if [ $? -eq 0 ]; then
|
||||
hasrpm=1
|
||||
result=`rpm -q yum`
|
||||
if [ $? -eq 0 ]; then
|
||||
hasyum=1
|
||||
else
|
||||
result=`rpm -q zypper`
|
||||
if [ "$?" = "0" ]; then
|
||||
haszypper=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
###########
|
||||
##start generating the os pkg repositories
|
||||
if ( pmatch "$OSVER" "sles11*" && [ $haszypper -eq 1 ] ); then
|
||||
|
Loading…
Reference in New Issue
Block a user