Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Boichat via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Nicolas Boichat <drinkcat@google.com>,
	Ricardo Martincoski <ricardo.martincoski@datacom.com.br>
Subject: [Buildroot] [PATCH 1/1] utils/docker-run: Bind mount .git/objects if needed
Date: Tue,  8 Aug 2023 04:40:41 +0000	[thread overview]
Message-ID: <20230808044047.4065708-1-drinkcat@google.com> (raw)

If buildroot is checked out as part of a 'repo' manifest,
docker-run doesn't fully bind mount the .git directory, leading to
commands such as `utils/docker-run make check-package` to fail.

Signed-off-by: Nicolas Boichat <drinkcat@google.com>
---
 utils/docker-run | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/utils/docker-run b/utils/docker-run
index ab95e61e84..6a58db6d9f 100755
--- a/utils/docker-run
+++ b/utils/docker-run
@@ -32,6 +32,12 @@ if [ "${GIT_DIR}" ]; then
     # path already (in a wordir), then that's a noop.
     GIT_DIR="$(cd "${MAIN_DIR}"; readlink -e "${GIT_DIR}")"
     docker_opts+=( --mount "type=bind,src=${GIT_DIR},dst=${GIT_DIR}" )
+
+    # 'repo' stores .git/objects separately.
+    if [ -L "${GIT_DIR}/objects" ]; then
+        OBJECTS_DIR="$(readlink -e "${GIT_DIR}/objects")"
+        docker_opts+=( --mount "type=bind,src=${OBJECTS_DIR},dst=${OBJECTS_DIR}" )
+    fi
 fi
 
 if tty -s; then
-- 
2.41.0.640.ga95def55d0-goog

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

             reply	other threads:[~2023-08-08  4:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  4:40 Nicolas Boichat via buildroot [this message]
2023-08-09 21:30 ` [Buildroot] [PATCH 1/1] utils/docker-run: Bind mount .git/objects if needed Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230808044047.4065708-1-drinkcat@google.com \
    --to=buildroot@buildroot.org \
    --cc=drinkcat@google.com \
    --cc=ricardo.martincoski@datacom.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox