Skip to content

Commit

Permalink
Merge pull request #260 from YoeDistro/kraj/master
Browse files Browse the repository at this point in the history
envsetup: Remove additional options to docker run
  • Loading branch information
cbrake authored Jan 29, 2020
2 parents 2a2e81b + 7f74269 commit d55b66c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
26 changes: 13 additions & 13 deletions envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -467,34 +467,33 @@ dkr() {
check_docker || return 1

CMD="$1"
PSEUDOTTY=""

if [ -z "$CMD" ]; then
echo "setting dkr action to shell"
CMD="/bin/bash"
PSEUDOTTY="--tty"
else
shift
fi
if [ "$DOCKER_PSEUDO_TTY" = "no" ]; then
PSEUDO_TTY=""
else
PSEUDO_TTY="-t"
fi

SSH_AUTH_DIR=~/

unset MAP_DL_DIR
unset MAP_TMPDIR
unset MAP_SSTATE_DIR
if [ -n "$CUSTOM_DL_DIR" ]; then
MAP_DL_DIR="-v $CUSTOM_DL_DIR:$CUSTOM_DL_DIR"
fi
if [ -n "$CUSTOM_TMPDIR" ]; then
MAP_TMPDIR="-v $CUSTOM_TMPDIR:$CUSTOM_TMPDIR"
fi
if [ -n "$CUSTOM_SSTATE_DIR" ]; then
MAP_SSTATE_DIR="-v $CUSTOM_SSTATE_DIR:$CUSTOM_SSTATE_DIR"
fi
MAP_TMPDIR="-v $(readlink -f $OE_BUILD_TMPDIR):$(readlink -f $OE_BUILD_TMPDIR)"
MAP_DL_DIR="-v $(readlink -f $OE_DL_DIR):$(readlink -f $OE_DL_DIR)"
MAP_SSTATE_DIR="-v $(readlink -f $OE_SSTATE_DIR):$(readlink -f $OE_SSTATE_DIR)"

if [ -n "$SSH_AUTH_SOCK" ]; then
SSH_AUTH_DIR=$(readlink -f $SSH_AUTH_SOCK)
fi

docker run --rm -i ${PSEUDOTTY} --log-driver=none -a stdin -a stdout -a stderr \
docker run --rm -i $PSEUDO_TTY \
-v $(pwd):$(pwd) \
-v ~/.ssh:/home/build/.ssh \
-v ~/.gitconfig:/home/build/.gitconfig \
Expand All @@ -504,8 +503,9 @@ 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() {
Expand Down
7 changes: 7 additions & 0 deletions local.sh.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@

# configure docker container to run bitbake in
#export DOCKER_REPO=yoedistro/yoe-build:buster

# Flag to control docker launch with pseudo-tty
# when output is piped or redirected to files then
# then docker should be launched without tty
# otherwise it will emit all control characters into
# redirected log files, default is 'yes'
#export DOCKER_PSEUDO_TTY=no

0 comments on commit d55b66c

Please sign in to comment.