summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2022-09-28 10:56:35 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-29 21:15:50 +0100
commit569d4cd3257ec26c63489d2b016bfac83a5fa244 (patch)
tree865c0f074e9b4e27dc3aa963496bfac4d5d5d065
parente14a481661ba3db39fa9bb97902e0014c700f0b4 (diff)
downloadpoky-569d4cd3257ec26c63489d2b016bfac83a5fa244.tar.gz
scripts/oe-setup-builddir: do not read TEMPLATECONF from templateconf.cfg
Also, write to it only if it does not already exist. As discussed here[1], reading from templateconf.cfg serves no purpose: it exists only if the build directory has already been initialized, and so the scripts will not change anything in the build directory anyway. My adjustment is to keep the file however; it is useful as a pointer to the original template, which can be utilized by config management tools in the future. [1] https://lists.openembedded.org/g/openembedded-architecture/topic/template_handling_in_oe_core/93968540 (From OE-Core rev: bcfaeb8ed503ce1a5add3ec882f0e0c3bccfd3d2) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/oe-setup-builddir14
1 files changed, 3 insertions, 11 deletions
diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir
index e3c8c6d437..a13860c7d9 100755
--- a/scripts/oe-setup-builddir
+++ b/scripts/oe-setup-builddir
@@ -34,16 +34,6 @@ chmod -st "$BUILDDIR/conf" 2>/dev/null || echo "WARNING: unable to chmod $BUILDD
34 34
35cd "$BUILDDIR" || die "Failed to change directory to $BUILDDIR!" 35cd "$BUILDDIR" || die "Failed to change directory to $BUILDDIR!"
36 36
37if [ -z "$TEMPLATECONF" ] && [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then
38 TEMPLATECONF=$(cat "$BUILDDIR/conf/templateconf.cfg")
39 # The following two are no longer valid; unsetting them will automatically get them replaced
40 # with correct ones.
41 if [ "$TEMPLATECONF" = meta/conf ] || [ "$TEMPLATECONF" = meta-poky/conf ]; then
42 unset TEMPLATECONF
43 rm "$BUILDDIR/conf/templateconf.cfg"
44 fi
45fi
46
47. "$OEROOT/.templateconf" 37. "$OEROOT/.templateconf"
48 38
49# Keep the original TEMPLATECONF before possibly prefixing it with $OEROOT below. 39# Keep the original TEMPLATECONF before possibly prefixing it with $OEROOT below.
@@ -132,4 +122,6 @@ fi
132[ ! -r "$OECORENOTESCONF" ] || cat "$OECORENOTESCONF" 122[ ! -r "$OECORENOTESCONF" ] || cat "$OECORENOTESCONF"
133unset OECORENOTESCONF 123unset OECORENOTESCONF
134 124
135echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg" 125if [ ! -f "$BUILDDIR/conf/templateconf.cfg" ]; then
126 echo "$ORG_TEMPLATECONF" >"$BUILDDIR/conf/templateconf.cfg"
127fi