Gentoo Archives: gentoo-user

From: Kobboi <gentoo@××××××××.be>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Generic kernel: hardware and loading the right modules
Date: Mon, 09 Feb 2009 23:52:01
Message-Id: 1234227194.14792.32.camel@saive.lan
1 I've asked this on IRC and the forums, but I'm not getting any further.
2 Maybe I'm asking the wrong question or misunderstanding the few replies
3 I get, but allow me to pose my question on the mailing list as well.
4
5 Over the last few years, I have been compiling kernels for well-defined
6 sets of hardware, i.e. the systems I myself was working on. The items
7 and devices I knew I had and needed were compiled in-kernel, some
8 optional things as modules (that is, the more "functional" modules like
9 file systems or support for Ethernet bridging, not the "hardware"
10 modules). I knew about udev, and primarily thought of it as the program
11 that could enforce persistent naming, heck, it could even rename network
12 interfaces from the standard eth0 to something more meaningful. How
13 cool!
14
15 I recently found myself in a new and unexplored situation: I needed a
16 generic kernel/module combination (precompiled) that would work on a
17 variety of hardware in the x86 architecture, and especially a way to
18 load the right modules. I always assumed there would be some kind of
19 magic at work, but I guess there isn't.
20
21 First idea: genkernel. Never used it before, but it seemed to work ok.
22 The initrd generated by genkernel works with busybox's mdev. The net
23 effect seems to be that every driver module (I noted IDE and SATA
24 chipsets I never even heard of) in the initrd is loaded, relevant or
25 not, and stays loaded. Ok, that'll probably work, but why bother
26 creating modules, if I still use them all. And sure, I could unload most
27 of them, but I don't want to bother my users with that. And it seems
28 kind of inefficient, I mean, I wouldn't expect a 2009 Linux system to
29 work like that.
30
31 Second idea: manual initramfs creation. Very insightful and a
32 recommended exercise. Problem: I have no idea how to handle the loading
33 of modules the way I want. Questions: Should I use udev instead of mdev
34 in the initrd? Would that make a difference? Why doesn't genkernel use
35 udev too then? Does udev do any module loading or does it just act upon
36 device file creation (meaning the relevant module is already loaded)?
37
38 Somebody on IRC coined the term "hotplug", but the hotplug ebuilds have
39 version names beginning with 2004. The elogs of those ebuilds talk about
40 modules loaded at boot (yay!) and something called "coldplug", but
41 coldplug is blocked by recent udev versions (aww!). So maybe udev does
42 have the capability of loading relevant modules?
43
44 Maybe I'm expecting too much, maybe I'm confusing device drivers with
45 the genericity of what a module is, maybe I haven't read the right man
46 pages or googled the right keywords. I would just really like someone to
47 give me a clear explanation :-)
48
49 Thanks in advance,
50 Kobboi