.. _yocto-wrynose-build: Building Images =============== Setup Build Directory --------------------- Starting with Yocto Wrynose, the build directory is set up with the `bitbake-setup `_ tool instead of ``karo-setup-release.sh``. Run the following command in the root directory of the cloned BSP repository (see :doc:`BSP Setup <../bsp-setup/index>`): .. prompt:: :prompts: $ bitbake-setup init The command interactively asks you to choose the configuration options: * **Configuration template**: ``default.conf.json`` (the Ka-Ro NXP BSP configuration shipped in the ``configurations`` directory of the repository). * **Machine**: the target module to build for. * **Distro**: the target distribution. * **Baseboard**: the baseboard the module is mounted on (or none). * **Configuration**: ``default`` or ``default-with-eula``. Choose ``default-with-eula`` to accept the Freescale/NXP EULA, which is required to build images containing NXP EULA-licensed packages (e.g. hardware codecs). There are different configurations you can choose from. * **Ka-Ro DISTRO configurations** .. list-table:: :header-rows: 1 * - ``DISTRO=`` - Description * - karo-minimal - Ka-Ro Linux Distro with minimal read-only rootfs * - karo-wayland - Ka-Ro Linux Distro with wayland backend * - karo-xwayland - Ka-Ro Linux Distro with wayland backend and X11 compatibility layer * Possible ``MACHINE`` configurations: .. list-table:: :header-rows: 1 * - ``MACHINE=`` * - qs95-9610 * Possible baseboards (selected via the ``baseboard`` option, sets ``KARO_BASEBOARD``): .. list-table:: :header-rows: 1 * - ``KARO_BASEBOARD=`` - Description * - *(empty)* - No baseboard (module-only configuration) * - qsbase95 - :doc:`QSBase95 ` baseboard bitbake-setup then checks out all layers defined in the configuration template into the ``layers`` directory of the new setup and creates a ready-to-use build directory. The resulting directory layout below the repository root is: .. code-block:: text bitbake-builds/ ├── settings.conf ├── site.conf └── --wrynose/ # e.g. karo-minimal-qs95-9610-wrynose ├── build/ # the BitBake build directory (conf/, tmp/, ...) ├── config/ # the bitbake-setup configuration instance └── layers/ # the checked-out layers (meta-karo-nxp, ...) .. note:: The setup directory name is just an example and depends on the choices made during ``bitbake-setup init``. To enter the build environment of a setup, source the ``init-build-env`` script in its ``build`` directory: .. prompt:: :prompts: $ . bitbake-builds/--wrynose/build/init-build-env * **Specific Example:** .. prompt:: :prompts: $ . bitbake-builds/karo-minimal-qs95-9610-wrynose/build/init-build-env * **Managing setups:** ``bitbake-setup`` provides additional commands to manage your setups, e.g. ``bitbake-setup list`` to list the available configuration templates and existing setups, ``bitbake-setup status`` to check if a setup is in sync with its configuration template, and ``bitbake-setup update`` to bring a setup up to date with upstream changes. See the `bitbake-setup documentation `_ for details. Configuration ------------- To enable different features for your build you can modify the ``conf/local.conf`` file inside the ``build`` directory of your setup (``bitbake-builds//build/conf/local.conf``). Baseboard (optional) ~~~~~~~~~~~~~~~~~~~~ The baseboard is selected during ``bitbake-setup init`` via the ``baseboard`` option, which sets ``KARO_BASEBOARD`` through an OE configuration fragment. To change it afterwards, set ``KARO_BASEBOARD`` to the shortcut of the respective baseboard in your ``conf/local.conf``: .. code-block:: text KARO_BASEBOARD = "qsbase95" Machine Features ~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 * - Machine Feature - Description - Default? * - emmc - eMMC storage support - Automatically selected via $MACHINE if supported * - nand - NAND storage support - Automatically selected via $MACHINE if supported * - optee - OP-TEE support - Automatically selected via $MACHINE if supported * - pcie - PCIe interface support - Automatically selected via $MACHINE if supported * - gpu - Module has access to a GPU - Automatically selected via $MACHINE if supported * - lvds - LVDS interface support - Automatically selected via $MACHINE if supported .. note:: Not all may be listed, see Yocto layers for more. To expand the ``MACHINE_FEATURES`` variable to your needs, modify your ``conf/local.conf``: .. code-block:: text MACHINE_FEATURES:append = " item1 item2 ..." Distro Features ~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 * - Distro Feature - Description - Default? * - systemd - Changes init-system to systemd, e.g. neccessary when using Debian - No * - ipv6 - IPV6 support - No * - wifi - WiFi support - No * - bluetooth - Bluetooth support - No .. note:: Not all may be listed, see Yocto layers for more. To expand the ``DISTRO_FEATURES`` variable to your needs, modify your ``conf/local.conf``: .. code-block:: text DISTRO_FEATURES:append = " item1 item2 ..." Build the Image --------------- Build the image with the following command inside the ``build`` directory of your setup: .. prompt:: :prompts: $ bitbake Here are the different images that can be built: .. table:: :widths: 20 30 20 20 +----------------------------------+------------------------------------------------------------------+---------------------------+-----------------------------------+ | Image | Description | DISTRO | Provided by layer | +==================================+==================================================================+===========================+===================================+ | karo-image-minimal | Image with minimal read-only rootfs | karo-minimal | meta-karo-distro | +----------------------------------+------------------------------------------------------------------+---------------------------+-----------------------------------+ | karo-image-weston | Image with basic weston desktop, graphics accelerated | karo-(x)wayland | meta-karo-distro | +----------------------------------+------------------------------------------------------------------+---------------------------+-----------------------------------+ | karo-image-qt6 | Image with basic weston desktop and QT6. | karo-(x)wayland | meta-karo-distro | | | To use it with QT-Creator see | | | | | :doc:`/software-documentation/applications/qt/index` | | | +----------------------------------+------------------------------------------------------------------+---------------------------+-----------------------------------+ | karo-image-ml | Image including and supporting imx Machine-Learning demos | karo-(x)wayland | meta-karo-distro | | | See :doc:`/software-documentation/applications/ml/index` | | | +----------------------------------+------------------------------------------------------------------+---------------------------+-----------------------------------+ To build the SDK of a certain image run inside the ``build`` directory of your setup: .. prompt:: :prompts: $ bitbake -c populate_sdk .. tip:: The SDK can e.g. be used for :doc:`/software-documentation/applications/vscode/index`. Image Deployment ---------------- After a build is complete, the **results reside in the** ``bitbake-builds//build/tmp/deploy/images//`` **sub-directory**. An image is, for the most part, specific to the machine set in the environment setup. Each image build usually creates U-Boot, kernel, and an image based on the machine and distro configuration files. i.MX ~~~~ To continue programming your board with these images, simply ``cd`` into the above mentioned **** folder inside the deploy directory and run: .. prompt:: :prompts: $ uuu -v For further information about **uuu** see :doc:`/software-documentation/flashtools/uuu/index`. | .. tip:: See what you can do with Yocto built images on your module at :doc:`/software-documentation/linux/index`. If you compiled ``karo-image-qt6`` check out :doc:`/software-documentation/applications/qt/index`.