CentOS kernel customization

Source: Internet
Author: User
Tags rpmbuild
To improve the transmission efficiency of TCP, we recommend that you customize the CentOS kernel to improve the transmission efficiency. The following describes how to obtain the source code and compile the kernel. 1. before compilation, install the following components as the [root] User: surootyum-ygroupinstall & quot; DevelopmentTools & quot; yum-yinstallncurses-develqt-d

To improve the transmission efficiency of TCP, we recommend that you customize the CentOS kernel to improve the transmission efficiency. The following describes how to obtain the source code and compile the kernel.

 

1. run the [root] user to install the following components before compilation:
Su root
Yum-y groupinstall "Development Tools"
Yum-y install ncurses-devel qt-devel
Yum-y install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed xmlto
Yum-y install audit-libs-devel binutils-devel elfutils-libelf-devel
Yum-y install newt-devel python-devel zlib-devel


2. install the source code component of the kernel. [note] you must use the [non-root] user to execute the command.
Rpm-I http://vault.centos.org/6.5/updates/Source/SPackages/kernel-2.6.32-431.11.2.el6.src.rpm 2> & 1 | grep-v mock

Attachment: kernel-2.6.32-431.11.2.el6.src.rpm source abroad, download speed may be slow, you can use BGP machine room or VPN acceleration.

Source code address:
Http://vault.centos.org/6.5/ OS /Source/SPackages/
Http://vault.centos.org/6.5/updates/Source/SPackages/


3. extract and prepare the source code file [note] you must use the [non-root] user to execute the command
Cd ~ /Rpmbuild/SPECS
Rpmbuild-bp -- target = $ (uname-m) kernel. spec

Note: the source code directory tree of the kernel can be found in ~ /Rpmbuild/BUILD/kernel */linux */found in this directory.


4. compile the new kernel [note] the [non-root] user must be used to execute the command
Cd ~ /Rpmbuild/SPECS
Rpmbuild-bb -- with baseonly -- without debug -- without debuginfo -- target = 'uname-M' kernel. spec 2> build-err.log | tee build-out.log

 

Note: This process may take about 90 minutes. please wait.

Attachment: The rpm file of the custom kernel can be found in ~ /Rpmbuild/RPMS/'uname-m'/directory.


5. install the new kernel [note] you must use the [root] user to execute the command
Su root
Rpm-ivh kernel-*. rpm


6. verify the restart and check the kernel version.
Uname-


References:
[1] CentOS Wiki http://wiki.centos.org/zh/HowTos/Custom_Kernel#head-981e27f326384c58516d3b2051b225526bb0a50a
Related Article

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.