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>
This commit is contained in:
Richard Purdie 2010-10-22 13:00:40 +01:00
parent 00a96a2099
commit 36f1ae42fe
7 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -135,7 +135,6 @@ python base_do_setscene () {
bb.build.make_stamp("do_setscene", d)
}
do_setscene[selfstamp] = "1"
do_setscene[dirs] = "${PSEUDO_LOCALSTATEDIR}"
addtask setscene before do_fetch
addtask fetch

View File

@ -1096,6 +1096,8 @@ python do_package_setscene () {
sstate_setscene(d)
}
addtask do_package_setscene
do_package_setscene[fakeroot] = "1"
# Dummy task to mark when all packaging is complete
do_package_write () {

View File

@ -273,6 +273,7 @@ python do_package_write_deb_setscene () {
sstate_setscene(d)
}
addtask do_package_write_deb_setscene
do_package_write_deb_setscene[fakeroot] = "1"
python () {
if bb.data.getVar('PACKAGES', d, True) != '':

View File

@ -317,6 +317,7 @@ python do_package_write_ipk_setscene () {
sstate_setscene(d)
}
addtask do_package_write_ipk_setscene
do_package_write_ipk_setscene[fakeroot] = "1"
python () {
if bb.data.getVar('PACKAGES', d, True) != '':

View File

@ -556,6 +556,7 @@ python do_package_write_rpm_setscene () {
sstate_setscene(d)
}
addtask do_package_write_rpm_setscene
do_package_write_rpm_setscene[fakeroot] = "1"
python do_package_write_rpm () {
bb.build.exec_func("read_subpackage_metadata", d)

View File

@ -546,6 +546,7 @@ SRC_URI = "file://${FILE}"
PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
FAKEROOT = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_NOSYMLINKEXP=1 pseudo"
FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_NOSYMLINKEXP=1 LD_PRELOAD=libpseudo.so LD_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE}/pseudo/lib64:${STAGING_LIBDIR_NATIVE}/pseudo/lib"
FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"