From dc19d2ed791c511a06e25dae07820c04a89fa0e5 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 9 Jan 2017 13:25:11 -0500 Subject: [PATCH 1/5] Move the copy/cleanup code for xCAT-probe to their own functions --- makerpm | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/makerpm b/makerpm index c80ed0edf..784aeb760 100755 --- a/makerpm +++ b/makerpm @@ -9,7 +9,29 @@ # set -x -# Make one of the following rpms: perl-xCAT, xCAT-server, xCAT-client, xCAT-IBMhpc, xCAT-rmc, xCAT-UI, xCAT-test +function xcat_probe_copy { + # xCAT-probe uses some functions shipped with xCAT, copying for the following reasons: + # 1. make xCAT-probe code be self-contained + # 2. do not maintain two files for each script + # 3. symbolic link can't work during packaging + RPMNAME=${1} + if [ $RPMNAME = "xCAT-probe" ]; then + mkdir -p xCAT-probe/lib/perl/xCAT/ + files=("NetworkUtils.pm" "GlobalDef.pm" "ServiceNodeUtils.pm") + for f in "${files[@]}"; do + cp perl-xCAT/xCAT/$f ${RPMNAME}/lib/perl/xCAT/ + done + fi +} + +function xcat_probe_cleanup { + RPMNAME=${1} + if [ $RPMNAME = "xCAT-probe" ]; then + rm -rf xCAT-probe/lib/perl/xCAT/ + fi +} + +# Make the noarch rpms function makenoarch { RPMNAME=$1 if [ "$OSNAME" = "AIX" ]; then @@ -41,17 +63,7 @@ function makenoarch { fi fi - #xcat probe use some functions shipped by xCAT, for below reasons we need to copy files to xCAT-probe directory - #1 make xcat probe code to be self-contained - #2 don't maintain two files for each script - #3 symbolic link can't work during package - if [ $RPMNAME = "xCAT-probe" ]; then - CURDIR=$(pwd) - mkdir -p ${CURDIR}/xCAT-probe/lib/perl/xCAT/ - cp -f ${CURDIR}/perl-xCAT/xCAT/NetworkUtils.pm ${CURDIR}/xCAT-probe/lib/perl/xCAT/ - cp -f ${CURDIR}/perl-xCAT/xCAT/GlobalDef.pm ${CURDIR}/xCAT-probe/lib/perl/xCAT/ - cp -f ${CURDIR}/perl-xCAT/xCAT/ServiceNodeUtils.pm ${CURDIR}/xCAT-probe/lib/perl/xCAT/ - fi + xcat_probe_copy ${RPMNAME} tar --exclude .svn -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm @@ -62,6 +74,9 @@ function makenoarch { # undo the modifications above to leave the sandbox prestine on the build machine git checkout xCAT-UI/xCAT-UI.spec fi + + xcat_probe_cleanup ${RPMNAME} + fi } From 068494a9ae0afa154535d4aa02681a6fbe2e259b Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 10 Jan 2017 14:25:05 -0500 Subject: [PATCH 2/5] Use the variable for the path instead of hard code --- makerpm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makerpm b/makerpm index 784aeb760..3bc591545 100755 --- a/makerpm +++ b/makerpm @@ -16,7 +16,7 @@ function xcat_probe_copy { # 3. symbolic link can't work during packaging RPMNAME=${1} if [ $RPMNAME = "xCAT-probe" ]; then - mkdir -p xCAT-probe/lib/perl/xCAT/ + mkdir -p ${RPMNAME}/lib/perl/xCAT/ files=("NetworkUtils.pm" "GlobalDef.pm" "ServiceNodeUtils.pm") for f in "${files[@]}"; do cp perl-xCAT/xCAT/$f ${RPMNAME}/lib/perl/xCAT/ @@ -27,7 +27,7 @@ function xcat_probe_copy { function xcat_probe_cleanup { RPMNAME=${1} if [ $RPMNAME = "xCAT-probe" ]; then - rm -rf xCAT-probe/lib/perl/xCAT/ + rm -rf ${RPMNAME}/lib/perl/xCAT/ fi } From f843dcad3cc9484674caa4d75a877ce333f23226 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 10 Jan 2017 15:38:14 -0500 Subject: [PATCH 3/5] Change switchtype from cumulus to onie --- .../networks/edgecore_switches/onie_switches.rst | 4 ++-- xCAT-server/lib/xcat/plugins/switchdiscover.pm | 8 ++++---- .../share/xcat/scripts/{configcumulus => configonie} | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) rename xCAT-server/share/xcat/scripts/{configcumulus => configonie} (96%) diff --git a/docs/source/advanced/networks/edgecore_switches/onie_switches.rst b/docs/source/advanced/networks/edgecore_switches/onie_switches.rst index dd41a8c71..ba079c23c 100644 --- a/docs/source/advanced/networks/edgecore_switches/onie_switches.rst +++ b/docs/source/advanced/networks/edgecore_switches/onie_switches.rst @@ -49,9 +49,9 @@ Enable the passwordless ssh for "root" In a newly installed Cumulus OS, a default user ``cumulus`` will be created, the switch can be accessed via ssh with the default password ``CumulusLinux!``. -The passwordless ssh access of "root" should be enabled with the script ``/opt/xcat/share/xcat/scripts/configcumulus`` :: +The passwordless ssh access of "root" should be enabled with the script ``/opt/xcat/share/xcat/scripts/configonie`` :: - /opt/xcat/share/xcat/scripts/configcumulus --switches edgecoresw1 --ssh + /opt/xcat/share/xcat/scripts/configonie --switches edgecoresw1 --ssh After the passwordless access for "root" is setup successfully, the switch can be managed with the node management commands such as ``xdsh``, ``xdcp`` and ``updatenode``, etc. diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 1b90ea155..4966a24ff 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -37,7 +37,7 @@ my %global_mac_identity = ( "6c:ae:8b" => "BNT G8264-T switch", "fc:cf:62" => "BNT G8124 switch", "7c:fe:90" => "Mellanox IB switch", - "8c:ea:1b" => "Edgecore switch" + "8c:ea:1b" => "Edgecore Networks Switch" ); my %global_switch_type = ( @@ -53,7 +53,7 @@ my %global_switch_type = ( mellanox => "Mellanox", MLNX => "Mellanox", MELLAN => "Mellanox", - Edgecore => "cumulus" + Edgecore => "onie" ); @@ -1440,8 +1440,8 @@ sub switchsetup { my $config_script = "$::XCATROOT/share/xcat/scripts/config".$mytype; if (-r -x $config_script) { my $switches = join(",",@{${nodes_to_config}->{$mytype}}); - if ($mytype eq "cumulus") { - send_msg($request, 0, "Cumulus switch needs to take 50 mins to install, please run /opt/xcat/share/xcat/script/configcumulus after cumulus OS installed on switch\n"); + if ($mytype eq "onie") { + send_msg($request, 0, "onie switch needs to take 50 mins to install, please run /opt/xcat/share/xcat/script/configonie after Cumulus OS installed on switch\n"); } else { send_msg($request, 0, "call to config $mytype switches $switches\n"); my $out = `$config_script --switches $switches --all`; diff --git a/xCAT-server/share/xcat/scripts/configcumulus b/xCAT-server/share/xcat/scripts/configonie similarity index 96% rename from xCAT-server/share/xcat/scripts/configcumulus rename to xCAT-server/share/xcat/scripts/configonie index f746bd81a..3aa2ed2ac 100755 --- a/xCAT-server/share/xcat/scripts/configcumulus +++ b/xCAT-server/share/xcat/scripts/configonie @@ -384,14 +384,14 @@ sub config_ntp { sub usage { print "Usage: - configcumulus -h│--help - configcumulus --switches switchnames --ssh - configcumulus --switches switchnames --license filename - configcumulus --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--group snmp_group] - configcumulus --switches switchnames --ntp + configonie -h│--help + configonie --switches switchnames --ssh + configonie --switches switchnames --license filename + configonie --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--group snmp_group] + configonie --switches switchnames --ntp To set ssh, install license(license file: /root/license.txt), config snmp and ntp: - configcumulus --switches switchnames --all + configonie --switches switchnames --all \n"; } From fdbf2166e1c62f091e676180982293949e7f478e Mon Sep 17 00:00:00 2001 From: immarvin Date: Tue, 10 Jan 2017 21:20:09 -0500 Subject: [PATCH 4/5] fix issue Unsupported character in bootparams.addkcmdline #2392 --- perl-xCAT/xCAT/Utils.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index af8f42fcf..a39ea8bb2 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -4645,7 +4645,7 @@ sub splitkcmdline { my %cmdhash; - my @cmdlist = split(/[, ]/, $kcmdline); + my @cmdlist = split(/[ ]/, $kcmdline); foreach my $cmd (@cmdlist) { if ($cmd =~ /^R::(.*)$/) { $cmdhash{persistent} .= "$1 "; From 0ff29259858000d85c413a7c7da0dee6c68982fd Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 11 Jan 2017 01:42:08 -0500 Subject: [PATCH 5/5] xCAT-genesis-base.spec can not access the Release file, use snap+date directly --- xCAT-genesis-builder/xCAT-genesis-base.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-genesis-builder/xCAT-genesis-base.spec b/xCAT-genesis-builder/xCAT-genesis-base.spec index fd4d78161..95e1e719d 100755 --- a/xCAT-genesis-builder/xCAT-genesis-base.spec +++ b/xCAT-genesis-builder/xCAT-genesis-base.spec @@ -1,6 +1,6 @@ %define version %%REPLACE_CURRENT_VERSION%% Version: %{?version:%{version}}%{!?version:%(cat Version)} -Release: %{?release:%{release}}%{!?release:%(cat Release)} +Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")} %ifarch i386 i586 i686 x86 %define tarch x86 %endif