build-setup: Pass MACHINE variable to bitbake
There's no need to manually overwrite the local.conf file with a
MACHINE value that is different to the default. This variable can
be made available to bitbake using export commands.
Reference: https://github.com/openbmc/docs/commit/d5afde3325b0622a2e9d19f41192a88321145014
Tested: Verified the MACHINE variable was exported for the
qemux86-64 target:
- Before:
++ unset OEROOT
++ '[' -z /home/ubuntu/175744354/openbmc/build ']'
++ cd /home/ubuntu/175744354/openbmc/build
+ [[ -n qemux86-64 ]]
+ sed 's/^MACHINE\ ??=.*/MACHINE\ ??=\ "qemux86-64"/' -i conf/local.conf
+ cat
+ bitbake obmc-phosphor-image obmc-phosphor-debug-tarball
- After:
++ unset OEROOT
++ '[' -z /home/ubuntu/1669429605/openbmc/build ']'
++ cd /home/ubuntu/1669429605/openbmc/build
+ [[ -n qemux86-64 ]]
+ export MACHINE=qemux86-64
+ MACHINE=qemux86-64
+ export 'BB_ENV_EXTRAWHITE= MACHINE'
+ BB_ENV_EXTRAWHITE=' MACHINE'
+ cat
+ bitbake obmc-phosphor-image obmc-phosphor-debug-tarball
Change-Id: I2c30a6d48f801d1a9ea9a218ba5f20ec2565819e
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/build-setup.sh b/build-setup.sh
index 3b54d14..b119185 100755
--- a/build-setup.sh
+++ b/build-setup.sh
@@ -311,9 +311,9 @@
# Source our build env
${BITBAKE_CMD}
-# Change MACHINE name when given for build target
+# Export MACHINE name when given for build target
if [[ -n "${MACHINE}" ]]; then
- sed "s/^MACHINE\ ??=.*/MACHINE\ ??=\ \"${MACHINE}\"/" -i conf/local.conf
+ export MACHINE="${MACHINE}"; export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE MACHINE"
fi
# Custom BitBake config settings