blob: 4248c23b44279fd85eaeb5feccf9b9569dc50812 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
2
3Selecting a Device Manager
4**************************
5
6The Yocto Project provides multiple ways to manage the device manager
7(``/dev``):
8
9- Persistent and Pre-Populated ``/dev``: For this case, the ``/dev``
10 directory is persistent and the required device nodes are created
11 during the build.
12
13- Use ``devtmpfs`` with a Device Manager: For this case, the ``/dev``
14 directory is provided by the kernel as an in-memory file system and
15 is automatically populated by the kernel at runtime. Additional
16 configuration of device nodes is done in user space by a device
17 manager like ``udev`` or ``busybox-mdev``.
18
19Using Persistent and Pre-Populated ``/dev``
20===========================================
21
22To use the static method for device population, you need to set the
23:term:`USE_DEVFS` variable to "0"
24as follows::
25
26 USE_DEVFS = "0"
27
28The content of the resulting ``/dev`` directory is defined in a Device
29Table file. The
30:term:`IMAGE_DEVICE_TABLES`
31variable defines the Device Table to use and should be set in the
32machine or distro configuration file. Alternatively, you can set this
33variable in your ``local.conf`` configuration file.
34
35If you do not define the :term:`IMAGE_DEVICE_TABLES` variable, the default
36``device_table-minimal.txt`` is used::
37
38 IMAGE_DEVICE_TABLES = "device_table-mymachine.txt"
39
40The population is handled by the ``makedevs`` utility during image
41creation:
42
43Using ``devtmpfs`` and a Device Manager
44=======================================
45
46To use the dynamic method for device population, you need to use (or be
47sure to set) the :term:`USE_DEVFS`
48variable to "1", which is the default::
49
50 USE_DEVFS = "1"
51
52With this
53setting, the resulting ``/dev`` directory is populated by the kernel
54using ``devtmpfs``. Make sure the corresponding kernel configuration
55variable ``CONFIG_DEVTMPFS`` is set when building you build a Linux
56kernel.
57
58All devices created by ``devtmpfs`` will be owned by ``root`` and have
59permissions ``0600``.
60
61To have more control over the device nodes, you can use a device manager
62like ``udev`` or ``busybox-mdev``. You choose the device manager by
63defining the ``VIRTUAL-RUNTIME_dev_manager`` variable in your machine or
64distro configuration file. Alternatively, you can set this variable in
65your ``local.conf`` configuration file::
66
67 VIRTUAL-RUNTIME_dev_manager = "udev"
68
69 # Some alternative values
70 # VIRTUAL-RUNTIME_dev_manager = "busybox-mdev"
71 # VIRTUAL-RUNTIME_dev_manager = "systemd"
72