Saturday, December 05, 2009

Version 2.03 IZ2S Release - SOUND and SHARED LIBRARIES!

I am probably more excited about this release than any other, because it has opened up the possibilities for some things that just weren't possible before. We now have the ability to run applications using shared libraries. And the first application I decided to port over was "cmus". Cmus is a "small and fast text mode music player" which runs in a console. It's been built to support wav's, mp3's, and even vorbis ogg files. And best of all, it can play streams (that means streaming radio!).

This represents a lot of work on the part of myself, and my friends from #zipit on irc.freenode.net. GPSFan was nice enough to share some of his dark secrets with me pertaining to buildroot and ALSA. From there I was able to get the ALSA-utils built, and then rebuilt statically.

You can download version v2.03 here: http://www.oddree.com/zipit/Z2S-v203.zip

Here is a quick video demonstration of the new feature(s):


As always - here is the README file which is also included in the Zip file.

IZS - The "Improved Z2 Shell" (aka Shell with Benefits) v2.03

ABOUT
This collection was built by Ray Dios Haque out of sheer necessity. I wanted something that I could play with that would not effect the stock software that comes on the Z2. The easiest way to do that was to take the Z2 Shell that was built by rossimo from Zipit Wireless and expand upon it. I take no credit for the work of the Zipit community. If I don't claim to have built it - it's because I didn't. Thanks to all of you for your contributions over the years. I hope you enjoy my additions!

INSTALL (borrowed from the original README)
Format your SD card as a FAT or a FAT16 file system. Copy everything from this zip file onto the root of the card (preserving all paths/directories). Insert your SD card into the Zipit and boot it up. Note that you can only boot this image if you are running the Stock OS that came with your Zipit. If you have installed OpenEmbedded or Debian, then you have probably replaced the stock operating system which included a routine to look for the z2script.sh script. For legal purposes, I cannot provide you this stock operating system. Some of the smarter people in the Zipit community might be able to help you restore this OS (see CHAT below).

CHAT
Come chat with us! There is a thriving (?) community of the worlds best Zipit hackers who hang out in #zipit on irc.freenode.net. You can fire up 'irc' from this very image and come hang out.

CHANGES/ADDITIONS
RELEASE 2.03 (ALL NEW!) - December 2009
We have sound!! Thanks GPSFan! (alsaconf, alsamixer, alsactl, amidi, aplay, gawk, getopt, iecset), SHARED Library support (ldd, ldconfig, readelf), cmus (a wicked MP3 Player), matrix (ncmatrix), mpg123, mplayer-10rc2, ntpdate, gzip (gzip, gunzip, gzexe, zcat, zcmp, zdiff, zegrep, zforce, zless, zmore, znew), zz (script to run after ssh'ing in - use . zz (dot space zz))

RELEASE 2.02 - November 2009
cls (clear screen), centerim (ncurses instant messenger with AIM, Yahoo, ICQ support), irssi (ncurses irc client), links (ncurses), links2 (graphical browser!), sed (for scripting), tar, bzip2 (bzip2, bz2recover), coreutils (10MB's of binaries)

RELEASE 2.01 - Initial Release
wget, ircii-20090520 (irc), wireless-tools (ifrename, iwconfig, iwevent, iwgetid, iwlist, iwpriv, iwspy), ftp (ftp, /etc/services), unzip (unzipsfx, unzip, funzip), nmap (nmap, *new* ncat), wpa_passphrase, less (lessecho, lesskey), grep

LIBS CHANGES
Removed the worthless ncurses static libs to make way for all of the *shared* libs. Not listing all of them here. Just look for yourself.

STARTUP SCRIPT MODIFICATION(S)
REV 2.03
- Stopped audio_pxa from loading, and then run /mnt/sd0/modules/alsa/loadsound.sh for ALSA sound modules.
- Added ntp protocol to /etc/services file.
- Added a line which will fix the time and date if there is a network connection available, and then display that time/date to you.
- From here on out, all libs will go into /mnt/sd0/lib which will be linked to both /lib and /usr/lib/.
- Hid all the gory details of wpa_supplicant, while adding some other stuff for verbosity.
REV 2.02
- Modified the PATH statement so that coreutils and /mnt/sd0/bin binaries will override the busybox stuff.
- Created a home directory for the root user which exists on the SD card. It holds your stuff.
- Added a routine that change your MAC address to something random the first time you boot up. This should prevent duplicate MAC problems if you own multiple Z2 devices.
- Added a /var directory that exists on your SD card. Some things (like dropbear) expect to find it. Had to fix a script error in the BETA (thanks rkdavis).
- Added an /etc/issue file which is displayed at logon time and to ssh connections.
REV 2.01
- Added a routine asking if you would like to configure your wireless card. This was not possible before as there was no scanning routine and the image lacked the wpa_passphrase utility. You can now scan for and configure your wireless settings entirely from the zipit (wording updated in 2.02).
- Added "cp /mnt/sd0/etc/services /etc/services" which gives the ftp command the port numbers it needs to function.
- Added "cp -R /mnt/sd0/etc/terminfo /etc", "export TERM=vt102", "export TERMINFO=/etc/terminfo" to help irc understand the screen layout.
- Added "ln -s /mnt/sd0/lib/* /lib" to make ncurses libraries usable, and any future libraries that you or I might add.
- Added "ln -s /mnt/sd0/share /share" for nmap and anything else that might require a "share" directory to be present to function.

OTHER MODIFICATION(S)
- Replaced the stock keyboard driver in /modules with one that was created by GPSFan (Ken) from the Zipit Yahoo Group. This removed all of the problems with keys not working, or repeating while typing. The original drivers remain, but have been renamed to *.orig.

COMING SOON?
- A better mp3player or a front-end for mpg123.
- A script to download and install "packages" (zip files) using wget, unzip, and a "binary repository" on www.oddree.com. A similar system could provide updates when I provide them.
- I still want to get an image viewer working. DFBSee 'almost' works.

IFAQ (InFrequently Asked Questions)
Q. Why are you wasting your time on this? The Z2 Shell is dead!
A. It may be 10x more work to get simple things built for it - the Z2 is very lean, and still very useful.

Q. Why does nmap (or some other binary) run so slow?
A. Because everything has to be built "static" to run on the Z2. That means that where you might normally have hundreds of shared libraries on a linux machine, the Z2 Shell must embed the libraries into each running binary. It makes for some bloated inefficient stuff. But, it works. If you want a better system - start writing it! Otherwise, try to limit the actions of what you are doing. For instance, use an address range or port range with nmap. Don't start long running scans on entire networks. This is a Z2 we're talking about. The resources are pretty lean.

Q. How can I add my own binary/package?
A. There are several ways to go about this. The method I have used to compile everything is "scratchbox". Scratchbox is a program which let's you cross-compile applications. That means that you can build stuff for an ARM platform, even though you have a regular x86 machine. It can be tricky and complicated. Try reading up on what I have posted at http://www.oddree.com.

Q. Why did you *insert snarky comment here*?
A. If you find that I did something stupid and inefficient, do let me know. I don't claim to have any expertise in the area of building software. If you have some suggestions on how to improve things or would like to help with the next release of this improved Z2 Shell, email me at ray@oddree.com. I would love to collaborate with some folks who might be more talented than myself.

Q. Will you build *insert package name here* for me?
A. Probably. Unless you are asking me to build something that has an endless list of dependencies. In which case I will probably tell you to install OpenEmbedded or full fledged Debian. They all ready have all of these packages. I am only expanding upon the old Z2 Shell because I find it lean and useful.


Happy hacking! Next release ... keyboard backlight support? It's hard to chat in the dark. :-( I am seeking help from the Z2-Zen master, aliosa27 for that project.

6 comments:

  1. Excellent work. I was starting to expand on z2shell myself as i didn't much like angstrom or debian. I stumbled across this page searching for 'irssi static arm binary' for building tips. I just never had much time since my desktop is set to build for mipsel for a different project i'm doing. (distro/packages for those cheap 400mhz mips netbooks)

    So i have a few idea's/tips if you're willing to include them down the road sometime. First i have a static binary of 'bash' and i made a .bashrc so it displays color for 'ls' etc etc. Also i made a html.cfg for links2 that makes the images display 50% scale and drops the font to 12. Now pages look and fit better on the 320x240 screen. You can grab them here:
    http://www.hostwork.com/users/matt/zipitz2/

    Since in your FAQ it said we could request software i have a few ideas. Nano editor and midnight commander file manager are 'must haves'. Those would practically complete your 2.03 release for me.

    The built in busybox seems to be missing the 'hostname' function which is a shame because when using bash the hostname shows as (none). Maybe rebuild busybox and rename it busyboxz2 for use of other missing functions like hostname.

    As for your image viewer problem.... Just use links2. Start it with 'file:///' and it becomes a file browser that can read txt/html and show images.

    Again, great work.
    wicknix

    ReplyDelete
  2. Hey wicknix,

    These are some really awesome additions you have come up with. At one point I had tried to get bash built but I had run into some sort of issue with it. I will gladly include your bash in the next release (with credit due to you, of course).

    I will also happily use your links2 cfg file. That really makes the browser more usable!

    As for busybox, I approached it some point to rebuild it to my liking. But the list of questions to configure it went on for miles and I chickened out. I instead opted to build the core-utils package. But ... still no hostname. I will look to fix that in the next release.

    Per your suggestion, I have built nano and midnight commander. I will include them in the next release as well. But since you requested them I will give you an early start on testing them out. ;-)

    I was able to build nano as a single binary: http://oddree.com/zipit/nano

    mc had to be built dynamic, since it uses glib2 (the GNOME folks don't want a static glib). Also - I didn't do anything yet to fix the key-bindings. So everything is controlled by F1-F10 keys, which we don't have. But anyway ... you can get a package from here: http://oddree.com/zipit/mc-zipitz2.zip

    Thanks for dropping by. Come chat to us in #zipit on irc.freenode.net some time!

    -Ray

    ReplyDelete
  3. Hey Ray, Awesome! I uploaded busybox and a txt file showing what's all built into it. :)

    Hostname works great added to the start script now. Nano is a lifesaver. Beats powering off and removing the card every time to edit a file.

    Midnight commander doesn't 'require' the F keys, it can also use ESC + 1 - 0. 1 = F1, 0 = F10, etc etc. However i can't seem to figure out which key is ESC on the z2. If all else fails maybe you could load a different keymap for mc like you did for links2? Say like the smily face button for esc.

    I also thought of some more apps i'd enjoy having (limited time to play or i'd try building them). Mikmod and sidplay to handle .s3m/.xm/.mod/.it/.sit and .sid files (protracker/sountracker and commodore 64 sound file players). Also thought about bplay, a small sound player for .au and .wav that would allow you to enable sounds in centerIM. Last but not least, i'm quite partial to madplay for mp3 playback.

    Also have you thought about MOC (music on console) for your mp3 player? Can't remember if it can handle streaming radio, but it's quite nice and simple to operate.

    Cheers.
    wicknix

    ReplyDelete
  4. Wicknix, this is pretty cool stuff. I am going to work on getting this stuff added and put a new image out. The busybox changes will make the core-utils pack unessesary, so that should free up 9 megs or so from the image.

    MOC had been my first choice in MP3 playing, but I got tangled up in trying to get things built static. Now that we have the shared libraries thing figured out - it should be no sweat to build it.

    It may take me some time to get all this stuff cleaned up and released but I will probably have some idle time here during the holiday.

    Thanks for the contributions! These are really awesome additions.

    -Ray

    ReplyDelete
  5. Hey Ray, found something that might be of interest. It's basically links2 hacked together with elinks to allow css and jscript along with tabbed browsing in console.

    http://xray.sai.msu.ru/~karpov/links-hacked/

    Also snes9x and gnuboy emulators will run in framebuffer if you get froggy.

    Cheers.
    -wicknix

    ReplyDelete
  6. ...Damn. I haven't even gotten my card in the mail yet to try out with the zipit, but I am so impressed with EVERYTHING you have done to not only add a hell of a lot of functionality to the zipit, but also keep the original OS that comes with it in tact as well. Keep up the great work! I'd really like to see that backlight working when trying this stuff out in a future update. I'm rooting for you!

    ReplyDelete