Fedora Install kernel source code

Source: Internet
Author: User
Tags prepare rpmbuild

Fedora Core source after a long period of development, a lot of users have a good understanding of Fedora 12, here I publish a personal understanding, and you discuss the discussion. There is also a Chinese version of Linux, such as Redhat (Red Hat), Hongqi Linux and so on. At home, the user has been fully affirmed, mainly reflected in its security and stability, it has many similarities with UNIX. But at present, such operating systems are still mainly used in middle and high-end servers.
Install kernel Headers (header file)

This package provides kernel headers and makefiles enough to handle the module compilation in the kernel package. If you need to install drivers and some third-party software, you should need kernel Headers. If a driver requires kernel source code, then perhaps installing kernel headers is enough. Kernel headers can be obtained by installing the Kernel-devel RPM package. This package may not be automatically installed by Fedora. This package can be installed from your Fedora DVD or via FTP and Yum online. Find online in Fedora Software warehouse and update software warehouse while ensuring that they match your system and use the uname command. Example:

[Wisfern@wisfern ~]$ Uname-rm
2.6.32.11-99.fc12.i686.pae i686
If you have upgraded your kernel (using yum), then it is recommended that you use Yum to install the package.
[Wisfern@wisfern ~]$ sudo yum install Kernel-pae-devel

Install kernel source (kernel source)

Generally, you don't need to install kernel source unless you have some particular reason to recompile your kernel source. In any case kernel hesders are necessary.
There are three basic steps to install around kernel sourcede.
1. Preparing the relevant environment
2. Download the kernel source you want (with your current kernel want to match if needed)
3. Install SRC.RPM Package
4. Use Rpmbuild to convert source code to usable state
Note: The following steps will consume at least 400MB of disk space.

prepare the relevant environment

Before you start the installation, you must install two of the necessary packages: Rpmdevtools and yum-utils, which you can install using the following command:

Su-c ' yum install yum-utils rpmdevtools '

Install the kernel.src.rpm you previously selected and downloaded, this process cannot be performed under root user.

Setting up a directory

Rpmdev-setuptree

This command generates the Rpmbuild directory under the current user directory.

Download Kernel source

Access to kernel source code via ' Yum ' (for the latest Fedora kernel source)
The Yum tool can download the latest kernel source code. If it is not found, then there is no update, so use the default Fedora kernel source.
[Wisfern@wisfern desktop]# Yumdownloader–source Kernel (two before the source option-)

Install kernel source

Installing dependency Software

Su-c ' Yum-builddep kernel-<version>.src.rpm '

Install *.SRC.RPM Package

[Wisfern@wisfern Desktop] #sudo RPM-IVH kernel-2.6.32.11-99.fc12.src.rpm
1:kernel ########################################### [100%]

During the installation process, if the following error occurs:

Warning:user Mockbuild does not exist–using root
Warning:group Mockbuild does not exist–using root
It would be nice to create a new group and an account number.
#gourpadd Mockbuild
#useradd mockbuild-g Mockbuild
And then reinstall it again.

Prepare kernel source

To turn the source code into a usable state:
Enter Specs Directory

CD ~/rpmbuild/specs

Execute the following command

rpmbuild-bp–target=$ (UNAME-M) Kernel.spec (two before target option)

The source files can be found in the ~/rpmbuild/build/kernel-2.6.32 directory. Here are two useful directories.
1.linux-2.6.32.i686/arch
Here are the standard kernel.org kernel source containing fedora patches and updates. The system architecture matches the output of the uname-m, generally i686, and if you want, you can have the –target= option use Noarch parameters.
2.vanilla-2.6.32/
This contains only standard kernel.org kernel (no patches and updates).
Note:fedora the detailed process of compiling and configuring kernel source code can be found in the Fedora Wiki.

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.