custom kernels and heterogeneous hardware

Ben Scott dragonhawk at gmail.com
Wed Jun 21 15:35:00 EDT 2006


On 6/21/06, Paul Lussier <p.lussier at comcast.net> wrote:
> Please excuse yet another on-topic post, I'll try not to do it too
> frequently ;)

  HAH!

> I'm wondering how others handle needing to deploy a custom kernel to a
> wide variety of hardware.

  You might want to try looking at the way the distribution vendors
handle that problem.  After all, from the standpoint of the kernel
source distribution, their kernels aren't any less "custom" then
yours.

  Most of my experience are with Red Hat derivatives.  Red Hat's
hardware detection magic generates an /etc/modules.conf (or
/etc/modprobe.conf with kernel 2.6) for you.  Then the kernel's
regular auto-loading mechanism loads things normally.  It's rather
more sophisticated than Debian's approach of just listing a bunch of
modules to load.  On the other hand, the end result is the same.  So
unless you're hot-plugging hardware, I'm not sure Red Hat's increased
sophistication gets you anything.

  The Red Hat hardware detection magic is included in both anaconda
(the installer) and kudzu (the hardware change detection gizmo that
runs every boot).  Both are GPL'ed, as far as I know, so you might
look at them for code or ideas to use.

  Red Hat makes their kernel *very* modular.  It's often the case that
a module needs to be loaded just to read the root disk -- and the root
disk is where the modules are.  So Red Hat uses an initial RAM disk
(initrd), which the boot loader (LILO, GRUB) loads along with the
kernel image.  The initrd contains the modules needed to bootstrap the
root disk.  The initrd is built on the local system, whenever a new
kernel is installed.  Red Hat provides a tool, mkinitrd, which scans
/etc/modules.conf, figures out which modules are needed to boot the
system, and builds the initrd for you.

  Now, my experience with Debian is limited.  In the past,  my
experience was that Debian basically *didn't* handle this for you.
You picked a pre-compiled, "fat" kernel, or you compiled your own.
Ick.  However, I've been giving the current "testing" release, "etch",
a try at home.  The installer appeared to properly auto-detect
everything and configure /etc/modules for things like sound and
network.  It worked great, I'm glad to report.  I expect you could
adapt that same installer (or code from it) for your purposes.  I
don't know if it goes as far as things like SCSI modules and initrd
configuration, though.

  Hope this helps,

-- Ben



More information about the gnhlug-discuss mailing list