Kernel2.6x compilation process-general Linux technology-Linux programming and kernel information. The following is a detailed description. Abstract: The compiling methods in Kernel 2.6x are a little different from those in earlier versions. Therefore, we simply write the compilation process to help beginners learn Linux.
Kernle 2.6x compilation is relatively simple, and it is best for me to wait for the cainiao !!
This document uses Redhat as an example. The internal version is 2.6.0-test8.
1. Download
Http://www.kernel.org
Ii. Decompress
1. Put the downloaded kernel in the/usr/srcdirectory, for example, linux-2.6.0-test8.tar.bz2.
# Music linux-2.6.0-test8.tar.bz2/usr/src
# Tar jxvf linux-2.6.0-test8.tar.bz2
2. Go to the appropriate directory for compilation and installation, and go to the kernel option settings
# Cd linux-2.6.0-test8
# Make mrproper
# Make menuconfig
Go to the kernel tab. M is compiled in a fast mode, and * is directly compiled into the kernel.
As for what needs to be compiled into the kernel and what needs to be compiled into modules. In the posts in the article manager and the basic discussion area, you can find them. In addition, the doc in the kernel also has relevant documents.
3. Compile and install the kernel
# Make
# Sudo make install
This process is the process of compiling and installing the kernel. What does the system automatically do for us?
1] The system will generate bzImage in the/usr/src/linux/arch/i386/boot/directory, and copy bzImage as a vmlinuz-2.6.0-test8 to the/boot directory, and create a link to the recommended vmlinuz-2.6.0-test8 vmlinuz;
2] In the/boot directory, the System will generate System. map-2.6.0-test8 and create its link System. map;
3] In the/boot directory, automatically generated as a initrd-2.6.0-test8.img;
4] modify the/etc/grub. conf file and add the startup Item of the new kernel.
[Note] I wrote down this process in detail as I was prompted by the Big Bear and baby brother, for fear that new beginners would not understand this process. All the preceding four tasks are performed when the system automatically installs the kernel. Check the files in the/boot directory and the/etc/grub. conf file. This is different from 2.4.x in the past. A metaphor is that 2.4.x is still semi-automated. The above items need to execute many commands. In 2.6.x, one step is in place, which is fully automatic!
4. Fast compilation and installation mode
# Make modules
# Make modules_install
5. Set/etc/grub. conf. I don't need lilo. To be more precise, I don't know much about it, so I can only say how to set Grub.
Why set this? In fact, during kernel compilation and installation, the system has automatically added the startup items of the new kernel to/etc/grub. conf. If we do not change/etc/grub. conf and enable the new kernel directly, we will find prompts such as VFS errors.
The following is the/etc/grub. conf file that has not been changed after I install the new kernel.
Compare the modified/etc/grub. conf, we can easily find that we are in the new kernel 2. in x, when specifying the root partition location, the LABEL =/is not used, but the real partition location is used.
If you are not familiar with Linux, do not copy my partition settings. If you want to know about this, there are articles about GRUB and partition access in the basic discussion area, which are also available in the article manager.
The last point is that if the driver has been installed on the display card, you need to reinstall it in the new kernel. For example, I use a NVIDIA video card. I downloaded the NVIDIA driver that has been patched in the Download Area of LinuxSir. Org. Install it.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.