Help - Search - Members - Calendar
Full Version: Running Python from SD card
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > Qt/Qtopia
andyinjapan
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
zmiq2
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.
Stubear
A slightly easier option

Start at step 3.

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

CODE
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
gtar czf pyhton-xxxxx.ipk ./data.tar.gz ./debiab-binary ./control.tar/gz

otherwise do it in 2 steps
CODE
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
maslovsky
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
maslovsky,

That is a great idea. I would love to have cramfs images of Mickeyl's packages. . .
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.