Patchwork ptest: ensure do_install_ptest_base task runs in fakeroot context

login
register
mail settings
Submitter Ross Burton
Date Dec. 3, 2013, 5:21 p.m.
Message ID <1386091317-11014-1-git-send-email-ross.burton@intel.com>
Download mbox | patch
Permalink /patch/62745/
State Accepted
Commit b4b1c90bcfe4b3baddabd5bfcea9a264be223908
Headers show

Comments

Ross Burton - Dec. 3, 2013, 5:21 p.m.
As this task is installing files into $D it needs to run inside pseudo so that
special permissions and owners are preserved.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/classes/ptest.bbclass |    5 +++++
 1 file changed, 5 insertions(+)
Ross Burton - Dec. 3, 2013, 5:23 p.m.
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

On 3 December 2013 17:21, Ross Burton <ross.burton@intel.com> wrote:
> As this task is installing files into $D it needs to run inside pseudo so that
> special permissions and owners are preserved.
>
> Signed-off-by: Ross Burton <ross.burton@intel.com>
> ---
>  meta/classes/ptest.bbclass |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
> index 508ea9a..06dddf7 100644
> --- a/meta/classes/ptest.bbclass
> +++ b/meta/classes/ptest.bbclass
> @@ -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
>

Patch

diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
index 508ea9a..06dddf7 100644
--- a/meta/classes/ptest.bbclass
+++ b/meta/classes/ptest.bbclass
@@ -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)
+}