diff options
Diffstat (limited to 'documentation/dev-manual/dev-manual-common-tasks.xml')
-rw-r--r-- | documentation/dev-manual/dev-manual-common-tasks.xml | 109 |
1 files changed, 108 insertions, 1 deletions
diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index 5cfc8bec44..c2a361c6bb 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml | |||
@@ -946,7 +946,7 @@ | |||
946 | Furthermore, you must use <filename>_append</filename> instead | 946 | Furthermore, you must use <filename>_append</filename> instead |
947 | of the <filename>+=</filename> operator if you want to avoid | 947 | of the <filename>+=</filename> operator if you want to avoid |
948 | ordering issues. | 948 | ordering issues. |
949 | The reason for this is because doing so unconditionally appends | 949 | The reason for this is because doing so un>+conditionally appends |
950 | to the variable and avoids ordering problems due to the | 950 | to the variable and avoids ordering problems due to the |
951 | variable being set in image recipes and | 951 | variable being set in image recipes and |
952 | <filename>.bbclass</filename> files with operators like | 952 | <filename>.bbclass</filename> files with operators like |
@@ -7587,6 +7587,113 @@ | |||
7587 | </section> | 7587 | </section> |
7588 | </section> | 7588 | </section> |
7589 | 7589 | ||
7590 | <section id="selecting-dev-manager"> | ||
7591 | <title>Selecting a Device Manager</title> | ||
7592 | |||
7593 | <para> | ||
7594 | The Yocto Project provides multiple ways to manage the device | ||
7595 | manager (<filename>/dev</filename>): | ||
7596 | <itemizedlist> | ||
7597 | <listitem><para><emphasis>Persistent and Pre-Populated<filename>/dev</filename>:</emphasis> | ||
7598 | For this case, the <filename>/dev</filename> directory | ||
7599 | is persistent and the required device nodes are created | ||
7600 | during the build. | ||
7601 | </para></listitem> | ||
7602 | <listitem><para><emphasis>Use <filename>devtmps</filename> with a Device Manager:</emphasis> | ||
7603 | For this case, the <filename>/dev</filename> directory | ||
7604 | is provided by the kernel as an in-memory file system and | ||
7605 | is automatically populated by the kernel at runtime. | ||
7606 | Additional configuration of device nodes is done in user | ||
7607 | space by a device manager like | ||
7608 | <filename>udev</filename> or | ||
7609 | <filename>busybox-mdev</filename>. | ||
7610 | </para></listitem> | ||
7611 | </itemizedlist> | ||
7612 | </para> | ||
7613 | |||
7614 | <section id="static-dev-management"> | ||
7615 | <title>Using Persistent and Pre-Populated<filename>/dev</filename></title> | ||
7616 | |||
7617 | <para> | ||
7618 | To use the static method for device population, you need to | ||
7619 | set the | ||
7620 | <ulink url='&YOCTO_DOCS_REF_URL;#var-USE_DEVFS'><filename>USE_DEVFS</filename></ulink> | ||
7621 | variable to "0" as follows: | ||
7622 | <literallayout class='monospaced'> | ||
7623 | USE_DEVFS = "0" | ||
7624 | </literallayout> | ||
7625 | </para> | ||
7626 | |||
7627 | <para> | ||
7628 | The content of the resulting <filename>/dev</filename> | ||
7629 | directory is defined in a Device Table file. | ||
7630 | The | ||
7631 | <ulink url='&YOCTO_DOCS_REF_URL;#var-IMAGE_DEVICE_TABLES'><filename>IMAGE_DEVICE_TABLES</filename></ulink> | ||
7632 | variable defines the Device Table to use and should be set | ||
7633 | in the machine or distro configuration file. | ||
7634 | Alternatively, you can set this variable in your | ||
7635 | <filename>local.conf</filename> configuration file. | ||
7636 | </para> | ||
7637 | |||
7638 | <para> | ||
7639 | If you do not define the | ||
7640 | <filename>IMAGE_DEVICE_TABLES</filename> variable, the default | ||
7641 | <filename>device_table-minimal.txt</filename> is used: | ||
7642 | <literallayout class='monospaced'> | ||
7643 | IMAGE_DEVICE_TABLES = "device_table-mymachine.txt" | ||
7644 | </literallayout> | ||
7645 | </para> | ||
7646 | |||
7647 | <para> | ||
7648 | The population is handled by the <filename>makedevs</filename> | ||
7649 | utility during image creation: | ||
7650 | </para> | ||
7651 | </section> | ||
7652 | |||
7653 | <section id="devtmps-dev-management"> | ||
7654 | <title>Using <filename>devtmpfs</filename> and a Device Manager</title> | ||
7655 | |||
7656 | <para> | ||
7657 | To use the dynamic method for device population, you need to | ||
7658 | use (or be sure to set) the | ||
7659 | <ulink url='&YOCTO_DOCS_REF_URL;#var-USE_DEVFS'><filename>USE_DEVFS</filename></ulink> | ||
7660 | variable to "1", which is the default: | ||
7661 | <literallayout class='monospaced'> | ||
7662 | USE_DEVFS = "1" | ||
7663 | </literallayout> | ||
7664 | With this setting, the resulting <filename>/dev</filename> | ||
7665 | is populated by the kernel using <filename>devtmpfs</filename>. | ||
7666 | Make sure the corresponding kernel configuration variable | ||
7667 | <filename>CONFIG_DEVTMPFS</filename> is set when building | ||
7668 | you build a linux kernel. | ||
7669 | </para> | ||
7670 | |||
7671 | <para> | ||
7672 | All devices created by <filename>devtmpfs</filename> will be | ||
7673 | owned by <filename>root</filename> and have permissions | ||
7674 | <filename>0600</filename>. | ||
7675 | </para> | ||
7676 | |||
7677 | <para> | ||
7678 | To have more control over the device nodes, you can use a | ||
7679 | device manager like <filename>udev</filename> or | ||
7680 | <filename>busybox-mdev</filename>. | ||
7681 | You choose the device manager by defining the | ||
7682 | <filename>VIRTUAL-RUNTIME_dev_manager</filename> variable | ||
7683 | in your machine or distro configuration file. | ||
7684 | Alternatively, you can set this variable in your | ||
7685 | <filename>local.conf</filename> configuration file: | ||
7686 | <literallayout class='monospaced'> | ||
7687 | VIRTUAL-RUNTIME_dev_manager = "udev" | ||
7688 | |||
7689 | # Some alternative values | ||
7690 | # VIRTUAL-RUNTIME_dev_manager = "busybox-mdev" | ||
7691 | # VIRTUAL-RUNTIME_dev_manager = "systemd" | ||
7692 | </literallayout> | ||
7693 | </para> | ||
7694 | </section> | ||
7695 | </section> | ||
7696 | |||
7590 | <section id="platdev-appdev-srcrev"> | 7697 | <section id="platdev-appdev-srcrev"> |
7591 | <title>Using an External SCM</title> | 7698 | <title>Using an External SCM</title> |
7592 | 7699 | ||