summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-08-23 21:23:02 +0000
committerMatt Wilson <msw@redhat.com>2001-08-23 21:23:02 +0000
commit5663d1c038c72369b0ac1af4bb301602c292b590 (patch)
tree580c4227a0e394ae476dee47da4799485d12f178
parent56704c29a953deb45c098cd220f8621c6761a3b2 (diff)
downloadanaconda-5663d1c038c72369b0ac1af4bb301602c292b590.tar.gz
anaconda-5663d1c038c72369b0ac1af4bb301602c292b590.tar.xz
anaconda-5663d1c038c72369b0ac1af4bb301602c292b590.zip
write out each module to /tmp/modules.conf every time we insert them (MF #52293
-rw-r--r--loader/loader.c37
-rw-r--r--loader/modules.c19
-rw-r--r--loader/modules.h1
3 files changed, 37 insertions, 20 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 053e71423..d5ef3fc38 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2596,6 +2596,24 @@ int main(int argc, char ** argv) {
flags |= LOADER_FLAGS_SERIAL;
}
+ if (!FL_TESTING(flags)) {
+ int fd;
+
+ fd = open("/tmp/modules.conf", O_WRONLY | O_CREAT, 0666);
+ if (fd < 0) {
+ logMessage("error creating /tmp/modules.conf: %s\n",
+ strerror(errno));
+ } else {
+ /* HACK - notting */
+#ifdef __sparc__
+ write(fd,"alias parport_lowlevel parport_ax\n",34);
+#else
+ write(fd,"alias parport_lowlevel parport_pc\n",34);
+#endif
+ close(fd);
+ }
+ }
+
optCon = poptGetContext(NULL, argc, (const char **) argv, optionTable, 0);
if ((rc = poptGetNextOpt(optCon)) < -1) {
@@ -2852,25 +2870,6 @@ int main(int argc, char ** argv) {
loadUfs(&kd, modLoaded, &modDeps, flags);
- if (!FL_TESTING(flags)) {
- int fd;
-
- fd = open("/tmp/modules.conf", O_WRONLY | O_CREAT, 0666);
- if (fd < 0) {
- logMessage("error creating /tmp/modules.conf: %s\n",
- strerror(errno));
- } else {
- mlWriteConfModules(modLoaded, fd);
- /* HACK - notting */
-#ifdef __sparc__
- write(fd,"alias parport_lowlevel parport_ax\n",34);
-#else
- write(fd,"alias parport_lowlevel parport_pc\n",34);
-#endif
- close(fd);
- }
- }
-
/* We must look for cards which require the agpgart module */
agpgartInitialize(modLoaded, modDeps, modInfo, flags);
diff --git a/loader/modules.c b/loader/modules.c
index cc0ec1c6c..55a0794d9 100644
--- a/loader/modules.c
+++ b/loader/modules.c
@@ -295,7 +295,8 @@ int mlLoadModule(char * modName, void * location, moduleList modLoaded,
modLoaded->mods[modLoaded->numModules].path = path;
modLoaded->mods[modLoaded->numModules].firstDevNum = -1;
modLoaded->mods[modLoaded->numModules].lastDevNum = -1;
-
+ modLoaded->mods[modLoaded->numModules].written = 0;
+
if (ethDevices >= 0) {
modLoaded->mods[modLoaded->numModules].firstDevNum = ethDevices;
modLoaded->mods[modLoaded->numModules].lastDevNum = ethCount() - 1;
@@ -320,6 +321,20 @@ int mlLoadModule(char * modName, void * location, moduleList modLoaded,
}
modLoaded->mods[modLoaded->numModules++].args = newArgs;
+ /* */
+ if (!FL_TESTING(flags)) {
+ int fd;
+
+ fd = open("/tmp/modules.conf", O_WRONLY | O_CREAT | O_APPEND,
+ 0666);
+ if (fd == -1) {
+ logMessage("error appending to /tmp/modules.conf: %s\n",
+ strerror(errno));
+ } else {
+ mlWriteConfModules(modLoaded, fd);
+ close(fd);
+ }
+ }
} else {
if (path) removeExtractedModule(path);
free(path);
@@ -362,6 +377,8 @@ int mlWriteConfModules(moduleList list, int fd) {
for (i = 0, lm = list->mods; i < list->numModules; i++, lm++) {
if (!lm->weLoaded) continue;
+ if (lm->written) continue;
+ lm->written = 1;
if (lm->major != DRIVER_NONE) {
strcpy(buf, "alias ");
switch (lm->major) {
diff --git a/loader/modules.h b/loader/modules.h
index 7f7902eaf..d2d44ca33 100644
--- a/loader/modules.h
+++ b/loader/modules.h
@@ -10,6 +10,7 @@ struct loadedModuleInfo {
char * name;
char ** args;
int weLoaded;
+ int written;
char * path;
int firstDevNum, lastDevNum; /* only used for ethernet currently */
enum driverMajor major;