[OE-core] [PATCH 2/7] shadow: add a -native recipe with customized utilities

Mark Hatle mark.hatle at windriver.com
Wed Jun 1 21:05:42 UTC 2011


On 6/1/11 12:43 PM, Scott Garman wrote:
> On 06/01/2011 02:47 AM, Phil Blundell wrote:
>> On Tue, 2011-05-31 at 12:53 -0700, Scott Garman wrote:
>>> This adds a -native recipe for the shadow utilities.
>>>
>>> The custom --root option allows the the following utilities to be
>>> run within a chroot when invoked under pseudo:
>>
>> Rather than patching the code for all these utilities, can't you just
>> wrap them in a call to chroot(8)?  That is, make useradd.bbclass do:
>>
>> eval $PSEUDO chroot ${STAGING_DIR_TARGET} useradd ...
>>
>> rather than the existing
>>
>> eval $PSEUDO useradd --root ${STAGING_DIR_TARGET} ...
> 
> That's a reasonable suggestion. I haven't tried it yet, but I have found 
> that pseudo's chroot(2) implementation is not complete. One of the cases 
> where it does not work is when forking child processes, which breaks the 
> jail and the child processes are no longer chroot'ed.
> 
> My guess is that chroot(8) is going to call chroot(2) and then fork a 
> child process to run its additional arguments.

chroot should be complete in pseudo, if you can reproduce any failures we should
pass them upstream.

The reason I suggested the --root option was primarily for the ease of people
who are NOT using the automated scripting, i.e. someone manually adding a
preinst (or similar) to their recipes.

The --root option is easier (to me at least) to understand that having to if-def
stuff around a chroot..  (but that is personal preference...)

--Mark

> cc'ing Mark directly in case he has additional comments or needs to 
> correct me.
> 
> Scott
> 





More information about the Openembedded-core mailing list