summaryrefslogtreecommitdiffstats
path: root/scripts/oe-setup-builddir
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:05:42 +0100
commitc6f2b57be8893ee58f20cc29d8ec3a5a6edf7c07 (patch)
tree1f112c62e13b1ded21ad26bde1ea51f52517cc2e /scripts/oe-setup-builddir
parent214c3dc91ceb1557b62ad3a359c72cfc9b2bf4f0 (diff)
downloadopenembedded-core-c6f2b57be8893ee58f20cc29d8ec3a5a6edf7c07.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). Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-setup-builddir')
-rwxr-xr-xscripts/oe-setup-builddir5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index 975619789a..5b7d92089c 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -61,6 +61,11 @@ if [ -n "$TEMPLATECONF" ]; then
echo >&2 "Error: TEMPLATECONF value points to nonexistent directory '$TEMPLATECONF'"
exit 1
fi
+ templatesdir=$(python3 -c "import sys; print(sys.argv[1].strip('/').split('/')[-2])" $TEMPLATECONF)
+ if [ ! -f "$TEMPLATECONF/../../layer.conf" -o $templatesdir != "templates" ]; then
+ echo >&2 "Error: TEMPLATECONF value (which is $TEMPLATECONF) must point to meta-some-layer/conf/templates/template-name"
+ exit 1
+ fi
fi
OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample"
OECORELOCALCONF="$TEMPLATECONF/local.conf.sample"