Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: Mario Domenech Goulart <mario@ossystems.com.br>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: Ownership issue in package contents
Date: Tue, 31 Mar 2015 16:09:42 -0500	[thread overview]
Message-ID: <551B0D16.8000608@windriver.com> (raw)
In-Reply-To: <87k2xwhoei.fsf@email.parenteses.org>

On 3/31/15 4:01 PM, Mario Domenech Goulart wrote:
> On Tue, 31 Mar 2015 15:51:50 -0500 Mark Hatle <mark.hatle@windriver.com> wrote:
> 
>> On 3/31/15 3:33 PM, Mario Domenech Goulart wrote:
>>>
>>> On Tue, 31 Mar 2015 13:23:00 -0500 Mark Hatle <mark.hatle@windriver.com> wrote:
>>>
>>>> On 3/31/15 12:20 PM, Mario Domenech Goulart wrote:
>>>>>
>>>>> On Tue, 31 Mar 2015 14:50:06 +0100 "Burton, Ross" <ross.burton@intel.com> wrote:
>>>>>
>>>>>> On 27 March 2015 at 17:31, Mario Domenech Goulart <mario@ossystems.com.br> wrote:
>>>>>>
>>>>>>     Note that, although I run "chown -R foo:foo ${D}${libdir}/foo" in
>>>>>>     the recipe, ./usr/lib/foo/ in the package is owned by root.
>>>>>>     However, its content has the right ownership.
>>>>>>
>>>>>> Looks like a bug in pseudo to me, can you file a bug for that?
>>>>>
>>>>> Sure.  Filed #7554.
>>>>
>>>> I'd suggest you look at meta/classes/package.bbclass "fixup_perms" function.
>>>>
>>>> The ${D}${libdir} (and above) are "corrected" to be 'root:root' by this
>>>> function.  I don't know why 'foo' would be, but if it's a standard defined
>>>> variable -- or if 'directory walking' is enabled it could end up doing this as well.
>>>>
>>>> The control file for this is in meta/files/fs-perms.txt (unless otherwise
>>>> defined by a distribution or other configuration file.)
>>>
>>> Thanks a lot.  You seem to have guided me exactly to what causes the
>>> issue.
>>>
>>>>
>>>> Format of the file is:
>>>>
>>>> # The format of this file
>>>> #
>>>> #<path> <mode>  <uid>   <gid>   <walk>  <fmode> <fuid>  <fgid>
>>> ...
>>>>
>>>> The default is:
>>> ...
>>>> libexecdir	0755 root root false - - -
>>> ...
>>>
>>> This variable seems to be the cause of problems:
>>>
>>> $ bitbake -e foo | grep libexecdir=
>>> export libexecdir="/usr/lib/foo"
>>>
>>> As far as I understand, package.bbclass may use a user-configured
>>> permissions table (via FILESYSTEM_PERMS_TABLES), but I'm not sure if
>>> this is the right "fix" for the case in question.  I'd have to hardcode
>>> the owner of /usr/lib/foo to be "foo", but foo may not be available when
>>> packaging other recipes.
>>
>> Ok, good this answers the question as to "why" it's happening.  You can easily
>> fix this by adding a configuration specific fs-perms.txt file (can name it
>> anything) that overrides that setting and add it to the FILESYSTEM_PERMS_TABLES.
>>  You can do this globally in a layer, a distribution or even just a recipe.
>>
>> In your recipe you can likely do something like:
>>
>> FILESYSTEM_PERMS_TABLES ?= "files/fs-perms.txt"
>> FILESYSTEM_PERMS_TABLES += "${THISDIR}/files/recipe-perms.txt"
>>
>> (Do the ?= first in case it's already set by someone else, then add your recipe
>> specific perms later)
>>
>> Contents of the "${THISDIR}/files/recipe-perms.txt":
>>
>> ${libexecdir} 0755 myuid mygid true - myuid mygid
>>
>> Then you can even skip the chown -R, as the system will do it for you.
> 
> I actually had tried that, but I got errors -- probably because the
> ownership will be set for each package that installs ${libexecdir}, and
> which is processed before the recipe that actually creates the
> user/group specified for ${libexecdir} in the file pointed by
> FILESYSTEM_PERMS_TABLES.

This is a bug then.  The owner/group correction is supposed to be made AFTER the
user/groups have been added to the system (sysroot) via the adduser.  THAT is a
bug that IMHO should be fixed sooner, rather then later.

It might be as simple as the install sysroot (${D}) configuration with pseudo
isn't pointing to the right /etc/passwd and /etc/group.  I believe it should be
pointing to the one in the regular sysroot repository.

--Mark

>>> Should libexecdir actually be in the `target_path_vars' variable
>>> (package.bbclass)?
>>
>> That is a good question, and something likely worthy of investigating.  Perhaps
>> removing it from the default set is the correct general purpose change.
>>
>> I wouldn't do it on an existing release, but its worth considering at the
>> beginning of a new release.
> 
> Best wishes.
> Mario
> 



  reply	other threads:[~2015-03-31 21:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 17:31 Ownership issue in package contents Mario Domenech Goulart
2015-03-27 17:43 ` Otavio Salvador
2015-03-31 13:50 ` Burton, Ross
2015-03-31 17:20   ` Mario Domenech Goulart
2015-03-31 18:23     ` Mark Hatle
2015-03-31 20:12       ` Burton, Ross
2015-03-31 20:18         ` Otavio Salvador
2015-03-31 20:33       ` Mario Domenech Goulart
2015-03-31 20:51         ` Mark Hatle
2015-03-31 21:01           ` Mario Domenech Goulart
2015-03-31 21:09             ` Mark Hatle [this message]
2015-03-31 21:21               ` Mario Domenech Goulart
2015-03-31 21:47                 ` Mark Hatle
2015-04-06 12:59                   ` Mario Domenech Goulart
2015-04-06 14:53                     ` Mark Hatle
2015-04-06 14:57                       ` Otavio Salvador
2015-04-06 16:49                         ` 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=551B0D16.8000608@windriver.com \
    --to=mark.hatle@windriver.com \
    --cc=mario@ossystems.com.br \
    --cc=openembedded-core@lists.openembedded.org \
    /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