The kernel has finally been edited and upgraded, and it was intended to continue to learn. But in the wife's encouragement, feel or stop to summarize the better, so that they are helpful to others.
0. Environment Introduction
I installed the Ubuntu-9.10-desktop-i386.iso on the Virtualbox-3.1.6-59338-win virtual machine. The computer itself is an XP system.
Note that it is best to do the following before doing the following:
1 Install the enhanced package. This switch between the virtual machine and our computer is very convenient, do not need to press the right CTL key. As for the other benefits, it is not yet realized, hehe.
2 and host (XP system) to set up a shared folder. This is more convenient for exchanging information.
3 The virtual machine's hard disk space is preferably more than 20G. Because the core decompression after a lot of space, and then do other, may be inconvenient.
1, download the core source code
The address is www.kernel.org, under "Lateststablekernel" has a green arrow, click can download. i download is 2.6.33.2, below this version for example to explain.
will download down the linux-2.6.33.2.tar.bz2 placed in /usr/src under.
2, extract the core source
To run the command:
#cd/USR/SRC
#tar-JXVF linux-2.6.33.2.tar.bz2
#ln-S linux-2.6.33.2 Linux (map Linux symbolic links to linux-2.6.33.2)
#cdlinux
3, #makemrproper
This command ensures that there are no incorrect. o files and the dependencies of the files under the source code directory.
This step can be omitted because it is the complete source package that has just been downloaded. However, if these source programs have been used more than once, this step cannot be ignored.
4. Configure the Kernel
Note: Before performing this step, you need to install libncurses, because Ubuntu is not installed by default. The installation command is:
#apt-getinstall Libncurses5-dev
The configuration can use one of the following commands:
#makeconfig (the most traditional configuration interface based on text, deprecated)
#makemenuconfig (Configuration interface based on text menu)
#makexconfig (required QT is already installed)
#makegconfig (need GTK + has been installed)
Usually we use the second one: #makemenuconfig
The specific configuration kernel, no longer detailed here. I didn't change anything for the first time.
5. Compile the kernel
Note: Before executing this command
1 need to be root user only. You can use the SU or sudo command.
2 Make sure that the/lib folder is writable, because Ubuntu defaults to not be writable. Command:
#chmod777/lib
This should be paid attention to OH. I just did not notice the changes, and then executed the following command to compile the kernel to go home from work, thought the next day to compile well. Did not expect the next day to find the implementation of a long time to stop, the reason is going to/lib in a folder under the test file, error.
The following starts the compilation:
#makebzImage (generates an executable Ubuntu kernel boot file)
#makemodules Modules_install
It's going to take one or two hours.
6, the above success, the kernel is compiled successfully. Update the kernel below
#cp arch/i386/boot/bzimage/boot/vmlinuz-2.6.33.2
Then copy the System.map to the/boot:
#cp system.map/boot/system.map-2.6.33.2
Generate INITRD.IMG:
#cd/lib/modules/2.6.33.2
#mkinitramfs-O/boot/initrd.img-2.6.33.2
Note: This place has something to say.
The production of initrd.img, under Fedora is generally used mkinitrd, and in Ubuntu/debian under the Mkintramfs.
Their usage is slightly different, as follows:
#mkinitrd/boot/initrd.img 2.6.33.2
#mkintramfs 2.6.33.2-o/boot/initrd.img
My this is Ubuntu/debian, of course, to use Mkintramfs. I first did not distinguish Fedora or ubuntu/debian, with mkinitrd always say find, check the next only found that the original use of Mkintramfs AH.
7, automatically find new Ubuntu kernel, and add to grub boot
#update-grub
8, OK, restart at this time, with the command (UNAME-R) Check your core is not 2.6.33.2 bar.
Note: The above are written according to the kernel version of 2.6.33.2, but please replace all corresponding 2.6.33.2 with your new version number.