Skip to content

Commit

Permalink
image: Use BITBAKEDIR and OEROOT for commands
Browse files Browse the repository at this point in the history
Use the BITBAKEDIR and OEROOT variables to determine where the commands
pyrex should wrap are located. This allows pyrex to correctly wrap
commands bitbake when the directory layout is other than the one used by
poky.
  • Loading branch information
JoshuaWatt committed Dec 9, 2019
1 parent 5225c7b commit 0ac3e34
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions image/capture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@

INIT_PWD=$PWD

# Prevent some variables from being unset so their value can be captured
unset() {
for var in "$@"; do
case "$var" in
BITBAKEDIR) ;;
OEROOT) ;;
*)
builtin unset "$var"
;;
esac
done
}

# Consume all arguments before sourcing the environment script
shift $#

Expand All @@ -24,6 +37,16 @@ if [ $? -ne 0 ]; then
exit 1
fi

if [ -z "$BITBAKEDIR" ]; then
echo "\$BITBAKEDIR not captured!"
exit 1
fi

if [ -z "$OEROOT" ]; then
echo "\$OEROOT not captured!"
exit 1
fi

cat > $PYREX_CAPTURE_DEST <<HEREDOC
{
"tempdir": "$PWD/pyrex",
Expand All @@ -34,11 +57,11 @@ cat > $PYREX_CAPTURE_DEST <<HEREDOC
"shell": "/bin/bash",
"commands": {
"include": [
"$PYREX_OEROOT/bitbake/bin/*",
"$PYREX_OEROOT/scripts/*"
"$BITBAKEDIR/bin/*",
"$OEROOT/scripts/*"
],
"exclude": [
"$PYREX_OEROOT/scripts/runqemu*"
"$OEROOT/scripts/runqemu*"
]
}
},
Expand All @@ -49,7 +72,8 @@ cat > $PYREX_CAPTURE_DEST <<HEREDOC
"BUILDDIR": "$BUILDDIR"
},
"bind": [
"$PYREX_OEROOT"
"$BITBAKEDIR",
"$OEROOT"
]
},
"bypass": {
Expand Down

0 comments on commit 0ac3e34

Please sign in to comment.