summaryrefslogtreecommitdiff
path: root/gentree.py
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-07-29 19:22:57 -0700
committerLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-07-29 19:46:49 -0700
commitc7a661f59d9885b20319a5074f602716a9f603a1 (patch)
tree97dad8bac3c3b037ac7883aa9896c34c4f3cb42e /gentree.py
parentadd3f1786bb17a801c0fb87489cb8e0dd671bbd6 (diff)
backports: enable kconfig language on dependencies file
Certain complex features that are backported may be be limitted to a certain target build configuration. An example can be if a backported feature is not yet backported with support for lockdep. In order to avoid build failures with these types of restrictions allow for specifying build configuration dependencies on backported upstream kconfig symbols other than just kernel versioning contstraints. This adds support for specifying upstream kconfig constaints other than kernel versioning by adding kconfig language extensions on the dependencies file. This will update the copied over upstream Kconfig file for the symbol specified with the kconfig constraints specified. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Diffstat (limited to 'gentree.py')
-rwxr-xr-xgentree.py32
1 files changed, 25 insertions, 7 deletions
diff --git a/gentree.py b/gentree.py
index b6c98e80..c480c98b 100755
--- a/gentree.py
+++ b/gentree.py
@@ -41,20 +41,35 @@ def read_dependencies(depfilename):
"""
Read a (the) dependency file and return the list of
dependencies as a dictionary, mapping a Kconfig symbol
- to a list of kernel version dependencies. While reading
- ignore blank/commented lines.
+ to a list of kernel version dependencies.
+
+ If a backported feature that an upstream backported driver
+ depends on had kconfig limitations (ie, debugging feature not
+ available) a built constaint restriction can be expressed
+ by using a kconfig expression. The kconfig expressions can
+ be specified by using the "kconfig: " prefix.
+
+ While reading ignore blank or commented lines.
"""
ret = {}
depfile = open(depfilename, 'r')
for item in depfile:
+ kconfig_exp = ""
item = item.strip()
if not item or item[0] == '#':
continue
- sym, dep = item.split()
- if not sym in ret:
- ret[sym] = [dep, ]
+ if "kconfig:" in item:
+ sym, kconfig_exp = item.split(" ", 1)
+ if not sym in ret:
+ ret[sym] = [kconfig_exp, ]
+ else:
+ ret[sym].append(kconfig_exp)
else:
- ret[sym].append(dep)
+ sym, dep = item.split()
+ if not sym in ret:
+ ret[sym] = [dep, ]
+ else:
+ ret[sym].append(dep)
return ret
@@ -513,7 +528,10 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None,
for sym in tuple(deplist.keys()):
new = []
for dep in deplist[sym]:
- if dep == "DISABLE":
+ if "kconfig:" in dep:
+ kconfig_expr = dep.replace('kconfig: ', '')
+ new.append(kconfig_expr)
+ elif (dep == "DISABLE"):
new.append('BACKPORT_DISABLED_KCONFIG_OPTION')
else:
new.append('!BACKPORT_KERNEL_%s' % dep.replace('.', '_'))