Add a Machine To Clea OS
From now on it's assumed to be working into Seco's docker and that all the layers have been downloaded succesfully with repo tool.
Adding a machine to Clea OS involves the modification of :
- the layer
seco-basemapped inlayers/base. - the silicon vendor-related layer (i.e.
meta-seco-imxfor NXP) mapped inlayers/meta-seco-<vendor>.
seco-base layer
This layer is the resposible of the creation of the build folder. The tool seco-setup.sh accesses seco-base layer to scan all the boards available on Clea OS that are stored in the layers/base/configs/ folder.
To add a new machine to Clea OS this is the first step to pursue. Let's consider the board called example based on a iMX8MP processor. To add the machine with Clea OS minimal features, the file called seco_sbc_example_clea_os_defconfig is created with the content:
#@Description: NXP i.MX8M Plus EVK EXAMPLE board for Clea OS FB and default settings
#
# Hardware Configuration
#
CONFIG_HW_IMX=y
CONFIG_ARCH_ARCHITECTURE_imx=y
CONFIG_MACH_MACHINE_nxp-imx8mpevk=y
#
# Yocto Configuration
#
CONFIG_FLAVOUR_CLEAOS_clea-os=y
#
# Yocto Distro
#
CONFIG_OS-DISTRO_DISTRO_clea-os-fb=y
#
# Yocto Project Settings
#
CONFIG_ES_BUILD-DIR="build_EXAMPLE"
CONFIG_YS_PACKAGE-CLASSES="package_rpm"
CONFIG_YS_SSTATE-DIR="${TOPDIR}/sstate-cache"
CONFIG_YS_DL-DIR="${BSPDIR}/downloads/"
CONFIG_YS_BB-NICE-LEVEL=1
For the Clea OS Things, the minimal file called seco_sbc_example_clea_os_things_defconfig is created with the content:
#@Description: NXP i.MX8M Plus EVK EXAMPLE board for Clea OS Things and default settings
#
# Hardware Configuration
#
CONFIG_HW_IMX=y
CONFIG_ARCH_ARCHITECTURE_imx=y
CONFIG_MACH_MACHINE_nxp-imx8mpevk=y
#
# BSP Settings
#
CONFIG_SYSDATA_ENABLE=y
CONFIG_FEATURE-APPEND_UBOOT-ADDONS_sysdata=y
#
# Yocto Configuration
#
CONFIG_FLAVOUR_CLEAOS_clea-os-things=y
#
# Disk Layout
#
CONFIG_FORCE-FEATURE-APPEND_DISTRO-FEATURES_redundant_root_slot=y
CONFIG_FEATURE-APPEND_DISTRO-FEATURES_sysdata=y
CONFIG_FEATURE-APPEND_DISTRO-FEATURES_redundant_root_slot=y
CONFIG_FEATURE-APPEND_DISTRO-FEATURES_clea-os-rootfs-squashfs-ro=y
CONFIG_FEATURE-APPEND_DISTRO-FEATURES_clea-os-overlay=y
CONFIG_UPDATESYSTEM_RAUC=y
#
# Distro Features
#
CONFIG_FEATURE_VIRTUALIZATION-DOCKER=y
CONFIG_CLOUD_SECO-IOT=y
CONFIG_CLOUD_ASTARTE-URL=""
CONFIG_CLOUD_ASTARTE-REALM=""
CONFIG_LAYERS_ADD_RAUC="meta-rauc"
CONFIG_FORCE_FEATURE_UPDATEMECHANISM-RAUC=y
CONFIG_FEATURE_UPDATEMECHANISM-RAUC=y
#
# Networking Tools
#
CONFIG_FEATURE_NETWORKING-SUITE_base=y
#
# Yocto Project Settings
#
CONFIG_ES_BUILD-DIR="build_EXAMPLE_things"
CONFIG_YS_PACKAGE-CLASSES="package_rpm"
CONFIG_YS_SSTATE-DIR="${TOPDIR}/sstate-cache"
CONFIG_YS_DL-DIR="${BSPDIR}/downloads/"
CONFIG_YS_BB-NICE-LEVEL=1
Similarly for the Clea OS Embedded features with Wayland, the minimal file called seco_sbc_example_clea_os_embedded_defconfig is created with the content:
#@Description: NXP i.MX8M Plus EVK board for Clea OS Embedded and default settings
#
# Hardware Configuration
#
CONFIG_HW_IMX=y
CONFIG_ARCH_ARCHITECTURE_imx=y
CONFIG_MACH_MACHINE_nxp-imx8mpevk=y
#
# Yocto Configuration
#
CONFIG_FLAVOUR_CLEAOS_clea-os-embedded=y
#
# Graphical Backend
#
CONFIG_OS-DISTRO_DISTRO_clea-os-wayland=y
#
# Wayland Settings
#
CONFIG_FEATURE_WAYLAND-COMPOSITOR=y
#
# Visual Identity
#
#
# Clea OS Splash-Screen
#
CONFIG_SPLASHSCREEN_PSPLASH=y
CONFIG_FEATURE_SPLASH-SCREEN-PSPLASH=y
CONFIG_FEATURE_PREFERRED-PROVIDER-virtual/psplash="psplash"
#
# System Settings
#
#
# Distro Management
#
CONFIG_FEATURE_DEFAULT=y
# CONFIG_FEATURE_VERSIONING is not set
#
# Disk Layout
#
CONFIG_SINGLE_ROOT_SLOT=y
CONFIG_UPDATESYSTEM_NONE=y
CONFIG_LAYERS_ADD_CYCLONEDX="meta-cyclonedx"
CONFIG_ENABLE_CYCLONEDX=y
CONFIG_FEATURE-ADD_INHERIT_cyclonedx-export=y
#
# Distro Features
#
CONFIG_FEATURE_VIRTUALIZATION-DOCKER=y
CONFIG_SECO-IOT_NONE=y
CONFIG_UPDATEMECHANISM_NONE=y
CONFIG_ENABLE_QT=y
CONFIG_FEATURE_CLEA-OS-QT-VERSION_6.x=y
#
# Packages Groups
#
#
# System Tools
#
CONFIG_FEATURE_SYSTEM-FILE-EDITOR_vim=y
CONFIG_FEATURE_SYSTEM-SERIAL-TOOLS=y
CONFIG_FEATURE_SYSTEM-MONITORING-TOOLS=y
CONFIG_FEATURE_SYSTEM-DISK-UTILITIES=y
CONFIG_FEATURE_SYSTEM-PACKAGE-MANAGER=y
#
# Multimedia Tools
#
CONFIG_FEATURE_CHROMIUM=y
#
# Networking Tools
#
CONFIG_FEATURE_NETWORKING-SUITE_advanced=y
CONFIG_FEATURE_NETWORKING-WIFI-ENABLED=y
CONFIG_FEATURE_NETWORKING-SSH-ENABLED=y
CONFIG_FEATURE_NETWORKING-CELLULAR-MODEM-ENABLED=y
CONFIG_LAYERS_ADD_SECURITY="meta-security"
CONFIG_FEATURE-APPEND_DISTRO-FEATURES_security=y
#
# Bluetooth Tools
#
CONFIG_FEATURE_BLUETOOTH-TOOLS=y
#
# Peripherals Tools
#
CONFIG_FEATURE_PERIPHERALS-SUITE_full=y
#
# Audio Tools
#
CONFIG_FEATURE_AUDIO-TOOLS=y
CONFIG_FEATURE-APPEND_DISTRO-FEATURES_pulseaudio=y
#
# Testing Tools
#
CONFIG_FEATURE_TEST-TOOLS_full=y
#
# Debug Tools
#
CONFIG_FEATURE_DEBUG-TOOLS-CORE=y
CONFIG_FEATURE_DEBUG-TOOLS-PERFORMANCE=y
CONFIG_FEATURE_DEBUG-TOOLS-RESCUE=y
CONFIG_FEATURE_DEBUG-TOOLS-DISK=y
CONFIG_FEATURE_DEBUG-TOOLS-ENABLED=y
#
# Benchmark Tools
#
CONFIG_FEATURE_BENCHMARK-TOOLS-MEMORY=y
CONFIG_FEATURE_BENCHMARK-TOOLS-DEVICE-PERFORMANCE=y
CONFIG_FEATURE_BENCHMARK-TOOLS-GRAPHICS=y
CONFIG_FEATURE_BENCHMARK-TOOLS-DISK=y
CONFIG_FEATURE_BENCHMARK-TOOLS=y
#
# Yocto Project Configuration
#
#
# Yocto Project Settings
#
CONFIG_ES_BUILD-DIR="build_EXAMPLE_embedded"
CONFIG_YS_PACKAGE-CLASSES="package_rpm"
CONFIG_YS_SSTATE-DIR="${TOPDIR}/sstate-cache"
CONFIG_YS_DL-DIR="${BSPDIR}/downloads/"
CONFIG_YS_BB-NICE-LEVEL=1
CONFIG_USE_SECO_PACKAGE_MIRRORS=y
CONFIG_YS-INCLUDE_SECO-PACKAGE-MIRRORS="../layers/base/config/seco-mirrors.conf"
When the files are created and placed into the layers/base/configs/ directory, running:
yoctouser@b9c7b7068c9f:~/workdir$ . ./seco-setup.sh -l | grep example
seco_sbc_example_clea_os NXP i.MX8M Plus EVK board for Clea OS FB and default settings
seco_sbc_example_clea_os_things NXP i.MX8M Plus EVK board for Clea OS Things and default settings
seco_sbc_example_clea_os_embedded_wayland NXP i.MX8M Plus EVK board for Clea OS Embedded and default settings
will show the added configurations.
SECO's silicon vendor-related layer
Firstly, add to SECO's silicon vendor-related layer the machine file for the board to be included in Clea OS in the directory layers/meta-seco/meta-seco-<vendor>/conf. Let's consider the board named example based on a NXP iMX8MP processor, create the file called layers/meta-seco/meta-seco-imx/conf/seco-imx8mp-evk-example.conf the minimal machine configuration may be:
#@TYPE: Machine
#@NAME: NXP i.MX 8M Plus EVK
#@SOC: i.MX8MP
require conf/machine/include/seco-imx8mp-common.inc
BOARD_VENDOR = "freescale"
KERNEL_DEVICETREE_BASENAME = "imx8mp-evk"
KERNEL_DTB_FILES = " \
imx8mp-evk.dtb \
"
UBOOT_CONFIG_BASENAME = "imx8mp_evk"
UBOOT_DTB_NAME = "imx8mp-evk.dtb"
IMXBOOT_TARGETS_BASENAME = "flash_evk"
BOOTSCRIPT_PARAM[ENV_DEFAULT_FDT_FILE] = "imx8mp-evk.dtb"
BOOTSCRIPT_PARAM[ENV_SYS_CONSOLE] = "console=ttymxc1,115200"
This file specifies:
- Seco's iMX8MP include file.
- U-Boot configuration.
- Kernel configuration (including the device-tree overlays).
To add a machine to Seco's silicon vendor-related layer it's needed to add the board-related flag in the layers/meta-seco/meta-seco-<vendor>/conf/Yconfig/Yconfig_machine file. Let's consider the board named example based on a NXP iMX8MP processor, a minimal Yconfig addition may be:
...
...
config MACH_MACHINE_nxp-imx8mpevk
bool "NXP i.MX8M Plus EVK"
select HW_IMX
select DEVICE_CLASS_evk
depends on ARCH_ARCHITECTURE_imx
help
NXP i.MX8M Plus evaluation board
...
...
After all the needed files have been added, with seco-setup.sh it's possible to create the BitBake build environment. Following the example, to create the environment for the newly added board:
yoctouser@2337e108adfc:~/workdir$ . ./seco-setup.sh -l | grep example
seco_sbc_example_clea_os NXP i.MX8M Plus EVK board for Clea OS FB and default settings
seco_sbc_example_clea_os_things NXP i.MX8M Plus EVK board for Clea OS Things and default settings
seco_sbc_example_clea_os_embedded_wayland NXP i.MX8M Plus EVK board for Clea OS Embedded and default settings
yoctouser@2337e108adfc:~/workdir$ . ./seco-setup.sh -d seco_sbc_example_clea_os
***
USE defconfig configuration file: seco_sbc_example_clea_os
SBC i.MX8MP EXAMPLE board for Clea OS FB and default settings
***
yoctouser@2337e108adfc:~/workdir$ . ./seco-setup.sh -c
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-imx8mp-example
SDKMACHINE=i686
DISTRO=clea-os-things-fb
EULA=
Double check the output of the seco-setup.sh to make sure that the creation of the environment is correct.
When seco-setup.sh creates the build directory, based on the configurations added in seco-base, it looks into meta-seco-<vendor> for the board specific flag and machine configuration.
For the example above:
layers/base/configs/seco_sbc_example_clea_os_defconfigcontainsCONFIG_MACHINE_SECO_IMX8MP_EXAMPLE.seco-setup.shsearches intometa-seco-imx/conf/Yconfig/Yconfig_machineforMACHINE_SECO_IMX8MP_EXAMPLEin order to create theMACHINEvariable inlocal.conf- at compile time the
MACHINEvariable is used to find the correct machine file, in this caselayers/meta-seco-imx/conf/seco-imx8mp-example.conf.
If one of the strings above are not consistent, errors at compile time or during the creation of the environment may occur.