How to know distro features
Asked Answered
P

1

9

I am building image for NXP board using yocto. I could see different distros say "x11, wayland, fb, directfb" etc.

In the conf files for these distros I could see "DISTRO_FEATURES_remove" of other distros. Say in x11 distro conf file "DISTRO_FEATURES_remove="wayland"" is there.

I need to check what features provided by each distro. Say I need to check the features provided by wayland and x11 distros.

Can you guide to check in yocto source folder for the features provided by these distros.

Paregmenon answered 24/8, 2018 at 10:7 Comment(0)
I
19

I think you are asking, "how do I know what's in DISTRO_FEATURES for a given distro?" If so, DISTRO_FEATURES is a variable that is set in a configuration and loaded/overloaded as needed to drive contents you want to add to your system. Various recipes check the contents of DISTRO_FEATURES to enable/disable different features. You can do the same to test as needed.

For example, some recipes may use the following to check to see if the configuration has enabled a features. Our custom linux kernel recipe uses the following to specify specific configuration files for the recipe.

{@bb.utils.contains('DISTRO_FEATURES', 'bluez5', 'file://bluetooth.cfg', '', d)} \

Generically, you turn features on or off by specifying contents for DISTRO_FEATURES on your own.

https://www.yoctoproject.org/docs/2.1/mega-manual/mega-manual.html#var-DISTRO_FEATURES

If you need to see the contents of DISTRO_FEATURES from the command line

bitbake -e imagename | grep "^DISTRO_FEATURES"
Iceni answered 24/8, 2018 at 14:5 Comment(3)
Thanks for the reply. If we want to enable a feature for the distro then how we will know the feature name? Say the feature name is "bluetooth" or "bluez5". If we want to select a feature for the distro then that should be supported by yocto. How to know that the feature is alreary supported so that I can select that feature for the distro?Paregmenon
I guess it depends on what you are adding. However, DISTRO_FEATURES is just a space separated list of strings. It is used by querying the list for a string your recipe or another recipe or class would then use to enable/disable some specific part of that recipe or class. Usage depends on need here.Iceni
Minor thing that tripped me up briefly - that {@bb.utils... line probably should have a leading $ - i.e. ${@bb.utils... if used in SRC_URI.Coolth

© 2022 - 2024 — McMap. All rights reserved.