From 69f38cbb87cdeb9e6fb985cd9e924dacd093b6eb Mon Sep 17 00:00:00 2001 From: ertaozh Date: Tue, 9 May 2017 04:03:41 -0400 Subject: [PATCH] Update bmcsetup related code for OpenBMC --- xCAT-genesis-scripts/bin/bmcsetup | 13 ++++++------- xCAT-server/lib/xcat/plugins/bmcconfig.pm | 8 ++++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index cbd787605..b8208abe8 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -266,13 +266,13 @@ elif [ "$IPMIMFG" == "674" ]; then # DELL ipmitool delloem lan set shared with lom$BMCPORT &>/dev/null ipmitool delloem lan set shared with failover all loms &>dev/null fi -elif [ "$IPMIMFG" = "42817" -a "$XPROD" = "16975" ]; then +elif [ "$IPMIMFG" = "42817" -a "$XPROD" = "16975" ]; then # IBM OpenPOWER servers with OpenBMC ISOPENBMC=1 fi -if [ -z "$ISOPENBMC" ]; then - LAN_MED_TYPE="802.3" -else +LAN_MED_TYPE="802.3" +if [ ! -z "$ISOPENBMC" ]; then + # Overvide the default value for OpenBMC LAN_MED_TYPE="Other LAN" fi while [ -z "$LANCHAN" ]; do @@ -390,12 +390,11 @@ done # update the node status to 'bmcready' for openbmc, no more configuration is needed. if [ ! -z "$ISOPENBMC" ]; then # To enable network configuration for openbmc - let idev=0 TRIES=0 bmc_config_rc=0 # Set Channel Access to apply network setting - #while ! ipmitool -d $idev lan set $LANCHAN access on; do - while ! ipmitool -d $idev raw 0x06 0x40 $LANCHAN 0x42 0x44 > /dev/null; do + #while ! ipmitool -d 0 lan set $LANCHAN access on; do + while ! ipmitool -d 0 raw 0x06 0x40 $LANCHAN 0x42 0x44 > /dev/null; do snooze let TRIES=TRIES+1 if [ $TRIES -gt $TIMEOUT ]; then diff --git a/xCAT-server/lib/xcat/plugins/bmcconfig.pm b/xCAT-server/lib/xcat/plugins/bmcconfig.pm index 60581c77d..bef071f58 100644 --- a/xCAT-server/lib/xcat/plugins/bmcconfig.pm +++ b/xCAT-server/lib/xcat/plugins/bmcconfig.pm @@ -96,9 +96,9 @@ sub process_request { my $request = shift; my $callback = shift; my $node = $request->{'_xcat_clienthost'}->[0]; - my $open_table = "ipmi"; + my $bmc_mgmt_type = "ipmi"; if ($request->{isopenbmc}->[0]) { - $open_table = "openbmc"; + $bmc_mgmt_type = "openbmc"; } unless (ok_with_node($node, 300)) { $callback->({ error => ["Unable to prove root on your IP approves of this request"], errorcode => [1] }); @@ -106,14 +106,14 @@ sub process_request { } #my $sitetable = xCAT::Table->new('site'); - my $ipmitable = xCAT::Table->new("$open_table"); + my $ipmitable = xCAT::Table->new("$bmc_mgmt_type"); my $tmphash; my $username; my $gennedpassword = 0; my $bmc; my $password; $tmphash = $ipmitable->getNodesAttribs([$node], [ 'bmc', 'username', 'bmcport', 'password', 'taggedvlan' ]); - my $authmap = xCAT::PasswordUtils::getIPMIAuth(noderange => [$node], ipmihash => $tmphash, keytype => $open_table); + my $authmap = xCAT::PasswordUtils::getIPMIAuth(noderange => [$node], ipmihash => $tmphash, keytype => $bmc_mgmt_type); if ($::XCATSITEVALS{genpasswords} eq "1" or $::XCATSITEVALS{genpasswords} =~ /y(es)?/i) { $password = genpassword(10) . "1cA!";