View Single Post
Old 09-07-2010, 12:29 AM   #27
Xaphiosis
Connoisseur
Xaphiosis doesn't litterXaphiosis doesn't litterXaphiosis doesn't litter
 
Posts: 52
Karma: 216
Join Date: Apr 2010
Device: PRS-T1
Yes, the .so file is identical, and my scripts are based on porkupan's (with a bit of simplification).

The reason the russified package is of interest is what happens when you enter the diagnostic mode. In the russified firmware, it first tries to load stuff from /test on the internal flash, which loads the .so file, which runs the script. The normal version, on the 600 at least, *always* enters into the SONY diagnostic mode. This is why I mention re-flashing as one way to get arbitrary code execution. In any case, if you want to change the boot scripts and such, you'll probably need to re-flash anyway.

The stuff about "flashing" in the russified firmware's scripts doesn't work on the 600 and is disabled. Probably the same for the 900. It does have a "test flash" script which just does mount --bind and restarts tinyhttp. I modified it to have an extra option to run a custom script and worked from there.

Also, be careful when writing shell scripts that redirect output to files on the internal flash or SD card. On the 600, there appears to be a bug of some kind regarding append mode whereby it does not flush reliably on an fsync or unmount. If you redirect to a file in /tmp and then copy it out, it works fine. If you do log to an SD card and find this problem happens to you, the other way out is to copy the file to /dev/null, which forces an open+read in normal (non-append) mode and hence flushes correctly.

It seems you inspired me to dump almost all my knowledge in this thread, so maybe others will benefit too. Good luck, and let us know how it goes. If you have any other questions, shoot
Xaphiosis is offline   Reply With Quote