summaryrefslogtreecommitdiffstats
path: root/loader2/usb.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-01-09 17:20:01 +0000
committerJeremy Katz <katzj@redhat.com>2003-01-09 17:20:01 +0000
commit913a448d7286c5e5d1f5104b46c1087b8c41f690 (patch)
treef850320596944bd4f52dc3932d458eb905a29d12 /loader2/usb.c
parentd027fc8ee9f7ad55a3499e7c13a0ff0aa85bb210 (diff)
downloadanaconda-913a448d7286c5e5d1f5104b46c1087b8c41f690.tar.gz
anaconda-913a448d7286c5e5d1f5104b46c1087b8c41f690.tar.xz
anaconda-913a448d7286c5e5d1f5104b46c1087b8c41f690.zip
only load usb-storage if we have any devices that need it. this will
speed up installs on systems with scsi but not usb-storage devices once the hacks to remove the module come back
Diffstat (limited to 'loader2/usb.c')
-rw-r--r--loader2/usb.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/loader2/usb.c b/loader2/usb.c
index 89ec9282e..95c35e9b9 100644
--- a/loader2/usb.c
+++ b/loader2/usb.c
@@ -64,6 +64,7 @@ int usbInitialize(moduleList modLoaded, moduleDeps modDeps,
struct device ** devices;
char * buf;
int i;
+ int loadUsbStorage = 0;
if (FL_NOUSB(flags)) return 0;
@@ -102,9 +103,23 @@ int usbInitialize(moduleList modLoaded, moduleDeps modDeps,
the device is ready for use */
sleepUntilUsbIsStable();
+ if (FL_NOUSBSTORAGE(flags))
+ loadUsbStorage = 0;
+ else {
+ devices = probeDevices(CLASS_UNSPEC, BUS_USB, PROBE_ALL);
+ if (devices) {
+ for (i = 0; devices[i]; i++) {
+ if (!strcmp(devices[i]->driver, "usb-storage")) {
+ loadUsbStorage = 1;
+ break;
+ }
+ }
+ free(devices);
+ }
+ }
+
buf = alloca(40);
- sprintf(buf, "hid:keybdev%s",
- (FL_NOUSBSTORAGE(flags) ? "" : ":usb-storage"));
+ sprintf(buf, "hid:keybdev%s", (loadUsbStorage ? ":usb-storage" : ""));
mlLoadModuleSet(buf, modLoaded, modDeps, modInfo, flags);
sleep(1);