From fee16aca24c752715e6f67fd28ffd64907c38e8a Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Thu, 23 Jan 2003 21:41:27 +0000 Subject: add support for the ks=nfs:host/path/ ks=http://host/path/ syntax to resolve to ip-kickstart. Also adds ftp kickstart file pulling. (#77320 at least... I think there are a few others on this) --- loader2/nfsinstall.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'loader2/nfsinstall.c') diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c index e760936b8..69526ee6c 100644 --- a/loader2/nfsinstall.c +++ b/loader2/nfsinstall.c @@ -275,30 +275,27 @@ void setKickstartNfs(struct loaderData_s * loaderData, int argc, int kickstartFromNfs(char * url, struct knownDevices * kd, struct loaderData_s * loaderData, int flags) { - char * host = NULL, * file = NULL; + char * host = NULL, *path = NULL, * file = NULL; int failed = 0; + struct networkDeviceConfig netCfg; - if (kickstartNetworkUp(kd, loaderData, flags)) { + logMessage("going to get ks from nfs"); + + if (kickstartNetworkUp(kd, loaderData, &netCfg, flags)) { logMessage("unable to bring up network"); return 1; } - host = url; - /* JKFIXME: need to add this; abstract out the functionality - * so that we can use it for all types */ - if (host[strlen(url) - 1] == '/') { - logMessage("directory syntax not supported yet"); - return 1; - /* host[strlen(host) - 1] = '\0'; - file = malloc(30); - sprintf(file, "%s-kickstart", inet_ntoa(netDev.dev.ip));*/ + getHostandPath(url, &host, &path, inet_ntoa(netCfg.dev.ip)); + + /* nfs has to be a little bit different... split off the last part as + * the file and then concatenate host + dir path */ + file = strrchr(path, '/'); + if (!file) { + file = "/"; } else { - file = strrchr(host, '/'); - if (!file) { - file = "/"; - } else { - *file++ = '\0'; - } + *file++ ='\0'; + host = sdupprintf("%s/%s", host, path); } logMessage("ks location: nfs://%s/%s", host, file); -- cgit