summaryrefslogtreecommitdiffstats
path: root/loader2
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2005-05-23 22:01:50 +0000
committerJeremy Katz <katzj@redhat.com>2005-05-23 22:01:50 +0000
commit1a576f5eacf02b16de73953c5755126168aca59a (patch)
treedc5979db7b6a04f7d45b432074db9163ba7dd8c7 /loader2
parent455dfbe2bc62f6b8b9f43f3298f182ea8ad41d08 (diff)
downloadanaconda-1a576f5eacf02b16de73953c5755126168aca59a.tar.gz
anaconda-1a576f5eacf02b16de73953c5755126168aca59a.tar.xz
anaconda-1a576f5eacf02b16de73953c5755126168aca59a.zip
2005-05-23 Jeremy Katz <katzj@redhat.com>
* loader2/modules.c (loadModule): usb-storage has reached new levels of awful and now doesn't enumerate the devices with anything approaching a reasonable speed. Add a sleep to wait for some devices to show up
Diffstat (limited to 'loader2')
-rw-r--r--loader2/modules.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/loader2/modules.c b/loader2/modules.c
index 09ed3cd19..6d9760ec3 100644
--- a/loader2/modules.c
+++ b/loader2/modules.c
@@ -254,7 +254,8 @@ static int loadModule(const char * modName, struct extractedModule * path,
int deviceCount = -1;
int popWindow = 0;
int rc, child, i, status;
-
+ static int usbWasLoaded = 0;
+
/* don't need to load a module that's already loaded */
if (mlModuleInList(modName, modLoaded))
return 0;
@@ -332,6 +333,19 @@ static int loadModule(const char * modName, struct extractedModule * path,
modLoaded->mods[num].firstDevNum = deviceCount;
modLoaded->mods[num].lastDevNum = ethCount("tr") - 1;
} else if (mi->major == DRIVER_SCSI) {
+ /* FIXME: this is a hack, but usb-storage seems to
+ * like to take forever to enumerate. try to
+ * give it some time */
+ if (!strcmp(modName, "usb-storage") && usbWasLoaded == 0) {
+ int slp;
+ usbWasLoaded++;
+ logMessage("sleeping for usb-storage stabilize...");
+ for (slp = 0; slp < 10; slp++) {
+ if (scsiDiskCount() > 0) break;
+ sleep(2);
+ }
+ logMessage("slept %d seconds", slp * 2);
+ }
modLoaded->mods[num].firstDevNum = deviceCount;
modLoaded->mods[num].lastDevNum = scsiDiskCount();
}