From patchwork Mon Apr 20 17:43:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagenknecht X-Patchwork-Id: 86506 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 871E6F5A8A9 for ; Mon, 20 Apr 2026 17:45:04 +0000 (UTC) Received: from mx1.emlix.com (mx1.emlix.com [178.63.209.131]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.25980.1776707094736875399 for ; Mon, 20 Apr 2026 10:44:55 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@emlix.com header.s=20250930 header.b=KjcjlqBw; dkim=fail reason="dkim: body hash did not verify" header.i=@emlix.com header.s=20250930 header.b=KjcjlqBw; spf=pass (domain: emlix.com, ip: 178.63.209.131, mailfrom: dwagenknecht@emlix.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emlix.com; s=20250930; t=1776707092; bh=iHjqsJHndQDYWVl0s/BmAQpiwaqfAQlN96mth21WoE8=; h=From:To:Cc:Subject:Date:From; b=KjcjlqBwRi7aBvbGCdGzH20UFw4+J0j0Ex+oHojZk360i4K/MT+uHwxDGun0ZFiI5 ZNc03ZtBJ2A/+MegCWxuqA9ruZ/Lr8hHbIn6aK0XrAPqxG/noRn7CR30mq21pvLMyT cnmPlOvj1i64jU7VXOdKCogr/BPmnwXvZnBDV4wkrtY9AwqhYfY/RucPhexjqT7PaN OpsKHlpGOM3tDELb9UQhSZ0Wcu6oKxk2FJsA4Wuf+nriTEltpvNeOCc1QZ1BihdAaA LyyYs34RoLG0xrz07Vg3KGrSLhCylC7m6wRz3zJUFxeJ8HpUS/T8ifLKxGcSKZQYVz nFd5HgflkrSSA== Received: from mx1.emlix.com (localhost [127.0.0.1]) by mx1.emlix.com (Postfix) with ESMTP id 7EE975F905 for ; Mon, 20 Apr 2026 19:44:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emlix.com; s=20250930; t=1776707092; bh=iHjqsJHndQDYWVl0s/BmAQpiwaqfAQlN96mth21WoE8=; h=From:To:Cc:Subject:Date:From; b=KjcjlqBwRi7aBvbGCdGzH20UFw4+J0j0Ex+oHojZk360i4K/MT+uHwxDGun0ZFiI5 ZNc03ZtBJ2A/+MegCWxuqA9ruZ/Lr8hHbIn6aK0XrAPqxG/noRn7CR30mq21pvLMyT cnmPlOvj1i64jU7VXOdKCogr/BPmnwXvZnBDV4wkrtY9AwqhYfY/RucPhexjqT7PaN OpsKHlpGOM3tDELb9UQhSZ0Wcu6oKxk2FJsA4Wuf+nriTEltpvNeOCc1QZ1BihdAaA LyyYs34RoLG0xrz07Vg3KGrSLhCylC7m6wRz3zJUFxeJ8HpUS/T8ifLKxGcSKZQYVz nFd5HgflkrSSA== Received: from mailer.emlix.com (p5098be52.dip0.t-ipconnect.de [80.152.190.82]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.emlix.com (Postfix) with ESMTPS id 65E655F78A for ; Mon, 20 Apr 2026 19:44:52 +0200 (CEST) From: Daniel Wagenknecht To: openembedded-core@lists.openembedded.org Cc: Daniel Wagenknecht Subject: [PATCH] classes: image-buildinfo: allow deploying the buildinfo file Date: Mon, 20 Apr 2026 19:43:47 +0200 Message-ID: <20260420174404.122964-2-dwagenknecht@emlix.com> X-Mailer: git-send-email 2.51.2 MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 20 Apr 2026 17:45:04 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/235581 The `buildinfo` file generated by the `image-buildinfo` class contains useful information to identify an image. Having it in the rootfs of the image as well as deployed alongside the image artifact can be useful. Allow to deploy it alongside the image by setting 'IMAGE_BUILDINFO_DEPLOY' to '1'. I use this in an automated testing workflow with unreliable deploy step to ensure the deployment succeeded. With IMAGE_BUILDINFO_VARS += "IMAGE_NAME" IMAGE_BUILDINFO_DEPLOY = "1" the generated buidinfo file is unique and the deploy step can be verified by comparing (the hash of) the file on the booted system and in `IMAGE_DEPLOY_DIR`. Signed-off-by: Daniel Wagenknecht --- I have prepared a patch for yocto-docs to add the variable to the glossary. I did not find guidance on how to do simultanious changes to OE-Core and yocto-docs so I'll send them once this has been merged. meta/classes/image-buildinfo.bbclass | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/meta/classes/image-buildinfo.bbclass b/meta/classes/image-buildinfo.bbclass index b83ce650ad..1dce50b376 100644 --- a/meta/classes/image-buildinfo.bbclass +++ b/meta/classes/image-buildinfo.bbclass @@ -16,6 +16,9 @@ IMAGE_BUILDINFO_VARS ?= "DISTRO DISTRO_VERSION" IMAGE_BUILDINFO_FILE ??= "${sysconfdir}/buildinfo" SDK_BUILDINFO_FILE ??= "/buildinfo" +# Deploy the file alongside the images. +IMAGE_BUILDINFO_DEPLOY ??= "0" + # From buildhistory.bbclass def image_buildinfo_outputvars(vars, d): vars = vars.split() @@ -70,12 +73,20 @@ python buildinfo_image () { bb.build.exec_func("buildinfo", d) } +python buildinfo_deploy() { + d.setVar("BUILDINFODEST", "${IMGDEPLOYDIR}/") + d.setVar("IMAGE_BUILDINFO_FILE", "${IMAGE_NAME}.buildinfo") + bb.build.exec_func("buildinfo", d) +} +do_image[postfuncs] += "create_symlinks" +do_image[subimages] += "buildinfo" + python buildinfo_sdk () { d.setVar("BUILDINFODEST", "${SDK_OUTPUT}/${SDKPATH}") d.setVar("IMAGE_BUILDINFO_FILE", d.getVar("SDK_BUILDINFO_FILE")) bb.build.exec_func("buildinfo", d) } -IMAGE_PREPROCESS_COMMAND += "buildinfo_image" +IMAGE_PREPROCESS_COMMAND += "buildinfo_image ${@oe.utils.vartrue('IMAGE_BUILDINFO_DEPLOY', 'buildinfo_deploy', '', d)}" POPULATE_SDK_PRE_TARGET_COMMAND += "buildinfo_sdk"