[PATCH openbmc] Add git version information to os-release

OpenBMC Patches openbmc-patches at stwcx.xyz
Thu Nov 12 06:20:19 AEDT 2015


From: Brad Bishop <bradleyb at us.ibm.com>

VERSION_ID = `git tag`
BUILD_ID = `git describe --dirty`
---
 meta-phosphor/common/recipes-core/os-release/os-release.bbappend | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 meta-phosphor/common/recipes-core/os-release/os-release.bbappend

diff --git a/meta-phosphor/common/recipes-core/os-release/os-release.bbappend b/meta-phosphor/common/recipes-core/os-release/os-release.bbappend
new file mode 100644
index 0000000..1692af1
--- /dev/null
+++ b/meta-phosphor/common/recipes-core/os-release/os-release.bbappend
@@ -0,0 +1,8 @@
+def git_describe(d):
+        return bb.process.run("git describe --dirty")[0]
+def git_tag(d):
+        return bb.process.run("git tag")[0]
+
+VERSION_ID = "${@git_tag(d)}"
+BUILD_ID = "${@git_describe(d)}"
+OS_RELEASE_FIELDS_append = " BUILD_ID"
-- 
2.6.3




More information about the openbmc mailing list