Setup:
I am trying to boot my router from a usb memory stick which is connected to a usb 1.1 4-port hub. Besides the stick, there are two usb printers and a soundcard connected to the hub, which is currently powered by an external power supply. For preparing the usb drive, I followed the instructions on Oleg's firmware page.

Problem:
When there are more than two devices connected to the hub, the router does not boot from the usb drive, but from internal flash, the usb drive is mounted as /tmp/harddisk, and an ftp server is started...

I suspect that this is because of the two seconds delay in the linuxrc script that makes the router wait until the usb devices are created in the kernel. It looks like this is too slow when there is a hub with a lot of devices connected.

To test this, I ran some parts of the linuxrc script from the commandline, pasting the whole text at once. I also inserted two 'date' commands to get an idea of the speed. Here is the code executed on the command line and it's output:

Code:
[admin@(none) root]$ date
Sat Jan 14 18:31:36 MEZ 2006
[admin@(none) root]$ insmod ide-mod && insmod ide-probe-mod && insmod ide-disk
insmod: ide-mod.o: no module by that name found
[admin@(none) root]$ insmod usbcore; insmod usb-ohci
Using /lib/modules/2.4.20/kernel/drivers/usb/usbcore.o
insmod: A module named usbcore already exists
Using /lib/modules/2.4.20/kernel/drivers/usb/host/usb-ohci.o
[admin@(none) root]$ insmod ehci-hcd && insmod usb-uhci && sleep 2s
insmod: ehci-hcd.o: no module by that name found
[admin@(none) root]$ insmod scsi_mod && insmod sd_mod && insmod usb-storage
Using /lib/modules/2.4.20/kernel/drivers/scsi/scsi_mod.o
Using /lib/modules/2.4.20/kernel/drivers/scsi/sd_mod.o
Using /lib/modules/2.4.20/kernel/drivers/usb/storage/usb-storage.o
[admin@(none) root]$ sleep 2s; date
Sat Jan 14 18:31:39 MEZ 2006
[admin@(none) root]$ mount -t ext3 -o ro "/dev/scsi/host0/bus0/target0/lun0/part1" /mnt || mount -t ext2 -o ro "/dev/scsi/host0/bus0/target0/lun0/part1" /mnt
mount: Mounting /dev/scsi/host0/bus0/target0/lun0/part1 on /mnt failed: No such file or directory
mount: Mounting /dev/scsi/host0/bus0/target0/lun0/part1 on /mnt failed: No such device
And here are the corresponding syslog entries:

Code:
Jan 14 18:31:37 kernel: usb-ohci.c: USB OHCI at membase 0xb8004000, IRQ 2
Jan 14 18:31:37 kernel: usb-ohci.c: usb-00:04.0, PCI device 14e4:4715
Jan 14 18:31:37 kernel: usb.c: new USB bus registered, assigned bus number 1
Jan 14 18:31:37 kernel: hub.c: USB hub found
Jan 14 18:31:37 kernel: hub.c: 2 ports detected
Jan 14 18:31:37 kernel: SCSI subsystem driver Revision: 1.00
Jan 14 18:31:37 kernel: Initializing USB Mass Storage driver...
Jan 14 18:31:37 kernel: usb.c: registered new driver usb-storage
Jan 14 18:31:37 kernel: USB Mass Storage support registered.
Jan 14 18:31:37 kernel: hub.c: new USB device 00:04.0-1, assigned address 2
Jan 14 18:31:37 kernel: hub.c: USB hub found
Jan 14 18:31:37 kernel: hub.c: 4 ports detected
Jan 14 18:31:38 kernel: hub.c: new USB device 00:04.0-1.1, assigned address 3
Jan 14 18:31:38 kernel: hub.c: USB hub found
Jan 14 18:31:38 kernel: hub.c: 1 port detected
Jan 14 18:31:39 kernel: hub.c: new USB device 00:04.0-1.2, assigned address 4
Jan 14 18:31:39 kernel: usb.c: USB device 4 (vend/prod 0x3f0/0x1504) is not claimed by any active driver.
Jan 14 18:31:39 kernel: hub.c: new USB device 00:04.0-1.3, assigned address 5
Jan 14 18:31:39 kernel: usb.c: USB device 5 (vend/prod 0x67b/0x2305) is not claimed by any active driver.
Jan 14 18:31:40 kernel: hub.c: new USB device 00:04.0-1.4, assigned address 6
Jan 14 18:31:40 kernel: usb.c: USB device 6 (vend/prod 0x41e/0x3020) is not claimed by any active driver.
Jan 14 18:31:40 USB audio: attached
Jan 14 18:31:40 kernel: hub.c: new USB device 00:04.0-1.1.1, assigned address 7
Jan 14 18:31:40 kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Jan 14 18:31:40 kernel:   Vendor: Prolific  Model: USB Flash Disk    Rev: PROL
Jan 14 18:31:40 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 02
Jan 14 18:31:40 kernel: Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
Jan 14 18:31:40 kernel: SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
Jan 14 18:31:40 kernel: sda: Write Protect is off
Jan 14 18:31:40 kernel:  p1
Jan 14 18:31:46 kernel: kjournald starting.  Commit interval 5 seconds
Jan 14 18:31:46 kernel: EXT3 FS 2.4-0.9.19, 19 August 2002 on sd(8,1), internal journal
Jan 14 18:31:46 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Jan 14 18:31:46 USB storage: ext3 fs mounted to /tmp/harddisk
Jan 14 18:31:46 FTP server: daemon is started
As you can see, the mount command is started at 18:31:39, but the scsi device is created at 18:31:40, so mount has a good reason to fail.

When there are only two devices connected to the hub, the router boots from the usb drive. Also the commands extracted from linuxrc work nicely when the delay is increased to 4s.

Question:
Is there a way to increase the delay in the linuxrc script?