Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v8 0/8] systemd uki support
@ 2024-10-11 12:20 Mikko Rapeli
  2024-10-11 12:20 ` [PATCH v8 1/8] uki.bbclass: add class for building Unified Kernel Images (UKI) Mikko Rapeli
                   ` (8 more replies)
  0 siblings, 9 replies; 30+ messages in thread
From: Mikko Rapeli @ 2024-10-11 12:20 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mikko Rapeli

These changes enable building systemd uki images which combine
kernel, kernel command line, initrd and possibly signatures to
a single UEFI binary. This binary can be booted with UEFI firmware
and systemd-boot. No grub is needed and UEFI firmware and/or
systemd-boot provide possibilities for boot menus.
The uki binary can also be signed for UEFI secure boot
so the secure boot extends from firmware to kernel and initrd.
Binding secure boot to full userspace is then easier since for example
kernel command line and initrd contain the support needed to mount
encrypted dm-verity etc partitions, and/or create partitions on demand
with systemd-repart using device specific TPM devices for encryption.

Tested on qemuarm64-secureboot machine from meta-arm with changes to
support secure boot. Slightly different configuration tested on
multiple arm64 System Ready boards with UEFI firmware, real and firmware
based TPM devices. Tested with ovmf firmware on x86_64 with selftests but
without secure boot which seems to be harder to setup in ovmf.

Sadly I see two wic selftests, wic.Wic2.test_rawcopy_plugin_qemu and
wic.Wic2.test_expand_mbr_image, failing when executing all wic selftests
on a build machine with zfs filesystem. Will investigate this further.
The issue seems to be in mkfs.ext4 producing broken filesystem, and partially
in the tests which don't run the correct rootfs file (.ext4 vs .wic).
Will debug this further and it is IMO unrelated to these changes since
they reproduce on pure master branch without this series.

v8: fixed comments from Ross Burton: debug print from warning to debug,
    dropped duplicate DISTRO_FEATURE setting for systemd in tests,
    removed aarch64 comment from tests which are currently x86 only.
    Fixed the new aarch64 wic selftest to run on both genericarm64
    and qemuarm64 by adding bios, virtio disk driver etc settings
    for runqemu (already set in genericarm64 but missing from qemuarm64).

v7: add missing "ovmf" to runqemu argument to
    test_efi_plugin_plain_systemd_boot_qemu_x86 to fix boot hang

v6: fixes wic refactoring botch which broken non-uki systemd-boot usage on
    genericarm64 reported by Ross Burton <Ross.Burton@arm.com>, added
    selftest to cover this wks usage on x86 and aarch64

v5: drop patch "image_types_wic.bbclass: set systemd-boot and os-release
    dependency for all archs" since systemd-boot does not support all
    architectures

v4: handle missing runqemu variable from build config, add
python3-pefile to fast ptest list

v3: rebased, fixed and added more sefltests, removed wic plugin side uki
support

v2: https://lists.openembedded.org/g/openembedded-core/message/204090

Michelle Lin (1):
  uki.bbclass: add class for building Unified Kernel Images (UKI)

Mikko Rapeli (7):
  wic bootimg-efi.py: keep timestamps and add debug prints
  wic bootimg-efi.py: change UKI support from wic plugin to uki.bbclass
  oeqa selftest uki.py: add tests for uki.bbclass
  oeqa selftest efibootpartition.py: add TEST_RUNQEMUPARAMS to runqemu
  oeqa selftest efibootpartition.py: remove systemd-boot from grub-efi
    test
  oeqa selftest wic.py: add TEST_RUNQEMUPARAMS to runqemu
  oeqa selftest wic.py: support UKIs via uki.bbclass

 meta-selftest/wic/test_efi_plugin.wks         |   5 +-
 .../test_efi_plugin_plain_systemd-boot.wks    |   5 +
 meta/classes-recipe/image_types_wic.bbclass   |   3 +-
 meta/classes-recipe/uki.bbclass               | 195 ++++++++++++++++++
 .../oeqa/selftest/cases/efibootpartition.py   |  11 +-
 meta/lib/oeqa/selftest/cases/uki.py           | 133 ++++++++++++
 meta/lib/oeqa/selftest/cases/wic.py           | 131 ++++++++++--
 .../wic/canned-wks/efi-uki-bootdisk.wks.in    |   3 +
 scripts/lib/wic/plugins/source/bootimg-efi.py | 183 +++++-----------
 9 files changed, 511 insertions(+), 158 deletions(-)
 create mode 100644 meta-selftest/wic/test_efi_plugin_plain_systemd-boot.wks
 create mode 100644 meta/classes-recipe/uki.bbclass
 create mode 100644 meta/lib/oeqa/selftest/cases/uki.py
 create mode 100644 scripts/lib/wic/canned-wks/efi-uki-bootdisk.wks.in

-- 
2.34.1



^ permalink raw reply	[flat|nested] 30+ messages in thread
* [PATCH] ovmf-native: remove .pyc files from install
@ 2024-10-14 10:28 Mikko Rapeli
  2024-10-14 11:05 ` [OE-core] " Alexander Kanavin
  0 siblings, 1 reply; 30+ messages in thread
From: Mikko Rapeli @ 2024-10-14 10:28 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mikko Rapeli

They break builds which share sstate files on different
machines and paths:

ERROR: ovmf-edk2-stable202408-r0 do_prepare_recipe_sysroot: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:extend_recipe_sysroot(d)
     0003:
File: '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/classes-global/staging.bbclass', lineno: 624, function: extend_recipe_sysroot
     0620:
     0621:    # Handle deferred binfiles
     0622:    for l in binfiles:
     0623:        (targetdir, dest) = binfiles[l]
 *** 0624:        staging_copyfile(l, targetdir, dest, postinsts, seendirs)
     0625:
     0626:    bb.note("Installed into sysroot: %s" % str(msg_adding))
     0627:    bb.note("Skipping as already exists in sysroot: %s" % str(msg_exists))
     0628:
File: '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/meta/classes-global/staging.bbclass', lineno: 165, function: staging_copyfile
     0161:        os.symlink(linkto, dest)
     0162:        #bb.warn(c)
     0163:    else:
     0164:        try:
 *** 0165:            os.link(c, dest)
     0166:        except OSError as err:
     0167:            if err.errno == errno.EXDEV:
     0168:                bb.utils.copyfile(c, dest)
     0169:            else:
Exception: FileExistsError: [Errno 17] File exists: '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-667282/tmp/sysroots-components/x86_64/ovmf-native/usr/bin/edk2_basetools/BaseTools/Source/Python/AutoGen/__pycache__/WorkspaceAutoGen.cpython-312.pyc' -> '/srv/pokybuild/yocto-worker/oe-selftest-fedora/build/build-st-667282/tmp/work/core2-64-poky-linux/ovmf/edk2-stable202408/recipe-sysroot-native/usr/bin/edk2_basetools/BaseTools/Source/Python/AutoGen/__pycache__/WorkspaceAutoGen.cpython-312.pyc'

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta/recipes-core/ovmf/ovmf_git.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb
index 202182397d..e761736453 100644
--- a/meta/recipes-core/ovmf/ovmf_git.bb
+++ b/meta/recipes-core/ovmf/ovmf_git.bb
@@ -223,6 +223,7 @@ do_compile:class-target() {
 
 do_install:class-native() {
     install -d ${D}/${bindir}/edk2_basetools
+    find ${S}/BaseTools -name \*.pyc -exec rm -rf \{\} \;
     cp -r ${S}/BaseTools ${D}/${bindir}/${EDK_TOOLS_DIR}
 }
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2024-10-17  8:52 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 12:20 [PATCH v8 0/8] systemd uki support Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 1/8] uki.bbclass: add class for building Unified Kernel Images (UKI) Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 2/8] wic bootimg-efi.py: keep timestamps and add debug prints Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 3/8] wic bootimg-efi.py: change UKI support from wic plugin to uki.bbclass Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 4/8] oeqa selftest uki.py: add tests for uki.bbclass Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 5/8] oeqa selftest efibootpartition.py: add TEST_RUNQEMUPARAMS to runqemu Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 6/8] oeqa selftest efibootpartition.py: remove systemd-boot from grub-efi test Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 7/8] oeqa selftest wic.py: add TEST_RUNQEMUPARAMS to runqemu Mikko Rapeli
2024-10-11 12:20 ` [PATCH v8 8/8] oeqa selftest wic.py: support UKIs via uki.bbclass Mikko Rapeli
2024-10-13  7:43 ` [OE-core] [PATCH v8 0/8] systemd uki support Richard Purdie
2024-10-14 10:30   ` Mikko Rapeli
2024-10-14 12:13   ` Mikko Rapeli
     [not found]   ` <17FE4B15CF045259.4702@lists.openembedded.org>
2024-10-15  6:44     ` Mikko Rapeli
2024-10-15  9:45       ` Richard Purdie
2024-10-15 10:43       ` Richard Purdie
2024-10-15 11:23         ` Mikko Rapeli
2024-10-15 11:32           ` Alexander Kanavin
     [not found]           ` <17FE9D06966A2DE5.32376@lists.openembedded.org>
2024-10-15 11:36             ` Alexander Kanavin
2024-10-15 14:13           ` Richard Purdie
2024-10-15 14:23             ` Mikko Rapeli
     [not found]         ` <17FE9C82DB831F81.27606@lists.openembedded.org>
2024-10-17  8:52           ` Mikko Rapeli
  -- strict thread matches above, loose matches on Subject: below --
2024-10-14 10:28 [PATCH] ovmf-native: remove .pyc files from install Mikko Rapeli
2024-10-14 11:05 ` [OE-core] " Alexander Kanavin
2024-10-14 11:21   ` Mikko Rapeli
2024-10-14 11:28     ` Alexander Kanavin
2024-10-14 11:39       ` Mikko Rapeli
2024-10-14 11:42         ` Alexander Kanavin
2024-10-14 12:01   ` Richard Purdie
2024-10-14 12:34     ` Ross Burton
2024-10-14 12:52       ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox