Intro

We plan to get Mike Demmer (et al)'s NetAPI running on the tablets. To make a long story short, netapi depends on twisted, which depends on zopeinterface, which depends on python…

There are two parts to this story.

The first one (the short one) is about how to get Twisted working on the tablets. The second is about a long process of cross-compiling and debian-packaging, which you won't need to do if you are just using Twisted, but you might need to do if you are using netapi.

Twisted

Twisted is an event-driven networking engine written in Python, supporting numerous protocols. It contains a web server, numerous chat clients, chat servers, mail servers, and more. It's got a number of useful APIs for networked services, and a few example applications to get you started.

NetAPI

NetAPI is an implementation of a network layer based on the publish/subscribe model, designed to better embody the types of communication entailed in applications like rss/podcast/news services, mail, etc, noting in particular that current notions of connection management do not match well with their models of data delivery. This may be particularly useful for delay tolerant applications.

For more details, see:

Installing on the Internet Tablets

  1. Add the phone class repositories to your repositories
    1. Launch the Application Manager (settings→application manager)
    2. Open the list of repositories (menu→tools→application catalog…) (menu is the little icon in the top left corner on the tab)
    3. Click the new button, and create a new catalog entry
    4. Click ok, then close, then yes refresh the application list
  2. Kill the application manager (see “small lessons” for details on why)
    • The packages we want won't show up in the application manager even though they are in the repositories
    • Even if you download the packages we want, the application manager will not install packages built for bora, but apt will
  3. Launch a terminal (Utilities→X Terminal)
  4. Get root access (see http://maemo.org/community/wiki/howdoibecomeroot/, follow the r&d mode instructions at the bottom)
    • (Only the first time) with the usb cable disconnected:
              pc> ./flasher --enable-rd-mode
    • when prompted, attach the device
             nokia$ sudo gainroot
  5. Reload the apt repositories
         nokia# apt-get update
  6. Install the packages and their pre-requisites
         nokia# apt-get install python-all python-dev python2.5-dev
         nokia# apt-get install python-zopeinterface
         nokia# apt-get install python-twisted-bin python-twisted-core
    1. Test twisted by running on a chatserver on the device:

Small Lessons

Adding Packages to the Class Repository

The Debian Repository HOWTO: http://www.debian.org/doc/manuals/repository-howto/repository-howto

  1. The repository is on phone.cs.berkeley.edu, which you can access with your eecs username and password (email RJ to be added to the group)
  2. copy the files into the appropriate directory on phone.cs.berkeley.edu
    • Main Directory: /var/www/virtualhosts/phone.cs.berkeley.edu/apt/
    • chinook free: apt/dists/chinook/free/binary-armel/
    • chinook non-free: apt/dists/chinook/non-free/binary-armel/
    • bora extras: apt/dists/bora/extras/binary-armel/
    • bora free: apt/dists/bora/free/binary-armel/
    • bora non-free: apt/dists/bora/non-free/binary-armel/
  3. ssh to phone.cs.berkeley.edu to update the packages file:
    $ cd /var/www/virtualhosts/phone.cs.berkeley.edu/apt/dists/[whatever directory you chose]
    $ dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz

Application Manager Weirdness

Some things we noticed during our trials and tribulations

  • /etc/apt/sources.list is empty
  • Our packages, and any bora packages don't show up in the available packages list in the Application Manager
  • The Application Manager does not allow installation of bora-built packages (i.e. if you download them from the web, and open with the Application Manager), although apt-get is fine with it. So if you want to install bora packages, use apt instead of the Application Manager.

We're not sure - it may be possible to add new repositories to the empty source file. But, just in case, instead we use the Application Manager to add new package repositories. Since apt won't run when the Application Manager is open, we then have to close the manager before going to an xterm window.

To update the package list:

apt-get update

You may get some warnings if the src repositories don't exist.

To search for packages:

apt-cache search [package name]

Getting rid of "sem_post: Function not implemented"

So scratchbox uses python2.3 for a lot of the emulation. This become problematic for cross-compiling applications where the configuration assumes that you want to use whichever python gets invoked when you just type “python”. (Do python -V to check which version is being run, which may not be the same that shows up if you run which python, see “scratchbox path quirks”). When we decided to upgrade the python that runs in scratchbox, we were subsequently flooded with lines saying “sem_post: Function not implemented”. To get rid of this, follow the instructions on this link: http://maemogeek.blogspot.com/2007/11/installing-qemu-arm-eabi-patch-into.html

Scratchbox Path Quirks

Scratchbox has a “feature” in which any applications that show up in /scratchbox/tools/bin are run, no matter where /scratchbox/tools/bin actually shows up on the path. Basically, once it finds the application, it checks to see if it is also in /scratchbox/tools/bin, and runs that if it is there, instead of whatever showed up. In particular, this happened when I was trying to upgrade python. “which” was clearly returning python2.5, whereas “python -V” always said “2.3”. The only way I could get around this was to (outside of scratchbox) delete /scratchbox/tools/bin/python, and replace it with the python2.5 binary. This, unfortunately triggered the sem_post warnings, which you can get rid of later.

(Re)-building Packages

We built and re-built a number of packages in a couple of different ways. For some packages which we compiled from scratch, we followed these instructions and it was pretty straightforward: http://maemo.org/development/documentation/how-tos/4-x/creating_a_debian_package.html.

For some other packages though, we decided to start with bora packages and repackage them. For this, we basically did an apt-get source on the package and then dpkg-buildpackage -rfakeroot. This command generally complains about dependencies so you have to repeat the process for all the dependent packages until there are none.

shortproject/pubsub.txt · Last modified: 2010/02/18 21:58 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki