From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Sun, 02 Nov 2025 20:01:45 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-wm1-f59.google.com (mail-wm1-f59.google.com [209.85.128.59]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 5A2J1h1p028023 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 2 Nov 2025 20:01:44 +0100 Received: by mail-wm1-f59.google.com with SMTP id 5b1f17b1804b1-475dca91610sf20261195e9.3 for ; Sun, 02 Nov 2025 11:01:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1762110098; cv=pass; d=google.com; s=arc-20240605; b=HfpVJzNBXy8W0rWuRpzP1dsulAu9WgsefwQUsgGluKtPaViOygzJuoMfkgiCZfMTkp Pk8ULoIF+eJQdKpYPSG4mm5pz4285CvH5Z5u87tKOJmMyOJp/yYRnIneN3RY9ICTpvpg ZKEMIVAQIQLbFlE3cT7HIDyOniJo0I8Xdmh9f5tohFIKKDUztNLzB8cVDBiP9JjrHq4g I7ouGJX+68EUDiky7YEAThc4C7IQrmsek9+IFmTYv89VLIPOElOiCzV/EYTL/3BL3zKU rQcCpId2TJdxrehSCMsAJxZdlXvdurP5RewtfVQXe39pMefQL8vVoGrpl6C+tMzw8fcZ Uneg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=V5habGqKunyJkwqFiMmFoOel2dfreMOg0FX0GxbddQE=; fh=pMpajZBbIxd7meR/Dgu0H/Bs8aIwJf28UYlvVugZDj0=; b=AXQQbsesI+rxc8bZhHIvqrOvhihGRHKFYZSJXAQp3WXxXb1QEpOEG6Q9jX5F1kbShz aivRxRKm22ub0rA6Ed2JZ1r4l8a1feZxHRVgg9Z2Bq2OmE0jf4J7gRAClO+wDcjMdah0 zznaSV5JLi4RE6Fp8qWoxG39AV1vP57cAcj/ZHcs4vqEWrxTaxt9r9kifm6NxK01VBJc WX7WIfMb5ELFhs4K/HnM9npPAw0KJwSS2Wrz41QeP/fP/JqVL+uAZ3OSFrGe3kbaI1Ly XkVzso2GBrmAhXEbA1bsCiSZn5J/s92/Knhiu/QeYJ/mAZ+Qy269bfZ7PfWMhPvhtDc9 dP0w==; darn=ilbers.de ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=QczdH8Zb; spf=pass (google.com: domain of fm-1212295-2025110219013397b245b0d9000207ea-vpwe0m@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-1212295-2025110219013397b245b0d9000207ea-vpwe0m@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1762110098; x=1762714898; darn=ilbers.de; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V5habGqKunyJkwqFiMmFoOel2dfreMOg0FX0GxbddQE=; b=hzVakhUsyt9l/5mUTfVRWFVMk7VdC8Kw8cvNe6waeaWiyxnWzE6k9Xo4SfBUfYflNz 8/6d1guSt1TVBWtWBoHB1Ss6DGm0BguTNHH8I+K4DwsaE+9Uvyk3VJ8aoXXIX1BRRYjh gyqAUVaxAAoKtfAO5Yh471/WfOBTVpya6Ta3Rwfox/Rnh2xlh5D8LmTh3u1m6Zb/YyQI GSlNNbiVyweJXrFySGixOR/nawElqx1MuBGvBQQpa6n2jdVMxY1OQBt6fVGRHCmGY1pd mb4OGkaDBUs4piCB2coUvn2fTs/OVu2XYhofsdzssffw6qVKSyc8LaVukgrCGoPco7lu 08ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762110098; x=1762714898; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=V5habGqKunyJkwqFiMmFoOel2dfreMOg0FX0GxbddQE=; b=rzJK4sb0xytx3XctSMHoCdpQz1Z4vd5MzYX6zBMsMyot9Sb8KtLLuNw4xMsZGMOuE2 3CB6ybyLJaXqHTy0UhmlEJq2JRITEFkeIWNIAUestzRLPx5cgVcw5vWKSSTQjSSirV0L QWCmpkrSecyxXUoFW5TGyFauWEUeTjHrATX84Ko1fdIsPDt0x2djFDokdLAyKg970/a3 rGHYwdu0VwtXXyNST0fYYsJCamwOkMDR1atW3wZ5wG5JK9WVj7OZerUCk0FfpQqS4CYZ yil9q/R6frkGm1KnldRCuRhdtAfy5vhSSNnovpS2S4fP70JS3ZY+muJxDTwh+whc+Oh5 it4w== X-Forwarded-Encrypted: i=2; AJvYcCUK9akEeFSZhjFtsy/hKAilF1lPZY6GJfFI3xZCvk8zL1EbRHAMk2Lbhp1NUZLCX+QV41MK@ilbers.de X-Gm-Message-State: AOJu0YwMFNpI9lRIYpGKevJoXmlA8GfCwHcXf5j/rxVoMT5bjiLMWSik m6a6pUIjHovwwtjWjZxRP3P7DiV1KvNR+Z1WOtnVyuud7YRrpZnxEQAE X-Google-Smtp-Source: AGHT+IHs6PuJ212TxrFjyJydLjSYVDv3CxhtCmeKL7Gfgqsi/2bfBQ1Aqw3f7c47odY7UtQXQl0rJw== X-Received: by 2002:a05:600c:4591:b0:46f:d897:516f with SMTP id 5b1f17b1804b1-477308b51c3mr119019425e9.34.1762110098001; Sun, 02 Nov 2025 11:01:38 -0800 (PST) X-BeenThere: isar-users@googlegroups.com; h="Ae8XA+bsXldZerZb9o1gTQD8oIkO7hRW5jyQUWWlo8fHvDEmQA==" Received: by 2002:a05:600c:1c28:b0:471:80e:c5fe with SMTP id 5b1f17b1804b1-477276e93e6ls35583865e9.0.-pod-prod-08-eu; Sun, 02 Nov 2025 11:01:34 -0800 (PST) X-Received: by 2002:a05:600c:a08:b0:46f:b43a:aef4 with SMTP id 5b1f17b1804b1-477308c9f72mr90900725e9.38.1762110094439; Sun, 02 Nov 2025 11:01:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1762110094; cv=none; d=google.com; s=arc-20240605; b=c+cNjJ8Q7ahKRWDZn4m+7NhVjDINy2Ai5DLybV/+Qqh1qtYWel7V4ZvMdLJ346/tBe CGiG+dvDGOYrIOsEKEFn/hydPPPYw/uyQBWO+SEF34G1dm1pR6QWL9C2nA5XeyXAiRj2 T++bAttYe86ujEjnRMWpNPzLTWWwYhb0IeqJlWsttV+8Hr5y4N+yAkOLktBM1nAKnB19 x2WdfwE1SlbALIIzXr0dlT5z84KH4RavaWOVGEG8+Uziif2NNTYI22ar9Efv9v3VGQyu 6IPzqsAP8IG28Bu5Yv3VpVAtZ+OIErcPYqeOOlzOp1iSNb4LCcssIcpeWDFDOT8npXqw 7KkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=pmc315FudhQ4BVJ8WIv7ixWhdkK5cpSlk6tvwF2R+to=; fh=1z37pEVhqwMLlkT4FDzOga7XBsM6Rzv6sXOq0pipxqo=; b=HF3273tz0E20rkACEjXxukznEQxjOL54BRFowSe8NlNTokKByQZ5fV32U86vsZj0kG jOPhGXZ6Umq4EKcO80urwh+dHEbrLzNrXtT+Q0HeYWN+NXwgsIHAa1nD2V2ndEOpZppg nMhx6HQ7mIS0GSko6TzSLkRuub3Zol3NVBDq9GIYKFkDPDYfn2OlacTcHWOVyXzatRyj cGQaNkQt+ccfjAsfe5JDqwLy95khUHwuPjmfHQ5Ya4IHXvxcZlO0JMo6o2oOmDbZVBVY +qnHcE3AqM5y2nDgzjTi6pLwxCNTEa007B7lC+6LzZu/CXe4rGDEbYgco2/ooWG494FF IwJg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=QczdH8Zb; spf=pass (google.com: domain of fm-1212295-2025110219013397b245b0d9000207ea-vpwe0m@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-1212295-2025110219013397b245b0d9000207ea-vpwe0m@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net. [185.136.64.226]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-4772fbef791si3981785e9.2.2025.11.02.11.01.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Nov 2025 11:01:34 -0800 (PST) Received-SPF: pass (google.com: domain of fm-1212295-2025110219013397b245b0d9000207ea-vpwe0m@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) client-ip=185.136.64.226; Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 2025110219013397b245b0d9000207ea for ; Sun, 02 Nov 2025 20:01:34 +0100 From: "'Cedric Hombourger' via isar-users" To: isar-users@googlegroups.com Cc: Cedric Hombourger Subject: [PATCH 1/1] image: introduce IMAGE_INITRD, deprecate INITRD_IMAGE Date: Sun, 2 Nov 2025 20:01:20 +0100 Message-ID: <20251102190129.727186-2-cedric.hombourger@siemens.com> In-Reply-To: <20251102190129.727186-1-cedric.hombourger@siemens.com> References: <20251102190129.727186-1-cedric.hombourger@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1212295:519-21489:flowmailer X-Original-Sender: cedric.hombourger@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=QczdH8Zb; spf=pass (google.com: domain of fm-1212295-2025110219013397b245b0d9000207ea-vpwe0m@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-1212295-2025110219013397b245b0d9000207ea-vpwe0m@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Cedric Hombourger Reply-To: Cedric Hombourger Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: 71IqxLUzIBMb 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 ?=3D "cip-core-initramfs" INITRD_IMAGE =3D "${INITRAMFS_RECIPE}-${DISTRO}-${MACHINE}.initrd.img" do_image_wic[depends] +=3D "${INITRAMFS_RECIPE}:do_build" And it could now be changed to: INITRD_IMAGE ?=3D "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. Signed-off-by: Cedric Hombourger --- 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(-) diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md index cf04fa5c..78c7eae0 100644 --- a/RECIPE-API-CHANGELOG.md +++ b/RECIPE-API-CHANGELOG.md @@ -791,3 +791,31 @@ Set `Rules-Requires-Root: no` in `debian/control` file= s to prevent unnecessary invocation of fakeroot during package builds. This follows Debian guidelin= es recommending not to use fakeroot when no privileged operations (e.g., `cho= wn`, root file modifications) are required.=20 + +### IMAGE_INITRD added to replace INITRD_IMAGE + +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 (presently adding a ${DISTRO}-${IMAGE}-initrd.img suffix to init= rd +images) and insert the build of their initramfs recipe into the image buil= d +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 t= he +imager. + +For instance, cip-core was doing the following: + + INITRAMFS_RECIPE ?=3D "cip-core-initramfs" + INITRD_IMAGE =3D "${INITRAMFS_RECIPE}-${DISTRO}-${MACHINE}.initrd.img= " + do_image_wic[depends] +=3D "${INITRAMFS_RECIPE}:do_build" + +And it could now be changed to: + + IMAGE_INITRD ?=3D "cip-core-initramfs" + +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). diff --git a/doc/user_manual.md b/doc/user_manual.md index 7133b217..230ea1cc 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -574,7 +574,7 @@ Every machine is described in its configuration file. T= he file defines the follo - U-Boot or other boot loader. - Machine-specific firmware. - `KERNEL_IMAGE` - The name of kernel binary that it installed to `/boot`= folder in target filesystem. This variable is used by Isar to extract the = kernel binary and put it into the deploy folder. This makes sense for embed= ded devices, where kernel and root filesystem are written to different flas= h partitions. This variable is optional. - - `INITRD_IMAGE` - The name of `ramdisk` binary. The meaning of this vari= able is similar to `KERNEL_IMAGE`. This variable is optional. + - `INITRD_IMAGE` - The name of `initramfs` recipe to be built and used by= the imager. - `MACHINE_SERIAL` - The name of serial device that will be used for cons= ole output. - `IMAGE_FSTYPES` - The types of images to be generated for this machine. =20 @@ -583,7 +583,6 @@ Below is an example of machine configuration file for `= Raspberry Pi` board: IMAGE_PREINSTALL =3D "linux-image-rpi-rpfv \ raspberrypi-bootloader-nokernel" KERNEL_IMAGE =3D "vmlinuz-4.4.0-1-rpi" -INITRD_IMAGE =3D "initrd.img-4.4.0-1-rpi" MACHINE_SERIAL =3D "ttyAMA0" IMAGE_FSTYPES =3D "wic" WKS_FILE =3D "rpi-sdimg" diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 441ea936..dff918d7 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -21,10 +21,35 @@ IMAGE_INSTALL +=3D "${KERNEL_IMAGE_PKG}" # Name of the image including distro&machine names IMAGE_FULLNAME =3D "${PN}-${DISTRO}-${MACHINE}" =20 -# These variables are used by wic and start_vm -KERNEL_IMAGE ?=3D "${IMAGE_FULLNAME}-${KERNEL_FILE}" +# Deprecated; this would be set to e.g. "${INITRAMFS_RECIPE}-${DISTRO}-${M= ACHINE}.initrd.img" INITRD_IMAGE ?=3D "" -INITRD_DEPLOY_FILE =3D "${@ d.getVar('INITRD_IMAGE') or '${IMAGE_FULLNAME}= -initrd.img'}" + +# IMAGE_INITRD should be used instead (variables consumed by this image cl= ass should +# be prefixed with IMAGE_ for consistency) +IMAGE_INITRD ?=3D "" + +# Name of the deployed initrd image +INITRD_DEPLOY_FILE =3D "${@ d.getVar('IMAGE_INITRD') or '${PN}' }-${DISTRO= }-${MACHINE}-initrd.img" + +# Make sure dependent initramfs recipe is built +do_image[depends] +=3D "${@ '${IMAGE_INITRD}:do_build' if '${IMAGE_INITRD}= ' else '' }" + +# Produce warning(s) if INITRD_IMAGE is used +python() { + initrd_image =3D d.getVar('INITRD_IMAGE') + image_initrd =3D d.getVar('IMAGE_INITRD') + if initrd_image and image_initrd: + bb.warn('both INITRD_IMAGE (deprecated) and IMAGE_INITRD were set,= ' + 'ignoring INITRD_IMAGE and using ' + f'IMAGE_INITRD =3D "{image_initrd}"') + d.setVar('INITRD_IMAGE', '') + elif initrd_image: + bb.warn('INITRD_IMAGE is deprecated, use IMAGE_INITRD instead') + d.setVar('INITRD_DEPLOY_FILE', initrd_image) +} + +# This variable is used by wic and start_vm +KERNEL_IMAGE ?=3D "${IMAGE_FULLNAME}-${KERNEL_FILE}" =20 # This defines the deployed dtbs for reuse by imagers DTB_FILES ?=3D "" diff --git a/testsuite/citest.py b/testsuite/citest.py index e53dfa9b..f944ee4a 100755 --- a/testsuite/citest.py +++ b/testsuite/citest.py @@ -288,6 +288,13 @@ class InitRdBaseTest(CIBaseTest): "IMAGE_INSTALL:remove =3D 'enable-fsck'", ] =20 + def init(self): + super().init() + self.deploy_dir =3D os.path.join(self.build_dir, 'tmp', 'deploy') + + def deploy_dir_image(self, machine): + return os.path.join(self.deploy_dir, 'images', machine) + def dracut_in_image(self, targets): machine =3D 'qemuamd64' distro =3D 'bookworm' @@ -308,6 +315,36 @@ class InitRdBaseTest(CIBaseTest): cmd=3D"systemctl is-active dracut-shutdown" ) =20 + def build_image_with_dependent_initrd(self, image, initrd, + distro=3D"debian-bookworm", + machine=3D"qemuamd64", + lines=3D'', + bb_should_fail=3DFalse): + mc =3D f'mc:{machine}-{distro.removeprefix("debian-")}' + initrd_image =3D f'{initrd}-{distro}-{machine}.initrd.img' + initrd_path =3D os.path.join(self.deploy_dir_image(machine), initr= d_image) + + # cleansstate if the initrd image was already built/deployed to ve= rify + # that a new build does result in the image being deployed + ret, _, err =3D self.exec_cmd(f'{mc}:{initrd}', 'bitbake -c cleans= state') + if ret: + self.fail(f"failed to clean {initrd}: {err}") + + # Make sure it is no longer deployed + if os.path.exists(initrd_path): + os.unlink(initrd_path) + + # Build the rootfs image and verify that its dependent initrd imag= e + # was built and deployed + self.perform_build_test(f'{mc}:{image}', lines=3Dlines, should_fai= l=3Dbb_should_fail) + + if bb_should_fail is False: + if os.path.exists(initrd_path) is False: + self.fail(f"initrd image not found: {initrd_path}!") + else: + if os.path.exists(initrd_path): + self.fail(f"initrd found despite bitbake failure: {initrd_= path}!") + =20 class InitRdTest(InitRdBaseTest): """ @@ -332,6 +369,52 @@ class InitRdTest(InitRdBaseTest): self.perform_build_test('mc:qemuamd64-bookworm:isar-image-ci', should_fail=3DTrue, lines=3Dlines) =20 + def test_var_initrd_image(self): + """ Check if deprecated INITRD_IMAGE variable may be used. """ + initrd =3D 'isar-initramfs' + distro =3D 'debian-bookworm' + machine =3D 'qemuamd64' + + lines =3D [ + f"INITRD_IMAGE =3D '{initrd}-{distro}-{machine}.initrd.img'", + f"do_image[depends] +=3D '{initrd}:do_build'" + ] + + self.init() + self.build_image_with_dependent_initrd('isar-image-ci', initrd, + distro, machine, lines) + + def test_var_image_initrd(self): + """ Check build of an image with a dependent initrd using IMAGE_IN= ITRD. """ + initrd =3D 'isar-initramfs' + lines =3D [f"IMAGE_INITRD =3D '{initrd}'"] + + self.init() + self.build_image_with_dependent_initrd('isar-image-ci', initrd, li= nes=3Dlines) + + def test_var_image_initrd_and_initrd_image(self): + """ Check use of both IMAGE_INITRD and INITRD_IMAGE. """ + initrd =3D 'isar-initramfs' + + self.init() + + # While both may be set, IMAGE_INITRD takes precedence. Ensure + # by specifying an invalid recipe name: bitbake should fail. + lines =3D [ + "IMAGE_INITRD =3D 'not-a-valid-initrd-recipe'", + f"INITRD_IMAGE =3D '{initrd}-debian-bookworm-qemuamd64.initrd.= img'" + ] + self.build_image_with_dependent_initrd('isar-image-ci', initrd, li= nes=3Dlines, + bb_should_fail=3DTrue) + + # The build should succeed if we have a valid IMAGE_INITRD even + # with an invalifd INITRD_IMAGE + lines =3D [ + f"IMAGE_INITRD =3D '{initrd}'", + "INITRD_IMAGE =3D 'not-a-valid-initrd-file'" + ] + self.build_image_with_dependent_initrd('isar-image-ci', initrd, li= nes=3Dlines) + =20 class InitRdCrossTests(InitRdBaseTest): """ --=20 2.47.3 --=20 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 e= mail to isar-users+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/isar-users/= 20251102190129.727186-2-cedric.hombourger%40siemens.com.