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 diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 61d6b5582..91a48d4b0 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; @@ -1956,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} and $res{data} ne ' ') { + $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}; @@ -1979,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 { 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}') 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 <