From 5db9e6dcecdd235d16fe0781eabe66191707c270 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 20 Nov 2017 11:06:19 -0500 Subject: [PATCH 1/6] Add messages to inform the user of the general action started via xCAT for flashing firmware --- xCAT-server/lib/xcat/plugins/openbmc.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index f4b67ee2b..472364159 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -878,7 +878,7 @@ sub parse_args { } } # show options parsed in bypass mode - print "DEBUG filename=$filename_passed, updateid=$updateid_passed, options=$option_flag, verbose=$verbose, invalid=$invalid_options\n"; + print "DEBUG filename=$filename_passed, updateid=$updateid_passed, options=$option_flag, invalid=$invalid_options rflash_arguments=@flash_arguments\n"; if ($option_flag =~ tr{ }{ } > 0) { unless ($verbose) { @@ -895,6 +895,7 @@ sub parse_args { if ($option_flag !~ /^-c$|^--check$|^-u$|^--upload$|^-a$|^--activate$/) { return ([ 1, "Invalid option specified when a file is provided: $option_flag" ]); } + xCAT::SvrUtils::sendmsg("Attempting to upload $flash_arguments[0], please wait...", $callback); } else { if ($updateid_passed) { @@ -902,6 +903,11 @@ sub parse_args { if ($option_flag !~ /^-d$|^--delete$|^-a$|^--activate$/) { return ([ 1, "Invalid option specified when an update id is provided: $option_flag" ]); } + my $action = "activate"; + if ($option_flag =~ /^-d$|^--delete$/) { + $action = "delete"; + } + xCAT::SvrUtils::sendmsg("Attempting to $action ID=$flash_arguments[0], please wait...", $callback); } else { # Neither Filename nor updateid was not passed, check flags allowed without file or updateid From aaacca80cda61d257d17ab4aff869a81cf257bd4 Mon Sep 17 00:00:00 2001 From: Miro Date: Sun, 26 Nov 2017 21:20:49 -0500 Subject: [PATCH 2/6] Fix merging in xdcpmerge.sh (#4328) * Fixes in xdcpmerge.sh Two fixes: 1. The grep pattern when finding duplicate usernames is missing ":" at the end. So, for example user "test" would also match "test2, etc.". Adding the ":" delimiter fixes the issue. 2. Another issue happens when the file to be merged is a superset of the files on the nodes. For example, if a new user is added and entire passwd file (that is otherwise identical) is sent to be merged. In this case, the $filebackup.nodups file, i.e. the original file with duplicates removed, becomes empty and the condition "if [ -s "$filebackup.nodups" ]" does not execute. Then the merged file ends up being original file with the merge file fully appended, clearly not what was intended. This is solved by changing the condition to check for file existence "-a" rather then for size. Additionally, I also turn the logic around so that the duplicates are removed from the merge file and then added to the original file. I think this makes logic a bit cleaner and also ensures that existing entries are not reordered or changed in any way. * Streamlining previous commit Adjustment to previous commit, streamlining and simplifying logic. Once $mergefile.nodups is created, just concatenate it the original file. * Update to xdcpmerge No need to copy $filebackup to $curfile, they are the same. --- xCAT-server/share/xcat/scripts/xdcpmerge.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/xdcpmerge.sh b/xCAT-server/share/xcat/scripts/xdcpmerge.sh index b7724e9f1..39922add6 100755 --- a/xCAT-server/share/xcat/scripts/xdcpmerge.sh +++ b/xCAT-server/share/xcat/scripts/xdcpmerge.sh @@ -82,24 +82,22 @@ for i in $*; do done # remove the last delimiter userlisttmp="${userlist%?}" - listend=")'" + listend="):'" userlist=$userlisttmp$listend grepcmd=$grepcmd$userlist #set -x - grepcmd="$grepcmd $filebackup > $filebackup.nodups" + grepcmd="$grepcmd $mergefile > $mergefile.nodups" #echo "grepcmd=$grepcmd" # now run it eval $grepcmd - # if no dups file created - if [ -s "$filebackup.nodups" ]; then - cp -p $filebackup.nodups $filebackup - #echo "cp -p $filebackup.nodups $filebackup" - rm $filebackup.nodups - fi fi - # Now update the currentfile - cat $filebackup $mergefile > $curfile - #echo "cat $filebackup $mergefile > $curfile" + + # add new entries from mergefile, if any + if [ -a "$mergefile.nodups" ]; then + cat $mergefile.nodups >> $curfile + rm $mergefile.nodups + fi + # now cleanup rm $filebackup.userlist # echo "rm $filebackup.userlist" From fdfc79d987edf0f955042cfb165ba1a605f9d2fa Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 27 Nov 2017 03:37:17 -0500 Subject: [PATCH 3/6] Modify for debug conveniently --- xCAT-test/autotest/testcase/rpower/cases0 | 14 +++++------- xCAT-test/autotest/testcase/rspconfig/cases0 | 24 ++++++++++++++------ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index 485758810..19ec464ae 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -160,25 +160,23 @@ check:rc==0 end start:rpower_suspend_OpenpowerBmc +hcp:openbmc cmd:rpower $$CN suspend -check:output=~Error: unsupported command rpower suspend for OpenPOWER +check:output=~Error: Unsupported command: rpower suspend check:rc==1 end -start:rpower_softoff_OpenpowerBmc -cmd:rpower $$CN softoff -check:output=~Error: unsupported command rpower softoff for OpenPOWER -check:rc==1 -end start:rpower_wake_OpenpowerBmc +hcp:openbmc cmd:rpower $$CN wake -check:output=~Error: unsupported command rpower wake for OpenPOWER +check:output=~Error: Unsupported command: rpower wake check:rc==1 end start:rpower_errorcommand_OpenpowerBmc +hcp:openbmc cmd:rpower $$CN ddd -check:output=~Unsupported command: +check:output=~Error: Unsupported command: rpower ddd check:rc==1 end diff --git a/xCAT-test/autotest/testcase/rspconfig/cases0 b/xCAT-test/autotest/testcase/rspconfig/cases0 index 8266cc402..da4ddb70f 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases0 +++ b/xCAT-test/autotest/testcase/rspconfig/cases0 @@ -142,35 +142,45 @@ end start:rspconfig_list_ip despcription:rspconfig list bmc ip -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -lip $$CN +cmd:rspconfig $$CN ip check:rc==0 +check:output=~__GETNODEATTR($$CN,bmc)__ end start:rspconfig_list_gateway +hcp:openbmc description:rspconfig list openbmc gateway Attribute: $$CN-The operation object of rspconfig command -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -lg $$CN +cmd:rspconfig $$CN gateway +check:output=~$$CN: BMC Gateway: check:rc==0 end start:rspconfig_list_netmask +hcp:openbmc description:rspconfig list openbmc netmask Attribute: $$CN-The operation object of rspconfig command -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -ln $$CN +cmd:rspconfig $$CN netmask check:rc==0 +check:output=~$$CN: BMC Netmask: end start:rspconfig_list_vlan -description:rspconfig list openbmc netmask +description:rspconfig list openbmc vlan Attribute: $$CN-The operation object of rspconfig command -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -lv $$CN +cmd: rspconfig $$CN vlan check:rc==0 +check:output=~$$CN: BMC VLAN ID: end start:rspconfig_list_all -description:rspconfig list openbmc netmask +description:rspconfig list openbmc ip gateway netmask vlan Attribute: $$CN-The operation object of rspconfig command -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -la $$CN +cmd: rspconfig $$CN ip gateway netmask vlan check:rc==0 +check:output=~$$CN: BMC VLAN ID: +check:output=~$$CN: BMC Gateway: +check:output=~$$CN: BMC Netmask: +check:output=~__GETNODEATTR($$CN,bmc)__ end From 77b09ffefa7d09ab2bb828628fab8fdb98c8561a Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 27 Nov 2017 03:59:24 -0500 Subject: [PATCH 4/6] add new cases and delete outdated test cases --- .../bundle/hdctrl_openpower_openbmc.bundle | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle index d7233bcf8..2a77bb1da 100644 --- a/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_openpower_openbmc.bundle @@ -1,14 +1,13 @@ description:the cases in this bundle is to used to verify xCAT hardware control funtions on openpower servers which are mananged using openbmc. #INCLUDE:hdctrl_general.bundle# -rinv_uuid -rinv_vpd rinv_cpu rinv_dimm +rinv_check_active_fw_count +rinv_check_active_fw_count_verbose rinv_wrongbmcpasswd rvitals_wattage rvitals_fanspeed rvitals_power -rvitals_leds rvitals_altitude rsetboot_net_statcheck rsetboot_cd_statcheck @@ -38,4 +37,16 @@ rspconfig_set_all rspconfig_set_all_invalid rspconfig_set_vlan rspconfig_set_vlan_invalid +rflash_check +rflash_invalid_activate +rflash_invalid_activate_and_delete +rflash_invalid_id +rflash_invalid_multiple_id_3 +rflash_invalid_multiple_id_2 +rflash_invalid_node +rflash_invalid_delete_2 +rpower_softoff +rpower_suspend_OpenpowerBmc +rpower_wake_OpenpowerBmc +rpower_errorcommand_OpenpowerBmc rpower_wrongpasswd From ca0071216d082ba0ac3856d2006990c6bfdbc559 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Mon, 27 Nov 2017 00:33:59 -0500 Subject: [PATCH 5/6] Modify genesis build script for centos x86_64 --- xCAT-genesis-builder/buildrpm | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/xCAT-genesis-builder/buildrpm b/xCAT-genesis-builder/buildrpm index 6b0f378c2..dfd318818 100755 --- a/xCAT-genesis-builder/buildrpm +++ b/xCAT-genesis-builder/buildrpm @@ -20,8 +20,11 @@ if [ -z $1 ]; then if [ $BUILDARCH = "ppc64le" ]; then HOSTOS="Pegas1.0" BUILDARCH="ppc64" - else + elif [ $BUILDARCH = "ppc64" ]; then HOSTOS="fedora26" + elif [ $BUILDARCH = "x86_64" ]; then + yum install efibootmgr bc -y + HOSTOS="centos7" fi fi @@ -45,13 +48,12 @@ echo "#!/bin/bash" > ./installkernel for line in `cat /lib/modules/$KERVER/modules.dep | awk -F: '{print \$1}'`; do basename $line >> ./installkernel; done -sed -i 's/\(.*\)\.ko/instmods \1/g' ./installkernel +sed -i 's/\(.*\)\.ko.*/instmods \1/g' ./installkernel chmod +x ./installkernel cd - mkdir -p $DRACUTMODDIR cp $DIR/* $DRACUTMODDIR - # Remove the ipr(IBM Power RAID) stuff when building on x86_64 if [ $BUILDARCH = "x86_64" ]; then sed -i 's/dracut_install \/lib64\/libform.so.5//' $DRACUTMODDIR/install @@ -62,6 +64,11 @@ if [ $BUILDARCH = "x86_64" ]; then sed -i '/\/usr\/sbin\/iprconfig/ d' $DRACUTMODDIR/install sed -i '/hwdb.bin/ d' $DRACUTMODDIR/install sed -i 's/instmods ipr//' $DRACUTMODDIR/installkernel + sed -i 's/ mkreiserfs//' $DRACUTMODDIR/install + sed -i 's/ reiserfstune//' $DRACUTMODDIR/install + sed -i 's/ vconfig//' $DRACUTMODDIR/install + sed -i 's/\/lib\/terminfo\/l\/linux/\/usr\/share\/terminfo\/l\/linux/g' $DRACUTMODDIR/install + sed -i 's/\/lib\/terminfo\/v\/vt100/\/usr\/share\/terminfo\/v\/vt100/g' $DRACUTMODDIR/install fi if [ "$HOSTOS" = "mcp" ]; then #Special handlings for MCP PPC64 platform building. @@ -144,12 +151,11 @@ if [ "$HOSTOS" = "mcp" ]; then else echo Creating the initramfs in /tmp/xcatgenesis.$$.rfs using dracut ... fi - # On Fedora 20 ppc64, dracut uses host-only mode by default if [ $BUILDARCH = "ppc64" ]; then dracut -m "xcat base" -N -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION else - dracut -m "xcat base" -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION + dracut -m "xcat base" --no-early-microcode -N -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION fi if [ $? -ne 0 ]; then @@ -159,6 +165,7 @@ fi echo Expanding the initramfs into /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs ... cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs + zcat /tmp/xcatgenesis.$$.rfs|cpio -dumi # add the perl library @@ -176,11 +183,12 @@ done # create the predictable naming for nics LIB_UDEV_RULES="/lib/udev/rules.d/" -cp $DRACUTMODDIR/80-net-name-slot.rules /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/lib/udev/rules.d/ - -if [ $? -ne 0 ]; then - echo "ERROR - expanding the initramfs, please correct the issues and try again" - exit 1 +if [ ! -e "$LIB_UDEV_RULES/80-net-name-slot.rules" ]; then + cp $DRACUTMODDIR/80-net-name-slot.rules /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/lib/udev/rules.d/ + if [ $? -ne 0 ]; then + echo "ERROR - expanding the initramfs, please correct the issues and try again" + exit 1 + fi fi # add the kernel From 2d90a3a1a34a9a7bded511bbc08fe15841c61324 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 27 Nov 2017 14:12:53 -0500 Subject: [PATCH 6/6] rspconfig fix for set hostname --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7659b2df5..45a4b727c 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1176,7 +1176,7 @@ sub parse_command_status { $next_status{RSPCONFIG_GET_REQUEST} = "RSPCONFIG_GET_RESPONSE"; $status_info{RSPCONFIG_SET_REQUEST}{data} = $1; - $status_info{RSPCONFIG_GET_RESPONSE}{argv} = "hostname"; + $status_info{RSPCONFIG_SET_REQUEST}{init_url} .= "/config/attr/HostName"; return 0; } }