From 36f1ae42fe13dae174b7fb5eb85dc49d7d7b516b Mon Sep 17 00:00:00 2001
From: Richard Purdie <rpurdie@linux.intel.com>
Date: Fri, 22 Oct 2010 13:00:40 +0100
Subject: pseudo/fakeroot: Move the pseudo directory creation into bitbake

If sstate was used to accelerate a build, the pseudo directory might not have
been created leading to subsequent task failures.

Also, sstate packages were not being installed under pseudo context meaning
file permissions could have been lost.

Fix these problems by creating a FAKEROOTDIRS variable which bitbake ensures
exists before running tasks and running the appropriate setscene tasks under
fakeroot context.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
---
 bitbake/lib/bb/runqueue.py | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'bitbake')

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 0d80a6934..0a319d2c4 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1066,6 +1066,10 @@ class RunQueueExecute:
                 for var in envvars:
                     comps = var.split("=")
                     env[comps[0]] = comps[1]
+                fakedirs = (the_data.getVar("FAKEROOTDIRS", True) or "").split()
+                for p in fakedirs:
+                    bb.mkdirhier(p)
+                bb.msg.debug(2, bb.msg.domain.RunQueue, "Running %s:%s under fakeroot, state dir is %s" % (fn, taskname, fakedirs))
 
             env['BB_TASKHASH'] = self.rqdata.runq_hash[task]
             env['PATH'] = self.cooker.configuration.initial_path
-- 
cgit v1.2.3