From aea40b0226eb36745cef53835c539c101be8f119 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Sat, 4 Oct 2014 23:20:48 -0700 Subject: [PATCH 01/10] fix an issue about hardware discovery process: the sub process can not receive findme request immediately --- xCAT-server/sbin/xcatd | 2 ++ 1 file changed, 2 insertions(+) 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"); From 590b18a34c718b55087babca890f08770a2764a9 Mon Sep 17 00:00:00 2001 From: mellor Date: Mon, 6 Oct 2014 10:19:57 -0400 Subject: [PATCH 02/10] defect 4277 - allow gpfs_updates script to create gpfs.csh profile that works for both csh and tcsh --- xCAT-IBMhpc/share/xcat/IBMhpc/gpfs/gpfs_updates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From e9dd282fdf886879de96c0b059eb584c1acc2d28 Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 7 Oct 2014 14:05:22 -0400 Subject: [PATCH 03/10] defect 4282 fix debian preinstall script errors --- xCAT-buildkit/share/xcat/kits/debian_template/preinst | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-buildkit/share/xcat/kits/debian_template/preinst b/xCAT-buildkit/share/xcat/kits/debian_template/preinst index 6232bd33d..40bdc2df5 100644 --- a/xCAT-buildkit/share/xcat/kits/debian_template/preinst +++ b/xCAT-buildkit/share/xcat/kits/debian_template/preinst @@ -21,6 +21,7 @@ case "$1" in upgrade) if [ -f /tmp/<<>> ]; then + echo "preupgrade processing" <<>> fi ;; From f5296e4107411e561263d57df0c2706da4872da9 Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 7 Oct 2014 17:47:53 -0400 Subject: [PATCH 04/10] fix def mapping of kitrepo osbasename attribute --- perl-xCAT/xCAT/Schema.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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', From cc67df3caafdb1190421fe0b1d8f2fc6ee182e42 Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 7 Oct 2014 18:03:47 -0400 Subject: [PATCH 05/10] minor error msg fixes for kit cmds --- xCAT-server/lib/xcat/plugins/kit.pm | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) 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 { From 32d389cbee34639f6a7b1507c0e6751468cf505b Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Tue, 7 Oct 2014 23:19:36 -0700 Subject: [PATCH 06/10] add message for 'mknb' in ubuntu LE --- xCAT-genesis-scripts/debian/postinst | 1 + xCAT-server/lib/xcat/plugins/mknb.pm | 3 +++ 2 files changed, 4 insertions(+) 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/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]}); From b76e15c4876736d6f1248c670777568d5aa84787 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 8 Oct 2014 08:09:37 -0400 Subject: [PATCH 07/10] minor fix for configib --- xCAT/postscripts/configib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 97df5ec9a646591e735863e012135dfbeb567765 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Wed, 8 Oct 2014 04:32:48 -0400 Subject: [PATCH 08/10] In ubuntu, rpm can be installed, if rpm is installed,ubuntu will use rpm instead of dpkg,so check dpkg first --- xCAT/postscripts/otherpkgs | 45 +++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 20 deletions(-) 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 From ee82fa97b48f447b4dbfc965978b604382e971d0 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Wed, 8 Oct 2014 09:06:52 -0400 Subject: [PATCH 09/10] add fix debian preinstall script errors --- xCAT-buildkit/share/xcat/kits/debian_template/preinst | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-buildkit/share/xcat/kits/debian_template/preinst b/xCAT-buildkit/share/xcat/kits/debian_template/preinst index 40bdc2df5..30b8a5598 100644 --- a/xCAT-buildkit/share/xcat/kits/debian_template/preinst +++ b/xCAT-buildkit/share/xcat/kits/debian_template/preinst @@ -17,6 +17,7 @@ set -e case "$1" in install) <<>> + echo "preinstall processing" ;; upgrade) From 5cb4f7a8d9121fd8303ebe39ef9967d637f60d93 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 8 Oct 2014 13:51:48 -0400 Subject: [PATCH 10/10] bug #4081, remove syntax warnings --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 46 ++++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) 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 = ();