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 With Linux on ST40
Linux Support Packages (LSP)
ST Logo

A few people have asked me questions about the Linux kernel sources, and the difference between kernel RPMs, SRPMs, and LSP. The problem is that the MontaVista distribution includes the kernel sources in several forms, and it is not always clear what should be installed and where it will end up.

LSPs are pre-configured kernels. They are specific for a particular board, and the LSP source can be built by simply typing make dep; make.

It is important to remember that SRPMs contain the `archives' necessary to build the package, exactly as downloaded from the Internet. Typically this will be a single tar archive, and various patches which need to be applied, together with a .spec file, which describes how the package should be built.

All processing of RPMs is performed using the rpm command. Its normal operation is to install RPMs and SPRMs, but it is also a minature build system, building SRPMs from the component files, and then launching the build process, and packaging the resuts into RPM files.

Normally building an SRPM has two stages (it actually has several, but we'll ignore that for the moment):

  1. The %prep phase which unpacks the tar archive, and applies the patches.
  2. The real %build phase, which build the source code into binaries.

The result of this build is then packaged up into an RPM which contains the binaries.

However, because may people will want the source code for the kernel, it is normal for Linux distributions to supply an RPM (not an SRPM note) which contains the kernel source code. MontaVista do this by breaking the kernel build into two steps:

  1. Performing a build of the kernel SRPM simply performs the %prep stage, and then packages the resulting source tree as an RPM. Hence installing the kernel RPM actually installs the kernel source code, not a built kernel.
  2. Building the kernel into a binary involves building a second SRPM, this time for the board specific LSP. Building the LSP SRPM actually generates two RPMs.
    1. The LSP RPM contains a copy of the kernel source code, with any board specific patches applied, the kernel configuration file installed and a configure already performed, and a README file describing anything special about the board and how to build it.
    2. The LSP binary RPM contains a built version of the LSP, usually in several formats, ready to be booted onto the target harwdare.

Thus the LSP and the kernel RPMs are almost identical, except that the LSP will have already been patched for any board specific modifications which are required, and pre-configured for the appropriate board.

Note that the SRPM for the LSP only contains the kernel configuration file, any board specific patches, the README file and the .spec file. It does not contain the kernel source code, and relies on the kernel sources having already been installed (from the kernel RPM).

Summary of RPMs:

Package kernel
Contains Generic kernel source code
Installed /opt/hardhat/devkit/kernel/kernel_version
Package cpu-kernel-headers
Contains CPU specific kernel headers
Installed /opt/hardhat/devkit/arch/cpu/sys_name/include/asm and /opt/hardhat/devkit/arch/cpu/sys_name/include/linux
Package cpu-board-lsp
Contains Pre-configured and patched kernel source code
Installed /opt/hardhat/devkit/lsp/board/kernel_version
Package cpu-board-lsp-binaries
Contains Compiled kernel binary images
Installed /opt/hardhat/devkit/arch/cpu/target/boot

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

  hhl-kernel-2.4.0-test9-st0.1-4.src.rpm

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

Name Meaning
2.4.0-test9 This is the Linux kernel version which we started from.
st0.1 This is the version number of the modifications we have made to this kernel.
4 This is the release number, and can be thought of as the package's version number.
Valid HTML 4.01! Last updated: 2001/07/31 09:00:27
© Copyright STMicroelectronics Limited, 2005
Printer