|
A few people have asked me questions about the Linux kernel sources, and the difference between kernel RPMs, SRPMs, and LSPs. The distribution includes the kernel sources in several forms, and it is not always clear what should be installed and where it will end up. Here I will try and explain what all of these packages are, and what they are used for. SRPMsFirst a bit of background on SRPMS. SRPMs contain everything necessary to build a package. This typically includes:
This is one of the nice features of the RPM system, as it allows a single file to contain all the information needed to build the program, but still in its original form, so it is simple to see where the source code has been modified and by whom. All processing of RPMs is performed using the rpm command. Most people will be familiar with using rpm to install RPMs, but it is also a miniature build system. In this mode rpm can take source code either from individual files or an SRPM, perform all the necessary steps of building and installing the program, and then generate an RPM containing the built program, and an SRPM containing all the sources used. When you install an SRPM, rpm will simply unpack the RPM, and place all the individual files into its SOURCE and SPECS directories. Where this is will depend on your distribution (for example in RedHat it is /usr/src/redhat). Kernel SourcesHaving said all of that about SRPMs, most people won't be interested in rebuilding the supplied programs from source. The exception to this is the Linux kernel, which we expect to be rebuilt frequently. This could be supplied as an SRPM, but as the kernel tends to be heavily patched, unless you're an RPM expert rebuilding from the SRPM can be slightly daunting. To avoid these problem the kernel is actually supplied as an RPM which contains source code. This is the generic kernel source, which can be configured and built for any supported system. This should probably be the starting point when porting the kernel to a new target board. LSPsTo further simplify the kernel build process, kernels are also supplied as Linux Support Packages (LSPs). These are pre-configured kernels for a particular target board, and may contain additional documentation or tools which are only be useful on a particular target board. In addition the LSP process supports patching a kernel for a particular board, although we normally don't do this. LSPs are supplied in two forms:
Thus the cross LSP and the generic kernel RPM's are almost identical, except that the LSP will have already been pre-configured for the appropriate board. As each stage of the build (from generic kernel source, to cross LSP to target LSP) builds on the sources from the previous build, the SRPMs for each of the LSPs will be very small, as they only contain the additional files. Typically this will just be the documentation and configuration files, plus the .spec file for the cross LSP, and the target LSP is usually just the .spec file and nothing else. Summary
Kernel version numbersAnother area which has caused some confusion is kernel and LSP version numbers. These have an additional version number compared to normal RPMs. For example
Here there are several version numbers, taking them in order:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||