New Arch Linux image for the Zipit Z2
With all the recent activity
around the Z2, I thought it might be worth it to create an up to date Arch Linux image for the Z2. Although it is theoretically possible to update my old image
, it is quite some pain to actually do so.
So what I did is take an official system image for an ARMv5 plattform from the ArchLinuxARM website
and modify it to work with the Z2.
The most important thing is to replace the kernel with a kernel built for the Z2. I have built a 3.13.0 mainline kernel. I have not patched the kernel in any way. If you are interested in the kernel's config, check out /proc/config.gz.
Other than that, I changed only a few other things, like adding a few systemd services to configure Z2 specific stuff like keyboard layout and LEDs.
Here is the download:
archlinuxarm-zipit-z2-wej-20140124.tar.xz (101 MB)
Simply extract the image (as root) onto an ext2 formatted miniSD card. It should then boot on any Z2 with u-boot installed. It takes about 330 MB on the card.
There is only the default root user with 'root' as its password. I have installed only a few additional packages to be able to use WiFi (wpa_supplicant, etc.).
I have enabled some zram swap, which allows me to use pacman for most smaller packages. The only thing that required a lot more RAM was a glibc update. It wasn't the glibc update itself, that needed that much RAM, but the regeneration of the installed locales. If you need more RAM for things like that, you might enable additional swap on the SD card. Beware though, that it is really slow and that it can shorten the SD card's life considerably.
That's it. Have fun with the image and feel free to leave a comment if you like it or if you have a question about it.
UPDATE: By default the system's root file system is mounted read-only. If you want to have it mounted read/write on boot, edit /etc/fstab and add the following line:
/dev/mmcblk0p1 / ext2 rw,noatime 0 0
Thanks for the image. I have tested and it works very well. I updated the system and after reboot the wireless card produced a panic with something related with the firmware. The problem was that after the update the firmware was missing because it is a non-free. I copied the firmwares that were in the original image and now everything is ok.
The systemd tries to mount the microsd as ext4, I think that a good idea would be to have a ext2 partition with boot and the root in another partition with ext4.
The screen when is idle some minutes it turns white instead of black or dark.
The halt process works but does not turn off the zipit. I don't know if this is normal because of u-boot or the zipit, or it is something related with systemd.
I have a swap partition that I use when the pacman run out of memory. The zram priority is -1 and the swap -2. Maybe the zram should have a bigger priority than the swap in the micro-sd card, I have to try.
I have not installed any X-windows programs. Only screen and alpine (re-alpine) to use google's imap. It works without problems only I have problems with the ca-certificates, but not any problem with the ram.
It is really nice to have a complete distribution for this small computer. Archlinux is very fast and pacman doesn't need too much resources, for example Debian apt need more memory. The problem that I see, is that archlinux has not stable releases, so you have to update frequently and with 32M of ram the process is slow and you need swap that can damage your card. Also in these hardware without official support every update can come with new problems.
If the kernel can be compiled without patch, it can be used for other distributions. A good candidate could be Slackware. They have a miniroot ready for unsuported arm devices. This distribution have not systemd and they have stable releases. The package manager was not so ram hungry but I have been long time from the last time I used it. http://arm.slackware.com/installation/
antonio: Thanks for your feedback. The issue with the screen turning all white when idle and not being able to turn the Z2 off is due to a few bits and pieces missing in the mainline kernel. anarsoul maintins his own Z2 kernel and has recently updated his tree to 3.13. Here is a pre-compiled kernel: https://www.dropbox.com/s/l630peo8uxqplne/z2-kernel-3.13.0.tar.gz .
The source can be found on github: https://github.com/anarsoul/linux-2.6/tree/v3.13-anarsoul-wip-v2
You can replace the kernel with that one. That fixes the display issue (will then turn off the backlight when idling for a while) and the power-off issue.
It is true that the rolling release style of Arch can sometimes be problematic. It is well worth it to try ARM Slackware on the Z2. It will probably work fine and it should be even less resource-hungry than Arch. Maybe I'll give it a try. :)
The Slackware rootfs just works. I have added your archlinux kernel with the modules and the firmware. You only have to modify the fstab. The keyboard works but not the alt keys. You have to add the keyboard.map. I have put it in the root directory and with loadkeys I have the keyboard.
For the wireless there is not a nice tool like in archlinux, but you can edit it previously.
If you are familiarized with Slackware (not my case), this image it is ready to use.
Everything seems to work, except there's an update available for the package "linux-firmware-20140316.dec41bc-1" which is 64mb, and pacman runs out of memory every time I try to update it. What should I do?
David N.: You could temporarily enable some swap on the sd card. It will be slow but should allow you to update the package. You do not need to create a swap partition. A swap file will be fine. You can create an empty file with "dd", then run "mkswap" on the empty file and then run "swapon" on the file.
wej: How much do you recommend? I tried doing the update with a 1MB swapfile and it still failed.
10MB was enough. The upgrade went smoothly. I'm still working out a few bugs (i.e. screensaver is white instead of black), but overall I'm very impressed. I'm glad to see the Zipit hasn't been forgotten.
Any idea if ALARM could be installed to internal memory (/dev/mtdblock*)? I don't have enough Mini-SD adapters.
David N.: For the white screen issue, please read the comments above. It is a kernel issue, which can easily be fixed by replacing it with the one I mention above.
If you have some problems with audio, i think it is due to a "bug" in jackd2.
It is because for ARM BogoMips are no longer written in /proc/cpuinfo, so Jackd2 fails to start.
Solutions found in Google suggests to install from latest source.
I'm posting just to let everyone know =)
I first saw the Zipit Z2 in the October 2014 issue of Linux Journal. I was able to order one from Amazon. I am looking forward to playing around with your customized Arch Linux. Thank you so much for all of your hard work on it!
Now that I have my Zipit Z2 ... how do I install u-boot? (I downloaded the u-boot file, but couldn't find any instrctions for installing it.)
Nevermind ... I found instructions here: http://www.notanon.com/zipit/upgrading-the-zipit-z2-from-blob-to-u-boot/2010/06/28/
Is there a new location for the patched kernel? The dropbox link is dead now. Thanks
Eric: I'll try to find the kernel archive and then put it on my server and post a link here.
I couldn't find a copy of the kernel I have linked above and I currently do not have the time to build a new one, but Mozzwald has built a 3.17 kernel that should work fine with Arch: https://mozzwald.com/zipit/kernel/z2_3.17.0_20150223.tar.bz2
The kernel above works fine, but won't display any messages during boot.
Nathan: That's probably due to the kernel's default configuration. My guess would be that it is configured to output the messages on the serial port instead of the display. It should be possible to adjust that through the uboot configuration.
Wej, I can't get Mozzwald's 3.17 kernel to work with your archLinux image. The kernel boots but is not able to find init,
I changed the uboot.script to use tty0 as the console and removed splash=silent quiet from the bootargs. Now I can see the error message: No working init found. I tried to add init=/usr/bin/init to the bootargs but this didn't help.
The kernel and the uboot script included in your image work fine though.
Nathan, have you used the same image with Mozzwald's 3.17 kernel?
Ok, I figured it out. I was extracting Mozzwald's kernel to the root of my card. This overwrote the /lib symlink and put the modules inside /lib/modules.
I moved /lib/modules/3.17.0+ /usr/lib/modules and created a new symlink /lib --> /usr/lib. I am not able to boot with the new kernel.
Hope this helps someone else! And thanks wej for your efforts with the Zipit!
correction. I am now* able...
I finally found some time to play with the archLinux image. It's a bit bloated compared to Openwrt, but package selection is broader, so I can see the appeal. Full system upgrade seems to have worked with a 64MB swap file. Make and gcc are also working well enough with the swap. I installed the SDL package (without it's depends) and it runs on fbcon with the ENV vars set. So I compiled gmu with mp3 support right on the zipit. Gmu uses about 60% cpu playing internet radio at 208MHz, but no skips. I like it.
deeice: That's neat! :)
Sure, Arch is a little bloated for the Z2 and pretty much on the edge when it comes to memory usage on the Z2, but at least with swap it is pretty usable.
Using zram based swap in combination with disk based swap can speed things up a bit when giving the zram based swap priority over the disk based one.
I followed your instructions but unfortunately it doesn't load from the sd card. I have previously installed openwrt on my Z2, using z2uFlashstock v0.3 and I suspect that the uboot skips the sd card and goes straight into loading openwrt from the internal memory. Do you have any idea how I could solve this?
splugi: If you can't not from any SD card, it might be a uboot problem. There are different versions of uboot for the Z2 with different configurations out there. So there might be one that is configured to boot only from the internal flash by default.
I'd say a more likely reason for the boot problem could be an incompatibility of the Z2 with the partciular SD card. The Z2 is quite picky when it comes to SD cards. Usually cards with 2 GB or lower are the most reliable. If possible, try with another card.