diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 4cba7141d..c76cb0ff7 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -776,18 +776,47 @@ sub mkinstall if ($maxmem) { $kcmdline.=" mem=$maxmem"; } + my $ksdev = ""; if ($ent->{installnic}) { - $kcmdline .= " ksdevice=" . $ent->{installnic}; + if ($ent->{installnic} eq "mac") + { + my $mactab = xCAT::Table->new("mac"); + my $macref = $mactab->getNodeAttribs($node, ['mac']); + $ksdev = $macref->{mac}; + } + else + { + $ksdev = $ent->{installnic}; + } } elsif ($ent->{primarynic}) { - $kcmdline .= " ksdevice=" . $ent->{primarynic}; + if ($ent->{primarynic} eq "mac") + { + my $mactab = xCAT::Table->new("mac"); + my $macref = $mactab->getNodeAttribs($node, ['mac']); + $ksdev = $macref->{mac}; + } + else + { + $ksdev = $ent->{primarynic}; + } } else { - $kcmdline .= " ksdevice=eth0"; + $ksdev = "eth0"; } + if ($ksdev eq "") + { + $callback->( + { + error => ["No MAC address defined for " . $node], + errorcode => [1] + } + ); + } + $kcmdline .= " ksdevice=" . $ksdev; #TODO: dd= for driver disks if (defined($sent->{serialport})) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 5dfc26344..f27aaae07 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -653,18 +653,47 @@ sub mkinstall } else { + my $netdev = ""; if ($ent->{installnic}) { - $kcmdline .= " netdevice=" . $ent->{installnic}; + 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}) { - $kcmdline .= " netdevice=" . $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}; + } } else { - $kcmdline .= " netdevice=eth0"; + $netdev = "eth0"; } + if ($netdev eq "") #why it is blank, no mac defined? + { + $callback->( + { + error => ["No mac.mac for $node defined"], + errorcode => [1] + } + ); + } + $kcmdline .= " netdevice=" . $netdev; } #TODO: driver disk handling should in SLES case be a mod of the install source, nothing to see here