build-setup: Inject environments to local.conf
Add ENV_LOCAL_CONF so that the environment could be injected into local.conf
of the openbmc build.
Typically the ENV_LOCAL_CONF could be defined as a variable containing
key=value with newlines, e.g.
export ENV_LOCAL_CONF="key1=\"${value1}\"
key2=\"${value2}\""
So that the below texts are appended into local.conf for the build:
key1="value1"
key2="value2"
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I4cffece334b8257e3a82a5fae7cf3813d1f489eb
diff --git a/build-setup.sh b/build-setup.sh
index 932f232..2d63f12 100755
--- a/build-setup.sh
+++ b/build-setup.sh
@@ -15,9 +15,12 @@
# Default: "~/{RandomNumber}"
# num_cpu Number of cpu's to give bitbake, default is total amount
# in system
-# UBUNTU_MIRROR: <optional, the URL of a mirror of Ubuntu to override the
-# default ones in /etc/apt/sources.list>
+# UBUNTU_MIRROR [optional] The URL of a mirror of Ubuntu to override the
+# default ones in /etc/apt/sources.list
# default is empty, and no mirror is used.
+# ENV_LOCAL_CONF [optional] The environment variables to inject into the
+# build, which will be written into local.conf.
+# default is empty.
#
# Docker Image Build Variables:
# BITBAKE_OPTS Set to "-c populate_sdk" or whatever other BitBake options
@@ -81,6 +84,7 @@
WORKSPACE=${WORKSPACE:-${HOME}/${RANDOM}${RANDOM}}
num_cpu=${num_cpu:-$(nproc)}
UBUNTU_MIRROR=${UBUNTU_MIRROR:-""}
+ENV_LOCAL_CONF=${ENV_LOCAL_CONF:-""}
# Docker Image Build Variables:
build_dir=${build_dir:-${WORKSPACE}/build}
@@ -409,6 +413,7 @@
USER_CLASSES += "buildstats"
INHERIT_remove = "uninative"
TMPDIR="${build_dir}"
+${ENV_LOCAL_CONF}
EOF_CONF
# Kick off a build