|
|
Line 11: |
Line 11: |
| 3) ./configure; make; make install | | 3) ./configure; make; make install |
| | | |
− | =Using an existing python binary=
| |
| | | |
− | <p>
| + | |
− | Luckily a number of existing linux platforms already support builds for the arm-linux. It is fairly painless to grab a binary from one of these systems and make it work on the chumby. I used the binary from [http://pymaemo.sourceforge.net/cgi-bin/moin.cgi python for maemo] project. The [http://maemo.org/ Maemo] project is the open source effort by Nokia to get linux and associated tools work on their arm based 770 platform.
| + | |
− | </p>
| + | |
− | * Download the python maemo binary from [http://pymaemo.sourceforge.net/cgi-bin/moin.cgi/ here]. You are looking for the PyMaemo 1.1 runtime.
| + | |
− | * The download is in a DEB file. There is probably some official way to untar a DEB file. However, the easiest solution is to run "tar x filename.deb". That will dump out the contents of the file.
| + | |
− | * You should see something like data.tar.gz. untar this file in the location of your choosing. For the purposes of this recipe I will assume you used the folder "chumby-python"
| + | |
− | * The next step is to make this folder available to the Chumby. There are two options: 1) copy the contents to a thumb drive or 2) simply mount this folder via NFS.
| + | |
− | * NFS:
| + | |
− | ** [[chumby_tricks | Enable SSH with a USB thumb drive]]. Your other option is to use find the easter egg that turns on the SSH server. A source of inspiration might be the Davinci Code.
| + | |
− | ** Login to your chumby via SSH.
| + | |
− | ** Mount your "chumby-python" folder via NFS - this assumes that you have exposed "chumby-python" using your nfs exports file. Assuming that your server name is chumbyfanboi and your "chumby-python" is located at /opt/chumby/chumby-python, execute the following command:
| + | |
− | ** "mount -o nolock -t nfs chumbyfanboi:/opt/chumby/chumby-python /python". "-o nolock" is important because portmap isn't running on the chumby.
| + | |
− | ** cd to /python/usr/bin.
| + | |
− | ** exec ./python2.4
| + | |
− | ** you should now be running python! Note that the Maemo distribution only includes the basic python packages.
| + | |
− | * Mount via USB (I haven't done this so please add your instructions here)
| + | |
| =If you're too lazy to do all that...= | | =If you're too lazy to do all that...= |
| You can download all of this prebuilt in [http://files.chumby.com/languages/python/chumby_python.tgz chumby_python.tgz] (3.8MB). | | You can download all of this prebuilt in [http://files.chumby.com/languages/python/chumby_python.tgz chumby_python.tgz] (3.8MB). |
| | | |
| Just unpack onto a USB drive, add your python code and a "debugchumby" script, and you can write your own python applications for your chumby! | | Just unpack onto a USB drive, add your python code and a "debugchumby" script, and you can write your own python applications for your chumby! |
Revision as of 20:44, 24 May 2009
Why Python?
- because writing in C sucks
- your time is valuable
- once a python zealot, always a python zealot.
Compiling python from source
1) Construct the Scratchbox environment.
2) Download the source to the python flavor of your choice
3) ./configure; make; make install
If you're too lazy to do all that...
You can download all of this prebuilt in chumby_python.tgz (3.8MB).
Just unpack onto a USB drive, add your python code and a "debugchumby" script, and you can write your own python applications for your chumby!