From b5206140dceb17a7832cc27ae23f5a0ec6a65a20 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 4 Oct 2011 18:13:37 +0000 Subject: [PATCH] Fix pxelinux files made by xnba using '!myipfn!' shortcut (at least best effort) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10699 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/xnba.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index 6287071e0..9bf05cbe7 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -130,10 +130,16 @@ sub setstate { } } my $elilokcmdline = $kern->{kcmdline}; #track it separate, since vars differ + my $pxelinuxkcmdline = $kern->{kcmdline}; #track it separate, since vars differ if ($kern->{kcmdline} =~ /!myipfn!/) { my $ipfn = '${next-server}';#xCAT::Utils->my_ip_facing($node); $kern->{kcmdline} =~ s/!myipfn!/$ipfn/g; - $elilokcmdline =~ s/!myipfn!/%N/; + $elilokmdline =~ s/!myipfn!/%N/; + $ipfn = xCAT::Utils->my_ip_facing($node); + unless ($ipfn) { $ipfn = $::XCATSITEVALS{master}; } + if ($ipfn) { + $pxelinuxkcmdline =~ s/!myipfn!/$ipfn/; + } } my $pcfg; unlink($tftpdir."/xcat/xnba/nodes/".$node.".pxelinux"); @@ -164,7 +170,7 @@ sub setstate { close($pcfg); open($pcfg,'>',$tftpdir."/xcat/xnba/nodes/".$node.".pxelinux"); print $pcfg "DEFAULT xCAT\nLABEL xCAT\n KERNEL mboot.c32\n"; - print $pcfg " APPEND $hypervisor --- $kernel ".$kern->{kcmdline}." --- ".$kern->{initrd}."\n"; + print $pcfg " APPEND $hypervisor --- $kernel ".$pxelinuxkcmdline." --- ".$kern->{initrd}."\n"; } else { if ($kern->{kernel} =~ /\.c32\z/ or $kern->{kernel} =~ /memdisk\z/) { #gPXE comboot support seems insufficient, chain pxelinux instead print $pcfg " set 209:string xcat/xnba/nodes/$node.pxelinux\n"; @@ -184,7 +190,7 @@ sub setstate { print $pcfg "initrd=".$kern->{initrd}." "; } if ($kern and $kern->{kcmdline}) { - print $pcfg $kern->{kcmdline}."\n"; + print $pcfg $pxelinuxkcmdline."\n"; } else { print $pcfg "\n"; }