Why should someone want to run a web server on his cellphone? Of course because he can =), just for the fun!
So, how to compile cherokee for Motorola A1200i:
First we need to build a “toolchain” a development environment that can compile binaries for the CPU architecture of the phone, in this case: ARM Linux
Such toolchain can be download from here: http://lsb.blogdns.com/ezx-crosstool
Pretty easy, just run ./build.sh you need build-essential (gcc and company), flex and bison, go for a cup of cofee and let the automagic work, this will compile a GCC compatible with your phone among some other utilities.
Now fetch last release of cherokee: http://www.cherokee-project.com/ , unpack and prepare yourself to compile it.
I based in this document: http://www.cherokee-project.com/doc/cookbook_embedding_cherokee.html after a few of “try and fail” tests i end with this configuration:
export AR=/home/maop/ezx-crosstool-0.6/gcc-arm-iwmmxt/gcc-3.3.6-glibc-2.3.2/arm-linux/bin/arm-linux-ar
export LD=/home/maop/ezx-crosstool-0.6/gcc-arm-iwmmxt/gcc-3.3.6-glibc-2.3.2/arm-linux/bin/arm-linux-ld
export CC=/home/maop/ezx-crosstool-0.6/gcc-arm-iwmmxt/gcc-3.3.6-glibc-2.3.2/arm-linux/bin/arm-linux-gcc
ac_cv_func_shm_open=no ac_cv_lib_rt_shm_open=no ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes \
./configure --host=arm-linux--prefix=/mmc/mmca1/cherokee --enable-static --enable-shared=no --enable-static-module=all \
--disable-tls --enable-beta --enable-trace --enable-nls=no --disable-largefile --disable-admin --disable-epoll --disable-ipv6 \
CC=/home/maop/ezx-crosstool-0.6/gcc-arm-iwmmxt/gcc-3.3.6-glibc-2.3.2/arm-linux/bin/arm-linux-gcc
As you can see i set –prefix to “/mmc/mmca1/cherokee” this mean that we’ll “install” cherokee on our memory stick this way we avoid to hack motorola’s linux system. Also this mean that you have to create that path on your development machine, try mkdir -p /mmc/mmca1/cherokee
and chown youruser:yourgroup -R /mmc
Now type “make” so compile of cherokee begins.
After make is done, type “make install” and all files will copy to /mmc/mmca1/cherokee
Now just transfer the “cherokee” directory to your SD card with your favorite transfer method (bluetooth, ftp, ssh, smb, usb mount, etc), then open eKonsole (you have shell in your phone right?) or telnet or sshd into it, change to the right directory: cd /mmc/mmca1/cherokee and simply run cherokee by typing: sbin/cherokee
And that’s all, of course you have to configure your phone to “USB Network” in your “USB Mode” settings, then open a browser in your machine, and type the IP of the phone et voilá! cherokee serving web pages right from your cell phone.
Dude, i remember the times of my night sessions with my 80386 coding in GW-Basic. Now our cellphones have more power than those old machines.
You can see cherokee in action in this video (if you can’t see it come to my site and see it =):
Cherokee running on a Motorola A1200i
Next post: “how to get your unix powertools in your A1200” (vim, bash, sshd, strace, python, perl, ruby, php, vmstat, nano, etc)
Saludos!
In which distribution/version did you build your environment?
I’m eager to try your tutorial, but I first would have to build the environment on a virtual machine.
PS: And I’m curious for the next post (UNIX powertools :). Do you still intend to publish it?
Thanks in advance!
Hello,
My tool chain was compiled on a VPS with debian Etch.
I saw in your blog you have already compiled cherokee succesfully for A1200i :) congrats!
Best regards
Dude, you my hero! XD