Since every boot method now includes the full installation environment, we
don't have to go looking for install.img anymore. Therefore, the method
configuration for URL installs only needs to (1) ask for where the packages
live, and (2) attempt to fetch updates.img and product.img from that
location.
---
loader/loader.c | 21 +++++++++++-----
loader/method.h | 4 +-
loader/urlinstall.c | 63 +++++++++++++++++++++++++--------------------------
loader/urlinstall.h | 4 +-
4 files changed, 49 insertions(+), 43 deletions(-)
case STEP_METHOD: {
if (FL_ASKMETHOD(flags)) {
- loaderData->method = -1;
-
if (FL_CMDLINE(flags)) {
fprintf(stderr, "No method given for cmdline mode, aborting
");
doExit(EXIT_FAILURE);
@@ -1330,17 +1328,25 @@ static void doLoaderMain(struct loaderData_s *loaderData,
30, 10, 20, 6, installNames, &loaderData->method,
_("OK"), _("Back"), NULL);
if (rc == 2) {
- loaderData->method = -1;
+ flags |= LOADER_FLAGS_ASKMETHOD;
}
if (rc && (rc != 1)) {
step = STEP_KBD;
dir = -1;
} else {
+ /* Now prompt for the method-specific config info. */
+ rc = installMethods[validMethods[loaderData->method]].prompt(loaderData);
+
+ /* Just go back to the method selection screen. */
+ if (rc == LOADER_BACK)
+ break;
+
class = installMethods[validMethods[loaderData->method]].type;
step = STEP_DRIVER;
dir = 1;
}
+
break;
}
@@ -1523,6 +1529,7 @@ static void doLoaderMain(struct loaderData_s *loaderData,
/* FIXME - this is where we need to look for product.img,
* updates.img, etc.
*/
+ installMethods[validMethods[loaderData->method]].findExtras(loaderData);
step = STEP_DONE;
break;
}
diff --git a/loader/method.h b/loader/method.h
index 967ed5d..9d71ec3 100644
--- a/loader/method.h
+++ b/loader/method.h
@@ -35,8 +35,8 @@ struct installMethod {
char * name;
int network;
enum deviceType type;
- char * (*mountImage)(struct installMethod * method,
- char * location, struct loaderData_s * loaderData);
+ int (*prompt)(struct loaderData_s *loaderData);
+ int (*findExtras)(struct loaderData_s *loaderData);
};
- /* Figure out the path where updates.img and product.img files are
- * kept. Since ui->url points to a stage2 image file, we just need
- * to trim off the file name and look in the same directory.
- */
- if ((slash = strrchr(oldUrl, '/')) == NULL)
+ if (!loaderData->instRepo)
return 0;
- if ((path = strndup(oldUrl, slash-oldUrl)) == NULL)
- path = oldUrl;
-
/* grab the updates.img before install.img so that we minimize our
* ramdisk usage */
- checked_asprintf(&ui->url, "%s/%s", path, "updates.img");
+ checked_asprintf(&url, "%s/images/%s", loaderData->instRepo, "updates.img");
/* grab the product.img before install.img so that we minimize our
* ramdisk usage */
- checked_asprintf(&ui->url, "%s/%s", path, "product.img");
+ checked_asprintf(&url, "%s/images/%s", loaderData->instRepo, "product.img");