Skip to content

Commit

Permalink
envsetup: Specify workdir in container to be OE_BASE
Browse files Browse the repository at this point in the history
setting workdir helps avoid a cd on container start
additionally use $@ for parameters, this lets us pass
all the parameters to bitbake in container instead of
limit of 8 ( even though 8 is big some autobuild tests
can use a lot bigger number e.g. sstate checker scripts in OE AB)

Signed-off-by: Khem Raj <[email protected]>
  • Loading branch information
kraj committed Jan 29, 2020
1 parent 53f3967 commit 0b17295
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,9 @@ dkr() {
if [ -z "$CMD" ]; then
echo "setting dkr action to shell"
CMD="/bin/bash"
else
shift
fi

SSH_AUTH_DIR=~/

unset MAP_DL_DIR
Expand Down Expand Up @@ -502,16 +503,17 @@ dkr() {
-v $SSH_AUTH_DIR:/ssh-agent \
-e SSH_AUTH_SOCK=/ssh-agent \
-e MACHINE=$MACHINE \
-w ${OE_BASE} \
--user $(id -u):$(id -g) \
${DOCKER_REPO} /bin/bash -c "cd $(pwd) && . envsetup.sh && $CMD $2 $3 $4 $5 $6 $7 $8"
${DOCKER_REPO} /bin/bash -c ". envsetup.sh && $CMD $@"
}

bitbake() {
ulimit -n 4096
if [ -z $DOCKER_REPO ] || [ "$DOCKER_REPO" = "none" ]; then
${OE_BASE}/sources/bitbake/bin/bitbake $@
else
dkr "${OE_BASE}/sources/bitbake/bin/bitbake $@"
dkr ${OE_BASE}/sources/bitbake/bin/bitbake $@
fi
}

Expand All @@ -520,7 +522,7 @@ devtool() {
if [ -z $DOCKER_REPO ] || [ "$DOCKER_REPO" = "none" ]; then
${OE_BASE}/sources/openembedded-core/scripts/devtool $@
else
dkr "${OE_BASE}/sources/openembedded-core/scripts/devtool $@"
dkr ${OE_BASE}/sources/openembedded-core/scripts/devtool $@
fi
}

Expand Down

0 comments on commit 0b17295

Please sign in to comment.