Author Topic: Running Python from SD card  (Read 3469 times)

andyinjapan

  • Newbie
  • *
  • Posts: 1
    • View Profile
Running Python from SD card
« on: July 27, 2004, 02:36:29 am »
As a Zaurus newbie, I'd like to know how I would install and use Python from the SD card instead of main memory.

I downloaded and tested python-core and a couple of other packages from Python for arm (a big "Thank-you!" to the maintainer for providing this), but main memory is a bit tight on the C700 and I'd rather have Python run from the SD card. (The Sharp installer complained that it couldn't install Python on the card when I tried.)

My C700 is running the Sharp 1.50JP rom and Qtopia 1.5.4, as well as the "Special kernal" (a Japanese rom update).

Any help would be appreciated...

--------
SL-C700, Sharp 1.50JP rom, Qtopia 1.5.4
SL-C700, Sharp 1.50JP rom, Qtopia 1.5.4

zmiq2

  • Sr. Member
  • ****
  • Posts: 383
    • View Profile
    • http://
Running Python from SD card
« Reply #1 on: July 27, 2004, 03:47:45 am »
Hi Andy,

las week I did exactly that. The recipe is:

1) create proper directory in sd card
 cd /mnt/card
 mkdir python
 mkdir python/bin
 mkdir python/lib

2) get the python packages from the web, and download them to the sd card

3) extract files to proper location:
for each package you want to install,

3.1) extract the package in a temp directory
 ar x python-coreXXXXXXXXX
 tar xvf data.tar.gz

3.2) check what files have been extracted, and to which directories, and move them accordingly to the previosly created directories
 i.e.
 move usr/bin/python /mnt/card/python/bin

NOTE: if your SD card is formatted as fat (as mine), then symlinks cannot be created in the card, and you'll receive lots of errors telling so. To solve this issue, you must write down what symlinks could not be created, and, instead of creating them, just copy the origin file over and over. It will take much more card space, but it's the only way and, anyway, its space in the SD card


4) create a symlink for pythin executable
cd /usr/bin
ln -s /mnt/card/python/bin/python

5) to run an app, just go tho the script directory and run
./py.py


This setup works for me. Hope that helps.
sl-c750, archos av580, socket cf [bt, wifi, modem], noname cf lan, audiovox rtm800 gsm-gprs cf, rom: sharp -> oz3.5.3 -> cacko -> oz3.5.4.1

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
Running Python from SD card
« Reply #2 on: July 27, 2004, 08:28:10 am »
A slightly easier option

Start at step 3.

Quote
3) extract files to proper location:
for each package you want to install,
Code: [Select]
tar xzf python-xxxxxxxx.ipk
Quote
3.1) extract the package in a temp directory
 ar x python-coreXXXXXXXXX

then tar then back up again.

If you have gnu tar then you can do this

Code: [Select]
gtar czf pyhton-xxxxx.ipk ./data.tar.gz ./debiab-binary ./control.tar/gzotherwise do it in 2 steps
Code: [Select]
tar cf pyhton-xxxxx.ipk ./data.tar.gz ./debiab-binary ./control.tar/gz
gzip python-xxxxx.ipk
mv python-xxxxx.ipk.gz python-xxxxx.ipk
The ./ before the files names is important if you want the ipk to work with the qui installer on the Sharp rom

Stu
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

maslovsky

  • Hero Member
  • *****
  • Posts: 1426
    • View Profile
    • http://my-zaurus.narod.ru
Running Python from SD card
« Reply #3 on: July 27, 2004, 12:38:44 pm »
I think a much better appoach will be to rebuild all the python packages into a cramfs image, then just mount it whenever python is needed. I'm gonna do that.

acpkendo

  • Full Member
  • ***
  • Posts: 169
    • View Profile
    • http://
Running Python from SD card
« Reply #4 on: October 19, 2004, 12:21:30 pm »
maslovsky,

That is a great idea.  I would love to have cramfs images of Mickeyl's packages. . .
« Last Edit: October 19, 2004, 12:23:00 pm by acpkendo »