Getting started with pre-release Angstrom on Collie (Zaurus SL-5500)
This page very briefly describes the steps I took to get Angstrom working on my SL-5500 Collie Zaurus. Angstrom has not reached release status yet, so this is not something for the faint-hearted. It's likely to be a pretty bumpy ride. Just for starters - yes, this is using a 2.6 kernel, on the Collie, which we all thought would be forever impossible since Sharp could not / would not release the source or specs for the SD controller in this device. Thankfully, some clever beans managed to reverse engineer the driver and then create a clean-room implementation of an open source driver, which means we have working SD support for collie with an open driver, on 2.6+ kernels - Yay!
This page has evolved from two earlier pages which dealt specifically with OpenZaurus. I also ran 3.5.4 for a while but never got around to doing a page specifically for that version:
Angstrom Collie pre-release images are posted at http://www.angstrom-distribution.org/unstable/images/collie/ . Releases are named according to the date that the build was done.
Because the Collie has limited storage, you can't fit a full GUI environment in the flash. So we'll have to install a basic console image into flash, and use altboot to pivot to an image on SD or CF storage. These instructions are all about using SD, as I need to keep the CF slot free for Wifi and Bluetooth.
Not as easy as you'd hope..
The image 20070709 (and later ones to come too, possibly) contain kernel 2.6.21, which as at this time (30/09/2007) still contains a problem with some SD cards which causes a kernel oops on SD card insertion. Until this is fixed, the only way to get SD support working is with an older kernel. What I've done is used the most recent root image, but with an older kernel and modules to get SD working. Here's what we need:
- 20070709/zImage-2.6.21-collie-20070710163105.bin - we'll flash this kernel initially so that we can get the system up enough to replace the modules to suit the older kernel that we'll flash later. It will be named "zImage" on the CF card for flashing.
- 20070709/console-image-collie.jffs2 - this is the root filesystem, it will be put on the CF card as "initrd.bin"
- 20070703/zImage-2.6.20-collie-20070620221652.bin - a slightly older kernel that works with SD.
- 20070703/modules-22.214.171.124-collie.tgz - the modules for this kernel image
Standard process for flashing applies (reset-C-D etc). I suggest you use the md5sum tool to make sure that the files you copy on to your CF card arrive intact. Using corrupt image files is both common and disastrous.
First we will flash the latest kernel and rootfs, then replace the modules in the rootfs with the modules for the older kernel, then we will flash the older kernel.
- Copy zImage-2.6.21-collie-20070710163105.bin onto your CF card as "zImage" (case won't matter if it's a FAT card)
- Copy console-image-collie.jffs2 onto your CF card as "initrd.bin"
- Use md5sum to make sure the files were downloaded and copied intact
- Insert the CF card into your Zaurus
- Make sure your Z is plugged into power
- While holding the C and D keys down, press the Reset button (under the battery cover) and release all
- Mail and Charge lights should both come on steady, and stay on for a minute or two
- When the lights go out, press reset, replace the battery cover and power on
Prepare for kernel downgrade
- Once it's booted, you should get a login or command prompt (just login as root, no password)
- Take your CF card back to your PC
- Delete the zImage and initrd.bin files from the CF card
- Copy zImage-2.6.20-collie-20070620221652.bin to the CF card as "zImage"
- Copy modules-126.96.36.199-collie.tgz to the CF card as "modules.tgz"
- Put the CF card back in your zaurus, I think it mounts automatically
- Check that you have the CF card mounted and can view it's contents on the zaurus before proceeding
- Scary bit - remove the old modules so that we'll have space for the new ones. Note that after doing this your system will be pretty much broken until you get the new modules on and the new kernel flashed. "rm -rf /lib/modules/2.6.*"
- "cd /"
- Now unpack the new modules "tar xvzf /media/cf/modules.tgz". You should see the contents fly by on the screen as it unpacks the new modules.
- Verify they went where they should "ls /lib/modules/188.8.131.52/"
- You are now ready to flash the new (older) kernel
Flash the older kernel
Since we already have the old kernel on the CF card as zImage, just go through the normal flash steps - C-D-Reset. It should take less time because we are only flashing the kernel (about 1mb) and not the entire rootfs (around 14mb). Once done, your system should boot up to a login prompt where you can login as root.
Getting Altboot to work with SD
Altboot knows about the kernel needing specific module support for SD cards, but there seems to be an issue with it not loading all the required modules even after you configure it. My guess is that because it uses insmod it doesn't load all the dependent modules correctly, or maybe there are other services that normally run after altboot that get things working properly. At any rate, what worked for me was adding this to /etc/altboot.func, just before the section where it tries to load the SD module and mount the card:
I don't know if the sleep is actually necessary, I added it while testing thinking things might need time to settle before mounting and haven't yet tried without it.
Save the file and reboot. You should now be able to get altboot to try mounting your SD card. Just press a key to enter altboot, and select 3, boot from sd card. It should attempt to mount the card. If you get errors here about not being able to mount it then re-examine altboot.func to make sure your changes were correct. Also check the output of "lsmod | grep mmc\|spi" to see if the three modules above (and others, like mmc_core) have loaded.
Assuming it mounted ok, you should be good to go with either booting an image you already had on the SD card, or now setting up a rootfs to boot from on your SD card.
Now is a good time to get your device loading the touch screen driver on boot, since you're gonna want that to work later on. Create a file at /etc/modutils/touch with a single line in it: "ucb1x00_ts" (without the quotes). Then run update-modules, and check that the ucb1x00_ts line now appears in /etc/modules.
Make a new SD RootFS
My preference is to have root filesystems as images on the SD card, rather than using the whole card as one root filesystem. This means you can try out new releases etc as easily as copying a new file onto the SD card, and selecting it at boot with altboot, rather than having to use a separate SD card.
We'll build the new rootfs on the PC first, then we'll copy the finished article over to the SD card.
Download the tarball for the image
Angstrom devs are releasing tarballs as well as jffs2 images, which makes this really easy. As of this writing, the latest full image is 20070709/Angstrom-x11-image-glibc-test-20070711-collie.rootfs.tar.gz but it's worth checking http://www.angstrom-distribution.org/unstable/images/collie/ for the latest.
Create your new image and populate it
dd if=/dev/zero of=base.img bs=1M count=256
losetup /dev/loop0 base.img
mount -t ext2 /dev/loop0 base
tar xvzf ../Angstrom-x11-image-glibc-test-20070711-collie.rootfs.tar.gz
See what we did there?
- the count parameter of the dd command decides how big our image will be (in MB). I chose 256MB.
- We then created a filesystem on the resulting "base.img" file, and mounted it.
- Then we unpacked the downloaded image into the mounted filesystem, unmounted it, and just for paranoia's sake, sync'd to make sure everything had finished writing to disk.
You can now copy that base.img file to your SD card. For altboot to recognise it, you must put in on the SD card under a directory named "boot-images", and the file must be named with -rootfs.bin at the end. eg: "cp base.img /mnt/card/boot-images/angbase-rootfs.bin"
Now when you boot your Z and tell altboot to use the SD card, it will present you a menu with a list of images found in boot-images. Now you're up an running with a full Angstrom image, booting from SD card on a 2.6 kernel on Collie. Life is sweet.