summaryrefslogtreecommitdiffstats
path: root/loader/modules.c
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-03-06 21:49:49 +0000
committerErik Troan <ewt@redhat.com>2001-03-06 21:49:49 +0000
commit1d36b0bd06cc50bc1523d3896eb175cf7a2543ec (patch)
tree10c85932b18df590f326c074ae6366f1048bf37f /loader/modules.c
parenta04ff25160736a690912c51de6110a2c7bf63a61 (diff)
downloadanaconda-1d36b0bd06cc50bc1523d3896eb175cf7a2543ec.tar.gz
anaconda-1d36b0bd06cc50bc1523d3896eb175cf7a2543ec.tar.xz
anaconda-1d36b0bd06cc50bc1523d3896eb175cf7a2543ec.zip
make a copy of driver major/minor types to we don't need modinfo around
to write out modules.conf
Diffstat (limited to 'loader/modules.c')
-rw-r--r--loader/modules.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/loader/modules.c b/loader/modules.c
index 278355a5c..cc0ec1c6c 100644
--- a/loader/modules.c
+++ b/loader/modules.c
@@ -215,7 +215,7 @@ int mlLoadModule(char * modName, void * location, moduleList modLoaded,
char fileName[200];
int rc, i;
char ** arg, ** newArgs;
- struct moduleInfo * mi;
+ struct moduleInfo * mi = NULL;
int ethDevices = -1;
pid_t child;
int status;
@@ -301,6 +301,14 @@ int mlLoadModule(char * modName, void * location, moduleList modLoaded,
modLoaded->mods[modLoaded->numModules].lastDevNum = ethCount() - 1;
}
+ if (mi) {
+ modLoaded->mods[modLoaded->numModules].major = mi->major;
+ modLoaded->mods[modLoaded->numModules].minor = mi->minor;
+ } else {
+ modLoaded->mods[modLoaded->numModules].major = DRIVER_NONE;
+ modLoaded->mods[modLoaded->numModules].minor = DRIVER_MINOR_NONE;
+ }
+
if (args) {
for (i = 0, arg = args; *arg; arg++, i++);
newArgs = malloc(sizeof(*newArgs) * (i + 1));
@@ -341,11 +349,10 @@ int mlModuleInList(const char * modName, moduleList list) {
return 0;
}
-int mlWriteConfModules(moduleList list, moduleInfoSet modInfo, int fd) {
+int mlWriteConfModules(moduleList list, int fd) {
int i;
struct loadedModuleInfo * lm;
char buf[200], buf2[200];
- struct moduleInfo * mi;
int scsiNum = 0;
int ethNum;
int trNum = 0;
@@ -355,9 +362,9 @@ int mlWriteConfModules(moduleList list, moduleInfoSet modInfo, int fd) {
for (i = 0, lm = list->mods; i < list->numModules; i++, lm++) {
if (!lm->weLoaded) continue;
- if ((mi = isysFindModuleInfo(modInfo, lm->name))) {
+ if (lm->major != DRIVER_NONE) {
strcpy(buf, "alias ");
- switch (mi->major) {
+ switch (lm->major) {
case DRIVER_CDROM:
strcat(buf, "cdrom ");
break;
@@ -372,7 +379,7 @@ int mlWriteConfModules(moduleList list, moduleInfoSet modInfo, int fd) {
break;
case DRIVER_NET:
- switch (mi->minor) {
+ switch (lm->minor) {
case DRIVER_MINOR_ETHERNET:
for (ethNum = lm->firstDevNum;
ethNum <= lm->lastDevNum; ethNum++) {