Bug 6770

Summary: Improve storing build information in images
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Phlip Balister <philip>
Component: deploymentAssignee: Alejandro Hernandez <alejandro.hernandez>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: bluelightning, doug.geiger, kergoth, sgw
Version: unspecified   
Target Milestone: 1.8   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)
Attachments:
Description Flags
build_info.inc none

Description Phlip Balister 2014-09-26 17:08:33 UTC
Currently images contain a file /etc/version in the image that contains a timestamp.

root@ettus-e300:/etc/init.d# cat /etc/version
201409231521

It would be helpful to have a standard way of documenting what layers, versions of layers, bitbake versions, etc were used to create the image. From a brief discussion on the list, it seems like there are several ad hoc solutions floating around. It would be nice to have a standard way of doing this for people that need to be able to work backwards from the image to what it was built with.
Comment 1 Christopher Larson 2014-09-26 17:42:54 UTC
I'd definitely be interesting in steps in this direction. Having a way to identify the rootfs in some way would definitely be useful. I'd be interested in capturing not just layer information but *configuration* as well.
Comment 2 Doug 2014-09-26 17:54:17 UTC
Created attachment 2145 [details]
build_info.inc

I've attached a build_info.inc that I have used on some of my images to include a build timestamp, and layer names/version info in /etc/build
Comment 3 Doug 2014-09-26 18:10:36 UTC
(In reply to comment #2)
> Created attachment 2145 [details]
> build_info.inc

Credit: Marc Ferland posted a similar set of commands in 2012: https://lists.yoctoproject.org/pipermail/yocto/2012-October/010136.html
Comment 4 Alejandro Hernandez 2014-10-14 20:29:23 UTC
Ok, so I'll be implementing this as an IMAGE_FEATURE, and this is what I'm trying to achieve:

/etc/build:

-----------------------
Build Configuration:  |
-----------------------
DISTRO = poky
DISTRO_VERSION = 1.7
BB_VERSION = 1.24.0
BUILD_SYS = x86_64-linux
TARGET_SYS = x86_64-poky-linux
MACHINE = qemux86-64
USER_CLASSES = buildstats image-mklibs image-prelink
IMAGE_CLASSES = image_types
IMAGE_FEATURES = debug-tweaks buildinfo
IMAGE_LINGUAS = 
IMAGE_INSTALL = packagegroup-core-boot run-postinsts
PACKAGE_EXCLUDE = 
-----------------------
Layer Revisions:      |
-----------------------
meta              = hsalejandro/6770:ccf5a4d2342c4fd40e4e0b332ea7e34e0bf175d4
meta-yocto        = hsalejandro/6770:ccf5a4d2342c4fd40e4e0b332ea7e34e0bf175d4
meta-yocto-bsp    = hsalejandro/6770:ccf5a4d2342c4fd40e4e0b332ea7e34e0bf175d4
Comment 5 Phlip Balister 2014-10-29 10:36:52 UTC
A couple of questions:

1) Have you thought about adding the build hostname?
2) Will the layer info show if the build machine has un-committed changes?
Comment 6 Alejandro Hernandez 2014-10-29 18:29:10 UTC
1 - No, I hand't thought of that, but it'd be relatively easy to add its variable to the function.
2 - The layer info would show the latest commit checksum
Comment 7 Phlip Balister 2014-10-29 20:22:44 UTC
It would be good to show if the git repos are clean or dirty. One of the things we are worried about is knowing if the build had uncommitted work.
Comment 8 Saul Wold 2014-10-29 21:21:11 UTC
I would agree with the git dirty vs clean additional information, but I would be concerned about the possibility of information leakage including the build hostname