Help - Search - Members - Calendar
Full Version: How To "mount" Cards As Usb Mass-storage With Oz
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > Angstrom & OpenZaurus
obergix
Hi guys.

With the Sharp rom, we're able to access the SD or CF cards in the Z as usb mass-storage drives from a computer connected to the Z.

Is it also possible when the Z is running OpenZaurus (3.5.3 here) ?

If yes, any pointer to a howto would be great wink.gif

I know I could do mostly the same if I had networking working between both units, through scp, samba or anything else... but networking with usbnet is actually broken at the present time (linux kernel 2.6.11, etc.)

Best regards,
Hrw
which Z?

on c7x0 with 2.6.x kernel you have to upgrade kernel to newer 2.6.11 release which have USB gadget modules modularized. Then all what is needed is "modprobe g_file_storage WITH_I_DONT_REMEMBER_OPTION=/dev/hda" for CF card and /dev/mmcblk0 for SD
obergix
QUOTE(Hrw @ Jun 15 2005, 11:45 AM)
which Z?

SL-C1000

QUOTE
on c7x0 with 2.6.x kernel you have to upgrade kernel to newer 2.6.11 release which have USB gadget modules modularized. Then all what is needed is "modprobe g_file_storage WITH_I_DONT_REMEMBER_OPTION=/dev/hda" for CF card and /dev/mmcblk0 for SD
*


I'm using OZ 3.5.3, so Kernel 2.4.20 at the present time... but maybe the 2.6.11 is ready for the 1000 ? I'm gonna check...

Thanks anyway for the answer.

Best regards,
lardman
QUOTE
I'm using OZ 3.5.3, so Kernel 2.4.20


The source for storage_fd should be in the kernel code, it just may not have been built - have a look in the machine feed and see if it's there.


Si

P.S.

You may be able to use the storage_fd.o module from a Sharp ROM (with the same kernel version) directly (but this is not ideal and it may not work due to missing symbols anyway).
obergix
QUOTE(lardman @ Jun 16 2005, 11:10 AM)
QUOTE
I'm using OZ 3.5.3, so Kernel 2.4.20


The source for storage_fd should be in the kernel code, it just may not have been built - have a look in the machine feed and see if it's there.
*



Thanks for the info.

The module was available in a package, that I've then installed.

Had to do an insmod -f (tainting the kernel)...

But not working :
insmod: init_module: storage_fd: Invalid argument

excerpt from dmesg :
CODE
wifi0: LinkStatus: BSSID=02:00:92:2f:97:00
storage_fd: storage_fd 0.1 035 2002-06-12 20:00 (OUT=64,IN=64)
storage_fd: vendorID: 4dd productID: 9050
storage_fd: usbd_register_function failed.


Dunno... maybe a problem with the cable, etc.

Any clue ?
lardman
QUOTE
Any clue ?


Did you try a search for storage_fd.o??

The module still needs to know which of the devices it is to use for mass storage.

This script of mine (from long ago, repeated a fair few times on this forum, should do the trick for you):

start_storage.sh:

CODE
#!/bin/sh
# change the next line if you want SD rather than CF
umount /dev/hda1
/sbin/rmmod pxa_bi
/sbin/rmmod net_fd
/sbin/rmmod usbdcore
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/usbdcore.o
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/storage_fd/storage_fd.o storage_device=/dev/hda1
# change /dev/hda1 to /dev/mmcda1 or whatever if you want
/sbin/insmod /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/bi/pxa_bi.o shortpacket=1 recvpacket=256


Obviously your kernel version is different so change the paths accordingly, I'm also not sure whether the shortpacket, recvpacket settings are needed/correct for your Z.

Do a search for start_net.sh to get back to normal functionality.


Si
obergix
QUOTE(Hrw @ Jun 15 2005, 11:45 AM)
which Z?

on c7x0 with 2.6.x kernel you have to upgrade kernel to newer 2.6.11 release which have USB gadget modules modularized. Then all what is needed is "modprobe g_file_storage WITH_I_DONT_REMEMBER_OPTION=/dev/hda" for CF card and /dev/mmcblk0 for SD
*


Seems to me that the option is file= (http://www.linux-usb.org/gadget/file_storage.html)

However, I've tried that on 3.5.4.1-alpha1 (file=/dev/hda1), and didn't work well... lots of errors...

I hope I didn't screw the CF card :/

Anyway, hope this helps.
SimedonMyrrho
I also have some problems with g_file_storage.

I use the command

CODE
modprobe g_file_storage file=/dev/hda


for both my 256 MB compact flash card and my IBM 340 MB microdrive, which both have a fat partition.

I tried 3.5.4 and 3.5.4.1.

I tried to mount them under Linux (2.6.16-ck1) and under win2k.

The compact flash card works, after some time (about 1 minute). The card is recognized as Linux File Storage, the fat formatted drive is recognizd and usable under win2k just like a normal usb stick.

The microdrive does not work like the flash drive. Neither Linux, nor win2k detect the partition, only the drive is recognized, either als Linux File Storage or as sdb. So with g_file_storage the microdrive is not usable. Of course it can be mounted under OZ 3.5.4 and 3.5.4.1, and i can install ipkgs from it.

I even tried to make a ext2 partition on the microdrive, then make a file on that partition, and make a partition inside that file, formatted it and then used this file as the parameter for g_file_storage. It also did not work.

The listing for the latter:
CODE
mkfs.ext2 -m 0 /dev/hda
mount /dev/hda /mnt
dd if=/dev/zero of=/mnt/store bs=1M count=340
fdisk /mnt/store
modprobe g_file_storage file=/mnt/store


Maybe some devs may take a look at it. Probably a newer kernel (2.6.16) is a solution for problems like these. I have read somewhere (lkml or so), that in 2.6.16-mm1 there are some bugfixes for the gadget devices. Unfortunately there is not much information on this topic out there, the file storage gadget howto is a good source of information, but there are no solutions for problems like these.
lardman
QUOTE
mkfs.ext2 -m 0 /dev/hda


No partition?

Si
Da_Blitz
to look up arg names for modules modinfo <module name> can come in handy
SimedonMyrrho
@lardman

QUOTE
No partition?


Yes, no partition. All i wanted was a logical drive where i can create the file i would be using as a backup for g_file_storage on. So i decided to create a superfloppy. Win probably does not like it, but oz did not have a problem mounting it.

QUOTE
to look up arg names for modules modinfo <module name> can come in handy


Thanks, i wasn't aware of that. All i did was looking into the source code file on my gentoo box, where i did find some of the parameters one can give to g_file_storage gadget.

BTW, I use a C860, which has 2 bad eraseblocks, if that matters.
SimedonMyrrho
I finally got it working with my microdrive.

The new kernel 2.6.16 in oz-3.5.4.1-rc1 did the trick. I takes some time until windows recognizes the drive, but some seconds ago i finished a download to the drive, and no errors whatsorever.

The microdrive is partitioned as usual. One partition, with one logical drive in it, formatted with fat32.

The modprobe command is the usual one
CODE
modprobe g_file_storage file=/dev/hda


Thanks for providing an OZ with this new kernel.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.