Wednesday, November 28, 2007

Too hard

I have gone around the houses a little with my psion. Building a distribution isn't the easiest thing in the world and here were the approaches I tried and have now rejected. First tho' a quick note to say that I looked at just using the excellent stuff on OpenPsion.org. The trouble is that it uses the unsupported wookie release of Debian. This is a 2.4 kernel, an initrd and a pre-built filesystem using the deb packages with some serious cleaning up. I really could do with a 'supported' distribution because I want to install some packages that the original author didn't think of.

First I tried to create an arm-architecture environment under qemu, and use this to compile a 2.6 kernel, uclibc, busybox, etc. There were a few problems with this, the biggest was the Mac compatibility. I never managed to compile qemu on the Mac properly - possbily a bug, possibly my fault - but it was taking me too long to solve. Then I downloaded the Q binary. This was better, but there were issues with the scsi device and again it was taking too long. On Windows it was better - I installed the binary qemu and created a debian basic install, but given I don't use windows at home it would detract too much from my work to do the whole thing at work. Also, I touched on the problem that setting up networking at work would have somehow been too hard. This confused me because the debian installer worked fine, however I was disallowed from enabling network bridging (work policy) when I tried post-install. So it should never have worked.. weird.

So I tried (at work again - naughty) to use the buildroot product from the uclibc/busybox guys under cygwin. Seems this is broken in a number of ways. There is some patchs that are required to fix an undefined reference to _libintl_gettext. I downloaded the patchs from the mailing list but they wouldn't patch properly - patch rejected them. I did a bit more digging and found that cygwin has some case insensitivity that will silently break an include somewhere in buildroot - I think there are two '.s' files with the same name other than capitalisation. Solution that was suggested was to compile on a linux box for comparison purposes. Not a solution I can really work with.

I then revisited the idea of just using the Debian etch install. The vanilla install is HUGE! Far too many megs for me to use. However, I could follow the method used by the OpenPsion guys. I could use ar to unzip the deb archives and manually (with scripts similar to those on OpenPsion) remove the stuff I don't need. The downside is that I will have to use glibc (bigger than I need really) but other than that, everything is binary and ready to go. I just need to cross-compile a kernel (perhaps re-use the config from OpenPsion's 2.4 kernel) and think about the initrd. Perhaps if I compile-in all the hardware support I won't need an initrd and can just boot into the root fs.

So cross-compile time

No comments: