From e71fb8f71c09ef93a9d9a543105de0f99f6c64c1 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Wed, 9 Aug 2023 23:24:48 +0200 Subject: [PATCH] utils/docker-run: bind mount .git/objects if needed 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 [yann.morin.1998@free.fr: use newly introduced mountpoints list] Signed-off-by: Yann E. MORIN --- utils/docker-run | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/utils/docker-run b/utils/docker-run index 7b27a9b05c..40027514c5 100755 --- a/utils/docker-run +++ b/utils/docker-run @@ -33,6 +33,14 @@ if [ "${GIT_DIR}" ]; then # path already (in a wordir), then that's a noop. GIT_DIR="$(cd "${MAIN_DIR}"; readlink -e "${GIT_DIR}")" mountpoints+=( "${GIT_DIR}" ) + + # 'repo' stores .git/objects separately. + if [ -L "${GIT_DIR}/objects" ]; then + # GITDIR is already an absolute path, but for symetry + # with the above, keep the same cd+readlink construct. + OBJECTS_DIR="$(cd "${MAIN_DIR}"; readlink -e "${GIT_DIR}/objects")" + mountpoints+=( "${OBJECTS_DIR}" ) + fi fi if [ "${BR2_DL_DIR}" ]; then