Yocto: Custom Linux Systems for Qt Apps – Episode 1

Click the above “blue words” to follow us

01. Introduction

>>>

The Yocto Project is an open-source collaboration project that helps developers create custom Linux-based systems for varioushardware architectures of embedded products. The Yocto Project provides a flexible set of tools and a development environment that allows embedded device developers worldwide to collaborate by sharing technologies, software stacks, configurations, and best practices for creating these custom Linux images.

To view the Yocto Project community and the companies participating in the Yocto Project, please refer to the “Community” and “Ecosystem” tabs on the homepage at https://www.yoctoproject.org/

02. Purpose

>>>

The Yocto Project supports architectures such as Intel, ARM, MIPS, AMD, and PPC. Most ODMs, OSVs, and chip vendors create and provide BSPs that support their hardware. If you want to add a custom chip, you can create a BSP that supports that architecture. In addition to extensive architecture support, the Yocto Project fully supports various device emulation through Quick Emulator (QEMU).

Unlike full Linux distributions, Yocto allows you to customize your images; you can decide which features or modules to include in your image. For instance, many devices do not have a display, so components like X11, GTK+, Qt, or SDL can be omitted. The final image will be small enough and free of unnecessary features.

03. Downloading the Default Version for Emulation

>>>

[1] My system is Ubuntu 20.04. Execute the following command to install the dependencies. This may not be complete; if compilation fails, install what is missing.

sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool

>>>

[2] Find an empty directory to download Yocto.

mkdir yocto && cd yocto && git clone git://git.yoctoproject.org/poky // Downloading from this repository can be slow; there are many versions available. You can check https://wiki.yoctoproject.org/wiki/Releases for more options.

[Recommended download for faster speed]

git clone https://github.com/yoctoproject/poky.git

Yocto: Custom Linux Systems for Qt Apps - Episode 1

// [3] cd poky && git branch -a # View all branches && git checkout -t origin/kirkstone -b my-kirkstone # Select the Kirkstone branch # If you need to update Yocto later, execute: git pull
// [4] Build Yocto && cd poky && source oe-init-build-env
// bitbake + optional parameters: core-image-minimal core-image-full-cmdline core-image-sato core-image-weston meta-toolchain meta-ide-support // [5] Start building with bitbake core-image-sato. The first compilation time depends on the compilation device and network; it usually takes about 2 hours. Subsequent compilations will be much faster. // [6] Note that if you want to forcefully stop the installation process, try to press Ctrl + c just once. Yocto will finish the current task but will stop subsequent tasks. If you press Ctrl + c multiple times, it may forcefully stop Yocto, which can lead to compilation issues next time. Generally, you only need to go to the build directory and delete *.sock and *.lock files, as follows:
$ ls build/bitbake-cookerdaemon.log bitbake.lock bitbake.sock cache conf downloads hashserve.sock sstate-cache tmp

After the compilation is complete, run as follows:

runqemu qemux86-64 // Run the emulation interface

【If you have any questions, ask AI fittencode】

Yocto: Custom Linux Systems for Qt Apps - Episode 1

04. Installation of Ubuntu 20.04

>>>

[Fast Transfer] I sent you ub…64.iso, come take a look at https://www.alipan.com/t/Wy0F9VIURQHIhmLs5JCy. Click the link to save. Use the “Aliyun Disk” app for fast online viewing without downloading, and videos can be played at original speed.

Yocto: Custom Linux Systems for Qt Apps - Episode 1

Installation tutorial can be found online.

Yocto: Custom Linux Systems for Qt Apps - Episode 1

05. Extracting Yocto Files

>>>

Yocto: Custom Linux Systems for Qt Apps - Episode 1

Download

[Fast Transfer] I sent you po…ar.gz, come take a look at https://www.alipan.com/t/Tm1C6DiFGOgHPoysD1PM. Click the link to save. Use the “Aliyun Disk” app for fast online viewing without downloading, and videos can be played at original speed.

Yocto: Custom Linux Systems for Qt Apps - Episode 1

06. Introduction to Yocto’s File Framework

>>>

Poky

Poky has two meanings. The first refers to the build system (OpenEmbedded) used to build Linux. Notably, Poky is just a concept, not a physical entity: it includes the BitBake tool, compilation toolchain, BSP, and various packages or layers. It can be considered that Poky is the essence of Yocto; additionally, the default reference Linux distribution obtained using the Poky system is also called Poky (of course, we can name this distribution as we like).

Yocto: Custom Linux Systems for Qt Apps - Episode 1

Metadata

Metadata: A collection of metadata describes the essential elements within the distribution and their sources. The OE build system parses metadata files to build Linux. Generally, metadata includes recipes, shared classes, configuration files, and information related to build instructions, as well as data to control build content and outcomes. Metadata also includes commands and data to specify software versions, sources for software, patches for bug fixes, or custom software files.

Recipes: .bb/.bbappend files, recipe files that describe where to obtain source code, how to configure, and how to compile. The difference between bbappend and bb lies mainly in that bbappend is based on bb and serves to supplement and override corresponding bb files, somewhat akin to a

Leave a Comment