blob: 0f938c3925c532b60618500e76d735780fced030 [file] [log] [blame]
Brad Bishopba470942017-07-21 22:05:22 -04001# WARNING!
2#
3# These modifications to os-release disable the bitbake parse
4# cache (for the os-release recipe only). Before copying
5# and pasting into another recipe ensure it is understood
6# what that means!
7
Brad Bishop05ce9c52015-11-19 22:06:41 -06008def run_git(d, cmd):
Brad Bishop7019fbe2017-07-21 21:47:44 -04009 try:
10 oeroot = d.getVar('COREBASE', True)
11 return bb.process.run("git --work-tree %s --git-dir %s/.git %s"
12 % (oeroot, oeroot, cmd))[0].strip('\n')
13 except:
14 pass
Brad Bishopbe861802015-11-11 13:56:17 -050015
Patrick Williams46d9de32020-11-17 15:42:09 -060016VERSION_ID := "${@run_git(d, 'describe --dirty --long')}"
17VERSION = "${@'-'.join(d.getVar('VERSION_ID').split('-')[0:2])}"
Brad Bishop05ce9c52015-11-19 22:06:41 -060018
Patrick Williams46d9de32020-11-17 15:42:09 -060019BUILD_ID := "${@run_git(d, 'describe --abbrev=0')}"
20OPENBMC_TARGET_MACHINE = "${MACHINE}"
Brad Bishop05ce9c52015-11-19 22:06:41 -060021
Joseph Reynolds268247a2018-12-05 16:49:22 -060022OS_RELEASE_FIELDS_append = " BUILD_ID OPENBMC_TARGET_MACHINE"
Brad Bishopba470942017-07-21 22:05:22 -040023
24# Ensure the git commands run every time bitbake is invoked.
25BB_DONT_CACHE = "1"
Brad Bishope384d0c2017-07-24 20:24:28 -040026
27# Make os-release available to other recipes.
28SYSROOT_DIRS_append = " ${sysconfdir}"