1. Preparatory work
Switch to administrator permissions, sudo–i Enter the user password to enter root permissions
Apt-get Install build-essential kernel-package libncurses5-dev libqt3-headers
Build-essential (Basic Programming library (GCC, make, etc.)
Kernel-package (some configuration files and tools that generate kernel-image in the Debian system)
Libncurses5-dev (Meke Menuconfig to invoke)
Libqt3-headers (make Xconfig to invoke)
2. Download a specific version of the kernel source code http://www.kernel.org
I'm downloading the latest version of the LINUX-3.2.12.TAR.BZ2, released in 2012-03-19.
3. Copy source linux-3.2.12.tar.bz2 to/usr/src directory and unzip
command. Assuming the source code is stored in the/home directory
Cp/home/linux-3.2.12.tar.bz2/usr/src
Cd/usr/src
Tar xvjf linux-3.2.12.tar.bz2
Generate linux-3.2.12 Directory after decompression
4. CD linux-3.2.12
Next Configure kernel options
Make Menuconfig This step is more complex, the kernel options are many, we can use the current kernel configuration options,
But the time to compile the kernel will be longer, because the configuration used to install the system is adapted to most systems, non-fixed
System options. About the kernel configuration options How to customize, many online.
5./usr/src/linux-headers-2.6.38-13-generic/.config the kernel configuration file in the system you are using
Under the/usr/src/linux-3.2.12 directory
cp/usr/src/linux-headers-2.6.38-13-generic/.config/usr/src/linux-3.2.12
Perform:
cd/usr/src/linux-3.2.12
Make Menuconfig
The terminal will pop up a configuration interface
Note The main menu ends with two items:
Load a kernel configuration ...
Save a kernel configuration ...
Select first load ... to set the kernel to be compiled using the current kernel configuration details, and then select
Save this saves and finally exits the Config interface
6. Install the new kernel as compiled
Execute: Make mrproper (clears old files that were previously compiled, if you are compiling for the first time, you can not execute them)
Execution: Make (compile, add-j4, must plus, dual-core parallel compilation, much faster, but using the original configuration
option, my computer still needs a clock or so)
Then: Make install
Again: Make modules (Compile module)
Again: Make Modules_install (Install module)
Finally, create the INITRD file:
Mkinitramfs-o/boot/initrd.img-linux-3.2.12
7. Make install, the system automatically updates the startup item, you can cat/boot/grub/grub.cfg to see. The previous startup item cannot be deleted, and if the compilation kernel is unsuccessful, the previous startup item is missing and your system is kneeling.
8. Reboot