2009-12-12 00:59:10 +00:00
|
|
|
Updating the upstream source
|
|
|
|
============================
|
|
|
|
|
2009-12-12 01:03:44 +00:00
|
|
|
1) You can use either:
|
|
|
|
a) a git repository of the kernel source
|
2012-06-03 15:55:11 +00:00
|
|
|
b) a kernel tarball from kernel.org (e.g. linux-3.4.tar.bz2)
|
|
|
|
and, optionally, a patch (e.g. patch-3.5-rc1.bz2).
|
2009-12-12 00:59:10 +00:00
|
|
|
|
2009-12-12 01:03:44 +00:00
|
|
|
2) Run ./debian/bin/genorig.py <repository>
|
|
|
|
or ./debian/bin/genorig.py <tarball> [patch]
|
2012-06-03 15:55:11 +00:00
|
|
|
This will produce ../orig/linux_<version>.orig.tar.gz
|
|
|
|
(e.g. linux_3.5~rc1.orig.tar.gz).
|
2009-12-12 00:59:10 +00:00
|
|
|
|
2010-03-03 21:55:31 +00:00
|
|
|
(genorig.py requires the python and unifdef packages to be
|
|
|
|
installed)
|
|
|
|
|
2012-06-03 15:55:11 +00:00
|
|
|
3) Unpack linux_<version>.orig.tar.gz, cd into the new directory,
|
2009-12-12 00:59:10 +00:00
|
|
|
and do a 'svn export' to get the debian/ subdirectory.
|
|
|
|
Alternatively unpack using "make -f debian/rules orig".
|
2009-12-08 00:13:52 +00:00
|
|
|
|
2010-03-03 21:55:31 +00:00
|
|
|
(the orig target of the Makefiles requires rsync)
|
|
|
|
|
2009-12-08 00:13:52 +00:00
|
|
|
Applying patches to the Debian kernel tree
|
|
|
|
==========================================
|
|
|
|
|
|
|
|
The Debian kernel packaging uses a custom patching system:
|
|
|
|
|
|
|
|
Patches are stored below debian/patches, loosely sorted in bugfix/,
|
|
|
|
features/ and debian/. Patches are in the standard kernel patch
|
2012-06-03 15:30:52 +00:00
|
|
|
format (unified diff to be applied with patch -p1) and generally have
|
|
|
|
DEP-3 headers.
|
2009-12-08 00:13:52 +00:00
|
|
|
|
|
|
|
The order and the selection of patches which are applied during build
|
2012-06-03 15:30:52 +00:00
|
|
|
time are specified in the series/ subdirectory. The series file 'base'
|
|
|
|
is used for all configurations and the series file 'base-extra' is
|
|
|
|
additionally used for optional featuresets.
|
2009-12-08 00:13:52 +00:00
|
|
|
|
|
|
|
Let's look at the actual series file for 2.6.26-12:
|
|
|
|
|
|
|
|
+ bugfix/all/net-unix-gc-fix-soft-lockups-oom-issues.patch
|
|
|
|
+ bugfix/all/inotify-watch-removal-umount-races.patch
|
|
|
|
+ bugfix/all/atm-duplicate-listen-on-socket-corrupts-the-vcc-table.patch
|
|
|
|
+ bugfix/all/ata-pata_marvell-vs-ahci.patch
|
|
|
|
+ features/sparc/video-sunxvr500-intergraph.patch
|
|
|
|
|
2012-06-03 15:30:52 +00:00
|
|
|
The patches to be applied are specified relative to debian/patches
|
|
|
|
and must be preceded by a "+". The series files may be arbitrarily
|
|
|
|
documented with comments starting with "#".
|
2009-12-08 00:13:52 +00:00
|
|
|
|
|
|
|
Let's now have a look at the series file for the addon kernel flavours
|
|
|
|
of 2.6.26-12:
|
|
|
|
|
|
|
|
+ features/all/xen/dom0-fix-processor-throttling-when-pr-id-is-minus-1.patch featureset=xen
|
|
|
|
|
|
|
|
The same syntax applies for specifing the patches, but an additional
|
|
|
|
argument is needed which specifies the featureset the patch applies to.
|
|
|
|
|
2010-03-01 22:32:20 +00:00
|
|
|
|
|
|
|
If you want to generate a source tree with all patches applied, run
|
|
|
|
make -f debian/rules source-all
|
|
|
|
|
|
|
|
The resulting source can be found below debian/build.
|
|
|
|
|
2009-12-12 00:53:57 +00:00
|
|
|
Kernel config files
|
|
|
|
===================
|
|
|
|
Configuration files are constructed dynamically from a number of config
|
|
|
|
files, as listed in debian/config/<arch>/defines.
|
2009-12-08 00:13:52 +00:00
|
|
|
|
2009-12-12 00:53:57 +00:00
|
|
|
Control file
|
|
|
|
============
|
|
|
|
The master control file debian/control must be generated before
|
|
|
|
the package is uploaded. debian/rules contains the debian/control
|
|
|
|
target, which generates the control file by invoking the
|
|
|
|
debian/bin/gencontrol.py script, which combines the templates from
|
|
|
|
the templates directory and architecture-specific defines file to
|
|
|
|
produce the debian/control file. Note that this target is intentionally
|
|
|
|
made to fail with a non-zero exit code to make sure that it is never
|
|
|
|
run during an automatic build. The following variables are substituted
|
|
|
|
into the templates:
|
|
|
|
|
|
|
|
@version@ Upstream kernel version, for example 2.6.11.
|
|
|
|
@arch@ The Debian arch name, such as powerpc or i386.
|
|
|
|
@flavour@ The build flavour, such as 686 or k7-smp.
|
|
|
|
@class@ The CPU/architecture class; displayed in synopsis. It should
|
|
|
|
be fairly short, as the synopsis is supposed to be <80 chars.
|
|
|
|
It should be in the form "foo class", and will show up in the
|
|
|
|
description as "foo class machines".
|
|
|
|
@longclass@ The CPU/architecture class; displayed in the extended
|
|
|
|
description. The same rules apply as in @class@. If
|
|
|
|
this is unset, it will default to @class@.
|
|
|
|
@desc@ (Potentially) multi-line verbiage that's appended to
|
|
|
|
-image descriptions.
|
|
|
|
@abiname@ Current abiname, a single digit.
|
|
|
|
|
|
|
|
Normally, the arch-specific contents should be controlled by
|
|
|
|
adjusting the corresponding defines file.
|
2009-12-08 00:13:52 +00:00
|
|
|
|
|
|
|
TODO:
|
2009-12-12 00:59:10 +00:00
|
|
|
- Patches applied to the upstream source
|
2009-12-08 00:13:52 +00:00
|
|
|
- How to define a flavour
|
2009-12-12 00:53:57 +00:00
|
|
|
- More detail on generation of debian/control and configs
|
2009-12-08 00:13:52 +00:00
|
|
|
|