Advanced usage
This section describes how to add customizations to the already existing configurations and describe how the configurator works.
How the .config is generated
The generation of the .config file, as said, is the artifact resulting from menuconfig tool processing the configuration.
menuconfig is a Yconfig interface that allows users to interactively navigate and modify the configuration tree. Options are displayed based on dependencies and user selections. Conditional options are visually distinct, often grayed out or hidden when unavailable. menuconfig reads the Yconfig files, creating the interactive interface and, finally, creating the .config:
Yconfig files --> menuconfig --> .config
The Yconfig system is a tool used to manage configuration options for complex projects, such as operating systems or embedded systems. It provides a hierarchical and dependency-aware approach to organizing and selecting configuration settings.
The tree-like hierarchy and dependency-awareness bring many advantages:
-
Configuration options are grouped into categories and subcategories to make navigation logical and intuitive.
-
Options can depend on the state of other options or specific conditions. Dependent options are hidden or disabled if their requirements are unmet.
Yconfig supports various types of options:
- boolean options (
y/n) enable or disable features. - string, integer, and hex options provide customization, such as specifying memory sizes or file paths.
It also allows default values and constraints to simplify the configuration and ensure valid setups. Its logical organization simplifies navigation, dependency awareness prevents invalid configurations, and its flexibility supports diverse project requirements. The user-friendly interface makes it accessible even for complex configurations.
Once the configuration is finalized, a .config file is generated by menuconfig. This file captures the state of all configuration options, including enabled features, disabled options, and specific settings.
The root Yconfig file is layers/base/config/Yconfig/Yconfig. A Yconfig can include other Yconfigs with the syntax:
...
source "<path/to/Yconfig>"
...
osource "<path/to/Yconfig>"
...
where:
sourcereturns an error if the targetedYconfigis not found.osourcereturns a warning if the targetedYconfigis not found but the execution continues.<path/to/Yconfig>is the relative path to the targetedYconfigreferred tomconforconfbinaries' paths.
This means that it's easy to spread Yconfig files in many layers, automatically including the needed flags when a layer is included.
Configuration flags clusters
The build configurator core function is to create and process the .config file in order to create the required build environment. A .config file consist in a set of flags such as:
...
CONFIG_EXAMPLE=y
CONFIG_EXAMPLE_FEATURE_DISABLED=n
# CONFIG_EXAMPLE_NOT_ENABLED is not set
CONFIG_EXAMPLE_STRING="default"
...
Depending on the name of the flag some actions can be performed. The build configurator defines clusters of flags to associate the action to flag clusters. For a detailed description of the association between flags and actions, read the documentation in the seco-build-configurator at this link. The documentation has a table containing the matches between flags clusters and the actions performed on the build environment and the syntax that the flags need to let the configurator work properly.
Adding new configuration flags to Yconfig
Creating new configuration entries involves modifying the Yconfig tree. For customers, it's highly recommended to keep Yconfigs in Seco's layers as they are. To add new entries only add Yconfigs in the custom layer and include it sourcing it in the layers/base/config/Yconfig/Yconfig.
Add a variable automatically in the local.conf
As an example, consider the custom layer layers/meta-seco/meta-seco-xyz that wants to add a new variable in the local.conf. This is the structure of the layer:
$ tree -a layers/meta-seco/meta-seco-xyz
layers/meta-seco/meta-seco-xyz
├── conf
│ ├── bblayers.conf
│ ├── layer.conf
│ └── SRCREV.conf
└── custom_layer
Create the folder layers/meta-seco/meta-seco-xyz/conf/Yconfig and create into it the file Yconfig_xyz:
$ tree -a layers/meta-seco/meta-seco-xyz
layers/meta-seco/meta-seco-xyz
├── conf
│ ├── bblayers.conf
│ ├── layer.conf
│ ├── SRCREV.conf
│ └── Yconfig
│ └── Yconfig_xyz
└── custom_layer
Write into the file the custom configuration entries. Following the syntax in the repository seco-build-configurator at this link, to add a variable to local.conf add the content to Yconfig_xyz:
menu "XYZ custom configurations"
config FEATURE_XYZ-NEW-AWESOME-FEATURE
string "Adding new feature example for meta-seco-xyz"
default "example-feature"
help
Enter the name of the custom feature.
endmenu
NOTE: Always leave an empty line at the end of any
Yconfigfile. This may cause the error:
../meta-seco/meta-seco-xyz/conf/Yconfig/Yconfig_xyz:52: 'endmenu' in different file than 'menu'
../meta-seco/meta-seco-xyz/conf/Yconfig/Yconfig_xyz:11: location of the 'menu'even if the menu is correctly closed in the file.
Include the new Yconfig_xyz file sourcing it in the root layers/base/Yconfig/Yconfig adding:
...
...
comment "Custom XYZ configurations"
source "../meta-seco/meta-seco-xyz/conf/Yconfig/Yconfig_xyz
In this way, running the configurator with:
yoctouser@f48a332eb475:~/workdir$ . ./seco-setup.sh -m
it's possible to see that a new menu appeared called XYZ custom configurations in the landing page:

Entering in that menu it's possible to view that the added configuration has the default value set in Yconfig_xyz. Press Enter on it to edit the new entry added selecting the value example-feature-modified:

Saving the configuration generates the layers/base/.config that holds the new variable set:
$ cat layers/base/.config
...
#
# XYZ custom configurations
#
CONFIG_FEATURE_XYZ-NEW-AWESOME-FEATURE="example-feature-modified"
Finally, creating the build environment and checking the content of local.conf:
yoctouser@f48a332eb475:~/workdir$ . ./seco-setup.sh -c
***
INFO: Found custom layer "seco-xyz"!!! Use it.
***
WARNING: no CONFIG_CLOUD_ASTARTE-URL found in the configuration.
WARNING: no CONFIG_CLOUD_ASTARTE-REALM found in the configuration.
WARNING: no CONFIG_CLOUD_ASTARTE-PAIRING-TOKEN found in the configuration.
WARNING: no RAUC found in the configuration.
Welcome to SECO BSP
The Yocto Project has extensive documentation about OE including a
reference manual which can be found at:
http://yoctoproject.org/documentation
For more information about OpenEmbedded see their website:
http://www.openembedded.org/
Your build environment has been configured with:
MACHINE=seco-rk3568-e09
SDKMACHINE=i686
DISTRO=clea-os-fb
EULA=
yoctouser@f48a332eb475:~/workdir/build_e09_xyz$ cat conf/local.conf | grep ^XYZ
XYZ_NEW_AWESOME_FEATURE = "example-feature-modified"
To find out what are the available actions, look at the documentation of seco-build-configurator at this link.
Add a custom machine to Yconfig
Starting-off from the layer created in the section, the custom layer has the structure:
$ tree -a layers/meta-seco/meta-seco-xyz
layers/meta-seco/meta-seco-xyz
├── conf
│ ├── bblayers.conf
│ ├── layer.conf
│ ├── SRCREV.conf
│ └── Yconfig