2.6.x kernel compilation experience

Source: Internet
Author: User
2.6.x kernel compilation experience-general Linux technology-Linux programming and kernel information. The following is a detailed description. For reference.

Steps:

Download the original code to the root directory (other directories are acceptable, but I am used to it)

# Cd (go to the root directory)
# Md5sum kernel-2.6.7 (the MD5 code verification of the original code, which I did not actually do, has always been an acute problem! In addition, we need to compare the character with the naked eye. Later I remembered it, but it has been compiled successfully, so I didn't verify it again)
# Music kernel-2.6.7.tar.gz/usr/src (mobile kernel source code to/usr/src)
# Cd/usr/src (in the/usr/src directory)
# Tar cvf/root/boot.tar/boot (package and back up the boot directory to/root/boot.tar for fast recovery after failure)
# Tar cvf/root/modules.tar/lib/modules/kernel-2.6.5-358 (package and back up the current module to/root/modules.tar for quick recovery after failure)
# Tar vzxf kernel-2.6.7.tar.gz (unpackage kernel source code, if the bz format, then tar jvxf kernel-2.6.7.tar.bz)
# Cd kernel-2.6.7 (in the kernel source code directory)
# Make mrproper (number of cleanup codes, which can be omitted during the first compilation .)
# Make menuconfig (create a compilation list. Note: xconfig cannot be used for the first compilation)
......

It took me half an hour to complete the complex process. there are thousands of details and no error can be made. For details, refer to the default settings (too many by default, the kernel will increase, and the compilation time will be extended. Of course, if everything is default, it makes no sense to compile the kernel.) The file hidden file is generated here. config

.....
....
# Make

(Start to follow. the content of config is compiled by the kernel module-modules. The machine runs on its own and runs on my CR600MHz for 25 minutes. We recommend that you run it in command mode. If you are in X, run init 3 to the terminal, and then make. Of course, you can log on to the second console to top up the page at this time, you will see that the CPU usage of gcc reaches 80-90 $ ----- on my machine is like this, if your machine is faster and the memory is large, of course, you can compile xmms on the GUI to listen to songs .)

# Make modules_install (installation module)
# Maek install (install the kernel to your system)

Check: Make sure the grub. conf file has been modified.

# Cd/boot
# Ls-l

Check whether

Initrd-2.6.7.img
Vmlinz-2.6.7
# Vi grub. conf

Check if there are any startup options for the new kernel. reboot, init 6, or shutdown-h now (restart)

Note:

Make dep; make clear; make modules

You do not need to manually modify lilo. conf or grub. conf.

Make install to complete all the new Kernel configuration steps.

2: Focus on make menuconfig (here you can also make xconfig make gconfig make oldconfig). A lot of hardware can be removed, such as sound card drives that are useless to you. 1000 M, memory M Nic. 1394 Interface, does PCMCIA have a few desktop computers? Haha.

Note: In file system, select ext2 to compile to the kernel, and EXT3 to compile to the module (of course, you can directly compile to the kernel, but the kernel will be larger). Otherwise, the system cannot start.

If you want to mount a WINDOWS FAT32 disk, You need to compile vfat as a module. NTFS is selected as the NTFS module (write operations are supported from 2.6, but we do not recommend that you modify the NTFS-format disk in WINDOWS-data records that may damage the NTFS disk), other file systems, what MAC file system support, BeOS file system support, FreeBSD file system support, SOLARIS File System Support, etc ...... the support is too comprehensive, and most of them can be removed. however, we need to retain SMB and NFS (haha, unless you only use it on a single machine)

ISO9600 File System (the standard CD file system, and the support for the M $ CD file system, what is the name J. I cannot quite remember. it is best to select .) select your own motherboard chip support.

The CPU of P4 has several Optimization Options. If your CPU is P4, then SYE is YES! (The specific name is hard to remember. If you want to compile it, check the description for each item)

Preemptible Kernel must be selected. This is mentioned in almost all articles about the 2.6 Kernel, which is the preemptive Kernel. That is to say, some high-priority programs can first execute with some low-priority programs, even if these programs are executed in the core State, thus reducing the kernel latency and improving the system response. This feature can improve the performance of desktop and real-time systems. What ACPI and APM power management are also different based on your machine's new and old options.

3: it is best not to use kernel debuging. I personally think it is not very useful. in addition, after a 4 K stack is compiled, it is said that the latest NVIDIA driver will not be installed ......... it depends on your creation. I have compiled it six times and it is in the 2.6.7 kernel testing period.

4. The loopback device must be compiled into the kernel.

Otherwise ALL of your loopback devices are in use

5. The driver of the video card must be included in the module. Because the driver will be installed later, upgrade the module.

My experience: to install anti-virus software, you need to compile capbilities into the module in security option. You cannot select Y to compile them into the kernel. In addition, after each kernel compilation, the driver must be reinstalled. It seems that you do not need to re-compile the sound card driver for the old kernel, and you still need to install the video card.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.