DistributedNetworksDistributedNetworks





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.



Linux Compiles kernel source code

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.