[build] capture 2 initialization git commands in 'make init' target (#1074)

This commit is contained in:
Ying Xie 2017-10-24 19:49:37 -07:00 committed by GitHub
parent d7d6f3044f
commit 41f226f0dc
2 changed files with 10 additions and 9 deletions

View File

@ -60,7 +60,7 @@ SONIC_BUILD_INSTRUCTION := make \
PASSWORD=$(PASSWORD) \ PASSWORD=$(PASSWORD) \
USERNAME=$(USERNAME) USERNAME=$(USERNAME)
.PHONY: sonic-slave-build sonic-slave-bash .PHONY: sonic-slave-build sonic-slave-bash init
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
@ -89,3 +89,7 @@ sonic-slave-bash :
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \ { echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
$(DOCKER_BUILD) ; } $(DOCKER_BUILD) ; }
@$(DOCKER_RUN) -t $(SLAVE_IMAGE):$(SLAVE_TAG) bash @$(DOCKER_RUN) -t $(SLAVE_IMAGE):$(SLAVE_TAG) bash
init :
git submodule update --init --recursive
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $$(realpath --relative-to=. $$(cut -d" " -f2 .git))" > .git'

View File

@ -25,19 +25,16 @@ To clone the code repository recursively, assuming git version 1.9 or newer:
git clone --recursive https://github.com/Azure/sonic-buildimage.git git clone --recursive https://github.com/Azure/sonic-buildimage.git
NOTE: If the repo has already been cloned, however there are no files under the submodule directories (e.g., src/lldpd, src/ptf, src/sonic-linux-kernel, etc.), you can manually fetch all the git submodules as follows:
git submodule update --init --recursive
You also need to change all git paths to relative path as we build all submodules inside the docker:
git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $(realpath --relative-to=. $(cut -d" " -f2 .git))" > .git'
## Usage ## Usage
To build SONiC installer image and docker images, run the following commands: To build SONiC installer image and docker images, run the following commands:
# Execute make init once after cloning the repo, or fetched remote repo with submodule updates
make init
# Execute make configure once to configure ASIC
make configure PLATFORM=[ASIC_VENDOR] make configure PLATFORM=[ASIC_VENDOR]
make make
**NOTE**: We recommend reserving 50G free space to build one platform. **NOTE**: We recommend reserving 50G free space to build one platform.