Monday, March 12, 2012

In the Zone

I decided to use my renewed focus on the jffs to try and see if I could squeeze gmenu2x onto the stock zipit jffs along with gmu. (I've already fielded a few not so subtle hints from my co-worker that the linux command line is perhaps not the easiest way to use the zipit.)  This wasn't gonna be easy though because gmenu2x is fairly bloated with C++, freetype, and lots of png files.

The first thing I did was to cut it back to a minimal installation with just the default skin, only one translation (french), and fewer icons and the smallest background image file I could find.  See above.  I also ran all the images through pngcrush for good measure.  This resulted in a gmenu2x installation that was almost small enough for the jffs.  Unfortunately it didn't quite work when run from the stock busybox shell.  I had to build a tiny killall executable to enable my previous uclibc workaround from the iz2s build.  Then I had to make sure to "exec gmenu2x" from my gmenu wrapper script or it would complain about various tty ailments whenever it finished running an app.  Weirdness.

Next I attempted to link gmenu2x without libstdc++ according to these instructions.   But gmenu2x uses STL strings, dynamic casts, and more from libstdc++ so the best I could do was skip exceptions and static link with libstdc++.a.  The shared lib is about 800k stripped, and would would use about 300K compressed on the jffs, so I managed to squeeze a little bit out of it.  I recently discovered the jffs seems to garbage collect on boot up, which means I may have a reliable way to compare the space usage.  So I'll probably try to install the full lib someday to see exactly how much I saved.  Actually, I suspect I'll hold off on that until I find another C++ program that I just gotta have...

I also tried static linking libfreetype, but that didn't save anything.  A stripped libfreetype is 400K, or about 200K compressed on the jffs, so I bit the bullet and stuck it on there.  This meant I could also toss in the dgclock program for only 20K if could trick it to use the same font as gmenu2x.  So I moved the /mnt/ffs/gmenu2x/skins/Default/font.ttf file to /mnt/share/fonts/font.ttf and replaced it in it's original location with a soft link.  Then I soft linked the mplus-2p-medium.ttf file used by dgclock to font.ttf and voila!  The dgclock works.  The gmenu2x font file is fairly compact but I can barely tell the difference in the dgclock program.  It might have slightly narrower glyphs.  Maybe it'll be good enough for a few more small SDL-ttf programs.
This fit onto the zipit, but just barely, so I swapped out the wpa-supplicant and wpa-passphrase for my cut down versions.  The ones from the V1 firmware (and IZ2S) are fairly large, and the ancient wpa-supplicant was having troubles connecting reliably to WPA2 routers anyhow.  The new smaller version actually seems to work better.  This got me to about 700K free on the jffs.  That's enough room for some more small goodies.

While working with dgclock, I noticed the zipit appeared to be stuck in a different timezone (somewhere in europe?) instead of EST5EDT.  I'm not sure what caused it, but eventually I deleted the /mnt/ffs/TZ file and rebooted.  The timezone setting script popped up.  I entered EST5EDT, and it recovered.  Then I realized I was off by an hour because the 2007 daylight savings rules weren't incorporated into the iz2s uclibc.  Fortunately Dom pointed out the uclib TimeZone fix for the US 2007 daylight savings change in one of the comments here.    Down at the bottom it mentions the magic EST5EDT,M3.2.0,M11.1.0 setting for the /mnt/ffs/TZ file.  EST5EDT,M3.2.0,M11.1.0 is US Eastern Time with Daylight Savings Time starting on the 3rd month (March), 2nd week, day 0 (Sunday) and continuing until the 11th month (November), 1st week, day 0 (Sunday).

Here's a combo jffs image containing the base, gmu and gmenu2x packages to make it an easier install for newbs.  Note:  I said "easier", not "easy".

gmu-gmenu2x-jffs.tgz   Here's the install instructions.

And apparently the Goodie Bag was offline for a while.  Sorry.  I think I'll try and mirror it...


  1. I got the same trial ! I gave Z2s to 2 kids, to an old retired person,
    and to a friend who doesn't even know windows. Sure that there was no way
    with the command line! And they did not understand retawq...So I upxed
    the staticly linked rayhaque's link2 fb, and wrote a script menu.
    I might remove dropbear, but all in all it fits with rockbox.
    You can find my french beta at
    I'm sure you could have it done much better than me, but I think it's
    not so bad with only two years studying linux in my spare time.
    Next step, I will replace alsamixer and amixer by rexima.
    If you want to add a Goodie Bag Mirror to your Favorite Toys,
    send me a mail, you are welcome at

    1. I followed the README and assembled the french beta with a smaller (partly static) sdl build of links to save a few hundred K. With the extra space I kept dropbear, the small wpa_passphrase, and the rockbox english file. I also added an english version of the menu for me to play with. This should install with the same instructions as the gmu-gmenu2x file above.

      I have to admit, I don't really like the autorepeat kbd. I also think some of the wifi examples files are missing, so i used setup-net to connect and test the slimmer links executable. It could also use a rockbox
      config file with the theme and font preselected.

      But it's a good mix of software for the jffs. Plus you'll have over 400K free on the jffs if you replace alsamixer with rexima. That's more than enough space for internet radio via mpg123, or some other medium sized app.

  2. Nice. I really wanted to try glinks, but didn't think there was any way it would fit. It probably makes sense to remove dropbear. Then you can possibly get internet radio with the static upxed mpg123 and a small script for a handful of preset stations. I'll definitely try your beta when I get a chance.

    I'll send you an email about the Goodie Bag. I think another mirror might be a good idea.

  3. Hi, congratulations for your blog! is one of the most updated. Had a lot of info and I don't know from where to start... I'm waiting for my Zipit Z2 to come, could you tell me how to start? I see you have lot of modifications and addins but don't understand how to start from scratch. Sorry for be so noob.

    Best regards from Argentina.

  4. The first comment by Dom has a link to a zip file. If you unzip it there is a README file that tells you how to replace the stock zipit app on the jffs with his custom system. You need to get IZ2S onto a mini SD card. Then unzip Dom's file onto the root of the SD card. Insert it into the zipit and boot. Then follow the README. (instead of "tar" I think you can use "/mnt/sd0/busybox tar" uncompress the .bz2 files.

    When you're finished you should have a really nice menu driven system on the internal flash. The menu is in french, but the choices look easy to follow. I'm excited about the options for saving multiple wifi profiles because I was about to write that code myself, and now I don't have to.

    If you want more, there are a few other configurations that fit in the internal jffs. Or you can add programs from the goodie bag to the IZ2s on the SD card. Or if you're an advanced user you can visit mozzwald's site and have the latest bleeding edge software.

    1. Thank you for your answer! will download the files and read the README waiting for the arrive of my Z2 =)