From f13d37314c81388d0d34e7d5a4ec7c05e9b7f578 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Tue, 4 Jun 2002 16:36:25 +0000 Subject: hopefully fixes the loopback mounted iso ftp/http installs for kickstart (#65811) --- loader/loader.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'loader') diff --git a/loader/loader.c b/loader/loader.c index 97185b728..430ec0cf6 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -2302,6 +2302,7 @@ static char * setupKickstart(char * location, struct knownDevices * kd, return NULL; } else if (ksType == KS_CMD_URL) { + char * finalPrefix; memset(&ui, 0, sizeof(ui)); imageUrl = strdup(url); @@ -2350,6 +2351,19 @@ static char * setupKickstart(char * location, struct knownDevices * kd, logMessage("failed to retrieve second stage"); return NULL; } + + /* now that we've loaded images, the url could have changed to handle + the multi-disc loopback stuff */ + if (!strcmp(ui.prefix, "/")) + finalPrefix = "/."; + else + finalPrefix = ui.prefix; + + url = malloc(strlen(finalPrefix) + 25 + strlen(ui.address) + strlen(ui.login)); + sprintf(url, "%s://%s%s/%s", + ui.protocol == URL_METHOD_FTP ? "ftp" : "http", + ui.login, ui.address, finalPrefix); + } #endif -- cgit