blob: 5e853caa2cf975b4eb3e91421aa78e742ee7d327 [file] [log] [blame]
Andrew Geisslerf0343792020-11-18 10:42:21 -06001.. SPDX-License-Identifier: CC-BY-SA-2.0-UK
Andrew Geisslerc9f78652020-09-18 14:11:35 -05002
3********
4Features
5********
6
7This chapter provides a reference of shipped machine and distro features
8you can include as part of your image, a reference on image features you
9can select, and a reference on feature backfilling.
10
11Features provide a mechanism for working out which packages should be
12included in the generated images. Distributions can select which
Andrew Geissler09036742021-06-25 14:25:14 -050013features they want to support through the :term:`DISTRO_FEATURES` variable,
Andrew Geisslerc9f78652020-09-18 14:11:35 -050014which is set or appended to in a distribution's configuration file such
15as ``poky.conf``, ``poky-tiny.conf``, ``poky-lsb.conf`` and so forth.
Andrew Geissler09036742021-06-25 14:25:14 -050016Machine features are set in the :term:`MACHINE_FEATURES` variable, which is
Andrew Geisslerc9f78652020-09-18 14:11:35 -050017set in the machine configuration file and specifies the hardware
18features for a given machine.
19
20These two variables combine to work out which kernel modules, utilities,
21and other packages to include. A given distribution can support a
22selected subset of features so some machine features might not be
23included if the distribution itself does not support them.
24
25One method you can use to determine which recipes are checking to see if
26a particular feature is contained or not is to ``grep`` through the
27:term:`Metadata` for the feature. Here is an example that
28discovers the recipes whose build is potentially changed based on a
Andrew Geisslerc926e172021-05-07 16:11:35 -050029given feature::
Andrew Geisslerc9f78652020-09-18 14:11:35 -050030
31 $ cd poky
32 $ git grep 'contains.*MACHINE_FEATURES.*feature'
33
34.. _ref-features-machine:
35
36Machine Features
37================
38
39The items below are features you can use with
40:term:`MACHINE_FEATURES`. Features do not have a
41one-to-one correspondence to packages, and they can go beyond simply
42controlling the installation of a package or packages. Sometimes a
43feature can influence how certain recipes are built. For example, a
44feature might determine whether a particular configure option is
45specified within the :ref:`ref-tasks-configure` task
46for a particular recipe.
47
48This feature list only represents features as shipped with the Yocto
49Project metadata:
50
51- *acpi:* Hardware has ACPI (x86/x86_64 only)
52
53- *alsa:* Hardware has ALSA audio drivers
54
55- *apm:* Hardware uses APM (or APM emulation)
56
57- *bluetooth:* Hardware has integrated BT
58
59- *efi:* Support for booting through EFI
60
61- *ext2:* Hardware HDD or Microdrive
62
63- *keyboard:* Hardware has a keyboard
64
Patrick Williams92b42cb2022-09-03 06:53:57 -050065- *numa:* Hardware has non-uniform memory access
66
Andrew Geisslerc9f78652020-09-18 14:11:35 -050067- *pcbios:* Support for booting through BIOS
68
69- *pci:* Hardware has a PCI bus
70
71- *pcmcia:* Hardware has PCMCIA or CompactFlash sockets
72
73- *phone:* Mobile phone (voice) support
74
75- *qvga:* Machine has a QVGA (320x240) display
76
77- *rtc:* Machine has a Real-Time Clock
78
79- *screen:* Hardware has a screen
80
81- *serial:* Hardware has serial support (usually RS232)
82
83- *touchscreen:* Hardware has a touchscreen
84
85- *usbgadget:* Hardware is USB gadget device capable
86
87- *usbhost:* Hardware is USB Host capable
88
89- *vfat:* FAT file system support
90
91- *wifi:* Hardware has integrated WiFi
92
93.. _ref-features-distro:
94
95Distro Features
96===============
97
98The items below are features you can use with
99:term:`DISTRO_FEATURES` to enable features across
100your distribution. Features do not have a one-to-one correspondence to
101packages, and they can go beyond simply controlling the installation of
102a package or packages. In most cases, the presence or absence of a
103feature translates to the appropriate option supplied to the configure
104script during the :ref:`ref-tasks-configure` task for
Andrew Geissler615f2f12022-07-15 14:00:58 -0500105the recipes that optionally support the feature. Appropriate options
106must be supplied, and enabling/disabling :term:`PACKAGECONFIG` for the
107concerned packages is one way of supplying such options.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500108
109Some distro features are also machine features. These select features
110make sense to be controlled both at the machine and distribution
111configuration level. See the
112:term:`COMBINED_FEATURES` variable for more
113information.
114
115This list only represents features as shipped with the Yocto Project
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500116metadata, as extra layers can define their own:
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500117
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500118- *3g:* Include support for cellular data.
119
120- *acl:* Include
121 `Access Control List <https://en.wikipedia.org/wiki/Access-control_list>`__ support.
122
123- *alsa:* Include `Advanced Linux Sound Architecture <https://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture>`__
124 support (OSS compatibility kernel modules installed if available).
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500125
126- *api-documentation:* Enables generation of API documentation during
127 recipe builds. The resulting documentation is added to SDK tarballs
128 when the ``bitbake -c populate_sdk`` command is used. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600129 ":ref:`sdk-manual/appendix-customizing-standard:adding api documentation to the standard sdk`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500130 section in the Yocto Project Application Development and the
131 Extensible Software Development Kit (eSDK) manual.
132
133- *bluetooth:* Include bluetooth support (integrated BT only).
134
135- *cramfs:* Include CramFS support.
136
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500137- *debuginfod:* Include support for getting ELF debugging information through
138 a :ref:`debuginfod <dev-manual/common-tasks:using the debuginfod server method>`
139 server.
140
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500141- *directfb:* Include DirectFB support.
142
143- *ext2:* Include tools for supporting for devices with internal
144 HDD/Microdrive for storing files (instead of Flash only devices).
145
146- *ipsec:* Include IPSec support.
147
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500148- *ipv4:* Include IPv4 support.
149
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500150- *ipv6:* Include IPv6 support.
151
152- *keyboard:* Include keyboard support (e.g. keymaps will be loaded
153 during boot).
154
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500155- *largefile:* Enable building applications with
156 `argefile support <https://en.wikipedia.org/wiki/Large-file_support>`__.
157
158- *multiarch:* Enable building applications with multiple architecture
159 support.
160
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500161- *ldconfig:* Include support for ldconfig and ``ld.so.conf`` on the
162 target.
163
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500164- *nfc:* Include support for
165 `Near Field Communication <https://en.wikipedia.org/wiki/Near-field_communication>`__.
166
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500167- *nfs:* Include NFS client support (for mounting NFS exports on
168 device).
169
170- *opengl:* Include the Open Graphics Library, which is a
171 cross-language, multi-platform application programming interface used
172 for rendering two and three-dimensional graphics.
173
174- *pci:* Include PCI bus support.
175
176- *pcmcia:* Include PCMCIA/CompactFlash support.
177
178- *ppp:* Include PPP dialup support.
179
180- *ptest:* Enables building the package tests where supported by
181 individual recipes. For more information on package tests, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600182 ":ref:`dev-manual/common-tasks:testing packages with ptest`" section
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500183 in the Yocto Project Development Tasks Manual.
184
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500185- *seccomp:* Enables building applications with
186 `seccomp <https://en.wikipedia.org/wiki/Seccomp>`__ support, to
187 allow them to strictly restrict the system calls that they are allowed
188 to invoke.
189
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500190- *smbfs:* Include SMB networks client support (for mounting
191 Samba/Microsoft Windows shares on device).
192
193- *systemd:* Include support for this ``init`` manager, which is a full
194 replacement of for ``init`` with parallel starting of services,
195 reduced shell overhead, and other features. This ``init`` manager is
196 used by many distributions.
197
198- *usbgadget:* Include USB Gadget Device support (for USB
199 networking/serial/storage).
200
201- *usbhost:* Include USB Host support (allows to connect external
202 keyboard, mouse, storage, network etc).
203
204- *usrmerge:* Merges the ``/bin``, ``/sbin``, ``/lib``, and ``/lib64``
205 directories into their respective counterparts in the ``/usr``
206 directory to provide better package and application compatibility.
207
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500208- *vfat:* Include `FAT filesystem <https://en.wikipedia.org/wiki/File_Allocation_Table>`__
209 support.
210
211- *vulkan:* Include support for the
212 `Vulkan API <https://en.wikipedia.org/wiki/Vulkan>`__.
213
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500214- *wayland:* Include the Wayland display server protocol and the
215 library that supports it.
216
217- *wifi:* Include WiFi support (integrated only).
218
219- *x11:* Include the X server and libraries.
220
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500221- *xattr:* Include support for
222 `extended file attributes <https://en.wikipedia.org/wiki/Extended_file_attributes>`__.
223
224- *zeroconf:* Include support for
225 `zero configuration networking <https://en.wikipedia.org/wiki/Zero-configuration_networking>`__.
226
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500227.. _ref-features-image:
228
229Image Features
230==============
231
232The contents of images generated by the OpenEmbedded build system can be
233controlled by the :term:`IMAGE_FEATURES` and
234:term:`EXTRA_IMAGE_FEATURES` variables that
235you typically configure in your image recipes. Through these variables,
236you can add several different predefined packages such as development
237utilities or packages with debug information needed to investigate
238application problems or profile applications.
239
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700240Here are the image features available for all images:
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500241
Andrew Geissler615f2f12022-07-15 14:00:58 -0500242- *allow-empty-password:* Allows Dropbear and OpenSSH to accept
243 logins from accounts having an empty password string.
244
245- *allow-root-login:* Allows Dropbear and OpenSSH to accept root logins.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500246
247- *dbg-pkgs:* Installs debug symbol packages for all packages installed
248 in a given image.
249
250- *debug-tweaks:* Makes an image suitable for development (e.g. allows
Andrew Geissler615f2f12022-07-15 14:00:58 -0500251 root logins, logins without passwords ---including root ones, and enables
252 post-installation logging). See the ``allow-empty-password``,
253 ``allow-root-login``, ``empty-root-password``, and ``post-install-logging``
254 features in this list for additional information.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500255
256- *dev-pkgs:* Installs development packages (headers and extra library
257 links) for all packages installed in a given image.
258
259- *doc-pkgs:* Installs documentation packages for all packages
260 installed in a given image.
261
Andrew Geissler615f2f12022-07-15 14:00:58 -0500262- *empty-root-password:* This feature or ``debug-tweaks`` is required if
263 you want to allow root login with an empty password. If these features
264 are not present in :term:`IMAGE_FEATURES`, a non-empty password is
265 forced in ``/etc/passwd`` and ``/etc/shadow`` if such files exist.
266
267 .. note::
268 ``empty-root-passwd`` doesn't set an empty root password by itself.
269 You get an initial empty root password thanks to the
270 :oe_git:`base-passwd </openembedded-core/tree/meta/recipes-core/base-passwd/>`
271 and :oe_git:`shadow </openembedded-core/tree/meta/recipes-extended/shadow/>`
272 recipes, and the presence of ``empty-root-passwd`` or ``debug-tweaks``
273 just disables the mechanism which forces an non-empty password for the
274 root user.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500275
Andrew Geissler595f6302022-01-24 19:11:47 +0000276- *overlayfs-etc:* Configures the ``/etc`` directory to be in ``overlayfs``.
277 This allows to store device specific information elsewhere, especially
278 if the root filesystem is configured to be read-only.
279
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500280- *package-management:* Installs package management tools and preserves
281 the package manager database.
282
283- *post-install-logging:* Enables logging postinstall script runs to
284 the ``/var/log/postinstall.log`` file on first boot of the image on
285 the target system.
286
287 .. note::
288
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500289 To make the ``/var/log`` directory on the target persistent, use the
290 :term:`VOLATILE_LOG_DIR` variable by setting it to "no".
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500291
292- *ptest-pkgs:* Installs ptest packages for all ptest-enabled recipes.
293
294- *read-only-rootfs:* Creates an image whose root filesystem is
295 read-only. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600296 ":ref:`dev-manual/common-tasks:creating a read-only root filesystem`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500297 section in the Yocto Project Development Tasks Manual for more
298 information.
299
300- *splash:* Enables showing a splash screen during boot. By default,
301 this screen is provided by ``psplash``, which does allow
302 customization. If you prefer to use an alternative splash screen
303 package, you can do so by setting the ``SPLASH`` variable to a
304 different package name (or names) within the image recipe or at the
305 distro configuration level.
306
307- *staticdev-pkgs:* Installs static development packages, which are
308 static libraries (i.e. ``*.a`` files), for all packages installed in
309 a given image.
310
311Some image features are available only when you inherit the
312:ref:`core-image <ref-classes-core-image>` class. The current list of
313these valid features is as follows:
314
315- *hwcodecs:* Installs hardware acceleration codecs.
316
317- *nfs-server:* Installs an NFS server.
318
319- *perf:* Installs profiling tools such as ``perf``, ``systemtap``, and
320 ``LTTng``. For general information on user-space tools, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600321 :doc:`/sdk-manual/index` manual.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500322
323- *ssh-server-dropbear:* Installs the Dropbear minimal SSH server.
324
325- *ssh-server-openssh:* Installs the OpenSSH SSH server, which is more
326 full-featured than Dropbear. Note that if both the OpenSSH SSH server
327 and the Dropbear minimal SSH server are present in
Andrew Geissler09036742021-06-25 14:25:14 -0500328 :term:`IMAGE_FEATURES`, then OpenSSH will take precedence and Dropbear
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500329 will not be installed.
330
331- *tools-debug:* Installs debugging tools such as ``strace`` and
332 ``gdb``. For information on GDB, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600333 ":ref:`dev-manual/common-tasks:debugging with the gnu project debugger (gdb) remotely`" section
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500334 in the Yocto Project Development Tasks Manual. For information on
Andrew Geissler09209ee2020-12-13 08:44:15 -0600335 tracing and profiling, see the :doc:`/profile-manual/index`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500336
337- *tools-sdk:* Installs a full SDK that runs on the device.
338
339- *tools-testapps:* Installs device testing tools (e.g. touchscreen
340 debugging).
341
342- *x11:* Installs the X server.
343
344- *x11-base:* Installs the X server with a minimal environment.
345
346- *x11-sato:* Installs the OpenedHand Sato environment.
347
348.. _ref-features-backfill:
349
350Feature Backfilling
351===================
352
353Sometimes it is necessary in the OpenEmbedded build system to extend
354:term:`MACHINE_FEATURES` or
355:term:`DISTRO_FEATURES` to control functionality
356that was previously enabled and not able to be disabled. For these
357cases, we need to add an additional feature item to appear in one of
358these variables, but we do not want to force developers who have
359existing values of the variables in their configuration to add the new
360feature in order to retain the same overall level of functionality.
361Thus, the OpenEmbedded build system has a mechanism to automatically
362"backfill" these added features into existing distro or machine
363configurations. You can see the list of features for which this is done
364by finding the
365:term:`DISTRO_FEATURES_BACKFILL` and
366:term:`MACHINE_FEATURES_BACKFILL`
367variables in the ``meta/conf/bitbake.conf`` file.
368
369Because such features are backfilled by default into all configurations
370as described in the previous paragraph, developers who wish to disable
371the new features need to be able to selectively prevent the backfilling
372from occurring. They can do this by adding the undesired feature or
373features to the
374:term:`DISTRO_FEATURES_BACKFILL_CONSIDERED`
375or
376:term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`
377variables for distro features and machine features respectively.
378
379Here are two examples to help illustrate feature backfilling:
380
381- *The "pulseaudio" distro feature option*: Previously, PulseAudio
382 support was enabled within the Qt and GStreamer frameworks. Because
383 of this, the feature is backfilled and thus enabled for all distros
Andrew Geissler09036742021-06-25 14:25:14 -0500384 through the :term:`DISTRO_FEATURES_BACKFILL` variable in the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500385 ``meta/conf/bitbake.conf`` file. However, your distro needs to
386 disable the feature. You can disable the feature without affecting
387 other existing distro configurations that need PulseAudio support by
Andrew Geissler09036742021-06-25 14:25:14 -0500388 adding "pulseaudio" to :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED` in
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500389 your distro's ``.conf`` file. Adding the feature to this variable
Andrew Geissler09036742021-06-25 14:25:14 -0500390 when it also exists in the :term:`DISTRO_FEATURES_BACKFILL` variable
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500391 prevents the build system from adding the feature to your
Andrew Geissler09036742021-06-25 14:25:14 -0500392 configuration's :term:`DISTRO_FEATURES`, effectively disabling the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500393 feature for that particular distro.
394
395- *The "rtc" machine feature option*: Previously, real time clock (RTC)
396 support was enabled for all target devices. Because of this, the
397 feature is backfilled and thus enabled for all machines through the
Andrew Geissler09036742021-06-25 14:25:14 -0500398 :term:`MACHINE_FEATURES_BACKFILL` variable in the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500399 ``meta/conf/bitbake.conf`` file. However, your target device does not
400 have this capability. You can disable RTC support for your device
401 without affecting other machines that need RTC support by adding the
Andrew Geissler09036742021-06-25 14:25:14 -0500402 feature to your machine's :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500403 list in the machine's ``.conf`` file. Adding the feature to this
Andrew Geissler09036742021-06-25 14:25:14 -0500404 variable when it also exists in the :term:`MACHINE_FEATURES_BACKFILL`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500405 variable prevents the build system from adding the feature to your
Andrew Geissler09036742021-06-25 14:25:14 -0500406 configuration's :term:`MACHINE_FEATURES`, effectively disabling RTC
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500407 support for that particular machine.