[OE-core] [PATCH v2 2/3] base-files: create ${base_bindir} etc. instead of /bin, /sbin and /lib

Mark Hatle mark.hatle at windriver.com
Tue Jan 5 00:16:29 UTC 2016


On 1/4/16 5:46 PM, Matthias Schiffer wrote:
> On 01/04/2016 11:59 PM, Mark Hatle wrote:
>> On 1/2/16 5:53 PM, Matthias Schiffer wrote:
>>> These directories conflict with the symlinks created for merged-usr setups.
>>>
>>> Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
>>> ---
>>> v2: create both ${base_libdir} and ${nonarch_base_libdir}
>>>
>>>  meta/recipes-core/base-files/base-files_3.0.14.bb | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
>>> index b71d5c5..2af7ecd 100644
>>> --- a/meta/recipes-core/base-files/base-files_3.0.14.bb
>>> +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
>>> @@ -33,8 +33,8 @@ INHIBIT_DEFAULT_DEPS = "1"
>>>  docdir_append = "/${P}"
>>>  dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
>>>  dirs2775 = ""
>>> -dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
>>> -           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
>>> +dirs755 = "${base_bindir} /boot /dev ${sysconfdir} ${sysconfdir}/default \
>>> +           ${sysconfdir}/skel ${base_libdir} ${nonarch_base_libdir} /mnt /proc ${ROOT_HOME} /run ${base_sbindir} \
>>>             ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
>>>             ${libdir} ${sbindir} ${datadir} \
>>>             ${datadir}/common-licenses ${datadir}/dict ${infodir} \
>>>
>>
>> I agree this new set looks correct.. but I'd like to see the corresponding
>> change to fs-perms that sets the permissions and such for each of these new
>> locations.
>>
>> --Mark
>>
> 
> The current meta/files/fs-perms.txt doesn't mention any of /bin, /sbin
> or /lib, and seemingly never did. I guess they could be added, but that
> could also be done in a separate patch (and as I mentioned in another
> mail, I'm not exactly a fan of the fs-perms concept, so I don't really
> care.)

Actually it does:

# Note: all standard config directories are automatically assigned "0755 root
root false - - -"

Actual definition is buried in the code itself, meta/classes/package.bbclass:

    # By default all of the standard directories specified in
    # bitbake.conf will get 0755 root:root.
    target_path_vars = [    'base_prefix',
                'prefix',
                'exec_prefix',
                'base_bindir',
                'base_sbindir',
                'base_libdir',
                'datadir',
                'sysconfdir',
                'servicedir',
                'sharedstatedir',
                'localstatedir',
                'infodir',
                'mandir',
                'docdir',
                'bindir',
                'sbindir',
                'libexecdir',
                'libdir',
                'includedir',
                'oldincludedir' ]

The problem is people have added 'additional' standard directories since that
time and have NOT updated the table.

So likely the following needs to be added (based on the current bitbake.conf):

nonarch_base_libdir
systemd_unitdir
systemd_system_unitdir
nonarch_libdir
systemd_user_unitdir


As mentioned before.. the problem being solved is: If you don't have the table
of system directories and permission.. and you build a package that uses a
standard system directory.. what owner/group/permission does that directory get?

Answer? depends on the package, package manager and other misc things.. this is
a really really bad case on non-deterministic behavior.  If we run through a
table of operations (this internal table and the one in the fs-perms.txt and
other files, if added) then we can synchronize -all- packages in a build with
the configured system setup.

Note, with the way this was designed.. if /bin should NOT be a directory, the
fs-perms.txt (or additional files provided by a configuration) can simply
declare it as a symlink and the original entry goes away.

A distribution definition is a combination of the distro config file, matching
fs-perms settings, and other associated files.  People miss the fs-perms, I
don't know if they don't realize it's there and why it's there or if they assume
it's a one size fits all default configuration.  (The default does fit many
configurations, but not all....)

--Mark


> Matthias
> 




More information about the Openembedded-core mailing list