From 2d1cb4d54ecfd7b18d029aaf84e4848813ff3272 Mon Sep 17 00:00:00 2001 From: ligc Date: Fri, 20 Aug 2010 05:22:41 +0000 Subject: [PATCH] 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 --- xCAT-server/lib/xcat/plugins/sles.pm | 89 ++++++++++------------------ 1 file changed, 32 insertions(+), 57 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index fb3df17e5..9afacc3a7 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -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) {