Step 1: Download the Linux kernel source code (URL: http://www.kernel.org /)
Step 2: deploy the kernel source code to the relevant directory of the Linux system.
Start Linux, open the terminal interface, and change the permission to root user. Enter Su on the terminal and then the password. Then, move the downloaded Linux kernel source code to the following directory:
,/Usr/src, the specific command is: MV linux-2.6.36.tar.gz/usr/src.
Input tar zxvf linux-2.6.36.tar.gz to decompress the kernel package and place the generated source code under the linux-2.6.36 directory.
Enter the CD linux-2.6.36 and switch to the directory.
Step 3: configure the kernel
There are many Kernel configuration methods, including the following:
Make menuconfig // graphic tool interface based on the ncurse Library
Make config // based on the text command line tool, not recommended
Make xconfig // X11-based graphical tool interface
Make gconfig // graphical tool-based interface
Since Linux is still in the beginner stage, we chose the simple Kernel configuration method, make menuconfig
Enter make menuconfig on the terminal. After a few seconds, the terminal will become a Graphical Kernel configuration interface. Most of the configuration uses the default value, which is only a small part.
You need to select based on your needs.
Step 4: Compile the kernel. This step takes about 1 hour.
Enter the command, make bzimage
Step 5: Compile and install the kernel module
Enter the command: Make modules_install
Step 6: Install the kernel
Run the following command: copy the compiled kernel image file to the correct directory and automatically rewrite the Linux Startup File. Grub configuration file.
The changed. Grub configuration file is as follows:
Step 7: restart the system. When you start the interface, you will find the LINUX system that we just compiled successfully. When you enter this system, the compilation of the entire system is complete.