From a9676db2b152a6a5c302b475107d6d61e6aaa362 Mon Sep 17 00:00:00 2001 From: Mike Fulbright Date: Mon, 24 Apr 2000 18:26:49 +0000 Subject: Fix to allow kickstart specified hostname to override --- loader/net.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/loader/net.c b/loader/net.c index 65c43eaa5..61f2597a6 100644 --- a/loader/net.c +++ b/loader/net.c @@ -498,6 +498,7 @@ int kickstartNetwork(char * device, struct networkDeviceConfig * netDev, int ksArgc; int netSet, rc; char * arg, * chptr; + char * kshostname=NULL; poptContext optCon; struct in_addr * parseAddress; int noDns = 0; @@ -548,10 +549,12 @@ int kickstartNetwork(char * device, struct networkDeviceConfig * netDev, netSet = PUMP_INTFINFO_HAS_NETMASK; break; - /* ignore hostname for now, just don't barf on it! */ - case 'h': - parseAddress = NULL; - break; + case 'h': + if (kshostname) + free(kshostname); + kshostname = strdup(arg); + logMessage("netDev->dev.hostname = %s", kshostname); + break; } if (parseAddress && !inet_aton(arg, parseAddress)) { @@ -605,6 +608,12 @@ int kickstartNetwork(char * device, struct networkDeviceConfig * netDev, logMessage("nodns is %d", noDns); + if (kshostname) { + logMessage("setting ks specified hostname of %s", kshostname); + netDev->dev.hostname=strdup(kshostname); + netDev->dev.set |= PUMP_NETINFO_HAS_HOSTNAME; + } + if (!noDns) findHostAndDomain(netDev, flags); -- cgit