-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
This commit is contained in:
parent
af98e24170
commit
77f3598c8f
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user