Chapter 10. Patching, Customizing, and Upgrading Kernels

Introduction

Patching, customizing, and upgrading the Linux kernel are useful tasks to master, and they’re really not all that scary. These are among the few system maintenence chores that require a reboot, which can be dismaying for those who glory in sustaining long uptimes. Other than that, it’s no worse than patching or upgrading any other software.

You’ll need kernel sources, and gcc, the GNU C compiler. There are two places to get kernel sources: from your own distribution, or from http://kernel.org. The different Linux distributions modify kernels to varying degrees. Red Hat, SuSE, and Mandrake ship heavily modified kernels. Debian and Slackware mess with them only a little bit. It’s possible that installing a vanilla kernel from http://kernel.org will cause things to break on distributions that use modified kernels, so it’s better to use kernel sources for your distribution. (See Chapter 2 and Chapter 3 for more information on obtaining and installing Linux software, and Recipe Recipe 4.2 to learn about build tools.)

As with most Linux software, when you patch a kernel, you’re not patching your existing kernel; rather, you’re patching the sources and building a new binary, so you’ll end up with two kernels. This is a good thing, because then you’ll have your original kernel to use in the event the new one doesn’t boot. You can install as many different kernels as you like, and test the latest releases and different configurations. ...

Get Linux Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.