Fakeroot: Dealing with the need for "root"

Sometimes packages requires root permissions in order to perform some action, such as changing user or group owners or creating device nodes. Since OpenEmbedded will not keep the user and group information it's usually preferably to remove that from the makefiles. For device nodes it's usually preferably to create them from the initial device node lists or via udev configuration.

However if you can't get by without root permissions then you can use fakeroot to simulate a root environment, without the need to really give root access.

Using fakeroot is done by prefixing the task:

fakeroot do_install() {

Since this requires fakeroot you also need to add a dependency on fakeroot-native:

DEPENDS = "fakeroot-native"

See the fuse recipe for an example. Further information on fakeroot, including a description of it works, is provided in the reference section: fakeroot.