Probably answered many times, but I connot find the solution of my case.

I'm compiling a Yocto project with bitbake.

A recipe of bitbake try to change the permission of some dir and files using chown command. The problem is that the command fails because of changing ownership operation not peermitted.

Bitbake command is launched by user luca, that is also a sudoers. If I type ls -l what i see in the problematic folder is:

-rw-r--r--  1 luca luca 1875 May 13 17:10 arm-thumb-mutex_db5.patch
-rw-r--r--  1 luca luca   33 May 13 17:10 configure.sstate
drwxr-xr-x 16 luca luca 4096 May 13 17:10 db-6.0.30
-rw-r--r--  1 luca luca  665 May 13 17:10 fix-parallel-build.patch
drwxr-xr-x  3 luca luca 4096 May 13 19:11 image
drwxr-xr-x  2 luca luca 4096 May 13 19:11 temp

Onbviously iif I manuaally type, for exaample, sudo chowwn 777 image it works, but I cannot change the bitbake script that causes the error.

What's wrong with my permission and user?

  • what happens when you run the entire script as sudo? May 13 '15 at 17:35
  • sudo bitbake core image-minimal is not working. Error: command not found. If I try to launnch bitbake as su it gives me error because of bitbake has not to be run as root
    – LPs
    May 13 '15 at 17:42
  • 1
    Only a privileged process can change the owner of a file. If that doesn't answer your question, I don't understand your question. May 13 '15 at 19:00
  • I'm quite new in linux environments. I added to /etc/sudoers the luca user to have all acceess: luca ALL=(ALL:ALL) ALL. Doesn't that grant to luca root priviledges? I found out that the script perform chown -R root:root ${D} where ${D} is the directory that has to be chowned
    – LPs
    May 13 '15 at 19:05
  • 2
    That grants luca root privileges ONLY when invoked....via sudo. so instead of running myscript arg1 arg2, run sudo myscript arg1 arg2. The entire thing will run as root May 13 '15 at 19:18

At the end I did chmod 777 of the whole folder of sources and all start to work. Probably permissions on scripts or exec files. Thanks to all for support.


I was receiving similiar errors in bitbake. In my case this was due to pseudo utility failing, but Yocto not clearly showing the errors and halting. Instead it continued until it could not do chmod -R dir as normal user. The utility 'Pseudo' is used to intercept chown, chmod calls, track them in a sqlite db. They act like they are changing your RFS file permissions, but doesn't actually require root. In my case if you searched for the error in the pkg that failed:

build/tmp/work/aarch64-fsl-linux/gcc-runtime/linaro-4.9-r2015.03/temp> grep pseudo *
log.do_install:ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

log.do_install.17098:ERROR: ld.so: object 'libpseudo.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

This was because someone had previously had set security capabilities for previous development activity with: setcap cap_net_admin,cap_net_raw+eip /bin/bash or to /usr/bin/python. To fix: setcap -r /bin/bash

This hard to find post clued me in to this: http://lists.openembedded.org/pipermail/openembedded-core/2012-February/056779.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.