diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2019-11-19 06:29:38 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-11-19 06:42:10 +0000 |
commit | 676810be344246ac9cc6b7d558b97164225d37ea (patch) | |
tree | 6fa302c8e2431959b42ba837f83263919e556cc5 | |
parent | 4eb6faf28cfe7c623b6d71ed61fe2e98b1bad7ca (diff) | |
download | kernel_replicant_linux-676810be344246ac9cc6b7d558b97164225d37ea.tar.gz kernel_replicant_linux-676810be344246ac9cc6b7d558b97164225d37ea.tar.bz2 kernel_replicant_linux-676810be344246ac9cc6b7d558b97164225d37ea.zip |
debian/lib/python/debian_linux/abi.py: Add support for namespaces
Exported symbols can now be defined to belong to a specific namespace,
and Module.symvers includes this as an additional field between name
and module.
The namespace can be an empty string, so when reading we need to split
fields on '\t' and not the default of one-or-more-whitespace. We then
also need to separate fields with '\t' when writing an ABI reference.
Namespaces are intended for grouping symbols exported for use by
groups of in-tree modules, and we ought to add support for ignoring
ABI changes on this basis. For now, just add it as an attribute of
Symbol which is compared when checking for ABI changes.
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | debian/lib/python/debian_linux/abi.py | 14 |
2 files changed, 9 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog index 2ea5c6fef815..6307c9e6dbfb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,7 @@ linux (5.4~rc7-1~exp1) UNRELEASED; urgency=medium LOCK_DOWN_IN_EFI_SECURE_BOOT * [armel/marvell] lockdown: Disable Lockdown as it now selects MODULE_SIG * [amd64] Update "x86: Make x32 syscall support conditional …" for 5.4 + * debian/lib/python/debian_linux/abi.py: Add support for symbol namespaces [ Romain Perier ] * Rebased the following patches onto 5.4.x: diff --git a/debian/lib/python/debian_linux/abi.py b/debian/lib/python/debian_linux/abi.py index 8532db16da8e..ab6feb53956c 100644 --- a/debian/lib/python/debian_linux/abi.py +++ b/debian/lib/python/debian_linux/abi.py @@ -1,6 +1,6 @@ class Symbol(object): - def __init__(self, name, module, version, export): - self.name, self.module = name, module + def __init__(self, name, namespace, module, version, export): + self.name, self.namespace, self.module = name, namespace, module self.version, self.export = version, export def __eq__(self, other): @@ -12,6 +12,8 @@ class Symbol(object): # modules is not an ABI change. Compare everything else. if self.name != other.name: return False + if self.namespace != other.namespace: + return False if self.version != other.version: return False if self.export != other.export: @@ -33,10 +35,10 @@ class Symbols(dict): def read(self, file): for line in file: - version, name, module, export = line.strip().split() - self[name] = Symbol(name, module, version, export) + version, name, namespace, module, export = line.split('\t') + self[name] = Symbol(name, namespace, module, version, export) def write(self, file): for s in sorted(self.values(), key=lambda i: i.name): - file.write("%s %s %s %s\n" % - (s.version, s.name, s.module, s.export)) + file.write("%s\t%s\t%s\t%s\n" % + (s.version, s.name, s.namespace, s.module, s.export)) |