summaryrefslogtreecommitdiffstats
path: root/loader2/nfsinstall.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-01-23 21:41:27 +0000
committerJeremy Katz <katzj@redhat.com>2003-01-23 21:41:27 +0000
commitfee16aca24c752715e6f67fd28ffd64907c38e8a (patch)
tree9060dd3fa69aa2d7fc1398a0732bbea582c0fa46 /loader2/nfsinstall.c
parentc9fa7f7ec292d892b05028c4c7cc0b4c40103f38 (diff)
downloadanaconda-fee16aca24c752715e6f67fd28ffd64907c38e8a.tar.gz
anaconda-fee16aca24c752715e6f67fd28ffd64907c38e8a.tar.xz
anaconda-fee16aca24c752715e6f67fd28ffd64907c38e8a.zip
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)
Diffstat (limited to 'loader2/nfsinstall.c')
-rw-r--r--loader2/nfsinstall.c31
1 files changed, 14 insertions, 17 deletions
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);