[yocto] Revision file in images

Paul Eggleton paul.eggleton at linux.intel.com
Mon Oct 15 12:28:35 PDT 2012


On Monday 15 October 2012 14:55:28 Marc Ferland wrote:
> Anders Darander <anders at chargestorm.se> writes:
> > * Marc Ferland <ferlandm at sonatest.com> [121012 17:40]:
> >> Hi,
> >> 
> >> Is a revision file populated in the images produced by the build process?
> >> Something listing the revisions of the different layers used. Just like
> >> the "OE Build Configuration" summary.
> > 
> > As Saul wrote, I don't know any way of getting this info.
> > 
> >> I'd like to easily identify what a target system currently runs.
> > 
> > In my own project, I'm using something like:
> > 
> > 
> > IMAGE_PREPROCESS_COMMAND += "rootfs_update_timestamp ;\
> > 
> >              git describe --dirty --long --always
> >>
> >>${IMAGE_ROOTFS}/etc/build ;\
> >>
> >              "
> > 
> > This doesn't explicitly put the SHA1's of the included layers into the
> > rootfs, but it does put my the most recent tag from my top-layer,
> > together with the number of commits after that tag, and an abreviated
> > version of the current commits SHA1 into the file /etc/build. This will
> > give me all info I need.
> 
> FYI, I was able to put the SHA1 of each meta data layer by doing:
> 
> def print_layers_version(d):
> 	layertext = "Configured metadata layers:\n%s\n" %
> '\n'.join(get_layers_branch_rev(d)) return layertext
> 
> IMAGE_PREPROCESS_COMMAND += "echo "${@print_layers_version(d)}" > /
> ${IMAGE_ROOTFS}/etc/build; "

I was going to say earlier I'm planning on adding something like this to OE-
Core for 1.4.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list