summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2022-08-31 13:13:55 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-01 10:07:02 +0100
commit8791c77a4098d62080ecad09d94718eccd7f1a47 (patch)
tree6a4b91e6870edf93dd4f5a47cc9f6b9668b201c5
parent4ab7125180127e22e3a781676abeaabed0822baf (diff)
downloadpoky-8791c77a4098d62080ecad09d94718eccd7f1a47.tar.gz
scripts/oe-setup-builddir: add a check that TEMPLATECONF is valid
specifically that ../../layer.conf exists, and that second-from-last component in the path is 'templates'. This requires tweaking template.conf creation in eSDK bbclass, as we need to ensure that the path in it is valid, and exists (which may not be the case if the SDK is poky-based). (From OE-Core rev: c6f2b57be8893ee58f20cc29d8ec3a5a6edf7c07) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-recipe/populate_sdk_ext.bbclass3
-rwxr-xr-xscripts/oe-setup-builddir5
2 files changed, 7 insertions, 1 deletions
diff --git a/meta/classes-recipe/populate_sdk_ext.bbclass b/meta/classes-recipe/populate_sdk_ext.bbclass
index 56e24c4eed..925cb313fc 100644
--- a/meta/classes-recipe/populate_sdk_ext.bbclass
+++ b/meta/classes-recipe/populate_sdk_ext.bbclass
@@ -438,7 +438,8 @@ python copy_buildsystem () {
438 else: 438 else:
439 # Write a templateconf.cfg 439 # Write a templateconf.cfg
440 with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f: 440 with open(baseoutpath + '/conf/templateconf.cfg', 'w') as f:
441 f.write('meta/conf\n') 441 f.write('meta/conf/templates/default\n')
442 os.makedirs(os.path.join(baseoutpath, core_meta_subdir, 'conf/templates/default'), exist_ok=True)
442 443
443 # Ensure any variables set from the external environment (by way of 444 # Ensure any variables set from the external environment (by way of
444 # BB_ENV_PASSTHROUGH_ADDITIONS) are set in the SDK's configuration 445 # BB_ENV_PASSTHROUGH_ADDITIONS) are set in the SDK's configuration
diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index 5d644168cb..bf832ee0ca 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -61,6 +61,11 @@ if [ -n "$TEMPLATECONF" ]; then
61 echo >&2 "Error: TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'" 61 echo >&2 "Error: TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'"
62 exit 1 62 exit 1
63 fi 63 fi
64 templatesdir=$(python3 -c "import sys; print(sys.argv[1].strip('/').split('/')[-2])" $TEMPLATECONF)
65 if [ ! -f "$TEMPLATECONF/../../layer.conf" -o $templatesdir != "templates" ]; then
66 echo >&2 "Error: TEMPLATECONF value (which is $TEMPLATECONF) must point to meta-some-layer/conf/templates/template-name"
67 exit 1
68 fi
64 fi 69 fi
65 OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample" 70 OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
66 OECORELOCALCONF="$TEMPLATECONF/local.conf.sample" 71 OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"