Small Linux system for the Zipit Z2

2010-09-04 11:45
I have created a small Linux system for the Zipit Z2 wireless messenger device. I have created the rootfs from scratch, so it is not based on any of the other System images available for the Z2 (like z2buntu or Debian). It boots up pretty fast and comes with several applications preinstalled including WeeChat (an IRC client), Links (text-based webbrowser), mutt (an e-mail client) and the Gmu music player. I have also included mplayer.

Zipit Z2 running Linux
The system uses uClibc and busybox. It comes with Linux 2.6.36-rc2 (with some additional Z2 patches).

To use this rootfs on your Z2 you need to have the U-Boot bootloader installed.

When U-Boot is installed, all you need to do is write the extracted system image to a SD card (2 GB or larger), then put the card into your Zipit and turn it on. You can use the dd utility to write the image to the SD card that. If you are using a larger SD card you can resize the partition and filesystem later with gparted.

Another way of installing it is to prepare your SD card (any size) with an ext2 file system and extract the rootfs tarball onto it.

You need only one of the two files!

UPDATE: Please use the updated version of the rootfs!

z2-system-wejp-20100905.7z
Size: 16MB, md5sum: ae8f02989cd747e36209ed2732f4292b

z2-system-wejp-20100905.tar.bz2
Size: 20 MB, md5sum: 17d792d69d0e9bc5e4fed71e77d42ddb


To login you can either use the "root" user or the unpriviledged "default" user. Both have their passwords set to "password". You should change the passwords.

The system comes with four virtual terminals enabled, which means you can run multiple applications at the same time and switch between them, e.g. run Gmu to listen to some music while chatting on IRC with WeeChat. To switch to another terminal press CTRL (this is mapped to the "..." button) and Cursor left/right. In case you have started a graphical SDL-based application like Gmu, you can switch back to the text terminal by pressing CTRL+Alt+Home. From there, you can again navigate through your text terminals (and also back to the graphical application) with the CTRL+Cursor left/right buttons.

To run Gmu type gmu on the terminal. To run WeeChat type weechat-curses. Links can be started by typing links.

If you want to use your wireless network, you need to configure wpa_supplicant to connect to it. Just put your network configuration in /etc/wpa.conf and The system will connect to the network next time you boot it up. You can also use the wpa_passphrase utility to create a configuration entry for your /etc/wpa.conf file.

To change the brightness of the display and keyboard backlight, you can use the lcd and keys scripts.

Usage: lcd/keys [brightness]

[brightness] can be "off", "low", "med", "high" or "max".

The whole system would not have been possible with the great work done by the community. Especially all the work that has been done on the Linux kernel and the U-Boot bootloader to support the Zipit Z2 device.

Update: Due to popular demand I have now released the rootfs also as a tarball (bzip2 compressed) containing all the files of the image. You can use that one to write the userland to an SD card of arbitrary size. Aditionally I have updated the image. It is only a minor change that fixes a bug (see comments for details).
 
gimmebottles (web) says:
2010-09-05 14:55:37
hi, i tried your rootfs, looks good, but it spams me with "sending discover". how can i disable that?
wejp (web) says:
2010-09-05 19:10:41
gimmebottles: Unfortunately I discovered this "bug" only right after releasing the rootfs, but it is very simple to solve this issue. The messages are generated by the dhcp client. You can edit the /etc.rc.local file and change the line with udhcpc to end with ">/dev/null &" instead of just "&". That way all messages from udhcpc will be dropped.
These messages do not appear when you are connected to a wireless LAN. That is why I first did not see those messages myself.
I'll release aan updated version of the rootfs in a few minutes, but as it is such a simple fix I would suggest, for all of you who have already downloaded the current version, to just change the line mentioned above.
gimmebottles (web) says:
2010-09-10 22:24:49
another question: would it be possible to upload the source code of gmu for the zipit to built it for z2buntu?
wejp (web) says:
2010-09-11 11:25:28
gimmebottles: Gmu's source code is already available. The version I have included with the roots has some minor changes compared to the current version 0.7.1 of Gmu, but it is still a work in progress. Those changes will be available with the release of Gmu 0.7.2 which I will release soon.
jg (web) says:
2010-09-11 19:10:15
is it possible to install aptitude? would it need to be compiled?
wejp (web) says:
2010-09-13 08:21:17
jg: To use aptitude you would first need to install apt. While installing both should be possible - you would have to compile those things of course - its usefulness is somewhat questionable. Apt alone is not very useful, you would also need a package repository with compatible packages. Besides that apt is also very memory hungry, which means you would most likely have to enable swap. This is not a very good idea on SD cards. It is both slow and reduces the SD card's lifetime considerably.
wifi help (web) says:
2010-09-19 06:04:53
wifi error right after boot

Executing rc.local ...
ioctl[SIOCSIWESSID] No such file or Directory

z2 login :

what should if check. I am not able to connect to wifi after creating a wpa conf file ( I have a WEP conn )
wejp (web) says:
2010-09-19 09:47:43
wifi help: That ioctl message is no problem and can be ignored. Your problem with not being able to connect to the network mus lie somewhere else. While I would strongly suggest not to use WEP at all and switch to WPA or WPA2 as soon as possible, if you really cannot do that, you could try to connect to the network without wpa_supplicant. To connect to WEP and unencrypted networks you can use the iwconfig command, like so:
iwconfig wlan0 essid YourNetworkESSID key YourWEPkey

When you run iwconfig without any parameters you can check wheter you are connected to a network or not.
mr (web) says:
2010-10-01 17:40:15
how did you create this rootfs from scratch

if you could tell me on how to get started on my own that would be great

by the way your rootfs is simple and fast which makes it great.
wejp (web) says:
2010-10-03 12:26:55
mr: I can't explain how building a rootfs works in detail here. Although there are tools available that make it less cumbersome to create one, by automating large parts of the process of compiling the pieces neccessary (e.g. buildroot), you still need some knowledge about how Linux systems work in general and especially how the boot process works, which programs are involved etc.
If you are really interested in building your own rootfs, you should start reading about those things. Linux from scratch ( http://www.linuxfromscratch.org/ ) is a good starting point. It explains lots of things involved in creating an entire Linux system.
mr (web) says:
2010-10-03 14:59:58
Thanks I'll do that
:-)
gimmebottles (web) says:
2010-10-06 08:18:41
hi, i have a question.
in your rootfs you use several terminals which can be switched using STRG+Alt+Home. can you tell how to enable it generally in linux?
wejp (web) says:
2010-10-06 10:14:32
gimmebottles: All this can be done by creating a keymap which maps the buttons to the desired functions. Each button on the Z2 (and on any other ordinary keyboard on other devices) emits a keycode. A keycode is just a number from 1 to 255. A keycode alone doesn't do anything, though. So it has to be mapped to an actual function like 'a' or 'A' or 'F2'. In case of the Z2 I have mapped the Home button to 'F2'. With the Alt button being mapped to the Alt function and the '...' button mapped to CTRL you can use that to switch to virtual terminal 2. Also I have mapped The cursor left/right buttons in combination with CTRL to Decr_Console/Incr_Console. So you can use those to easily switch between those virtual terminals. For my Z2 system the keymap file needs to be converted to a binary format, because Busybox understands the binary format only. This can be done with loadkeys using the -b switch.
Deyna (web) says:
2010-10-09 03:05:55
this has everything i want a game or two for entertainment. how hard would it be to get visual boy advance up and running?
wejp (web) says:
2010-10-10 10:56:30
Probably not that hard. I haven't looked at virtual boy advance, but if it uses SDL, like many emulators do, it should be rather easy to build it. If you want to give it a try yourself, the most important thing when cross-compiling is to make sure to cross-compile against uClibs, not glibc.
jaybear (web) says:
2011-09-17 00:38:20
Hey wejp, I dunno if you recall, but we spoke recently on #zipit at freenode. (I was the guy working on getting alsa working on an openwrt image. I did it, finally) I have a question you may know the answer to. I'm working on gmenu2x for my zipit (from the qi hardware git tree) and it builds and runs fine, and some of the keys work, but most of them do the same things. I've been trying to figure out why, through a few days of tinkering and editing, etc. I read somewhere that SDL emits different keycodes than the actual keyboard. Now, I found a lookup table for SDL keycodes, but obviously they don't match. Since you had done some work with SDL, I was wondering if you knew what the SDL keycodes were, for the most useful keys. I really only need up, down, left, right, the middle floating key in the dpad, options, home, space, backspace, enter, alt, and prev/next. if you know any of them, or where I might find them, Or even have some zipit-specific sdl source I could crawl through to find them, that'd be a huge help and I'd be eternally grateful.
wej (web) says:
2011-09-17 08:53:01
jaybear: Yeah, I remember. :)
For the key codes have a look at the Gmu Zipit package. There is a file called gmuinput.zipit-z2.conf which is basically a mapping of keycodes to human readable button names. You should be able to easily figure out which button has which SDL key code that way.
Up, down, left and right are 273, 274, 276 and 275.
deeice (web) says:
2011-09-21 16:58:17
Jaybear,

For gmenu2x the keymapping is done at runtime by the input.conf file. You can compare mine to the default to see what I tweaked. I mentioned it in this blog post not too long ago.

http://macrofig.blogspot.com/2011/06/gmenu2x-revisited.html

The binary package should have an input.conf file tweaked for the zipit.

steve (web) says:
2011-10-25 00:55:40
Hi quick question--
has anyone noticed that speed is a problem on zipit? When I run mutt on my zipit, it is soo slooow it really can't be used.

Leave a comment

Name
E-Mail
Website
Homepage
Comment