How to Compile a Kernel
- 1). Download and install the source code for your kernel. This should be available from the operating system's official website, or through code repositories, if available. Before installing, check the version of the kernel you are using:
$ uname -r
2.6.xx - 2). Navigate to the source folder and run the menu configuration editor. Source code is usually stored in the folder "/usr/src/linux-versionumber." Navigate to this folder and run the "make" command to start the configuration process for the kernel:
$ cd /usr/bin/linux-2.6.xxx
$ make menuconfig - 3). Navigate the menu. The menu contains options you can disable and enable to remove or include certain functionality for the compiled kernel. Make sure that you understand your computer's hardware and the functionality you wish the computer to have so that you can easily remove unnecessary packages.
- 4). Build the kernel. Once you have finished configuring the kernel, exit the menu. Enter the following command at the command prompt to begin the process of building the kernel. Note: run the first command first, then when that finishes run the second:
$ make all
$ make modules_install install