set the netdevice installnic or primarynic, instead of the mac address, if the installnic or primarynic is set to keyword mac then the netdevice will be the mac address

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7156 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2010-08-20 05:22:41 +00:00
parent 40568dba33
commit 2d1cb4d54e

View File

@ -654,74 +654,49 @@ sub mkinstall
. $ent->{nfsserver}
. "$pkgdir/1";
my $mgtref = $hmtab->getNodeAttribs($node, ['mgt']);
#special case for system P machines, which is mgted by hmc or ivm
#mac address is used to identify the netdevice
if( ($mgtref->{mgt} eq "hmc" || $mgtref->{mgt} eq "ivm") && $arch =~ /ppc/)
my $netdev = "";
if ($ent->{installnic})
{
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
if (defined $macref->{mac})
if ($ent->{installnic} eq "mac")
{
$kcmdline .= " netdevice=" . $macref->{mac};
}
else
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$netdev = $macref->{mac};
}
else
{
$callback->(
{
error => ["No mac.mac for $node defined"],
errorcode => [1]
}
);
$netdev = $ent->{installnic};
}
}
else
}
elsif ($ent->{primarynic})
{
my $netdev = "";
if ($ent->{installnic})
if ($ent->{primarynic} eq "mac")
{
if ($ent->{installnic} eq "mac")
{
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$netdev = $macref->{mac};
}
else
{
$netdev = $ent->{installnic};
}
}
elsif ($ent->{primarynic})
{
if ($ent->{primarynic} eq "mac")
{
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$netdev = $macref->{mac};
}
else
{
$netdev = $ent->{primarynic};
}
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$netdev = $macref->{mac};
}
else
{
$netdev = "bootif";
}
if ($netdev eq "") #why it is blank, no mac defined?
{
$callback->(
{
error => ["No mac.mac for $node defined"],
errorcode => [1]
}
);
}
unless ($netdev eq "bootif") { #if going by bootif, BOOTIF will suffice
$kcmdline .= " netdevice=" . $netdev;
$netdev = $ent->{primarynic};
}
}
else
{
$netdev = "bootif";
}
if ($netdev eq "") #why it is blank, no mac defined?
{
$callback->(
{
error => ["No mac.mac for $node defined"],
errorcode => [1]
}
);
}
unless ($netdev eq "bootif") { #if going by bootif, BOOTIF will suffice
$kcmdline .= " netdevice=" . $netdev;
}
# Add the kernel paramets for driver update disk loading
foreach (@dd_drivers) {