[OE-core] [PATCH] buildinfo: Added buildinfo recipe
Alejandro Hernandez
alejandro.hernandez at linux.intel.com
Fri Oct 10 18:29:11 UTC 2014
Writes build information to target filesystem to help developers
[YOCTO #6770]
Signed-off-by: Alejandro Hernandez <alejandro.hernandez at linux.intel.com>
---
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
diff --git a/meta/recipes-extended/buildinfo/buildinfo_0.1.bb b/meta/recipes-extended/buildinfo/buildinfo_0.1.bb
new file mode 100644
index 0000000..b299efb
--- /dev/null
+++ b/meta/recipes-extended/buildinfo/buildinfo_0.1.bb
@@ -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}
+}
--
1.9.1
More information about the Openembedded-core
mailing list