Compiling Kernel   «Prev  Next»

Lesson 6 Kernel compilation: look before you leap
Objective Advantages and Disadvantages of Building Custom Linux Kernel

Advantages and Disadvantages of Building Custom Linux Kernel

List the advantages and disadvantages of building a custom Linux kernel. There are a number of reasons why it might be necessary to build a custom kernel, including
  1. Optimizing the system as a router, not a host
  2. Enabling advanced routing options
  3. Disabling, for reasons of security, nonessential capabilities
  4. Enabling capabilities that Red Hat chose not to enable
  5. Reconfiguring internal kernel parameters that affect your users' programs
  6. Changing kernel operating parameters that are not configurable at boot time or through /proc/sys
  7. Because you can!

However, rebuilding the Linux kernel, which was essential during the monolithic-only era, is unnecessary on many systems running Red Hat Linux today because
  1. Red Hat Linux now installs a kernel targeted to a system's particular processor
  2. Most hardware support is included by default
  3. When security issues emerge, Red Hat releases kernel updates promptly.
    Securing your system by upgrading to a new Red Hat kernel is less involving than applying patches and building a new kernel and, therefore, is generally preferred.
You probably will not know whether or not you need to rebuild your kernel until you review what options the Linux kernel has.
As with many other facets of Linux, "because you can" is usually enough reason to rebuild your kernel. The next lesson prepares you to rebuild your kernel.
  1. When you type make bzImage, Linux compiles the kernel source code.
  2. Because building modules is a separate step from building the kernel, you must perform a make modules now.
  3. Once the kernel is built, you need to copy the kernel and system map into the /boot partition. In this example, we are copying our 2.2.14 kernel
  4. Finally make modules_install places the newly compiled modules into the /lib/modules directory hierarchy.

For Systems running Red Hat Linux, is it necessary to rebuild the Linux kernel?

For most users, it is not necessary to rebuild the Linux kernel on systems running Red Hat Linux. Red Hat Linux is designed to be a stable and reliable operating system, and the default kernel provided by Red Hat is usually sufficient for most users' needs.
However, there may be certain situations where rebuilding the kernel is necessary. Here are a few examples:
  1. To add or remove kernel modules: If you need to add or remove kernel modules that are not included in the default kernel, you may need to rebuild the kernel to include or exclude the necessary modules.
  2. To customize kernel configuration: If you need to customize the kernel configuration for your specific hardware or software needs, you may need to rebuild the kernel with your desired configuration settings.
  3. To update the kernel: If you want to update to a newer version of the kernel that is not available through the default package repositories, you may need to rebuild the kernel from source.

If you do need to rebuild the kernel, it is important to follow the proper procedures to ensure that the new kernel is stable and reliable. Red Hat provides documentation on how to rebuild the kernel on their website, and it is recommended to follow their instructions carefully.
In summary, while it is not necessary to rebuild the Linux kernel on systems running Red Hat Linux for most users, there may be certain situations where rebuilding the kernel is necessary to customize the system's configuration or update to a newer kernel version.