Yocto/Qt5: hello-qt part3 - SDK

Introduction

This work is sponsored by Reliable Embedded Systems. You can find more information about our training/consulting services here.

Objectives

The goal of this blog post is to show my journey trying to build a hello-qt application and reasons why I don't like Qt. As far as I can tell this is going to be a multi part blog post. You might want to have a look at part one and part two as well. We'll try to build an SDK for qt5, with this SDK a simple hello-qt application and in part four a recipe for this.


SDKs

In general the Yocto Projecty supports both a "classic" SDK and an extensible SDK. The extensible SDK is what I wanted to use for this, since it contains the devtool as well, but, as I already pointed out, meta-qt5 (community) support is kind of "not so motivated"[1] and with meta-qt6 (by the Qt Company) you can not even build the hello-qt command line application. 

[1] https://github.com/meta-qt5/meta-qt5/issues/356 

Install my build environment

If not don't complain to me that something didn't work as outlined here. Watch the video on how to install it:

 
Having said that - it should also work without my build environment. I just didn't test it like that. I will give you hints which layers to check out without it.

qt5 image with qtbase and qtserial (just for fun)

Various files

core-image-minimal-qt5

Check here and ignore the hello-qt app for now.

bblayers.conf

Check here.

local.conf

Check here.

Enter/setup my build environment

student@e450-tr1:/workdir$ ./resy-poky-container.sh
+ docker pull reliableembeddedsystems/poky-container:2020-07-26-master-local-gcc-9-gui-ub18
2020-07-26-master-local-gcc-9-gui-ub18: Pulling from reliableembeddedsystems/poky-container
Digest: sha256:9c8f984136026066a2ab27df09bc8b29a829b2c91ed86d957c4b9d156873c5ee
Status: Image is up to date for reliableembeddedsystems/poky-container:2020-07-26-master-local-gcc-9-gui-ub18
docker.io/reliableembeddedsystems/poky-container:2020-07-26-master-local-gcc-9-gui-ub18
+ set +x
 -- interactive mode --
source /workdir/resy-cooker.sh in container
+ press <ENTER> to go on

+ docker run --name poky_container --rm -it -v /home/student/projects:/projects -v /opt:/nfs -v /workdir:/workdir -v /workdir:/workdir reliableembeddedsystems/poky-container:2020-07-26-master-local-gcc-9-gui-ub18 --workdir=/workdir
pokyuser@fc3633f77731:/workdir$ source /workdir/resy-cooker.sh multi-v7-ml-qt5
/workdir /workdir
MACHINE or MACHINE-sw-variant: multi-v7-ml-qt5
initial SITE_CONF=../../sources/meta-resy/template-common/site.conf.sample
TEMPLATECONF: ../meta-multi-v7-ml-bsp/template-multi-v7-ml-qt5
source ../sources/poky/oe-init-build-env multi-v7-ml-qt5

### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal-qt5
    core-image-minimal-base-qt5 
    core-image-minimal-qt5 -c populate_sdk
    core-image-minimal-base-qt5 -c populate_sdk

You can also run generated qemu images with a command like 'runqemu qemux86'
/workdir
--> $#: 1
pokyuser      65      21  0 14:39 pts/0    00:00:00 /bin/bash /workdir/killall_bitbake.sh
pokyuser      67      65  0 14:39 pts/0    00:00:00 grep bitbake
pokyuser      65      21  0 14:39 pts/0    00:00:00 /bin/bash /workdir/killall_bitbake.sh
pokyuser      72      65  0 14:39 pts/0    00:00:00 grep bitbake
rm -f /workdir/build/multi-v7-ml-qt5/hashserve.sock
to ./resy-poky-container.sh:
 -- non-interactive mode --
 add the image you want to build to the command line ./resy-poky-container.sh <MACHINE> <image>
 -- interactive mode --
   enter it with - ./resy-poky-container.sh <no param>
   bitbake <image>
   source /workdir/resy-cooker.sh <MACHINE>
pokyuser@fc3633f77731:/workdir$ 

BitBake the kernel/device tree/rootfs

pokyuser@fc3633f77731:/workdir$ bitbake core-image-minimal-qt5
NOTE: Started PRServer with DBfile: /workdir/build/multi-v7-ml-qt5/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 45421, PID: 82
Loading cache: 100% |#########################################################################################################################################| Time: 0:00:00
Loaded 3375 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################| Time: 0:00:00
Parsing of 2265 .bb files complete (2264 cached, 1 parsed). 3376 targets, 372 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-resy-linux-gnueabi"
MACHINE              = "multi-v7-ml"
DISTRO               = "resy"
DISTRO_VERSION       = "3.1.2"
TUNE_FEATURES        = "arm armv7a vfp thumb callconvention-hard"
TARGET_FPU           = "hard"
meta                 
meta-poky            
meta-yocto-bsp       = "2020-08-28-dunfell-3.1.2+:d2877e208112ed479ab0b3a961aea87c31591d17"
meta-multi-v7-ml-bsp = "dunfell:64005615f681d984df398130caa5b21ca70b2fc8"
meta-u-boot-wic-bsp  = "dunfell:4dbfc93ee3fe797cee5a25ef7a389eeaec70f418"
meta-resy            = "dunfell:0c0bd4bb2defd6c5a55b172a20c7ee6694459d31"
meta-oe              
meta-networking      
meta-filesystems     
meta-python          = "2020-04-30-dunfell-3.1:17fd382f3467e20308924499b7531ae8b789f056"
meta-qt5             = "2020-09-08-dunfell:0e7015f7a86dda995a39662edbb5c26da647c496"
meta-qt5-examples    = "dunfell:44dc00fa08c78c6eb75a1d97018bd7cee999a4f1"

Initialising tasks: 100% |####################################################################################################################################| Time: 0:00:01
Sstate summary: Wanted 60 Found 59 Missed 1 Current 742 (98% match, 99% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 2110 tasks of which 2110 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 1 seconds
pokyuser@fc3633f77731:/workdir$ 

update tftp

student@e450-tr1:/workdir$ cp /workdir/build/multi-v7-ml-qt5/tmp/deploy/images/multi-v7-ml/uImage--5.4.47-custom-ml-std+git0+fd8cd8ac94-r0.1-multi-v7-ml-20201003180432.bin /tftpboot/imx6q-phytec-mira-rdk-nand/
student@e450-tr1:/workdir$ pushd /tftpboot/imx6q-phytec-mira-rdk-nand/
/tftpboot/imx6q-phytec-mira-rdk-nand /workdir
student@e450-tr1:/tftpboot/imx6q-phytec-mira-rdk-nand$ ln -sf uImage--5.4.47-custom-ml-std+git0+fd8cd8ac94-r0.1-multi-v7-ml-20201003180432.bin uImage
student@e450-tr1:/tftpboot/imx6q-phytec-mira-rdk-nand$ cp /workdir/build/multi-v7-ml-qt5/tmp/deploy/images/multi-v7-ml/imx6q-phytec-mira-rdk-nand--5.4.47-custom-ml-std+git0+fd8cd8ac94-r0.1-multi-v7-ml-20201003180432.dtb /tftpboot/imx6q-phytec-mira-rdk-nand/
student@e450-tr1:/tftpboot/imx6q-phytec-mira-rdk-nand$ ln -sf imx6q-phytec-mira-rdk-nand--5.4.47-custom-ml-std+git0+fd8cd8ac94-r0.1-multi-v7-ml-20201003180432.dtb uImage-imx6q-phytec-mira-rdk-nand.dtb
student@e450-tr1:/tftpboot/imx6q-phytec-mira-rdk-nand$ popd
/workdir
student@e450-tr1:/workdir$ 

update nfs

student@e450-tr1:/opt/poky$ sudo rm -rf /opt/resy/3.1.2/multi-v7-ml/imx6q-phytec-mira-rdk-nand-qt/core-image-minimal-qt5-multi-v7-ml
student@e450-tr1:/opt/poky$ sudo mkdir -p /opt/resy/3.1.2/multi-v7-ml/imx6q-phytec-mira-rdk-nand-qt/core-image-minimal-qt5-multi-v7-ml
student@e450-tr1:/opt/poky$ sudo ln -sf /opt/resy/3.1.2/multi-v7-ml/imx6q-phytec-mira-rdk-nand-qt/core-image-minimal-qt5-multi-v7-ml mira-rootfs
student@e450-tr1:/opt/poky$ sudo tar xf /workdir/build/multi-v7-ml-qt5/tmp/deploy/images/multi-v7-ml/core-image-minimal-qt5-multi-v7-ml-20201004133729.rootfs.tar.bz2 -C /opt/resy/3.1.2/multi-v7-ml/imx6q-phytec-mira-rdk-nand-qt/core-image-minimal-qt5-multi-v7-ml

Boot the board

U-Boot SPL 2020.01 (Jan 06 2020 - 20:56:31 +0000)
Boot device 1
Trying to boot from MMC1
mmc_load_image_raw_sector: mmc block read error


U-Boot 2020.01 (Jan 06 2020 - 20:56:31 +0000)

CPU:   Freescale i.MX6Q rev1.3 996 MHz (running at 792 MHz)
CPU:   Automotive temperature grade (-40C to 125C) at 56C
Reset cause: WDOG
I2C:   ready
DRAM:  1 GiB
NAND:  1024 MiB
MMC:   FSL_SDHC: 0
Loading Environment from SPI Flash... SF: Detected n25q128a13 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
OK
In:    serial
Out:   serial
Err:   serial
Net:   FEC [PRIME]
Hit any key to stop autoboot:  0
bootfile: imx6q-phytec-mira-rdk-nand/uImage
fdtfile: imx6q-phytec-mira-rdk-nand/uImage-imx6q-phytec-mira-rdk-nand.dtb
FEC Waiting for PHY auto negotiation to complete..... done
Using FEC device
host 192.168.42.1 is alive
Using FEC device
TFTP from server 192.168.42.1; our IP address is 192.168.42.11
Filename 'imx6q-phytec-mira-rdk-nand/uImage'.
Load address: 0x10007fc0
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###################
         6.4 MiB/s  
done
Bytes transferred = 9814592 (95c240 hex)
Using FEC device
TFTP from server 192.168.42.1; our IP address is 192.168.42.11
Filename 'imx6q-phytec-mira-rdk-nand/uImage-imx6q-phytec-mira-rdk-nand.dtb'.
Load address: 0x18000000
Loading: ###
         3.5 MiB/s  
done
Bytes transferred = 40916 (9fd4 hex)
Booting from nfs uEnv.txt from ext4...
bootargs=console=ttymxc1,115200n8 ip=192.168.42.11:192.168.42.1:192.168.42.254:255.255.255.0:imx6q-phytec-mira-rdk-nand:eth0:off nfsroot=192.168.42.1:/opt/poky/mira-rootfs,v3,tcp noinitrd nohlt panic=1 earlyprintk=ttymxc1,115200n8
## Booting kernel from Legacy Image at 10007fc0 ...
   Image Name:   Linux-5.4.47-custom-ml-std
   Image Type:   ARM Linux Kernel Image (no loading done) (uncompressed)
   Data Size:    9814528 Bytes = 9.4 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 18000000
   Booting using the fdt blob at 0x18000000
   XIP Kernel Image (no loading done)
   Using Device Tree in place at 18000000, end 1800cfd3

Starting kernel ... 

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.47-custom-ml-std (oe-user@oe-host) (gcc version 9.3.0 (GCC)) #1 SMP Wed Jun 17 14:40:38 UTC 2020
[    0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: PHYTEC phyBOARD-Mira Quad Carrier-Board with NAND
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 64 MiB at 0x4c000000
[    0.000000] percpu: Embedded 20 pages/cpu s49228 r8192 d24500 u81920
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 260608
[    0.000000] Kernel command line: console=ttymxc1,115200n8 ip=192.168.42.11:192.168.42.1:192.168.42.254:255.255.255.0:imx6q-phytec-mira-rdk-nand:eth0:off nfsroot=192.168.42.1:/opt/poky/mira-rootfs,v3,tcp noinitrd nohlt panic=1 earlyprintk=ttymxc1,115200n8
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 949944K/1048576K available (13312K kernel code, 1707K rwdata, 5476K rodata, 2048K init, 403K bss, 33096K reserved, 65536K cma-reserved, 196608K highmem)
...
[    5.274597] Loading compiled-in X.509 certificates
[    5.283286] Btrfs loaded, crc32c=crc32c-generic
[    5.319667] hctosys: unable to open rtc device (rtc0)
[    5.355779] mmc0: host does not support reading read-only switch, assuming write-enable
[    5.369941] mmc0: new high speed SDHC card at address 1234
[    5.376013] mmcblk0: mmc0:1234 SA08G 7.25 GiB 
[    5.382461]  mmcblk0: p1
[    5.431406] Micrel KSZ9031 Gigabit PHY 2188000.ethernet-1:03: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=2188000.ethernet-1:03, irq=POLL)
[   12.728403] fec 2188000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   12.738013] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   12.768040] IP-Config: Complete:
[   12.771280]      device=eth0, hwaddr=50:2d:f4:16:2d:bd, ipaddr=192.168.42.11, mask=255.255.255.0, gw=192.168.42.254
[   12.781745]      host=imx6q-phytec-mira-rdk-nand, domain=, nis-domain=(none)
[   12.788813]      bootserver=192.168.42.1, rootserver=192.168.42.1, rootpath=
[   12.806539] VFS: Mounted root (nfs filesystem) readonly on device 0:16.
[   12.813776] devtmpfs: mounted
[   12.819175] Freeing unused kernel memory: 2048K
[   12.878490] Run /sbin/init as init process
[   12.887905] random: fast init done
INIT: version  booting
Starting udev
[   13.333413] udevd[102]: starting version 3.2.9
[   13.360701] random: udevd: uninitialized urandom read (16 bytes read)
[   13.368954] random: udevd: uninitialized urandom read (16 bytes read)
[   13.378206] random: udevd: uninitialized urandom read (16 bytes read)
[   13.435679] udevd[103]: starting eudev-3.2.9
[   13.645352] etnaviv-gpu 130000.gpu: ignoring dependency for device, assuming no driver
[   13.653453] etnaviv-gpu 134000.gpu: ignoring dependency for device, assuming no driver
[   13.661612] etnaviv-gpu 2204000.gpu: ignoring dependency for device, assuming no driver
[   13.738098] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc1
[   13.767061] da9062 2-0058: Device detected (device-ID: 0x62, var-ID: 0x12, DA9062)
[   13.773646] usb_phy_generic usbphynop1: usbphynop1 supply vcc not found, using dummy regulator
[   13.788399] usb_phy_generic usbphynop2: usbphynop2 supply vcc not found, using dummy regulator
[   14.544510] da9062-watchdog da9062-watchdog: DMA mask not set
[   14.550654] da9063-rtc da9062-rtc: DMA mask not set
[   14.567359] da9063-rtc da9062-rtc: registered as rtc0
[   14.649831] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[   15.278869] urandom_read: 2 callbacks suppressed
[   15.278876] random: dd: uninitialized urandom read (512 bytes read)
[   15.516945] random: dropbear: uninitialized urandom read (32 bytes read)

Resy (Reliable Embedded Systems Reference Distro) 3.1.2 multi-v7-ml /dev/ttymxc1

multi-v7-ml login: 

Build/Use the Qt5 SDK

As I already mentioned above forget about the extensible SDK. It will build, but it's not usable. So let's concentrate on the "classic" SDK.

Normally in the OE/Yocto universe the SDK is built against a specific software stack/image. Something like this:

pokyuser@fc3633f77731:/workdir$ bitbake core-image-minimal-qt5
pokyuser@fc3633f77731:/workdir$ bitbake core-image-minimal-qt5 -c populate_sdk

core-image-minmal-qt5 contains certain packages and the SDK is built against those packages. This does not seem to be the case with qt5, as I will show you soon.

It's not well documented how to build a qt5 SDK, but that's what seems to work somehow:

  • inherit populate_sdk_qt5 - line 8
  • qt packages - line 28,29
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright (C) 2020 Robert Berger <robert.berger@ReliableEmbeddedSystems.com>
# Released under the MIT license (see COPYING.MIT for the terms)

require recipes-core/images/common-img.inc
require recipes-core/images/core-image-minimal.bb

# qt support in SDK
inherit populate_sdk_qt5

IMAGE_INSTALL += "\
                  dropbear \
                  udev-extraconf \
"

# udev-extraconf for automount

#IMAGE_INSTALL += "\
#                  packagegroup-tools-cmdline \
#                  packagegroup-tools-top \
#"

#packagegroup-tools-io
#packagegroup-tools-rt


# let's include qtbase by default
IMAGE_INSTALL += "\
                  qtbase \
                  qtserialport \
"

# global - in local.conf
#DISTRO_FEATURES_remove = "wayland"
#DISTRO_FEATURES_remove = "vulkan"

# this is a pure qt5 embedded demo image without X
CONFLICT_DISTRO_FEATURES = "x11 wayland"

# enable stuff from MACHINE/DISTRO_FEATURES
# I added this in local.conf, since it's small
#CORE_IMAGE_EXTRA_INSTALL += "packagegroup-base-extended"

One of the problems here is, that populate_sdk_qt5.bbclass adds TOOLCHAIN_TARGET_TASK_append = " packagegroup-qt5-toolchain-target" which unconditionally adds lots of stuff (much mote than hello-qt needs) as you can see here:

# Copyright (C) 2014 O.S. Systems Software LTDA.

DESCRIPTION = "Target packages for Qt5 SDK"
LICENSE = "MIT"

PACKAGE_ARCH = "${TUNE_PKGARCH}"
inherit packagegroup

PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"

# Requires Wayland to work
USE_WAYLAND = " \
    qtwayland-dev \
    qtwayland-mkspecs \
    qtwayland-plugins \
    qtwayland-tools \
"

# Requires X11 to work
USE_X11 = " \
    qtx11extras-dev \
    qtx11extras-mkspecs \
"

RDEPENDS_${PN} += " \
    packagegroup-core-standalone-sdk-target \
    libsqlite3-dev \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qt3d-dev', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qt3d-mkspecs', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qt3d-qmlplugins', '', d)} \
    qtbase-dev \
    qtbase-mkspecs \
    qtbase-plugins \
    qtbase-staticdev \
    qtbase-tools \
    qttranslations-qtbase \
    qttranslations-qthelp \
    qtcharts-dev \
    qtcharts-mkspecs \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtcharts-qmlplugins', '', d)} \
    qtconnectivity-dev \
    qtconnectivity-mkspecs \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtconnectivity-qmlplugins', '', d)} \
    qttranslations-qtconnectivity \
    qtdeclarative-dev \
    qtdeclarative-mkspecs \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtdeclarative-qmlplugins', '', d)} \
    qtdeclarative-tools \
    qtdeclarative-staticdev \
    qttranslations-qtdeclarative \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtgraphicaleffects-qmlplugins', '', d)} \
    qtimageformats-dev \
    qtimageformats-plugins \
    qtlocation-dev \
    qtlocation-mkspecs \
    qtlocation-plugins \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtlocation-qmlplugins', '', d)} \
    qttranslations-qtlocation \
    qtmqtt-dev \
    qtmqtt-mkspecs \
    qtmultimedia-dev \
    qtmultimedia-mkspecs \
    qtmultimedia-plugins \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtmultimedia-qmlplugins', '', d)} \
    qttranslations-qtmultimedia \
    qtscript-dev \
    qtscript-mkspecs \
    qttranslations-qtscript \
    qtsensors-dev \
    qtsensors-mkspecs \
    qtsensors-plugins \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtsensors-qmlplugins', '', d)} \
    qtserialport-dev \
    qtserialport-mkspecs \
    qtserialbus-dev \
    qtserialbus-mkspecs \
    qtsvg-dev \
    qtsvg-mkspecs \
    qtsvg-plugins \
    qtsystems-dev \
    qtsystems-mkspecs \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtsystems-qmlplugins', '', d)} \
    qttools-dev \
    qttools-mkspecs \
    qttools-staticdev \
    qttools-tools \
    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '${USE_WAYLAND}', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${USE_X11}', '', d)} \
    qtwebsockets-dev \
    qtwebsockets-mkspecs \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtwebsockets-qmlplugins', '', d)} \
    qttranslations-qtwebsockets \
    qtwebchannel-dev \
    qtwebchannel-mkspecs \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'qtwebchannel-qmlplugins', '', d)} \
    qtxmlpatterns-dev \
    qtxmlpatterns-mkspecs \
    qttranslations-qtxmlpatterns \
    qtquickcontrols2 \
    qtquickcontrols2-dev \
    qtquickcontrols2-mkspecs \
"
RDEPENDS_${PN}_remove_toolchain-clang_riscv32 = "qttools-dev qttools-mkspecs qttools-staticdev qttools-tools"
RDEPENDS_${PN}_remove_toolchain-clang_riscv64 = "qttools-dev qttools-mkspecs qttools-staticdev qttools-tools"

RRECOMMENDS_${PN} += " \
    qtquickcontrols-qmlplugins \
    qttools-plugins \
"

RRECOMMENDS_${PN}_remove_toolchain-clang_riscv32 = "qttools-plugins"
RRECOMMENDS_${PN}_remove_toolchain-clang_riscv64 = "qttools-plugins"

I did not fix it, but that's how you could remove stuff.

Let's build the SDK

pokyuser@fc3633f77731:/workdir$ bitbake core-image-minimal-qt5 -c populate_sdk
NOTE: Started PRServer with DBfile: /workdir/build/multi-v7-ml-qt5/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 41399, PID: 315
Loading cache: 100% |#########################################################################################################################################| Time: 0:00:00
Loaded 3375 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################| Time: 0:00:00
Parsing of 2265 .bb files complete (2264 cached, 1 parsed). 3376 targets, 372 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-resy-linux-gnueabi"
MACHINE              = "multi-v7-ml"
DISTRO               = "resy"
DISTRO_VERSION       = "3.1.2"
TUNE_FEATURES        = "arm armv7a vfp thumb callconvention-hard"
TARGET_FPU           = "hard"
meta                 
meta-poky            
meta-yocto-bsp       = "2020-08-28-dunfell-3.1.2+:d2877e208112ed479ab0b3a961aea87c31591d17"
meta-multi-v7-ml-bsp = "dunfell:64005615f681d984df398130caa5b21ca70b2fc8"
meta-u-boot-wic-bsp  = "dunfell:4dbfc93ee3fe797cee5a25ef7a389eeaec70f418"
meta-resy            = "dunfell:0c0bd4bb2defd6c5a55b172a20c7ee6694459d31"
meta-oe              
meta-networking      
meta-filesystems     
meta-python          = "2020-04-30-dunfell-3.1:17fd382f3467e20308924499b7531ae8b789f056"
meta-qt5             = "2020-09-08-dunfell:0e7015f7a86dda995a39662edbb5c26da647c496"
meta-qt5-examples    = "dunfell:44dc00fa08c78c6eb75a1d97018bd7cee999a4f1"

Initialising tasks: 100% |####################################################################################################################################| Time: 0:00:02
Sstate summary: Wanted 528 Found 527 Missed 1 Current 1080 (99% match, 99% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 4269 tasks of which 4269 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 1 seconds
pokyuser@fc3633f77731:/workdir$ 

Let's install the SDK in my SDK container

student@e450-tr1:/workdir$ ./resy-sdk-container.sh 
+ docker pull reliableembeddedsystems/sdk-container:ubuntu-18.04-gcc-9
ubuntu-18.04-gcc-9: Pulling from reliableembeddedsystems/sdk-container
Digest: sha256:90d0edd6489ec466f1db2173488686712a62bfd5c898c0867fb92620343f0249
Status: Image is up to date for reliableembeddedsystems/sdk-container:ubuntu-18.04-gcc-9
docker.io/reliableembeddedsystems/sdk-container:ubuntu-18.04-gcc-9
++ id -u student
++ stat -c %g /home/student
+ docker run -e TARGET_UID=1000 -e TARGET_GID=1000 -v /opt:/opt -v /workdir:/workdir -v /home/student/projects:/projects -v /home/student:/student -v /tftpboot:/tftpboot --interactive --tty --entrypoint=/usr/bin/entrypoint.sh reliableembeddedsystems/sdk-container:ubuntu-18.04-gcc-9 --login
sdk@ee6f0f83b4e1:/$ pushd /workdir/build/multi-v7-ml-qt5/tmp/deploy/sdk/
sdk@ee6f0f83b4e1:/workdir/build/multi-v7-ml-qt5/tmp/deploy/sdk$ ./resy-glibc-x86_64-core-image-minimal-qt5-armv7at2hf-vfp-multi-v7-ml-toolchain-3.1.2.sh
Resy (Reliable Embedded Systems Reference Distro) SDK installer version 3.1.2
=============================================================================
Enter target directory for SDK (default: /opt/resy/3.1.2): /projects/resy/3.1.2/sdk
You are about to install the SDK to "/projects/resy/3.1.2/sdk". Proceed [Y/n]? Y
Extracting SDK.....................................................................................................................................................................................done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.
 $ . /projects/resy/3.1.2/sdk/environment-setup-armv7at2hf-vfp-resy-linux-gnueabi
sdk@ee6f0f83b4e1:/workdir/build/multi-v7-ml-qt5/tmp/deploy/sdk$ popd
/
sdk@ee6f0f83b4e1:/$ 

Let's work as a developer using the SDK instead of OE/Yocto

sdk@ee6f0f83b4e1:/$ pushd /projects
/projects /
sdk@ee6f0f83b4e1:/projects$ git clone https://gitlab.com/exempli-gratia/hello-qt-sdk
Cloning into 'hello-qt-sdk'...
warning: redirecting to https://gitlab.com/exempli-gratia/hello-qt-sdk.git/
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.  
remote: Compressing objects: 100% (9/9), done. 
remote: Total 13 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (13/13), done.
sdk@ee6f0f83b4e1:/projects$ cd hello-qt-sdk/build/
sdk@ee6f0f83b4e1:/projects/hello-qt-sdk/build$ source /projects/resy/3.1.2/sdk/environment-setup-armv7at2hf-vfp-resy-linux-gnueabi
sdk@ee6f0f83b4e1:/projects/hello-qt-sdk/build$ cmake ../src/
-- Toolchain file defaulted to '/projects/resy/3.1.2/sdk/sysroots/x86_64-resysdk-linux/usr/share/cmake/OEToolchainConfig.cmake'
-- The C compiler identification is GNU 9.3.0  
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /projects/resy/3.1.2/sdk/sysroots/x86_64-resysdk-linux/usr/bin/arm-resy-linux-gnueabi/arm-resy-linux-gnueabi-gcc
-- Check for working C compiler: /projects/resy/3.1.2/sdk/sysroots/x86_64-resysdk-linux/usr/bin/arm-resy-linux-gnueabi/arm-resy-linux-gnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /projects/resy/3.1.2/sdk/sysroots/x86_64-resysdk-linux/usr/bin/arm-resy-linux-gnueabi/arm-resy-linux-gnueabi-g++
-- Check for working CXX compiler: /projects/resy/3.1.2/sdk/sysroots/x86_64-resysdk-linux/usr/bin/arm-resy-linux-gnueabi/arm-resy-linux-gnueabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /projects/hello-qt-sdk/build
sdk@ee6f0f83b4e1:/projects/hello-qt-sdk/build$ make
make[1]: Entering directory '/projects/hello-qt-sdk/build'
make[2]: Entering directory '/projects/hello-qt-sdk/build'
Scanning dependencies of target hello-qt
make[2]: Leaving directory '/projects/hello-qt-sdk/build'
make[2]: Entering directory '/projects/hello-qt-sdk/build'
[ 50%] Building CXX object CMakeFiles/hello-qt.dir/hello-qt.cpp.o
[100%] Linking CXX executable hello-qt
make[2]: Leaving directory '/projects/hello-qt-sdk/build'
[100%] Built target hello-qt
make[1]: Leaving directory '/projects/hello-qt-sdk/build' 
sdk@ee6f0f83b4e1:/projects/hello-qt-sdk/build$ sudo mkdir -p /opt/resy/3.1.2/multi-v7-ml/imx6q-phytec-mira-rdk-nand-qt/core-image-minimal-qt5-multi-v7-ml/usr/local/bin
sdk@ee6f0f83b4e1:/projects/hello-qt-sdk/build$ sudo make install DESTDIR=/opt/resy/3.1.2/multi-v7-ml/imx6q-phytec-mira-rdk-nand-qt/core-image-minimal-qt5-multi-v7-ml
[100%] Built target hello-qt
Install the project...
-- Install configuration: ""
-- Installing: /opt/resy/3.1.2/multi-v7-ml/imx6q-phytec-mira-rdk-nand-qt/core-image-minimal-qt5-multi-v7-ml/usr/local/bin/hello-qt
sdk@ee6f0f83b4e1:/projects/hello-qt-sdk/build$ popd 
/
sdk@ee6f0f83b4e1:/$

Let's run it on the board

Resy (Reliable Embedded Systems Reference Distro) 3.1.2 multi-v7-ml /dev/ttymxc1

multi-v7-ml login: root
root@multi-v7-ml:~# [   43.368017] vddpu: disabling
[   43.370921] flexcan1-reg: disabling
[   43.374416] mPCIe_1V5: disabling
[   43.377650] usb_otg_vbus: disabling

root@multi-v7-ml:~# [   98.008047] random: crng init done
root@multi-v7-ml:~# hello-qt
Hello, Qt!
root@multi-v7-ml:~# 

Let's remove it from the board

root@multi-v7-ml:~# which hello-qt
/usr/local/bin/hello-qt
root@multi-v7-ml:~# rm -f /usr/local/bin/hello-qt

Conclusion

Despite the fact that qt5 is something I try to avoid others might use it. Also I think that developers and not only Yocto people will use it. Here is a possible development workflow utilizing the "classic" SDK.

Comments

Popular posts from this blog

Yocto: BitBake and Dependencies - e.g. One recipe to use output of another recipe

Yocto: kernel modules not showing up in the rootfs

Yocto/Qt5: hello-qt part2 - Licensing