6. What now?

6.1. Installing the debianized kernel

Once the kernel image is done compiling you will need to install the kernel and the modules. First check to make sure your kernel compiled successfully by changing into the /usr/src directory like this:

bash:/usr/src/linux# cd ..
bash:/usr/src# ls
custom-kernel.config                     kernel-source-2.2.19    kernel-source-2.2.19.tar.bz2
(1)kernel-image-2.2.19_custom.1.0_i386.deb  linux
(1)
There it is! Notice that it added our revision option to the end of the filename along with the automatically determined architecture.

Now to install the kernel and all its modules simply do this:

bash:/usr/src# dpkg -i kernel-image-2.2.19_custom.1.0_i386.deb

As part of the post-installation process it will ask you if you want to install the modules. You definitely want to say yes.

Warning

If you are using the flavour option or are installing a kernel version which is the same as the one you are currently running you should immediately jump to another terminal and move your current modules "out of the way." If you don't there is a very good possibility you will end up with module conflicts and a broken or wacky-acting system. Please reference the Flavour documentation in /usr/share/doc/kernel-package/Flavour.

Caution

The command to move your modules "out of the way" is (as root user):
bash:/lib/modules# mv 2.2.19 2.2.19-old
Substituting your version number for 2.2.19.

The post-installation should then ask you if you want to make a boot disk. If you made one earlier then you can say no here. Otherwise, grab a floppy you don't mind erasing, and say yes.

Next the post-installation should ask you if you want to run lilo. The documentation says it is a bit buggy but I didn't notice any problems. Say yes.

Warning

If you haven't made a boot disk yet then you need to do so. If for whatever reason the post-install wacks lilo you will not be able to reboot without it. Also, if you are using loadlin or some other bootloader you will probably want to reference the documentation in /usr/share/doc/kernel-package before answering this question. Your answer should most likely be no.

If everything went well then all you need to do is reboot and see if it works. If the reboot fails, insert your boot floppy and reboot. In future versions I hope to cover more troubleshooting issues, but for now, seek out help wherever you can find it;-)

6.2. Clean up

Congratulations on compiling your first kernel with kernel-package. No sweat eh? There are a couple more things we need to do to clean things up before you can enjoy that new kernel.

First, since we didn't create an epoch with our custom kernel package we need to put it on hold so dselect or apt-get doesn't try to "upgrade" it. You can do that by doing this (as the root user):

bash# echo "kernel-image-2.2.19 hold" | dpkg --set-selections

Substitute the name of your kernel image for the above. Also, the "|" character is made by typing Shift-\. To check that the package is indeed on hold do this (again, as root):

bash# dpkg --get-selections | grep kernel-image

If you put it on hold successfully it should look like this:

bash# dpkg --get-selections | grep kernel-image
kernel-image-2.2.19     hold

Next, you need to get rid of the symlink you created in the /usr/src directory. It's not really necessary but it's a good idea. There are several reasons most people remove the link:

  1. The next time you decide to download a kernel it might not be from a Debian archive. When you go to unzip the source it will overwrite your old source tree right through the old symlink you left in place last time. Bummer.

  2. The next time you download the kernel source from the Debian archive, you'll unzip the source into it's own tree without problems. But... seeing you already have a symlink called linux in the src directory, you figure you're fine and go ahead and compile. Forgetting, of course, that it's linked to your old source tree.

  3. When you download patches or other source (that you need to run special hardware) into a specific source tree, you don't want anything else messing with it. By removing the symlink you just might prevent #1 from happening.

Again, it's not necessary to remove the link. I would recommend it. It's easy to recreate, and you don't hurt anything by removing it. To remove the link do this (as root user):

bash# cd /usr/src
bash:/usr/src# rm linux

Finally, it's not required, but a good idea is to backup the custom debianized kernel you created onto whatever medium you choose. As a minimum, create another boot disk, this time using the new kernel you just created. Grab another floppy you don't mind being erased. It's not a good idea to overwrite the original boot disk you created. You haven't been using your new kernel long enough to determine if it's going to work the way you want it to. If you installed kernel-2.2.19 like I did just do (otherwise substitute your information) (as root user):

bash# mkboot /boot/vmlinuz-2.2.19

One final note. If you happen to need to rebuild your kernel, because you just bought a new sound card or you want to enable a new feature which you just realized you forgot to put in the first time, all you have to do is make-kpkg clean and increment your kernel image one revision. Your new command should look something like this:

bash$ cd /usr/src/linux

And then do:

bash:/usr/src/linux$ make-kpkg clean

And reconfigure your kernel:

bash:/usr/src/linux$ make xconfig

And then do:

bash:/usr/src/linux$ make-kpkg --revision=custom.2.0 kernel_image