Linked by Clinton De Young on Mon 3rd Mar 2003 03:07 UTC
Debian and its clones If you are reading this, I assume you already know what the Linux kernel is and why you may want to update it. However, if you are accidentally reading this walkthrough, just happen to be running Linux, and have no idea what the kernel is or why you would want to update it, the next two paragraphs are for you (if you are looking instead into a less verbose and more generic way of updating your kernel on any Linux distro, read here). In a neophyte nutshell, the Linux kernel is the brain of the Linux system. It tells your system which file systems, hardware, protocols, etc. are supported. There is a lot more to it than that, of course, but I think that diminutive description will suffice for now.
Permalink for comment
To read all comments associated with this story, please click here.
Good Job, Clinton!
by Kevin on Tue 4th Mar 2003 14:18 UTC

Clinton's article is excellent. I read it with some interest, as I"m making a presentation on building kernels at my LUG meeting in a couple of days.

A few observations:

1. I too was curious about why the author didn't advise downloading the kernel source from Debian archives. Perhaps it's because the 2.4.20 source package isn't in the stable repository.
It is however in testing, and the procedure for getting it is relatively simple:
a) Tell apt to get package lists from testing. Open /etc/apt/sources.list with your favorite text editor. In the first line change the word "stable" to "testing". Comment out the other lines by inserting "#" for the first character (this saves time downloading package lists you won't be using after this anyway).
b) Do "apt-get update".
c) Do "apt-get install kernel-source-2.4.20".
d) Edit sources.list again. This time uncomment all the lines, and change "testing" back to "stable" in the first line.
e) Do "apt-get update" again.

2. Debian kernel sources are compressed with bzip2, but tar can handle these using -j for bzip2 instead of using z for gzip, as follows:
tar jxvf kernel-source-2.4.20
In any event, you can simply "apt-get install bzip2" along with the other packages Clinton lists.

3. At the site, the hyperlink to "2.4.20" is indeed a patch, but to the right of it the "F" is a link to the Full kernel source. The links further right are interesting, as they show how many changes to each file in the source tree are applied by the patch. (In other words, where and how many changes took place since the last stable kernel).

4. I always check "Prompt for development and/or incomplete" in the kernel configuration. There are many items in this category that are really quite stable and have been for some time, but for some reason they're still classified as "incomplete/development". A good example is VESA framebuffer console support. (There are others, I just can't think of them now.) There are plenty of "Don't check this unless you really know what you're doing" warnings to scare newbies away from the stuff that really belongs in this category. And anyway, isn't the entire kernel still incomplete and under development?

5. It is not necessary to answer "Y" to "Sound support" to enable sound; "M" works just fine. I also use a module to support my sound card.

6. Kernel-package is da bomb. Use it once and you'll never go back to make... make... make...

7. When invoking make-kpkg, using the "--append-to-version" option allows you to have more than one 2.4.20 kernel without them stepping all over each other. I use this instead of "--revision", as follows:
"make-kpkg --append-to-version=.20030304 kernel_image"
Note the dot beginning the revision. I use the date as my argument; this way each kernel is identified by the date I compiled it. Each 2.4.20 kernel will have a different name in /boot, and its modules will be installed in a separate subdirectory of /lib/modules.

8. The grub boot loader is da bomb. Check out the Linux Journal's web archive for "Boot With Grub". Then install it. Run "update-grub" to generate a boot menu.

9. After you've installed grub, add the following lines to /etc/kernel-img.conf:
Now whenever you add or remove a kernel package your boot loader's menu is automatically updated. No more editing /etc/lilo.conf, and no more needing to remember to run /sbin/lilo every time you make a new kernel. (A sample kernel-img.conf file is in the documentation, under /usr/share/doc/kernel-package.)

10. To enable your CD-ROM burner, you don't need to enable SCSI disk support (in fact, the help for this option explains what it's for). And all of the SCSI stuff can be modules, including "SCSI Support" itself.

11. In the what if something goes wrong section, if you've installed a kernel image .deb and the kernel doesn't boot, you need to remove the .deb using dpkg:
"dpkg -P kernel-image-"
This will remove the kernel, its, and its config file in /boot, and it's module tree under /lib/modules. It will also let the package system know the files aren't there anymore; if you just delete these the package system won't know about it.

If you followed my suggestion to use grub, deleting the kernel image deb will also update the boot loader menu.

Once you've purged the kernel package you can delete the .deb file in /usr/src.

If you use the "--append-to-version" argument you don't need to worry about how may kernels you have of the same version. They will all have different names and won't conflict.

That's all I can think of now. Please understand that despite my lengthy comment I thought Clinton's article was *excellent*. If I'd had this kind of tutorial available when I started using Debian I'd have more hair now.