features.rst 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  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 :ref:`ref-features-backfill`.
  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-altcfg.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. - *bluetooth:* Hardware has integrated BT
  43. - *efi:* Support for booting through EFI
  44. - *ext2:* Hardware HDD or Microdrive
  45. - *keyboard:* Hardware has a keyboard
  46. - *numa:* Hardware has non-uniform memory access
  47. - *pcbios:* Support for booting through BIOS
  48. - *pci:* Hardware has a PCI bus
  49. - *pcmcia:* Hardware has PCMCIA or CompactFlash sockets
  50. - *phone:* Mobile phone (voice) support
  51. - *qemu-usermode:* QEMU can support user-mode emulation for this machine
  52. - *qvga:* Machine has a QVGA (320x240) display
  53. - *rtc:* Machine has a Real-Time Clock
  54. - *screen:* Hardware has a screen
  55. - *serial:* Hardware has serial support (usually RS232)
  56. - *touchscreen:* Hardware has a touchscreen
  57. - *usbgadget:* Hardware is USB gadget device capable
  58. - *usbhost:* Hardware is USB Host capable
  59. - *vfat:* FAT file system support
  60. - *wifi:* Hardware has integrated WiFi
  61. .. _ref-features-distro:
  62. Distro Features
  63. ===============
  64. The items below are features you can use with
  65. :term:`DISTRO_FEATURES` to enable features across
  66. your distribution. Features do not have a one-to-one correspondence to
  67. packages, and they can go beyond simply controlling the installation of
  68. a package or packages. In most cases, the presence or absence of a
  69. feature translates to the appropriate option supplied to the configure
  70. script during the :ref:`ref-tasks-configure` task for
  71. the recipes that optionally support the feature. Appropriate options
  72. must be supplied, and enabling/disabling :term:`PACKAGECONFIG` for the
  73. concerned packages is one way of supplying such options.
  74. Some distro features are also machine features. These select features
  75. make sense to be controlled both at the machine and distribution
  76. configuration level. See the
  77. :term:`COMBINED_FEATURES` variable for more
  78. information.
  79. .. note::
  80. :term:`DISTRO_FEATURES` is normally independent of kernel configuration,
  81. so if a feature specified in :term:`DISTRO_FEATURES` also relies on
  82. support in the kernel, you will also need to ensure that support is
  83. enabled in the kernel configuration.
  84. This list only represents features as shipped with the Yocto Project
  85. metadata, as extra layers can define their own:
  86. - *3g:* Include support for cellular data.
  87. - *acl:* Include :wikipedia:`Access Control List <Access-control_list>` support.
  88. - *alsa:* Include :wikipedia:`Advanced Linux Sound Architecture <Advanced_Linux_Sound_Architecture>`
  89. support (OSS compatibility kernel modules installed if available).
  90. - *api-documentation:* Enables generation of API documentation during
  91. recipe builds. The resulting documentation is added to SDK tarballs
  92. when the ``bitbake -c populate_sdk`` command is used. See the
  93. ":ref:`sdk-manual/appendix-customizing-standard:adding api documentation to the standard sdk`"
  94. section in the Yocto Project Application Development and the
  95. Extensible Software Development Kit (eSDK) manual.
  96. - *bluetooth:* Include bluetooth support (integrated BT only).
  97. - *cramfs:* Include CramFS support.
  98. - *debuginfod:* Include support for getting ELF debugging information through
  99. a :ref:`debuginfod <dev-manual/debugging:using the debuginfod server method>`
  100. server.
  101. - *directfb:* Include DirectFB support.
  102. - *ext2:* Include tools for supporting devices with internal
  103. HDD/Microdrive for storing files (instead of Flash only devices).
  104. - *gobject-introspection-data:* Include data to support
  105. `GObject Introspection <https://gi.readthedocs.io/en/latest/>`__.
  106. - *ipsec:* Include IPSec support.
  107. - *ipv4:* Include IPv4 support.
  108. - *ipv6:* Include IPv6 support.
  109. - *keyboard:* Include keyboard support (e.g. keymaps will be loaded
  110. during boot).
  111. - *minidebuginfo:* Add minimal debug symbols :ref:`(minidebuginfo)<dev-manual/debugging:enabling minidebuginfo>`
  112. to binary files containing, allowing ``coredumpctl`` and ``gdb`` to show symbolicated stack traces.
  113. - *multiarch:* Enable building applications with multiple architecture
  114. support.
  115. - *ldconfig:* Include support for ldconfig and ``ld.so.conf`` on the
  116. target.
  117. - *lto:* Enable `Link-Time Optimisation <https://gcc.gnu.org/wiki/LinkTimeOptimization>`__.
  118. - *nfc:* Include support for
  119. `Near Field Communication <https://en.wikipedia.org/wiki/Near-field_communication>`__.
  120. - *nfs:* Include NFS client support (for mounting NFS exports on
  121. device).
  122. - *nls:* Include National Language Support (NLS).
  123. - *opengl:* Include the Open Graphics Library, which is a
  124. cross-language, multi-platform application programming interface used
  125. for rendering two and three-dimensional graphics.
  126. - *overlayfs:* Include `OverlayFS <https://docs.kernel.org/filesystems/overlayfs.html>`__
  127. support.
  128. - *pam:* Include :wikipedia:`Pluggable Authentication Module (PAM) <Pluggable_authentication_module>`
  129. support.
  130. - *pci:* Include PCI bus support.
  131. - *pcmcia:* Include PCMCIA/CompactFlash support.
  132. - *pni-names:* Enable generation of persistent network interface names, i.e.
  133. the system tries hard to have the same but unique names for the network
  134. interfaces even after a reinstall.
  135. - *polkit:* Include :wikipedia:`Polkit <Polkit>` support.
  136. - *ppp:* Include PPP dialup support.
  137. - *ptest:* Enables building the package tests where supported by
  138. individual recipes. For more information on package tests, see the
  139. ":ref:`test-manual/ptest:testing packages with ptest`" section
  140. in the Yocto Project Development Tasks Manual.
  141. - *pulseaudio:* Include support for
  142. `PulseAudio <https://www.freedesktop.org/wiki/Software/PulseAudio/>`__.
  143. - *selinux:* Include support for
  144. :wikipedia:`Security-Enhanced Linux (SELinux) <Security-Enhanced_Linux>`
  145. (requires `meta-selinux <https://layers.openembedded.org/layerindex/layer/meta-selinux/>`__).
  146. - *seccomp:* Enables building applications with
  147. :wikipedia:`seccomp <Seccomp>` support, to
  148. allow them to strictly restrict the system calls that they are allowed
  149. to invoke.
  150. - *smbfs:* Include SMB networks client support (for mounting
  151. Samba/Microsoft Windows shares on device).
  152. - *systemd:* Include support for this ``init`` manager, which is a full
  153. replacement of for ``init`` with parallel starting of services,
  154. reduced shell overhead, and other features. This ``init`` manager is
  155. used by many distributions.
  156. - *systemd-resolved:* Include support and use ``systemd-resolved`` as the
  157. main DNS name resolver in ``glibc`` Name Service Switch. This is a DNS
  158. resolver daemon from ``systemd``.
  159. - *usbgadget:* Include USB Gadget Device support (for USB
  160. networking/serial/storage).
  161. - *usbhost:* Include USB Host support (allows to connect external
  162. keyboard, mouse, storage, network etc).
  163. - *usrmerge:* Merges the ``/bin``, ``/sbin``, ``/lib``, and ``/lib64``
  164. directories into their respective counterparts in the ``/usr``
  165. directory to provide better package and application compatibility.
  166. - *vfat:* Include :wikipedia:`FAT filesystem <File_Allocation_Table>`
  167. support.
  168. - *vulkan:* Include support for the :wikipedia:`Vulkan API <Vulkan>`.
  169. - *wayland:* Include the Wayland display server protocol and the
  170. library that supports it.
  171. - *wifi:* Include WiFi support (integrated only).
  172. - *x11:* Include the X server and libraries.
  173. - *xattr:* Include support for
  174. :wikipedia:`extended file attributes <Extended_file_attributes>`.
  175. - *zeroconf:* Include support for
  176. `zero configuration networking <https://en.wikipedia.org/wiki/Zero-configuration_networking>`__.
  177. .. _ref-features-image:
  178. Image Features
  179. ==============
  180. The contents of images generated by the OpenEmbedded build system can be
  181. controlled by the :term:`IMAGE_FEATURES` and
  182. :term:`EXTRA_IMAGE_FEATURES` variables that
  183. you typically configure in your image recipes. Through these variables,
  184. you can add several different predefined packages such as development
  185. utilities or packages with debug information needed to investigate
  186. application problems or profile applications.
  187. The image features available for all images are:
  188. - *allow-empty-password:* Allows Dropbear and OpenSSH to accept
  189. logins from accounts having an empty password string.
  190. - *allow-root-login:* Allows Dropbear and OpenSSH to accept root logins.
  191. - *dbg-pkgs:* Installs debug symbol packages for all packages installed
  192. in a given image.
  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 can be used if you want to allow root
  198. login with an empty password. If this feature is not present in
  199. :term:`IMAGE_FEATURES`, a non-empty password is forced in ``/etc/passwd`` and
  200. ``/etc/shadow`` if such files exist.
  201. .. note::
  202. ``empty-root-password`` 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-password`` just disables the
  207. mechanism which forces an non-empty password for the root user.
  208. - *lic-pkgs:* Installs license packages for all packages installed in a
  209. given image.
  210. - *overlayfs-etc:* Configures the ``/etc`` directory to be in ``overlayfs``.
  211. This allows to store device specific information elsewhere, especially
  212. if the root filesystem is configured to be read-only.
  213. - *package-management:* Installs package management tools and preserves
  214. the package manager database.
  215. - *post-install-logging:* Enables logging postinstall script runs to
  216. the ``/var/log/postinstall.log`` file on first boot of the image on
  217. the target system.
  218. .. note::
  219. To make the ``/var/log`` directory on the target persistent, remove the
  220. ``files/fs-perms-volatile-log.txt`` value from
  221. :term:`FILESYSTEM_PERMS_TABLES`.
  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 :term:`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
  293. add new functionality to :term:`MACHINE_FEATURES` or
  294. :term:`DISTRO_FEATURES`, but at the same time, allow existing
  295. distributions or machine definitions to opt out of such new
  296. features, to retain the same overall level of functionality.
  297. To make this possible, the OpenEmbedded build system has a mechanism to
  298. automatically "backfill" features into existing distro or machine
  299. configurations. You can see the list of features for which this is done
  300. by checking the :term:`DISTRO_FEATURES_BACKFILL` and
  301. :term:`MACHINE_FEATURES_BACKFILL` variables in the
  302. ``meta/conf/bitbake.conf`` file.
  303. These two variables are paired with the
  304. :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED`
  305. and :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED` variables
  306. which allow distro or machine configuration maintainers to `consider` any
  307. added feature, and decide when they wish to keep or exclude such feature,
  308. thus preventing the backfilling from happening.
  309. Here are two examples to illustrate feature backfilling:
  310. - *The "pulseaudio" distro feature option*: Previously, PulseAudio support was
  311. enabled within the Qt and GStreamer frameworks. Because of this, the feature
  312. is now backfilled and thus enabled for all distros through the
  313. :term:`DISTRO_FEATURES_BACKFILL` variable in the ``meta/conf/bitbake.conf``
  314. file. However, if your distro needs to disable the feature, you can do so
  315. without affecting other existing distro configurations that need PulseAudio
  316. support. You do this by adding "pulseaudio" to
  317. :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED` in your distro's ``.conf``
  318. file. So, adding the feature to this variable when it also exists in the
  319. :term:`DISTRO_FEATURES_BACKFILL` variable prevents the build system from
  320. adding the feature to your configuration's :term:`DISTRO_FEATURES`,
  321. effectively disabling the feature for that particular distro.
  322. - *The "rtc" machine feature option*: Previously, real time clock (RTC)
  323. support was enabled for all target devices. Because of this, the
  324. feature is backfilled and thus enabled for all machines through the
  325. :term:`MACHINE_FEATURES_BACKFILL` variable in the ``meta/conf/bitbake.conf``
  326. file. However, if your target device does not have this capability, you can
  327. disable RTC support for your device without affecting other machines
  328. that need RTC support. You do this by adding the "rtc" feature to the
  329. :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED` list in your machine's ``.conf``
  330. file. So, adding the feature to this variable when it also exists in the
  331. :term:`MACHINE_FEATURES_BACKFILL` variable prevents the build system from
  332. adding the feature to your configuration's :term:`MACHINE_FEATURES`,
  333. effectively disabling RTC support for that particular machine.