Author Topic: Creating Python 2.4 Zaurus Image  (Read 25520 times)

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
Creating Python 2.4 Zaurus Image
« Reply #15 on: January 11, 2005, 05:01:10 pm »
Connections to a remote MySQL database should work just fine as long as you specify things like host, port, user, passwd, etc. as parameters in the connect call (and don't rely on picking them up from [client] section of a my.cnf file). I ran the full suite of dbapi20 tests (about 40 unit tests) and had only three minor failures that shouldn't affect usability.

I've looked at the Twisted networking package and though it looks like really good stuff, it's pretty huge and has some major dependancies (like OpenSSL) that I don't want impose on users that don't need it. At some point I may package it up as an add-on, but it doesn't look like it will make it into the base image. I also looked at PyGames (a Python interface to SDL) but it's also too big and has too many dependancies for the base image.

So, barring any other suggestions, I may be able to package all this good stuff up and have a release by the end of the week. Stay tuned

LarsAC

  • Newbie
  • *
  • Posts: 4
    • View Profile
Creating Python 2.4 Zaurus Image
« Reply #16 on: January 12, 2005, 05:49:04 am »
BTW, would this only work on Cacko or other ROMs (e.g. for the 5500/5600) as well ?

Lars

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
Creating Python 2.4 Zaurus Image
« Reply #17 on: January 12, 2005, 07:58:46 am »
I'm testing on a C760 running Cacko 1.22 and a 5500 running the the last official Sharp ROM. So pretty much any Zaurus with a ROM that is reasonably close to the standard Sharp ROM should work just fine. I've even modified the mount scripts to theoretically work with the 3000 (though I have no way to test). It will not be compatible with pdaXrom or OpenZaurus, but I believe they both have their own solutions.

slapout

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Creating Python 2.4 Zaurus Image
« Reply #18 on: January 12, 2005, 02:16:36 pm »
I'm using kopsis's Python 2.3 image on a 5600 with the Watapon rom. I've just started working with python, so I haven't tried all the modules. But the basic stuff seems to work and the little stuff I've done with pyqt seems to work.
SL-5600
Watapon 1.2 Rom

vernm

  • Newbie
  • *
  • Posts: 1
    • View Profile
Creating Python 2.4 Zaurus Image
« Reply #19 on: January 12, 2005, 07:37:54 pm »
I just got my 5600 last week. It is great, but I have a lot to learn re. Linix. I am most interested in Python; I have been using it for about 4 years. I have been reading about your port of 2.4. Sounds fantastic.

I noted that the memory footprint is an issue. Have you looked into the Python feature which allows imports from a ZIP file. This might be a good way to shrink the size. There is probably some time penalty, but I bet it is not too bad.

Right now I am trying to figure out what I need to do to setup Python on my Zaurus. I would like to put it on my SanDisk 512MB SD card. Is there a good how-to guide for setting things up for Linix newbies.

Since I have a lot of python experience, I would be happy to help out anyone who has a Python question.

kopsis

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • http://kopsisengineering.com
Creating Python 2.4 Zaurus Image
« Reply #20 on: January 13, 2005, 07:40:37 am »
You can read up on my approach to Python on the Z here. That write up is for the previous (2.3) image, but most of it will apply to the new 2.4 image as well. The only big differences are 2.4 (obviously  ) and that I'll offer a cramfs image in addition to the ext2 version.

A cramfs image, for those not familiar with them, is a "Compressed RAM FileSystem". It's basically a ramdisk image that is compressed and saved to a file. Since it's already compressed, the trick of importing modules from a ZIP file is unnecessary. Using the cramfs image will be a bit slower than the ext2, but the whole thing will need less than 10MiB of space on your SD or CF card.

The ext2 image will remain avialable for those who are willing to trade space for speed and for developers who want to be able to add packages or otherwise customize the image (the ext2 image is read-write, the cramfs is read-only). You'll be able to fit either onto a 512MB SD card and still have over 450MB of space left

Ragnorok

  • Sr. Member
  • ****
  • Posts: 296
    • View Profile
    • http://
Creating Python 2.4 Zaurus Image
« Reply #21 on: September 17, 2005, 01:49:50 pm »
Quote
it's definitely worth a try, though i'd be thankful for your "semi-detailed instructions"- i'm not new to computers however to linux and especially unix commands are quite unknown to me.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=61925\"][{POST_SNAPBACK}][/a][/div]
- Just did this and it's pretty simple.  Thanks kopsis, for putting this thing together.  Beats installing all of that stuff separately!!

- Naturally you must have an ext2 file system available.  My SD is ext2; since it never comes out of Hiroshi I don't care if it's not compatible with another device.  I mount it from the Z when I need to move data around.
- I just looked at the /etc/rc.d/init.d/mntpython script to see it wanted to mount it to /opt/QtPalmtop/lib/python2.4.  Farther down you'll find an fsck.ext2 command, then after that a mount command to mount file system using a loop.  Take note of these commands.  The Z has two loop devices already, so unless you're using them for something else, you won't have to wory about the lines that create a bunch of loop devices.  If both of your loops are busy you'll have to make another one.
- I created a place on the SD to hold the python directory.  Since it's going to be linked to /opt/QtPalmtop/lib, I used /usr/mnt.rom/card/QtPalmtop/lib/python2.4.  Anywhere will work just fine ... simply create a directory.
- Just 'cause, I ran the fsck to be sure the python24.ex2 wasn't corrupted, which is what it does each time it mounts.
- Then I created a temporary dir to mount it to, since the final "resting" place has to be the /opt...lib dir above.  I used /home/zaurus/mnt, but anything writable that's not the lib dir above should work fine.
- Use the noted loop mount command, substituting the location of python24.ex2 for $IMAGEDIR/file and the temporary mount point for $PYTHONDIR.
- cp -R <mnt point>\python2.4 <dest dir>.  For my example, <mnt point> is /home/zaurus/mnt and <dest dir> is /usr/mnt.rom/card/QtPalmtop/lib/python2.4, just to be painfully explicit.  (grin)
- The odd thing is this actually puts stuff in <dest dir>\mnt.  I could have copied it down one directory, but I was feeling lazy, so I just linked to there.
- cd /opt/QtPalmtop/lib
- ln -s <dest dir>\mnt python2.4
- umount <mnt point>
- rmdir <mnt point> (only if you want to ... I created it just to mount this .ex2 so I deleted it when I was done)
- rm <path to>\python24.ex2.  You don't need this any longer because it' on your SD card in <dest dir>\mnt now.
- You can delete mntpython, or just uncomment the exit 0 at the beginning, which is what I did.  If you don't prevent this from running you'll get errors next reboot.
- Run the Hello World example from the installation instructions.  Also, type "help()" and press Enter.  If it loads help, you know you're golden ... if there were errors but it still gets a python command prompt, the Hello World will still work but it won't load help.
- Enjoy your new kopsis-provided python 2.4 installation.

- I've had very good results moving binaries and libraries to wherever and linking them back to where they started.  I haven't done this with python yet, but I certainly will be.  Just move python-exe from /home/QtPalmtop/bin to /mnt/card/QtPalmtop/bin and "ln -s" to "put it back".  Nethack is the only thing I've seen that fails with this treatment, so even if you have to install to "Internal", it doesn't have to stay there.  I have tons of free space because I don't let stuff live there forever.  If it doesn't work ... no biggie ... just remove the link and move it back!  This is Linux, not Winbloze, and it simply won't care.

- The entire reason I did this is to get gnome-sudoku to run.  I scoured the web fo Sudoku generators and this is the only thing I found.  Tons of *solvers*, but no generators/players for the Z at all.  Gnome-sudoku is written in python, and kopsis so very conveniently provided this package for the latest version.
- I'm going to play with it today.

- Hope this helps...
« Last Edit: September 17, 2005, 01:54:44 pm by Ragnorok »
| I shed a tear for the passing of Hiroshi; he served me well
| Zaurus zealot since Nov 2002, PDA user since Oct 1991
| Replaced Z with UMID BZ February 2010

rjohnson1969

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • http://
Creating Python 2.4 Zaurus Image
« Reply #22 on: May 10, 2007, 05:58:45 pm »
Quote
You can read up on my approach to Python on the Z here.
[div align=\'right\'][/div]
KOPSIS,
This is an ingenious way of packaging python.  Until I found your site, I was too intimidated to install it.  Now, its on my sl-5500 SD and running fine.

I have a question:  Does the loop filesystem mounted from SD throw off the SharpROM System Info application that estimates memory remaining?  Mine seems to have gone up by about the size of the read only image...  or I have some major cleaning up to do...

Thanks,
  --  RJ
sl-5500 with Sharp 3.13 ROM
using stock PIM
generic 512MB SD
Pretec CF Wi-Fi

hughsieman

  • Newbie
  • *
  • Posts: 28
    • View Profile
Creating Python 2.4 Zaurus Image
« Reply #23 on: June 16, 2007, 09:39:51 am »
Hi

I have installed your python image kopsis and have been using it for the last few weeks to learn python/PyQt so thanks very much for that.

Just one thing though. I would like to set up python/PyQt/Qt on one of my Windows machines and I would like to be able to develop on the Windows machine and then run on the Z and vice versa.

I installed Python obviously, then Qt and then PyQt. Then I needed scintilla which I installed and then I needed sip and it was all getting a bit silly. Needless to say I couldn't get it to work. I was trying to get Idle up and running but failed.

I think I had the wrong versions to match the Z anyway as I was installing PyQt4 and I think it should have been version 3.

Anyway, please would someone let me know what to download and install and how to do it to achieve the above.

Many thanks and apologies for the fairly long post.

Also if this would be best in the Desktop thread then please let me know.