]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
image-buildinfo.bbclass: configurable location for build file
authorPatrick Ohly <patrick.ohly@intel.com>
Mon, 20 Mar 2017 12:26:18 +0000 (13:26 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 21 Mar 2017 22:43:03 +0000 (22:43 +0000)
In a stateless image, /etc is not a good place for the "build"
file. By definining the location with a variable it becomes possible
to have the file created elsewhere on a per-image basis. The default
is the same as before.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/image-buildinfo.bbclass

index 85626f0a6864638709c6c2f7013ec563be872319..213fb9cf9b61f7c4111ff3bde97efcdfc6a5f2c9 100644 (file)
@@ -12,6 +12,9 @@
 # Desired variables to display 
 IMAGE_BUILDINFO_VARS ?= "DISTRO DISTRO_VERSION"
 
+# Desired location of the output file in the image.
+IMAGE_BUILDINFO_FILE ??= "${sysconfdir}/build"
+
 # From buildhistory.bbclass
 def image_buildinfo_outputvars(vars, listvars, d): 
     vars = vars.split()
@@ -61,7 +64,7 @@ def buildinfo_target(d):
 
 # Write build information to target filesystem
 python buildinfo () {
-    with open(d.expand('${IMAGE_ROOTFS}${sysconfdir}/build'), 'w') as build:
+    with open(d.expand('${IMAGE_ROOTFS}${IMAGE_BUILDINFO_FILE}'), 'w') as build:
         build.writelines((
             '''-----------------------
 Build Configuration:  |