diff options
author | Erik Troan <ewt@redhat.com> | 1999-07-23 00:13:35 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 1999-07-23 00:13:35 +0000 |
commit | 8f31492bb357f64103b2c9c62821a9cbf5b0cffc (patch) | |
tree | 31b7b5bde84a7ebe11447a91cab9d51acaa4bc6d | |
parent | 3c4fb59e017a840ad902ec6f9730f1324fb3453e (diff) | |
download | anaconda-8f31492bb357f64103b2c9c62821a9cbf5b0cffc.tar.gz anaconda-8f31492bb357f64103b2c9c62821a9cbf5b0cffc.tar.xz anaconda-8f31492bb357f64103b2c9c62821a9cbf5b0cffc.zip |
1) load modules by name
2) update list of loaded modules
3) recurse for dependency resolution
-rw-r--r-- | loader/modules.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/loader/modules.c b/loader/modules.c index e7d3b2844..d24cd1dc2 100644 --- a/loader/modules.c +++ b/loader/modules.c @@ -2,6 +2,7 @@ #include <ctype.h> #include <errno.h> #include <fcntl.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> @@ -164,35 +165,37 @@ static int moduleLoaded(moduleList modList, const char * name) { return 0; } -int mlLoadModule(struct moduleInfo * modInfo, moduleList modLoaded, +int mlLoadModule(char * modName, moduleList modLoaded, moduleDeps modDeps, int testing) { moduleDeps dep; char ** nextDep; - char modName[80]; + char fileName[80]; int rc; - for (dep = modDeps; dep->name && strcmp(dep->name, modInfo->moduleName); + for (dep = modDeps; dep->name && strcmp(dep->name, modName); dep++); if (dep && dep->deps) { nextDep = dep->deps; while (*nextDep) { if (!moduleLoaded(modLoaded, *nextDep)) { - sprintf(modName, "%s.o", *nextDep); - if (!testing) insmod(*nextDep, NULL); + mlLoadModule(*nextDep, modLoaded, modDeps, testing); } - dep++; + nextDep++; } } if (testing) return 0; - sprintf(modName, "%s.o", modInfo->moduleName); + sprintf(fileName, "%s.o", modName); + + printf("loading %s\n", fileName); + rc = insmod(fileName, NULL); + if (!rc) + modLoaded->modules[modLoaded->numModules++] = strdup(modName); - rc = insmod(modName, NULL); - sleep(2); return rc; } |