OpenWrt Forum Archive

Topic: wl500g, usb multi-card readers and lsusb

The content of this topic has been archived on 1 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all, I've just updated http://wiki.openwrt.org/UsbStorageHowto

On my WL500g/WR-RC2 I needed to change the following from defaults to make USB storage work, and in particular, USB multi-card readers.

in /etc/modules.d/60-usb-ohci
change

ohci

to

usb-ohci

This seems to be a simple typo - the UHCI module is called uhci.o, but the OHCI module is called usb-ohci.o

To allow multi-card readers to be recognised I made this change:
in /etc/modules.d/60-usb-storage
change

scsi_mod

to

scsi_mod max_scsi_luns=8

To find what device the USB reader has made itself I have to do a dmesg.

I can't get lsusb to work - it prints no output when run with no options, and lsusb -t does this:

root@OpenWrt:/# lsusb -t
cannot open /proc/bus/usb/devices, No such file or directory (2)

The directory /proc/bus/usb exists but is empty.  I believe there needs to be stuff in here for lsusb to work.  Any suggestions?

Cheers

Dan

mount -t usbfs none /proc/bus/usb
Greetings, wtzm

cheers wtzm, that worked a treat

The fixes are in CVS now and will appear in RC3 smile

Thanks ndb - I've also found something else -
usb-ohci works better if it is loaded last.  The file /etc/modules.d/60-usb-ohci is added by the kmod-usb-ohci but by default it loads before /etc/modules.d/60-usb-storage.  I renamed it to /etc/modules.d/61-usb-ohci and now I can mount my flash card at boot time.

To mount my flashcard at boot I created a file called /etc/init.d/S11usbmount

root@OpenWrt:/etc/init.d# cat S11usbmount
#!/bin/sh
#wait for all modules to load
sleep 5
#thanks to wtzm, lsusb now works!
mount -t usbfs none /proc/bus/usb
#so df -h looks nice
ln -s /dev/scsi/host0/bus0/target0/lun1/part1 /dev/cf
mount /dev/cf /cf

I now have my flash card available as /cf whenever I boot.

My wl500g has only 2Mb of internal flash for some reason, so I'm only installing the core packages to the internal flash.  I will boot from the internal flash - I'm a bit wary of doing a pivot_root in case something goes wrong.  I will install big packages like samba to /cf - but if something goes wrong with the external flash I will still be able to boot.

danversj wrote:

My wl500g has only 2Mb of internal flash for some reason

Uhh, that's not so nice. I did know that the wl-520g is supposed to have 2MB only,
but I wasn't aware that ASUS is doing the same with wl-500g's. On my router the
firmware for my USB-ADSL modem already takes up ~650K, so with kernel, busybox
and uClibc there wouldn't be much space left with only 2MB flash. BTW, the noatime
mount option should be used to maximize the usb-storage (if flash based) lifetime.

The discussion might have continued from here.