
This attempts to separate the bits we *require* to run bitbake with oe-core via the wrapper script, and which are independent of the build environment (PSEUDO_DISABLED, PSEUDO_BUILD, BBFETCH2) from those which are more particular to poky-init-build-env's way of setting things up (e.g. adding MACHINE to BB_ENV_EXTRAWHITE, relying on OEROOT, etc). This should make it easier to use scripts/bitbake with non-standard workflows. (From OE-Core rev: 7f9d6efcaf019eb046c8aa00735f823e3dbc8712) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
1.7 KiB
Executable File
#!/bin/sh
export BBFETCH2=True export BB_ENV_EXTRAWHITE="PSEUDO_BUILD PSEUDO_DISABLED $BB_ENV_EXTRAWHITE"
NO_BUILD_OPTS="--version -h --help -p --parse-only -s --show-versions -e --environment -g --graphviz" needpseudo="1" for opt in $@; do for key in $NO_BUILD_OPTS; do if [ $opt = $key ] then needpseudo="0" break fi done [ $needpseudo = "0" ] && break done
buildpseudo="1"
if [ $needpseudo = "1" ] && [ -e "$BUILDDIR/pseudodone" ]; then
PSEUDOBINDIR=cat $BUILDDIR/pseudodone
if [ -e "$PSEUDOBINDIR/pseudo" -a -e "$PSEUDOBINDIR/tar" ]; then
buildpseudo="0"
fi
fi
if [ $needpseudo = "0" ]; then
buildpseudo="0"
fi
OLDPATH=$PATH
export PATH=echo $PATH | sed s#[^:]*/scripts:##
if [ $buildpseudo = "1" ]; then
echo "Pseudo is not present but is required, building this first before the main build"
export PSEUDO_BUILD=1
bitbake pseudo-native tar-replacement-native -c populate_sysroot
ret=$?
if [ "$ret" != "0" ]; then
exit 1
fi
PSEUDOBINDIR=bitbake -e | grep STAGING_BINDIR_NATIVE=\" | cut -d '=' -f2 | cut -d '"' -f2
ret=$?
if [ "$ret" != "0" ]; then
exit 1
fi
echo $PSEUDOBINDIR > $BUILDDIR/pseudodone
# This needs to exist in case pseudo has to log somewhere
mkdir -p $PSEUDOBINDIR/../../var/pseudo
fi
BITBAKE=which bitbake
export PATH=$OLDPATH
if [ $needpseudo = "1" ]; then
export PSEUDO_BUILD=2
PSEUDOBINDIR=cat $BUILDDIR/pseudodone
PSEUDO_BINDIR=$PSEUDOBINDIR PSEUDO_LIBDIR=$PSEUDOBINDIR/../lib/pseudo/lib PSEUDO_PREFIX=$PSEUDOBINDIR/../../ PSEUDO_DISABLED=1 $PSEUDOBINDIR/pseudo $BITBAKE $@
else
export PSEUDO_BUILD=0
$BITBAKE $@
fi
ret=$?
exit $ret