blob: 8dfe29d66a63681a638c12cb39e9c436693784d0 [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
116metadata:
117
118- *alsa:* Include ALSA support (OSS compatibility kernel modules
119 installed if available).
120
121- *api-documentation:* Enables generation of API documentation during
122 recipe builds. The resulting documentation is added to SDK tarballs
123 when the ``bitbake -c populate_sdk`` command is used. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600124 ":ref:`sdk-manual/appendix-customizing-standard:adding api documentation to the standard sdk`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500125 section in the Yocto Project Application Development and the
126 Extensible Software Development Kit (eSDK) manual.
127
128- *bluetooth:* Include bluetooth support (integrated BT only).
129
130- *cramfs:* Include CramFS support.
131
132- *directfb:* Include DirectFB support.
133
134- *ext2:* Include tools for supporting for devices with internal
135 HDD/Microdrive for storing files (instead of Flash only devices).
136
137- *ipsec:* Include IPSec support.
138
139- *ipv6:* Include IPv6 support.
140
141- *keyboard:* Include keyboard support (e.g. keymaps will be loaded
142 during boot).
143
144- *ldconfig:* Include support for ldconfig and ``ld.so.conf`` on the
145 target.
146
147- *nfs:* Include NFS client support (for mounting NFS exports on
148 device).
149
150- *opengl:* Include the Open Graphics Library, which is a
151 cross-language, multi-platform application programming interface used
152 for rendering two and three-dimensional graphics.
153
154- *pci:* Include PCI bus support.
155
156- *pcmcia:* Include PCMCIA/CompactFlash support.
157
158- *ppp:* Include PPP dialup support.
159
160- *ptest:* Enables building the package tests where supported by
161 individual recipes. For more information on package tests, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600162 ":ref:`dev-manual/common-tasks:testing packages with ptest`" section
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500163 in the Yocto Project Development Tasks Manual.
164
165- *smbfs:* Include SMB networks client support (for mounting
166 Samba/Microsoft Windows shares on device).
167
168- *systemd:* Include support for this ``init`` manager, which is a full
169 replacement of for ``init`` with parallel starting of services,
170 reduced shell overhead, and other features. This ``init`` manager is
171 used by many distributions.
172
173- *usbgadget:* Include USB Gadget Device support (for USB
174 networking/serial/storage).
175
176- *usbhost:* Include USB Host support (allows to connect external
177 keyboard, mouse, storage, network etc).
178
179- *usrmerge:* Merges the ``/bin``, ``/sbin``, ``/lib``, and ``/lib64``
180 directories into their respective counterparts in the ``/usr``
181 directory to provide better package and application compatibility.
182
183- *wayland:* Include the Wayland display server protocol and the
184 library that supports it.
185
186- *wifi:* Include WiFi support (integrated only).
187
188- *x11:* Include the X server and libraries.
189
190.. _ref-features-image:
191
192Image Features
193==============
194
195The contents of images generated by the OpenEmbedded build system can be
196controlled by the :term:`IMAGE_FEATURES` and
197:term:`EXTRA_IMAGE_FEATURES` variables that
198you typically configure in your image recipes. Through these variables,
199you can add several different predefined packages such as development
200utilities or packages with debug information needed to investigate
201application problems or profile applications.
202
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700203Here are the image features available for all images:
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500204
Andrew Geissler615f2f12022-07-15 14:00:58 -0500205- *allow-empty-password:* Allows Dropbear and OpenSSH to accept
206 logins from accounts having an empty password string.
207
208- *allow-root-login:* Allows Dropbear and OpenSSH to accept root logins.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500209
210- *dbg-pkgs:* Installs debug symbol packages for all packages installed
211 in a given image.
212
213- *debug-tweaks:* Makes an image suitable for development (e.g. allows
Andrew Geissler615f2f12022-07-15 14:00:58 -0500214 root logins, logins without passwords ---including root ones, and enables
215 post-installation logging). See the ``allow-empty-password``,
216 ``allow-root-login``, ``empty-root-password``, and ``post-install-logging``
217 features in this list for additional information.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500218
219- *dev-pkgs:* Installs development packages (headers and extra library
220 links) for all packages installed in a given image.
221
222- *doc-pkgs:* Installs documentation packages for all packages
223 installed in a given image.
224
Andrew Geissler615f2f12022-07-15 14:00:58 -0500225- *empty-root-password:* This feature or ``debug-tweaks`` is required if
226 you want to allow root login with an empty password. If these features
227 are not present in :term:`IMAGE_FEATURES`, a non-empty password is
228 forced in ``/etc/passwd`` and ``/etc/shadow`` if such files exist.
229
230 .. note::
231 ``empty-root-passwd`` doesn't set an empty root password by itself.
232 You get an initial empty root password thanks to the
233 :oe_git:`base-passwd </openembedded-core/tree/meta/recipes-core/base-passwd/>`
234 and :oe_git:`shadow </openembedded-core/tree/meta/recipes-extended/shadow/>`
235 recipes, and the presence of ``empty-root-passwd`` or ``debug-tweaks``
236 just disables the mechanism which forces an non-empty password for the
237 root user.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500238
Andrew Geissler595f6302022-01-24 19:11:47 +0000239- *overlayfs-etc:* Configures the ``/etc`` directory to be in ``overlayfs``.
240 This allows to store device specific information elsewhere, especially
241 if the root filesystem is configured to be read-only.
242
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500243- *package-management:* Installs package management tools and preserves
244 the package manager database.
245
246- *post-install-logging:* Enables logging postinstall script runs to
247 the ``/var/log/postinstall.log`` file on first boot of the image on
248 the target system.
249
250 .. note::
251
Andrew Geissler4c19ea12020-10-27 13:52:24 -0500252 To make the ``/var/log`` directory on the target persistent, use the
253 :term:`VOLATILE_LOG_DIR` variable by setting it to "no".
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500254
255- *ptest-pkgs:* Installs ptest packages for all ptest-enabled recipes.
256
257- *read-only-rootfs:* Creates an image whose root filesystem is
258 read-only. See the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600259 ":ref:`dev-manual/common-tasks:creating a read-only root filesystem`"
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500260 section in the Yocto Project Development Tasks Manual for more
261 information.
262
263- *splash:* Enables showing a splash screen during boot. By default,
264 this screen is provided by ``psplash``, which does allow
265 customization. If you prefer to use an alternative splash screen
266 package, you can do so by setting the ``SPLASH`` variable to a
267 different package name (or names) within the image recipe or at the
268 distro configuration level.
269
270- *staticdev-pkgs:* Installs static development packages, which are
271 static libraries (i.e. ``*.a`` files), for all packages installed in
272 a given image.
273
274Some image features are available only when you inherit the
275:ref:`core-image <ref-classes-core-image>` class. The current list of
276these valid features is as follows:
277
278- *hwcodecs:* Installs hardware acceleration codecs.
279
280- *nfs-server:* Installs an NFS server.
281
282- *perf:* Installs profiling tools such as ``perf``, ``systemtap``, and
283 ``LTTng``. For general information on user-space tools, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600284 :doc:`/sdk-manual/index` manual.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500285
286- *ssh-server-dropbear:* Installs the Dropbear minimal SSH server.
287
288- *ssh-server-openssh:* Installs the OpenSSH SSH server, which is more
289 full-featured than Dropbear. Note that if both the OpenSSH SSH server
290 and the Dropbear minimal SSH server are present in
Andrew Geissler09036742021-06-25 14:25:14 -0500291 :term:`IMAGE_FEATURES`, then OpenSSH will take precedence and Dropbear
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500292 will not be installed.
293
294- *tools-debug:* Installs debugging tools such as ``strace`` and
295 ``gdb``. For information on GDB, see the
Andrew Geissler09209ee2020-12-13 08:44:15 -0600296 ":ref:`dev-manual/common-tasks:debugging with the gnu project debugger (gdb) remotely`" section
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500297 in the Yocto Project Development Tasks Manual. For information on
Andrew Geissler09209ee2020-12-13 08:44:15 -0600298 tracing and profiling, see the :doc:`/profile-manual/index`.
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500299
300- *tools-sdk:* Installs a full SDK that runs on the device.
301
302- *tools-testapps:* Installs device testing tools (e.g. touchscreen
303 debugging).
304
305- *x11:* Installs the X server.
306
307- *x11-base:* Installs the X server with a minimal environment.
308
309- *x11-sato:* Installs the OpenedHand Sato environment.
310
311.. _ref-features-backfill:
312
313Feature Backfilling
314===================
315
316Sometimes it is necessary in the OpenEmbedded build system to extend
317:term:`MACHINE_FEATURES` or
318:term:`DISTRO_FEATURES` to control functionality
319that was previously enabled and not able to be disabled. For these
320cases, we need to add an additional feature item to appear in one of
321these variables, but we do not want to force developers who have
322existing values of the variables in their configuration to add the new
323feature in order to retain the same overall level of functionality.
324Thus, the OpenEmbedded build system has a mechanism to automatically
325"backfill" these added features into existing distro or machine
326configurations. You can see the list of features for which this is done
327by finding the
328:term:`DISTRO_FEATURES_BACKFILL` and
329:term:`MACHINE_FEATURES_BACKFILL`
330variables in the ``meta/conf/bitbake.conf`` file.
331
332Because such features are backfilled by default into all configurations
333as described in the previous paragraph, developers who wish to disable
334the new features need to be able to selectively prevent the backfilling
335from occurring. They can do this by adding the undesired feature or
336features to the
337:term:`DISTRO_FEATURES_BACKFILL_CONSIDERED`
338or
339:term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`
340variables for distro features and machine features respectively.
341
342Here are two examples to help illustrate feature backfilling:
343
344- *The "pulseaudio" distro feature option*: Previously, PulseAudio
345 support was enabled within the Qt and GStreamer frameworks. Because
346 of this, the feature is backfilled and thus enabled for all distros
Andrew Geissler09036742021-06-25 14:25:14 -0500347 through the :term:`DISTRO_FEATURES_BACKFILL` variable in the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500348 ``meta/conf/bitbake.conf`` file. However, your distro needs to
349 disable the feature. You can disable the feature without affecting
350 other existing distro configurations that need PulseAudio support by
Andrew Geissler09036742021-06-25 14:25:14 -0500351 adding "pulseaudio" to :term:`DISTRO_FEATURES_BACKFILL_CONSIDERED` in
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500352 your distro's ``.conf`` file. Adding the feature to this variable
Andrew Geissler09036742021-06-25 14:25:14 -0500353 when it also exists in the :term:`DISTRO_FEATURES_BACKFILL` variable
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500354 prevents the build system from adding the feature to your
Andrew Geissler09036742021-06-25 14:25:14 -0500355 configuration's :term:`DISTRO_FEATURES`, effectively disabling the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500356 feature for that particular distro.
357
358- *The "rtc" machine feature option*: Previously, real time clock (RTC)
359 support was enabled for all target devices. Because of this, the
360 feature is backfilled and thus enabled for all machines through the
Andrew Geissler09036742021-06-25 14:25:14 -0500361 :term:`MACHINE_FEATURES_BACKFILL` variable in the
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500362 ``meta/conf/bitbake.conf`` file. However, your target device does not
363 have this capability. You can disable RTC support for your device
364 without affecting other machines that need RTC support by adding the
Andrew Geissler09036742021-06-25 14:25:14 -0500365 feature to your machine's :term:`MACHINE_FEATURES_BACKFILL_CONSIDERED`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500366 list in the machine's ``.conf`` file. Adding the feature to this
Andrew Geissler09036742021-06-25 14:25:14 -0500367 variable when it also exists in the :term:`MACHINE_FEATURES_BACKFILL`
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500368 variable prevents the build system from adding the feature to your
Andrew Geissler09036742021-06-25 14:25:14 -0500369 configuration's :term:`MACHINE_FEATURES`, effectively disabling RTC
Andrew Geisslerc9f78652020-09-18 14:11:35 -0500370 support for that particular machine.