* [PATCH 0/6] systemd based initrd and modular kernel support
@ 2025-03-14 11:19 Mikko Rapeli
2025-03-14 11:19 ` [PATCH 2/6] systemd: enable efi support if in MACHINE_FEATURES too Mikko Rapeli
` (7 more replies)
0 siblings, 8 replies; 13+ messages in thread
From: Mikko Rapeli @ 2025-03-14 11:19 UTC (permalink / raw)
To: openembedded-core; +Cc: Mikko Rapeli
systemd based initrd supports more security, encryption etc features
than custom shell script ones but oe-core lacks support for it.
Convert core-image-initramfs-boot to create systemd based initrd
if "systemd-initramfs" is set in DISTRO_FEATURES. Includes a test
for this initrd to mount rootfs via Unified Kernel Image uki.py.
Sadly the boot time is really slow, e.g. over 30 seconds with
systemd based initrd. One of the major reasons is the large
amount of kernel modules built into the linux-yocto kernel and
processing of their udev events in userspace. Thus add
kernel-initrd-modules meta package to easily install
subset of all kernel modules to initrd. The subset
supports "mount rootfs from any block device" but
doesn't include graphics, UBS etc support. Without this
generated meta package, initrd recipe needs to manually define
which exact kernel modules to include which breaks if
those modules are built into the kernel. Thus the initrd
becomes machine and kernel config specific and hard to maintain.
With this meta package a generic initrd can be created.
Separate changes to linux-yocto compile a lot more drivers
as modules but they depend on these initrd changes.
Mikko Rapeli (6):
systemd: use serial-getty-generator on genericarm64
systemd: enable efi support if in MACHINE_FEATURES too
uki.bbclass: drop serial console from kernel command line
kernel.bbclass: add kernel-initrd-modules meta package
core-image-initramfs-boot: add option to build systemd based initrd
oeqa selftest uki.py: add aarch64/arm test with systemd based initrd
.../recipes-core/systemd/systemd_%.bbappend | 3 +
.../kernel-module-split.bbclass | 46 +++++++++++
meta/classes-recipe/kernel.bbclass | 5 +-
meta/classes-recipe/module.bbclass | 37 +++++++++
meta/classes-recipe/uki.bbclass | 2 +-
meta/lib/oeqa/selftest/cases/uki.py | 76 +++++++++++++++++++
.../images/core-image-initramfs-boot.bb | 28 ++++++-
meta/recipes-core/systemd/systemd_257.3.bb | 1 +
8 files changed, 193 insertions(+), 5 deletions(-)
create mode 100644 meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
--
2.43.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/6] systemd: enable efi support if in MACHINE_FEATURES too
2025-03-14 11:19 [PATCH 0/6] systemd based initrd and modular kernel support Mikko Rapeli
@ 2025-03-14 11:19 ` Mikko Rapeli
2025-03-14 11:19 ` [PATCH 3/6] uki.bbclass: drop serial console from kernel command line Mikko Rapeli
` (6 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Mikko Rapeli @ 2025-03-14 11:19 UTC (permalink / raw)
To: openembedded-core; +Cc: Mikko Rapeli
For example genericarm64 enables "efi" in MACHINE_FEATURES
and in u-boot. Boot without "efi" in systemd works with
EFI protocols but for example efivars is not mounted at
all so various checks fail in userspace. Fix these by
enabling "efi" support if it's in MACHINE_FEATURES.
Fixes efivars mount to /sys/firmware/efi/efivars etc.
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
meta/recipes-core/systemd/systemd_257.3.bb | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/recipes-core/systemd/systemd_257.3.bb b/meta/recipes-core/systemd/systemd_257.3.bb
index 64fb8fe69a..9bc4532021 100644
--- a/meta/recipes-core/systemd/systemd_257.3.bb
+++ b/meta/recipes-core/systemd/systemd_257.3.bb
@@ -69,6 +69,7 @@ PAM_PLUGINS = " \
PACKAGECONFIG ??= " \
${@bb.utils.filter('DISTRO_FEATURES', 'acl audit apparmor efi ldconfig pam pni-names selinux smack polkit seccomp', d)} \
+ ${@bb.utils.filter('MACHINE_FEATURES', 'efi', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'minidebuginfo', 'coredump elfutils', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/6] uki.bbclass: drop serial console from kernel command line
2025-03-14 11:19 [PATCH 0/6] systemd based initrd and modular kernel support Mikko Rapeli
2025-03-14 11:19 ` [PATCH 2/6] systemd: enable efi support if in MACHINE_FEATURES too Mikko Rapeli
@ 2025-03-14 11:19 ` Mikko Rapeli
2025-03-14 11:19 ` [PATCH 4/6] kernel.bbclass: add kernel-initrd-modules meta package Mikko Rapeli
` (5 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Mikko Rapeli @ 2025-03-14 11:19 UTC (permalink / raw)
To: openembedded-core; +Cc: Mikko Rapeli
The kernel will continue using console from firmware which is
much better on HW when we may not know at build time which
console HW and drivers are available, e.g. like on
genericarm64 machine.
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
meta/classes-recipe/uki.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes-recipe/uki.bbclass b/meta/classes-recipe/uki.bbclass
index d9a7fb0e6f..fedff222c6 100644
--- a/meta/classes-recipe/uki.bbclass
+++ b/meta/classes-recipe/uki.bbclass
@@ -81,7 +81,7 @@ UKIFY_CMD ?= "ukify build"
UKI_CONFIG_FILE ?= "${UNPACKDIR}/uki.conf"
UKI_FILENAME ?= "uki.efi"
UKI_KERNEL_FILENAME ?= "${KERNEL_IMAGETYPE}"
-UKI_CMDLINE ?= "rootwait root=LABEL=root console=${KERNEL_CONSOLE}"
+UKI_CMDLINE ?= "rootwait root=LABEL=root"
# secure boot keys and cert, needs sbsign-tools-native (meta-secure-core)
#UKI_SB_KEY ?= ""
#UKI_SB_CERT ?= ""
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 4/6] kernel.bbclass: add kernel-initrd-modules meta package
2025-03-14 11:19 [PATCH 0/6] systemd based initrd and modular kernel support Mikko Rapeli
2025-03-14 11:19 ` [PATCH 2/6] systemd: enable efi support if in MACHINE_FEATURES too Mikko Rapeli
2025-03-14 11:19 ` [PATCH 3/6] uki.bbclass: drop serial console from kernel command line Mikko Rapeli
@ 2025-03-14 11:19 ` Mikko Rapeli
2025-03-14 11:19 ` [PATCH 5/6] core-image-initramfs-boot: add option to build systemd based initrd Mikko Rapeli
` (4 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Mikko Rapeli @ 2025-03-14 11:19 UTC (permalink / raw)
To: openembedded-core; +Cc: Mikko Rapeli
At the moment linux-yocto kernels for various architectures
are not very modular and a lot of drivers are built into the kernel
even when they are not needed at runtime. These make the main kernel
binary big and slow to boot. This also impacts udev in userspace
which takes a long time processing events from all these built in drivers,
for example when udev runs in initrd.
Then constructing the initrd is very device and kernel configuration specific.
initrd image needs explicitly define which binary packages to install
to avoid pulling in complex dependencies. A full set of kernel modules
via kernel-modules meta package is too big for initrd and most of the
drivers are not needed for use cases like "just load modules to mount
main rootfs". Then the initrd configuration breaks if kernel driver
is built into the kernel since the binary package doesn't exist.
Introduce kernel-initrd-modules meta package to solve these problems.
The meta package adds dependencies to real kernel modules based on
the kernel module file paths so that it will include several
kernel subsystems and their drivers which are often needed to find
main rootfs from some block device. This works when drivers are built
as modules but does not break if drivers are built into the kernel.
The resulting initrd is also smaller since only a subset of drivers
are needed for "mount the rootfs" usecase. Tested on genericarm64
kernel and qemu and AMD KV260 HW.
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
.../kernel-module-split.bbclass | 46 +++++++++++++++++++
meta/classes-recipe/kernel.bbclass | 5 +-
meta/classes-recipe/module.bbclass | 37 +++++++++++++++
3 files changed, 87 insertions(+), 1 deletion(-)
diff --git a/meta/classes-recipe/kernel-module-split.bbclass b/meta/classes-recipe/kernel-module-split.bbclass
index 9487365eb7..06e8fbed6e 100644
--- a/meta/classes-recipe/kernel-module-split.bbclass
+++ b/meta/classes-recipe/kernel-module-split.bbclass
@@ -42,6 +42,40 @@ KERNEL_MODULE_PACKAGE_PREFIX ?= ""
KERNEL_MODULE_PACKAGE_SUFFIX ?= "-${KERNEL_VERSION}"
KERNEL_MODULE_PROVIDE_VIRTUAL ?= "1"
+# subset of kernel modules needed in initrd, to e.g. mount rootfs from block device
+KERNEL_INITRD_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" }-initrd-modules"
+
+# match regex to path or file name. E.g. include all drivers with files in path /drivers/ata/
+KERNEL_INITRD_MODULES_REGEX ?= "(.*)(\
+/drivers/acpi/|\
+/drivers/ata/|\
+/drivers/block/|\
+/drivers/cdrom/|\
+/drivers/char/hw_random/|\
+/drivers/char/tpm/|\
+/drivers/char/|\
+/drivers/crypto/|\
+/drivers/dax/|\
+/drivers/firmware/arm_scmi/|\
+/drivers/gpu/drm/|\
+/drivers/md/|\
+/drivers/mmc/|\
+/drivers/mtd/|\
+/drivers/nvdimm/|\
+/drivers/nvme/|\
+/drivers/pci/|\
+/drivers/scsi/|\
+/drivers/tee/|\
+/drivers/tty/serial/|\
+/drivers/virtio/|\
+/drivers/watchdog/|\
+/kernel/arch/|\
+/kernel/block/|\
+/kernel/crypto/|\
+/kernel/fs/|\
+/kernel/lib/\
+)(.*)"
+
python split_kernel_module_packages () {
import re
@@ -183,6 +217,18 @@ python split_kernel_module_packages () {
modules = do_split_packages(d, root='${nonarch_base_libdir}/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='%s-%s' % (kernel_package_name, kernel_version))
if modules:
d.appendVar('RDEPENDS:' + metapkg, ' '+' '.join(modules))
+
+ initrd_metapkg = d.getVar('KERNEL_INITRD_MODULES_META_PACKAGE')
+ initrd_module_regex = re.compile(d.getVar('KERNEL_INITRD_MODULES_REGEX'))
+ initrd_modules = []
+ for module in modules:
+ files = d.getVar('FILES:' + module)
+ m = re.match(initrd_module_regex, files)
+ if m:
+ initrd_modules.append(module)
+
+ if initrd_modules:
+ d.appendVar('RDEPENDS:' + initrd_metapkg, ' '+' '.join(initrd_modules))
}
do_package[vardeps] += '${@" ".join(map(lambda s: "module_conf_" + s, (d.getVar("KERNEL_MODULE_PROBECONF") or "").split()))}'
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 64a685a964..8fda61574d 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -695,13 +695,14 @@ EXPORT_FUNCTIONS do_compile do_transform_kernel do_transform_bundled_initramfs d
# kernel-base becomes kernel-${KERNEL_VERSION}
# kernel-image becomes kernel-image-${KERNEL_VERSION}
-PACKAGES = "${KERNEL_PACKAGE_NAME} ${KERNEL_PACKAGE_NAME}-base ${KERNEL_PACKAGE_NAME}-vmlinux ${KERNEL_PACKAGE_NAME}-image ${KERNEL_PACKAGE_NAME}-dev ${KERNEL_PACKAGE_NAME}-modules ${KERNEL_PACKAGE_NAME}-dbg"
+PACKAGES = "${KERNEL_PACKAGE_NAME} ${KERNEL_PACKAGE_NAME}-base ${KERNEL_PACKAGE_NAME}-vmlinux ${KERNEL_PACKAGE_NAME}-image ${KERNEL_PACKAGE_NAME}-dev ${KERNEL_PACKAGE_NAME}-modules ${KERNEL_PACKAGE_NAME}-initrd-modules ${KERNEL_PACKAGE_NAME}-dbg"
FILES:${PN} = ""
FILES:${KERNEL_PACKAGE_NAME}-base = "${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.order ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/modules.builtin.modinfo"
FILES:${KERNEL_PACKAGE_NAME}-image = ""
FILES:${KERNEL_PACKAGE_NAME}-dev = "/${KERNEL_IMAGEDEST}/System.map* /${KERNEL_IMAGEDEST}/Module.symvers* /${KERNEL_IMAGEDEST}/config* ${KERNEL_SRC_PATH} ${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
FILES:${KERNEL_PACKAGE_NAME}-vmlinux = "/${KERNEL_IMAGEDEST}/vmlinux-${KERNEL_VERSION_NAME}"
FILES:${KERNEL_PACKAGE_NAME}-modules = ""
+FILES:${KERNEL_PACKAGE_NAME}-initrd-modules = ""
FILES:${KERNEL_PACKAGE_NAME}-dbg = "/usr/lib/debug /usr/src/debug"
RDEPENDS:${KERNEL_PACKAGE_NAME} = "${KERNEL_PACKAGE_NAME}-base (= ${EXTENDPKGV})"
# Allow machines to override this dependency if kernel image files are
@@ -716,7 +717,9 @@ ALLOW_EMPTY:${KERNEL_PACKAGE_NAME} = "1"
ALLOW_EMPTY:${KERNEL_PACKAGE_NAME}-base = "1"
ALLOW_EMPTY:${KERNEL_PACKAGE_NAME}-image = "1"
ALLOW_EMPTY:${KERNEL_PACKAGE_NAME}-modules = "1"
+ALLOW_EMPTY:${KERNEL_PACKAGE_NAME}-initrd-modules = "1"
DESCRIPTION:${KERNEL_PACKAGE_NAME}-modules = "Kernel modules meta package"
+DESCRIPTION:${KERNEL_PACKAGE_NAME}-initrd-modules = "Kernel initrd modules meta package"
pkg_postinst:${KERNEL_PACKAGE_NAME}-base () {
if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then
diff --git a/meta/classes-recipe/module.bbclass b/meta/classes-recipe/module.bbclass
index f2f0b25a2d..51f864f1f9 100644
--- a/meta/classes-recipe/module.bbclass
+++ b/meta/classes-recipe/module.bbclass
@@ -86,3 +86,40 @@ EXPORT_FUNCTIONS do_compile do_install
KERNEL_MODULES_META_PACKAGE = "${PN}"
FILES:${PN} = ""
ALLOW_EMPTY:${PN} = "1"
+
+# subset of kernel modules needed in initrd, to e.g. mount rootfs from block device
+KERNEL_INITRD_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" }-initrd-modules"
+
+# match regex to path or file name. E.g. include all drivers with files in path /drivers/ata/
+KERNEL_INITRD_MODULES_REGEX ?= "(.*)(\
+/drivers/acpi/|\
+/drivers/ata/|\
+/drivers/block/|\
+/drivers/cdrom/|\
+/drivers/char/hw_random/|\
+/drivers/char/tpm/|\
+/drivers/char/|\
+/drivers/crypto/|\
+/drivers/dax/|\
+/drivers/firmware/arm_scmi/|\
+/drivers/gpu/drm/|\
+/drivers/md/|\
+/drivers/mmc/|\
+/drivers/mtd/|\
+/drivers/nvdimm/|\
+/drivers/nvme/|\
+/drivers/pci/|\
+/drivers/scsi/|\
+/drivers/tee/|\
+/drivers/tty/serial/|\
+/drivers/virtio/|\
+/drivers/watchdog/|\
+/kernel/arch/|\
+/kernel/block/|\
+/kernel/crypto/|\
+/kernel/fs/|\
+/kernel/lib/\
+)(.*)"
+
+FILES:${PN}-initrd = ""
+ALLOW_EMPTY:${PN}-initrd = "1"
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 5/6] core-image-initramfs-boot: add option to build systemd based initrd
2025-03-14 11:19 [PATCH 0/6] systemd based initrd and modular kernel support Mikko Rapeli
` (2 preceding siblings ...)
2025-03-14 11:19 ` [PATCH 4/6] kernel.bbclass: add kernel-initrd-modules meta package Mikko Rapeli
@ 2025-03-14 11:19 ` Mikko Rapeli
2025-03-14 11:19 ` [PATCH 6/6] oeqa selftest uki.py: add aarch64/arm test with " Mikko Rapeli
` (3 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Mikko Rapeli @ 2025-03-14 11:19 UTC (permalink / raw)
To: openembedded-core; +Cc: Mikko Rapeli
If "systemd-initramfs" is in DISTRO_FEATURES then convert
core-image-initramfs-boot from shell scripts to systemd.
The resulting initramfs is much bigger than shell script one but
supports much more features like disk encryption and TPM devices.
Also includes udev which can load any drivers needed to mount
rootfs. Uses kernel-initrd-modules meta package to install a
subset of kernel modules needed for mounting rootfs on multiple
platforms.
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
.../images/core-image-initramfs-boot.bb | 28 +++++++++++++++++--
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/meta/recipes-core/images/core-image-initramfs-boot.bb b/meta/recipes-core/images/core-image-initramfs-boot.bb
index 7258944751..215d32fd3d 100644
--- a/meta/recipes-core/images/core-image-initramfs-boot.bb
+++ b/meta/recipes-core/images/core-image-initramfs-boot.bb
@@ -4,7 +4,31 @@ LICENSE = "MIT"
INITRAMFS_SCRIPTS ?= "initramfs-framework-base initramfs-module-udev"
-PACKAGE_INSTALL = "${INITRAMFS_SCRIPTS} ${VIRTUAL-RUNTIME_base-utils} base-passwd"
+inherit image
+
+PACKAGE_INSTALL = " \
+ ${VIRTUAL-RUNTIME_base-utils} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd-initramfs', ' \
+ base-files \
+ coreutils \
+ e2fsprogs-mke2fs \
+ kernel-initrd-modules \
+ os-release-initrd \
+ util-linux-blkid \
+ util-linux-mount \
+ util-linux-umount \
+ ${VIRTUAL-RUNTIME_init_manager} \
+ ${VIRTUAL-RUNTIME_dev_manager} \
+ ', '${INITRAMFS_SCRIPTS}', d)} \
+ base-passwd \
+"
+
+# reduce size
+NO_RECOMMENDATIONS = "1"
+
+# don't install automatically, pick manually instead
+MACHINE_EXTRA_RDEPENDS = ""
+MACHINE_EXTRA_RRECOMMENDS = ""
# Ensure the initramfs only contains the bare minimum
IMAGE_FEATURES = ""
@@ -18,5 +42,3 @@ IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
IMAGE_NAME_SUFFIX ?= ""
IMAGE_ROOTFS_SIZE = "8192"
IMAGE_ROOTFS_EXTRA_SPACE = "0"
-
-inherit image
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 6/6] oeqa selftest uki.py: add aarch64/arm test with systemd based initrd
2025-03-14 11:19 [PATCH 0/6] systemd based initrd and modular kernel support Mikko Rapeli
` (3 preceding siblings ...)
2025-03-14 11:19 ` [PATCH 5/6] core-image-initramfs-boot: add option to build systemd based initrd Mikko Rapeli
@ 2025-03-14 11:19 ` Mikko Rapeli
2025-03-14 11:21 ` [PATCH v2 1/6] systemd: use serial-getty-generator on genericarm64 Mikko Rapeli
` (2 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Mikko Rapeli @ 2025-03-14 11:19 UTC (permalink / raw)
To: openembedded-core; +Cc: Mikko Rapeli
Use core-image-initramfs-boot with systemd to boot via UKI on
arm/aarch64. Tested on qemuarm, qemuarm64 and genericarm64
on aarch64 build host. The machines have different image
and qemuboot configs so they need to be configured in test.
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
meta/lib/oeqa/selftest/cases/uki.py | 76 +++++++++++++++++++++++++++++
1 file changed, 76 insertions(+)
diff --git a/meta/lib/oeqa/selftest/cases/uki.py b/meta/lib/oeqa/selftest/cases/uki.py
index 9a1aa4e269..4830fb3403 100644
--- a/meta/lib/oeqa/selftest/cases/uki.py
+++ b/meta/lib/oeqa/selftest/cases/uki.py
@@ -139,3 +139,79 @@ IMAGE_CLASSES:remove = 'testimage'
cmd = "echo $( cat /sys/firmware/efi/efivars/LoaderEntrySelected-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep '%s'" % (uki_filename)
status, output = qemu.run_serial(cmd)
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+
+ @skipIfNotArch(['aarch64', 'arm'])
+ @OETestTag("runqemu")
+ def test_uki_boot_systemd_initrd(self):
+ """Build and boot into UEFI firmware (u-boot), systemd-boot, initrd with systemd, rootfs with systemd"""
+ image = "core-image-base"
+ runqemu_params = get_bb_var('TEST_RUNQEMUPARAMS', image) or ""
+ cmd = "runqemu %s nographic serial wic" % (runqemu_params)
+
+ self.write_config("""
+# efi firmware must load systemd-boot, not grub
+EFI_PROVIDER = "systemd-boot"
+
+# image format must be wic, needs esp partition for firmware etc
+IMAGE_FSTYPES:pn-%s:append = " wic"
+WKS_FILE = "efi-uki-bootdisk.wks.in"
+
+# efi, uki and systemd features must be enabled
+INIT_MANAGER = "systemd"
+DISTRO_FEATURES += "systemd-initramfs"
+MACHINE_FEATURES:append = " efi"
+IMAGE_CLASSES:append:pn-core-image-base = " uki"
+
+# uki embeds also an initrd
+INITRAMFS_IMAGE = "core-image-initramfs-boot"
+
+# runqemu must not load kernel separately, it's in the uki
+QB_KERNEL_ROOT = ""
+QB_DEFAULT_KERNEL = "none"
+
+# u-boot, not all qemu* machines set this correctly
+QB_DEFAULT_BIOS = "u-boot.bin"
+# machines may not set this correctly
+QB_DEFAULT_FSTYPE = "wic"
+
+# u-boot needs to find ESP partition so use virtio block device instead of default scsi
+QB_ROOTFS_OPT = "-drive id=root,file=@ROOTFS@,if=none,format=raw -device virtio-blk-pci,drive=root"
+QB_DRIVE_TYPE = "/dev/vd"
+
+# boot command line provided via uki, not via bootloader
+UKI_CMDLINE = "rootwait root=LABEL=root"
+# enable if debug output is needed
+# UKI_CMDLINE += "systemd.log_level=debug systemd.log_target=console systemd.journald.forward_to_console=1"
+
+# disable kvm, breaks boot
+QEMU_USE_KVM = ""
+
+IMAGE_CLASSES:remove = 'testimage'
+""" % (image))
+
+ uki_filename = get_bb_var('UKI_FILENAME', image)
+
+ bitbake(image + " u-boot")
+ with runqemu(image, ssh=False, launch_cmd=cmd) as qemu:
+ self.assertTrue(qemu.runner.logged, "Failed: %s" % cmd)
+
+ # Verify from efivars that firmware was:
+ # aarch64
+ cmd = "echo $( cat /sys/firmware/efi/efivars/LoaderFirmwareInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep 'Das U-Boot'"
+ status, output = qemu.run_serial(cmd)
+ self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+
+ # Check that systemd-boot was the loader
+ cmd = "echo $( cat /sys/firmware/efi/efivars/LoaderInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep systemd-boot"
+ status, output = qemu.run_serial(cmd)
+ self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+
+ # Check that systemd-stub was used
+ cmd = "echo $( cat /sys/firmware/efi/efivars/StubInfo-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep systemd-stub"
+ status, output = qemu.run_serial(cmd)
+ self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
+
+ # Check that the compiled uki file was booted into
+ cmd = "echo $( cat /sys/firmware/efi/efivars/LoaderEntrySelected-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f ) | grep '%s'" % (uki_filename)
+ status, output = qemu.run_serial(cmd)
+ self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 1/6] systemd: use serial-getty-generator on genericarm64
2025-03-14 11:19 [PATCH 0/6] systemd based initrd and modular kernel support Mikko Rapeli
` (4 preceding siblings ...)
2025-03-14 11:19 ` [PATCH 6/6] oeqa selftest uki.py: add aarch64/arm test with " Mikko Rapeli
@ 2025-03-14 11:21 ` Mikko Rapeli
2025-03-14 11:33 ` Patchtest results for " patchtest
2025-03-17 10:37 ` [OE-core] [PATCH 0/6] systemd based initrd and modular kernel support Alexander Kanavin
2025-03-17 11:50 ` Richard Purdie
7 siblings, 1 reply; 13+ messages in thread
From: Mikko Rapeli @ 2025-03-14 11:21 UTC (permalink / raw)
To: poky; +Cc: openembedded-core, Mikko Rapeli
systemd-serialgetty recipe sets serial consoles based
on SERIAL_CONSOLES build time variable. These fail to
be detected on multiple devices including qemu and the
resulting failures delay boot to systemd "running" state
by one minute on an example aarch64 build machine and qemu.
Serial console login works with both since udev will
trigger agetty on correct devices. Using systemd side
serial-getty-generator disables systemd-serialgetty.
qemu-system-aarch64 core-image-base boot time with
systemd-serialgetty before this patch:
$ systemd-analyze
Startup finished in 8.314s (firmware) + 9.805s (loader) + 14.338s (kernel) + 1min 34.392s (userspace) = 2min 6.851s
multi-user.target reached after 1min 34.387s in userspace.
with this patch:
Startup finished in 8.312s (firmware) + 9.804s (loader) + 14.295s (kernel) + 29.808s (userspace) = 1min 2.220s
multi-user.target reached after 29.802s in userspace.
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
v1: https://lists.yoctoproject.org/g/poky/message/13522
diff --git a/meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend b/meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
new file mode 100644
index 0000000000..f23852a351
--- /dev/null
+++ b/meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
@@ -0,0 +1,3 @@
+# auto detection instead of build time configured via SERIAL_CONSOLES
+# to support multiple devices
+PACKAGECONFIG:append:genericarm64 = " serial-getty-generator"
--
2.43.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Patchtest results for [PATCH v2 1/6] systemd: use serial-getty-generator on genericarm64
2025-03-14 11:21 ` [PATCH v2 1/6] systemd: use serial-getty-generator on genericarm64 Mikko Rapeli
@ 2025-03-14 11:33 ` patchtest
0 siblings, 0 replies; 13+ messages in thread
From: patchtest @ 2025-03-14 11:33 UTC (permalink / raw)
To: Mikko Rapeli; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 3229 bytes --]
Thank you for your submission. Patchtest identified one
or more issues with the patch. Please see the log below for
more information:
---
Testing patch /home/patchtest/share/mboxes/v2-1-6-systemd-use-serial-getty-generator-on-genericarm64.patch
FAIL: test target mailing list: Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists (test_mbox.TestMbox.test_target_mailing_list)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: pretest src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.pretest_src_uri_left_files)
SKIP: test CVE check ignore: No modified recipes or older target branch, skipping test (test_metadata.TestMetadata.test_cve_check_ignore)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum modified not mentioned: No modified recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test src uri left files: No modified recipes, skipping pretest (test_metadata.TestMetadata.test_src_uri_left_files)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this
email with an explanation of why the patch should be accepted. If you
believe these results are due to an error in patchtest, please submit a
bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category
under 'Yocto Project Subprojects'). For more information on specific
failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank
you!
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [OE-core] [PATCH 0/6] systemd based initrd and modular kernel support
2025-03-14 11:19 [PATCH 0/6] systemd based initrd and modular kernel support Mikko Rapeli
` (5 preceding siblings ...)
2025-03-14 11:21 ` [PATCH v2 1/6] systemd: use serial-getty-generator on genericarm64 Mikko Rapeli
@ 2025-03-17 10:37 ` Alexander Kanavin
2025-03-17 10:42 ` Mikko Rapeli
2025-03-17 11:50 ` Richard Purdie
7 siblings, 1 reply; 13+ messages in thread
From: Alexander Kanavin @ 2025-03-17 10:37 UTC (permalink / raw)
To: mikko.rapeli; +Cc: openembedded-core
Note that the feature freeze is now. This has to wait.
Alex
On Fri, 14 Mar 2025 at 12:20, Mikko Rapeli via lists.openembedded.org
<mikko.rapeli=linaro.org@lists.openembedded.org> wrote:
>
> systemd based initrd supports more security, encryption etc features
> than custom shell script ones but oe-core lacks support for it.
> Convert core-image-initramfs-boot to create systemd based initrd
> if "systemd-initramfs" is set in DISTRO_FEATURES. Includes a test
> for this initrd to mount rootfs via Unified Kernel Image uki.py.
>
> Sadly the boot time is really slow, e.g. over 30 seconds with
> systemd based initrd. One of the major reasons is the large
> amount of kernel modules built into the linux-yocto kernel and
> processing of their udev events in userspace. Thus add
> kernel-initrd-modules meta package to easily install
> subset of all kernel modules to initrd. The subset
> supports "mount rootfs from any block device" but
> doesn't include graphics, UBS etc support. Without this
> generated meta package, initrd recipe needs to manually define
> which exact kernel modules to include which breaks if
> those modules are built into the kernel. Thus the initrd
> becomes machine and kernel config specific and hard to maintain.
> With this meta package a generic initrd can be created.
>
> Separate changes to linux-yocto compile a lot more drivers
> as modules but they depend on these initrd changes.
>
> Mikko Rapeli (6):
> systemd: use serial-getty-generator on genericarm64
> systemd: enable efi support if in MACHINE_FEATURES too
> uki.bbclass: drop serial console from kernel command line
> kernel.bbclass: add kernel-initrd-modules meta package
> core-image-initramfs-boot: add option to build systemd based initrd
> oeqa selftest uki.py: add aarch64/arm test with systemd based initrd
>
> .../recipes-core/systemd/systemd_%.bbappend | 3 +
> .../kernel-module-split.bbclass | 46 +++++++++++
> meta/classes-recipe/kernel.bbclass | 5 +-
> meta/classes-recipe/module.bbclass | 37 +++++++++
> meta/classes-recipe/uki.bbclass | 2 +-
> meta/lib/oeqa/selftest/cases/uki.py | 76 +++++++++++++++++++
> .../images/core-image-initramfs-boot.bb | 28 ++++++-
> meta/recipes-core/systemd/systemd_257.3.bb | 1 +
> 8 files changed, 193 insertions(+), 5 deletions(-)
> create mode 100644 meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
>
> --
> 2.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#212832): https://lists.openembedded.org/g/openembedded-core/message/212832
> Mute This Topic: https://lists.openembedded.org/mt/111696849/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [OE-core] [PATCH 0/6] systemd based initrd and modular kernel support
2025-03-17 10:37 ` [OE-core] [PATCH 0/6] systemd based initrd and modular kernel support Alexander Kanavin
@ 2025-03-17 10:42 ` Mikko Rapeli
0 siblings, 0 replies; 13+ messages in thread
From: Mikko Rapeli @ 2025-03-17 10:42 UTC (permalink / raw)
To: Alexander Kanavin; +Cc: openembedded-core
Hi,
On Mon, Mar 17, 2025 at 11:37:29AM +0100, Alexander Kanavin wrote:
> Note that the feature freeze is now. This has to wait.
Yes, I'm aware. Just posted this out as it is 'done' on my side
and need feedback.
The kernel config change RFC is also out but that in current form
breaks things so need feedback how this could be fixed, for example
in specific machines configure features to compile as modules,
and/or which usecases must work with the single kernel binary
without initrd.
Cheers,
-Mikko
> Alex
>
> On Fri, 14 Mar 2025 at 12:20, Mikko Rapeli via lists.openembedded.org
> <mikko.rapeli=linaro.org@lists.openembedded.org> wrote:
> >
> > systemd based initrd supports more security, encryption etc features
> > than custom shell script ones but oe-core lacks support for it.
> > Convert core-image-initramfs-boot to create systemd based initrd
> > if "systemd-initramfs" is set in DISTRO_FEATURES. Includes a test
> > for this initrd to mount rootfs via Unified Kernel Image uki.py.
> >
> > Sadly the boot time is really slow, e.g. over 30 seconds with
> > systemd based initrd. One of the major reasons is the large
> > amount of kernel modules built into the linux-yocto kernel and
> > processing of their udev events in userspace. Thus add
> > kernel-initrd-modules meta package to easily install
> > subset of all kernel modules to initrd. The subset
> > supports "mount rootfs from any block device" but
> > doesn't include graphics, UBS etc support. Without this
> > generated meta package, initrd recipe needs to manually define
> > which exact kernel modules to include which breaks if
> > those modules are built into the kernel. Thus the initrd
> > becomes machine and kernel config specific and hard to maintain.
> > With this meta package a generic initrd can be created.
> >
> > Separate changes to linux-yocto compile a lot more drivers
> > as modules but they depend on these initrd changes.
> >
> > Mikko Rapeli (6):
> > systemd: use serial-getty-generator on genericarm64
> > systemd: enable efi support if in MACHINE_FEATURES too
> > uki.bbclass: drop serial console from kernel command line
> > kernel.bbclass: add kernel-initrd-modules meta package
> > core-image-initramfs-boot: add option to build systemd based initrd
> > oeqa selftest uki.py: add aarch64/arm test with systemd based initrd
> >
> > .../recipes-core/systemd/systemd_%.bbappend | 3 +
> > .../kernel-module-split.bbclass | 46 +++++++++++
> > meta/classes-recipe/kernel.bbclass | 5 +-
> > meta/classes-recipe/module.bbclass | 37 +++++++++
> > meta/classes-recipe/uki.bbclass | 2 +-
> > meta/lib/oeqa/selftest/cases/uki.py | 76 +++++++++++++++++++
> > .../images/core-image-initramfs-boot.bb | 28 ++++++-
> > meta/recipes-core/systemd/systemd_257.3.bb | 1 +
> > 8 files changed, 193 insertions(+), 5 deletions(-)
> > create mode 100644 meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
> >
> > --
> > 2.43.0
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#212832): https://lists.openembedded.org/g/openembedded-core/message/212832
> > Mute This Topic: https://lists.openembedded.org/mt/111696849/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [OE-core] [PATCH 0/6] systemd based initrd and modular kernel support
2025-03-14 11:19 [PATCH 0/6] systemd based initrd and modular kernel support Mikko Rapeli
` (6 preceding siblings ...)
2025-03-17 10:37 ` [OE-core] [PATCH 0/6] systemd based initrd and modular kernel support Alexander Kanavin
@ 2025-03-17 11:50 ` Richard Purdie
2025-03-17 12:20 ` Mikko Rapeli
7 siblings, 1 reply; 13+ messages in thread
From: Richard Purdie @ 2025-03-17 11:50 UTC (permalink / raw)
To: mikko.rapeli, openembedded-core
On Fri, 2025-03-14 at 13:19 +0200, Mikko Rapeli via lists.openembedded.org wrote:
> systemd based initrd supports more security, encryption etc features
> than custom shell script ones but oe-core lacks support for it.
> Convert core-image-initramfs-boot to create systemd based initrd
> if "systemd-initramfs" is set in DISTRO_FEATURES. Includes a test
> for this initrd to mount rootfs via Unified Kernel Image uki.py.
>
> Sadly the boot time is really slow, e.g. over 30 seconds with
> systemd based initrd. One of the major reasons is the large
> amount of kernel modules built into the linux-yocto kernel and
> processing of their udev events in userspace. Thus add
> kernel-initrd-modules meta package to easily install
> subset of all kernel modules to initrd. The subset
> supports "mount rootfs from any block device" but
> doesn't include graphics, UBS etc support. Without this
> generated meta package, initrd recipe needs to manually define
> which exact kernel modules to include which breaks if
> those modules are built into the kernel. Thus the initrd
> becomes machine and kernel config specific and hard to maintain.
> With this meta package a generic initrd can be created.
>
> Separate changes to linux-yocto compile a lot more drivers
> as modules but they depend on these initrd changes.
>
> Mikko Rapeli (6):
> systemd: use serial-getty-generator on genericarm64
> systemd: enable efi support if in MACHINE_FEATURES too
> uki.bbclass: drop serial console from kernel command line
> kernel.bbclass: add kernel-initrd-modules meta package
> core-image-initramfs-boot: add option to build systemd based initrd
> oeqa selftest uki.py: add aarch64/arm test with systemd based initrd
>
> .../recipes-core/systemd/systemd_%.bbappend | 3 +
> .../kernel-module-split.bbclass | 46 +++++++++++
> meta/classes-recipe/kernel.bbclass | 5 +-
> meta/classes-recipe/module.bbclass | 37 +++++++++
> meta/classes-recipe/uki.bbclass | 2 +-
> meta/lib/oeqa/selftest/cases/uki.py | 76 +++++++++++++++++++
> .../images/core-image-initramfs-boot.bb | 28 ++++++-
> meta/recipes-core/systemd/systemd_257.3.bb | 1 +
> 8 files changed, 193 insertions(+), 5 deletions(-)
> create mode 100644 meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
Unfortunately this series seemed to result in oe-selftest failures on
both aarch64 and x86-64:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/1242
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/1110/steps/14/logs/stdio
Cheers,
Richard
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [OE-core] [PATCH 0/6] systemd based initrd and modular kernel support
2025-03-17 11:50 ` Richard Purdie
@ 2025-03-17 12:20 ` Mikko Rapeli
2025-03-17 12:25 ` Richard Purdie
0 siblings, 1 reply; 13+ messages in thread
From: Mikko Rapeli @ 2025-03-17 12:20 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
Hi,
On Mon, Mar 17, 2025 at 11:50:58AM +0000, Richard Purdie wrote:
> On Fri, 2025-03-14 at 13:19 +0200, Mikko Rapeli via lists.openembedded.org wrote:
> > systemd based initrd supports more security, encryption etc features
> > than custom shell script ones but oe-core lacks support for it.
> > Convert core-image-initramfs-boot to create systemd based initrd
> > if "systemd-initramfs" is set in DISTRO_FEATURES. Includes a test
> > for this initrd to mount rootfs via Unified Kernel Image uki.py.
> >
> > Sadly the boot time is really slow, e.g. over 30 seconds with
> > systemd based initrd. One of the major reasons is the large
> > amount of kernel modules built into the linux-yocto kernel and
> > processing of their udev events in userspace. Thus add
> > kernel-initrd-modules meta package to easily install
> > subset of all kernel modules to initrd. The subset
> > supports "mount rootfs from any block device" but
> > doesn't include graphics, UBS etc support. Without this
> > generated meta package, initrd recipe needs to manually define
> > which exact kernel modules to include which breaks if
> > those modules are built into the kernel. Thus the initrd
> > becomes machine and kernel config specific and hard to maintain.
> > With this meta package a generic initrd can be created.
> >
> > Separate changes to linux-yocto compile a lot more drivers
> > as modules but they depend on these initrd changes.
> >
> > Mikko Rapeli (6):
> > � systemd: use serial-getty-generator on genericarm64
> > � systemd: enable efi support if in MACHINE_FEATURES too
> > � uki.bbclass: drop serial console from kernel command line
> > � kernel.bbclass: add kernel-initrd-modules meta package
> > � core-image-initramfs-boot: add option to build systemd based initrd
> > � oeqa selftest uki.py: add aarch64/arm test with systemd based initrd
> >
> > �.../recipes-core/systemd/systemd_%.bbappend�� |� 3 +
> > �.../kernel-module-split.bbclass�������������� | 46 +++++++++++
> > �meta/classes-recipe/kernel.bbclass����������� |� 5 +-
> > �meta/classes-recipe/module.bbclass����������� | 37 +++++++++
> > �meta/classes-recipe/uki.bbclass�������������� |� 2 +-
> > �meta/lib/oeqa/selftest/cases/uki.py���������� | 76 +++++++++++++++++++
> > �.../images/core-image-initramfs-boot.bb������ | 28 ++++++-
> > �meta/recipes-core/systemd/systemd_257.3.bb��� |� 1 +
> > �8 files changed, 193 insertions(+), 5 deletions(-)
> > �create mode 100644 meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
>
> Unfortunately this series seemed to result in oe-selftest failures on
> both aarch64 and x86-64:
>
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/1242
> https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/1110/steps/14/logs/stdio
Thanks, I will investigate these. I ran into various issues when executing
selftests on my aarch64 build machine.
Is the basehash error related to this series or something else?
https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/1782873/raw_inline
stdio: ERROR: When reparsing /tmp/selftest-fetchoxfe4t0p/test.bb:do_checkuri, the basehash value changed from 84b9e23a83a764e7a5d8a96ee523199e2b1c604f4280a45030e248de0ff52962 to 4123da244f465feffecb2b4fd2b132b64851981ec2fb70bf9445df8b0ea6a69e. The metadata is not deterministic and this needs to be fixed.
stdio: ERROR: The following commands may help:
stdio: ERROR: $ bitbake test -cdo_checkuri -Snone
stdio: ERROR: Then:
stdio: ERROR: $ bitbake test -cdo_checkuri -Sprintdiff
stdio: ERROR: When reparsing /tmp/selftest-fetchoxfe4t0p/test.bb:do_fetch, the basehash value changed from 6d55d6743729b615749dc016857d7e5f9c884a8b92f0d57f68e743f4910333d3 to fa7d6ea0563b60362418d2a6c5e41a6684183d01ec578b65abd0c64a9cfba7cf. The metadata is not deterministic and this needs to be fixed.
...
There are a lot of these.
If there are any boot failures in qemu then I will have a look. The changes were not
supposed to change existing rootfs or initrd images. The new test in uki.py
may fail on some configurations which I did no manage to test.
Maybe "uki.bbclass: drop serial console from kernel command line" is breaking
serial console prompt on some machines. I'll try to reproduce.
Did the test run contain the linux-yocto changes which build a lot of kernel
drivers as modules? I don't think that is ready for AB testing yet, hence RFC in
https://lists.yoctoproject.org/g/linux-yocto/message/14866
The changes were sent out in-reply-to this thread so it's possible some tool
picked them up. That could explain shell script based initrd boot error message:
ERROR: There's no '/dev' on rootfs.
Cheers,
-Mikko
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [OE-core] [PATCH 0/6] systemd based initrd and modular kernel support
2025-03-17 12:20 ` Mikko Rapeli
@ 2025-03-17 12:25 ` Richard Purdie
0 siblings, 0 replies; 13+ messages in thread
From: Richard Purdie @ 2025-03-17 12:25 UTC (permalink / raw)
To: Mikko Rapeli; +Cc: openembedded-core
On Mon, 2025-03-17 at 14:20 +0200, Mikko Rapeli wrote:
> Hi,
>
> On Mon, Mar 17, 2025 at 11:50:58AM +0000, Richard Purdie wrote:
> > On Fri, 2025-03-14 at 13:19 +0200, Mikko Rapeli via lists.openembedded.org wrote:
> > > systemd based initrd supports more security, encryption etc features
> > > than custom shell script ones but oe-core lacks support for it.
> > > Convert core-image-initramfs-boot to create systemd based initrd
> > > if "systemd-initramfs" is set in DISTRO_FEATURES. Includes a test
> > > for this initrd to mount rootfs via Unified Kernel Image uki.py.
> > >
> > > Sadly the boot time is really slow, e.g. over 30 seconds with
> > > systemd based initrd. One of the major reasons is the large
> > > amount of kernel modules built into the linux-yocto kernel and
> > > processing of their udev events in userspace. Thus add
> > > kernel-initrd-modules meta package to easily install
> > > subset of all kernel modules to initrd. The subset
> > > supports "mount rootfs from any block device" but
> > > doesn't include graphics, UBS etc support. Without this
> > > generated meta package, initrd recipe needs to manually define
> > > which exact kernel modules to include which breaks if
> > > those modules are built into the kernel. Thus the initrd
> > > becomes machine and kernel config specific and hard to maintain.
> > > With this meta package a generic initrd can be created.
> > >
> > > Separate changes to linux-yocto compile a lot more drivers
> > > as modules but they depend on these initrd changes.
> > >
> > > Mikko Rapeli (6):
> > > systemd: use serial-getty-generator on genericarm64
> > > systemd: enable efi support if in MACHINE_FEATURES too
> > > uki.bbclass: drop serial console from kernel command line
> > > kernel.bbclass: add kernel-initrd-modules meta package
> > > core-image-initramfs-boot: add option to build systemd based initrd
> > > oeqa selftest uki.py: add aarch64/arm test with systemd based initrd
> > >
> > > .../recipes-core/systemd/systemd_%.bbappend | 3 +
> > > .../kernel-module-split.bbclass | 46 +++++++++++
> > > meta/classes-recipe/kernel.bbclass | 5 +-
> > > meta/classes-recipe/module.bbclass | 37 +++++++++
> > > meta/classes-recipe/uki.bbclass | 2 +-
> > > meta/lib/oeqa/selftest/cases/uki.py | 76 +++++++++++++++++++
> > > .../images/core-image-initramfs-boot.bb | 28 ++++++-
> > > meta/recipes-core/systemd/systemd_257.3.bb | 1 +
> > > 8 files changed, 193 insertions(+), 5 deletions(-)
> > > create mode 100644 meta-yocto-bsp/recipes-core/systemd/systemd_%.bbappend
> >
> > Unfortunately this series seemed to result in oe-selftest failures on
> > both aarch64 and x86-64:
> >
> > https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/1242
> > https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/1110/steps/14/logs/stdio
>
> Thanks, I will investigate these. I ran into various issues when executing
> selftests on my aarch64 build machine.
>
> Is the basehash error related to this series or something else?
>
> https://autobuilder.yoctoproject.org/valkyrie/api/v2/logs/1782873/raw_inline
>
> stdio: ERROR: When reparsing /tmp/selftest-fetchoxfe4t0p/test.bb:do_checkuri, the basehash value changed from 84b9e23a83a764e7a5d8a96ee523199e2b1c604f4280a45030e248de0ff52962 to 4123da244f465feffecb2b4fd2b132b64851981ec2fb70bf9445df8b0ea6a69e. The metadata is not deterministic and this needs to be fixed.
> stdio: ERROR: The following commands may help:
> stdio: ERROR: $ bitbake test -cdo_checkuri -Snone
> stdio: ERROR: Then:
> stdio: ERROR: $ bitbake test -cdo_checkuri -Sprintdiff
> stdio: ERROR: When reparsing /tmp/selftest-fetchoxfe4t0p/test.bb:do_fetch, the basehash value changed from 6d55d6743729b615749dc016857d7e5f9c884a8b92f0d57f68e743f4910333d3 to fa7d6ea0563b60362418d2a6c5e41a6684183d01ec578b65abd0c64a9cfba7cf. The metadata is not deterministic and this needs to be fixed.
> ...
>
> There are a lot of these.
I don't remember anything in the branch that would do that. It is
possible these are normal test output and only show up due to the other
failures. The test output shows everything from that execution thread
of selftest (due to the way python unittest parallelism was enabled).
> If there are any boot failures in qemu then I will have a look. The changes were not
> supposed to change existing rootfs or initrd images. The new test in uki.py
> may fail on some configurations which I did no manage to test.
> Maybe "uki.bbclass: drop serial console from kernel command line" is breaking
> serial console prompt on some machines. I'll try to reproduce.
>
> Did the test run contain the linux-yocto changes which build a lot of kernel
> drivers as modules? I don't think that is ready for AB testing yet, hence RFC in
> https://lists.yoctoproject.org/g/linux-yocto/message/14866
> The changes were sent out in-reply-to this thread so it's possible some tool
> picked them up. That could explain shell script based initrd boot error message:
>
> ERROR: There's no '/dev' on rootfs.
Those were not included.
Cheers,
Richard
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-03-17 12:25 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-14 11:19 [PATCH 0/6] systemd based initrd and modular kernel support Mikko Rapeli
2025-03-14 11:19 ` [PATCH 2/6] systemd: enable efi support if in MACHINE_FEATURES too Mikko Rapeli
2025-03-14 11:19 ` [PATCH 3/6] uki.bbclass: drop serial console from kernel command line Mikko Rapeli
2025-03-14 11:19 ` [PATCH 4/6] kernel.bbclass: add kernel-initrd-modules meta package Mikko Rapeli
2025-03-14 11:19 ` [PATCH 5/6] core-image-initramfs-boot: add option to build systemd based initrd Mikko Rapeli
2025-03-14 11:19 ` [PATCH 6/6] oeqa selftest uki.py: add aarch64/arm test with " Mikko Rapeli
2025-03-14 11:21 ` [PATCH v2 1/6] systemd: use serial-getty-generator on genericarm64 Mikko Rapeli
2025-03-14 11:33 ` Patchtest results for " patchtest
2025-03-17 10:37 ` [OE-core] [PATCH 0/6] systemd based initrd and modular kernel support Alexander Kanavin
2025-03-17 10:42 ` Mikko Rapeli
2025-03-17 11:50 ` Richard Purdie
2025-03-17 12:20 ` Mikko Rapeli
2025-03-17 12:25 ` Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.