22 May 2004 thomasvs   » (Master)

Fedora Core 2

Overall, upgrade of most of my/our machines went smoothly. It's during those operations that I re-appreciate the value of our fedora.us policies and the ease of rebuilding that mach brings me.

FC2's kernel has a very sparsely documented feature that seems to be called vdso or linux-gate. Run ldd /bin/bash on an FC2 machine and you'll see it being linked to a "library" called linux-gate.so.1 which isn't a real library, but something the kernel dynamically creates. Took me quite some time to pinpoint this mechanism as the problem for mach to set up chroot's for pre-FC2test3 on post-FC2test3 systems.

Now on to figuring out a way to build kernel modules properly on 2.6.

Here's the thing. In 2.4, you could build out-of-tree kernel modules just by using the kernel source that was preconfigured. Using this, you could make modules for any Red Hat kernel. That means, also for smp, or for i586, and so on.

With 2.6, you need a bunch of generated files specific to your arch/type combination, which is now stored in /lib/modules/(uname -r)/build

So, if you want to build all modules for a given kernel release in one go, you can't. Since the i586 and i686 kernel rpms aren't parallel installable, for example, you need two runs. What's more, apt-get will look at /etc/rpm/platform through rpm to figure out the correct arch to install, and there's no real way I can make apt forcefully install the i586 one on an i686 machine.

So, one solution would be to download the kernel rpms, rpm2cpio them, and extract all the files, and repackage them. Doable. But that would create some huge .src.rpms and some huge end result .rpms.

So I ran a diff on the four directories. It turns out that not that many files are different. So here's what I'm going to do:

  • Write a script to unpack all the kernel rpms for a given release
  • run a python script on it that tells me which files are the same in all fours, and which files are different in any of them
  • make a deeply symlinked forest of all common stuff, and copy the different stuff
  • package this forest as a kernel-modules-devel rpm.
The %post script would then need to figure out if you have a normal or smp kernel installed for the same kernel version/release, so it can set up a symlink from the original /lib/modules/(uname -r) to the common one the symlink forest links from.

A big hack, but a smart one. It took half a day to think about the algorithm. After having written it down, it took another half a day to write the python code until it worked. Running involves a lot of waiting due to the rpm unpacking and list scanning.

Then I went on to actually use these packages. Looking at the stuff in autostars, I was trying to come up with a decent way of integrating 2.6's kbuild system with our autotooled setup.

Since obj-m vars are refused by automake, however, the best I could come up with was a hack that would generate a Makefile.26 for the new system which would be invoked from automake. That would have been kludgey at best.

But Dave to the rescue: he had looked at the same problem lately and had updated but not commited the macros to work with 2.6. Apparently he wrote a small modtool script in analogy with libtool, creating .ko files and necessities in a .mods dir. I was left with just fixing the small issues to make it work on Fedora Core 2, and (as I later found out) merge back all my previously commited fixes which he threw away :)

So, our as-linux stuff, combined with the kernel rpm I made for the symlink forest, managed to build the sample kernel modules fine. Next step - real modules.

The trickiest one to get right was the combination of hostap and ipw2100. The ipw2100 modules need the hostap ones, and build against headers from hostap and needs symbols from hostap. With a few enhancements to as-linux, this worked out fine too. And now I need testers. If you have FC2 and an ipw2100 network card, try these packages. You need hostap and ipw2100. Don't forget to get/update the firmware file in /etc/firmware, you need version 1.1 of the file.

I also tried rebuilding the qc-usb kernel module, but while it loads fine and detects the camera, it doesn't really work. I tried a regular build from the source project too, though, and it had the same results, so it's probably not my fault.

If you have a kernel project that you'd like to see packaged, let me know and if it's something I can test, I'll give it a shot.

advogato

I was scared advogato was down for good and had taken my diary entries with me. Over the years I've written quite a few entries and I was hoping to somehow get them back so I can store them for when I go to the old men's home.

When it got back up I wrote a simple script using the xml-rpc python interface. Python is soooo nice for simple stuff like this. If you want to backup your entries, get the script and run it with your username as argument. It will create a directory with that name in your current dir and download each of the entries to a separate .html file.

I've thought about setting up a planet aggregator and wordrpess on our apestaart server to get my friends to blog a little about their life in Belgium. Blogging is a nice unintrusive way of letting others know what you're up to, and reading them is a nice way of knowing how they're doing.

Uraeus

If he was talking about me as well, then he's giving me too much credit. All I'm trying to do is to make sure we can do streaming, and try and tackle the general "Multimedia, Codecs, Patents, Licenses and Distributions" problem. But we're making progress. Interested in what the FSF has to answer to our questions.

Flocks

I was getting the feeling my favourite cat herder was turning into a prison warden, but he sort of put my mind to rest.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!