diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index acadf67ca..db2bd36c5 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -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', diff --git a/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_updates b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_updates index 6ab6eaabb..5d8c9fd34 100755 --- a/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_updates +++ b/xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_updates @@ -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 diff --git a/xCAT-buildkit/share/xcat/kits/debian_template/preinst b/xCAT-buildkit/share/xcat/kits/debian_template/preinst index 6232bd33d..30b8a5598 100644 --- a/xCAT-buildkit/share/xcat/kits/debian_template/preinst +++ b/xCAT-buildkit/share/xcat/kits/debian_template/preinst @@ -17,10 +17,12 @@ set -e case "$1" in install) <<>> + echo "preinstall processing" ;; upgrade) if [ -f /tmp/<<>> ]; then + echo "preupgrade processing" <<>> fi ;; diff --git a/xCAT-genesis-scripts/debian/postinst b/xCAT-genesis-scripts/debian/postinst index f5e28d707..55a4d98bb 100644 --- a/xCAT-genesis-scripts/debian/postinst +++ b/xCAT-genesis-scripts/debian/postinst @@ -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 manually'" touch /etc/xcat/genesis-scripts-updated ;; diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index d211af164..e61152906 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -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 = (); diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 5f01a8db4..a96754747 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -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 { diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index e4cd41283..4bae8272b 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -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]}); diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 3ad667574..bb10bdf60 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -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"); diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index 4717c1339..904dd0da3 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -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 diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index 6d3e771c8..2845b5130 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -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