summaryrefslogtreecommitdiffstats
path: root/loader2
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-10-02 20:45:45 +0000
committerJeremy Katz <katzj@redhat.com>2003-10-02 20:45:45 +0000
commit825702f598db2949abaf5c4ec206f54af0de836c (patch)
tree6f419d68d8a2f2cc96d49687093ac018d3eaddd3 /loader2
parentefb7db4145ba33c1c27dc037ce7c674bb7921f2c (diff)
downloadanaconda-825702f598db2949abaf5c4ec206f54af0de836c.tar.gz
anaconda-825702f598db2949abaf5c4ec206f54af0de836c.tar.xz
anaconda-825702f598db2949abaf5c4ec206f54af0de836c.zip
dd from path (from msw, tweaked slightly)
Diffstat (limited to 'loader2')
-rw-r--r--loader2/driverdisk.c11
-rw-r--r--loader2/loader.c5
2 files changed, 14 insertions, 2 deletions
diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c
index da4f29003..d1e193e01 100644
--- a/loader2/driverdisk.c
+++ b/loader2/driverdisk.c
@@ -430,13 +430,18 @@ static void loadFromLocation(struct knownDevices * kd,
void getDDFromSource(struct knownDevices * kd,
struct loaderData_s * loaderData,
char * src, int flags) {
+ char *path = "/tmp/dd.img";
+ int unlinkf = 0;
+
if (!strncmp(src, "nfs:", 4)) {
+ unlinkf = 1;
if (getFileFromNfs(src + 4, "/tmp/dd.img", kd, loaderData,
flags)) {
logMessage("unable to retrieve driver disk: %s", src);
return;
}
} else if (!strncmp(src, "ftp://", 6) || !strncmp(src, "http://", 7)) {
+ unlinkf = 1;
if (getFileFromUrl(src, "/tmp/dd.img", kd, loaderData, flags)) {
logMessage("unable to retrieve driver disk: %s", src);
return;
@@ -448,17 +453,19 @@ void getDDFromSource(struct knownDevices * kd,
loaderData->modDepsPtr, loaderData->modInfo,
kd, flags);
return;
+ } else if (!strncmp(src, "path:", 5)) {
+ path = src + 5;
} else {
newtWinMessage(_("Kickstart Error"), _("OK"),
_("Unknown driver disk kickstart source: %s"), src);
return;
}
- if (!mountLoopback("/tmp/dd.img", "/tmp/drivers", "loop6")) {
+ if (!mountLoopback(path, "/tmp/drivers", "loop6")) {
loadFromLocation(kd, loaderData, "/tmp/drivers", flags);
umountLoopback("/tmp/drivers", "loop6");
unlink("/tmp/drivers");
- unlink("/tmp/dd.img");
+ if (unlinkf) unlink(path);
}
}
diff --git a/loader2/loader.c b/loader2/loader.c
index 7e11f0cb8..9c4d6662c 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -1161,6 +1161,11 @@ int main(int argc, char ** argv) {
modInfo, &kd, flags);
}
+ if (!access("/dd.img", R_OK)) {
+ logMessage("found /dd.img, loading drivers");
+ getDDFromSource(&kd, &loaderData, "path:/dd.img", flags);
+ }
+
/* this allows us to do an early load of modules specified on the
* command line to allow automating the load order of modules so that
* eg, certain scsi controllers are definitely first.