summaryrefslogtreecommitdiffstats
path: root/loader2/modules.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-11-04 15:55:46 +0000
committerJeremy Katz <katzj@redhat.com>2004-11-04 15:55:46 +0000
commitfdef8f802d251666a214e86f1c9e5d99be45fe21 (patch)
tree4d484aa59370f725cbf6281052d8af98fe095dc8 /loader2/modules.c
parent0a63e9375bf447e8343b392d02aaed41bb7e7fc6 (diff)
downloadanaconda-fdef8f802d251666a214e86f1c9e5d99be45fe21.tar.gz
anaconda-fdef8f802d251666a214e86f1c9e5d99be45fe21.tar.xz
anaconda-fdef8f802d251666a214e86f1c9e5d99be45fe21.zip
2004-11-04 Jeremy Katz <katzj@redhat.com>
* loader2/modules.c (lateModuleSort): Implement an additional sort to move drivers to the end of our list of drivers to load. This is handy for, eg, fibre channel so that it doesn't end up at the front of the list so that people don't get confused with sda being their FC disk. Also, put ibmvscsic in the list due to #137920
Diffstat (limited to 'loader2/modules.c')
-rw-r--r--loader2/modules.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/loader2/modules.c b/loader2/modules.c
index 1a69f3e2f..78cdbffb4 100644
--- a/loader2/modules.c
+++ b/loader2/modules.c
@@ -361,6 +361,52 @@ static int loadModule(const char * modName, struct extractedModule * path,
return rc;
}
+/*
+ * This takes the list of modules we're going to load and sorts
+ * some to be at the end on an arbitrary criteria (eg, fiberchannel).
+ * This should help the problems where people's FC controller ends up being
+ * sda and they then can't boot or otherwise have things being strange.
+ * And yes, this is a hack. *sigh*
+ */
+static char ** lateModuleSort(char **allmods, int num) {
+ int i, j, k, l;
+ char ** modList;
+ /* the qlogic drivers are usually for fibrechannel according to coughlan
+ * as is lpfc. ibmvscsic needs to be sure to be loaded after ipr on
+ * power5 due to bug #137920 */
+ char * lateList[] = { "qla2100", "qla2200", "qla2300", "qla2322",
+ "qla6312", "qla6322",
+ "lpfc", "ibmvscsic", NULL };
+ char ** lateMods;
+
+ modList = alloca(sizeof(*modList) * (num + 1));
+
+ lateMods = alloca(sizeof(*lateMods) * 10);
+ lateMods = memset(lateMods, 0, 10);
+
+ i = j = k = l = 0;
+
+ for (; allmods[i]; i++) {
+ int late = 0;
+ for (j = 0; lateList[j]; j++) {
+ if (!strcmp(allmods[i], lateList[j])) {
+ lateMods[l++] = allmods[i];
+ late = 1;
+ break;
+ }
+ }
+ if (!late)
+ modList[k++] = allmods[i];
+ }
+
+ for (i = 0; i < l; i++) {
+ modList[k++] = lateMods[i];
+ }
+ modList[k] = NULL;
+
+ return modList;
+}
+
/* handle loading a set of modules including their dependencies. also has
* a nasty evil hack for handling usb-storage removal/reloading for scsi
* device ordering. */
@@ -422,6 +468,7 @@ static int doLoadModules(const char * origModNames, moduleList modLoaded,
logMessage("ERROR: loop in module dependencies; not inserting");
return 1;
}
+ list = lateModuleSort(list, i);
for (i = 0; list[i]; i++) {
strcat(items, " ");