linux/debian
Ben Hutchings 59b5fabac6 debian/control,debian/rules,debian/rules.d: Support the 'nodoc' build profile 2016-05-15 03:11:42 +01:00
..
abi/4.5.0-2 Add ABI reference for 4.5.0-2 2016-05-07 01:37:59 +01:00
bin fix tools disabling in arch-specific rules 2016-05-14 19:07:15 +01:00
certs Fix config for module signing 2016-04-04 10:41:46 +01:00
config [mipsel/octeon] Activate flavour on mipsel. 2016-05-13 18:58:54 +02:00
installer Build udebs for the mipsel/octeon flavour 2016-05-14 21:07:32 +02:00
lib/python/debian_linux debian_linux.utils._read_rfc822: Parse and ignore comments 2016-05-14 19:54:34 +01:00
patches KEYS: Fix ASN.1 indefinite length object parsing (CVE-2016-0758) 2016-05-14 05:18:04 +02:00
rules.d debian/control,debian/rules,debian/rules.d: Support the 'nodoc' build profile 2016-05-15 03:11:42 +01:00
source * debian: Ignore *.local. 2014-05-18 16:48:07 +00:00
templates debian/control,debian/rules,debian/rules.d: Support the 'nodoc' build profile 2016-05-15 03:11:42 +01:00
tests selftests: Run non-default tests 2015-10-31 22:17:39 +00:00
.gitignore Merge linux-tools source package into linux (Closes: #550379, #573483, #816500) 2016-03-21 01:32:16 +00:00
README.Debian README.Debian: Change more URLs to use https: scheme 2016-04-25 00:52:47 +02:00
README.source stable-update: Rewrite stable-update.sh in Python 2016-05-06 21:37:36 +01:00
changelog debian/control,debian/rules,debian/rules.d: Support the 'nodoc' build profile 2016-05-15 03:11:42 +01:00
compat * debian/changelog: Update. 2009-03-24 13:25:43 +00:00
copyright debian/copyright: Note that extract-cert and sign-file are under LGPL 2.1 2016-04-04 10:41:48 +01:00
hyperv-daemons.README.Debian Rename README.Debian.hyperv-daemon so dh_installdocs finds it 2015-07-13 00:12:58 +00:00
hyperv-daemons.hv-fcopy-daemon.init hyperv-daemons: Add init scripts 2016-02-21 15:03:47 +00:00
hyperv-daemons.hv-fcopy-daemon.service Add hyperv-daemons package 2015-06-28 18:44:20 +00:00
hyperv-daemons.hv-kvp-daemon.init hyperv-daemons: Add init scripts 2016-02-21 15:03:47 +00:00
hyperv-daemons.hv-kvp-daemon.service Add hyperv-daemons package 2015-06-28 18:44:20 +00:00
hyperv-daemons.hv-vss-daemon.init hyperv-daemons: Add init scripts 2016-02-21 15:03:47 +00:00
hyperv-daemons.hv-vss-daemon.service Add hyperv-daemons package 2015-06-28 18:44:20 +00:00
hyperv-daemons.install Add hyperv-daemons package 2015-06-28 18:44:20 +00:00
libcpupower-dev.install Build tools from power/cpupower 2016-03-20 15:49:21 +00:00
libcpupower0.install Build tools from power/cpupower 2016-03-20 15:49:21 +00:00
libcpupower0.symbols Build tools from power/cpupower 2016-03-20 15:49:21 +00:00
liblockdep-dev.README.Debian Improve liblockdep documentation a little 2015-08-14 14:25:33 +02:00
liblockdep-dev.docs Add liblockdep packages 2015-08-14 00:21:08 +02:00
liblockdep-dev.install Add liblockdep packages 2015-08-14 00:21:08 +02:00
libusbip-dev.install Build usbip userland packages (Closes: #568362) 2012-06-20 06:04:10 +00:00
linux-cpupower.install Build tools from power/cpupower 2016-03-20 15:49:21 +00:00
lockdep.dirs Fix parallel builds of both arch and indep binaries 2015-12-10 02:44:23 +00:00
rules debian/control,debian/rules,debian/rules.d: Support the 'nodoc' build profile 2016-05-15 03:11:42 +01:00
rules.defs Use dpkg makefile to define architecture variables 2016-03-20 22:24:13 +00:00
rules.real debian/control,debian/rules,debian/rules.d: Support the 'nodoc' build profile 2016-05-15 03:11:42 +01:00
usbip.install debian/control,debian/rules,debian/rules.d: Support the 'nodoc' build profile 2016-05-15 03:11:42 +01:00
usbip.manpages debian/control,debian/rules,debian/rules.d: Support the 'nodoc' build profile 2016-05-15 03:11:42 +01:00
watch debian/watch: Add watch file and update script 2013-06-24 02:04:54 +00:00

README.source

Updating the upstream source
============================

In addition to the build-dependencies, you will need the rsync and
unifdef packages installed.

1) It is recommended to fetch the release tag from the relevant upstream git
   repository, one of:

   * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
   * https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
   * git://kernel.ubuntu.com/ubuntu/linux.git

   However, it is also possible to use upstream tarball and patch releases.
   Both tags and files should be signed by the relevant maintainer, which
   you *must* verify using commands such as:

   $ git tag -v v4.5
   $ xzcat linux-4.5.tar.xz | gpg --verify linux-4.5.tar.sign -
   $ xzcat patch-4.5.1.xz | gpg --verify patch-4.5.1.sign -

   The upstream maintainers' key fingerprints are:

   pub   2048R/00411886 2011-09-20
         Key fingerprint = ABAF 11C6 5A29 70B1 30AB  E3C4 79BE 3E43 0041 1886
   uid                  Linus Torvalds <torvalds@linux-foundation.org>
   sub   2048R/012F54CA 2011-09-20

   pub   4096R/6092693E 2011-09-23
         Key fingerprint = 647F 2865 4894 E3BD 4571  99BE 38DB BDC8 6092 693E
   uid                  Greg Kroah-Hartman (Linux kernel stable release signing key) <greg@kroah.com>
   sub   4096R/76D54749 2011-09-23

   pub   4096R/FDCE24FC 2011-12-10
         Key fingerprint = D4E1 E317 4470 9144 B0F8  101A DB74 AEB8 FDCE 24FC
   uid                  Luis Henriques <luis.henriques@canonical.com>
   uid                  Luis Henriques <henrix@camandro.org>
   sub   4096R/EFBC394A 2011-12-10

2) Run: ./debian/bin/genorig.py <repository>
   or:  ./debian/bin/genorig.py <tarball> [patch]

   This will produce ../orig/linux_<version>.orig.tar.xz
   (e.g. linux_3.5~rc1.orig.tar.xz).

   It involves applying several patches and file deletions for DFSG
   compliance, as listed in debian/patches/series-orig.  Occasionally
   you will need to refresh these.

3) Run: make -f debian/rules orig

   This will apply the main quilt series to the upstream source, which
   will usually fail due to conflicts with upstream changes.  You need
   to resolve those by dropping or refreshing patches.

Recording updates in the changelog
----------------------------------

Upstream commits that we already cherry-picked and included in a
previous package upload should not be mentioned, since they don't make
any difference to the package.  Any other commits that fix a Debian
bug report and/or a security issue with a CVE ID should always be
listed, along with the (Closes: #nnnnnn) and/or (CVE-yyyy-nnnn)
reference.

Aside from those general rules:

* For an upstream release candidate, don't attempt to list the changes

* For a stable release by Linus, refer to the summary at
  kernelnewbies.org, e.g. http://kernelnewbies.org/Linux_4.5

* For a stable update, refer to the changelog on kernel.org, e.g.
  https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.5.1, and
  list all changes that are relevant to our package and that fix bugs
  that we would consider 'important' or higher severity

  - The script debian/bin/stable-update updates the changelog
    version and inserts the list of changes.  It doesn't attempt to
    filter out irrelevant or unimportant changes.

  - The script debian/bin/ckt-stable-update.sh does the same for
    stable updates by the Canonical Kernel Team.

  - If you have time, please delete irrelevant changes such as:
    + Fixes for architectures not supported by the package
    + Fixes for drivers that aren't enabled in any of our configurations
    + Build fixes for configurations that we don't use
    + Fixes for lockdep false positives

If you have time, please add bracketted prefixes to the upstream
change list as described below under "Changelog conventions".

Applying patches to the Debian kernel tree
==========================================

The Debian kernel packaging uses the quilt patch system, but with
multiple series to allow for featuresets.

Patches are stored below debian/patches, loosely sorted in bugfix/,
features/ and debian/. Patches are in the standard kernel patch
format (unified diff to be applied with patch -p1) and generally have
DEP-3 headers.

The series file 'series' is used for all configurations and a series
file 'series-<featureset>' is used for each optional featureset.

If you want to generate a source tree with all patches applied, run
make -f debian/rules source

The resulting source can be found below debian/build.

Changelog conventions
=====================

If a change only affects some architectures, flavours or featuresets,
this should be noted with a bracketted prefix on the changelog line:

* [<fset>] Change to featureset <fset>
* [<arch>] Change that affects Debian architecture <arch>
* [<arch1>,<arch2>...] Change that affects Debian architectures
  <arch1>, <arch2>, ...
* [<arch>/<flavour>] Change that affects kernel flavour <flavour>
  on Debian architecture <arch>
* [<arch>/{<flavour1>,<flavour2>...}] Change that affects kernel
  flavours <flavour1>, <flavour2>, ... on Debian architecture <arch>

You can use wildcards to cover multiple values, e.g. 'arm*' for armel,
armhf and arm64 architectures.  Also 'x86' is used to cover the Debian
architectures amd64, i386 and x32.

Kernel config files
===================
Configuration files are constructed dynamically from a number of config
files, as listed in debian/config/<arch>/defines.

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.

TODO:
- Patches applied to the upstream source
- How to define a flavour
- More detail on generation of debian/control and configs

Running tests
=============

linux supports autopkgtest and should be able to run most of the
kernel's self-tests on any architecture where kexec is supported,
but it has higher resource requirements than most packages:

- A VM with plenty of disk space (10GB is enough), RAM (1GB is
  probably enough) and at least 2 CPUs
- The temporary directory for adt-virt-qemu (-o option) will need
  several GB of space, so a tmpfs may not be suitable

Note that if you tell adt-run to use an 'unbuilt tree' (i.e. an
unpacked source package) it does not exclude VCS directories such as
.git.  Either use a packed source package or copy the working tree
elsewhere excluding .git.

Example invocation:

    adt-run -B ../linux-image-4.2.0-rc6-amd64_4.2~rc6-1~exp2_amd64.deb \
        ../linux_4.2~rc6-1~exp2.dsc \
	--timeout-test=1200 \
        --- adt-virt-qemu /var/cache/autopkgtest/adt-sid.img -o /var/tmp -c 2