Upgrading to Yocto Kirkstone

The Yocto 4.0 release (spring 2022), also codenamed “Kirkstone” introduces a couple of changes. You can take a look at the official migration guide.

The following errors and fixes have appeared while attempting to update a meta-layer to the current release.



Errors


Incorrect LAYERSERIES_COMPAT

Error message:

ERROR: Layer meta-amateurradio is not compatible with the core layer which only supports these series: kirkstone (layer is compatible with honister)

Explanation: Each layer must declare the list of releases it is compatible with, to safeguard against mismatched configurations. See the upstream documentation about LAYERSERIES_COMPAT. Because we’re working with new Yocto versions, we’ll have to manually change the list of the compatible releases of the layer, inside the layer.conf file.

Fix:

vim poky/meta-amateurradio/conf/layer.conf
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -12,7 +12,7 @@ BBFILE_PRIORITY_meta-amateurradio = "6"
 LAYERDEPENDS_meta-amateurradio = "core"
 LAYERDEPENDS_meta-amateurradio += "openembedded-layer"
 
-LAYERSERIES_COMPAT_meta-amateurradio = "honister"
+LAYERSERIES_COMPAT_meta-amateurradio = "honister kirkstone"
 
 BBFILES_DYNAMIC += " \
   qt5-layer:${LAYERDIR}/dynamic-layers/qt5-layer/*/*/*.bb \

Error message:

ERROR: ParseError in configuration INHERITs: Could not inherit file classes/image-prelink.bbclass

Explanation: The error can appear if you’re reusing conf/local.conf files from previous versions. In the Kirkstone release, the image-prelink class was removed. For reference, this commit explains the change. Also, the change was mentioned in the official documentation. To correct the issue, just remove the image-prelink from the list of used classes, in the conf/local.conf file.

Fix:

vim build/conf/local.conf
 SDKMACHINE = "x86_64"
-USER_CLASSES = "buildstats image-prelink"
+USER_CLASSES = "buildstats"
 PATCHRESOLVE = "noop"

Failures in do_configure

Error messages:

| ./configure: line 10020: pkg-config: command not found
| configure: error: Gpredict requires libcurl-dev 7.19 or later
| NOTE: The following config.log files may provide further information.
| NOTE: .../build/tmp/work/cortexa72-poky-linux/gpredict/2.2.1-r0/gpredict-2.2.1/config.log
| ERROR: configure failed
| ../fldigi-4.1.20/configure: line 12526: syntax error near unexpected token `PNG,'
| ../fldigi-4.1.20/configure: line 12526: `            PKG_CHECK_MODULES(PNG, libpng >= 1.2.8, ac_cv_[]png=yes, ac_cv_[]png=no)'
| NOTE: The following config.log files may provide further information.
| NOTE: .../build/tmp/work/cortexa72-poky-linux/fldigi/4.1.20-r0/build/config.log
| ERROR: configure failed
| DEBUG: Executing shell function do_configure
| ERROR: Error calling .../build/tmp/work/cortexa72-poky-linux/qsstv/9.5.8-r0/recipe-sysroot-native/usr/bin/qmake -makefile -o Makefile -r PREFIX=/usr .../build/tmp/work/cortexa72-poky-linux/qsstv/9.5.8-r0/qsstv/qsstv.pro --
| WARNING: exit code 1 from a shell command.
| Project ERROR: libopenjp2 development package not found

Explanation: In the Kirkstone release, the pkgconfig dependency is not pulled automatically anymore, triggering do_configure failures (not finding the pkg-config tool or other dependencies). Reference patch triggering this issue. To fix it, the recipes having failures must inherit the pkgconfig bbclass, as shown below.

Fix:

vim poky/meta-amateurradio/recipes-ham/gpredict/gpredict_2.2.1.bb
-inherit autotools-brokensep gettext
+inherit autotools-brokensep gettext pkgconfig
vim poky/meta-amateurradio/recipes-ham/fldigi/fldigi_4.1.20.bb
-inherit autotools gettext
+inherit autotools gettext pkgconfig
vim poky/meta-amateurradio/dynamic-layers/qt5-layer/recipes-ham/qsstv/qsstv_9.5.8.bb
-inherit qmake5
+inherit qmake5 pkgconfig

Failures while accessing the network during the build

Starting with Kirkstone, compilation steps are not allowed to use the network (to improve reproducibility and reduce the chances of data exfiltration). If your build process requires network access during the build, you must specify it in the recipe.

vim poky/meta-amateurradio/recipes-ham/fldigi/fldigi_4.1.20.bb
+do_configure[network] = "1"
+do_compile[network] = "1"


Warnings


Git or Github warnings

Error message:

WARNING: direwolf-1.6-r0 do_fetch: URL: git://github.com/wb2osz/direwolf.git;protocol=git uses git protocol which is no longer supported by github. Please change to ;protocol=https in the url.
WARNING: direwolf-1.6-r0 do_fetch: URL: git://github.com/wb2osz/direwolf.git;protocol=git does not set any branch parameter. The future default branch used by tools and repositories is uncertain and we will therefore soon require this is set in all git urls.

Explanation: There are two different items impacting the Git protocol.

First, due to political-correctness trends, the “master” branch is not assumed anymore to be the default branch (with some projects replacing it with the “main” branch). Starting with Kirkstone, the name of the branch must always be specified (or the “nobranch” flag must be set).

Second, the Github servers block the unencrypted git protocol. The URLs mentioned in the recipes must use the HTTPS protocol.

For both of these changes, a migration script is available.

Automated fix (using migration script):

./poky/scripts/contrib/convert-srcuri.py ./poky/meta-amateurradio/

Manual fix (changing the URL):

vim poky/meta-amateurradio/recipes-ham/cubicsdr/cubicsdr_git.bb
-SRC_URI = "git://github.com/cjcliffe/CubicSDR.git;protocol=git"
+SRC_URI = "git://github.com/cjcliffe/CubicSDR.git;protocol=https;branch=master"

License warnings

Error message:

WARNING: csdr-git-r0 do_populate_lic: QA Issue: csdr: No generic license file exists for: BSD in any provider [license-exists]
WARNING: csdr-git-r0 do_package_qa: QA Issue: Recipe LICENSE includes obsolete licenses GPLv3+ [obsolete-license]
WARNING: rtlsdr-git-r0 do_package_qa: QA Issue: Recipe LICENSE includes obsolete licenses GPL-2.0 [obsolete-license]
WARNING: goocanvas-2.0.4-r0 do_package_qa: QA Issue: Recipe LICENSE includes obsolete licenses GPLv2 [obsolete-license]
WARNING: hamlib-git-r0 do_package_qa: QA Issue: Recipe LICENSE includes obsolete licenses GPLv2+ [obsolete-license]
WARNING: fldigi-4.1.20-r0 do_package_qa: QA Issue: Recipe LICENSE includes obsolete licenses GPLv3 [obsolete-license]

Explanation: The license names mentioned in the recipes are validated using a more strict criteria. The table below shows the mapping between the old and new license names. It is not a complete reference, but a starting point.

Old license New license
BSD BSD-3-Clause
GPLv3 GPL-3.0-only
GPLv3+ GPL-3.0-or-later
GPLv2 GPL-2.0-only
GPL-2.0 GPL-2.0-only
GPLv2+ GPL-2.0-or-later

You can look at the available license names in the poky git repository.

To fix these warnings, a migration script is available.

Automated fix (using migration script):

./poky/scripts/contrib/convert-spdx-licenses.py ./poky/meta-amateurradio/

Manual fix (changing the license name):

vim poky/meta-amateurradio/recipes-ham/fldigi/fldigi_4.1.20.bb
-LICENSE = "GPLv3"
+LICENSE = "GPL-3.0-only"

Warnings with whitelist, blacklist and abort keywords

Error message:

WARNING: The BB_DISKMON_DIRS "ABORT" action has been renamed to "HALT", update configuration

Explanation: Due to political correctnes trends, keywords like “whitelist”, “blacklist” and “abort” have been replaced with other keywords.

A migration script is available to identify and possibly fix issues.

Automated fix (using migration script):

./poky/scripts/contrib/convert-variable-renames.py ./poky/meta-amateurradio/

Manual fix (changing the config):

vim build/conf/local.conf
 BB_DISKMON_DIRS = "\
     STOPTASKS,${TMPDIR},1G,100K \
     STOPTASKS,${DL_DIR},1G,100K \
     STOPTASKS,${SSTATE_DIR},1G,100K \
     STOPTASKS,/tmp,100M,100K \
-    ABORT,${TMPDIR},100M,1K \
-    ABORT,${DL_DIR},100M,1K \
-    ABORT,${SSTATE_DIR},100M,1K \
-    ABORT,/tmp,10M,1K"
+    HALT,${TMPDIR},100M,1K \
+    HALT,${DL_DIR},100M,1K \
+    HALT,${SSTATE_DIR},100M,1K \
+    HALT,/tmp,10M,1K"


Other issues


Longer build times

The kirkstone build takes a lot longer to finish, while building the rust compiler (rust-llvm-native, rust-native, rust-cross).

It’s possible you’re updating an image that included librsvg. The update to the latest release also pulls the rust environment. This commit has added that change.