Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: "Rifenbark, Scott M" <scott.m.rifenbark@intel.com>,
	openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH RFC] image: Enable fakeroot for the devshell
Date: Mon, 18 Feb 2013 13:28:08 +0000	[thread overview]
Message-ID: <1361194088.5927.17.camel@ted> (raw)

The rootfs task runs under fakeroot. This converts the devshell to do the same,
allowing the user easier debugging of problems like permissions for example.

I'm really after to provoke some discussion with this patch. There are a
variety of cases where it would be desirable to run devshell in fakeroot
context. This patch enables it for one, the image generation case but
there are others.

We have several options:

a) Add these in on a case by case basis. Image generation is one which
is clearly makes sense to me.
b) Always enable fakeroot for devshell. The downside is some calls
accessing the user's session won't work properly. You'd have to run
those in the form "PSEUDO_UNLOAD=1 <command>"
c) Add a new fakerootdevshell task which sits along side devshell but
starts devshell with fakeroot privileges.

Adding a new task is relatively expensive in parsing performance and in
runqueue generation. I'm not sure whether there is enough of a case for
two different tasks or that it would user friendly. I'm therefore
seriously considering b) but would be interested in the opinions of
others. The attached patch implements a) as a proof of concept. b) would
be just adding those lines to devshell.bbclass instead.

Regardless of which we pick, we need to document it, cc'ing Scott s he
knows there is a change in this area brewing and needed before release.

[YOCTO #3374]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/image.bbclass |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index dd78acb..0d737c3 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -184,6 +184,9 @@ do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
 do_rootfs[cleandirs] += "${S} ${WORKDIR}/intercept_scripts"
 do_build[nostamp] = "1"
 
+do_devshell[depends] += "virtual/fakeroot-native:do_populate_sysroot"
+do_devshell[fakeroot] = "1"
+
 # Must call real_do_rootfs() from inside here, rather than as a separate
 # task, so that we have a single fakeroot context for the whole process.
 do_rootfs[umask] = "022"





             reply	other threads:[~2013-02-18 23:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 13:28 Richard Purdie [this message]
2013-02-19 18:16 ` [PATCH RFC] image: Enable fakeroot for the devshell Mark Hatle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1361194088.5927.17.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=scott.m.rifenbark@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox