summaryrefslogtreecommitdiff
path: root/meta-phosphor/recipes-core
diff options
context:
space:
mode:
authorJoseph Reynolds <jrey@us.ibm.com>2018-12-06 01:49:22 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-01-22 18:31:05 +0300
commit268247af93df10b1a7609b77aebdd4d0190e994c (patch)
tree0d9997b7aea698c3c5071469e817c3b933576721 /meta-phosphor/recipes-core
parent12dc3541f914a41cc6ae9fb6abcbf85f85b663a0 (diff)
downloadopenbmc-268247af93df10b1a7609b77aebdd4d0190e994c.tar.xz
Add OPENBMC_TARGET_MACHINE to /etc/os-release
This adds a new OS identification parameter (OPENBMC_TARGET_MACHINE) to the /etc/os-release file in the generated OpenBMC image to indicate the kind of device the OpenBMC image is targeted to control. This is needed to be able to track the image back to its source code: the distro and version indicate the exact source code that was used, and the target machine says which Bitbake layer configuration within that source was used. Note the target machine name is typically set in the openbmc/meta-*/meta-MACHINE/conf/local.conf.sample file. (This is where TEMPLATECONF points to.) The "uname" command options -m (machine) and -i (hardware platform) will continue to refer to the BMC and not its target machine. Tested: On the build system, `cat $IMAGE_ROOTFS/etc/os-release` shows the correct value. (From meta-phosphor rev: e9319a8c4b7bc9b737fbb6e5359f878d5ab13e7a) Change-Id: I29483ef4a72ae80c30399c795177ed446456740d Signed-off-by: Joseph Reynolds <jrey@us.ibm.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-phosphor/recipes-core')
-rw-r--r--meta-phosphor/recipes-core/os-release/os-release.bbappend6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta-phosphor/recipes-core/os-release/os-release.bbappend b/meta-phosphor/recipes-core/os-release/os-release.bbappend
index 77249fc50..c01014643 100644
--- a/meta-phosphor/recipes-core/os-release/os-release.bbappend
+++ b/meta-phosphor/recipes-core/os-release/os-release.bbappend
@@ -24,9 +24,13 @@ python() {
build_id = run_git(d, 'describe --abbrev=0')
if build_id:
d.setVar('BUILD_ID', build_id)
+
+ target_machine = d.getVar('MACHINE', True)
+ if target_machine:
+ d.setVar('OPENBMC_TARGET_MACHINE', target_machine)
}
-OS_RELEASE_FIELDS_append = " BUILD_ID"
+OS_RELEASE_FIELDS_append = " BUILD_ID OPENBMC_TARGET_MACHINE"
# Ensure the git commands run every time bitbake is invoked.
BB_DONT_CACHE = "1"