From: Zhihang Wei <wzh@ilbers.de>
To: Cedric Hombourger <cedric.hombourger@siemens.com>,
isar-users@googlegroups.com, wzh@ilbers.de
Subject: Re: [PATCH 0/1] image: introduce IMAGE_INITRD, deprecate INITRD_IMAGE
Date: Fri, 21 Nov 2025 18:07:48 +0100 [thread overview]
Message-ID: <5ae801ae-55e0-48ab-9db4-a55d7c03954b@ilbers.de> (raw)
In-Reply-To: <9cb68e63-3820-4678-a607-b35a574a8e74@ilbers.de>
Hi Cedric,
After some checking I think we need to rework this patch.
The INITRD_IMAGE variable was origionally used, when we already have a
customized initrd image binary. In this case, the default initrd image
should not be generated.
And the logic was implemented as (until commit ea6f44c9):
In image bb.class:
- If 'INITRD_IMAGE' is not empty, set 'no-generate-initrd'.
- Since image.bbclass inherits rootfs.bbclass:
- rootfs.bbclass checks 'no-generate-initrd'.
- If it is NOT set, add the task to generate the default initrd.
However, this did not actually work. the default initrd image was always
generated.
The issue came from initramfs.bbclass:
- initramfs.bbclass has no logic to set 'no-generate-initrd'.
- It also inherits rootfs.bbclass, which means:
- rootfs.bbclass sees 'no-generate-initrd' as unset, so it always
generates default initrd image.
The patch "[v3 1/1] rootfs: rework no-generate-initrd rootfs feature"
fixes this behavior, and it was merged to next as 78d42de0. However, I
tested your patch before rebasing onto the latest next. It passed CI and
your additional test cases, and I applied it as c3c4e72c. At that moment
it caused a merge conflict, and I did not resolve the conflict correctly.
After both the patches were merged to next, two of the test cases you
added failed:
- InitRdTest.test_var_initrd_image, and
- InitRdTest.test_var_image_initrd_and_initrd_image.
Both tests set INITRD_IMAGE variable to a meaningful value. But the
logic for determining whether to generate a default initrd has been
reworked and moved entirely into rootfs.bbclass. Under the new logic:
- rootfs.bbclass does not add 'generate-initrd' when INITRD_IMAGE is set.
- rootfs.bbclass adds initrd generation tasks only when
'generate-initrd' is set.
- Since both initramfs.bbclass and image.bbclass inherit rootfs.bbclass,
neither will generate a default initrd image in this case.
Back to your patch, I'm wondering whether it makes sense to keep both
INITRD_IMAGE and your new variable. If my understanding is correct, they
serve different purposes:
- INITRD_IMAGE is used when a custom initrd image binary is provided.
- Your variable is used when a custom recipe should be used to build the
initrd image.
Because I did not resolve the merge conflict correctly when applying
your patch, I suggest reverting c3c4e72c for now and reworking your
patch on top of 78d42de0.
Thanks,
Zhihang
On 11/12/25 17:41, Zhihang Wei wrote:
> Applied to next, thanks.
>
> The patch was rebased onto the current next.
>
> Best regards,
> Zhihang
>
> On 11/2/25 20:01, 'Cedric Hombourger' via isar-users wrote:
>> INITRD_IMAGE could be set to the full name of an initrd image to be
>> found in DEPLOY_DIR_IMAGE. Downstream layers had to assume how Isar
>> names its image artifacts (${DISTRO}-${IMAGE}-initrd.img suffix for
>> initrd images) and insert the build of their initramfs recipe into
>> the image build pipeline.
>>
>> IMAGE_INITRD is introduced to (1) have a constistent naming convention
>> for variables consumed by the image class (IMAGE_ prefix) (2) only
>> require this variable to be set when a custom initrd should be built
>> and used by the imager.
>>
>> For instance, cip-core was doing the following:
>>
>> INITRAMFS_RECIPE ?= "cip-core-initramfs"
>> INITRD_IMAGE = "${INITRAMFS_RECIPE}-${DISTRO}-${MACHINE}.initrd.img"
>> do_image_wic[depends] += "${INITRAMFS_RECIPE}:do_build"
>>
>> And it could now be changed to:
>>
>> IMAGE_INITRD ?= "cip-core-initramfs"
>>
>> (their layer would likely keep their INITRAMFS_RECIPE variable as it
>> may be considered as an API towards its own downstream users).
>>
>> INITRD_IMAGE is "only" deprecated; meaning that it may still be used
>> (but build-time warnings will be raised). If both IMAGE_INITRD and
>> INITRD_IMAGE are set then the latter will be ignored (a warning noting
>> that both were set will be emitted).
>>
>> These changes were tested against (1) new CI test-cases and (2) CIP
>> Core 1.9.0 both with and without adaptions to its code.
>>
>> Patch dependencies:
>> [1]
>> https://lists.isar-build.org/isar-users/20251101111326.600581-1-cedric.hombourger@siemens.com/T/#t
>> [2]
>> https://lists.isar-build.org/isar-users/20251030094451.1303871-1-Quirin.Gylstorff@siemens.com/T/#t
>>
>> InitRd tests:
>>
>> builder@ed1e0b7e8d4e:/work/testsuite$ trun --max-parallel-tasks=1
>> -p sstate=1 -t initrd citest.py
>> JOB ID : bdf8f7130f426014b0c008d0095ad317a9f66bee
>> JOB LOG :
>> /tmp/tmp72bozbdi/avocado/job-results/job-2025-11-02T18.30-bdf8f71/job.log
>> (1/8) citest.py:InitRdTest.test_dracut_in_image: STARTED
>> (1/8) citest.py:InitRdTest.test_dracut_in_image: PASS (104.93 s)
>> (2/8) citest.py:InitRdTest.test_dracut_build_initrd: STARTED
>> (2/8) citest.py:InitRdTest.test_dracut_build_initrd: PASS (34.36 s)
>> (3/8) citest.py:InitRdTest.test_dracut_build_failure: STARTED
>> (3/8) citest.py:InitRdTest.test_dracut_build_failure: FAIL:
>> Bitbake suceeded but was expected to fail! (143.54 s)
>> (4/8) citest.py:InitRdTest.test_var_initrd_image: STARTED
>> (4/8) citest.py:InitRdTest.test_var_initrd_image: PASS (259.88 s)
>> (5/8) citest.py:InitRdTest.test_var_image_initrd: STARTED
>> (5/8) citest.py:InitRdTest.test_var_image_initrd: PASS (237.34 s)
>> (6/8)
>> citest.py:InitRdTest.test_var_image_initrd_and_initrd_image: STARTED
>> (6/8)
>> citest.py:InitRdTest.test_var_image_initrd_and_initrd_image: PASS
>> (242.03 s)
>> (7/8) citest.py:InitRdCrossTests.test_dracut_in_image: STARTED
>> (7/8) citest.py:InitRdCrossTests.test_dracut_in_image: PASS
>> (407.83 s)
>> (8/8) citest.py:InitRdCrossTests.test_dracut_build_initrd: STARTED
>> (8/8) citest.py:InitRdCrossTests.test_dracut_build_initrd: PASS
>> (44.71 s)
>> RESULTS : PASS 7 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 |
>> INTERRUPT 0 | CANCEL 0
>> JOB TIME : 1482.17 s
>>
>> See [1] and/or [2] for an explanation (and proposed fix) for the single
>> test failure.
>>
>> Cedric Hombourger (1):
>> image: introduce IMAGE_INITRD, deprecate INITRD_IMAGE
>>
>> RECIPE-API-CHANGELOG.md | 28 +++++++++++++
>> doc/user_manual.md | 3 +-
>> meta/classes/image.bbclass | 31 ++++++++++++--
>> testsuite/citest.py | 83 ++++++++++++++++++++++++++++++++++++++
>> 4 files changed, 140 insertions(+), 5 deletions(-)
>>
>
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/5ae801ae-55e0-48ab-9db4-a55d7c03954b%40ilbers.de.
next prev parent reply other threads:[~2025-11-21 17:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-02 19:01 'Cedric Hombourger' via isar-users
2025-11-02 19:01 ` [PATCH 1/1] " 'Cedric Hombourger' via isar-users
2025-11-12 16:41 ` [PATCH 0/1] " Zhihang Wei
2025-11-21 17:07 ` Zhihang Wei [this message]
2025-11-19 15:05 ` Zhihang Wei
2025-11-29 14:37 ` 'Jan Kiszka' via isar-users
2025-11-29 15:00 ` 'Jan Kiszka' via isar-users
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5ae801ae-55e0-48ab-9db4-a55d7c03954b@ilbers.de \
--to=wzh@ilbers.de \
--cc=cedric.hombourger@siemens.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox