summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-26 12:56:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-28 09:20:53 +0100
commit72ab2866e1727c373c3c651f98b1e5b5f3d47e8f (patch)
treea04022f5c2eb8926d4812b3ad7e8342bd44e6277 /meta/classes/sstate.bbclass
parent2045338ab4eda5dfab79c21fea3c4fc7b9732ec9 (diff)
downloadpoky-72ab2866e1727c373c3c651f98b1e5b5f3d47e8f.tar.gz
sstate.bbclass: Add a string representing the lsb release to native/cross sstate
This patch adds the lsb name and revision to the path used for sstate files. This means that reuse of sstate files between different distributions is restricted by default. The behaviour can be configured using mirror urls, for example: SSTATE_MIRRORS = "file://Ubuntu-11.10/(.*) file://Ubuntu/\1 \n" would map Ubuntu 11.10 to a more generic "Ubuntu" named sstate feed. Usually, more modern distros have increased libc versions for example so whilst more older native/cross sstate packages will usually work on newer distros, the opposite is not true. This patch allows development of policy to better handle this although no default policy is currently being used. (From OE-Core rev: 9360fc318cec5c873b17f59b817dd6312c81ee27) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass22
1 files changed, 17 insertions, 5 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index d00779adeb..e87f3c05ab 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -11,14 +11,17 @@ def generate_sstatefn(spec, hash, d):
11 11
12SSTATE_PKGARCH = "${PACKAGE_ARCH}" 12SSTATE_PKGARCH = "${PACKAGE_ARCH}"
13SSTATE_PKGSPEC = "sstate-${PN}-${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}-${PV}-${PR}-${SSTATE_PKGARCH}-${SSTATE_VERSION}-" 13SSTATE_PKGSPEC = "sstate-${PN}-${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}-${PV}-${PR}-${SSTATE_PKGARCH}-${SSTATE_VERSION}-"
14SSTATE_PKGNAME = "${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC', True), d.getVar('BB_TASKHASH', True), d)}" 14SSTATE_PKGNAME = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC', True), d.getVar('BB_TASKHASH', True), d)}"
15SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}" 15SSTATE_PKG = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
16SSTATE_PATHSPEC = "${SSTATE_DIR}/*/${SSTATE_PKGSPEC}" 16SSTATE_EXTRAPATH = ""
17SSTATE_EXTRAPATHWILDCARD = ""
18SSTATE_PATHSPEC = "${SSTATE_DIR}/${SSTATE_EXTRAPATHWILDCARD}*/${SSTATE_PKGSPEC}"
19
17 20
18SSTATE_SCAN_FILES ?= "*.la *-config *_config" 21SSTATE_SCAN_FILES ?= "*.la *-config *_config"
19SSTATE_SCAN_CMD ?= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES", True).split())}" \) -type f' 22SSTATE_SCAN_CMD ?= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES", True).split())}" \) -type f'
20 23
21BB_HASHFILENAME = "${SSTATE_PKGSPEC}" 24BB_HASHFILENAME = "${SSTATE_EXTRAPATH} ${SSTATE_PKGSPEC}"
22 25
23SSTATE_MANMACH ?= "${SSTATE_PKGARCH}" 26SSTATE_MANMACH ?= "${SSTATE_PKGARCH}"
24 27
@@ -43,6 +46,10 @@ python () {
43 else: 46 else:
44 d.setVar('SSTATE_MANMACH', d.expand("${MACHINE}")) 47 d.setVar('SSTATE_MANMACH', d.expand("${MACHINE}"))
45 48
49 if bb.data.inherits_class('native', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross', d):
50 d.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/")
51 d.setVar('SSTATE_EXTRAPATHWILDCARD', "*/")
52
46 # These classes encode staging paths into their scripts data so can only be 53 # These classes encode staging paths into their scripts data so can only be
47 # reused if we manipulate the paths 54 # reused if we manipulate the paths
48 if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d) or bb.data.inherits_class('crosssdk', d): 55 if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d) or bb.data.inherits_class('crosssdk', d):
@@ -524,7 +531,10 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
524 } 531 }
525 532
526 for task in range(len(sq_fn)): 533 for task in range(len(sq_fn)):
527 sstatefile = d.expand("${SSTATE_DIR}/" + generate_sstatefn(sq_hashfn[task], sq_hash[task], d) + "_" + mapping[sq_task[task]] + ".tgz") 534 spec = sq_hashfn[task].split(" ")[1]
535 extrapath = sq_hashfn[task].split(" ")[0]
536
537 sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + mapping[sq_task[task]] + ".tgz")
528 if os.path.exists(sstatefile): 538 if os.path.exists(sstatefile):
529 bb.debug(2, "SState: Found valid sstate file %s" % sstatefile) 539 bb.debug(2, "SState: Found valid sstate file %s" % sstatefile)
530 ret.append(task) 540 ret.append(task)
@@ -548,7 +558,9 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d):
548 if task in ret: 558 if task in ret:
549 continue 559 continue
550 560
551 sstatefile = d.expand(generate_sstatefn(sq_hashfn[task], sq_hash[task], d) + "_" + mapping[sq_task[task]] + ".tgz") 561 spec = sq_hashfn[task].split(" ")[1]
562 extrapath = sq_hashfn[task].split(" ")[0]
563 sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + mapping[sq_task[task]] + ".tgz")
552 564
553 srcuri = "file://" + sstatefile 565 srcuri = "file://" + sstatefile
554 localdata.setVar('SRC_URI', srcuri) 566 localdata.setVar('SRC_URI', srcuri)