From b6b1155f41fabc19c75ffaa73742845487c59300 Mon Sep 17 00:00:00 2001 From: gaofeng Date: Tue, 20 Oct 2015 02:28:35 -0500 Subject: [PATCH] support openpower bmcsetup chain --- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index 7cce5f9e4..bf8a88547 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -1347,12 +1347,23 @@ sub gen_chain_for_profiles{ } #run bmcsetups. #PowerNV nodes can't use 'runcmd=bmcsetup' to set BMC. - if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig and $netboot ne 'petitboot'){ - if (index($final_chain, "runcmd=bmcsetup") == -1){ - $final_chain = 'runcmd=bmcsetup,'.$final_chain.':reboot4deploy'; - } - else{ - $final_chain = $final_chain.':reboot4deploy'; + #But OpenPower need to support bmcsetup + my $nodehmtab = xCAT::Table->new('nodehm'); + my $comments = ""; + my $nodehmtab_entry = $nodehmtab->getNodeAttribs($hwprofile, ['comments']); + if (defined $nodehmtab_entry->{'comments'}) { + $comments = $nodehmtab_entry->{'comments'}; + } + + if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig){ + if ((($netboot eq 'petitboot') and ($comments eq 'openpower')) or ($netboot ne 'petiboot')) + { + if (index($final_chain, "runcmd=bmcsetup") == -1){ + $final_chain = 'runcmd=bmcsetup,'.$final_chain.':reboot4deploy'; + } + else{ + $final_chain = $final_chain.':reboot4deploy'; + } } } return (0, $final_chain);