From patchwork Mon Sep 28 08:14:32 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagenknecht X-Patchwork-Id: 99455 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 D6BDFC9833E for ; Mon, 28 Sep 2026 08:14:51 +0000 (UTC) Received: from mx1.emlix.com (mx1.emlix.com [178.63.209.131]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.53656.1790583284587311865 for ; Mon, 28 Sep 2026 01:14:45 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@emlix.com header.s=20250930 header.b=fcD6yfKj; dkim=fail reason="dkim: body hash did not verify" header.i=@emlix.com header.s=20250930 header.b=fcD6yfKj; 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=1790583282; bh=T3KZDvzvhrzewlumSpOyKu3b44ROqf7woJ6Jc2sBRyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fcD6yfKjyjZA/hSSuYGrcRkjtczBFjQ+iyzppdwZYbiVCTSOtqK2NQCrTQPZpabMx RzUp4Rss/R2jE972R9tQd00EC7mMZdRKHi3tpgYXovp455Roc3Re1BvOG484GmSv4c RCauemSnLIsqOp1qQrNvvT9i1vIgXFvFMpkja5DP7avA8lGJ+LWBoBPOuk3ziqPEpJ l0JKmqS1fHAZKjudsTz8bk/WOyDWg469IQk01oMcQ6ksQAISwQ92tWYKK7g7MGeSTm 9QBgq4EDcCY5yOvBY6PtTd/U3p9XGbnSvQnE1UR/W6U4DEZtN/s50oODujg0UeC/tj j9j2hT5vlZYLg== Received: from mx1.emlix.com (localhost [127.0.0.1]) by mx1.emlix.com (Postfix) with ESMTP id 13FD55F838; Mon, 28 Sep 2026 10:14:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emlix.com; s=20250930; t=1790583282; bh=T3KZDvzvhrzewlumSpOyKu3b44ROqf7woJ6Jc2sBRyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fcD6yfKjyjZA/hSSuYGrcRkjtczBFjQ+iyzppdwZYbiVCTSOtqK2NQCrTQPZpabMx RzUp4Rss/R2jE972R9tQd00EC7mMZdRKHi3tpgYXovp455Roc3Re1BvOG484GmSv4c RCauemSnLIsqOp1qQrNvvT9i1vIgXFvFMpkja5DP7avA8lGJ+LWBoBPOuk3ziqPEpJ l0JKmqS1fHAZKjudsTz8bk/WOyDWg469IQk01oMcQ6ksQAISwQ92tWYKK7g7MGeSTm 9QBgq4EDcCY5yOvBY6PtTd/U3p9XGbnSvQnE1UR/W6U4DEZtN/s50oODujg0UeC/tj j9j2hT5vlZYLg== 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 F3A6C5F7C7; Mon, 28 Sep 2026 10:14:41 +0200 (CEST) From: Daniel Wagenknecht To: openembedded-core@lists.openembedded.org, alex.kanavin@gmail.com, paul@pbarker.dev Cc: Daniel Wagenknecht Subject: [PATCH v3] classes: image-buildinfo: deploy the buildinfo file Date: Mon, 28 Sep 2026 10:14:32 +0200 Message-ID: <20260928081434.975338-1-dwagenknecht@emlix.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <18D5B8D11CEFBF2A.668921@lists.openembedded.org> References: 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, 28 Sep 2026 08:14:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/246739 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. 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 --- v2: * rebased * copy generated file instead of regenerating it * add varflags only if needed v3: * rebased * deploy unconditionally as suggested by alex.kanavin@gmail.com meta/classes/image-buildinfo.bbclass | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/meta/classes/image-buildinfo.bbclass b/meta/classes/image-buildinfo.bbclass index 01636dac6..d44e15443 100644 --- a/meta/classes/image-buildinfo.bbclass +++ b/meta/classes/image-buildinfo.bbclass @@ -70,12 +70,21 @@ python buildinfo_image () { bb.build.exec_func("buildinfo", d) } +python buildinfo_deploy() { + src = d.expand("${IMAGE_ROOTFS}/${IMAGE_BUILDINFO_FILE}") + dst = d.expand("${IMGDEPLOYDIR}/${IMAGE_NAME}.buildinfo") + oe.path.copyhardlink(src, dst) +} +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 buildinfo_deploy" POPULATE_SDK_PRE_TARGET_COMMAND += "buildinfo_sdk"