mbox series

[0/6] systemd based initrd and modular kernel support

Message ID 20250314111942.304800-1-mikko.rapeli@linaro.org
Headers show
Series systemd based initrd and modular kernel support | expand

Message

Mikko Rapeli March 14, 2025, 11:19 a.m. UTC
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