[Glibc-bsd-devel] multiple kernel support on freebsd-i386

Nathan Hawkins utsl@quic.net
Sat, 29 Nov 2003 23:50:32 -0500


I've finally developed the basic support for installing multiple kernel
packages of different releases. (i.e. You'll be able to install both a
5.0 and a 5.1 kernel, and boot either one.) The issue is that the system
utilities like ps break when you boot into a kernel with a different
version.

The solution I've come up with is to move those utilities into
subdirectories. (I tried just renaming them, but some of them look at
argv[0].) I used /libfbsd/5.1/bin for /bin and /sbin. I then wrote a
small utility that detects the kernel version, and execs the right
version of the utility. This tool is called kversion. When called with
its own name, it prints the kernel version.

How this works: I hard-link /sbin/ifconfig to /bin/kversion. When I run
ifconfig, kversion sees that I'm running a 5.1 kernel, so it execs
/libfbsd/5.1/bin/ifconfig.

I'm still working on the packaging, but so far it looks like it'll work
well. There are quite a few loose ends, like where the manpages and
libraries go, so it'll probably take a while before I'm ready to upload.

	---Nathan