Friday, December 30, 2011

Christmas Special

Sometime around Christmas rkdavis mentioned something about loading sdlBasic on the stock zipit jffs instead of rockbox.  Since I eventually want gmu on a zipit to be used as a dedicated internet radio, I figured maybe it was a good time to start separating the base jffs goodies from the rockbox stuff.

I also wanted to tinker with the wifi setup scripts.  I really like the easy dialog based EWoC wifi script included in later IZ2S releases, but I don't want to waste 200K of the jffs on the dialog executable.  So I dug deep into the dark old corners of the internet to review what could be done with ANSI escape sequences instead.  I found some really promising stuff and a related book that I'm gonna buy.  
But it proved difficult getting things to work well with the builtin echo command from the stock busybox sh.  And running ANSI escape codes with the external echo or printf commands from the IZ2S replacement busybox was just horribly slow.  So this is all I've got so far:  The previous SSID used shows up in green!  Not pretty, and my horrible photo skills don't help much either, but at least it's a marginal improvement.
Follow the directions from the previous blog post to install the smaller base system.  Then add whatever you want:  sdlBasic, busybox, tinyirc, or anything else that fits... (Hmm, it looks like you'll need to add either the full sed from the original package, or add busybox for its sed, otherwise the wifi scripts won't work.)

iz2jffs-base.tar.bz2

Anyhow, I trimmed down the old sdlBasic to something that I think will fit in the jffs on top of the base system.  I actually had to rebuild the executable because the previous build was pulling in libstdc++ due to my lame makefile.  That would have been 3 megabytes of completely wasted space on the jffs.  With libstdc++ out of the picture, I got all the libs needed for the sdlBasic runtime collected together.  I removed the docs and included only the Beast and Sokoban demos to save space.   Here's a nice blurry pic of me beating up on Sokoban level 1 to convince you that you absolutely must have it.
I personally don't want to mess up the jffs right now on my zipit by replacing rockbox with sdlBasic, so if anyone else tries it be sure to let me know how well (or not) it fits.

sdlbasic-iz2jffs.zip

Meanwhile, on the complete opposite end of the spectrum from this tiny stuff, I finally put up a download link for the Emacs I built for IZ2S way back when.  It's so handy, I feel compelled to share it.

Saturday, December 17, 2011

More Small Thinking

Well, I managed to squeeze an extremely stripped down copy of IZ2S onto the jffs of a stock zipit, with rockbox, dropbearmulti, and the retawq web browser.  This means you can boot the zipit with no SD card and get on the internet in a pinch (kinda, sorta).  As you can see in this (somewhat blurry) picture of retawq browsing this very blog, with nothing in the miniSD slot.

But the main purpose is to be able to run rockbox from the jffs so you can swap SD cards with different music on them at runtime.

To make things fit I stripped and upxed all the executables.  The jffs does it's own compression, but upx compression is slightly better.  I also removed just about everything I could - fonts, languages, themes, plugins, libs.  You name it, it's gone.  There's about 800K left on the jffs if you find something missing that you just can't live without.  I made softlinks for the rockbox plugins directories, so you can play them off the SD card if you really want to.  Static linked executables from IZ2S can also run off the SD card, although if you want that, you should probably just boot into IZ2S itself.

One little gotcha trying to put this together was the IZ2S tar program.  I couldn't get it to *create* an archive.  Only untar seems to work.  So I had to relearn cpio to get test builds off the jffs with my softlilnks intact.  I haven't used cpio in like 30 years...

Anyhow, here's how to install.  Put iz2jffs.tar.bz2 on an IZ2S SD card and boot it up.  Then you want to delete just about everything on /mnt/ffs except the start.sh script, the wpa_supplicant directory with the wifi drivers, and the properties.txt file with your MAC address.  After that you can unzip the new stuff, power down the zipit, and boot it up without the SD card.

cd /mnt/ffs

rm Zcovery
rm Zipit2
rm *.xml
rm *.arl

tar -xjpvf /mnt/sd0/iz2jffs.tar.bz2

The SD card (with all your music) shows up in Rockbox as Files/share/sd0.

iz2jffs.tar.bz2

Update:  I've been fiddling with the busybox from iz2s enhanced because it has so many goodies.  It's almost 600K upxed, but it may be worth it since you can get 100K back by replacing the full sed and netcat utilities in /mnt/ffs/bin.  I've also compiled and upxed tinyirc (37K) and I'm still trying to decide if the upxed dialog utility is worth it for the wifi script at 150K.  Here's a zip with these if anyone else wants to play.

iz2jffs-extras.zip

Thursday, December 15, 2011

Blank Slate

I've sorta lost momentum lately on the nano-x/fltk and sdlbasic projects, so I decided to spice things up a bit and take some risks mucking around with the internal flash on the zipit.  I had a zipit floating around that was loaded up with an older uboot and kernel from my earliest rockbox experiments on the wejp and z2lite userlands.  I thought it might be nice to replace all that with Mozzwald's spiffy looking OpenWrt rescue image.  So I booted it up in z2lite and ran his new uflasher script.  Not good.  Instead of the latest uboot and OpenWrt I get a blank white screen.  Probably shoulda booted z2sid instead of z2lite and flashed from there.  Oh well.  Live and learn.

Or maybe not.  I also had some unopened zipits with virgin stock in flash, just begging to be ruined as well.  Eh, why not...  I cracked one open, booted it up in IZ2S, and started tinkering with the stock files in /mnt/ffs.  It had no Zcovery app, just the start.sh script, the Zipit2 app, some wifi stuff and data files.  So I deleted the data files, replaced Zipit2 with an empty script file, and slightly modified the start.sh script to launch Z2covery (like it does in the updated stock filesystem you get after the virgin zipit phones home).  Then I created a modified version of the IZ2S Z2script.sh to work in /mnt/ffs on the internal flash instead of /mnt/sd0 on the SD card and saved that script as /mnt/ffs/Zcovery.  I also added dropbearmulti, the IZ2S power demons, and the fbcon drivers to /mnt/ffs.  Finally I booted it up without an SD card to see how much room I'd have leftover for a dedicated gmu internet radio (or rockbox) device running on the internal flash instead of the SD card.

Not bad.  Nearly 4 MB of the internal jffs is still available.  I think I can work with that.  Plus, the SD card automounts so I can use that to load different music, apps, or rockbox plugins on the fly at runtime, from a FAT formatted card.  Sweet!

Hopefully I can load this on virgin zipits to avoid the dreaded "Stock App of Doom" where the fresh from the box zipit gets permanently stuck in an infinite phone home and update loop.  I'm especially concerned about what happens when the update servers eventually go silent at zipitwireless.com.  Or have they already?