features.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. ********
  3. Features
  4. ********
  5. This chapter provides a reference of shipped machine and distro features
  6. you can include as part of your image, a reference on image features you
  7. can select, and a reference on feature backfilling.
  8. Features provide a mechanism for working out which packages should be
  9. included in the generated images. Distributions can select which
  10. features they want to support through the :term:`DISTRO_FEATURES` variable,
  11. which is set or appended to in a distribution's configuration file such
  12. as ``poky.conf``, ``poky-tiny.conf``, ``poky-lsb.conf`` and so forth.
  13. Machine features are set in the :term:`MACHINE_FEATURES` variable, which is
  14. set in the machine configuration file and specifies the hardware
  15. features for a given machine.
  16. These two variables combine to work out which kernel modules, utilities,
  17. and other packages to include. A given distribution can support a
  18. selected subset of features so some machine features might not be
  19. included if the distribution itself does not support them.
  20. One method you can use to determine which recipes are checking to see if
  21. a particular feature is contained or not is to ``grep`` through the
  22. :term:`Metadata` for the feature. Here is an example that
  23. discovers the recipes whose build is potentially changed based on a
  24. given feature::
  25. $ cd poky
  26. $ git grep 'contains.*MACHINE_FEATURES.*feature'
  27. .. _ref-features-machine:
  28. Machine Features
  29. ================
  30. The items below are features you can use with
  31. :term:`MACHINE_FEATURES`. Features do not have a
  32. one-to-one correspondence to packages, and they can go beyond simply
  33. controlling the installation of a package or packages. Sometimes a
  34. feature can influence how certain recipes are built. For example, a
  35. feature might determine whether a particular configure option is
  36. specified within the :ref:`ref-tasks-configure` task
  37. for a particular recipe.
  38. This feature list only represents features as shipped with the Yocto
  39. Project metadata:
  40. - *acpi:* Hardware has ACPI (x86/x86_64 only)
  41. - *alsa:* Hardware has ALSA audio drivers
  42. - *apm:* Hardware uses APM (or APM emulation)
  43. - *bluetooth:* Hardware has integrated BT
  44. - *efi:* Support for booting through EFI
  45. - *ext2:* Hardware HDD or Microdrive
  46. - *keyboard:* Hardware has a keyboard
  47. - *numa:* Hardware has non-uniform memory access
  48. - *pcbios:* Support for booting through BIOS
  49. - *pci:* Hardware has a PCI bus
  50. - *pcmcia:* Hardware has PCMCIA or CompactFlash sockets
  51. - *phone:* Mobile phone (voice) support
  52. - *qemu-usermode:* QEMU can support user-mode emulation for this machine
  53. - *qvga:* Machine has a QVGA (320x240) display
  54. - *rtc:* Machine has a Real-Time Clock
  55. - *screen:* Hardware has a screen
  56. - *serial:* Hardware has serial support (usually RS232)
  57. - *touchscreen:* Hardware has a touchscreen
  58. - *usbgadget:* Hardware is USB gadget device capable
  59. - *usbhost:* Hardware is USB Host capable
  60. - *vfat:* FAT file system support
  61. - *wifi:* Hardware has integrated WiFi
  62. .. _ref-features-distro:
  63. Distro Features
  64. ===============
  65. The items below are features you can use with
  66. :term:`DISTRO_FEATURES` to enable features across
  67. your distribution. Features do not have a one-to-one correspondence to
  68. packages, and they can go beyond simply controlling the installation of
  69. a package or packages. In most cases, the presence or absence of a
  70. feature translates to the appropriate option supplied to the configure
  71. script during the :ref:`ref-tasks-configure` task for
  72. the recipes that optionally support the feature. Appropriate options
  73. must be supplied, and enabling/disabling :term:`PACKAGECONFIG` for the
  74. concerned packages is one way of supplying such options.
  75. Some distro features are also machine features. These select features
  76. make sense to be controlled both at the machine and distribution
  77. configuration level. See the
  78. :term:`COMBINED_FEATURES` variable for more
  79. information.
  80. .. note::
  81. :term:`DISTRO_FEATURES` is normally independent of kernel configuration,
  82. so if a feature specified in :term:`DISTRO_FEATURES` also relies on
  83. support in the kernel, you will also need to ensure that support is
  84. enabled in the kernel configuration.
  85. This list only represents features as shipped with the Yocto Project
  86. metadata, as extra layers can define their own:
  87. - *3g:* Include support for cellular data.
  88. - *acl:* Include :wikipedia:`Access Control List <Access-control_list>` support.
  89. - *alsa:* Include :wikipedia:`Advanced Linux Sound Architecture <Advanced_Linux_Sound_Architecture>`
  90. support (OSS compatibility kernel modules installed if available).
  91. - *api-documentation:* Enables generation of API documentation during
  92. recipe builds. The resulting documentation is added to SDK tarballs
  93. when the ``bitbake -c populate_sdk`` command is used. See the
  94. ":ref:`sdk-manual/appendix-customizing-standard:adding api documentation to the standard sdk`"
  95. section in the Yocto Project Application Development and the
  96. Extensible Software Development Kit (eSDK) manual.
  97. - *bluetooth:* Include bluetooth support (integrated BT only).
  98. - *cramfs:* Include CramFS support.
  99. - *debuginfod:* Include support for getting ELF debugging information through
  100. a :ref:`debuginfod <dev-manual/debugging:using the debuginfod server method>`
  101. server.
  102. - *directfb:* Include DirectFB support.
  103. - *ext2:* Include tools for supporting for devices with internal
  104. HDD/Microdrive for storing files (instead of Flash only devices).
  105. - *gobject-introspection-data:* Include data to support
  106. `GObject Introspection <https://gi.readthedocs.io/en/latest/>`__.
  107. - *ipsec:* Include IPSec support.
  108. - *ipv4:* Include IPv4 support.
  109. - *ipv6:* Include IPv6 support.
  110. - *keyboard:* Include keyboard support (e.g. keymaps will be loaded
  111. during boot).
  112. - *multiarch:* Enable building applications with multiple architecture
  113. support.
  114. - *ld-is-gold:* Use the :wikipedia:`gold <Gold_(linker)>`
  115. linker instead of the standard GCC linker (bfd).
  116. - *ldconfig:* Include support for ldconfig and ``ld.so.conf`` on the
  117. target.
  118. - *lto:* Enable `Link-Time Optimisation <https://gcc.gnu.org/wiki/LinkTimeOptimization>`__.
  119. - *nfc:* Include support for
  120. `Near Field Communication <https://en.wikipedia.org/wiki/Near-field_communication>`__.
  121. - *nfs:* Include NFS client support (for mounting NFS exports on
  122. device).
  123. - *nls:* Include National Language Support (NLS).
  124. - *opengl:* Include the Open Graphics Library, which is a
  125. cross-language, multi-platform application programming interface used
  126. for rendering two and three-dimensional graphics.
  127. - *overlayfs:* Include `OverlayFS <https://docs.kernel.org/filesystems/overlayfs.html>`__
  128. support.
  129. - *pam:* Include :wikipedia:`Pluggable Authentication Module (PAM) <Pluggable_authentication_module>`
  130. support.
  131. - *pci:* Include PCI bus support.
  132. - *pcmcia:* Include PCMCIA/CompactFlash support.
  133. - *polkit:* Include :wikipedia:`Polkit <Polkit>` support.
  134. - *ppp:* Include PPP dialup support.
  135. - *ptest:* Enables building the package tests where supported by
  136. individual recipes. For more information on package tests, see the
  137. ":ref:`dev-manual/packages:testing packages with ptest`" section
  138. in the Yocto Project Development Tasks Manual.
  139. - *pulseaudio:* Include support for
  140. `PulseAudio <https://www.freedesktop.org/wiki/Software/PulseAudio/>`__.
  141. - *selinux:* Include support for
  142. :wikipedia:`Security-Enhanced Linux (SELinux) <Security-Enhanced_Linux>`
  143. (requires `meta-selinux <https://layers.openembedded.org/layerindex/layer/meta-selinux/>`__).
  144. - *seccomp:* Enables building applications with
  145. :wikipedia:`seccomp <Seccomp>` support, to
  146. allow them to strictly restrict the system calls that they are allowed
  147. to invoke.
  148. - *smbfs:* Include SMB networks client support (for mounting
  149. Samba/Microsoft Windows shares on device).
  150. - *systemd:* Include support for this ``init`` manager, which is a full
  151. replacement of for ``init`` with parallel starting of services,
  152. reduced shell overhead, and other features. This ``init`` manager is
  153. used by many distributions.
  154. - *usbgadget:* Include USB Gadget Device support (for USB
  155. networking/serial/storage).
  156. - *usbhost:* Include USB Host support (allows to connect external
  157. keyboard, mouse, storage, network etc).
  158. - *usrmerge:* Merges the ``/bin``, ``/sbin``, ``/lib``, and ``/lib64``
  159. directories into their respective counterparts in the ``/usr``
  160. directory to provide better package and application compatibility.
  161. - *vfat:* Include :wikipedia:`FAT filesystem <File_Allocation_Table>`
  162. support.
  163. - *vulkan:* Include support for the :wikipedia:`Vulkan API <Vulkan>`.
  164. - *wayland:* Include the Wayland display server protocol and the
  165. library that supports it.
  166. - *wifi:* Include WiFi support (integrated only).
  167. - *x11:* Include the X server and libraries.
  168. - *xattr:* Include support for
  169. :wikipedia:`extended file attributes <Extended_file_attributes>`.
  170. - *zeroconf:* Include support for
  171. `zero configuration networking <https://en.wikipedia.org/wiki/Zero-configuration_networking>`__.
  172. .. _ref-features-image:
  173. Image Features
  174. ==============
  175. The contents of images generated by the OpenEmbedded build system can be
  176. controlled by the :term:`IMAGE_FEATURES` and
  177. :term:`EXTRA_IMAGE_FEATURES` variables that
  178. you typically configure in your image recipes. Through these variables,
  179. you can add several different predefined packages such as development
  180. utilities or packages with debug information needed to investigate
  181. application problems or profile applications.
  182. Here are the image features available for all images:
  183. - *allow-empty-password:* Allows Dropbear and OpenSSH to accept
  184. logins from accounts having an empty password string.
  185. - *allow-root-login:* Allows Dropbear and OpenSSH to accept root logins.
  186. - *dbg-pkgs:* Installs debug symbol packages for all packages installed
  187. in a given image.
  188. - *debug-tweaks:* Makes an image suitable for development (e.g. allows
  189. root logins, logins without passwords ---including root ones, and enables
  190. post-installation logging). See the ``allow-empty-password``,
  191. ``allow-root-login``, ``empty-root-password``, and ``post-install-logging``
  192. features in this list for additional information.
  193. - *dev-pkgs:* Installs development packages (headers and extra library
  194. links) for all packages installed in a given image.
  195. - *doc-pkgs:* Installs documentation packages for all packages
  196. installed in a given image.
  197. - *empty-root-password:* This feature or ``debug-tweaks`` is required if
  198. you want to allow root login with an empty password. If these features
  199. are not present in :term:`IMAGE_FEATURES`, a non-empty password is
  200. forced in ``/etc/passwd`` and ``/etc/shadow`` if such files exist.
  201. .. note::
  202. ``empty-root-passwd`` doesn't set an empty root password by itself.
  203. You get an initial empty root password thanks to the
  204. :oe_git:`base-passwd </openembedded-core/tree/meta/recipes-core/base-passwd/>`
  205. and :oe_git:`shadow </openembedded-core/tree/meta/recipes-extended/shadow/>`
  206. recipes, and the presence of ``empty-root-passwd`` or ``debug-tweaks``
  207. just disables the mechanism which forces an non-empty password for the
  208. root user.
  209. - *lic-pkgs:* Installs license packages for all packages installed in a
  210. given image.
  211. - *overlayfs-etc:* Configures the ``/etc`` directory to be in ``overlayfs``.
  212. This allows to store device specific information elsewhere, especially
  213. if the root filesystem is configured to be read-only.
  214. - *package-management:* Installs package management tools and preserves
  215. the package manager database.
  216. - *post-install-logging:* Enables logging postinstall script runs to
  217. the ``/var/log/postinstall.log`` file on first boot of the image on
  218. the target system.
  219. .. note::
  220. To make the ``/var/log`` directory on the target persistent, use the
  221. :term:`VOLATILE_LOG_DIR` variable by setting it to "no".
  222. - *ptest-pkgs:* Installs ptest packages for all ptest-enabled recipes.
  223. - *read-only-rootfs:* Creates an image whose root filesystem is
  224. read-only. See the
  225. ":ref:`dev-manual/read-only-rootfs:creating a read-only root filesystem`"
  226. section in the Yocto Project Development Tasks Manual for more
  227. information.
  228. - *read-only-rootfs-delayed-postinsts:* when specified in conjunction
  229. with ``read-only-rootfs``, specifies that post-install scripts are
  230. still permitted (this assumes that the root filesystem will be made
  231. writeable for the first boot; this feature does not do anything to
  232. ensure that - it just disables the check for post-install scripts.)
  233. - *serial-autologin-root:* when specified in conjunction with
  234. ``empty-root-password`` will automatically login as root on the
  235. serial console. This of course opens up a security hole if the
  236. serial console is potentially accessible to an attacker, so use
  237. with caution.
  238. - *splash:* Enables showing a splash screen during boot. By default,
  239. this screen is provided by ``psplash``, which does allow
  240. customization. If you prefer to use an alternative splash screen
  241. package, you can do so by setting the ``SPLASH`` variable to a
  242. different package name (or names) within the image recipe or at the
  243. distro configuration level.
  244. - *stateless-rootfs:*: specifies that the image should be created as
  245. stateless - when using ``systemd``, ``systemctl-native`` will not
  246. be run on the image, leaving the image for population at runtime by
  247. systemd.
  248. - *staticdev-pkgs:* Installs static development packages, which are
  249. static libraries (i.e. ``*.a`` files), for all packages installed in
  250. a given image.
  251. Some image features are available only when you inherit the
  252. :ref:`ref-classes-core-image` class. The current list of
  253. these valid features is as follows:
  254. - *hwcodecs:* Installs hardware acceleration codecs.
  255. - *nfs-server:* Installs an NFS server.
  256. - *perf:* Installs profiling tools such as ``perf``, ``systemtap``, and
  257. ``LTTng``. For general information on user-space tools, see the
  258. :doc:`/sdk-manual/index` manual.
  259. - *ssh-server-dropbear:* Installs the Dropbear minimal SSH server.
  260. .. note::
  261. As of the 4.1 release, the ``ssh-server-dropbear`` feature also
  262. recommends the ``openssh-sftp-server`` package, which by default
  263. will be pulled into the image. This is because recent versions of
  264. the OpenSSH ``scp`` client now use the SFTP protocol, and thus
  265. require an SFTP server to be present to connect to. However, if
  266. you wish to use the Dropbear ssh server `without` the SFTP server
  267. installed, you can either remove ``ssh-server-dropbear`` from
  268. ``IMAGE_FEATURES`` and add ``dropbear`` to :term:`IMAGE_INSTALL`
  269. instead, or alternatively still use the feature but set
  270. :term:`BAD_RECOMMENDATIONS` as follows::
  271. BAD_RECOMMENDATIONS += "openssh-sftp-server"
  272. - *ssh-server-openssh:* Installs the OpenSSH SSH server, which is more
  273. full-featured than Dropbear. Note that if both the OpenSSH SSH server
  274. and the Dropbear minimal SSH server are present in
  275. :term:`IMAGE_FEATURES`, then OpenSSH will take precedence and Dropbear
  276. will not be installed.
  277. - *tools-debug:* Installs debugging tools such as ``strace`` and
  278. ``gdb``. For information on GDB, see the
  279. ":ref:`dev-manual/debugging:debugging with the gnu project debugger (gdb) remotely`" section
  280. in the Yocto Project Development Tasks Manual. For information on
  281. tracing and profiling, see the :doc:`/profile-manual/index`.
  282. - *tools-sdk:* Installs a full SDK that runs on the device.
  283. - *tools-testapps:* Installs device testing tools (e.g. touchscreen
  284. debugging).
  285. - *weston:* Installs Weston (reference Wayland environment).
  286. - *x11:* Installs the X server.
  287. - *x11-base:* Installs the X server with a minimal environment.
  288. - *x11-sato:* Installs the OpenedHand Sato environment.
  289. .. _ref-features-backfill:
  290. Feature Backfilling
  291. ===================
  292. Sometimes it is necessary in the OpenEmbedded build system to extend
  293. :term:`MACHINE_FEATURES` or
  294. :term:`DISTRO_FEATURES` to control functionality
  295. that was previously enabled and not able to be disabled. For these
  296. cases, we need to add an additional feature item to appear in one of
  297. these variables, but we do not want to force developers who have
  298. existing values of the variables in their configuration to add the new
  299. feature in order to retain the same overall level of functionality.
  300. Thus, the OpenEmbedded build system has a mechanism to automatically
  301. "backfill" these added features into existing distro or machine
  302. configurations. You can see the list of features for which this is done
  303. by finding the
  304. :term:`DISTRO_FEATURES_BACKFILL` and
  305. :term:`MACHINE_FEATURES_BACKFILL`
  306. variables in the ``meta/conf/bitbake.conf`` file.
  307. Because such features are backfilled by default into all configurations
  308. as described in the previous paragraph, developers who wish to disable
  309. the new features need to be able to selectively prevent the backfilling
  310. from occurring. They can do this by adding the undesired feature or
  311. features to the
  312. :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED`
  313. or
  314. :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`
  315. variables for distro features and machine features respectively.
  316. Here are two examples to help illustrate feature backfilling:
  317. - *The "pulseaudio" distro feature option*: Previously, PulseAudio
  318. support was enabled within the Qt and GStreamer frameworks. Because
  319. of this, the feature is backfilled and thus enabled for all distros
  320. through the :term:`DISTRO_FEATURES_BACKFILL` variable in the
  321. ``meta/conf/bitbake.conf`` file. However, your distro needs to
  322. disable the feature. You can disable the feature without affecting
  323. other existing distro configurations that need PulseAudio support by
  324. adding "pulseaudio" to :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED` in
  325. your distro's ``.conf`` file. Adding the feature to this variable
  326. when it also exists in the :term:`DISTRO_FEATURES_BACKFILL` variable
  327. prevents the build system from adding the feature to your
  328. configuration's :term:`DISTRO_FEATURES`, effectively disabling the
  329. feature for that particular distro.
  330. - *The "rtc" machine feature option*: Previously, real time clock (RTC)
  331. support was enabled for all target devices. Because of this, the
  332. feature is backfilled and thus enabled for all machines through the
  333. :term:`MACHINE_FEATURES_BACKFILL` variable in the
  334. ``meta/conf/bitbake.conf`` file. However, your target device does not
  335. have this capability. You can disable RTC support for your device
  336. without affecting other machines that need RTC support by adding the
  337. feature to your machine's :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`
  338. list in the machine's ``.conf`` file. Adding the feature to this
  339. variable when it also exists in the :term:`MACHINE_FEATURES_BACKFILL`
  340. variable prevents the build system from adding the feature to your
  341. configuration's :term:`MACHINE_FEATURES`, effectively disabling RTC
  342. support for that particular machine.