backports: add support for backport_srctree
PATCH 1/1 backports: add support for backport_srctree
From: "Luis R. Rodriguez" <[email protected]>
The Linux kernel uses srctree to help prefix header files and scripts. When backporting we want to be able to override driver's Makefiles' usage of srctree with our own. Since we can't easily and sanely override the srctree itself without causing a lot of issues just use the python generator to do the change for us on the target Makefiles. This addresses the srctree usage case and where ccflags was used without prefixing any parent directory when used with drivers, the kernel tends to fix that with addtree command.
---
Running ckmake now too so you can either apply or wait.
backport/Makefile.kernel | 2 ++ gentree.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-)
backport/Makefile.kernel +2 -0
@@ -15,6 +15,8 @@ NOSTDINC_FLAGS := \ $(BACKPORTS_GIT_TRACKER_DEF) \ $(CFLAGS) +backport_srctree = $(M) + obj-y += compat/ obj-$(CPTCFG_CFG80211) += net/wireless/
gentree.py +3 -1
@@ -478,11 +478,13 @@ def process(kerneldir, outdir, copy_list_file, git_revision=None, data = open(os.path.join(root, f), 'r').read() for r in regexes: data = r.sub(r'CPTCFG_\1', data) + data = re.sub(r'srctree', 'backport_srctree', data) + data = re.sub(r'-Idrivers', '-I$(backport_srctree)/drivers', data) fo = open(os.path.join(root, f), 'w') fo.write(data) fo.close() - git_debug_snapshot(args, "rename config symbol usage") + git_debug_snapshot(args, "rename config symbol / srctree usage") # disable unbuildable Kconfig symbols and stuff Makefiles that doesn't exist maketree = make.MakeTree(os.path.join(args.outdir, 'Makefile.kernel'))
Signature · 1 line
1.7.10.4
Quoted 26 lines · Luis R. Rodriguez
From: "Luis R. Rodriguez" <[email protected]>
The Linux kernel uses srctree to help prefix header files and scripts. When backporting we want to be able to override driver's Makefiles' usage of srctree with our own. Since we can't easily and sanely override the srctree itself without causing a lot of issues just use the python generator to do the change for us on the target Makefiles. This addresses the srctree usage case and where ccflags was used without prefixing any parent directory when used with drivers, the kernel tends to fix that with addtree command.
Signed-off-by Luis R. Rodriguez <[email protected]>---
Running ckmake now too so you can either apply or wait.
backport/Makefile.kernel | 2 ++ gentree.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-)backport/Makefile.kernel +0
-0
backport/Makefile.kernel NOSTDINC_FLAGS := \ · line 18
Quoted 4 lines
backport/Makefile.kernel +1
-0@@ -15,6 +15,8 @@ NOSTDINC_FLAGS := \ $(BACKPORTS_GIT_TRACKER_DEF) \ $(CFLAGS) +backport_srctree = $(M)
this needs to be just srctree as the gen script will add the backport prefix for us.
ckmake test 1 failed :)
Luis
Quoted 31 lines · Luis R. Rodriguez
Quoted 29 lines · Luis R. Rodriguez
From: "Luis R. Rodriguez" <[email protected]>
The Linux kernel uses srctree to help prefix header files and scripts. When backporting we want to be able to override driver's Makefiles' usage of srctree with our own. Since we can't easily and sanely override the srctree itself without causing a lot of issues just use the python generator to do the change for us on the target Makefiles. This addresses the srctree usage case and where ccflags was used without prefixing any parent directory when used with drivers, the kernel tends to fix that with addtree command.
Signed-off-by Luis R. Rodriguez <[email protected]>---
Running ckmake now too so you can either apply or wait.
backport/Makefile.kernel | 2 ++ gentree.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-)backport/Makefile.kernel +0
-0@@ -15,6 +15,8 @@ NOSTDINC_FLAGS := \ $(BACKPORTS_GIT_TRACKER_DEF) \ $(CFLAGS)
Quoted 4 lines
backport/Makefile.kernel NOSTDINC_FLAGS := \ · line 18
Quoted 1 line
backport/Makefile.kernel +1
-0+backport_srctree = $(M)this needs to be just srctree as the gen script will add the backport prefix for us.
I'd probably be a little more careful in teh regex and just replace "$(srctree)" (needs escaping for regex)?
johannes