Fix and adjust ukify packaging
v3 cover Fix and adjust ukify packaging
This packages up 'ukify' from systemd to be used as an, optional, stand-alone tool to generate and inspect Unified Kernel Images (UKIs) on the target. The original plan was to add this to sytemd-boot, as systemd-boot-native already handles 'ukify', but the recent systemd upgrade snuck in 'ukify' under the radar. So package it up properly from inside the systemd recipe.
Changes since v2:
* Add python3-pyzstd to ptest-packagelist.inc, as suggested by Mathieu Dubois-Briand
Changes since v1:
* Adjusted pyzstd patch to not specify an upper limit to the setuptools version, as suggested by Alexander Kanavin.
Koen Kooi (2):
python3-pyzstd: import 0.17.0 from meta-python
systemd: package 'ukify' seperately
meta/recipes-core/systemd/systemd_258.1.bb | 19 +++++++++++++ ...emove-setuptools-version-limit-of-74.patch | 27 +++++++++++++++++++ .../python/python3-pyzstd_0.17.0.bb | 19 +++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 meta/recipes-devtools/python/python3-pyzstd/0001-Remove-setuptools-version-limit-of-74.patch create mode 100644 meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb
Signature · 1 line
2.34.1
PATCH v3 1/3 python3-pyzstd: import 0.17.0 from meta-python
From the upstream website:
Pyzstd module provides classes and functions for compressing and decompressing data, using Facebook's Zstandard (or zstd as short name) algorithm.
This recipe is being moved over for systemd 258.x, the 'ukify' tool depends on this.
---
Changes since v1:
* Adjusted pyzstd patch to not specify an upper limit to the setuptools version, as suggested by Alexander Kanavin.
...emove-setuptools-version-limit-of-74.patch | 27 +++++++++++++++++++ .../python/python3-pyzstd_0.17.0.bb | 19 +++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 meta/recipes-devtools/python/python3-pyzstd/0001-Remove-setuptools-version-limit-of-74.patch create mode 100644 meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb
meta/recipes-devtools/python/python3-pyzstd/0001-Remove-setuptools-version-limit-of-74.patch new file +27 -0
@@ -0,0 +1,27 @@ +From bc9b975c9f41e43481a2eb0623b4180926baecec Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Wed, 9 Apr 2025 14:38:31 -0700 +Subject: [PATCH] Remove setuptools version limit of '74' + +Upstream sticks to 0.74 since setuptools have dropped msvc9compiler +support beyond that which is needed for python 3.9 on windows. We +do not have this problem on Linux + +Upstream-Status: Inappropriate [OE-specific] +Signed-off-by: Khem Raj <[email protected]> +--- + pyproject.toml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyproject.toml b/pyproject.toml +index dd885e4..5d4d511 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,6 +1,6 @@ + [build-system] + # setuptools 64+ support --build-option + # setuptools 74+ drops distutils.msvc9compiler required for Python 3.9 under Windows +-requires = ["setuptools>=64,<74"] ++requires = ["setuptools>=64"] + backend-path = ["build_script"] + build-backend = "pyzstd_pep517"
meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb new file +19 -0
@@ -0,0 +1,19 @@ +DESCRIPTION = "Pyzstd module provides classes and functions for compressing and \ +decompressing data, using Facebook’s Zstandard (or zstd as short name) algorithm." +HOMEPAGE = "https://github.com/animalize/pyzstd" +SECTION = "devel/python" + +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=aedb5a2679cd1552fb61c181ef974b9e" + +PYPI_PACKAGE = "pyzstd" + +SRC_URI += "file://0001-Remove-setuptools-version-limit-of-74.patch" +SRC_URI[sha256sum] = "d84271f8baa66c419204c1dd115a4dec8b266f8a2921da21b81764fa208c1db6" + +inherit pypi python_setuptools_build_meta ptest-python-pytest + +# clang-16 with -flto segfaults on arm, therefore ignore flto for now +do_configure:append:arm:toolchain-clang() { + sed -i -e "s|'-flto'|''|" ${S}/setup.py +}
Signature · 1 line
2.34.1
Re: [OE-core] [PATCH v3 1/3] python3-pyzstd: import 0.17.0 from meta-python
Quoted 10 lines · Koen Kooi via lists.openembedded.org
From the upstream website:
Pyzstd module provides classes and functions for compressing and decompressing data, using Facebook's Zstandard (or zstd as short name) algorithm.This recipe is being moved over for systemd 258.x, the 'ukify' tool depends on this.
Signed-off-by Koen Kooi <[email protected]>---
Hi Koen,
Thanks for the new version.
meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb
Quoted 5 lines
meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb new file +0
-0
A new entry should be added in meta/conf/distro/include/maintainers.inc for this recipe:
2025-12-18 08:49:56,223 - oe-selftest - INFO - distrodata.Distrodata.test_maintainers (subunit.RemotedTestCase)
2025-12-18 08:49:56,223 - oe-selftest - INFO - ... FAIL
...
2025-12-18 08:49:56,224 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
File "/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/lib/oeqa/selftest/cases/distrodata.py", line 105, in test_maintainers
self.fail("""
File "/usr/lib64/python3.9/unittest/case.py", line 676, in fail
raise self.failureException(msg)AssertionError:
The following recipes do not have a maintainer assigned to them. Please add an entry to meta/conf/distro/include/maintainers.inc file. python3-pyzstd (/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb)
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/2854
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/2747
meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb line 5
Quoted 6 lines
meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb new file +5
-0@@ -0,0 +1,19 @@ +DESCRIPTION = "Pyzstd module provides classes and functions for compressing and \ +decompressing data, using Facebook’s Zstandard (or zstd as short name) algorithm." +HOMEPAGE = "https://github.com/animalize/pyzstd" +SECTION = "devel/python" +
You also need to add a SUMMARY line here. QA complains:
WARNING: python3-pyzstd-0.17.0-r0 do_recipe_qa: QA Issue: Recipe python3-pyzstd in /srv/pokybuild/yocto-worker/qemuriscv64-ptest/build/layers/openembedded-core/meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb does not contain a SUMMARY. Please add an entry. [missing-metadata]
WARNING: python3-pyzstd-0.17.0-r0 do_recipe_qa: QA Issue: Recipe python3-pyzstd in /srv/pokybuild/yocto-worker/qemuriscv64-ptest/build/layers/openembedded-core/meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb does not have an assigned maintainer. Please add an entry into meta/conf/distro/include/maintainers.inc. [missing-maintainer]
https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/848
Aside of this, other tests are succeeding.
Thanks,
Mathieu
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Re: [OE-core] [PATCH v3 1/3] python3-pyzstd: import 0.17.0 from meta-python
Quoted 53 lines
Op 18 dec 2025, om 14:40 heeft Mathieu Dubois-Briand <[email protected]> het volgende geschreven:
Quoted 10 lines · Koen Kooi via lists.openembedded.org
From the upstream website:
Pyzstd module provides classes and functions for compressing and decompressing data, using Facebook's Zstandard (or zstd as short name) algorithm.This recipe is being moved over for systemd 258.x, the 'ukify' tool depends on this.
Signed-off-by Koen Kooi <[email protected]>---
Hi Koen,
Thanks for the new version.
meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb
Quoted 5 lines
meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb new file +0
-0A new entry should be added in meta/conf/distro/include/maintainers.inc for this recipe:
2025-12-18 08:49:56,223 - oe-selftest - INFO - distrodata.Distrodata.test_maintainers (subunit.RemotedTestCase) 2025-12-18 08:49:56,223 - oe-selftest - INFO - ... FAIL ... 2025-12-18 08:49:56,224 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last): File "/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/lib/oeqa/selftest/cases/distrodata.py", line 105, in test_maintainers self.fail(""" File "/usr/lib64/python3.9/unittest/case.py", line 676, in fail raise self.failureException(msg)AssertionError:
The following recipes do not have a maintainer assigned to them. Please add an entry to meta/conf/distro/include/maintainers.inc file. python3-pyzstd (/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/layers/openembedded-core/meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb)https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/2854
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/2747meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb line 5
Quoted 6 lines
meta/recipes-devtools/python/python3-pyzstd_0.17.0.bb new file +5
-0@@ -0,0 +1,19 @@ +DESCRIPTION = "Pyzstd module provides classes and functions for compressing and \ +decompressing data, using Facebook’s Zstandard (or zstd as short name) algorithm." +HOMEPAGE = "https://github.com/animalize/pyzstd" +SECTION = "devel/python" +You also need to add a SUMMARY line here. QA complains:
Quoted 6 lines
WARNING: python3-pyzstd-0.17.0-r0
do_recipe_qa: QA Issue: Recipe python3-pyzstd in/srv/pokybuild/yocto-worker/qemuriscv64-ptest/build/layers/openembedded-core/meta/recipes-devtools/python/python3-pyzstd_0.17.0.bbdoes not contain a SUMMARY. Please add an entry. [missing-metadata]
WARNING: python3-pyzstd-0.17.0-r0do_recipe_qa: QA Issue: Recipe python3-pyzstd in/srv/pokybuild/yocto-worker/qemuriscv64-ptest/build/layers/openembedded-core/meta/recipes-devtools/python/python3-pyzstd_0.17.0.bbdoes not have an assigned maintainer. Please add an entry into meta/conf/distro/include/maintainers.inc. [missing-maintainer]https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/848
Aside of this, other tests are succeeding.
Thanks! I'll try to send a v4 before heading out for the holidays, I appreciate your feedback and help with this. It has been a looooooong time since I had to add a new recipe to OE-core.
regards,
Koen
Quoted 9 lines
Thanks,
MathieuSignature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH v3 2/3 systemd: package 'ukify' seperately
In reply to Koen KooiThe upgrade to 258.x started shipping 'ukify' by default, but didn't adjust the runtime dependencies. Add the python modules 'ukify' imports and split out the package to avoid dragging in gigabytes of python just plain systemd.
Succesfully tested at runtime on:
* RB1-core-kit, using u-boot EFI mode + systemd-boot
* RB3gen2-core-kit, using Qualcomm UEFI + systemd-boot
* Rubikpi3, using Qualcomm UEFI and type 2 boot
* Beagleboneblack using u-boot UFI mode + systemd-boot
--- meta/recipes-core/systemd/systemd_258.1.bb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
meta/recipes-core/systemd/systemd_258.1.bb +19 -0
@@ -408,6 +408,7 @@ PACKAGE_BEFORE_PN += "\ ${PN}-networkd \ ${PN}-rpm-macros \ ${PN}-udev-rules \ + ${PN}-ukify \ ${PN}-vconsole-setup \ ${PN}-zsh-completion \ libsystemd-shared \
@@ -630,6 +631,24 @@ FILES:${PN}-udev-rules = "\ ${nonarch_libdir}/udev/rules.d/99-systemd.rules \ " +SUMMARY:${PN}-ukify = "Create and inspect Unified Kernel Images (UKIs)" +DESCRIPTION:${PN}-ukify = "ukify is a tool whose primary purpose is to combine components (usually a kernel, an initrd, and a UEFI boot stub) to create a Unified Kernel Image (UKI) — a PE binary that can be executed by the firmware to start the embedded linux kernel." +FILES:${PN}-ukify = "${bindir}/ukify" +RDEPENDS:${PN}-ukify = " \ + python3-compression \ + python3-core \ + python3-crypt \ + python3-datetime \ + python3-io \ + python3-json \ + python3-netclient \ + python3-pefile \ + python3-pprint \ + python3-pydoc \ + python3-pyzstd \ + python3-shell \ + " + CONFFILES:${PN} = "${sysconfdir}/systemd/coredump.conf \ ${sysconfdir}/systemd/journald.conf \ ${sysconfdir}/systemd/logind.conf \
Signature · 1 line
2.34.1
PATCH v3 3/3 ptest-packagelists.inc: add python3-pyzstd
In reply to Koen Kooi--- meta/conf/distro/include/ptest-packagelists.inc | 1 + 1 file changed, 1 insertion(+)
meta/conf/distro/include/ptest-packagelists.inc +1 -0
@@ -76,6 +76,7 @@ PTESTS_FAST = "\ python3-pyasn1 \ python3-pytz \ python3-pyyaml \ + python3-pyzstd \ python3-rpds-py \ python3-trove-classifiers \ python3-uritools \
Signature · 1 line
2.34.1