diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index a5e2eb60a..b286edb5c 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -752,15 +752,19 @@ sub mknetboot my $useifname=0; #for rhels5.x-ppc64, if installnic="mac", BOOTIF= should be appended my $usemac=0; + my $nicname=""; if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic} and $reshash->{$node}->[0]->{installnic} ne "mac") { $useifname=1; - $kcmdline .= "ifname=".$reshash->{$node}->[0]->{installnic} . ":"; + #$kcmdline .= "ifname=".$reshash->{$node}->[0]->{installnic} . ":"; + $nicname=$reshash->{$node}->[0]->{installnic}; } elsif ($nodebootif) { $useifname=1; - $kcmdline .= "ifname=$nodebootif:"; + #$kcmdline .= "ifname=$nodebootif:"; + $nicname=$nodebootif; } elsif ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{primarynic} and $reshash->{$node}->[0]->{primarynic} ne "mac") { $useifname=1; - $kcmdline .= "ifname=".$reshash->{$node}->[0]->{primarynic}.":"; + #$kcmdline .= "ifname=".$reshash->{$node}->[0]->{primarynic}.":"; + $nicname=$reshash->{$node}->[0]->{primarynic}; }else{ if($arch=~ /ppc/) { @@ -790,24 +794,32 @@ sub mknetboot # } } - if ($useifname && $mac) { - $kcmdline .= "$mac "; + if( ($nicname ne "") and (not xCAT::NetworkUtils->isValidMAC($nicname) )){ + if ($useifname && $mac) { + $kcmdline .= "ifname=$nicname:$mac "; + } + $kcmdline .= "netdev=$nicname "; + }else { + if($mac){ + $kcmdline .= "BOOTIF=$mac "; + } } + # add "netdev=" or "BOOTIF=" # which are used for other scenarios - my $netdev = ""; - if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic} and $reshash->{$node}->[0]->{installnic} ne "mac") { - $kcmdline .= "netdev=" . $reshash->{$node}->[0]->{installnic} . " "; - } elsif ($nodebootif) { - $kcmdline .= "netdev=" . $nodebootif . " "; - } elsif ( $reshash->{$node}->[0] and $reshash->{$node}->[0]->{primarynic} and $reshash->{$node}->[0]->{primarynic} ne "mac") { - $kcmdline .= "netdev=" . $reshash->{$node}->[0]->{primarynic} . " "; - } else { - if ( ($usemac || $useifname) && $mac) { - $kcmdline .= "BOOTIF=" . $mac . " "; - } - } + #my $netdev = ""; + #if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic} and $reshash->{$node}->[0]->{installnic} ne "mac") { + # $kcmdline .= "netdev=" . $reshash->{$node}->[0]->{installnic} . " "; + #} elsif ($nodebootif) { + # $kcmdline .= "netdev=" . $nodebootif . " "; + #} elsif ( $reshash->{$node}->[0] and $reshash->{$node}->[0]->{primarynic} and $reshash->{$node}->[0]->{primarynic} ne "mac") { + # $kcmdline .= "netdev=" . $reshash->{$node}->[0]->{primarynic} . " "; + #} else { + # if ( ($usemac || $useifname) && $mac) { + # $kcmdline .= "BOOTIF=" . $mac . " "; + # } + #} my %client_nethash = xCAT::DBobjUtils->getNetwkInfo( [$node] ); if ( $client_nethash{$node}{mgtifname} =~ /hf/ )