summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
Diffstat (limited to 'loader')
-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;