Skip to contentSkip to conversation

Setting directories permissions

DISCUSSION Oliver Graute 2 participants 2 messages Jun 13, 2017

lore
Share & tools
lore
#0 lore raw

Hello List,

I try to define a directory permission for a folder to 0775 instead of 0755 in my recipe. But somewhere in the install and packaging process this is overwritten.

in my receipe I do this:

do_install() {
    install -m 0775 -d ${D}${sysconfdir}/folder1/folder2/

I expect this on the target:

root@box:/etc/folder1# ls -la
drwxrwxr-x    2 root     webgrp         512 Jan  1  1970 folder2

but I get only this permissions:

root@box:/etc/folder1# ls -la
drwxr-xr-x    2 root     webgrp         512 Jan  1  1970 folder2

I also tried to define it in the fs-perms.txt file. But this didn't work either.

/etc/folder1/folder2 0775 root webgrp false - - -

some clue how to handle such directory permissions the yocto way?

Best Regards,

Oliver

#1 lore raw

Hi Oliver,

It is not not clear to me what the root cause of this could be... Is this directory shared by several pacakages by any chance?

One trick I am using to figure out in which recipe/package a file or directory is found is the following (from the build directory):

echo tmp*/work/*/*/*/packages-split/*/etc/folder1

This will give you all recipes and packages that might deliver the /etc/folder1 directory...

One thing you might want to try is setting its permissions during the post installation of the package which you can specifiy in your recipe as follows:

pkg_postinst_${PN} () {
       chmod 775 /etc/folder1
}

I hope this helps, Laurent.

Quoted 39 lines · Oliver Graute

Hello List,

I try to define a directory permission for a folder to 0775 instead of 0755 in my recipe. But somewhere in the install and packaging process this is overwritten.

in my receipe I do this:

do_install() {
    install -m 0775 -d ${D}${sysconfdir}/folder1/folder2/

I expect this on the target:

root@box:/etc/folder1# ls -la
drwxrwxr-x    2 root     webgrp         512 Jan  1  1970 folder2

but I get only this permissions:

root@box:/etc/folder1# ls -la
drwxr-xr-x    2 root     webgrp         512 Jan  1  1970 folder2

I also tried to define it in the fs-perms.txt file. But this didn't work either.

/etc/folder1/folder2 0775 root webgrp false - - -

some clue how to handle such directory permissions the yocto way?

Best Regards,

Oliver
--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Signature · 3 lines
Laurent Gauthier
Phone: +33 630 483 429
http://soccasys.com