RHEL6.1 use rpmbuild to upgrade the kernel

Source: Internet
Author: User
Tags rpmbuild
RHEL is a commercially supported Linux version. Its software is available for free and free to use. However, patches and technical support are charged. However, according to the GPLv2 protocol, code must be published for any modifications to the kernel. Therefore, RedHat only publishes the source code on the official FTP and does not provide a binary package. For those who have not bought the RHEL service, manually compile the source code into an RPM Binary Package. On RHEL5, it is very easy to compile kernel. src. rpm. A command can be done, but in RHE

RHEL is a commercially supported Linux version. Its software is available for free and free to use. However, patches and technical support are charged.

However, according to the GPLv2 protocol, code must be published for any modifications to the kernel. Therefore, RedHat only publishes the source code on the official FTP and does not provide a binary package. For those who have not bought the RHEL service, manually compile the source code into an RPM Binary Package.

On RHEL5, it is very easy to compile kernel. src. rpm. A single command can be done, but the cup is available in RHEL6.1 .... On the one hand, RedHat has changed some packaging methods to curb Oracle's OEL. On the other hand, the kernel changes a lot from 2.6.18 to 2.6.32, and the span is too large, sometimes changing.

OS: RHEL6U1, kernel: 2.6.32-131.0.15.el6.x86 _ 64

Ensure that the/root space is more than 20 GB.

1) Obtain kernel. src. rpm

Lftp ftp.redhat.com:/pub/redhat/linux/enterprise/6 Server/en/OS/SRPMS

Get kernel-2.6.32-131.6.1.el6.src.rpm # This is the latest kernel.

2) install the dependency package
Yum-y install rpm * xmlto asciidoc elfutils-libelf-devel zlib-devel binutils-devel newt-devel python-devel hmaccalc perl *

Note that asciidoc and newt-devel do not exist. I did not pay attention to it here. I ignored it. When I build it below, I will prompt that the dependent package is missing, so I am in a hurry and try again. Note: When compiling src. rpm of RHEL, do not mess up the dependent packages that google lacks.

3) Compile the kernel
Groupadd mockbuild
Useradd-g mockbuild
Rpm-ivh kernel-2.6.32-131.6.1.el6.src.rpm

Cd/root/rpmbuild/SPEC/
Rpmbuild-bb -- with fireware -- target = 'uname-m' kernel. spec

In this case, you will be prompted that some dependent packages are missing, as long as yum is installed, and asciidoc and newt-devel are not prompted. It does not exist in ISO.

4) solve the dependency
Here, at the beginning, my first reaction was to google, but it was not needed at all. Go to RedHat's FTP

Lftp ftp.redhat.com:/pub/redhat/linux/enterprise/6 Server/en/OS/SRPMS

Get asciidoc-8.4.5-4.1.el6.src.rpm, newt-0.52.11-2.el6.src.rpm

Rpmbuild -- bb -- target = 'uname-m' asciidoc. spec

In this way, the problem of dependent asciidoc can be solved. Newt-devel is a little more troublesome.

When rpmbuild newt, will prompt to rely on slang this package, the same, www.linuxidc.com disc is not provided, and then get the slang-2.2.1-1.el6.src.rpm from ftp, and in rpmbuild slang prompt to rely on oniguruma, it is not in the CD, and then get the oniguruma-5.9.1-3.1.el6.src.rpm from ftp

So build oniguruma first, then slang, And newt-devel.

So far, the dependency is resolved.

5) recompile
Rpmbuild -- bb -- with firmware -- target = 'uname-m' kernel. spec.

Then there is a long wait. When gpg: WARNING: unsafe permissions on homedir '.' is displayed, wait patiently.

6) Compilation takes a long time .. Have more coffee. : D

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.