summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorMichael Ho <Michael.Ho@bmw.de>2018-11-29 14:21:36 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-03 21:16:00 +0000
commitaa83cb5264554dd1963042f905688afc796e98d0 (patch)
tree9647388f4f5ed43a06ebf7048a1ba5a89e5124e1 /meta/classes/sstate.bbclass
parent99f505422bc06ba26ac39baa6138669fabfb4fea (diff)
downloadpoky-aa83cb5264554dd1963042f905688afc796e98d0.tar.gz
sstate: add support for caching shared workdir tasks
The sstate bbclass uses workdir as a hardcoded string in path manipulations. This means that the sstate caching mechanism does not work for the work-shared directory which the kernel uses to share its build configuration and source files for out of tree kernel modules. This commit modifies the path manipulation mechanism to use the work-shared directory if detected in the paths when handling the sstate cache packages. (From OE-Core rev: 27642449f95e38598f9c83948ce109c5891e5877) Signed-off-by: Michael Ho <Michael.Ho@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index be5f19b33e..0abebce699 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -362,7 +362,10 @@ def sstate_installpkgdir(ss, d):
362 362
363 for plain in ss['plaindirs']: 363 for plain in ss['plaindirs']:
364 workdir = d.getVar('WORKDIR') 364 workdir = d.getVar('WORKDIR')
365 sharedworkdir = os.path.join(d.getVar('TMPDIR', True), "work-shared")
365 src = sstateinst + "/" + plain.replace(workdir, '') 366 src = sstateinst + "/" + plain.replace(workdir, '')
367 if sharedworkdir in plain:
368 src = sstateinst + "/" + plain.replace(sharedworkdir, '')
366 dest = plain 369 dest = plain
367 bb.utils.mkdirhier(src) 370 bb.utils.mkdirhier(src)
368 prepdir(dest) 371 prepdir(dest)
@@ -620,8 +623,11 @@ def sstate_package(ss, d):
620 os.rename(state[1], sstatebuild + state[0]) 623 os.rename(state[1], sstatebuild + state[0])
621 624
622 workdir = d.getVar('WORKDIR') 625 workdir = d.getVar('WORKDIR')
626 sharedworkdir = os.path.join(d.getVar('TMPDIR', True), "work-shared")
623 for plain in ss['plaindirs']: 627 for plain in ss['plaindirs']:
624 pdir = plain.replace(workdir, sstatebuild) 628 pdir = plain.replace(workdir, sstatebuild)
629 if sharedworkdir in plain:
630 pdir = plain.replace(sharedworkdir, sstatebuild)
625 bb.utils.mkdirhier(plain) 631 bb.utils.mkdirhier(plain)
626 bb.utils.mkdirhier(pdir) 632 bb.utils.mkdirhier(pdir)
627 os.rename(plain, pdir) 633 os.rename(plain, pdir)