-Fix mknb typo on yaboot configurations

-Have yaboot and pxe create hex filenames for all addresses known to mac table, in addition to the nodename


git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@608 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-02-28 00:17:24 +00:00
parent 383e2c5eed
commit d2e7d9cb64
3 changed files with 44 additions and 12 deletions

View File

@ -117,10 +117,10 @@ sub process_request {
} elsif ($arch =~ /ppc/) {
open($cfgfile,">","$tftpdir/etc/".lc($_));
print $cfgfile "timeout=5\n";
print $cfgfile "label=xcat\n";
print $cfgfile "image=xcat/nbk.$arch\n";
print $cfgfile "initrd=xcat/nbfs.$arch.gz\n";
print $cfgfile 'append="xcatd='.$hexnets->{$_}.":$xcatdport $consolecmdline\n";
print $cfgfile " label=xcat\n";
print $cfgfile " image=xcat/nbk.$arch\n";
print $cfgfile " initrd=xcat/nbfs.$arch.gz\n";
print $cfgfile ' append="xcatd='.$hexnets->{$_}.":$xcatdport $consolecmdline\"\n";
close($cfgfile);
}
}

View File

@ -100,15 +100,31 @@ sub setstate {
print $pcfg "LOCALBOOT 0\n";
close($pcfg);
}
my $mactab = xCAT::Table->new('mac'); #to get all the hostnames
my %ipaddrs;
my $ip = inet_ntoa(inet_aton($node));;
unless ($ip) {
syslog("local1|err","xCAT unable to resolve IP in pxe plugin");
return;
}
my @ipa=split(/\./,$ip);
my $pname = sprintf("%02X%02X%02X%02X",@ipa);
unlink($tftpdir."/pxelinux.cfg/".$pname);
link($tftpdir."/pxelinux.cfg/".$node,$tftpdir."/pxelinux.cfg/".$pname);
$ipaddrs{$ip} = 1;
if ($mactab) {
my $ment = $mactab->getNodeAttribs($node,['mac']);
if ($ment and $ment->{mac}) {
my @macs = split(/\|/,$ment->{mac});
foreach (@macs) {
if (/!(.*)/) {
$ipaddrs{inet_ntoa(inet_aton($1))} = 1;
}
}
}
}
foreach $ip (keys %ipaddrs) {
my @ipa=split(/\./,$ip);
my $pname = sprintf("%02X%02X%02X%02X",@ipa);
unlink($tftpdir."/pxelinux.cfg/".$pname);
link($tftpdir."/pxelinux.cfg/".$node,$tftpdir."/pxelinux.cfg/".$pname);
}
}

View File

@ -108,10 +108,26 @@ sub setstate {
syslog("local1|err","xCAT unable to resolve IP in yaboot plugin");
return;
}
my @ipa=split(/\./,$ip);
my $pname = sprintf("%02x%02x%02x%02x",@ipa);
unlink($tftpdir."/etc/".$pname);
link($tftpdir."/etc/".$node,$tftpdir."/etc/".$pname);
my $mactab = xCAT::Table->new('mac');
my %ipaddrs;
$ipaddrs{$ip} = 1;
if ($mactab) {
my $ment = $mactab->getNodeAttribs($node,['mac']);
if ($ment and $ment->{mac}) {
my @macs = split(/\|/,$ment->{mac});
foreach (@macs) {
if (/!(.*)/) {
$ipaddrs{inet_ntoa(inet_aton($1))} = 1;
}
}
}
}
foreach $ip (keys %ipaddrs) {
my @ipa=split(/\./,$ip);
my $pname = sprintf("%02x%02x%02x%02x",@ipa);
unlink($tftpdir."/etc/".$pname);
link($tftpdir."/etc/".$node,$tftpdir."/etc/".$pname);
}
}