From e5965c02776dd9942a246f639cf7239fc8333064 Mon Sep 17 00:00:00 2001 From: Wataru Ishida Date: Tue, 30 Oct 2018 13:17:39 -0700 Subject: [PATCH] make: support buildimage to be git submodule Signed-off-by: Wataru Ishida --- Makefile.work | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.work b/Makefile.work index 1809e2b6c0d8..c9d0baf2286b 100644 --- a/Makefile.work +++ b/Makefile.work @@ -63,9 +63,11 @@ OVERLAY_MODULE_CHECK := lsmod | grep "^overlay " > /dev/null 2>&1 || (echo "ERRO BUILD_TIMESTAMP := $(shell date +%Y%m%d\.%H%M%S) +GIT_DIRECTORY := $(shell file .git | grep -q ASCII && awk '{split($$2, ary, ".git"); print ary[1]}' .git | xargs realpath || pwd ) + DOCKER_RUN := docker run --rm=true --privileged \ - -v $(PWD):/sonic \ - -w /sonic \ + -v $(GIT_DIRECTORY):$(GIT_DIRECTORY) \ + -w $(PWD) \ -e "http_proxy=$(http_proxy)" \ -e "https_proxy=$(https_proxy)" \ -i$(if $(TERM),t,)