From 90a84dc37573b66170bec0f3301d6b66e2eff0ca Mon Sep 17 00:00:00 2001 From: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:20:10 -0300 Subject: [PATCH] fix: Replace yaboot with grub2 for PPC nodediscovery Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com> --- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 9 ++------- xCAT-server/lib/xcat/plugins/dhcp.pm | 4 ++-- xCAT-server/lib/xcat/plugins/nodediscover.pm | 4 ++-- xCAT-server/lib/xcat/plugins/setup.pm | 8 ++++---- xCAT-server/xCAT-wsapi/restapi.pl | 9 ++++----- xCAT-server/xCAT-wsapi/xcatws-test.sh | 3 +-- xCAT-server/xCAT-wsapi/xcatws.cgi | 9 ++++----- 7 files changed, 19 insertions(+), 27 deletions(-) diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index b901d2413..b0ee5935a 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -1497,20 +1497,15 @@ sub get_netboot_attr { # It's sequence sensitive: os arch -> os name -> os major version -> hardware profile # Priority | Arch | OS Name | OS Major Version | Management method | Noderes.netboot | # 1 | x86_64/x86 | * | * | * | xnba | - # 2 | ppc64 | rhels | 7 | * | grub2 | # 2 | ppc64 | pkvm | * | * | petitboot | - # 3 | | * | * | * | yaboot | + # 3 | ppc64 | * | * | * | grub2 | # 4 | ppc64le/el | * | * | * | grub2 # 4 | ppc64le/el | * | * | ipmi | petitboot # arch osname version hardware netboot my %netboot_dict = ('x86_64' => 'xnba', 'ppc64' => { - 'rhels' => { - '7' => 'grub2', - '*' => 'yaboot', - }, 'pkvm' => 'petitboot', - '*' => 'yaboot', + '*' => 'grub2', }, 'ppc64le' => { '*' => { diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 05dd98d9e..2e0f3a04a 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -2750,8 +2750,8 @@ sub addnet " } else if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { #for onie on cumulus switch\n"; push @netent, " option www-server = \"http://$tftp:$httpport/install/onie/onie-installer\";\n"; push @netent, - " } else if substring(filename,0,1) = null { #otherwise, provide yaboot if the client isn't specific\n "; - push @netent, " filename \"/yaboot\";\n"; + " } else if substring(filename,0,1) = null { #otherwise, provide grub2 for PPC firmware that omits a client architecture\n "; + push @netent, " filename \"/boot/grub2/grub2.ppc\";\n"; push @netent, " }\n"; if ($range) { diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index d7f4fef1e..3489aef02 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -234,8 +234,8 @@ sub process_request { $nrtab->setNodeAttribs($node, { netboot => 'xnba' }); } elsif ($request->{arch}->[0] =~ /ppc/ and $request->{platform}->[0] =~ /PowerNV/) { $nrtab->setNodeAttribs($node, { netboot => 'petitboot' }); - } elsif ($request->{arch}->[0] =~ /ppc/ and $currboot !~ /yaboot/) { - $nrtab->setNodeAttribs($node, { netboot => 'yaboot' }); + } elsif ($request->{arch}->[0] =~ /ppc/ and $currboot !~ /^grub2(?:[-].*)?$/) { + $nrtab->setNodeAttribs($node, { netboot => 'grub2' }); } elsif($request->{arch}->[0] =~ /armv7l/ and $currboot !~ /onie/) { #for onie switch, the netboot should be "onie" $nrtab->setNodeAttribs($node, { netboot => 'onie' }); diff --git a/xCAT-server/lib/xcat/plugins/setup.pm b/xCAT-server/lib/xcat/plugins/setup.pm index 5ebe50cd9..b57c9292c 100644 --- a/xCAT-server/lib/xcat/plugins/setup.pm +++ b/xCAT-server/lib/xcat/plugins/setup.pm @@ -1172,7 +1172,7 @@ sub writelpar { # Set some attrs common to all lpars $tables{'nodetype'}->setNodeAttribs('lpar', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('lpar', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('lpar', { netboot => 'yaboot' }); + $tables{'noderes'}->setNodeAttribs('lpar', { netboot => 'grub2' }); # Write regexs for some of the ppc attrs # Note: we assume here that if they used f1c1p1 for nodes they should use f1c1 for cecs @@ -1468,7 +1468,7 @@ sub writesn { $tables{'ppc'}->setNodeAttribs('service', { id => '1', nodetype => 'lpar' }); $tables{'nodetype'}->setNodeAttribs('service', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('service', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('service', { netboot => 'yaboot' }); + $tables{'noderes'}->setNodeAttribs('service', { netboot => 'grub2' }); $tables{'servicenode'}->setNodeAttribs('service', { nameserver => 1, dhcpserver => 1, tftpserver => 1, nfsserver => 1, conserver => 1, monserver => 1, ftpserver => 1, nimserver => 1, ipforward => defined($STANZAS{'xcat-service-nodes'}->{'route-masks'}) }); if ($STANZAS{'ll-config'}->{'central_manager_list'}) { # write the LL postscript for service nodes addPostscript('service', 'llserver.sh') @@ -1621,7 +1621,7 @@ sub writestorage { $tables{'ppc'}->setNodeAttribs('storage', { id => '1', nodetype => 'lpar' }); $tables{'nodetype'}->setNodeAttribs('storage', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('storage', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('storage', { netboot => 'yaboot' }); + $tables{'noderes'}->setNodeAttribs('storage', { netboot => 'grub2' }); # Figure out what cec each storage node is in and write ppc.hcp, ppc.parent, noderes.xcatmaster, noderes.servicenode # Math for SN in BB: cecnum = ( ( (snnum-1) / snsperbb) * cecsperbb) + cecstart-1 + snpositioninbb @@ -1789,7 +1789,7 @@ sub writecompute { $tables{'ppc'}->setNodeAttribs('compute', { nodetype => 'lpar' }); $tables{'nodetype'}->setNodeAttribs('compute', { nodetype => 'ppc,osi', arch => 'ppc64' }); $tables{'nodehm'}->setNodeAttribs('compute', { mgt => 'fsp', cons => 'fsp' }); - $tables{'noderes'}->setNodeAttribs('compute', { netboot => 'yaboot' }); + $tables{'noderes'}->setNodeAttribs('compute', { netboot => 'grub2' }); if ($STANZAS{'ll-config'}->{'central_manager_list'}) { # write the LL postscript for compute nodes addPostscript('compute', 'llcompute.sh'); } diff --git a/xCAT-server/xCAT-wsapi/restapi.pl b/xCAT-server/xCAT-wsapi/restapi.pl index a4427e8d0..c8f87526f 100755 --- a/xCAT-server/xCAT-wsapi/restapi.pl +++ b/xCAT-server/xCAT-wsapi/restapi.pl @@ -81,7 +81,7 @@ my %URIdef = ( PUT => { desc => "Change the attibutes for the node {nodename}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/nodes/node1 {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/nodes/node1 {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -89,7 +89,7 @@ my %URIdef = ( POST => { desc => "Create the node {nodename}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Create a node with attributes groups=all, mgt=dfm and netboot=yaboot|POST|/nodes/node1 {\"groups\":\"all\",\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Create a node with attributes groups=all, mgt=hmc and netboot=grub2|POST|/nodes/node1 {\"groups\":\"all\",\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "mkdef", fhandler => \&defhdl, outhdler => \&noout, @@ -571,7 +571,7 @@ my %URIdef = ( PUT => { desc => "Change the attibutes for the group {groupname}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/groups/all {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/groups/all {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -583,7 +583,7 @@ my %URIdef = ( GET => { desc => "Get the specific attributes for the group {groupname}.", usage => "||$usagemsg{objreturn}|", - example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"yaboot\",\n \"mgt\":\"dfm\"\n }\n}|", + example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"grub2\",\n \"mgt\":\"hmc\"\n }\n}|", cmd => "lsdef", fhandler => \&defhdl, outhdler => \&defout, @@ -2745,4 +2745,3 @@ sub pushFlags { } } - diff --git a/xCAT-server/xCAT-wsapi/xcatws-test.sh b/xCAT-server/xCAT-wsapi/xcatws-test.sh index 47d070218..267820393 100755 --- a/xCAT-server/xCAT-wsapi/xcatws-test.sh +++ b/xCAT-server/xCAT-wsapi/xcatws-test.sh @@ -158,7 +158,7 @@ RESTMSG="Display the node restapinode1" REST GET "/nodes/restapinode1" RESTMSG="Change the attributes for node restapinode1" -REST PUT "/nodes/restapinode1" '{"mgt":"fsp","netboot":"yaboot"}' +REST PUT "/nodes/restapinode1" '{"mgt":"hmc","netboot":"grub2"}' RESTMSG="Display the node restapinode1" REST GET "/nodes/restapinode1" @@ -194,4 +194,3 @@ REST GET "/groups/restapi" RESTMSG="Display the nodes in group restapi" REST GET "/nodes/restapi" - diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index 59d8d16ce..c61a20b71 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -83,7 +83,7 @@ my %URIdef = ( PUT => { desc => "Change the attributes for the node {noderange}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/nodes/node1 {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/nodes/node1 {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -91,7 +91,7 @@ my %URIdef = ( POST => { desc => "Create the node {noderange}.", usage => "|$usagemsg{objchparam} DataBody: {options:{opt1:v1,opt2:v2},attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Create a node with attributes groups=all, mgt=dfm and netboot=yaboot|POST|/nodes/node1 {\"options\":{\"--template\":\"x86_64kvmguest-template\"}, \"groups\":\"all\",\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Create a node with attributes groups=all, mgt=hmc and netboot=grub2|POST|/nodes/node1 {\"options\":{\"--template\":\"x86_64kvmguest-template\"}, \"groups\":\"all\",\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "mkdef", fhandler => \&defhdl, outhdler => \&noout, @@ -657,7 +657,7 @@ my %URIdef = ( PUT => { desc => "Change the attributes for the group {groupname}.", usage => "|$usagemsg{objchparam} DataBody: {attr1:v1,att2:v2,...}.|$usagemsg{non_getreturn}|", - example => "|Change the attributes mgt=dfm and netboot=yaboot.|PUT|/groups/all {\"mgt\":\"dfm\",\"netboot\":\"yaboot\"}||", + example => "|Change the attributes mgt=hmc and netboot=grub2.|PUT|/groups/all {\"mgt\":\"hmc\",\"netboot\":\"grub2\"}||", cmd => "chdef", fhandler => \&defhdl, outhdler => \&noout, @@ -669,7 +669,7 @@ my %URIdef = ( GET => { desc => "Get the specific attributes for the group {groupname}.", usage => "||$usagemsg{objreturn}|", - example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"yaboot\",\n \"mgt\":\"dfm\"\n }\n}|", + example => "|Get the attributes {mgt,netboot} for group all|GET|/groups/all/attrs/mgt,netboot|{\n \"all\":{\n \"netboot\":\"grub2\",\n \"mgt\":\"hmc\"\n }\n}|", cmd => "lsdef", fhandler => \&defhdl, outhdler => \&defout, @@ -3589,4 +3589,3 @@ sub pushFlags { } } -