From 52f78c5449305921d71abc5b83381f06e3e35ade Mon Sep 17 00:00:00 2001 From: daniceexi Date: Tue, 10 Mar 2015 01:25:11 -0400 Subject: [PATCH 01/19] defect 4586: copy /proc/cpuinfo from host node to rootimage --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 7dc708701..a2cdc9cd6 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -320,6 +320,10 @@ unless ($onlyinitrd) { print "Error: cannnot create bootstraps for rootimage. Make sure you specified full http mirror path.\n"; exit 1; } + + # Since kernel-image package needs the /proc/cpuinfo file to validate the cpu type, + # copy the /proc/cpuinfo from host node + copy("/proc/cpuinfo", "$rootimg_dir/proc/cpuinfo"); # Prepare the installation mirror for the package install print("Mount /proc, /dev, /sys, pkgdir and otherpkgdir to the rootimg.\n"); From 9e2ca8863851cf05c4a2dd64dd8d5acf5fc0e8ae Mon Sep 17 00:00:00 2001 From: daniceexi Date: Tue, 10 Mar 2015 03:47:48 -0400 Subject: [PATCH 02/19] defect:4592 ubuntu:genimage, move the running of postinstall script before determining the linux kernel version since postinstall script might add new kernel pakcage --- .../share/xcat/netboot/ubuntu/genimage | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index a2cdc9cd6..3f906064a 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -584,6 +584,31 @@ unless ($onlyinitrd) { postscripts(); #run 'postscripts' } +#-- run postinstall script +unless ($imagename) { + $postinstall_filename= imgutils::get_profile_def_filename($osver, $profile, $arch, $customdir, "postinstall"); + unless ($postinstall_filename) { + $postinstall_filename= imgutils::get_profile_def_filename($osver, $profile, $arch, $pathtofiles, "postinstall"); + } +} + +if ( $postinstall_filename ) { + + $updates{'postinstall'} = $postinstall_filename if ($tempfile); + + foreach my $postinstall ( split /,/, $postinstall_filename ) { + if ( !-x $postinstall ) { + print "postinstall script $postinstall is not executable\n"; + exit 1; + } + my $rc = system($postinstall, $rootimg_dir,$osver,$arch,$profile); + if($rc) { + print "postinstall script $postinstall failed\n"; + exit 1; + } + } +} + # Default to the first kernel found in the install image if nothing specified explicitly. # A more accurate guess than whatever the image build server happens to be running # If specified, that takes precedence. @@ -668,31 +693,6 @@ if (-d "$rootimg_dir/usr/share/dracut") { print "Enter the dracut mode. Dracut version: $dracutver. Dracut directory: $dracutdir.\n"; } -#-- run postinstall script -unless ($imagename) { - $postinstall_filename= imgutils::get_profile_def_filename($osver, $profile, $arch, $customdir, "postinstall"); - unless ($postinstall_filename) { - $postinstall_filename= imgutils::get_profile_def_filename($osver, $profile, $arch, $pathtofiles, "postinstall"); - } -} - -if ( $postinstall_filename ) { - - $updates{'postinstall'} = $postinstall_filename if ($tempfile); - - foreach my $postinstall ( split /,/, $postinstall_filename ) { - if ( !-x $postinstall ) { - print "postinstall script $postinstall is not executable\n"; - exit 1; - } - my $rc = system($postinstall, $rootimg_dir,$osver,$arch,$profile); - if($rc) { - print "postinstall script $postinstall failed\n"; - exit 1; - } - } -} - # all the attributes have been gathered # now, update the linuximage and osimage tables # TODO: do statelite and stateless share the same attributes? From e5cee0d4332df363b2635bc602b25c75684065fb Mon Sep 17 00:00:00 2001 From: Jia Zhao Date: Tue, 10 Mar 2015 19:52:07 +0800 Subject: [PATCH 03/19] fix nodeimport error on PowerNV node --- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index 743101e38..778eea607 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -1261,6 +1261,13 @@ sub gen_chain_for_profiles{ unless ($netprofileattr){ return (1, "Can not get attributes for network profile $netprofile"); } + + # Get node's netboot attribute + my ($retcode, $retval) = xCAT::ProfiledNodeUtils->get_netboot_attr($imgprofile, $hwprofile); + if (not $retcode) { + return (1, $retval); + } + my $netboot = $retval; $final_chain = 'osimage='.$provmethod.":--noupdateinitrd"; # get the chain attribute from hardwareprofile and insert it to node. @@ -1273,7 +1280,8 @@ sub gen_chain_for_profiles{ } } #run bmcsetups. - if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig){ + #PowerNV nodes can't use 'runcmd=bmcsetup' to set BMC. + if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig and $netboot ne 'petitboot'){ if (index($final_chain, "runcmd=bmcsetup") == -1){ $final_chain = 'runcmd=bmcsetup,'.$final_chain.':reboot4deploy'; } @@ -1383,7 +1391,7 @@ sub get_netboot_attr{ # 1 | x86_64/x86 | * | * | * | xnba | # 2 | ppc64 | rhels | 7 | * | grub2 | # 3 | | * | * | * | yaboot | -# 4 | ppc64le/el | * | * | IBM_PowerNV | petiboot | +# 4 | ppc64le/el | * | * | IBM_PowerNV | petitboot | # 5 | | * | * | * | grub2 | # arch osname version hardware netboot my %netboot_dict = ( 'x86_64' => 'xnba', @@ -1397,7 +1405,7 @@ sub get_netboot_attr{ 'ppc64le' => { '*' => { '*' => { - 'IBM_PowerNV' => 'petiboot', + 'IBM_PowerNV' => 'petitboot', '*' => 'grub2', }, }, From 551bc0ab1160ca43a00fa4f3fed5582b1550bd4d Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 10 Mar 2015 08:41:52 -0400 Subject: [PATCH 04/19] defect 4494: fix lskmodules to find both *.deb and *.udeb packages --- xCAT-server/lib/xcat/plugins/kmodules.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kmodules.pm b/xCAT-server/lib/xcat/plugins/kmodules.pm index 1801c87a9..9f22a645e 100644 --- a/xCAT-server/lib/xcat/plugins/kmodules.pm +++ b/xCAT-server/lib/xcat/plugins/kmodules.pm @@ -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 { From 8f90acc07cb7e5715b49606f34a944931f23d736 Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 10 Mar 2015 14:49:54 -0400 Subject: [PATCH 05/19] defect 4349: fix rmkitcomp othepkgs dir removal; fix typo in Schema.pm to now display kitcomponent reponame correctly --- perl-xCAT/xCAT/Schema.pm | 2 +- xCAT-server/lib/xcat/plugins/kit.pm | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index f9574c00a..c1deed358 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -3710,7 +3710,7 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs); access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname', }, {attr_name => 'kitreponame', - tabentry => 'kitcomponent.kitrepoid', + tabentry => 'kitcomponent.kitreponame', access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname', }, {attr_name => 'basename', diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 1c50f3b5b..ac1393f31 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -2737,7 +2737,7 @@ sub rmkitcomp # Read all the kitcomponents assigned to all the osimage to make sure the repo used by other osimage # will not be deleted. - my @allosikitcomps = $tabs{osimage}->getAllAttribs( 'imagename', 'kitcomponents' ); + my @allosikitcomps = $tabs{osimage}->getAllAttribs( 'imagename', 'kitcomponents','otherpkgdir' ); (my $linuximagetable) = $tabs{linuximage}->getAttribs({imagename=> $osimage}, 'postinstall', 'exlist', 'otherpkglist', 'otherpkgdir', 'driverupdatesrc'); if ( $linuximagetable and $linuximagetable->{otherpkgdir} ) { @@ -2750,7 +2750,11 @@ sub rmkitcomp if ( $allosikitcomp->{kitcomponents} and $allosikitcomp->{imagename} ) { my @allkitcomps = split /,/, $allosikitcomp->{kitcomponents}; foreach my $allkitcomp ( @allkitcomps ) { - if ( $allosikitcomp->{imagename} ne $osimage or $allkitcomp ne $kitcomponent ) { + if ( (($allosikitcomp->{imagename} ne $osimage) and + ( $allosikitcomp->{otherpkgdir} eq $otherpkgdir )) + or ($allkitcomp ne $kitcomponent) ) { + +} $newosikitcomponents{$allkitcomp} = 1; } } From d009a51b1c5318cb2f9b4a2ab8f6787f7fd7c663 Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 10 Mar 2015 17:12:50 -0400 Subject: [PATCH 06/19] defect 4349: update previous fix to rmkitcomp --- xCAT-server/lib/xcat/plugins/kit.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index ac1393f31..7f07f9f72 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -2737,7 +2737,7 @@ sub rmkitcomp # Read all the kitcomponents assigned to all the osimage to make sure the repo used by other osimage # will not be deleted. - my @allosikitcomps = $tabs{osimage}->getAllAttribs( 'imagename', 'kitcomponents','otherpkgdir' ); + my @allosikitcomps = $tabs{osimage}->getAllAttribs( 'imagename', 'kitcomponents' ); (my $linuximagetable) = $tabs{linuximage}->getAttribs({imagename=> $osimage}, 'postinstall', 'exlist', 'otherpkglist', 'otherpkgdir', 'driverupdatesrc'); if ( $linuximagetable and $linuximagetable->{otherpkgdir} ) { @@ -2748,13 +2748,13 @@ sub rmkitcomp my %newosikitcomponents; foreach my $allosikitcomp (@allosikitcomps) { if ( $allosikitcomp->{kitcomponents} and $allosikitcomp->{imagename} ) { + (my $allosiotherpkgdir) = $tabs{linuximage}->getAttribs({imagename=> $allosikitcomp->{imagename}}, 'otherpkgdir'); + my @allkitcomps = split /,/, $allosikitcomp->{kitcomponents}; foreach my $allkitcomp ( @allkitcomps ) { if ( (($allosikitcomp->{imagename} ne $osimage) and - ( $allosikitcomp->{otherpkgdir} eq $otherpkgdir )) - or ($allkitcomp ne $kitcomponent) ) { - -} + ($allosiotherpkgdir->{otherpkgdir} eq $otherpkgdir)) + or ($allkitcomp ne $kitcomponent) ) { $newosikitcomponents{$allkitcomp} = 1; } } From acd15d4648880a32db87f943b2e52490eed38664 Mon Sep 17 00:00:00 2001 From: baiyuan Date: Tue, 10 Mar 2015 23:33:21 -0400 Subject: [PATCH 07/19] fix confignics -s to config installnic when installnic is not in nics table --- xCAT/postscripts/confignics | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/confignics b/xCAT/postscripts/confignics index 6be53a5f4..7122d7749 100755 --- a/xCAT/postscripts/confignics +++ b/xCAT/postscripts/confignics @@ -217,6 +217,8 @@ fi splitconfig "$NICIPS" splitconfig "$NICCUSTOMSCRIPTS" + + if [ $boot_myscript -eq 1 ];then . $str_dir_name/$myscript if [ $? -ne 0 ];then @@ -273,9 +275,11 @@ if [ $bool_remove -eq 1 ];then configeth -r $str_temp_nic done fi - old_ifs=$IFS IFS=$' ' +if [ $bool_cfg_inst_nic -eq 1 ];then + str_all_nics=$str_all_nics" "$str_inst_nic +fi array_nics_temp=($str_all_nics) IFS=$old_ifs for key in ${array_nics_temp[@]} @@ -341,7 +345,6 @@ do fi fi done - if [ -n "$str_ib_nics" ];then logger -t xcat -p local4.info "confignics: executed script: configib for nics: $str_ib_nics, ports: $num_iba_ports" echo "confignics on $NODE: executed script: configib for nics: $str_ib_nics, ports: $num_iba_ports" From 3a65b11326b560567e2f1b4c2c2d056a98668d04 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 11 Mar 2015 04:04:04 -0400 Subject: [PATCH 08/19] defect 4586: when run genimage for ubuntu, grub_pc package cannot be configured correctly (postinst failed). It will cause the failure of genimage. use environment variable [DEBIAN_FRONTEND=noninteractive] for each apt-get run to make the apt-get default action is to say yes for any question --- xCAT-server/share/xcat/netboot/ubuntu/genimage | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index 3f906064a..4edff6ac0 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -280,15 +280,11 @@ unless ($onlyinitrd) { my @line=split(" ",`ls -lh $installroot/$osver/$arch/dists/ | grep dr`); my $dist = $line[@line-1]; -# my $aptgetcmd = "chroot $rootimg_dir apt-get update && chroot $rootimg_dir apt-get $non_interactive "; - - # If there is env in otherpkg list - # apt-get update and apt-get install should be added env param - my $aptgetcmd = "chroot $rootimg_dir apt-get update"; - my $aptgetcmdby="chroot $rootimg_dir apt-get $non_interactive "; - - - my $aptcachecmd = "chroot $rootimg_dir apt-get update && chroot $rootimg_dir apt-cache $non_interactive "; + # If there is env in otherpkg list + # apt-get update and apt-get install should be added env param + my $aptgetcmd = "DEBIAN_FRONTEND=noninteractive chroot $rootimg_dir apt-get update"; + my $aptgetcmdby = "DEBIAN_FRONTEND=noninteractive chroot $rootimg_dir apt-get $non_interactive "; + my $aptcachecmd = "DEBIAN_FRONTEND=noninteractive chroot $rootimg_dir apt-get update && chroot $rootimg_dir apt-cache $non_interactive "; my $aptcmd1 = "debootstrap"; #my $aptcmd2 = "--arch $uarch $dist $rootimg_dir file://$installroot/$osver/$arch/"; my $aptcmd2; From 793a6c170968867abfd43882b85488c3a0bdb2fb Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 11 Mar 2015 06:04:50 -0400 Subject: [PATCH 09/19] defect 4539: for rh7, remove the HWADDR entry from ifcfg-ethx files to skip the deadlock of cfg in ifcfg-ethx and real system --- xCAT-server/share/xcat/install/scripts/post.rhels7 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-server/share/xcat/install/scripts/post.rhels7 b/xCAT-server/share/xcat/install/scripts/post.rhels7 index 5a15719d6..41127db68 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/post.rhels7 @@ -6,4 +6,8 @@ do 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 From c51cfca5e1c98ce3a1be7abdd68078932652baef Mon Sep 17 00:00:00 2001 From: chudegao Date: Wed, 11 Mar 2015 18:02:31 +0800 Subject: [PATCH 10/19] fix feature request 189, support not contain existing postscript in kit --- xCAT-server/lib/xcat/plugins/kit.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 7f07f9f72..20a771fbe 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -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/" ) { From ff2e58e66f039e961cefde2ec351fa6147709ef6 Mon Sep 17 00:00:00 2001 From: amy0701 Date: Thu, 12 Mar 2015 01:27:24 -0400 Subject: [PATCH 11/19] fix confignics -s does not work in postscripts --- xCAT/postscripts/configeth | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 7a571db44..590a78598 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash # IBM(c) 2014 EPL license http://www.eclipse.org/legal/epl-v10.html # Internal script used by confignics only. # It configs the Ethernet adpaters on the node @@ -502,6 +502,21 @@ elif [ "$1" = "-s" ];then str_inst_ip=`grep fixed-address $str_lease_file | tail -n 1 | awk '{print $2}' | sed 's/;$//'` str_inst_mask=`grep subnet-mask $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` str_inst_gateway=`grep routers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` + else + if [ -n "$MACADDRESS" ];then + str_inst_mac=$MACADDRESS + inst_nic=`ip -o link |grep -i ${str_inst_mac} |awk '{print $2}'|sed 's/://g'` + if [ ! -z "${inst_nic}" ];then + str_inst_ip=`ip -4 -o addr|grep -i ${inst_nic} |awk '{print $4}'|awk -F/ '{print $1}'` + if [ ! -z "str_inst_ip" ];then + inst_ip_pre=`ip ro ls|grep -i ${str_inst_ip}|awk '{print $1}'|awk -F/ '{print $1}'` + if [ ! -z "inst_ip_pre" ];then + str_inst_mask=`route |grep ${inst_ip_pre}|awk '{print $3}'|head -1` + fi + fi + fi + str_inst_gateway=`ip ro ls|grep default|awk '{print $3}'|head -1` + fi fi elif [ -f "/etc/SuSE-release" ];then str_lease_file="/var/lib/dhcpcd/dhcpcd-"$str_inst_nic".info" @@ -516,6 +531,21 @@ elif [ "$1" = "-s" ];then str_inst_ip=`grep fixed-address $str_lease_file | tail -n 1 | awk '{print $2}' | sed 's/;$//'` str_inst_mask=`grep subnet-mask $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` str_inst_gateway=`grep routers $str_lease_file | tail -n 1 | awk '{print $3}' | sed 's/;$//'` + else + if [ -n "$MACADDRESS" ];then + str_inst_mac=$MACADDRESS + inst_nic=`ip -o link |grep -i ${str_inst_mac} |awk '{print $2}'|sed 's/://g'` + if [ ! -z "${inst_nic}" ];then + str_inst_ip=`ip -4 -o addr|grep -i ${inst_nic} |awk '{print $4}'|awk -F/ '{print $1}'` + if [ ! -z "str_inst_ip" ];then + inst_ip_pre=`ip ro ls|grep -i ${str_inst_ip}|awk '{print $1}'|awk -F/ '{print $1}'` + if [ ! -z "inst_ip_pre" ];then + str_inst_mask=`route |grep ${inst_ip_pre}|awk '{print $3}'|head -1` + fi + fi + fi + str_inst_gateway=`ip ro ls|grep default|awk '{print $3}'|head -1` + fi fi fi if [ -n "$MACADDRESS" ];then From 7ff60abe6e4a702172920bcc47d0d7c9b54bc0ba Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 11 Mar 2015 20:55:48 -0700 Subject: [PATCH 12/19] put xCAT-genesis-scripts-ppc64 in PCM build --- buildcore.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildcore.sh b/buildcore.sh index f5897f5ae..6cf311196 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -49,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" +PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64" # Note: for FSM, the FlexCAT rpm is built separately from gsa/git FSMBUILD="perl-xCAT xCAT-client xCAT-server" FSMLINK="" From 7333896fcb15d23eaefebfc5c8031632df0045a7 Mon Sep 17 00:00:00 2001 From: litingt Date: Wed, 11 Mar 2015 21:22:47 -0700 Subject: [PATCH 13/19] add xCAT-vlan for PCM team --- buildcore.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildcore.sh b/buildcore.sh index 6cf311196..8a22a7cd0 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -49,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" +PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 xCAT-vlan" # Note: for FSM, the FlexCAT rpm is built separately from gsa/git FSMBUILD="perl-xCAT xCAT-client xCAT-server" FSMLINK="" From ebe61dbab5bdd69a92504fe7168146a903920d46 Mon Sep 17 00:00:00 2001 From: Jia Zhao Date: Thu, 12 Mar 2015 17:30:02 +0800 Subject: [PATCH 14/19] fix nodeimport getting netboot attribute error --- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 35 ++++++++++++------- xCAT-server/lib/xcat/plugins/profilednodes.pm | 16 +++++---- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index 778eea607..ce7989c72 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -1351,7 +1351,6 @@ sub get_netboot_attr{ { return 0, "Hardware profile not defined in DB." } - $hardwareprofile =~ s/^__HardwareProfile_//; } else { @@ -1384,16 +1383,28 @@ sub get_netboot_attr{ { $os_arch = 'x86_64'; } + + # Identify whether this node is PowerKVM or PowerNV if os arch is ppc64le + # If hardware profile is defined + my $mgt = '*'; + if ($os_arch eq 'ppc64le' and $hardwareprofile ne '*') { + my $nodehmtab = xCAT::Table->new('nodehm'); + my $nodehmtab_entry = $nodehmtab->getNodeAttribs($hardwareprofile, ['mgt']); + if (defined $nodehmtab_entry->{'mgt'}) { + $mgt = $nodehmtab_entry->{'mgt'}; + } + } + # Rule for netboot attribute.If update the rule,just update %netboot_dict and @condition_array # It's sequence sensitive: os arch -> os name -> os major version -> hardware profile -# Priority | Arch | OS Name | OS Major Version | Hardware Profile | Noderes.netboot | -# 1 | x86_64/x86 | * | * | * | xnba | -# 2 | ppc64 | rhels | 7 | * | grub2 | -# 3 | | * | * | * | yaboot | -# 4 | ppc64le/el | * | * | IBM_PowerNV | petitboot | -# 5 | | * | * | * | grub2 | -# arch osname version hardware netboot +# Priority | Arch | OS Name | OS Major Version | Management method | Noderes.netboot | +# 1 | x86_64/x86 | * | * | * | xnba | +# 2 | ppc64 | rhels | 7 | * | grub2 | +# 3 | | * | * | * | yaboot | +# 4 | ppc64le/el | * | * | * | grub2 +# 4 | ppc64le/el | * | * | ipmi | petitboot +# arch osname version hardware netboot my %netboot_dict = ( 'x86_64' => 'xnba', 'ppc64' => { 'rhels' => { @@ -1405,20 +1416,20 @@ sub get_netboot_attr{ 'ppc64le' => { '*' => { '*' => { - 'IBM_PowerNV' => 'petitboot', - '*' => 'grub2', + '*' => 'grub2', + 'ipmi' => 'petitboot', }, }, }, ); - my $condition_array_ref = [$os_arch, $os_name, $os_major_version, $hardwareprofile]; + my $condition_array_ref = [$os_arch, $os_name, $os_major_version, $mgt]; $netboot = cal_netboot(\%netboot_dict, $condition_array_ref); if($netboot eq '0') { return 0, "Can not get the netboot attribute"; } else - { + { return 1, $netboot; } } diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index d674c4c4a..a4c2f4d84 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -839,6 +839,14 @@ Usage: if(exists $args_dict{'hardwareprofile'}){ $hardwareprofile = $args_dict{'hardwareprofile'}; } + + # 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; # After checking, all nodes' profile should be same # Get the new profile with specified ones in args_dict @@ -879,13 +887,7 @@ Usage: 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; From 1636b11e4b95b9822a0c35129802ca182e5a7895 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 12 Mar 2015 07:02:35 -0700 Subject: [PATCH 15/19] fix defect #4595 [FVT]:CN ip is not correctly configured on sles11.3 when installnic and primarynic is blank --- xCAT-server/share/xcat/install/scripts/chroot.sles | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/chroot.sles b/xCAT-server/share/xcat/install/scripts/chroot.sles index 7698db4e8..cf22e985a 100644 --- a/xCAT-server/share/xcat/install/scripts/chroot.sles +++ b/xCAT-server/share/xcat/install/scripts/chroot.sles @@ -46,7 +46,15 @@ if [ -z "$PRINIC" ] then for karg in $(cat /proc/cmdline |sed -e 's/-/:/g' -e 's/ /\n/g'); do if [ "${karg%%=*}" = "BOOTIF" ]; then - export PRINIC=`ifconfig -a|grep -i "hwaddr ${karg#*=01:}"|awk '{print $1}'` + #export PRINIC=`ifconfig -a|grep -i "hwaddr ${karg#*=01:}"|awk '{print $1}'` + export PRINIC=${karg#*=01:} + export PRINIC=`ip -o link|grep -i "$PRINIC"|awk '{print $2}'|sed s/://` + fi + if [ "${karg%%=*}" = "netdevice" ]; then + export PRINIC="${karg#*=}"; + if [ "${#PRINIC}" = "20" ]; then + export PRINIC=${PRINIC:3:21} + fi fi done if [ -z "$PRINIC" ]; then @@ -57,7 +65,8 @@ if [ -z "$PRINIC" ] then export PRINIC=eth0 elif [[ `echo "$PRINIC" | grep -sqE ^[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+:[A-Fa-f0-9]+$ ;echo $?` == "0" ]]; then - export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'` + #export PRINIC=`ifconfig -a | grep -i "HWaddr $PRINIC" | awk '{print $1}'` + export PRINIC=`ip -o link|grep -i "$PRINIC"|awk '{print $2}'|sed s/://` fi echo 'export PRINIC='"$PRINIC" > /mnt/tmp/prinicsetting ]]> From f66b9b9c126fe38ba88cfdefe3d10977ea71489b Mon Sep 17 00:00:00 2001 From: xCAT Build Machine Date: Thu, 12 Mar 2015 11:16:52 -0400 Subject: [PATCH 16/19] Fix some minor formatting issue in buildcore.sh --- buildcore.sh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/buildcore.sh b/buildcore.sh index f5897f5ae..4ff8f272c 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -85,21 +85,19 @@ if [ "$OSNAME" != "AIX" ]; then echo "Can't get lock /var/lock/xcatbld-$REL.lock. Someone else must be doing a build right now. Exiting...." exit 1 fi - - export HOME=/root # This is so rpm and gpg will know home, even in sudo + # This is so rpm and gpg will know home, even in sudo + export HOME=/root fi # for the git case, query the current branch and set REL (changing master to devel if necessary) function setbranch { - #git checkout $BRANCH - #REL=`git rev-parse --abbrev-ref HEAD` REL=`git name-rev --name-only HEAD` if [ "$REL" = "master" ]; then REL="devel" fi } -if [ "$REL" = "xcat-core" ]; then # using git +if [ "$REL" = "xcat-core" ]; then # using git GIT=1 setbranch # this changes the REL variable fi @@ -131,7 +129,7 @@ fi XCATCORE="xcat-core" # core-snap is a sym link to xcat-core -if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms +if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms DESTDIR=../../$REL$EMBEDDIR/$XCATCORE else DESTDIR=../..$EMBEDDIR/$XCATCORE @@ -184,7 +182,8 @@ fi # If they have not given us a premade update file, do an svn update or git pull and capture the results SOMETHINGCHANGED=0 -if [ "$GIT" = "1" ]; then # using git +if [ "$GIT" = "1" ]; then + # using git if [ -z "$GITUP" ]; then GITUP=../coregitup echo "git pull > $GITUP" @@ -198,7 +197,8 @@ if [ "$GIT" = "1" ]; then # using git if ! $GREP 'Already up-to-date' $GITUP; then SOMETHINGCHANGED=1 fi -else # using svn +else + # using svn GIT=0 if [ -z "$SVNUP" ]; then SVNUP=../coresvnup @@ -242,7 +242,6 @@ fi # Build the rest of the noarch rpms for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT-SoftLayer xCAT-vlan xCAT-confluent; do - #if [ "$EMBED" = "zvm" -a "$rpmname" != "xCAT-server" -a "$rpmname" != "xCAT-UI" ]; then continue; fi # for zvm embedded env only need to build server and UI if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-buildkit" ]; then continue; fi # do not build xCAT-buildkit on aix if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-SoftLayer" ]; then continue; fi # do not build xCAT-softlayer on aix @@ -253,7 +252,8 @@ for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xC maker $rpmname fi if [ "$OSNAME" = "AIX" ]; then - if [ "$rpmname" = "xCAT-client" -o "$rpmname" = "xCAT-server" ]; then # we do not automatically install the rest of the rpms on AIX + if [ "$rpmname" = "xCAT-client" -o "$rpmname" = "xCAT-server" ]; then + # we do not automatically install the rest of the rpms on AIX echo "rpm -Uvh $rpmname-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat fi fi @@ -281,9 +281,7 @@ if [ "$OSNAME" != "AIX" ]; then fi # Build the xCAT and xCATsn rpms for all platforms -#for rpmname in xCAT xCATsn xCAT-OpenStack xCAT-OpenStack-baremetal; do for rpmname in xCAT xCATsn; do - #if [ "$EMBED" = "zvm" ]; then break; fi if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then UPLOAD=1 From e581247ade10588bf33150c591c92bad059ac8f7 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 12 Mar 2015 15:09:40 -0400 Subject: [PATCH 17/19] When building xCAT-server rpm, a Unknow option: help message appears. This is caused by the xCATreg tool not implementing the --help option (was -h or ? for help) build-readme requires the tools to implement the help option --- xCAT-server/share/xcat/tools/xCATreg | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/xCAT-server/share/xcat/tools/xCATreg b/xCAT-server/share/xcat/tools/xCATreg index f9284e78b..78a8d1589 100644 --- a/xCAT-server/share/xcat/tools/xCATreg +++ b/xCAT-server/share/xcat/tools/xCATreg @@ -165,7 +165,7 @@ sub xCATreg_init{ #init important attributes - $date = `date +"%Y%m%d"`; + $date = `date +"%Y%m%d"`; chomp($date); &runcmd("mkdir -p $logfiledir") if(! -e $logfiledir); @@ -1031,29 +1031,13 @@ sub git_update{ return 0; } -xCATreg_init(); - -############################################################### -# Mainfunction -############################################################### -send_msg(2,"........................"); -send_msg(2,"........................"); -send_msg(2,".....ooooO.............."); -send_msg(2,"....(....)....Ooooo....."); -send_msg(2,".....\\..(.....(....)...."); -send_msg(2,"......\\__).....)../....."); -send_msg(2,"..............(_ /......"); -send_msg(2,"........................"); -send_msg(2,".........START ........."); -send_msg(2,"........................"); - ####################################### # step 0. Parse input arguments ####################################### send_msg(2, "step 1, Parse input arguments............"); =pod if ( - !GetOptions("h|?" => \$needhelp, + !GetOptions("--help|h|?" => \$needhelp, "f=s" => \$configfile, "b=s" => \$branch, "m=s" => \$management_node, @@ -1063,7 +1047,7 @@ if ( ) =cut if ( - !GetOptions("h|?" => \$needhelp, + !GetOptions("--help|h|?" => \$needhelp, "f=s" => \$configfile, "b=s" => \$branch, "m=s" => \$management_node, @@ -1081,6 +1065,22 @@ if ($needhelp) exit 0; } + +xCATreg_init(); + +############################################################### +# Mainfunction +############################################################### +send_msg(2,"........................"); +send_msg(2,"........................"); +send_msg(2,".....ooooO.............."); +send_msg(2,"....(....)....Ooooo....."); +send_msg(2,".....\\..(.....(....)...."); +send_msg(2,"......\\__).....)../....."); +send_msg(2,"..............(_ /......"); +send_msg(2,"........................"); +send_msg(2,".........START ........."); +send_msg(2,"........................"); ####################################### # step 1. Read configuration files ####################################### From d08a231d1aa35d4a094efc34194be4123ff22f72 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Thu, 12 Mar 2015 15:26:44 -0400 Subject: [PATCH 18/19] Remove the "set -x" in the xCAT-vlan spec file causing unnecessary output to the log files when building xCAT-vlan RPM --- xCAT-vlan/xCAT-vlan.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/xCAT-vlan/xCAT-vlan.spec b/xCAT-vlan/xCAT-vlan.spec index 82d174541..25bef6228 100755 --- a/xCAT-vlan/xCAT-vlan.spec +++ b/xCAT-vlan/xCAT-vlan.spec @@ -68,8 +68,6 @@ ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmvlan ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lsvlan ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/chvlanports -set -x - %clean # This step does not happen until *after* the %files packaging below From 0bd0860cdc555f790604a1a436a18cd6d29557f6 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Fri, 13 Mar 2015 01:52:55 -0400 Subject: [PATCH 19/19] add netboot pkglist for ubuntu 14.04.2 x86_64 --- .../ubuntu/compute.ubuntu14.04.2.x86_64.pkglist | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.2.x86_64.pkglist diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.2.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.2.x86_64.pkglist new file mode 100644 index 000000000..0b69a32dc --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu14.04.2.x86_64.pkglist @@ -0,0 +1,15 @@ +bash +nfs-common +openssl +isc-dhcp-client +libc-bin +linux-image-generic-lts-utopic +openssh-server +openssh-client +wget +vim +ntp +rsync +busybox-static +gawk +dnsutils