xref: /OK3568_Linux_fs/buildroot/docs/manual/customize-device-permission-tables.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1// -*- mode:doc; -*-
2// vim: set syntax=asciidoc:
3
4[[customize-device-permission]]
5==== Setting file permissions and ownership and adding custom devices nodes
6
7Sometimes it is needed to set specific permissions or ownership on files
8or device nodes. For example, certain files may need to be owned by
9root. Since the post-build scripts are not run as root, you cannot do
10such changes from there unless you use an explicit fakeroot from the
11post-build script.
12
13Instead, Buildroot provides support for so-called _permission tables_.
14To use this feature, set config option +BR2_ROOTFS_DEVICE_TABLE+ to a
15space-separated list of permission tables, regular text files following
16the xref:makedev-syntax[makedev syntax].
17
18If you are using a static device table (i.e. not using +devtmpfs+,
19+mdev+, or +(e)udev+) then you can add device nodes using the same
20syntax, in so-called _device tables_. To use this feature, set config
21option +BR2_ROOTFS_STATIC_DEVICE_TABLE+ to a space-separated list of
22device tables.
23
24As shown in xref:customize-dir-structure[], the recommended location for
25such files is +board/<company>/<boardname>/+.
26
27It should be noted that if the specific permissions or device nodes are
28related to a specific application, you should set variables
29+FOO_PERMISSIONS+ and +FOO_DEVICES+ in the package's +.mk+ file instead
30(see xref:generic-package-reference[]).
31