[Buildroot] [PATCH 4/5] utils/docker-run: also mount current working directory

Yann E. MORIN yann.morin.1998 at free.fr
Wed Aug 9 21:24:49 UTC 2023


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 at free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 utils/docker-run | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/utils/docker-run b/utils/docker-run
index ff903b96e9..83938f8a7a 100755
--- a/utils/docker-run
+++ b/utils/docker-run
@@ -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
-- 
2.25.1




More information about the buildroot mailing list