Re: [OE-core] [PATCH v3 00/11] systemd based initrd and modular kernel support

Mathieu Dubois-Briand
2025-04-07T08:51:47Z

On Mon Apr 7, 2025 at 10:10 AM CEST, Mikko Rapeli wrote:
> Hi,
>
> On Mon, Apr 07, 2025 at 09:53:45AM +0200, Mathieu Dubois-Briand wrote:
>> On Fri Apr 4, 2025 at 6:29 PM CEST, 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.
>> >
>>
>> Hi Mikko,
>>
>> Thanks for your patch.
>>
>> I believe one of these wic related patches is responsible of some
>> oe-selftest failures we can see on the autobuilder:
>>
>> 2025-04-06 15:51:49,317 - oe-selftest - INFO - wic.Wic.test_permissions (subunit.RemotedTestCase)
>> 2025-04-06 15:51:49,318 - oe-selftest - INFO - ... FAIL
>>
>> ...
>>
>> ERROR: When reparsing /tmp/selftest-fetchsrayuxoq/test.bb:do_checkuri, the basehash value changed from 84b9e23a83a764e7a5d8a96ee523199e2b1c604f4280a45030e248de0ff52962 to 4123da244f465feffecb2b4fd2b132b64851981ec2fb70bf9445df8b0ea6a69e. The metadata is not deterministic and this needs to be fixed.
>> ERROR: The following commands may help:
>> ERROR: $ bitbake test -cdo_checkuri -Snone
>> ERROR: Then:
>> ERROR: $ bitbake test -cdo_checkuri -Sprintdiff
>>
>> ERROR: When reparsing /tmp/selftest-fetchsrayuxoq/test.bb:do_fetch, the basehash value changed from 6d55d6743729b615749dc016857d7e5f9c884a8b92f0d57f68e743f4910333d3 to fa7d6ea0563b60362418d2a6c5e41a6684183d01ec578b65abd0c64a9cfba7cf. The metadata is not deterministic and this needs to be fixed.
>> ERROR: The following commands may help:
>> ERROR: $ bitbake test -cdo_fetch -Snone
>> ERROR: Then:
>> ERROR: $ bitbake test -cdo_fetch -Sprintdiff
>>
>> ERROR: When reparsing /tmp/selftest-fetchsrayuxoq/test.bb:do_unpack, the basehash value changed from ae9d94aafc721d891f8754df82ed90da8191357178f3db64221a49d5c1de3bcd to 1ac8f87a71db151b8eb2ae8d13f9a6ea1a0c884ef98555d61d2c2fe07a476a8a. The metadata is not deterministic and this needs to be fixed.
>> ERROR: The following commands may help:
>> ERROR: $ bitbake test -cdo_unpack -Snone
>> ERROR: Then:
>> ERROR: $ bitbake test -cdo_unpack -Sprintdiff
>>
>> ...
>>
>> https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/1391
>>
>> Can you have a look at this please?
>
> I can have a look but how can these patches change the basehash'es when testing?
>
> I've seen some of the wic selftets failing on x86_64 build machine with zfs
> but changes to fix this was rejected multiple times.
>
> Then I've seen some of these failing with odd pseudo failures on aarch64
> build machine.
>
> With my patches the end result was the same.
>
> I ran wic and uki selftests on x86_64 and aarch64 build machines for targets qemuarm64,
> qemuarm and genericx86-64.
>
> The wic patches have actually nothing to do with this series except I ran into bugs
> in wic which resulted in unbootable images, e.g. the UEFI bootloader binaries
> missing from ESP partition. These were impacting some builds but not all
> which was really troubling.
>
> Cheers,
>
> -Mikko

Ok, I am running some git bisect locally anyway, I will keep you updated
a bit later today.

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering