diff options
author | Erik Troan <ewt@redhat.com> | 1999-08-09 22:22:49 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1999-08-09 22:22:49 +0000 |
commit | 876cab0fa27639871bc26dc3375078f2f4506938 (patch) | |
tree | b1b5b2006448901e3584d1706326b589b7aa2abe /loader | |
parent | 70f0db4d88bdf1afb7a866a3bc3b6fbecc0f52ad (diff) | |
download | anaconda-876cab0fa27639871bc26dc3375078f2f4506938.tar.gz anaconda-876cab0fa27639871bc26dc3375078f2f4506938.tar.xz anaconda-876cab0fa27639871bc26dc3375078f2f4506938.zip |
try to write out options in conf.modules (though it doesn't seem happy
quite yet)
Diffstat (limited to 'loader')
-rw-r--r-- | loader/modules.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/loader/modules.c b/loader/modules.c index c9fff21c6..7bf14a644 100644 --- a/loader/modules.c +++ b/loader/modules.c @@ -173,11 +173,12 @@ int mlLoadDeps(moduleDeps * moduleDepListPtr, const char * path) { } int mlLoadModule(char * modName, moduleList modLoaded, - moduleDeps modDeps, int testing) { + moduleDeps modDeps, char ** args, int testing) { moduleDeps dep; char ** nextDep; char fileName[80]; - int rc; + int rc, i; + char ** arg, ** newArgs; if (mlModuleInList(modName, modLoaded)) { return 0; @@ -189,7 +190,7 @@ int mlLoadModule(char * modName, moduleList modLoaded, if (dep && dep->deps) { nextDep = dep->deps; while (*nextDep) { - mlLoadModule(*nextDep, modLoaded, modDeps, testing); + mlLoadModule(*nextDep, modLoaded, modDeps, NULL, testing); nextDep++; } @@ -199,11 +200,22 @@ int mlLoadModule(char * modName, moduleList modLoaded, sprintf(fileName, "%s.o", modName); - rc = insmod(fileName, NULL); + rc = insmod(fileName, args); if (!rc) { modLoaded->mods[modLoaded->numModules].name = strdup(modName); - modLoaded->mods[modLoaded->numModules].args = NULL; - modLoaded->mods[modLoaded->numModules++].weLoaded = 1; + modLoaded->mods[modLoaded->numModules].weLoaded = 1; + + if (args) { + for (i = 0, arg = args; *arg; arg++, i++); + newArgs = malloc(sizeof(*newArgs) * (i + 1)); + for (i = 0, arg = args; *arg; arg++, i++) + newArgs[i] = *arg; + newArgs[i] = NULL; + } else { + newArgs = NULL; + } + + modLoaded->mods[modLoaded->numModules++].args = newArgs; } return rc; @@ -237,6 +249,7 @@ int mlWriteConfModules(moduleList list, moduleInfoSet modInfo, int fd) { struct moduleInfo * mi; int scsiNum = 0; int ethNum = 0; + char ** arg; if (!list) return 0; @@ -273,6 +286,17 @@ int mlWriteConfModules(moduleList list, moduleInfoSet modInfo, int fd) { strcat(buf, "\n"); write(fd, buf, strlen(buf)); } + + if (lm->args) { + strcpy(buf, "options "); + strcat(buf, lm->name); + for (arg = lm->args; *arg; arg++) { + strcat(buf, " "); + strcat(buf, *arg); + } + strcat(buf, "\n"); + write(fd, buf, strlen(buf)); + } } return 0; |