...
 
Commits (1155)

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

!/patches
!/patches*
!*.patch
!*.diff
!series
*.debhelper*
*.local
*.pyc
*.substvars
*-di
......@@ -13,6 +13,7 @@
/control.md5sum
/files
/hyperv-daemons/
/libbpf*/
/libcpupower*/
/liblockdep*/
/libusbip-dev/
......
......@@ -6,7 +6,9 @@ Patches
Debian applies small changes to the kernel source. These are split up into
separated patches addressing individual problems. Each of the patch files
contains a description and mentions the author. The patches can be found
at https://anonscm.debian.org/cgit/kernel/linux.git/tree/debian/patches.
in the source package or at
https://sources.debian.org/src/linux/<version>/debian/patches/
(with the package version substituted).
Config Files
------------
......@@ -47,10 +49,17 @@ Berkeley Database (libdb-dev) installed.
Non-free bits removed
---------------------
See the patches under debian/patches/debian/dfsg.
See the Files-Excluded field in debian/copyright.
Changelog
---------
Older Debian changelog entries are no longer included in binary
packages, but can be found in debian/changelog.old in the source
package.
Further information
-------------------
Debian Linux Kernel Handbook: https://kernel-handbook.alioth.debian.org
or debian-kernel-handbook package
Debian Linux Kernel Handbook:
https://kernel-team.pages.debian.net/kernel-handbook/
or debian-kernel-handbook package
Debian Wiki: https://wiki.debian.org/DebianKernel
Updating the upstream source
============================
In addition to the build-dependencies, you will need the rsync and
unifdef packages installed.
In addition to the build-dependencies, you will need the rsync package
installed.
1) It is recommended to fetch the release tag from the relevant upstream git
repository, one of:
......@@ -43,9 +43,8 @@ unifdef packages installed.
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.
It involves deleting files for DFSG compliance, as listed in the
Files-Excluded field in debian/copyright.
3) Run: make -f debian/rules orig
......@@ -79,9 +78,6 @@ Aside from those general rules:
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
......@@ -102,8 +98,8 @@ 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.
For each optional featureset there is an additional patch directory
debian/patches-<featureset>.
If you want to generate a source tree with all patches applied, run
make -f debian/rules source
......@@ -164,6 +160,16 @@ You can check the final list of configuration files by reading
debian/rules.gen. Each binary-arch_<arch>_<fset>_<flavour>_real
rule passes the list to debian/rules.real as the KCONFIG variable.
These files should be kept in order using the kconfigeditor2
utility from <https://salsa.debian.org/kernel-team/kernel-team>.
With this source package as your working directory, run:
debian/rules source
.../kernel-team/utils/kconfigeditor2/process.py .
This will also warn about any symbols that no longer exist, or
cannot be explicitly configured.
Control file
============
The master control file debian/control must be generated before
......@@ -193,6 +199,14 @@ into the templates:
Normally, the arch-specific contents should be controlled by
adjusting the corresponding defines file.
Build-dependencies that relate to specific binary packages can be
specified in a Build-Depends field in the template for that binary
package. gencontrol.py will append the value to the source package's
Build-Depends-Arch or Build-Depends-Indep field, as appropriate. It
will also use the binary package's Architecture and Build-Profile as
the architecture-qualification and/or restriction for each build-
dependency that doesn't already have them.
TODO:
- Patches applied to the upstream source
- How to define a flavour
......@@ -233,7 +247,32 @@ Several build profiles are understood and supported:
- nodoc: Exclude most documentation
- pkg.linux.notools: Exclude userland tool packages (linux-kbuild-<version>,
linux-perf-<version>, etc.)
- pkg.linux.nokernel: Exclude kernel image and header packages
- pkg.linux.nosource: Exclude source binary package (linux-source-<version>)
- cross: Needed when cross-building. Currently this must be used together
with nopython as the build-dependencies will be unsatisfiable otherwise.
- nopython: Disable Python bindings. This currently disables building the
linux-perf-<version> package, as the perf program embeds Python.
Build rules
===========
The Debian build rules are split across multiple makefiles:
- debian/rules: Standard top-level makefile for Debian package build.
- debian/rules.gen: Intermediate makefile between debian/rules and
debian/rules.real. This is generated by gencontrol.py based on
the configuration under debian/config.
- debian/rules.real: Makefile for building a single kernel flavour
or other group of binary packages.
- debian/rules.d: Makefiles for building userland code from specific
source directories. The directory structure mirrors the kernel
source directories. debian/rules.real uses the "make-tools" to
invoke these makefiles.
All builds *must* be done out-of-tree in a subdirectory of
debian/build, so that the output files do not end up in the
linux-source-<version> binary package. Currently kernel builds use
debian/build/build_<arch>_<featureset>_<flavour>, userland code uses
debian/build/build-tools/<source-dir> and documentation uses
debian/build/build-doc.
#!/usr/bin/env python3
#!/usr/bin/python3
import sys
sys.path.append(sys.path[0] + "/../lib/python")
import optparse
import os
import shutil
......@@ -12,14 +10,14 @@ from urllib.request import urlopen
from urllib.error import HTTPError
from debian_linux.abi import Symbols
from debian_linux.config import *
from debian_linux.debian import *
from debian_linux.config import ConfigCoreDump
from debian_linux.debian import Changelog, VersionLinux
default_url_base = "http://deb.debian.org/debian/"
default_url_base_incoming = "http://incoming.debian.org/debian-buildd/"
default_url_base_ports = "http://ftp.ports.debian.org/debian-ports/"
default_url_base_ports_incoming = "http://incoming.ports.debian.org/"
default_url_base_security = "http://security.debian.org/"
default_url_base = "https://deb.debian.org/debian/"
default_url_base_incoming = "https://incoming.debian.org/debian-buildd/"
default_url_base_ports = "https://deb.debian.org/debian-ports/"
default_url_base_ports_incoming = "https://incoming.ports.debian.org/"
default_url_base_security = "https://deb.debian.org/debian-security/"
class url_debian_flat(object):
......@@ -35,30 +33,30 @@ class url_debian_pool(object):
self.base = base
def __call__(self, source, filename, arch):
return self.base + "pool/main/" + source[0] + "/" + source + "/" + filename
return (self.base + "pool/main/" + source[0] + "/" + source + "/"
+ filename)
class url_debian_ports_pool(url_debian_pool):
def __call__(self, source, filename, arch):
if arch == 'all':
return url_debian_pool.__call__(self, source, filename, arch)
return self.base + "pool-" + arch + "/main/" + source[0] + "/" + source + "/" + filename
return (self.base + "pool-" + arch + "/main/" + source[0] + "/"
+ source + "/" + filename)
class url_debian_security_pool(url_debian_pool):
def __call__(self, source, filename, arch):
return self.base + "pool/updates/main/" + source[0] + "/" + source + "/" + filename
return (self.base + "pool/updates/main/" + source[0] + "/" + source
+ "/" + filename)
class Main(object):
dir = None
def __init__(self, url, url_config=None, arch=None, featureset=None, flavour=None):
def __init__(self, arch=None, featureset=None, flavour=None):
self.log = sys.stdout.write
self.url = self.url_config = url
if url_config is not None:
self.url_config = url_config
self.override_arch = arch
self.override_featureset = featureset
self.override_flavour = flavour
......@@ -72,7 +70,14 @@ class Main(object):
self.version = changelog.version.linux_version
self.version_source = changelog.version.complete
self.config = ConfigCoreDump(fp=open("debian/config.defines.dump", "rb"))
if changelog.distribution.endswith('-security'):
self.urls = [url_base_security]
else:
self.urls = [url_base, url_base_ports,
url_base_incoming, url_base_ports_incoming]
self.config = ConfigCoreDump(fp=open("debian/config.defines.dump",
"rb"))
self.version_abi = self.config['version', ]['abiname']
......@@ -104,14 +109,16 @@ class Main(object):
def get_abi(self, arch, prefix):
try:
version_abi = (self.config['version',]['abiname_base'] + '-' +
self.config['abi', arch]['abiname'])
version_abi = (self.config[('version',)]['abiname_base'] + '-'
+ self.config['abi', arch]['abiname'])
except KeyError:
version_abi = self.version_abi
filename = "linux-headers-%s-%s_%s_%s.deb" % (version_abi, prefix, self.version_source, arch)
f = self.retrieve_package(self.url, filename, arch)
filename = ("linux-headers-%s-%s_%s_%s.deb" %
(version_abi, prefix, self.version_source, arch))
f = self.retrieve_package(filename, arch)
d = self.extract_package(f, "linux-headers-%s_%s" % (prefix, arch))
f1 = d + "/usr/src/linux-headers-%s-%s/Module.symvers" % (version_abi, prefix)
f1 = d + ("/usr/src/linux-headers-%s-%s/Module.symvers" %
(version_abi, prefix))
s = Symbols(open(f1))
shutil.rmtree(d)
return version_abi, s
......@@ -122,18 +129,27 @@ class Main(object):
# pickle.load allows running arbitrary code.
return self.config
def retrieve_package(self, url, filename, arch):
u = url(self.source, filename, arch)
filename_out = self.dir + "/" + filename
def retrieve_package(self, filename, arch):
for i, url in enumerate(self.urls):
u = url(self.source, filename, arch)
filename_out = self.dir + "/" + filename
f_in = urlopen(u)
f_out = open(filename_out, 'wb')
while 1:
r = f_in.read()
if not r:
break
f_out.write(r)
return filename_out
try:
f_in = urlopen(u)
except HTTPError:
if i == len(self.urls) - 1:
# No more URLs to try
raise
else:
continue
f_out = open(filename_out, 'wb')
while 1:
r = f_in.read()
if not r:
break
f_out.write(r)
return filename_out
def save_abi(self, version_abi, symbols, arch, featureset, flavour):
dir = "debian/abi/%s" % version_abi
......@@ -164,9 +180,8 @@ class Main(object):
self.update_flavour(config, arch, featureset, flavour)
def update_flavour(self, config, arch, featureset, flavour):
config_base = config.merge('base', arch, featureset, flavour)
self.log("Updating ABI for arch %s, featureset %s, flavour %s: " % (arch, featureset, flavour))
self.log("Updating ABI for arch %s, featureset %s, flavour %s: " %
(arch, featureset, flavour))
try:
if featureset == 'none':
localversion = flavour
......@@ -183,17 +198,20 @@ class Main(object):
import traceback
traceback.print_exc(None, sys.stdout)
if __name__ == '__main__':
options = optparse.OptionParser()
options.add_option("-i", "--incoming", action="store_true", dest="incoming")
options.add_option("--incoming-config", action="store_true", dest="incoming_config")
options.add_option("--ports", action="store_true", dest="ports")
options.add_option("--security", action="store_true", dest="security")
options.add_option("-u", "--url-base", dest="url_base", default=default_url_base)
options.add_option("--url-base-incoming", dest="url_base_incoming", default=default_url_base_incoming)
options.add_option("--url-base-ports", dest="url_base_ports", default=default_url_base_ports)
options.add_option("--url-base-ports-incoming", dest="url_base_ports_incoming", default=default_url_base_ports_incoming)
options.add_option("--url-base-security", dest="url_base_security", default=default_url_base_security)
options.add_option("-u", "--url-base", dest="url_base",
default=default_url_base)
options.add_option("--url-base-incoming", dest="url_base_incoming",
default=default_url_base_incoming)
options.add_option("--url-base-ports", dest="url_base_ports",
default=default_url_base_ports)
options.add_option("--url-base-ports-incoming",
dest="url_base_ports_incoming",
default=default_url_base_ports_incoming)
options.add_option("--url-base-security", dest="url_base_security",
default=default_url_base_security)
opts, args = options.parse_args()
......@@ -210,15 +228,5 @@ if __name__ == '__main__':
url_base_ports = url_debian_ports_pool(opts.url_base_ports)
url_base_ports_incoming = url_debian_flat(opts.url_base_ports_incoming)
url_base_security = url_debian_security_pool(opts.url_base_security)
if opts.incoming_config:
url = url_config = url_base_incoming
else:
url_config = url_base
if opts.security:
url = url_base_security
elif opts.ports:
url = url_base_ports_incoming if opts.incoming else url_base_ports
else:
url = url_base_incoming if opts.incoming else url_base
Main(url, url_config, **kw)()
Main(**kw)()
#!/usr/bin/python3
import sys
sys.path.append('debian/lib/python')
import fnmatch
import glob
import stat
import os
import re
from debian_linux.abi import Symbols
from debian_linux.config import ConfigCoreDump
from debian_linux.debian import *
from debian_linux.debian import Changelog, VersionLinux
class CheckAbi(object):
......@@ -46,19 +44,22 @@ class CheckAbi(object):
self.filename_new = "%s/Module.symvers" % dir
try:
version_abi = (self.config['version',]['abiname_base'] + '-' +
self.config['abi', arch]['abiname'])
version_abi = (self.config[('version',)]['abiname_base'] + '-'
+ self.config['abi', arch]['abiname'])
except KeyError:
version_abi = self.config['version',]['abiname']
self.filename_ref = "debian/abi/%s/%s_%s_%s" % (version_abi, arch, featureset, flavour)
version_abi = self.config[('version',)]['abiname']
self.filename_ref = ("debian/abi/%s/%s_%s_%s" %
(version_abi, arch, featureset, flavour))
def __call__(self, out):
ret = 0
new = Symbols(open(self.filename_new))
unversioned = [name for name in new if new[name].version == '0x00000000']
unversioned = [name for name in new
if new[name].version == '0x00000000']
if unversioned:
out.write("ABI is not completely versioned! Refusing to continue.\n")
out.write("ABI is not completely versioned! "
"Refusing to continue.\n")
out.write("\nUnversioned symbols:\n")
for name in sorted(unversioned):
self.SymbolInfo(new[name]).write(out, False)
......@@ -82,11 +83,13 @@ class CheckAbi(object):
out.write("ABI has changed! Refusing to continue.\n")
ret = 1
elif change or remove:
out.write("ABI has changed but all changes have been ignored. Continuing.\n")
out.write("ABI has changed but all changes have been ignored. "
"Continuing.\n")
elif add_effective:
out.write("New symbols have been added. Continuing.\n")
elif add:
out.write("New symbols have been added but have been ignored. Continuing.\n")
out.write("New symbols have been added but have been ignored. "
"Continuing.\n")
else:
out.write("No ABI changes.\n")
......@@ -149,9 +152,12 @@ class CheckAbi(object):
def _ignore(self, symbols):
# TODO: let config merge this lists
configs = []
configs.append(self.config.get(('abi', self.arch, self.featureset, self.flavour), {}))
configs.append(self.config.get(('abi', self.arch, None, self.flavour), {}))
configs.append(self.config.get(('abi', self.arch, self.featureset), {}))
configs.append(self.config.get(('abi', self.arch, self.featureset,
self.flavour), {}))
configs.append(self.config.get(('abi', self.arch, None, self.flavour),
{}))
configs.append(self.config.get(('abi', self.arch, self.featureset),
{}))
configs.append(self.config.get(('abi', self.arch), {}))
configs.append(self.config.get(('abi', None, self.featureset), {}))
configs.append(self.config.get(('abi',), {}))
......@@ -183,13 +189,17 @@ class CheckImage(object):
self.changelog = Changelog(version=VersionLinux)[0]
self.config_entry_base = config.merge('base', arch, featureset, flavour)
self.config_entry_build = config.merge('build', arch, featureset, flavour)
self.config_entry_image = config.merge('image', arch, featureset, flavour)