Tuesday, January 17, 2012

Diminishing Returns

After eliminating the ALSA bloatware I'd set my sights on the big fat static loadkeys program from IZ2S.  I was originally forced to keep it on the jffs because the keyboard is pretty much useless without a keymap, but a 300K executable is a bit excessive for that.  Now the IZ2S busybox upgrade comes with the loadkmap utility, which is much smaller because it only loads a binary version of the keymap file.  This seemed to work well enough so I compiled a tiny 4K standalone version for the base jffs system.  Unfortunately you need a recent version of the loadkeys program to convert any new keymaps you might make to the binary kmap file format, and the IZ2S loadkeys is a bit too old, so I has to use my Mint linux box to convert the keymaps.  Eventually I guess I'll build an updated loadkeys for IZ2S.  For now I just included a bunch of premade kmap files.

That took care of most of the remaining bloat on the base jffs.  None of the other executables in the /mnt/jffs/bin directory were significantly over 100K, so any further savings generated by replacing them would be relatively small. So, armed with the space saved by eliminating loadkeys I decided to try and replicate some more of the core IZ2S functionality on the jffs.  Two obvious gaps were the 600K Screen utility and the 4.5 Meg Centerim instant messenger client included in IZ2S.

Apparently source code development on the screen utility has ground to a halt lately, so I took a quick peek at the newer tmux screen multiplexor.  Unfortunately my build of tmux segfaults, so that'll have to wait a bit.  Instead, I recompiled the current release of screen to make a smaller executable, and while I was at it I threw in the vertical screen split patch.  As with emacs, I remain unconvinced as to how useful that'll ultimately be on the tiny zipit screen.  But it certainly can't hurt.  Well, actually the new upxed screen program is still almost 200K so I suppose it still hurts a little.
Thats my cheesy ANSI escape wifitest program in the right split, and the retawq browser on the left.

Centerim is huge so that's a no go for the jffs.  I examined quite a few alternatives and most of them seem to pull in openssl, or glib, or some other bloatware that pushes the exe size up over 2 Megs.  Too big for the jffs.  I had really high hopes for bitlbee because it's just a daemon that lets you use your IRC client (think pmirc) as a front end to various instant messanger services.  But it was also huge.  Oh well.

I decided to try the divide and conquer strategy.  Instead of one monster "do it all" program, I started looking for a group of smaller single protocol programs.  Even so, many of these were also bloatware.  So far I've got naim (pictured above) at 250K, bsflite (seen below) at 28K, and a shell script for jabber that (like pmirc) uses sed, grep, and ncat with ssl.  Apparently naim really wants to run with screen. It spews garbage unless I run screen first.  Weird, but ok I guess.  Unfortunately I don't IM myself, so I don't really know if it works.  Actually I think the TOC protocol used by the official naim release has been retired, so I may have to build an experimental version with the OSCAR protocol.  I did however manage to have someone to try bsflite on the zipit and confirmed that it was able to access an AIM account.

IZ2S version 2.04 comes with ncat, but I think it's built without ssl support.  The openssl program itself is about 1 Meg, so I had pretty low expectations when I built an new ncat.  Yep its huge.  But a search led me to snetcat aka.spipe with the embedded matrixssl library. At about 100K snetcat is a strong contender for the jffs.  I just need to redo the jabber script like I did with pmirc.  Then I need to figure out how to test it...

BTW, this post was actually composed on the road using e3em, which I ran on top of the screen utility so I could check the zipit battery level every so often with the EZ2S batlvl command line utility.

Here's the stuff.

bitlbee-iz2s.zip
loadkmap-iz2jffs.zip
screen-im-ssl-iz2jffs.zip

No comments:

Post a Comment