From 53374908bf6022eb4f5a96a91e583590b790a22c Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 30 May 2014 03:12:08 -0700 Subject: [PATCH 1/6] fix defect #4146 post.rh.common scipt has ifconfig that does work even on Redhat6 --- .../share/xcat/install/scripts/post.rh.common | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/post.rh.common b/xCAT-server/share/xcat/install/scripts/post.rh.common index 79bc733a7..9ad02fd7a 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rh.common +++ b/xCAT-server/share/xcat/install/scripts/post.rh.common @@ -13,7 +13,8 @@ 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=`ip -o link|grep -i "${karg#*=}"|awk '{print $2}'|sed s/://` fi done if [ -z "$PRINIC" ]; then @@ -24,13 +25,16 @@ 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 -IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') +#IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') +IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}') if [ -z $IP ] then dhclient eth0 - IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') + #IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') + IP=$(ip addr show dev $PRINIC | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1 | awk -F '/' '{print $1}') fi export HOSTNAME=$(host $IP 2>/dev/null | awk '{print $5}' | awk -F. '{print $1}') From 6e9d88a8428fb5edfb6bc605c10da3542730604c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 30 May 2014 10:23:31 -0400 Subject: [PATCH 2/6] Fix rpower wake turning off an on system --- xCAT-server/lib/xcat/plugins/ipmi.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 61d6b5582..3fb44b7cd 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -1541,6 +1541,7 @@ sub power_with_context { return; } elsif ($subcommand eq "wake") { $sessdata->{ipmisession}->subcmd(netfn=>0x3a,command=>0x1d,data=>[0,0],callback=>\&power_response,callback_args=>$sessdata); + return; } elsif (not $argmap{$subcommand}) { xCAT::SvrUtils::sendmsg([1,"unsupported command power $subcommand"],$callback); return; From 27d8ca563b81890e77cb6ae562e78ea9992c255a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 30 May 2014 11:05:05 -0400 Subject: [PATCH 3/6] Fix BMCPORT specification working with spaces --- xCAT-genesis-scripts/bin/bmcsetup | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index 4cdfeac75..195c32159 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -51,6 +51,7 @@ if [ "$IPMIMFG" == 2 ]; then #IBM BMCPORT=`grep bmcport /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'` if [ ! -z "$BMCPORT" ]; then let idev=0 + IFS=',' for p in $BMCPORT; do ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null ipmitool -d $idev raw 0x04 0x12 0x09 0x01 0x18 0x${p}1 0x00 > /dev/null @@ -61,6 +62,7 @@ if [ "$IPMIMFG" == 2 ]; then #IBM done let idev=idev+1 done + unset IFS fi elif [ "$XPROD" == "291" ]; then LOCKEDUSERS=1 @@ -70,6 +72,7 @@ if [ "$IPMIMFG" == 2 ]; then #IBM BMCPORT=`grep bmcport /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'` if [ ! -z "$BMCPORT" ]; then let idev=0 + IFS=',' for p in $BMCPORT; do ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null CURBMCPORT=`ipmitool -d $idev raw 0xc 2 1 0xc0 0 0 | awk '{print $2}'` @@ -79,6 +82,7 @@ if [ "$IPMIMFG" == 2 ]; then #IBM done let idev=idev+1 done + unset IFS fi fi fi @@ -92,6 +96,7 @@ elif [ "$IPMIMFG" == 20301 ] ; then BMCPORT=`grep bmcport /tmp/ipmicfg.xml |awk -F\> '{print $2}'|awk -F\< '{print $1}'` if [ ! -z "$BMCPORT" ]; then let idev=0 + IFS=',' for p in $BMCPORT; do ipmitool -d $idev raw 0xc 1 1 0xc0 $p > /dev/null # after this change, we need to watch and wait to see that it @@ -108,6 +113,7 @@ elif [ "$IPMIMFG" == 20301 ] ; then let idev=idev+1 done + unset IFS fi elif [ "$IPMIMFG" == "47488" ]; then LOCKEDUSERS=1 From f43352521e71c32ef46c35f81210f44ebba3d6fe Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 30 May 2014 11:24:13 -0400 Subject: [PATCH 4/6] Mark pending firmware to be clear that firmware is not yet active --- xCAT-server/lib/xcat/plugins/ipmi.pm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 3fb44b7cd..417ae8ad1 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -1957,11 +1957,20 @@ sub got_bios_buildid { my $sessdata = $res{sessdata}; if ($res{data}) { $sessdata->{biosbuildid} = $res{data}; - get_imm_property(property=>"/v2/bios/build_version",callback=>\&got_bios_version,sessdata=>$sessdata); + get_imm_property(property=>"/v2/bios/pending_build_version",callback=>\&got_bios_pending_buildid,sessdata=>$sessdata); } else { initfru_with_mprom($sessdata); } } +sub got_bios_pending_buildid { + my %res = @_; + my $sessdata = $res{sessdata}; + $sessdata->{biosbuildpending} = 0; + if ($res{data}) { + $sessdata->{biosbuildpending} = 1; + } + get_imm_property(property=>"/v2/bios/build_version",callback=>\&got_bios_version,sessdata=>$sessdata); +} sub got_bios_version { my %res = @_; my $sessdata = $res{sessdata}; @@ -1980,7 +1989,12 @@ sub got_bios_date { my $fru = FRU->new(); $fru->rec_type("bios,uefi,firmware"); $fru->desc("UEFI Version"); - $fru->value($sessdata->{biosbuildversion}." (".$sessdata->{biosbuildid}." ".$sessdata->{biosbuilddate}.")"); + my $pending = ""; + if ($sessdata->{biosbuildpending}) { + $pending = " [PENDING]"; + } + my $value = $sessdata->{biosbuildversion}." (".$sessdata->{biosbuildid}." ".$sessdata->{biosbuilddate}.")$pending"; + $fru->value($value); $sessdata->{fru_hash}->{uefi} = $fru; get_imm_property(property=>"/v2/fpga/build_id",callback=>\&got_fpga_buildid,sessdata=>$sessdata); } else { From 69763c4327662011c697cb0fecf33a141cffa9d3 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 30 May 2014 11:27:17 -0400 Subject: [PATCH 5/6] Fix problem where firmware was erroneously marked pending --- xCAT-server/lib/xcat/plugins/ipmi.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 417ae8ad1..91a48d4b0 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -1966,7 +1966,7 @@ sub got_bios_pending_buildid { my %res = @_; my $sessdata = $res{sessdata}; $sessdata->{biosbuildpending} = 0; - if ($res{data}) { + if ($res{data} and $res{data} ne ' ') { $sessdata->{biosbuildpending} = 1; } get_imm_property(property=>"/v2/bios/build_version",callback=>\&got_bios_version,sessdata=>$sessdata); From 6040b0a85354932086cc93f3091ce2a6398be93e Mon Sep 17 00:00:00 2001 From: Brian Elliott Finley Date: Sun, 1 Jun 2014 21:55:35 -0500 Subject: [PATCH 6/6] - test_hca_state - handle multi-adapter systems better. Improved output. Add filter option. --- xCAT-server/share/xcat/tools/test_hca_state | 221 +++++++++++++------- 1 file changed, 146 insertions(+), 75 deletions(-) diff --git a/xCAT-server/share/xcat/tools/test_hca_state b/xCAT-server/share/xcat/tools/test_hca_state index 4072ba071..7b6adf880 100755 --- a/xCAT-server/share/xcat/tools/test_hca_state +++ b/xCAT-server/share/xcat/tools/test_hca_state @@ -20,6 +20,7 @@ # NR=$1 +THINGY=$2 offer_help() { @@ -31,10 +32,18 @@ offer_help() { cat <