Archive for June, 2012

Compiling a custom uwsgi for the Rascal

This post is just a note to myself about how to modify the uwsgi source code, recompile uwsgi and install it on a Rascal. Here are the steps:

1. Create a uwsgi source code tarball on goelzer.com

I have the uwsgi source code in a directory (/home/mikegoelzer/goelzer.com/uwsgi). After modifying the C code, I can use these commands to build a new tarball that bitbake will fetch in the next step:


cd /home/mikegoelzer/goelzer.com/uwsgi
tar cvzf uwsgi-1.2.3.tar.gz uwsgi-1.2.3/
md5sum uwsgi-1.2.3.tar.gz && shasum -a 256 uwsgi-1.2.3.tar.gz

The tarball is now accessible at http://goelzer.com/uwsgi/uwsgi-1.2.3.tar.gz. The above command also prints two hashes of the tar file that will be used below.

2. Update the OE uwsgi recipe

On the OE build system, I modify the bitbake recipe for uwsgi in recipes/uwsgi/uwsgi_1.2.3.bb:


DESCRIPTION = "uWSGI is a WSGI web server for Python web applications"
HOMEPAGE = "http://projects.unbit.it/uwsgi/wiki"
SECTION = "net"
PRIORITY = "optional"
LICENSE = "GPLv2"
SRCNAME = "uwsgi"
PR = "r0"

SRC_URI = "http://goelzer.com/uwsgi/uwsgi-1.2.3.tar.gz \
file://editor.ini \
file://public.ini \
file://arm-timer-syscall.patch"

[...]

Here’s the full recipe as a backup. And a shell script used to rebuild uwsgi.

Also, the last two lines of the file should be updated with the hash values computed in step 1.

3. Rebuild uwsgi using bitbake:


source env.sh
rm oe_sources/uwsgi-1.2.3.tar.gz*
bitbake -c clean uwsgi
bitbake -b uwsgi_1.2.3.bb

4. SCP and install the newly built opkg

From the Rascal:


rm uwsgi_1.2.3-r0.6_armv5te.ipk
opkg remove uwsgi
scp ubuntu@ec2-204-236-242-68.compute-1.amazonaws.com:/home/ubuntu/openembedded-rascal/tmp/deploy/glibc/ipk/armv5te/uwsgi_1.2.3-r0.6_armv5te.ipk .
opkg install uwsgi_1.2.3-r0.6_armv5te.ipk
/etc/init.d/rascal-webserver.sh reload

To see the uwsgi logs:


cat /var/log/uwsgi/public.log

Leave a Comment