Tux
Communication
Mailing lists
Documentation
User Manual
Target board info.
Target chip info.
Support
Linux support
Bugzilla
Downloads
STLinux
Updates
Search
Google


The web
stlinux.com
Getting Started
Linux Support Packages (LSP)
ST Logo
Previous   Contents   Next

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.

SRPMs

First a bit of background on SRPMS. SRPMs contain everything necessary to build a package. This typically includes:

  • a single archive file, usually a .tar file, exactly as provided by the original vendor.
  • any patches which need to be applied, to the source code. This can be for any reason (to fix bugs, upgrade to a later version, add a new feature etc.), however the most common patch we provide is to add support for a new CPU, or for cross compilation.
  • a .spec file, which describes how the package should be built, and installed (including any dependencies on other packages).

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 Sources

Having 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.

LSPs

To 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:

  1. The cross LSP contains the sources for a pre-configured kernel for a particular board. This can be built simply by typing make dep; make.
  2. The target LSP contains a built version of the kernel for a particular board. This can be downloaded directly onto the target, and executed immediately.

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

Package stm-host-kernel
Contains Generic kernel source code
Installed /opt/STM/ST40Linux-1.0/devkit/kernel/kernel_version
Package stm-cross-cpu-lsp-board
Contains Cross LSP: Pre-configured and patched kernel source code
Installed /opt/STM/ST40Linux-1.0/devkit/lsp/board/kernel_version
Package stm-cpu-lsp-board
Contains Target LSP: Compiled kernel binary images
Installed /opt/STM/ST40Linux-1.0/devkit/cpu/target/boot

Kernel version numbers

Another area which has caused some confusion is kernel and LSP version numbers. These have an additional version number compared to normal RPMs. For example

stm-host-kernel-2.4.17_st0.1-4.src.rpm

Here there are several version numbers, taking them in order:

Name Meaning
2.4.17 This is the Linux kernel version which we started from.
st1.0 This is the version number of the modifications ST have made to this kernel, and will be shared by the generic kernel source and LSP source and binary packages.
4 This is the package's release number, and incremented each time a change is made to a particular package (typically a change to the .spec file.
Previous   Contents   Next
Valid HTML 4.01! Last updated: 2002/03/26 17:52:00
© Copyright STMicroelectronics Limited, 2005
Printer