summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-06-03 00:42:10 +0000
committerErik Troan <ewt@redhat.com>2000-06-03 00:42:10 +0000
commit186fef98e666786b9881b2c154ea60de8a217b6d (patch)
treecb7a042d7214c1d4903d124b04cc31f078364007
parent93d143385829ca1685e003dff08efa79b1c1dec1 (diff)
downloadanaconda-186fef98e666786b9881b2c154ea60de8a217b6d.tar.gz
anaconda-186fef98e666786b9881b2c154ea60de8a217b6d.tar.xz
anaconda-186fef98e666786b9881b2c154ea60de8a217b6d.zip
driver disks seem to work now :-)
-rw-r--r--isys/isys.h6
-rw-r--r--isys/moduleinfo.c21
-rw-r--r--loader/devices.c62
-rw-r--r--loader/devices.h11
-rw-r--r--loader/kickstart.c1
-rw-r--r--loader/loader.c97
-rw-r--r--loader/modules.c21
-rw-r--r--loader/modules.h4
8 files changed, 123 insertions, 100 deletions
diff --git a/isys/isys.h b/isys/isys.h
index ae0317396..f91ba47c2 100644
--- a/isys/isys.h
+++ b/isys/isys.h
@@ -12,8 +12,6 @@ struct moduleArg {
};
#define MI_FLAG_NOMISCARGS (1 << 0)
-enum miLocationTypes { MI_LOCATION_NONE, MI_LOCATION_DISKNAME,
- MI_LOCATION_DIRECTORY };
struct moduleInfo {
char * moduleName;
@@ -23,7 +21,6 @@ struct moduleInfo {
int numArgs;
struct moduleArg * args;
int flags;
- enum miLocationTypes location;
void * locationID;
};
@@ -36,8 +33,7 @@ typedef struct moduleInfoSet_s * moduleInfoSet;
moduleInfoSet isysNewModuleInfoSet(void);
void isysFreeModuleInfoSet(moduleInfoSet mis);
-int isysReadModuleInfo(const char * filename, moduleInfoSet mis,
- enum miLocationTypes identType, void * path);
+int isysReadModuleInfo(const char * filename, moduleInfoSet mis, void * path);
struct moduleInfo * isysFindModuleInfo(moduleInfoSet mis,
const char * moduleName);
diff --git a/isys/moduleinfo.c b/isys/moduleinfo.c
index 96b556ab9..5eadbdb3d 100644
--- a/isys/moduleinfo.c
+++ b/isys/moduleinfo.c
@@ -56,8 +56,7 @@ moduleInfoSet isysNewModuleInfoSet(void) {
return calloc(sizeof(struct moduleInfoSet_s), 1);
}
-int isysReadModuleInfo(const char * filename, moduleInfoSet mis,
- enum miLocationTypes identType, void * ident) {
+int isysReadModuleInfo(const char * filename, moduleInfoSet mis, void * ident) {
int fd, isIndented;
char * buf, * start, * next, * chptr;
struct stat sb;
@@ -125,15 +124,15 @@ int isysReadModuleInfo(const char * filename, moduleInfoSet mis,
nextModule = mis->moduleList + mis->numModules;
nextModule->moduleName = strdup(start);
- nextModule->major = DRIVER_NONE;
- nextModule->minor = DRIVER_MINOR_NONE;
- nextModule->description = NULL;
- nextModule->flags = 0;
- nextModule->args = NULL;
- nextModule->numArgs = 0;
- nextModule->location = identType;
- nextModule->locationID = ident;
- }
+ }
+
+ nextModule->major = DRIVER_NONE;
+ nextModule->minor = DRIVER_MINOR_NONE;
+ nextModule->description = NULL;
+ nextModule->flags = 0;
+ nextModule->args = NULL;
+ nextModule->numArgs = 0;
+ nextModule->locationID = ident;
} else if (!nextModule) {
/* ACK! syntax error */
return 1;
diff --git a/loader/devices.c b/loader/devices.c
index a3b2ef25a..42473bf5b 100644
--- a/loader/devices.c
+++ b/loader/devices.c
@@ -138,7 +138,7 @@ static int getModuleArgs(struct moduleInfo * mod, char *** argPtr) {
int devInitDriverDisk(moduleInfoSet modInfo, moduleList modLoaded,
moduleDeps *modDepsPtr, int flags, char * mntPoint,
- int removeable) {
+ struct driverDiskInfo * ddi) {
int badDisk = 0;
char from[200];
struct stat sb;
@@ -171,13 +171,11 @@ int devInitDriverDisk(moduleInfoSet modInfo, moduleList modLoaded,
diskName[sb.st_size] = '\0';
close(fd);
+ ddi->title = strdup(diskName);
+
sprintf(from, "%s/modinfo", mntPoint);
- if (removeable)
- fd = isysReadModuleInfo(from, modInfo, MI_LOCATION_DISKNAME, diskName);
- else
- fd = isysReadModuleInfo(from, modInfo, MI_LOCATION_DIRECTORY,
- mntPoint);
+ fd = isysReadModuleInfo(from, modInfo, ddi);
sprintf(from, "%s/modules.dep", mntPoint);
mlLoadDeps(modDepsPtr, from);
@@ -191,6 +189,9 @@ int devLoadDriverDisk(moduleInfoSet modInfo, moduleList modLoaded,
moduleDeps *modDepsPtr, int flags, int cancelNotBack) {
int rc;
int done = 0;
+ struct driverDiskInfo * ddi;
+
+ ddi = calloc(sizeof(*ddi), 1);
do {
if (FL_EXPERT(flags)) {
@@ -207,18 +208,27 @@ int devLoadDriverDisk(moduleInfoSet modInfo, moduleList modLoaded,
if (rc == 2) return LOADER_BACK;
- mlLoadModule("vfat", MI_LOCATION_NONE, NULL, modLoaded, (*modDepsPtr),
- NULL, modInfo, flags);
+ mlLoadModule("vfat", NULL, modLoaded, (*modDepsPtr), NULL, modInfo,
+ flags);
- devMakeInode("fd0", "/tmp/fd0");
+ ddi->device = "fd0";
+ ddi->mntDevice = "/tmp/fd0";
- if (doPwMount("/tmp/fd0", "/tmp/drivers", "vfat", 1, 0, NULL, NULL))
- if (doPwMount("/tmp/fd0", "/tmp/drivers", "ext2", 1, 0, NULL, NULL))
+ devMakeInode(ddi->device, ddi->mntDevice);
+
+ ddi->fs = "vfat";
+ if (doPwMount(ddi->mntDevice, "/tmp/drivers", ddi->fs, 1, 0, NULL,
+ NULL)) {
+ ddi->fs = "ext2";
+ if (doPwMount(ddi->mntDevice, "/tmp/drivers", ddi->fs, 1, 0, NULL,
+ NULL))
newtWinMessage(_("Error"), _("OK"),
_("Failed to mount driver disk."));
+ }
- if (devInitDriverDisk(modInfo, modLoaded, modDepsPtr,
- flags, "/tmp/drivers", 1))
+
+ if (devInitDriverDisk(modInfo, modLoaded, modDepsPtr, flags,
+ "/tmp/drivers", ddi))
newtWinMessage(_("Error"), _("OK"),
_("The floppy disk you inserted is not a valid driver disk "
"for this release of Red Hat Linux."));
@@ -365,8 +375,8 @@ int devDeviceMenu(enum driverMajor type, moduleInfoSet modInfo,
scsiWindow(mod->moduleName);
sleep(1);
}
- rc = mlLoadModule(mod->moduleName, mod->location, mod->locationID,
- modLoaded, *modDepsPtr, args, modInfo, flags);
+ rc = mlLoadModule(mod->moduleName, mod->locationID, modLoaded,
+ *modDepsPtr, args, modInfo, flags);
if (mod->major == DRIVER_SCSI) newtPopWindow();
if (args) {
@@ -385,7 +395,7 @@ int devDeviceMenu(enum driverMajor type, moduleInfoSet modInfo,
return rc;
}
-char * extractModule(char * location, char * modName) {
+char * extractModule(struct driverDiskInfo * ddi, char * modName) {
char * pattern[] = { NULL, NULL };
struct utsname un;
gzFile from;
@@ -397,20 +407,28 @@ char * extractModule(char * location, char * modName) {
int rc;
int failed;
char * toPath;
+ char * chptr;
uname(&un);
+ /* strip off BOOT, -SMP, whatever */
+ chptr = un.release + strlen(un.release) - 1;
+ while (!isdigit(*chptr)) chptr--;
+ *(chptr + 1) = '\0';
+
pattern[0] = alloca(strlen(modName) + strlen(un.release) + 5);
sprintf(pattern[0], "%s*/%s.o", un.release, modName);
logMessage("extracting pattern %s", pattern[0]);
- devMakeInode("fd0", "/tmp/fd0");
+ if (ddi->device)
+ devMakeInode(ddi->device, ddi->mntDevice);
+
while (1) {
failed = 0;
- if (doPwMount("/tmp/fd0", "/tmp/drivers", "vfat", 1, 0, NULL, NULL))
- if (doPwMount("/tmp/fd0", "/tmp/drivers", "ext2", 1, 0, NULL, NULL))
- failed = 1;
+ if (doPwMount(ddi->mntDevice, "/tmp/drivers", ddi->fs, 1, 0,
+ NULL, NULL))
+ failed = 1;
if (failed && !first) {
newtWinMessage(_("Error"), _("OK"),
@@ -427,7 +445,7 @@ char * extractModule(char * location, char * modName) {
buf[sb.st_size] = '\0';
close(fd);
- failed = strcmp(buf, location);
+ failed = strcmp(buf, ddi->title);
free(buf);
}
@@ -460,7 +478,7 @@ char * extractModule(char * location, char * modName) {
ejectFloppy();
rc = newtWinChoice(_("Driver Disk"), _("OK"), _("Cancel"),
- _("Please insert the %s driver disk now."), location);
+ _("Please insert the %s driver disk now."), ddi->title);
if (rc == 2) return NULL;
}
}
diff --git a/loader/devices.h b/loader/devices.h
index 26de0d1c2..df20e44e3 100644
--- a/loader/devices.h
+++ b/loader/devices.h
@@ -4,6 +4,13 @@
#include "../isys/isys.h"
#include "modules.h"
+struct driverDiskInfo {
+ char * device; /* may be null */
+ char * mntDevice;
+ char * fs;
+ char * title;
+};
+
int devDeviceMenu(enum driverMajor type, moduleInfoSet modInfo,
moduleList modLoaded, moduleDeps * modDepsPtr, int flags,
char ** moduleName);
@@ -11,9 +18,9 @@ int devLoadDriverDisk(moduleInfoSet modInfo, moduleList modLoaded,
moduleDeps *modDepsPtr, int flags, int cancelNotBack);
int devInitDriverDisk(moduleInfoSet modInfo, moduleList modLoaded,
moduleDeps *modDepsPtr, int flags, char * mntPoint,
- int removeable);
+ struct driverDiskInfo * ddi);
void ejectFloppy(void);
-char * extractModule(char * location, char * modName);
+char * extractModule(struct driverDiskInfo * location, char * modName);
#endif
diff --git a/loader/kickstart.c b/loader/kickstart.c
index 4a13ae550..84d3e0c10 100644
--- a/loader/kickstart.c
+++ b/loader/kickstart.c
@@ -27,7 +27,6 @@ struct ksCommand {
struct ksCommandNames ksTable[] = {
{ KS_CMD_NFS, "nfs" },
{ KS_CMD_CDROM, "cdrom" },
- { KS_CMD_DEVICE, "device" },
{ KS_CMD_HD, "harddrive" },
{ KS_CMD_TEXT, "text" },
{ KS_CMD_URL, "url" },
diff --git a/loader/loader.c b/loader/loader.c
index 7e6be4d96..163dbda06 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -375,7 +375,7 @@ int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps,
} else {
if (modList[i]->major == DRIVER_NET) {
mlLoadModule(modList[i]->moduleName,
- MI_LOCATION_NONE, modList[i]->locationID,
+ modList[i]->locationID,
modLoaded, modDeps, NULL, modInfo, flags);
}
}
@@ -387,7 +387,6 @@ int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps,
scsiWindow(modList[i]->moduleName);
mlLoadModule(modList[i]->moduleName,
- MI_LOCATION_NONE,
modList[i]->locationID, modLoaded, modDeps,
NULL, modInfo, flags);
sleep(1);
@@ -598,7 +597,7 @@ static char * mountHardDrive(struct installMethod * method,
static int ufsloaded;
#endif
- mlLoadModule("vfat", MI_LOCATION_NONE, NULL, modLoaded, *modDepsPtr,
+ mlLoadModule("vfat", NULL, modLoaded, *modDepsPtr,
NULL, modInfo, flags);
while (!done) {
@@ -617,9 +616,9 @@ static char * mountHardDrive(struct installMethod * method,
case BALKAN_PART_UFS:
if (!ufsloaded) {
ufsloaded = 1;
- mlLoadModule("ufs", MI_LOCATION_NONE, NULL,
- modLoaded, *modDepsPtr, NULL,
- modInfo, flags);
+ mlLoadModule("ufs", NULL, modLoaded,
+ *modDepsPtr, NULL, modInfo,
+ flags);
}
/* FALLTHROUGH */
#endif
@@ -987,8 +986,8 @@ static char * mountNfsImage(struct installMethod * method,
break;
}
- mlLoadModule("nfs", MI_LOCATION_NONE, NULL, modLoaded,
- *modDepsPtr, NULL, modInfo, flags);
+ mlLoadModule("nfs", NULL, modLoaded, *modDepsPtr, NULL, modInfo,
+ flags);
fullPath = alloca(strlen(host) + strlen(dir) + 2);
sprintf(fullPath, "%s:%s", host, dir);
@@ -1350,8 +1349,9 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo,
poptContext optCon;
int doContinue, missingOkay; /* obsolete */
char * fsType = "ext2";
- char * fs;
+ char * fsDevice = NULL;
struct moduleInfo * mi;
+ struct driverDiskInfo * ddi;
struct poptOption diskTable[] = {
{ "type", 't', POPT_ARG_STRING, &fsType, 0 },
{ 0, 0, 0, 0, 0 }
@@ -1366,6 +1366,8 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo,
if (!ksGetCommand(KS_CMD_DRIVERDISK, NULL, &ksArgc, &ksArgv)) {
optCon = poptGetContext(NULL, ksArgc, (const char **) ksArgv, diskTable, 0);
+ ddi = calloc(sizeof(*ddi), 1);
+
do {
if ((rc = poptGetNextOpt(optCon)) < -1) {
logMessage("bad argument to kickstart driverdisk command "
@@ -1375,29 +1377,39 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo,
break;
}
- fs = (char *) poptGetArg(optCon);
+ fsDevice = (char *) poptGetArg(optCon);
- if (!fs || poptGetArg(optCon)) {
+ if (!fsDevice || poptGetArg(optCon)) {
logMessage("bad arguments to kickstart driverdisk command");
break;
}
- if (strcmp(fsType, "nfs")) {
- devMakeInode(fs, "/tmp/disk");
- fs = "/tmp/disk";
- }
+ ddi->fs = strdup(fsType);
+
+ if (strcmp(ddi->fs, "nfs")) {
+ ddi->device = strdup(fsDevice);
+ ddi->mntDevice = "/tmp/disk";
+
+ devMakeInode(ddi->device, ddi->mntDevice);
+ } else {
+ ddi->mntDevice = fsDevice;
+ }
- if (!strcmp(fsType, "vfat"))
- mlLoadModule("vfat", MI_LOCATION_NONE, NULL, modLoaded,
- *modDepsPtr, NULL, modInfo, flags);
+ if (!strcmp(ddi->fs, "vfat"))
+ mlLoadModule("vfat", NULL, modLoaded, *modDepsPtr, NULL,
+ modInfo, flags);
- if (doPwMount(fs, "/tmp/drivers", fsType, 1, 0, NULL, NULL)) {
- logMessage("failed to mount %s", fs);
+ logMessage("looking for driver disk (%s, %s, %s)",
+ ddi->fs, ddi->device, ddi->mntDevice);
+
+ if (doPwMount(ddi->mntDevice, "/tmp/drivers", ddi->fs, 1, 0,
+ NULL, NULL)) {
+ logMessage("failed to mount %s", ddi->mntDevice);
break;
}
if (devInitDriverDisk(modInfo, modLoaded, modDepsPtr, flags,
- "/tmp/drivers", 1)) {
+ "/tmp/drivers", ddi)) {
logMessage("driver information missing!");
}
@@ -1405,6 +1417,7 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo,
} while (0);
}
+ ksArgv = NULL;
while (!ksGetCommand(KS_CMD_DEVICE, ksArgv, &ksArgc, &ksArgv)) {
opts = NULL;
@@ -1431,12 +1444,14 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo,
continue;
}
+ logMessage("found information on module %s", device);
+
if (opts)
poptParseArgvString(opts, &rc, (const char ***) &optv);
else
optv = NULL;
- rc = mlLoadModule(device, mi->location, mi->locationID, modLoaded,
+ rc = mlLoadModule(device, mi->locationID, modLoaded,
*modDepsPtr, optv, modInfo, flags);
if (optv) free(optv);
@@ -1576,8 +1591,7 @@ static char * setupKickstart(char * location, struct knownDevices * kd,
#ifdef INCLUDE_NETWORK
if (ksType == KS_CMD_NFS) {
- mlLoadModule("nfs", MI_LOCATION_NONE, NULL, modLoaded, *modDepsPtr,
- NULL, modInfo, flags);
+ mlLoadModule("nfs", NULL, modLoaded, *modDepsPtr, NULL, modInfo, flags);
fullPath = alloca(strlen(host) + strlen(dir) + 2);
sprintf(fullPath, "%s:%s", host, dir);
@@ -1844,8 +1858,7 @@ int kickstartFromNfs(struct knownDevices * kd, char * location,
logMessage("ks server: %s file: %s", ksPath, file);
- mlLoadModule("nfs", MI_LOCATION_NONE, NULL, modLoaded, *modDepsPtr, NULL,
- NULL, flags);
+ mlLoadModule("nfs", NULL, modLoaded, *modDepsPtr, NULL, NULL, flags);
if (doPwMount(ksPath, "/tmp/nfskd", "nfs", 1, 0, NULL, NULL)) {
logMessage("failed to mount %s", ksPath);
@@ -1869,11 +1882,9 @@ int kickstartFromHardDrive(char * location,
char * fileName;
char * fullFn;
- mlLoadModule("vfat", MI_LOCATION_NONE, NULL, modLoaded, *modDepsPtr, NULL,
- NULL, flags);
+ mlLoadModule("vfat", NULL, modLoaded, *modDepsPtr, NULL, NULL, flags);
#ifdef __sparc__
- mlLoadModule("ufs", MI_LOCATION_NONE, NULL, modLoaded, *modDepsPtr, NULL,
- NULL, flags);
+ mlLoadModule("ufs", NULL, modLoaded, *modDepsPtr, NULL, NULL, flags);
#endif
fileName = strchr(source, '/');
@@ -1904,8 +1915,7 @@ int kickstartFromHardDrive(char * location,
int kickstartFromFloppy(char * location, moduleList modLoaded,
moduleDeps * modDepsPtr, int flags) {
- mlLoadModule("vfat", MI_LOCATION_NONE, NULL, modLoaded, *modDepsPtr,
- NULL, NULL, flags);
+ mlLoadModule("vfat", NULL, modLoaded, *modDepsPtr, NULL, NULL, flags);
if (devMakeInode("fd0", "/tmp/fd0"))
return 1;
@@ -1941,7 +1951,7 @@ void readExtraModInfo(moduleInfoSet modInfo) {
dirName = malloc(50);
sprintf(dirName, "/tmp/DD-%d", num);
- isysReadModuleInfo(fileName, modInfo, MI_LOCATION_NONE, dirName);
+ isysReadModuleInfo(fileName, modInfo, dirName);
sprintf(fileName, "/tmp/DD-%d/modinfo", ++num);
}
@@ -2072,9 +2082,8 @@ void loadUfs(struct knownDevices *kd, moduleList modLoaded,
for (j = 0; j < table.maxNumPartitions; j++) {
if (table.parts[j].type == BALKAN_PART_UFS) {
if (!ufsloaded) {
- mlLoadModule("ufs", MI_LOCATION_NONE, NULL,
- modLoaded, *modDepsPtr, NULL,
- NULL, flags);
+ mlLoadModule("ufs", NULL, modLoaded,
+ *modDepsPtr, NULL, NULL, flags);
ufsloaded = 1;
}
}
@@ -2179,7 +2188,7 @@ int main(int argc, char ** argv) {
arg = FL_TESTING(flags) ? "./module-info" : "/modules/module-info";
modInfo = isysNewModuleInfoSet();
- if (isysReadModuleInfo(arg, modInfo, MI_LOCATION_NONE, NULL)) {
+ if (isysReadModuleInfo(arg, modInfo, NULL)) {
fprintf(stderr, "failed to read %s\n", arg);
sleep(5);
exit(1);
@@ -2316,7 +2325,7 @@ int main(int argc, char ** argv) {
pciReadDrivers("/modules/pcitable");
/*modInfo = isysNewModuleInfoSet();*/
- if (isysReadModuleInfo(arg, modInfo, MI_LOCATION_NONE, NULL)) {
+ if (isysReadModuleInfo(arg, modInfo, NULL)) {
fprintf(stderr, "failed to read %s\n", arg);
sleep(5);
exit(1);
@@ -2357,18 +2366,14 @@ int main(int argc, char ** argv) {
}
#ifndef __ia64__
- mlLoadModule("raid0", MI_LOCATION_NONE, NULL, modLoaded, modDeps, NULL,
- modInfo, flags);
- mlLoadModule("raid1", MI_LOCATION_NONE, NULL, modLoaded, modDeps, NULL,
- modInfo, flags);
- mlLoadModule("raid5", MI_LOCATION_NONE, NULL, modLoaded, modDeps, NULL,
- modInfo, flags);
+ mlLoadModule("raid0", NULL, modLoaded, modDeps, NULL, modInfo, flags);
+ mlLoadModule("raid1", NULL, modLoaded, modDeps, NULL, modInfo, flags);
+ mlLoadModule("raid5", NULL, modLoaded, modDeps, NULL, modInfo, flags);
#endif
#ifdef __i386__
/* We need this for loopback installs */
- mlLoadModule("vfat", MI_LOCATION_NONE, NULL, modLoaded, modDeps,
- NULL, modInfo, flags);
+ mlLoadModule("vfat", NULL, modLoaded, modDeps, NULL, modInfo, flags);
#endif
stopNewt();
diff --git a/loader/modules.c b/loader/modules.c
index c7e69b3be..821dccf79 100644
--- a/loader/modules.c
+++ b/loader/modules.c
@@ -206,8 +206,7 @@ static void removeExtractedModule(char * path) {
rmdir(path);
}
-int mlLoadModule(char * modName, enum miLocationTypes locationType,
- char * location, moduleList modLoaded,
+int mlLoadModule(char * modName, void * location, moduleList modLoaded,
moduleDeps modDeps, char ** args, moduleInfoSet modInfo,
int flags) {
moduleDeps dep;
@@ -220,6 +219,7 @@ int mlLoadModule(char * modName, enum miLocationTypes locationType,
pid_t child;
int status;
char * path = NULL;
+ int needUmount = 0;
if (mlModuleInList(modName, modLoaded)) {
return 0;
@@ -237,20 +237,16 @@ int mlLoadModule(char * modName, enum miLocationTypes locationType,
if (dep && dep->deps) {
nextDep = dep->deps;
while (*nextDep) {
- if (mlLoadModule(*nextDep, locationType, location, modLoaded,
- modDeps, NULL, modInfo, flags) && location)
- mlLoadModule(*nextDep, MI_LOCATION_NONE, NULL, modLoaded,
- modDeps, NULL, modInfo, flags);
+ if (mlLoadModule(*nextDep, location, modLoaded, modDeps, NULL,
+ modInfo, flags) && location)
+ mlLoadModule(*nextDep, NULL, modLoaded, modDeps, NULL,
+ modInfo, flags);
nextDep++;
}
}
- if (locationType == MI_LOCATION_DISKNAME) {
+ if (location)
path = extractModule(location, modName);
- if (!path) return 1;
- } else if (locationType == MI_LOCATION_DIRECTORY) {
- path = strdup(location);
- }
sprintf(fileName, "%s.o", modName);
for (argPtr = args; argPtr && *argPtr; argPtr++) {
@@ -288,6 +284,9 @@ int mlLoadModule(char * modName, enum miLocationTypes locationType,
}
}
+ if (needUmount)
+ umount(path);
+
if (!rc) {
modLoaded->mods[modLoaded->numModules].name = strdup(modName);
modLoaded->mods[modLoaded->numModules].weLoaded = 1;
diff --git a/loader/modules.h b/loader/modules.h
index ed46dc7c8..12d524d99 100644
--- a/loader/modules.h
+++ b/loader/modules.h
@@ -17,12 +17,12 @@ struct moduleList_s {
int numModules;
};
+
int mlReadLoadedList(moduleList * list);
void mlFreeList(moduleList list);
int mlLoadDeps(moduleDeps * moduleDepList, const char * path);
moduleDeps mlNewDeps(void);
-int mlLoadModule(char * modName, enum miLocationTypes locationType,
- char * location, moduleList modLoaded,
+int mlLoadModule(char * modName, void * location, moduleList modLoaded,
moduleDeps modDeps, char ** args, moduleInfoSet modInfo,
int flags);
char ** mlGetDeps(moduleDeps modDeps, const char * modName);