Skip to contentSkip to conversation

File permissions not correctly set when using custom FILESYSTEM_PERMS_TABLES

DISCUSSION Hanke Fabian (DC/PAR) 1 participant 2 messages Feb 9

lore
Share & tools
lore
#0 lore raw

Hello,

I’m trying to use FILESYSTEM_PERMS_TABLES with a custom file system permission file which includes the following line:

${localstatedir}/foo 0777 root root true 0777 root root

But when I package the following recipe (after cleaning):

FILES:${PN} = "${localstatedir}/foo/test"

do_install () {
mkdir -p ${D}${localstatedir}/foo
echo "test" > ${D}${localstatedir}/foo/test
}

the test file ends up with wrong permissions (missing the write for group and others) for some reason:

$ ls -l /home/user/workspace/deployment/yocto/build/tmp-glibc/work/corei7-64-oe-linux/var-test/1.0-r0/package/var/foo/
total 4.0K
-rwxr-xr-x 2 user user 5 Feb  9 09:48 test

I also enabled some debug logs in package.bbclass and it seems that my permission table file is correctly read:
NOTE: Fixup Perms: /var/foo: /var/foo 0777 0 0 true 0777 0 0

Did someone else experience a similar issue?

I’m using kirkstone branch with poky distribution.

Best regards,

Fabian Hanke

--------------------
Bosch Rexroth AG

#1 lore raw

I guess I figured it already on my own. I forgot that bitbake runs in some fakeroot/pseudo environment which does some user/permission magic behind the scenes:
https://docs.yoctoproject.org/dev/overview-manual/concepts.html#fakeroot-and-pseudo

--------------------------------

Bosch Rexroth AG

Registered Office: Stuttgart, Registration Court: Amtsgericht Stuttgart HRB 23192 Executive Board: Dr. Steffen Haack (President), Roland Bittenauer, Thomas Fechner, Holger von Hebel, Reinhard Schäfer Chairman of the Supervisory Board: Dr. Markus Forschner