Skip to contentSkip to conversation

ptest: ensure do_install_ptest_base task runs in fakeroot context

PATCH In review Ross Burton 1 participant 2 messages Dec 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ptest: ensure do_install_ptest_base task runs in fakeroot context

As this task is installing files into $D it needs to run inside pseudo so that special permissions and owners are preserved.

---
 meta/classes/ptest.bbclass |    5 +++++
 1 file changed, 5 insertions(+)
meta/classes/ptest.bbclass +5 -0
index 508ea9a..06dddf7 100644
@@ -53,3 +53,8 @@ do_install_ptest_base[cleandirs] = "${D}${PTEST_PATH}"
 addtask configure_ptest_base after do_configure before do_compile
 addtask compile_ptest_base   after do_compile   before do_install
 addtask install_ptest_base   after do_install   before do_package
+
+python () {
+    if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+        d.setVarFlag('do_install_ptest_base', 'fakeroot', 1)
+}
Signature · 1 line
1.7.10.4
#1 lore raw

I should add that this fixes problems like systemd failing rebuilds with crazy errors like:

| tar: sysroot-destdir/usr/lib/systemd/ptest/test/sys/module/uhci_hcd/drivers/pci\:uhci_hcd:
Cannot open: Permission denied

Ross

Quoted 24 lines · Ross Burton

As this task is installing files into $D it needs to run inside pseudo so that special permissions and owners are preserved.

---
 meta/classes/ptest.bbclass |    5 +++++
 1 file changed, 5 insertions(+)
meta/classes/ptest.bbclass +5 -1
index 508ea9a..06dddf7 100644
@@ -53,3 +53,8 @@ do_install_ptest_base[cleandirs] = "${D}${PTEST_PATH}"
 addtask configure_ptest_base after do_configure before do_compile
 addtask compile_ptest_base   after do_compile   before do_install
 addtask install_ptest_base   after do_install   before do_package
+
+python () {
+    if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+        d.setVarFlag('do_install_ptest_base', 'fakeroot', 1)
+}
--

1.7.10.4