@@ -226,9 +226,13 @@ do_unpack[postfuncs] += "create_source_date_epoch_stamp"
def get_source_date_epoch_value(d):
return oe.reproducible.epochfile_read(d.getVar('SDE_FILE'), d)
+def get_bitbake_branch_rev(d):
+ revisions = oe.buildcfg.get_bitbake_revision()
+ return oe.buildcfg.get_branch_rev3(revisions)
+
def get_layers_branch_rev(d):
revisions = oe.buildcfg.get_layer_revisions(d)
- layers_branch_rev = ["%-20s = \"%s:%s\"" % (r[1], r[2], r[3]) for r in revisions]
+ layers_branch_rev = oe.buildcfg.get_branch_rev3(revisions)
i = len(layers_branch_rev)-1
p1 = layers_branch_rev[i].find("=")
s1 = layers_branch_rev[i][p1:]
@@ -241,11 +245,11 @@ def get_layers_branch_rev(d):
else:
i -= 1
p1 = layers_branch_rev[i].find("=")
- s1= layers_branch_rev[i][p1:]
+ s1 = layers_branch_rev[i][p1:]
return layers_branch_rev
-BUILDCFG_FUNCS ??= "buildcfg_vars get_layers_branch_rev buildcfg_neededvars"
+BUILDCFG_FUNCS ??= "buildcfg_vars get_bitbake_branch_rev get_layers_branch_rev buildcfg_neededvars"
BUILDCFG_FUNCS[type] = "list"
def buildcfg_vars(d):
@@ -764,8 +764,9 @@ def buildhistory_get_build_id(d):
def buildhistory_get_metadata_revs(d):
# We want an easily machine-readable format here
- revisions = oe.buildcfg.get_layer_revisions(d)
- medadata_revs = ["%-17s = %s:%s%s" % (r[1], r[2], r[3], r[4]) for r in revisions]
+ revisions = oe.buildcfg.get_bitbake_revision()
+ revisions.extend(oe.buildcfg.get_layer_revisions(d))
+ medadata_revs = oe.buildcfg.get_branch_rev4(revisions)
return '\n'.join(medadata_revs)
def outputvars(vars, listvars, d):
@@ -27,11 +27,14 @@ def image_buildinfo_outputvars(vars, d):
ret += "%s = %s\n" % (var, value)
return ret.rstrip('\n')
+def get_bitbake_rev(d):
+ revision = oe.buildcfg.get_bitbake_revision()
+ return '\n'.join(oe.buildcfg.get_branch_rev4(revision))
+
# Returns layer revisions along with their respective status
def get_layer_revs(d):
revisions = oe.buildcfg.get_layer_revisions(d)
- medadata_revs = ["%-17s = %s:%s%s" % (r[1], r[2], r[3], r[4]) for r in revisions]
- return '\n'.join(medadata_revs)
+ return '\n'.join(oe.buildcfg.get_branch_rev4(revisions))
def buildinfo_target(d):
# Get context
@@ -55,6 +58,12 @@ Build Configuration: |
buildinfo_target(d),
'''
-----------------------
+Bitbake Revision: |
+-----------------------
+''',
+ get_bitbake_rev(d),
+ '''
+-----------------------
Layer Revisions: |
-----------------------
''',
@@ -71,6 +71,19 @@ def is_layer_modified(path):
# output and a 129 return code when a layer isn't a git repo at all.
return " -- modified"
+def get_branch_rev3(revisions):
+ # Return 3 items for each revision
+ return ["%-20s = \"%s:%s\"" % (r[1], r[2], r[3]) for r in revisions]
+
+def get_branch_rev4(revisions):
+ # Return 4 items for each revision
+ return ["%-17s = %s:%s%s" % (r[1], r[2], r[3], r[4]) for r in revisions]
+
+def get_bitbake_revision():
+ bbdir = bb.__file__.rsplit('/', 3)[0]
+ return [(bbdir, os.path.basename(bbdir), get_metadata_git_branch(bbdir).strip(), \
+ get_metadata_git_revision(bbdir), is_layer_modified(bbdir))]
+
def get_layer_revisions(d):
layers = (d.getVar("BBLAYERS") or "").split()
revisions = []