aboutsummaryrefslogtreecommitdiffstats
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:14:47 +0000
commit27642449f95e38598f9c83948ce109c5891e5877 (patch)
tree385873119aaf92f31c8089f9802a03c592db822a
parente0db1beb6db624b3b743e780c298c63a1e177cfb (diff)
downloadopenembedded-core-contrib-27642449f95e38598f9c83948ce109c5891e5877.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. Signed-off-by: Michael Ho <Michael.Ho@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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):
for plain in ss['plaindirs']:
workdir = d.getVar('WORKDIR')
+ sharedworkdir = os.path.join(d.getVar('TMPDIR', True), "work-shared")
src = sstateinst + "/" + plain.replace(workdir, '')
+ if sharedworkdir in plain:
+ src = sstateinst + "/" + plain.replace(sharedworkdir, '')
dest = plain
bb.utils.mkdirhier(src)
prepdir(dest)
@@ -620,8 +623,11 @@ def sstate_package(ss, d):
os.rename(state[1], sstatebuild + state[0])
workdir = d.getVar('WORKDIR')
+ sharedworkdir = os.path.join(d.getVar('TMPDIR', True), "work-shared")
for plain in ss['plaindirs']:
pdir = plain.replace(workdir, sstatebuild)
+ if sharedworkdir in plain:
+ pdir = plain.replace(sharedworkdir, sstatebuild)
bb.utils.mkdirhier(plain)
bb.utils.mkdirhier(pdir)
os.rename(plain, pdir)
href='#n192'>192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281