summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-22 22:15:59 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-02-23 22:52:22 +0000
commit77988c32f1c9b3eb9248ac6eb296fb8f4c833752 (patch)
tree91f3d65faac65de51c8c1bdd67564215b89b680d /meta
parent2ede6787ea92d0312a73805870b01c3baa9d4139 (diff)
downloadpoky-77988c32f1c9b3eb9248ac6eb296fb8f4c833752.tar.gz
sstatesig.py: Add handling for machine specific module dependencies
Adding dependencies on machine specific recipes from generic packages causes a rebuild of the generic package per machine if using signatures for the stamp files which is unacceptable. We need to declare that RRECOMMENDS on kernel-module-* are safe and that we shouldn't care about these machine specific dependencies from a stamp perspective. This change adds code which does this. It depends on a change in bitbake to expose the dataCache object which can be used to make the calculations we need to allow this to work correctly. (From OE-Core rev: 91fc672756d45086cdf4e9c6de8e920dcd8cd14e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/sstatesig.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index ee7cbad0d9..5a64882fba 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -1,6 +1,6 @@
1import bb.siggen 1import bb.siggen
2 2
3def sstate_rundepfilter(fn, recipename, task, dep, depname): 3def sstate_rundepfilter(fn, recipename, task, dep, depname, dataCache):
4 # Return True if we should keep the dependency, False to drop it 4 # Return True if we should keep the dependency, False to drop it
5 def isNative(x): 5 def isNative(x):
6 return x.endswith("-native") 6 return x.endswith("-native")
@@ -8,13 +8,16 @@ def sstate_rundepfilter(fn, recipename, task, dep, depname):
8 return x.endswith("-cross") or x.endswith("-cross-initial") or x.endswith("-cross-intermediate") 8 return x.endswith("-cross") or x.endswith("-cross-initial") or x.endswith("-cross-intermediate")
9 def isNativeSDK(x): 9 def isNativeSDK(x):
10 return x.endswith("-nativesdk") 10 return x.endswith("-nativesdk")
11 def isKernel(fn):
12 inherits = " ".join(dataCache.inherits[fn])
13 return inherits.find("module-base.bbclass") != -1 or inherits.find("linux-kernel-base.bbclass") != -1
11 14
12 # Always include our own inter-task dependencies 15 # Always include our own inter-task dependencies
13 if recipename == depname: 16 if recipename == depname:
14 return True 17 return True
15 18
16 # Quilt (patch application) changing isn't likely to affect anything 19 # Quilt (patch application) changing isn't likely to affect anything
17 if depname == "quilt-native": 20 if depname == "quilt-native" and recipename != "quilt-native":
18 return False 21 return False
19 # Don't change native/cross/nativesdk recipe dependencies any further 22 # Don't change native/cross/nativesdk recipe dependencies any further
20 if isNative(recipename) or isCross(recipename) or isNativeSDK(recipename): 23 if isNative(recipename) or isCross(recipename) or isNativeSDK(recipename):
@@ -30,6 +33,17 @@ def sstate_rundepfilter(fn, recipename, task, dep, depname):
30 if depname in ['sysvinit-inittab', 'shadow-securetty', 'opkg-config-base', 'netbase', 'formfactor', 'xserver-xf86-config', 'pointercal', 'base-files']: 33 if depname in ['sysvinit-inittab', 'shadow-securetty', 'opkg-config-base', 'netbase', 'formfactor', 'xserver-xf86-config', 'pointercal', 'base-files']:
31 return False 34 return False
32 35
36 # Kernel modules are well namespaced. We don't want to depend on the kernel's checksum
37 # if we're just doing an RRECOMMENDS_xxx = "kernel-module-*", not least because the checksum
38 # is machine specific.
39 # Therefore if we're not a kernel or a module recipe (inheriting the kernel classes)
40 # and we reccomend a kernel-module, we exclude the dependency.
41 depfn = dep.rsplit(".", 1)[0]
42 if dataCache and isKernel(depfn) and not isKernel(fn):
43 for pkg in dataCache.runrecs[fn]:
44 if " ".join(dataCache.runrecs[fn][pkg]).find("kernel-module-") != -1:
45 return False
46
33 # Default to keep dependencies 47 # Default to keep dependencies
34 return True 48 return True
35 49
@@ -37,15 +51,15 @@ class SignatureGeneratorOEBasic(bb.siggen.SignatureGeneratorBasic):
37 name = "OEBasic" 51 name = "OEBasic"
38 def init_rundepcheck(self, data): 52 def init_rundepcheck(self, data):
39 pass 53 pass
40 def rundep_check(self, fn, recipename, task, dep, depname): 54 def rundep_check(self, fn, recipename, task, dep, depname, dataCache = None):
41 return sstate_rundepfilter(fn, recipename, task, dep, depname) 55 return sstate_rundepfilter(fn, recipename, task, dep, depname, dataCache)
42 56
43class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash): 57class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
44 name = "OEBasicHash" 58 name = "OEBasicHash"
45 def init_rundepcheck(self, data): 59 def init_rundepcheck(self, data):
46 pass 60 pass
47 def rundep_check(self, fn, recipename, task, dep, depname): 61 def rundep_check(self, fn, recipename, task, dep, depname, dataCache = None):
48 return sstate_rundepfilter(fn, recipename, task, dep, depname) 62 return sstate_rundepfilter(fn, recipename, task, dep, depname, dataCache)
49 63
50# Insert these classes into siggen's namespace so it can see and select them 64# Insert these classes into siggen's namespace so it can see and select them
51bb.siggen.SignatureGeneratorOEBasic = SignatureGeneratorOEBasic 65bb.siggen.SignatureGeneratorOEBasic = SignatureGeneratorOEBasic