From 77f3598c8f2f480c5896b96a01cfb5fc4d961c37 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 25 Sep 2009 20:46:26 +0000 Subject: [PATCH] -Bring back the addkcmdline handling at the pxe level git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4234 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/pxe.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pxe.pm b/xCAT-server/lib/xcat/plugins/pxe.pm index a6c259648..7f31643dd 100644 --- a/xCAT-server/lib/xcat/plugins/pxe.pm +++ b/xCAT-server/lib/xcat/plugins/pxe.pm @@ -5,6 +5,7 @@ use Sys::Syslog; use Socket; use File::Copy; +my $addkcmdlinehandled; my $request; my $callback; my $dhcpconf = "/etc/dhcpd.conf"; @@ -66,6 +67,10 @@ sub setstate { my %chainhash = %{shift()}; my %machash = %{shift()}; my $kern = $bphash{$node}->[0]; #$bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']); + if (not $addkcmdlinehandled->{$node} and $kern->{addkcmdline}) { #Implement the kcmdline append here for + #most generic, least code duplication + $kern->{kcmdline} .= " ".$kern->{addkcmdline}; + } if ($kern->{kcmdline} =~ /!myipfn!/) { my $ipfn = xCAT::Utils->my_ip_facing($node); unless ($ipfn) { @@ -80,7 +85,7 @@ sub setstate { } ); } - $kern->{kcmdline} =~ s/!myipfn!/$ipfn/; + $kern->{kcmdline} =~ s/!myipfn!/$ipfn/g; } my $pcfg; open($pcfg,'>',$tftpdir."/pxelinux.cfg/".$node); @@ -168,7 +173,6 @@ sub setstate { my $errored = 0; sub pass_along { my $resp = shift; - $callback->($resp); if ($resp and ($resp->{errorcode} and $resp->{errorcode}->[0]) or ($resp->{error} and $resp->{error}->[0])) { $errored=1; } @@ -176,7 +180,12 @@ sub pass_along { if ($_->{error} or $_->{errorcode}) { $errored=1; } + if ($_->{_addkcmdlinehandled}) { + $addkcmdlinehandled->{$_->{name}->[0]}=1; + return; #Don't send back to client this internal hint + } } + $callback->($resp); } @@ -324,7 +333,7 @@ sub process_request { my $bptab = xCAT::Table->new('bootparams',-create=>1); my $chaintab = xCAT::Table->new('chain'); my $mactab = xCAT::Table->new('mac'); #to get all the hostnames - my %bphash = %{$bptab->getNodesAttribs(\@nodes,[qw(kernel initrd kcmdline)])}; + my %bphash = %{$bptab->getNodesAttribs(\@nodes,[qw(kernel initrd kcmdline addkcmdline)])}; my %chainhash = %{$chaintab->getNodesAttribs(\@nodes,[qw(currstate)])}; my %machash = %{$mactab->getNodesAttribs(\@nodes,[qw(mac)])}; foreach (@nodes) {