diff options
author | Matt Wilson <msw@redhat.com> | 2001-08-27 15:53:08 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2001-08-27 15:53:08 +0000 |
commit | 41a7624d61cbb8810506d81532200bf81f5d90d6 (patch) | |
tree | 5b9da29922862b676843abdaeb23b875e745986f | |
parent | 3eff69b7c9dededb6e44f7e1dca1e0dc529e5bef (diff) | |
download | anaconda-41a7624d61cbb8810506d81532200bf81f5d90d6.tar.gz anaconda-41a7624d61cbb8810506d81532200bf81f5d90d6.tar.xz anaconda-41a7624d61cbb8810506d81532200bf81f5d90d6.zip |
fix multiple scsi adapters
-rw-r--r-- | loader/modules.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/loader/modules.c b/loader/modules.c index 55a0794d9..25d3b77dc 100644 --- a/loader/modules.c +++ b/loader/modules.c @@ -53,6 +53,23 @@ static int ethCount(void) { return count; } +static int scsiCount(void) { + FILE *f; + char buf[16384]; + int count = 0; + + f = fopen("/tmp/modules.conf", "r"); + if (!f) + return 0; + while (fgets(buf, sizeof(buf) - 1, f)) { + if (!strncmp(buf, "scsi_hostadaptor", 16)) + count++; + } + fclose(f); + return count; +} + + int mlReadLoadedList(moduleList * mlp) { int fd; char * start; @@ -368,13 +385,15 @@ int mlWriteConfModules(moduleList list, int fd) { int i; struct loadedModuleInfo * lm; char buf[200], buf2[200]; - int scsiNum = 0; + int scsiNum; int ethNum; int trNum = 0; char ** arg; if (!list) return 0; + scsiNum = scsiCount(); + for (i = 0, lm = list->mods; i < list->numModules; i++, lm++) { if (!lm->weLoaded) continue; if (lm->written) continue; |