[PLUG] Linux clinic Sun - kernel hacking?

Carlos Konstanski ckonstanski at pippiandcarlos.com
Thu Dec 17 02:03:41 UTC 2009


On Wed, 16 Dec 2009, Mike Connors wrote:

> Date: Wed, 16 Dec 2009 17:32:51 -0800
> From: Mike Connors <mconnors1 at gmail.com>
> Reply-To: "General Linux/UNIX discussion and help;	civil and on-topic"
>     <plug at lists.pdxlinux.org>
> To: "General Linux/UNIX discussion and help;	civil and on-topic"
>     <plug at lists.pdxlinux.org>
> Subject: Re: [PLUG] Linux clinic Sun - kernel hacking?
> 
> Alan wrote:
>> What do you need to know?
>>
>> I guess I know more than most.  (I am the Linux kernel maintainer for
>> Intel's Ultra Mobility Group.)
> I guess I'd just like to get a general understanding of the kernel,
> modules, variables, etc. Every once in a while I want to do something on
> my Debian box and
> inevitably I have to  enable/disable something in the kernel or build a
> kernel with a module loaded. For instance, I want to disable IPv6
> support. Does any of this make sense?

Sure does. The first step is to get the kernel source. Most binary
distros don't give you this by default. Many distros have their own
kernel patchsets which alter the kernel from its original form. I
suggest going to http://www.kernel.org/ and downloading a vanilla
kernel, at least as an initial exercise. Then run "make menuconfig"
and browse through the entire tree of configuration options.
Familiarity with this layout is a must if you want to build your own
kernel.

As root, run "lspci -v". The output of this command is crucial to
configuring the right settings for hard drive, video, ethernet, sound,
i2c sensors, etc.

Simplify the task by avoiding the need for an initrd image. To do
this, the kernel must have the ability to read the root filesystem
without loading any modules. This means you want to build hard drive
support into the kernel, as opposed to building it as a module. (In
menuconfig, hit "y" instead of "m".) If your root filesystem is on a
SCSI disk, this must also be built into the kernel. If using software
RAID, build it into the kernel as well. Same goes for LVM.

Audio, ethernet and video drivers do best as modules. There are
systems in place to find and load these modules; let them do their
thing.

Once you have built a kernel, subsequent kernel builds are much, much
easier because you always start with your previous config. If you are
performing a minor version upgrade, the config will not change at all.

Carlos



More information about the PLUG mailing list