Enable early Debian trixie support, drop sid
cover Enable early Debian trixie support, drop sid
The next Debian release is still some time into the future, probably around mid of next year again, but it turned out that - at least for our RISC-V testing - it already provides a viable target. However, quite a bit more changes were need than the so far circulating first attempts.
This series now seems to work fine for all our architectures and with full feature set. It specifically allows us to switch from snapshot-based sid to latest trixie with our riscv64 build. If that may break again in the future we could still freeze the package set once more until trixie is finally released.
These are technical changes, no official commitments yet on the CIP support strategy for this not-yet-released Debian version.
Jan
Jan Kiszka (9):
Provide recipe to rebuild gnu-efi 3.0.18 for fixing armhf bug
swupdate: Control self-building via boolean var
swupdate-signer: Ensure compatibility also with latest openssl 3.3
u-boot: Use efisebdb with trixie for generating the UEFI key database
initramfs-crypt-hook: Make dependencies release-specific and add
trixie support
read-only-rootfs: Do not install tmp-fs with trixie anymore
efibootguard: Use prebuilt python-shtab from trixie onward Add Debian trixie
Replace sid with trixie
.gitlab-ci.yml | 6 +-
Kconfig | 7 +-
classes/delta-update.bbclass | 4 +-
classes/read-only-rootfs.bbclass | 5 +-
conf/distro/cip-core-sid.conf | 20 ----
conf/distro/cip-core-trixie.conf | 16 ++++
doc/README.swupdate.md | 16 ++--
kas-cip.yml | 2 +-
kas/opt/sid.yml | 15 ---
kas/opt/trixie.yml | 15 +++
.../efibootguard/efibootguard_0.18-1+cip.bb | 7 +-
recipes-bsp/u-boot/files/rules.tmpl | 8 +-
recipes-bsp/u-boot/u-boot-common-2024.01.inc | 5 +-
recipes-core/images/swupdate.inc | 10 +-
.../0001-ARM32-Split-headers-and-code.patch | 93 +++++++++++++++++++
recipes-devtools/gnu-efi/gnu-efi_latest.bb | 25 +++++
.../secure-boot-secrets/files/sid | 1 +
.../{sid => trixie}/PkKek-1-snakeoil.key | 0
.../{sid => trixie}/PkKek-1-snakeoil.pem | 0
.../swupdate-certificates/files/trixie | 1 +
.../swupdate-signer/files/sign-swu-cms | 9 +-
...ook_0.3.bb => initramfs-crypt-hook_0.4.bb} | 10 +-
start-qemu.sh | 6 +-
23 files changed, 206 insertions(+), 75 deletions(-)
delete mode 100644 conf/distro/cip-core-sid.conf
create mode 100644 conf/distro/cip-core-trixie.conf
delete mode 100644 kas/opt/sid.yml
create mode 100644 kas/opt/trixie.yml
create mode 100644 recipes-devtools/gnu-efi/files/0001-ARM32-Split-headers-and-code.patch
create mode 100644 recipes-devtools/gnu-efi/gnu-efi_latest.bb
create mode 120000 recipes-devtools/secure-boot-secrets/files/sid
rename recipes-devtools/secure-boot-secrets/files/{sid => trixie}/PkKek-1-snakeoil.key (100%)
rename recipes-devtools/secure-boot-secrets/files/{sid => trixie}/PkKek-1-snakeoil.pem (100%)
create mode 120000 recipes-devtools/swupdate-certificates/files/trixie
rename recipes-initramfs/initramfs-crypt-hook/{initramfs-crypt-hook_0.3.bb => initramfs-crypt-hook_0.4.bb} (89%)Signature · 1 line
2.43.0
PATCH 1/9 Provide recipe to rebuild gnu-efi 3.0.18 for fixing armhf bug
From: Jan Kiszka <[email protected]>
This allows to rebuild gnu-efi from testing/unstable in order to address
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1086705. With this version, the kernel stub of EFI Boot Guard is built correctly again, and the system boots.
--- .../efibootguard/efibootguard_0.18-1+cip.bb | 4 + .../0001-ARM32-Split-headers-and-code.patch | 93 +++++++++++++++++++ recipes-devtools/gnu-efi/gnu-efi_latest.bb | 25 +++++ 3 files changed, 122 insertions(+) create mode 100644 recipes-devtools/gnu-efi/files/0001-ARM32-Split-headers-and-code.patch create mode 100644 recipes-devtools/gnu-efi/gnu-efi_latest.bb
recipes-bsp/efibootguard/efibootguard_0.18-1+cip.bb +4 -0
@@ -35,6 +35,10 @@ PATCHTOOL = "git" inherit dpkg DEPENDS = "python-shtab" + +DEPENDS:trixie = "gnu-efi" +DEPENDS:sid = "gnu-efi" + # needed for buster, bullseye could use compat >= 13 python() { arch = d.getVar('DISTRO_ARCH')
recipes-devtools/gnu-efi/files/0001-ARM32-Split-headers-and-code.patch new file +93 -0
93 lines not on this page · raw message
recipes-devtools/gnu-efi/gnu-efi_latest.bb new file +25 -0
@@ -0,0 +1,25 @@ +# +# CIP Core, generic profile +# +# Copyright (c) Siemens AG, 2023 +# +# Authors: +# Jan Kiszka <[email protected]> +# +# SPDX-License-Identifier: MIT +# + +inherit dpkg + +CHANGELOG_V="<orig-version>+cip" + +SRC_URI = "apt://${BPN}" +SRC_URI += "file://0001-ARM32-Split-headers-and-code.patch;apply=no" + +do_prepare_build() { + deb_add_changelog + + cd ${S} + quilt import -f ${WORKDIR}/*.patch + quilt push -a +}
Signature · 1 line
2.43.0
PATCH 2/9 swupdate: Control self-building via boolean var
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Under the assumption that future versions of Debian will deliver us the needed versions of SWUpdate, this eases to opt-in for self-building.
--- recipes-core/images/swupdate.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
recipes-core/images/swupdate.inc +7 -3
@@ -17,9 +17,13 @@ SWU_HW_COMPAT ?= "cip-core-1.0" IMAGER_BUILD_DEPS:swu += "${@'swupdate-signer' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}" IMAGER_INSTALL:swu += "${@'swupdate-signer' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}" IMAGE_INSTALL += "${@'swupdate-certificates' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}" -IMAGE_INSTALL += " swupdate" -IMAGE_INSTALL:remove:sid = "swupdate" -IMAGE_PREINSTALL:append:sid = " swupdate" +SWUPDATE_SELFBUILT ?= "0" +SWUPDATE_SELFBUILT:buster = "1" +SWUPDATE_SELFBUILT:bullseye = "1" +SWUPDATE_SELFBUILT:bookworm = "1" + +IMAGE_INSTALL:append = "${@' swupdate' if bb.utils.to_boolean(d.getVar('SWUPDATE_SELFBUILT')) else ''}" +IMAGE_PREINSTALL:append = "${@'' if bb.utils.to_boolean(d.getVar('SWUPDATE_SELFBUILT')) else ' swupdate'}" IMAGE_INSTALL += " swupdate-handler-roundrobin"
Signature · 1 line
2.43.0
Re: [isar-cip-core][PATCH 2/9] swupdate: Control self-building via boolean var
Quoted 5 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Under the assumption that future versions of Debian will deliver us the needed versions of SWUpdate, this eases to opt-in for self-building.
Do we need some additional logic for SWU_SIGNED = 0? As swupdate from trixie requires signed updates?
Quirin
Quoted 26 lines
Signed-off-by Jan Kiszka <[email protected]>--- recipes-core/images/swupdate.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)recipes-core/images/swupdate.inc +7
-3@@ -17,9 +17,13 @@ SWU_HW_COMPAT ?= "cip-core-1.0" IMAGER_BUILD_DEPS:swu += "${@'swupdate-signer' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}" IMAGER_INSTALL:swu += "${@'swupdate-signer' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}" IMAGE_INSTALL += "${@'swupdate-certificates' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}" -IMAGE_INSTALL += " swupdate" -IMAGE_INSTALL:remove:sid = "swupdate" -IMAGE_PREINSTALL:append:sid = " swupdate" +SWUPDATE_SELFBUILT ?= "0" +SWUPDATE_SELFBUILT:buster = "1" +SWUPDATE_SELFBUILT:bullseye = "1" +SWUPDATE_SELFBUILT:bookworm = "1" + +IMAGE_INSTALL:append = "${@' swupdate' if bb.utils.to_boolean(d.getVar('SWUPDATE_SELFBUILT')) else ''}" +IMAGE_PREINSTALL:append = "${@'' if bb.utils.to_boolean(d.getVar('SWUPDATE_SELFBUILT')) else ' swupdate'}" IMAGE_INSTALL += " swupdate-handler-roundrobin"
Re: [isar-cip-core][PATCH 2/9] swupdate: Control self-building via boolean var
Quoted 10 lines · Quirin Gylstorff
Quoted 5 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Under the assumption that future versions of Debian will deliver us the needed versions of SWUpdate, this eases to opt-in for self-building.
Do we need some additional logic for
SWU_SIGNED= 0? As swupdate from trixie requires signed updates?
You mean we must enforce SWU_SIGNED = 1 from trixie onward?
Jan
Quoted 32 lines
Quoted 31 lines
Signed-off-by Jan Kiszka <[email protected]>---
recipes-core/images/swupdate.inc | 10 +++++++---1 file changed, 7 insertions(+), 3 deletions(-)recipes-core/images/ renamed from recipes-core/images/swupdate.inc +0
-0swupdate.inc
index96994b5c..b1cad439100644recipes-core/images/swupdate.inc +0
-0@@ -17,9 +17,13 @@ SWU_HW_COMPAT ?= "cip-core-1.0"IMAGER_BUILD_DEPS:swu += "${@'swupdate-signer' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}" IMAGER_INSTALL:swu += "${@'swupdate-signer' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}"
IMAGE_INSTALL+= "${@'swupdate-certificates' if bb.utils.to_boolean(d.getVar('SWU_SIGNED')) else ''}" -IMAGE_INSTALL += " swupdate" -IMAGE_INSTALL:remove:sid = "swupdate"recipes-core/images/swupdate.inc +6
-1-IMAGE_PREINSTALL:append:sid = " swupdate" +SWUPDATE_SELFBUILT ?= "0" +SWUPDATE_SELFBUILT:buster = "1" +SWUPDATE_SELFBUILT:bullseye = "1" +SWUPDATE_SELFBUILT:bookworm = "1" + +IMAGE_INSTALL:append = "${@' swupdate' ifbb.utils.to_boolean(d.getVar('SWUPDATE_SELFBUILT')) else ''}" +IMAGE_PREINSTALL:append = "${@'' if bb.utils.to_boolean(d.getVar('SWUPDATE_SELFBUILT')) else ' swupdate'}"
IMAGE_INSTALL+= " swupdate-handler-roundrobin"
Signature · 2 lines
Siemens AG, Technology Linux Expert Center
Re: [isar-cip-core][PATCH 2/9] swupdate: Control self-building via boolean var
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Quirin Gylstorff
Quoted 2 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Under the assumption that future versions of Debian will deliver us the needed versions of SWUpdate, this eases to opt-in for self-building.
Do we need some additional logic for
SWU_SIGNED= 0? As swupdate from trixie requires signed updates?You mean we must enforce
SWU_SIGNED= 1 from trixie onward?
... or do you rather mean we should switch back to self-building if someone selected SWU_SIGNED = 0? The latter comes with the risk that self-building for >= trixie could quickly become untested and start to silently break.
Jan
Signature · 2 lines
Siemens AG, Technology Linux Expert Center
Re: [isar-cip-core][PATCH 2/9] swupdate: Control self-building via boolean var
Quoted 13 lines · Jan Kiszka
Quoted 12 lines · Jan Kiszka
Quoted 10 lines · Quirin Gylstorff
Quoted 5 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Under the assumption that future versions of Debian will deliver us the needed versions of SWUpdate, this eases to opt-in for self-building.
Do we need some additional logic for
SWU_SIGNED= 0? As swupdate from trixie requires signed updates?
Quoted 7 lines
Quoted 2 lines
You mean we must enforce
SWU_SIGNED= 1 from trixie onward?... or do you rather mean we should switch back to self-building if someone selected
SWU_SIGNED= 0? The latter comes with the risk that self-building for >= trixie could quickly become untested and start to silently break.
I think documenting it would be enough as SWU_SIGNED = 1 is already the default. If you want to deactivate signing you would need to set SWU_SIGNED = 0 and activate self-building.
Quirin
Quoted 2 lines
Quoted 1 line
Jan
Re: [isar-cip-core][PATCH 2/9] swupdate: Control self-building via boolean var
Quoted 20 lines · Quirin Gylstorff
Quoted 17 lines · Jan Kiszka
Quoted 15 lines · Jan Kiszka
Quoted 11 lines · Quirin Gylstorff
Quoted 6 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Under the assumption that future versions of Debian will deliver us the
needed versions of SWUpdate, this eases to opt-in for self-building.Do we need some additional logic for
SWU_SIGNED= 0? As swupdate from trixie requires signed updates?You mean we must enforce
SWU_SIGNED= 1 from trixie onward?
Quoted 7 lines
Quoted 4 lines
... or do you rather mean we should switch back to self-building if someone selected
SWU_SIGNED= 0? The latter comes with the risk that self-building for >= trixie could quickly become untested and start to silently break.I think documenting it would be enough as
SWU_SIGNED= 1 is already the default. If you want to deactivate signing you would need to setSWU_SIGNED= 0 and activate self-building.
But what should be documented? These are just the technical steps. If those are not part of any test set, things will eventually break - in the best case already when trying to build.
I'm rather inclined to deny self-building on >bookworm until we have a concrete need and cover that via testing as well.
Jan
Signature · 2 lines
Siemens AG, Technology Linux Expert Center
Re: [isar-cip-core][PATCH 2/9] swupdate: Control self-building via boolean var
Quoted 29 lines · Jan Kiszka
Quoted 20 lines · Quirin Gylstorff
Quoted 17 lines · Jan Kiszka
Quoted 15 lines · Jan Kiszka
Quoted 11 lines · Quirin Gylstorff
Quoted 6 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Under the assumption that future versions of Debian will deliver us the
needed versions of SWUpdate, this eases to opt-in for self-building.Do we need some additional logic for
SWU_SIGNED= 0? As swupdate from trixie requires signed updates?You mean we must enforce
SWU_SIGNED= 1 from trixie onward?Quoted 7 lines
Quoted 4 lines
... or do you rather mean we should switch back to self-building if someone selected
SWU_SIGNED= 0? The latter comes with the risk that self-building for >= trixie could quickly become untested and start to silently break.I think documenting it would be enough as
SWU_SIGNED= 1 is already the default. If you want to deactivate signing you would need to setSWU_SIGNED= 0 and activate self-building.
Quoted 6 lines
But what should be documented? These are just the technical steps. If those are not part of any test set, things will eventually break - in the best case already when trying to build.
I'm rather inclined to deny self-building on >bookworm until we have a concrete need and cover that via testing as well.
I concur with deactivating the self-building >bookworm. Quirin
Quoted 3 lines
Jan
PATCH 3/9 swupdate-signer: Ensure compatibility also with latest openssl 3.3
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
That -check option was probably never official and is now definitely gone with openssl 3.3 from trixie. In fact, we do not even need it, the return code is set as expected also without it.
--- recipes-devtools/swupdate-signer/files/sign-swu-cms | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
recipes-devtools/swupdate-signer/files/sign-swu-cms +3 -6
@@ -10,14 +10,11 @@ error_msg() { } if ! openssl rsa -check -noout -in "$inkey"; then - error_msg "key '$inkey' is not a rsa key " + error_msg "key '$inkey' is not a rsa key" fi -# if openssl > 3.0 we have the x509 check option -if openssl version | grep -q "3.[0-9].[0-9]"; then - if ! openssl x509 -check -noout -in "$cert"; then - error_msg "certificate '$cert' is not a certificate" - fi +if ! openssl x509 -noout -in "$cert"; then + error_msg "certificate '$cert' is not a certificate" fi key_md5=$(openssl rsa -modulus -noout -in "$inkey" | openssl md5)
Signature · 1 line
2.43.0
PATCH 4/9 u-boot: Use efisebdb with trixie for generating the UEFI key database
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Latest peboot dropped efisiglist and points to efisebdb from the efivar package instead. That requires us to specify a key owner GUID, and we use a random one here for our demo purposes.
--- recipes-bsp/u-boot/files/rules.tmpl | 8 ++++++-- recipes-bsp/u-boot/u-boot-common-2024.01.inc | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-)
recipes-bsp/u-boot/files/rules.tmpl +6 -2
@@ -1,6 +1,6 @@ #!/usr/bin/make -f # -# Copyright (c) Siemens AG, 2018-2022 +# Copyright (c) Siemens AG, 2018-2024 # # SPDX-License-Identifier: MIT
@@ -13,7 +13,11 @@ override_dh_auto_build: if [ -e /usr/share/secure-boot-secrets/secure-boot.pem ]; then \ openssl x509 -in /usr/share/secure-boot-secrets/secure-boot.pem -out secure-boot.der -outform der; \ rm -f secure-boot.esl; \ - efisiglist -a -c secure-boot.der -o secure-boot.esl; \ + if [ -x /usr/bin/efisecdb ]; then \ + efisecdb -g 32db313c-f7d4-42a6-9a49-e32870001c63 -a -c secure-boot.der -o secure-boot.esl; \ + else \ + efisiglist -a -c secure-boot.der -o secure-boot.esl; \ + fi; \ rm -f ubootefi.var; \ tools/efivar.py set -i ubootefi.var -n PK -d secure-boot.esl -t file; \ tools/efivar.py set -i ubootefi.var -n KEK -d secure-boot.esl -t file; \
recipes-bsp/u-boot/u-boot-common-2024.01.inc +4 -1
@@ -24,7 +24,10 @@ S = "${WORKDIR}/u-boot-${PV}" DEBIAN_BUILD_DEPENDS += ", libssl-dev:native, libssl-dev:${DISTRO_ARCH}" DEBIAN_BUILD_DEPENDS:append:secureboot = ", \ - openssl, pesign, secure-boot-secrets, python3-openssl:native" + openssl, efivar, secure-boot-secrets, python3-openssl:native" +DEBIAN_BUILD_DEPENDS:append:secureboot:buster = ", pesign" +DEBIAN_BUILD_DEPENDS:append:secureboot:bullseye = ", pesign" +DEBIAN_BUILD_DEPENDS:append:secureboot:bookworm = ", pesign" DEPENDS:append:secureboot = " secure-boot-secrets" do_prepare_build:append:secureboot() {
Signature · 1 line
2.43.0
PATCH 5/9 initramfs-crypt-hook: Make dependencies release-specific and add trixie support
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Rather than making the list of alternatives longer and longer, append dependencies depending on the selected Debian release. Will also make it easier to clean up when we once drop support for a release.
Along with this refactoring comes the list of dependencies needed with trixie.
---
...s-crypt-hook_0.3.bb => initramfs-crypt-hook_0.4.bb} | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
rename recipes-initramfs/initramfs-crypt-hook/{initramfs-crypt-hook_0.3.bb => initramfs-crypt-hook_0.4.bb} (89%)recipes-initramfs/initramfs-crypt-hook/initramfs-crypt-hook_0.4.bb renamed from recipes-initramfs/initramfs-crypt-hook/initramfs-crypt-hook_0.3.bb +5 -5
@@ -10,14 +10,14 @@ inherit dpkg-raw DEBIAN_DEPENDS = "initramfs-tools, cryptsetup, \ - awk, openssl, libtss2-esys-3.0.2-0 | libtss2-esys0, \ - libtss2-rc0 | libtss2-esys0, libtss2-mu0 | libtss2-esys0, \ - e2fsprogs, tpm2-tools, coreutils, uuid-runtime" + awk, openssl, e2fsprogs, tpm2-tools, coreutils, uuid-runtime" CLEVIS_DEPEND = ", clevis-luks, jose, bash, luksmeta, file, libpwquality-tools" -DEBIAN_DEPENDS:append:buster = "${CLEVIS_DEPEND}, libgcc-7-dev" -DEBIAN_DEPENDS:append:bullseye = "${CLEVIS_DEPEND}" +DEBIAN_DEPENDS:append:buster = "${CLEVIS_DEPEND}, libgcc-7-dev, libtss2-esys0" +DEBIAN_DEPENDS:append:bullseye = "${CLEVIS_DEPEND}, libtss2-esys-3.0.2-0, libtss2-rc0, libtss2-mu0" +DEBIAN_DEPENDS:append:bookworm = ", libtss2-esys-3.0.2-0, libtss2-rc0, libtss2-mu0" +DEBIAN_DEPENDS:append:trixie = ", systemd-cryptsetup, libtss2-esys-3.0.2-0t64, libtss2-rc0t64, libtss2-mu-4.0.1-0t64" DEBIAN_DEPENDS:append = "${@encryption_dependency(d)}" def encryption_dependency(d):
Signature · 1 line
2.43.0
PATCH 6/9 read-only-rootfs: Do not install tmp-fs with trixie anymore
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Debian trixie gained tmpfs-based tmp by default, thus no longer needs our manual activation via the tmp-fs recipe.
--- classes/read-only-rootfs.bbclass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
classes/read-only-rootfs.bbclass +4 -1
@@ -15,7 +15,10 @@ INITRD_IMAGE = "${INITRAMFS_RECIPE}-${DISTRO}-${MACHINE}.initrd.img" do_image_wic[depends] += "${INITRAMFS_RECIPE}:do_build" IMAGE_INSTALL += "home-fs" -IMAGE_INSTALL += "tmp-fs" + +IMAGE_INSTALL:append:buster = " tmp-fs" +IMAGE_INSTALL:append:bullseye = " tmp-fs" +IMAGE_INSTALL:append:bookworm = " tmp-fs" # For pre bookworm images, empty /var is not usable IMAGE_INSTALL:append = " immutable-rootfs"
Signature · 1 line
2.43.0
PATCH 7/9 efibootguard: Use prebuilt python-shtab from trixie onward
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
With trixie, we even get 1.7.1, so we no longer need to use the self-built version.
--- recipes-bsp/efibootguard/efibootguard_0.18-1+cip.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
recipes-bsp/efibootguard/efibootguard_0.18-1+cip.bb +3 -1
@@ -34,7 +34,9 @@ PATCHTOOL = "git" inherit dpkg -DEPENDS = "python-shtab" +DEPENDS:buster = "python-shtab" +DEPENDS:bullseye = "python-shtab" +DEPENDS:bookworm = "python-shtab" DEPENDS:trixie = "gnu-efi" DEPENDS:sid = "gnu-efi"
Signature · 1 line
2.43.0
PATCH 8/9 Add Debian trixie
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Comes with an isar revision bump to stop using a self-built crossbuild-essential-riscv64 package.
Based on similar changes by Cedric Hombourger and Quirin Gylstorff.
---
Kconfig | 4 ++++
conf/distro/cip-core-trixie.conf | 16 ++++++++++++++++
kas-cip.yml | 2 +-
kas/opt/trixie.yml | 15 +++++++++++++++
recipes-devtools/secure-boot-secrets/files/sid | 1 +
.../files/{sid => trixie}/PkKek-1-snakeoil.key | 0
.../files/{sid => trixie}/PkKek-1-snakeoil.pem | 0
.../swupdate-certificates/files/trixie | 1 +
start-qemu.sh | 2 ++
9 files changed, 40 insertions(+), 1 deletion(-)
create mode 100644 conf/distro/cip-core-trixie.conf
create mode 100644 kas/opt/trixie.yml
create mode 120000 recipes-devtools/secure-boot-secrets/files/sid
rename recipes-devtools/secure-boot-secrets/files/{sid => trixie}/PkKek-1-snakeoil.key (100%)
rename recipes-devtools/secure-boot-secrets/files/{sid => trixie}/PkKek-1-snakeoil.pem (100%)
create mode 120000 recipes-devtools/swupdate-certificates/files/trixieKconfig +4 -0
@@ -136,6 +136,9 @@ config DEBIAN_BOOKWORM bool "bookworm (12)" depends on !ARCH_RISCV64 +config DEBIAN_TRIXIE + bool "trixie (testing)" + config DEBIAN_SID bool "sid (unstable)" depends on ARCH_RISCV64
@@ -147,6 +150,7 @@ config KAS_INCLUDE_DEBIAN default "kas/opt/buster.yml" if DEBIAN_BUSTER default "kas/opt/bullseye.yml" if DEBIAN_BULLSEYE default "kas/opt/bookworm.yml" if DEBIAN_BOOKWORM + default "kas/opt/trixie.yml" if DEBIAN_TRIXIE default "kas/opt/sid.yml" if DEBIAN_SID comment "Image features"
conf/distro/cip-core-trixie.conf new file +16 -0
@@ -0,0 +1,16 @@ +# +# CIP Core, generic profile +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Cedric Hombourger <[email protected]> +# +# SPDX-License-Identifier: MIT +# + +require conf/distro/debian-trixie.conf +require cip-core-common.inc + +PREFERRED_VERSION_linux-cip ?= "6.1.%" +PREFERRED_VERSION_linux-cip-rt ?= "6.1.%"
kas-cip.yml +1 -1
@@ -22,7 +22,7 @@ repos: isar: url: https://github.com/ilbers/isar.git - commit: 8c9bdd3cb0ac93aa46552d4554bafaea5d1d7d13 + commit: 57f6b70d91711075fbeb07dd2bdf5c9e5b3c6ee6 layers: meta:
kas/opt/trixie.yml new file +15 -0
@@ -0,0 +1,15 @@ +# +# CIP Core, generic profile +# +# Copyright (c) Siemens AG, 2024 +# +# Authors: +# Cedric Hombourger <[email protected]> +# +# SPDX-License-Identifier: MIT +# + +header: + version: 14 + +distro: cip-core-trixie
recipes-devtools/secure-boot-secrets/files/sid new file +1 -0
@@ -0,0 +1 @@ +trixie
recipes-devtools/secure-boot-secrets/files/trixie/PkKek-1-snakeoil.key renamed from recipes-devtools/secure-boot-secrets/files/sid/PkKek-1-snakeoil.key +0 -0
recipes-devtools/secure-boot-secrets/files/trixie/PkKek-1-snakeoil.pem renamed from recipes-devtools/secure-boot-secrets/files/sid/PkKek-1-snakeoil.pem +0 -0
recipes-devtools/swupdate-certificates/files/trixie new file +1 -0
@@ -0,0 +1 @@ +../../secure-boot-secrets/files/trixie
start-qemu.sh +2 -0
@@ -46,6 +46,8 @@ if [ -z "${DISTRO_RELEASE}" ]; then DISTRO_RELEASE="buster" elif grep -s -q "DEBIAN_BOOKWORM: true" .config.yaml; then DISTRO_RELEASE="bookworm" + elif grep -s -q "DEBIAN_TRIXIE: true" .config.yaml; then + DISTRO_RELEASE="trixie" else DISTRO_RELEASE="bullseye" fi
Signature · 1 line
2.43.0
PATCH 9/9 Replace sid with trixie
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
The only reasons to have sid support in isar-cip-core so far was riscv64 and also testing of zchunk-based delta-updates. Both can now be addressed in a more stable way via upcoming Debian 13 / trixie.
--- .gitlab-ci.yml | 6 +++--- Kconfig | 5 ----- classes/delta-update.bbclass | 4 ++-- conf/distro/cip-core-sid.conf | 20 ------------------- doc/README.swupdate.md | 16 +++++++-------- kas/opt/sid.yml | 15 -------------- .../efibootguard/efibootguard_0.18-1+cip.bb | 1 - start-qemu.sh | 4 +--- 8 files changed, 14 insertions(+), 57 deletions(-) delete mode 100644 conf/distro/cip-core-sid.conf delete mode 100644 kas/opt/sid.yml
.gitlab-ci.yml +3 -3
@@ -62,7 +62,7 @@ default: - if [ "${release}" = "buster" ]; then base_yaml="${base_yaml}:kas/opt/buster.yml"; fi - if [ "${release}" = "bullseye" ]; then base_yaml="${base_yaml}:kas/opt/bullseye.yml"; fi - if [ "${release}" = "bookworm" ]; then base_yaml="${base_yaml}:kas/opt/bookworm.yml"; fi - - if [ "${release}" = "sid" ]; then base_yaml="${base_yaml}:kas/opt/sid.yml"; fi + - if [ "${release}" = "trixie" ]; then base_yaml="${base_yaml}:kas/opt/trixie.yml"; fi - if [ "${encrypt}" = "enable" ]; then base_yaml="${base_yaml}:kas/opt/encrypt-data.yml"; fi - if [ "${swupdate_version}" = "2022.12" ]; then base_yaml="${base_yaml}:kas/opt/swupdate-2022.12.yaml"; fi - echo "Building ${base_yaml}"
@@ -333,13 +333,13 @@ build:qemu-amd64-secure-boot-buster: deploy: disable encrypt: enable -# riscv64 (sid) +# trixie images build:qemu-riscv64: extends: - .build_base variables: target: qemu-riscv64 - release: sid + release: trixie use_rt: disable targz: disable deploy: disable
Kconfig +0 -5
@@ -139,10 +139,6 @@ config DEBIAN_BOOKWORM config DEBIAN_TRIXIE bool "trixie (testing)" -config DEBIAN_SID - bool "sid (unstable)" - depends on ARCH_RISCV64 - endchoice config KAS_INCLUDE_DEBIAN
@@ -151,7 +147,6 @@ config KAS_INCLUDE_DEBIAN default "kas/opt/bullseye.yml" if DEBIAN_BULLSEYE default "kas/opt/bookworm.yml" if DEBIAN_BOOKWORM default "kas/opt/trixie.yml" if DEBIAN_TRIXIE - default "kas/opt/sid.yml" if DEBIAN_SID comment "Image features"
classes/delta-update.bbclass +2 -2
@@ -27,8 +27,8 @@ python () { if d.getVar("DELTA_RDIFF_REF_IMAGE") == "": bb.fatal("You must set DELTA_RDIFF_REF_IMAGE and provide the required files as artifacts to this recipe") elif d.getVar("DELTA_UPDATE_TYPE") == "zchunk": - if d.getVar("BASE_DISTRO_CODENAME") != "sid": - bb.fatal("Zchunk based delta update is only supported from sid") + if d.getVar("BASE_DISTRO_CODENAME") != "trixie": + bb.fatal("Zchunk based delta update is only supported from trixie onward") else: disable_delta_update_tasks(d) }
conf/distro/cip-core-sid.conf deleted +0 -20
@@ -1,20 +0,0 @@ -# -# CIP Core, generic profile -# -# Copyright (c) Siemens AG, 2022-2024 -# -# Authors: -# Jan Kiszka <[email protected]> -# -# SPDX-License-Identifier: MIT -# - -require conf/distro/debian-sid.conf -require cip-core-common.inc - -# corresponds to 20240211T000000Z -ISAR_APT_SNAPSHOT_TIMESTAMP ?= "1707606000" -ISAR_USE_APT_SNAPSHOT ?= "1" - -PREFERRED_VERSION_linux-cip ?= "6.1.%" -PREFERRED_VERSION_linux-cip-rt ?= "6.1.%"
doc/README.swupdate.md +8 -8
@@ -435,27 +435,27 @@ host$ scp -P 22222 ./cip-core-image-cip-core-bookworm-qemu-amd64.swu root@localh ## Delta Software Update using zchunk handler -Currently zchunk based delta updates are supported only in Sid images. Make sure to build the first image with Sid as the distribution with the following command: +Currently zchunk based delta updates are supported only in trixie images. Make sure to build the first image with trixie as the distribution with the following command: ``` -host$ ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/sid.yml +host$ ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/trixie.yml ``` For Delta update with zchunk, set the variable `DELTA_ZCK_URL` with the URL of the zck file that is hosted in a http server and set the `DELTA_UPDATE_TYPE` to `zchunk` in `delta-update.yml` file. Build the second image with the modification as shown above with the following command: ``` -KAS_BUILD_DIR=build-v2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/sid.yml:kas/opt/delta-update.yml +KAS_BUILD_DIR=build-v2 ./kas-container build kas-cip.yml:kas/board/qemu-amd64.yml:kas/opt/ebg-swu.yml:kas/opt/trixie.yml:kas/opt/delta-update.yml ``` Now start the first image. Run the following commands: ``` -host$ DISTRO_RELEASE=sid SWUPDATE_BOOT=y ./start-qemu.sh amd64 +host$ DISTRO_RELEASE=trixie SWUPDATE_BOOT=y ./start-qemu.sh amd64 ``` -Copy `cip-core-image-cip-core-sid-qemu-amd64.swu` file from `build-v2/tmp/deploy/images/qemu-amd64/` folder into the running system: +Copy `cip-core-image-cip-core-trixie-qemu-amd64.swu` file from `build-v2/tmp/deploy/images/qemu-amd64/` folder into the running system: ``` host$ cd build-v2/tmp/deploy/images/qemu-amd64/ -host$ scp -P 22222 ./cip-core-image-cip-core-sid-qemu-amd64.swu root@localhost: +host$ scp -P 22222 ./cip-core-image-cip-core-trixie-qemu-amd64.swu root@localhost: ``` -The `cip-core-image-cip-core-sid-qemu-amd64.zck` file must be hosted in a http server. -Any http server (service) can be used to host the .zck file as long as the http server supports http range requests. Copy the `build-v2/tmp/deploy/images/qemu-amd64/cip-core-image-cip-core-sid-qemu-amd64.zck` to the server directory. For more information on the integration of zchunk handler in swupdate, refer the [documentation](https://sbabic.github.io/swupdate/delta-update.html#integration-in-swupdate-the-delta-handler) +The `cip-core-image-cip-core-trixie-qemu-amd64.zck` file must be hosted in a http server. +Any http server (service) can be used to host the .zck file as long as the http server supports http range requests. Copy the `build-v2/tmp/deploy/images/qemu-amd64/cip-core-image-cip-core-trixie-qemu-amd64.zck` to the server directory. For more information on the integration of zchunk handler in swupdate, refer the [documentation](https://sbabic.github.io/swupdate/delta-update.html#integration-in-swupdate-the-delta-handler) ## Delta Software Update Verification
kas/opt/sid.yml deleted +0 -15
@@ -1,15 +0,0 @@ -# -# CIP Core, generic profile -# -# Copyright (c) Siemens AG, 2022-2024 -# -# Authors: -# Jan Kiszka <[email protected]> -# -# SPDX-License-Identifier: MIT -# - -header: - version: 14 - -distro: cip-core-sid
recipes-bsp/efibootguard/efibootguard_0.18-1+cip.bb +0 -1
@@ -39,7 +39,6 @@ DEPENDS:bullseye = "python-shtab" DEPENDS:bookworm = "python-shtab" DEPENDS:trixie = "gnu-efi" -DEPENDS:sid = "gnu-efi" # needed for buster, bullseye could use compat >= 13 python() {
start-qemu.sh +1 -3
@@ -40,9 +40,7 @@ if [ -n "${QEMU_PATH}" ]; then fi if [ -z "${DISTRO_RELEASE}" ]; then - if grep -s -q "DEBIAN_SID: true" .config.yaml; then - DISTRO_RELEASE="sid" - elif grep -s -q "DEBIAN_BUSTER: true" .config.yaml; then + if grep -s -q "DEBIAN_BUSTER: true" .config.yaml; then DISTRO_RELEASE="buster" elif grep -s -q "DEBIAN_BOOKWORM: true" .config.yaml; then DISTRO_RELEASE="bookworm"
Signature · 1 line
2.43.0
[isar-cip-core][PATCH 10/9] swupdate: Perform checks for supported configurations
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
The upcoming trixie release is currently containing everything we need from SWUpdate, so we are retiring the self-building option from that release on - until someone comes up with a valid use case to restore it. This happens to avoid exposing a configuration that is technically selectable but became silently broken due to being effectively unused.
The Debian package enforces SWU signing. Therefore warn if a user configures this out while using the upstream package.
--- recipes-core/images/swupdate.inc | 11 +++++++++++ 1 file changed, 11 insertions(+)
recipes-core/images/swupdate.inc +11 -0
@@ -23,6 +23,17 @@ SWUPDATE_SELFBUILT:buster = "1" SWUPDATE_SELFBUILT:bullseye = "1" SWUPDATE_SELFBUILT:bookworm = "1" +python() { + base_distro = d.getVar('BASE_DISTRO_CODENAME') + if base_distro not in ['buster', 'bullseye', 'bookworm'] and \ + bb.utils.to_boolean(d.getVar('SWUPDATE_SELFBUILT')): + bb.fatal(f'Self-built SWUpdate not supported for {base_distro}') + + if not bb.utils.to_boolean(d.getVar('SWUPDATE_SELFBUILT')) and \ + not bb.utils.to_boolean(d.getVar('SWU_SIGNED')): + bb.fatal('SWUpdate from Debian requires signed SWUs') +} + IMAGE_INSTALL:append = "${@' swupdate' if bb.utils.to_boolean(d.getVar('SWUPDATE_SELFBUILT')) else ''}" IMAGE_PREINSTALL:append = "${@'' if bb.utils.to_boolean(d.getVar('SWUPDATE_SELFBUILT')) else ' swupdate'}"
Signature · 1 line
2.43.0