[wplug] I'm a Linux whimp (need kernel help)

Chester R. Hosey Chester.Hosey at gianteagle.com
Tue Aug 16 10:23:42 EDT 2005


On Mon, 2005-08-15 at 20:58 -0400, Robert E. Coutch wrote:
> Alright you bunch of topic hijackers .... listen up !!!!
> 
> (Just teasing! Don't take offense OR ELSE )

I like bacon! Er, sorry.

> So here's how it went.
> [clip]
> I run glxinfo and see direct rendering is ENABLED.
> I run Chromium and it runs !!!!!
> 
> So now I have what I wanted, 3D acceleration on my laptop's SuperSavage IX/C 
> chipset.

Good stuff!

> I still remain clueless as to kernel.
> Do they make a kernel for dummies book by any chance?

Bah! It's not really that difficult that it would justify a whole book.
Nowadays distributors tend to assume that you have enough RAM that a
little kernel bloat won't matter, but in the days of old it was usually
suggested that you roll your own so as not to waste valuable core with
their bloated cruft.

Some things can be made modular and placed on an initrd, but the general
point is that it used to be common that those using Linux would
eventually compile it themselves. That's not an attempt at elitism, but
at reassurance -- it's not really that difficult, and it even comes with
a configuration menu!

If you want to give it a look, here's a little direction.

The short-and-sweet, twelve-step program towards freeing yourself from
vendor-kernel addiction:

1) Install bzip2, libncurses5-dev, gcc, make, etc.
2) Obtain kernel source
3) Unpack kernel source
4) Change into the kernel source directory
5) Optionally copy old config to .config and "make oldconfig"
6) Do a "make menuconfig"
7) If compiling a 2.4 kernel, "make dep"
8) make bzImage
9) make modules
10) make modules_install
11) Tell your bootloader about the new kernel.
12) Reboot

You're done!


The longer answer:

Most distributions and guides will (used to?) tell you to unpack
into /usr/src/linux. I found myself playing with many different
versions, and settled on /usr/src/ksrc/2.6.12 (for instance), allowing
for intact source trees for all versions I was testing.

What I'd do for an out-of-the-box fresh installation looks like the
following:

(Install bzip -- the package might be called bzip2 or similar, and
you'll need the libncurses development headers and a compiler.)

host:/home/chet# cd /usr/src/
host:/usr/src# mkdir -p ksrc/upstream
host:/usr/src# cd ksrc/upstream
host:/usr/src/ksrc/upstream# wget \
	http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.12.tar.bz2
host:/usr/src/ksrc/upstream# cd ..
host:/usr/src/ksrc# tar jxvf upstream/linux-2.6.12.tar.bz2

(wait for tar...)

host:/usr/src/ksrc# mv linux-2.6.12 2.6.12
host:/usr/src/ksrc# cd 2.6.12/
host:/usr/src/ksrc# cp /boot/config-2.6.9-11.EL .config
host:/usr/src/ksrc# make oldconfig

(At this point, you'll be asked a series of y/n options. Most of the
time you can go with the default, unless you know better. If you aren't
sure whether you know better, assume you don't. You'll be given an
opportunity to review everything later -- this is just a quick way of
getting a config from an old kernel up to speed with the new kernel's
features and options.)

This next step is optional if you're in a hurry, but highly recommended:

host:/usr/src/ksrc# make menuconfig

You'll quickly figure out menuconfig. It's simple, and if you change
anything you aren't certain about, Ctrl+C will always exit immediately.

If compiling a 2.4 kernel:

host:/usr/src/ksrc# make dep

And for all kernels:

host:/usr/src/ksrc# make bzImage
host:/usr/src/ksrc# make modules
host:/usr/src/ksrc# make modules_install

Some copy the generated kernel to /boot or /, but I like to leave it in
place. I've always got an old bootable kernel in another source tree
somewhere -- I'm very demanding of disk space in /usr/src, but if faced
with limitations I'd probably copy to /boot. The kernel will end up
at /usr/src/ksrc/2.6.12/arch/i386/boot/bzImage after a successful build.

Please note that it also makes sense to place it in /boot in the case
that /usr is a distinct partition -- if you wipe out /usr, you've still
got a minimally useful (and bootable!) system.

Inform your boot loader of the new kernel -- /boot/grub/menu.lst for
grub, /etc/lilo.conf for LILO. If using LILO, you'll need to type 'lilo'
to activate changes.

Note that if you're impatient (which I am) you can specify the -j option
to make, which will cause make to invoke multiple build processes
whenever possible. This really only makes sense during 'make bzImage'
and 'make modules' -- for instance, 'make -j2 bzImage' for single-CPU
systems or 'make -j4 bzImage' for SMP. I like to increase the number
until 'top' no longer reports idle CPU time (it will nearly always show
idle CPU on its first display cycle -- be somewhat patient).

If you're paranoid (which I am) about doing things as root, note that if
you have write permission to /usr/src, you can do everything up to 'make
install' as a non-root user.

Heck, if you just want to play in a 'sandbox' (safe environment), do it
all outside of /usr/src. You can do it in your home directory, but I
would move it to a proper location as soon as you're comfortable
compiling and booting from your own kernel.

Anyone still with me here who feels like piping in with comments or even
just to point out stupidities in my methods is definitely welcome to
comment. It's not quite a book, and it's all from memory, so if anything
doesn't work for you please let me know.

Chet


More information about the wplug mailing list