How to create an Rpm package for the RedHatLinux2.6 kernel-Linux general technology-Linux programming and kernel information: See the following for details. RedHat Enterprise Edition since AS4 and since FC3, the rpm installation package of kernel-sourcecode is no longer provided separately, because RedHat does not consider it necessary to maintain a separate kernel-sourcecode package, because all source code packages should be included. in. src. in rpm instead of in rpm. Therefore, you can manually install these later versions of RedHat packages, or compile the kernel-source package through kernel-*. src. rpm. The following method can be used to optimize some parameters and code of the RedHat kernel. Therefore, it is advantageous to use the RedHat release, especially the Enterprise version.
However, many people still cannot tell the relationship between kernel, kernel development, kernel source code, and some packages, so they often make detours when compiling the kernel, at the same time, the RedHat official website does not provide clear instructions for obtaining the kernel-source, which makes many users unable to get the necessary information.
First, identify the content and purpose of each rpm package.
Kernel-*. rpm ------------- kernel Binary Package. If no binary package exists, the system cannot start. Kernel-sourcecode -*. rpm ------------------- kernel source code package, installed in/usr/src/linux-* kernel compilation), but the high version of RedHat Linux does not provide this rpm, for the reason, see the official Release Note, the ultimate goal of this article is to develop this package by ourselves.
Kernel-devel-*. rpm -------------- kernel development kit, installed in/usr/src/kernels for kernel module development. The organization is similar to the kernel source code package and contains some kernel source code. Note that many people mistakenly think that this is the kernel source code package and use it to compile the kernel directly. Of course, it is impossible to succeed. This package is only used for kernel module level-1 development, such as drivers. Although you can also make menuconfig make dep, make bzImage is impossible because the core source code is missing.
Kernel -*. src. rpm --------------- the source code package provided by RedHat for creating rpm is installed in/usr/src/redhat. You can use rpmbuild to build all the packages mentioned above from this package.
Now let's start with src. rpm compiles all the above packages. Other packages except the sourcecode package can be directly built by rpmwithout any modification. Only sourcecode is troublesome, follow the steps below. I will use the RedHat AS4 version as an example. The other versions are the same.
# First install src. rpm
| CODE: rpm-ivh kernel-2.6.9-5.EL.src.rpm |