OESF Portables Forum

General Forums => General Discussion => Topic started by: lardman on February 26, 2004, 09:50:43 am

Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 26, 2004, 09:50:43 am
Attached is a tarball with 3 files inside:

Stick storage_fd.o in /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/storage_fd/

Stick the two .sh files anywhere you want (either in your path or cd to their directory and run them directly).

pxastart_storage.sh will load the storage_fd.o module and should then make your 5600 behave like a mass storage device (like one of those pen things you can stick in the USB port). It currently uses the CF card for the mass storage. You can edit the script to use /dev/mmcda1 instead of /dev/hda1 to use an MMC/SD card instead. The card in question will be mounted and unmounted by the scripts. Make sure this is possible (ie test to see whether your Z will allow you to umount cleanly. If it won\'t then the test won\'t work)

pxastart_net.sh will load the net_fd module which will return your 5600 to using the USB cradle connection as an ethernet connection (standard setup).

If the worst comes to the worst you can always reboot and the storage_fd module will be unloaded. It won\'t be loaded unless you run the pxastart_storage.sh script so there\'s no need to worry about breaking anything.

Basically I\'d just like someone to try out the scripts (run pxastart_storage.sh before putting your Z in the cradle) and see whether your WinXP/2k or Linux machine recognises it as a mass storage device.

Thank you,


Simon
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: ced on February 26, 2004, 10:15:27 am
I\'ve re-compile my own usb storage module.

I\'ve copied pxa_bi.o (because the size was different) and usb_storage.o to my zaurus and all the /etc files defined in the other thread for the 5500.

The storage has been loaded but I don\'t see any changes on my $M box.

I\'ve rebooted now and the kernel is sticked to text... no prompt, no ui...
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 26, 2004, 11:05:00 am
What do you mean \"the kernel is sticked to text\".

Do you mean you\'ve broken it? When you get it working again try the file I\'ve attached above. It doesn\'t change pxa_bi so it shouldn\'t kill your 5600 after a reboot (plus it doesn\'t mess around with the hotplug scripts, just by-passes them). The above file worked to some extent on my 5500 (non pxa) so it should produce some effect on a 5600.


Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: Greg2 on February 26, 2004, 11:23:09 am
The storage has been loaded but no changes in linux box... except now my battery applet shows it\'s charging but not connected when removed from cradle?

Specs:
5600, zynergy-1.1with Special kernel
Mandrake 9.1

Maybe special kernel problem?
Let me know if you need any data later...I won\'t reboot yet (don\'t worry,no big deal)
Mandrake still sees a 5600 in usb view?

Greg
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 26, 2004, 11:30:55 am
Hmm, very strange.

Could you do an lsmod and see what\'s loaded?

Cheers,


Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: Greg2 on February 26, 2004, 12:49:25 pm
lardman

I\'m still working at it (when I have time today)

It is this damn file structure (not like oz) part of it is read only and I have to use a trick of tumnus to change it.

There is
/lib/modules -] /home/root/modules/
and
/lib/modules.rom/

and where it should be is read only

I will change that later...

Greg
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: ced on February 26, 2004, 12:59:20 pm
I\'ve changed /dev/hda1 to /dev/mmcda1

Code: [Select]
bash-2.05$ sudo ./pxastart_storage.sh

rmmod: module serial_fd is not loaded

rmmod: module net_fd is not loaded

/lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/bi/pxa_bi.o: invalid parameter parm_shortpacket



bash-2.05$ lsmod

Module                  Size  Used by

storage_fd             99872   0 (unused)

usbdcore               34544   0 [storage_fd]

usbdmonitor             5248   0

sharp_mmcsd_m          26256   1


I don\'t have a new drive on my $M box...
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: Greg2 on February 26, 2004, 01:28:20 pm
lardman

I can\'t place that driver where it has to be to work with the Zynergy rom1.1

With the Sharp rom and TKCrom I can:

mount /-o rw,remount

but that doesn\'t work on Zynergy

The drivers are located in a minix file system with 0kb free?

Any ideas?

Greg
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 26, 2004, 03:42:22 pm
@ced: edit the script and remove the parameters which are passed to pxa_bi.o (I assumed that as the c860 pxa_bi.o took these so would the 5600 version, it looks like I was wrong).

@greg2: you can just provide a full path to the storage_fd.o file (in the script) so stick it anywhere. Also do what I\'ve suggested above if you have ced\'s problem (I assume you will).

BTW cheers for your help guys,


Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: Greg2 on February 26, 2004, 07:52:32 pm
lardman

lsmod reads the same as ced

I made a poor attempt at editing the script...i won\'t go there

I don\'t even know what pxa_bi.o is or should do? But I will leave the drivers in place if you would like to attach another script for me to try.

Greg
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: ced on February 27, 2004, 03:29:54 am
Code: [Select]
bash-2.05$ lsmod

Module                  Size  Used by

pxa_bi                 21328   0 (unused)

storage_fd             99872   0 (unused)

usbdcore               34544   0 [pxa_bi storage_fd]

usbdmonitor             5248   0

sharp_mmcsd_m          26256   1



bash-2.05$ cat /proc/usb-storage

Protocol status:STORAGE_IDLE

USB status:USB_DISCONNECT

Media status:MEDIA_EJECT

Media chage:MEDIA_CHANGE_OFF

Device name:/mnt/card

Device file descriptor:0x00000000

Device size:0x0

Device block size:0x512

Device write protect:WR_PROTECT_ON

Bulk in max size:0

Bulk out max size:0

device write error:0

device read error:0

device flush error:0

write data bulk out timout:0

device write max time:0 msec

Schedule task max num:0x512

Schedule task use num:0x1

Schedule task max use num:0x1


My SD card is not mounted (ext2 type) and my M$ box doesn\'t have a new drive...
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 27, 2004, 06:16:55 am
Sorry, I just spotted a mistake in my script - I was using storage_device=/mnt/cf when it should be storage_device=/dev/hda1, so no wonder nothing was working.

@ced: Your card will need to be in a format which Windows can read (sorry I should have said that before). Do you have a Linux box which you could try it on (as it will be able to read an ext2 mass-storage device)?

@greg2: I\'ve attached a new set of scripts. I\'ve change the pxastart_storage.sh one and created a new greg2pxastart_storage.sh script for you. Before you run this script you have to \'cd\' to the directory which contains the storage_fd.o module.


Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 27, 2004, 06:19:03 am
Hmm, I had to edit the scripts on a windows machine so it looks like they\'ve had line feeds added.

If you want to take a look at what I\'ve changed then change the original scripts on your Z that would probably be easiest.

Greg, if you have any troubles with editing them give me a shout.


Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: ced on February 27, 2004, 10:30:36 am
Code: [Select]
bash-2.05$ cat /proc/usb-storage

Protocol status:STORAGE_IDLE

USB status:USB_DISCONNECT

Media status:MEDIA_INSERT

Media chage:MEDIA_CHANGE_ON

Device name:/dev/hda1

Device file descriptor:0x00000000

Device size:0x0

Device block size:0x512

Device write protect:WR_PROTECT_OFF

Bulk in max size:0

Bulk out max size:0

device write error:0

device read error:0

device flush error:0

write data bulk out timout:0

device write max time:0 msec

Schedule task max num:0x512

Schedule task use num:0x0

Schedule task max use num:0x2


the usb status is still disconnected but now the CF is mounted.
If I plug my zaurus to the cradle then my M$ box reconise it as a \"SL series Ver3 (WDM)\" device. my CF card has a vfat type.
I get this with your script and with the C860 hotplug scripts.
If I\'ve used my SD card (ext2) then I get the same thing -] usb disconnected and card mounted.
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: ced on February 27, 2004, 11:07:58 am
sorry lardman, I\'ve used my own compiled module and it wasn\'t working... I\'ve switched to yours and it\'s working!

how did you configure/compile your storage_fd.o module?
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 27, 2004, 11:09:21 am
The card is recognised (in that it know which one to look at), but I don\'t think it\'s reading it properly as these two:

Device file descriptor:0x00000000
Device size:0x0

Should be non-zero. This looks much like my output on the 5500, I had expected it to be more promising for you guys. It looks like I\'ll have to dig deeper for the differences.

In truth this is a good thing (for me at least) as the sl5600 and c860 kernel sources are far more similar than those of the sl5500 and c860. Hopefully I\'ll be able to spot the difference.


Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: ced on February 27, 2004, 11:16:46 am
I\'m not sure If you\'ve seen my previous msg...

the string [2] in /proc/usb-devices display \"SL-C860\".

my module was showing \"SL-5600\".
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 27, 2004, 11:20:04 am
I must have been posting while you were.

So it\'s working now is it? You have access to the card, etc.?

I didn\'t compile this module, I just borrowed it from the c860 root fs tarball (though I can give you instructions as to how I compiled the module for my sl5500 if you want them).

Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: Greg2 on February 27, 2004, 11:32:51 am
lardman

I see it works!

I can\'t create this directory: /storage_fd ,where it should be
when I run it in this directory: /device ,I get:

Bad interpreter: no such file or directory

yesterday I removed that directory from your script and it seemed to be ok?

Any thoughts?

Greg
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: ced on February 27, 2004, 11:38:00 am
yes everything is working fine with the CF card.

yes please for the compilation instructions.

It\'s a bit shitty if I\'m suspending my zaurus (or stopping the device in windows), the usbcore module is busy and can\'t be removed. And finally, to reboot I need to use the hard reset button...
I\'ve checked the /proc/usb-devices file after a suspend:

Code: [Select]
bash-2.05$ cat /proc/usb-devices

usb-device list

Device: PXA

             Device:[        ]

Segmentation fault



I\'m using now the C860 hotplug script and it\'s working ok apart the above issues.
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 27, 2004, 11:46:10 am
Try \'rmmod storage_fd\' before suspending, this should stick you back to the normal condition.

I have to go home and look on my Linux box for the compilation instructions. I\'ll do that this evening. Actually I\'ll try compiling a 5600 version of the storage module too.


Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: ced on February 27, 2004, 12:17:38 pm
I\'ve compiled my modules like this:
  - make menuconfig
  - load poodle config file
  - enable \"mass storage function\" as a module
  - make dep; make clean; make zImage; make modules; make modules_install

What do I need to change in the configuration of the mass storage?

I\'m just wondering if the C860 users got the same issues during a suspend?

how do I configure the \"PC Link\" (qtsamba) application to use the storage option? and make it work properly?

so far I\'ve updated these files from the C860 rootfs source:
/etc/sdcontrol
/etc/usbcontrol
/etc/pcmia/ide
/etc/hotplug/usbd.agent (removed the MODULE_BI_OPT variable at the install module pxa_bi.o line)
/etc/hotplug/usbdstorage.agent
/etc/hotplug/usbdstorage.conf
/etc/rc.d/init.d/usb
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: Greg2 on February 27, 2004, 12:31:17 pm
lardman

Is there a trick to write in a read-only file system? (anybody?)

If not over the weekend I will back everything up and flash to Sharp rom.

Good work

Greg
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 27, 2004, 12:49:19 pm
@Ced: I\'ve tried enabling it the way you say (in the OE/OZ kernel build system), but no luck. In the end I looked at the log of the build process and copied the command line which was used to build net_fd. It seemed to work fine. No matter what I tried to enable I couldn\'t seem to get it to compile (including editing the makefile and config files manually).

@Greg: You may be able to mount the filesystem as rw temporarily, I don\'t know.

Take a look at the scripts I amended and then make changes to the ones you already have and it should work. If you just remove the entire path before the storafe_fd.o module then cd to the directory which contains the module you should be able to load it without troubles.


Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: Greg2 on February 28, 2004, 09:46:03 am
Si

I finally made it work with all your help!

I could have made the other rom work with your new modified script but I wanted something more neat and stable. For the record you can write on the Sharp read-only file system but not the Zynergy 1.1-with a trick that tumnus has posted in at least two other threads.(I will look into that another time)

I was going to make 2 little icons and create executable scripts but in the other thread I see you are thinking of hotplug scripts?

This was something you were trying on the dev/net that i was watching closely, it is a very valuable feature for me!

New specs: 5600, Rom 1.32 with Special kernel and USB-storage

Thanks

Greg
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 28, 2004, 10:15:44 am
No problem Greg, I\'m glad you\'ve got it working.

Sorry I missed your earlier post:

Quote
lardman

I see it works!

I can\'t create this directory: /storage_fd ,where it should be
when I run it in this directory: /device ,I get:

Bad interpreter: no such file or directory

yesterday I removed that directory from your script and it seemed to be ok?

Any thoughts?

Greg

This is because the Sharp text editor adds line feeds to the text files which it creates/edits. So you\'ll either have to get a different text editor (like the opie one), use vi, or run dos2unix (which strips out the line feeds) on the script which you were editing.


Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: dz on February 28, 2004, 12:41:29 pm
..weird, i try and run the scripts right from the sd card and i get this:

[u@h w]$ pxastart_storage.sh
pxastart_storage.sh: not found

when i try and do sh pxastart_storage.sh, i get this:

[u@h w]$ sh pxastart_storage.sh
: not found
: No such file or directory
: not found
 is not loadedpxa_bi
 is not loadedstorage_fd
 is not loadedserial_fd
 is not loadednet_fd
 is not loadedusbdcore
: not found
insmod: /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/usbdcore: No such file or directory
/lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/storage_fd/storage_fd.o: init_module: Invalid argument
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters
insmod: /lib/modules/2.4.18-rmk7-pxa3-embedix/kernel/drivers/usb/device/bi/pxa_b: No such file or directory

i dunno :/
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 28, 2004, 01:15:32 pm
Hopefully you\'re not trying to run the scripts from the card which is unmounted as part of the process?

Unless the command is in the path you have to do this:

$ ./command-name

rather than just:

$ command-name

to get it to run.

What device is this you\'re trying it on, a 5600? Which ROM?

Try just doing \'lsmod\' and see whether any of the modules are loaded.


Si
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: dz on February 28, 2004, 01:32:40 pm
ahh it works now.. i had to change the line in the file that said which drive to mount/umount

works well now.. i have a 5600 pxa255 with tkcRom

only thing is when windows recognized the mass storage option, it said it was a CL860 or whatnot.. either way, i dont know if that matters since it still works fine.. and i can rw from the new drive also

thanks
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: dz on February 28, 2004, 01:37:16 pm
now what would be nice is if you could do net + mass storage..  that way i could still ssh into it

either way, very nice job
Title: Wanted: 5600 usb mass storage test volunteer/victim ;-)
Post by: lardman on February 28, 2004, 04:41:59 pm
The c860 is a static string in the module. If you try the file I attached above it will say sl5500 instead.

Quote
now what would be nice is if you could do net + mass storage.. that way i could still ssh into it

Not at the same time I\'m afraid, but if you can ssh in then you could just use a graphical sftp client and then you have access. You can also just run the appropriate script and the Z will change its behaviour (take it out of the cradle first).

Si