These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

UNIX02/Recompile Your Kernel In Your New Debian Install And Reboot

Classnotes | UNIX02 | RecentChanges | Preferences

Start by chrooting into your new Debian install.

Most of the time, you will be getting your kernels from http://www.kernel.org/. Additionally, you may find patches you wish to include in your kernels from around the web. For today, however, I have made it easy for you.

I have a custom kernel which you can obtain from this link:

This is the Linux kernel version 2.4.20 with the ck4 patch by Con Kolivas. The ck4 patch includes a large number of performance and functionality patches (including preemptable and low-latency).

NOTE: At the time of this writing, ck4 is outdated. Currently, the new patch is ck6 and contains additional features. You can obtain this patch here: http://members.optusnet.com.au/ckolivas/kernel/

Download this kernel, and unarchive it into a subdirectory of /root. cd into that subdirectory and issue:

 # make clean; make mrproper

Once that has done, go ahead and issue

 # make xconfig

We will be using the X-interface configuration system because it can be easier to navigate. Once you have the Xconfig screen, you could proceed to sequentially move through these menus and select the features you want. As I have mentionned before, this is a difficult process, and it is recommended you start with a pre-existing configuration and work from there.

Inside the archive is a file called 'samsconfig', it is also located online here http://einstein.physics.arizona.edu/~hart/class/samsconfig . Load this configuration file, and then proceed to reconfigure it for your machine as needed. Some notes on this:

  • You must enable software RAID as a part of the kernel (not as a module) in order for your RAID devices to be recognized at boot.
  • You must have SMP enabled in order to use the preemptable kernel patch.

When you have finished configuration, issue

 # make dep
 # make bzImage

make bzImage will create your kernel image. You could issue a make install here that may or may not install your kernel correctly. Instead, we will install the kernel image by hand later on. Finally, issue

 # make modules

and take a break while all your modules compile. When they are done (provided you have had no errors) issue

 # make modules_install

This will install the modules. Next, we must move our kernel into /boot and reconfigure our bootloader. Because LILO works better with RAID systems, we will configure LILO. However, we have only breifly mentionned LILO in the past. If we have time today, we will go through it more in depth, but if not, take a look at this lilo.conf

Once you have lilo configured, issue lilo and verify there are no errors.

Finally, you need to issue rdev on the newly created Linux kernel so that it knows where the root filesystem will be when it starts booting (this is not always necessary, however for our RAID system to be the default boot device it is required. See the man page for rdev for more information).

 # rdev kernelimage /dev/md0

Now exit chroot and reboot your machine. If your machine does not reboot into your new Debian system, you will have to reboot into Knoppix to figure out what went wrong.



Classnotes | UNIX02 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited September 12, 2003 9:36 pm (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.