On Mon, 2026-04-20 at 19:43 +0200, Daniel Wagenknecht via
lists.openembedded.org wrote:
> 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 <[email protected]>
> ---
> 
> 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.

Hi Daniel,

Thanks for the patch. Sending patches separately for openembedded-core
and yocto-docs is correct.

>  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)
> +}

Rather than conditionally adding a new pre-process command which re-runs
the buildinfo function, can we conditionally copy the file to
${IMGDEPLOYDIR} after it is created in buildinfo_image?

> +do_image[postfuncs] += "create_symlinks"
> +do_image[subimages] += "buildinfo"

These two shouldn't be unconditionally added.

Best regards,

-- 
Paul Barker

Attachment: signature.asc
Description: This is a digitally signed message part

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#236728): 
https://lists.openembedded.org/g/openembedded-core/message/236728
Mute This Topic: https://lists.openembedded.org/mt/118924681/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to