populate_sdk_ext: enable custom templateconf.cfg

Do not always override templateconf.cfg content. Add option to use
already existing file.

(From OE-Core rev: e524e49ef22fd69882d5d2d01cd84db790e9cb88)

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Andrej Valek
2020-03-06 16:32:33 +01:00
committed by Richard Purdie
parent a1baa2b51e
commit 75bebb3546

View File

@@ -388,9 +388,13 @@ python copy_buildsystem () {
bb.utils.mkdirhier(os.path.join(baseoutpath, 'cache'))
shutil.copyfile(builddir + '/cache/bb_unihashes.dat', baseoutpath + '/cache/bb_unihashes.dat')
# Write a templateconf.cfg
with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f:
f.write('meta/conf\n')
# Use templateconf.cfg file from builddir if exists
if os.path.exists(builddir + '/conf/templateconf.cfg'):
shutil.copyfile(builddir + '/conf/templateconf.cfg', baseoutpath + '/conf/templateconf.cfg')
else:
# Write a templateconf.cfg
with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f:
f.write('meta/conf\n')
# Ensure any variables set from the external environment (by way of
# BB_ENV_EXTRAWHITE) are set in the SDK's configuration