buildinfo: Added buildinfo recipe
PATCH 1/1 buildinfo: Added buildinfo recipe
Writes build information to target filesystem to help developers
[YOCTO #6770]
--- meta/recipes-extended/buildinfo/buildinfo_0.1.bb | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 meta/recipes-extended/buildinfo/buildinfo_0.1.bb
meta/recipes-extended/buildinfo/buildinfo_0.1.bb new file +34 -0
@@ -0,0 +1,34 @@ +DESCRIPTION = "Writing build information on target filesystem" +SECTION = "MISC" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +PR = "r0" + +inherit buildhistory + +def buildinfo_target(d): + # Get context + if d.getVar('BB_WORKERCONTEXT', True) != '1': + return "" + # Single and list variables to be read + vars = "DISTRO DISTRO_VERSION BB_VERSION BUILD_SYS TARGET_SYS MACHINE USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL PACKAGE_EXCLUDE" + listvars = "USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL PACKAGE_EXCLUDE" + return outputvars(vars, listvars, d) + +do_install() { + # Write info to file + cat > build <<END +----------------------- +Build Configuration: | +----------------------- +${@buildinfo_target(d)} +----------------------- +Layer Revisions: | +----------------------- +${@buildhistory_get_metadata_revs(d)} +END + + # Install file with right permissions + install -d ${D}${sysconfdir} + install -m 0444 build ${D}${sysconfdir} +}
Signature · 1 line
1.9.1
Quoted 16 lines · Alejandro Hernandez
Writes build information to target filesystem to help developers
[YOCTO #6770]
Signed-off-by Alejandro Hernandez <[email protected]>--- meta/recipes-extended/buildinfo/buildinfo_0.1.bb | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 meta/recipes-extended/buildinfo/buildinfo_0.1.bbmeta/recipes-extended/buildinfo/buildinfo_0.1.bb new file +0
-0
meta/recipes-extended/buildinfo/buildinfo_0.1.bb line 2
Quoted 2 lines
meta/recipes-extended/buildinfo/buildinfo_0.1.bb new file +2
-0@@ -0,0 +1,34 @@ +DESCRIPTION = "Writing build information on target filesystem" +SECTION = "MISC"
MISC? I'd use base.
meta/recipes-extended/buildinfo/buildinfo_0.1.bb line 5
Quoted 3 lines
meta/recipes-extended/buildinfo/buildinfo_0.1.bb new file +3
-0+LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +PR = "r0"
Don't set PR please.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
Op 10 okt. 2014, om 20:29 heeft Alejandro Hernandez <[email protected]> het volgende geschreven:
Quoted 16 lines
Writes build information to target filesystem to help developers
[YOCTO #6770]
Signed-off-by Alejandro Hernandez <[email protected]>---
meta/recipes-extended/buildinfo/buildinfo_0.1.bb | 34 ++++++++++++++++++++++++1 file changed, 34 insertions(+)create mode 100644 meta/recipes-extended/buildinfo/buildinfo_0.1.bb
meta/recipes-extended/buildinfo/buildinfo_0.1.bb new file +0
-0
meta/recipes-extended/buildinfo/buildinfo_0.1.bb line 5
Quoted 5 lines
meta/recipes-extended/buildinfo/buildinfo_0.1.bb new file +5
-0@@ -0,0 +1,34 @@ +DESCRIPTION = "Writing build information on target filesystem" +SECTION = "MISC" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" +PR = "r0"
PR isn't used anymore
meta/recipes-extended/buildinfo/buildinfo_0.1.bb line 15
Quoted 10 lines
meta/recipes-extended/buildinfo/buildinfo_0.1.bb new file +10
-0+ +inherit buildhistory + +def buildinfo_target(d): + # Get context + if d.getVar('BB_WORKERCONTEXT', True) != '1': + return "" + # Single and list variables to be read + vars = "DISTRO DISTRO_VERSION BB_VERSION BUILD_SYS TARGET_SYS MACHINE USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL PACKAGE_EXCLUDE" + listvars = "USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL PACKAGE_EXCLUDE"
Don't use IMAGE* vars in package recipes, that breaks the orthogonality of the OE system.
Quoted 1 line · Koen Kooi
Don't use IMAGE* vars in package recipes, that breaks the orthogonality of the OE system.
To expand on what Koen said, you shouldn't use image-specific variables in a package as then the package can't be re-used in multiple images. At best you'll end up rebuilding the package every time an image is created, at worst images will have incorrect buildinfo.
Instead, implement this functionality as an optional image creation postprocess hook.
Ross