utils/docker-run: also mount current working directory

Currently, using utils/docker-run expects that the current working
directory is the working copy. This means that it is not possible
to use docker-run with an out-of-tree build (one using O=).

Add the current working directory to the list of mountpoints, and
use that as working directory in the container.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Yann E. MORIN 2023-08-09 23:24:49 +02:00
parent e71fb8f71c
commit db777eef13

View File

@ -17,10 +17,13 @@ declare -a docker_opts=(
-i
--rm
--user "$(id -u):$(id -g)"
--workdir "${MAIN_DIR}"
--workdir "$(pwd)"
)
declare -a mountpoints=( "${MAIN_DIR}" )
declare -a mountpoints=(
"${MAIN_DIR}"
"$(pwd)"
)
# Empty GIT_DIR means that we are not in a workdir, *and* git is too old
# to know about worktrees, so we're not in a worktree either. So it means