Skip to contentSkip to conversation

Revision file in images

DISCUSSION Marc Ferland 4 participants 6 messages Oct 12, 2012 – Oct 16, 2012

lore
Share & tools
lore
#0 lore raw

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.

I'd like to easily identify what a target system currently runs.

Regards,

Marc

#1 lore raw
Quoted 6 lines · Marc Ferland

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.

That level of detail no.

Quoted 2 lines

I'd like to easily identify what a target system currently runs.

You can identify it based on the /etc/issue file, which contains the information that you might have set in DISTRO_NAME and DISTRO_VERSION in your distro.

For example from poky.conf
DISTRO_NAME = "Poky 8.0 (Yocto Project 1.3 Reference Distro)" DISTRO_VERSION = "1.3+snapshot-${DATE}"

oe-core alone does not se any default name, but version as follows:
DISTRO_VERSION ??= "oe-core.0"

These go into the issue file via the base_files recipe.

Sau!

Quoted 9 lines

Regards,

Marc
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

#2 lore raw
In reply to Marc Ferland
Quoted 5 lines · Marc Ferland

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.

Quoted 1 line

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
Quoted 1 line

${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.

Cheers,
Anders

Quoted 7 lines

Regards,

Marc
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Signature · 2 lines
Anders Darander
ChargeStorm AB / eStorm AB
#3 lore raw
Quoted 18 lines · Anders Darander
Quoted 5 lines · Marc Ferland

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.

Quoted 1 line

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
Quoted 9 lines
Quoted 1 line

${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; "

Marc

#4 lore raw
Quoted 29 lines · On Monday 15 October 2012 14:55:28 Marc Ferland wrote:
Quoted 20 lines · Anders Darander
Quoted 5 lines · Marc Ferland

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.

Quoted 1 line

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
Quoted 3 lines

${IMAGE_ROOTFS}/etc/build ;\

Quoted 7 lines
             "

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.

Quoted 8 lines

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

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#5 lore raw
In reply to Marc Ferland
Quoted 8 lines · Marc Ferland

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; "

Ah, nice solution!

That might be something to add to my own /etc/build. You can never get too much info if some issues turn up...

/Anders

Signature · 2 lines
Anders Darander
ChargeStorm AB / eStorm AB