Packaging Linux kernel patches for Debian

Yann Dirson

Debian

dirson@debian.org

$Revision: 1.11 $
Revision History
Revision 1.12000-06-10
Initial plain-text revision
Revision 1.42001-05-14
New "Depends" field
Revision 1.82002-02-08
New syntax "Kernel-version: all"
Revision 2002-02-10
Moved to DocBook, made it more of a real manual
Revision 1.92002-02-14
Kernel-version ranges
Revision 1.102002-02-18
First description of "revision 1" format


Features



The dh_installkpatches debhelper add-on

dh_installkpatches

Name

dh_installkpatches -- install kernel patch into package build directories

Description

dh_installkpatches is a debhelper script that reads debian/package.kpatches or debian/package.kpatches.something files describing one or several revisions of a single kernel patch, and installs them into the package build directory with customized apply and unpatch scripts.

It also sets the kpatch:Depends substitution variable, that you should use in your control file to ensure that generated material in your package get all their dependencies. The use of kpatch:Depends requires a build-dependency on version 0.99.3 or later of the dh-kpatches package.

Options

This program does not take any particular option in addition to the standard debhelper(1) ones.

See also

debhelper(1), make-kpkg(1).

/usr/share/doc/dh-kpatches/kpatches-specs.txt.

Author

This manual page was written by Yann Dirson .

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license can be found under /usr/share/common-licenses/FDL.



Description of the kpatches file format

The syntax of kpatches files is inspired by the syntax of Debian control-files. A kpatches file contains sections, which are separated by one or more empty lines. Each section is made of Key: value lines.



Revision 0 kpatches files

This is the currently supported format for kpatches files. It is to be superceded shortly with a new revision, more general, described later in this document.

The file starts with a section for generic patch information, and then has one for each patchfile, allowing versions of the patch for many kernel versions to be specified in one file.





Revision 1 kpatches files

This will be the next supported format for kpatches files. It has not been implemented yet. It is described here for public review.

There are 3 levels of information in this file. A kernel-patch (1st level) is a set of patch alternatives (2nd level), each of which is made of a sequence of patch operations (3rd level).

The file starts with a section for generic patch information, and then, for each alternative, has an alternative-specific section followed by one section for each patch operation.

An alternative section is syntactically distinguished from an operation section by their mandatory constituent fields.




The alternative-specific parts

A number of alternative-specific fields are used as conditions for this alternative to be considered. This allows not only to specify in the same file versions of the patch for many kernel versions, but also to specify versions of the patch for different kernel flavours. For example, the LTT patch comes for 2 kernel flavours: plain kernel, and RTAI-patched kernel.

The order of alternative sections is significant: the 1st alternative for which all conditions are fullfilled is selected, and all further alternatives are ignored.






Examples of kpatches (revision 0) files