0th step: Log in with Root
First step: Make Mrproper
Step Two: Make Oldconfig
Step three: Make Menuconfig
Fourth step: Make DEP
Fifth step: Make Bzimage (Here you can get a cup of tea first)
Sixth step: Make modules (Here you can drink 2 cups of tea)
Seventh Step: Make Modules_install
Eighth Step: Make Install
Nineth Step: Finally create the Initrd file (if you already have a INITRD file, you do not need this step)
Mkinitramfs-o/boot/initrd.img-2.6.34
If all works, the following will not be seen. It is expected to take 1 hours, depending on the configuration of the computer.
Transferred from: http://387424-student-sina-com.iteye.com/blog/728021
The first step: getting Ready for work
Open terminal for root privileges: sudo su
Then install the tools you need to compile the kernel:
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)
Additional tools can be installed as prompted during the upgrade process
Step two: Download the kernel source code linux-2.6.34.tar.gz
Please go to www.kernel.org website to download the latest version linux-2.6.34.tar.gz kernel
Suppose you download it in the root directory and unzip it into the/usr/src/linux-2.6.34 directory.
Cd/usr/src
Tar zxvf/root/linux-2.6.34.tar.gz
A new folder will be generated in/USR/SRC after decompression linux-2.6.34
Step Three: Configure
Copy the kernel configuration file in use/usr/src/linux-headers-2.6.32-22-generic/.config to the/usr/src/linux-2.6.34 directory
cp/usr/src/linux-headers-2.6.32-22-generic/.config/usr/src/linux-2.6.34
Perform:
cd/usr/src/linux-2.6.34
Make Menuconfig
The terminal will pop up a configuration interface
(If there is a problem, it may be the first step of the tool is not installed, you can install and try again.) If still not, then install libqt3-compat-headers)
Note The main menu ends with two items: Load a kernel configuration ...
Save a kernel configuration ...
Select the first load ... to set the kernel to be compiled using the current kernel configuration details, then save this option and exit the configuration interface.
Fourth Step: Install the new kernel as compiled
Execute: sudo make mrproper (clean up old files previously compiled, if you are the first to compile, do not execute)
execution: sudo makes (compile, can add-j4, if your CPU is dual core, If you can increase your speed)
Then: sudo make install
again: sudo make modules (compile module)
again: sudo make modules_install (install module)
finally create INI TRD file:
Mkinitramfs-o/boot/initrd.img-2.6.34
Fifth step: Update the configuration of the Grub boot list
sudo gedit/boot/grub/grub.cfg
My grub.cfg is added as follows:
Menuentry ' ubuntu 10.04,linux 2.6.34 '--class ubuntu--class gnu-linux--class GNU--class os {
Recordfail
Insmod ext2
Set root= ' (hd1,9) '
Search--no-floppy--fs-uuid--set 501d3a42-1d52-4438-99bf-e679da605867
linux/vmlinuz-2.6.34 root=uuid=33883099-83a5-49f3-9c12-ee6a4d90da9e ro Quiet Splash
initrd/initrd.img-2.6.34
}
# The following is the original 2.6.32 kernel boot entry
Menuentry ' Ubuntu,linux 2.6.32-22-generic '--class Ubuntu--class gnu-linux--class GNU--class os {
Recordfail
Insmod ext2
Set root= ' (hd1,9) '
Search--no-floppy--fs-uuid--set 501d3a42-1d52-4438-99bf-e679da605867
Linux/vmlinuz-2.6.32-22-generic root=uuid=33883099-83a5-49f3-9c12-ee6a4d90da9e ro Quiet Splash
Initrd/initrd.img-2.6.32-22-generic
}
So far, the compilation of the entire kernel is complete.
But maybe when you restart the system, although the boot menu adds the new kernel 2.6.34 startup items, it is very likely that the startup fails with the following prompt:
Warning:can ' t open directory/lib/modules/2.6.34/modules.dep,no such files or directory
At this time should not be discouraged, playing Linux to have the courage and perseverance to eat crabs, haha. Quiet heart, choose to start the login system from the old kernel, and then execute the following command (in order to avoid the input error, it is best to copy the following command) modified to successfully start the new kernel.
######################################
sudo su (guaranteed root access, otherwise you will not be prompted enough to complete the task successfully)
Cd/boot
CP initrd.img-2.6.34 Initrd-2.6.34.old (make a backup first just in case, haha)
Depmod-a
Update-initramfs-k 2.6.34-c
Cd/tmp
gzip-dc/boot/initrd.img-2.6.34| Cpio-id
Touch LIB/MODULES/2.6.34/MODULES.DEP
Find./| Cpio-h newc-o >/boot/initrd.img-2.6.34.new
Gzip/boot/initrd.img-2.6.34.new
Cd/boot
MV Initrd.img-2.6.34.new.gz initrd.img-2.6.34
Linux kernel compilation