summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-10-22 13:00:40 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-10-22 13:00:40 +0100
commit36f1ae42fe13dae174b7fb5eb85dc49d7d7b516b (patch)
tree0bf129fbd24cc21652ffa387400b4925c24218f9
parent00a96a20995cefacc52e10559029de32941ecf6e (diff)
downloadpoky-36f1ae42fe13dae174b7fb5eb85dc49d7d7b516b.tar.gz
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>
-rw-r--r--bitbake/lib/bb/runqueue.py4
-rw-r--r--meta/classes/base.bbclass1
-rw-r--r--meta/classes/package.bbclass2
-rw-r--r--meta/classes/package_deb.bbclass1
-rw-r--r--meta/classes/package_ipk.bbclass1
-rw-r--r--meta/classes/package_rpm.bbclass1
-rw-r--r--meta/conf/bitbake.conf1
7 files changed, 10 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 0d80a6934c..0a319d2c42 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1066,6 +1066,10 @@ class RunQueueExecute:
1066 for var in envvars: 1066 for var in envvars:
1067 comps = var.split("=") 1067 comps = var.split("=")
1068 env[comps[0]] = comps[1] 1068 env[comps[0]] = comps[1]
1069 fakedirs = (the_data.getVar("FAKEROOTDIRS", True) or "").split()
1070 for p in fakedirs:
1071 bb.mkdirhier(p)
1072 bb.msg.debug(2, bb.msg.domain.RunQueue, "Running %s:%s under fakeroot, state dir is %s" % (fn, taskname, fakedirs))
1069 1073
1070 env['BB_TASKHASH'] = self.rqdata.runq_hash[task] 1074 env['BB_TASKHASH'] = self.rqdata.runq_hash[task]
1071 env['PATH'] = self.cooker.configuration.initial_path 1075 env['PATH'] = self.cooker.configuration.initial_path
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index f540b58fbb..feee524a6b 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -135,7 +135,6 @@ python base_do_setscene () {
135 bb.build.make_stamp("do_setscene", d) 135 bb.build.make_stamp("do_setscene", d)
136} 136}
137do_setscene[selfstamp] = "1" 137do_setscene[selfstamp] = "1"
138do_setscene[dirs] = "${PSEUDO_LOCALSTATEDIR}"
139addtask setscene before do_fetch 138addtask setscene before do_fetch
140 139
141addtask fetch 140addtask fetch
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index b64ff5de58..a35fbb29ef 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1096,6 +1096,8 @@ python do_package_setscene () {
1096 sstate_setscene(d) 1096 sstate_setscene(d)
1097} 1097}
1098addtask do_package_setscene 1098addtask do_package_setscene
1099do_package_setscene[fakeroot] = "1"
1100
1099 1101
1100# Dummy task to mark when all packaging is complete 1102# Dummy task to mark when all packaging is complete
1101do_package_write () { 1103do_package_write () {
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 0efef67b82..2f0d78ddb4 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -273,6 +273,7 @@ python do_package_write_deb_setscene () {
273 sstate_setscene(d) 273 sstate_setscene(d)
274} 274}
275addtask do_package_write_deb_setscene 275addtask do_package_write_deb_setscene
276do_package_write_deb_setscene[fakeroot] = "1"
276 277
277python () { 278python () {
278 if bb.data.getVar('PACKAGES', d, True) != '': 279 if bb.data.getVar('PACKAGES', d, True) != '':
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index cac0453685..e93d7e2b16 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -317,6 +317,7 @@ python do_package_write_ipk_setscene () {
317 sstate_setscene(d) 317 sstate_setscene(d)
318} 318}
319addtask do_package_write_ipk_setscene 319addtask do_package_write_ipk_setscene
320do_package_write_ipk_setscene[fakeroot] = "1"
320 321
321python () { 322python () {
322 if bb.data.getVar('PACKAGES', d, True) != '': 323 if bb.data.getVar('PACKAGES', d, True) != '':
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 0af93e7b74..4ad97c35c5 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -556,6 +556,7 @@ python do_package_write_rpm_setscene () {
556 sstate_setscene(d) 556 sstate_setscene(d)
557} 557}
558addtask do_package_write_rpm_setscene 558addtask do_package_write_rpm_setscene
559do_package_write_rpm_setscene[fakeroot] = "1"
559 560
560python do_package_write_rpm () { 561python do_package_write_rpm () {
561 bb.build.exec_func("read_subpackage_metadata", d) 562 bb.build.exec_func("read_subpackage_metadata", d)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 33a6fad30f..13c8f86a62 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -546,6 +546,7 @@ SRC_URI = "file://${FILE}"
546PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/" 546PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
547FAKEROOT = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_NOSYMLINKEXP=1 pseudo" 547FAKEROOT = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_NOSYMLINKEXP=1 pseudo"
548FAKEROOTENV = "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" 548FAKEROOTENV = "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"
549FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
549PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native" 550PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
550 551
551 552