diff options
author | Michael Ho <Michael.Ho@bmw.de> | 2018-11-29 14:21:36 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-06 16:38:30 +0000 |
commit | 5646749d60b003b30d30d68c342eefb513dd8373 (patch) | |
tree | a4f6364ab6df8c288deef4687bb127d7132c9d9f | |
parent | 179c5cb7fd0f06970135187f1203507aa55d6bde (diff) | |
download | poky-5646749d60b003b30d30d68c342eefb513dd8373.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)
(From OE-Core rev: f57d83c72b5f53fb10bc8377862668580d331a8c)
Signed-off-by: Michael Ho <Michael.Ho@bmw.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/sstate.bbclass | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 9f059a04a0..e61490ae90 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) |