Skip to content

Commit

Permalink
[build] capture 2 initialization git commands in 'make init' target (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yxieca committed Oct 25, 2017
1 parent d7d6f30 commit 41f226f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ SONIC_BUILD_INSTRUCTION := make \
PASSWORD=$(PASSWORD) \
USERNAME=$(USERNAME)

.PHONY: sonic-slave-build sonic-slave-bash
.PHONY: sonic-slave-build sonic-slave-bash init

.DEFAULT_GOAL := all

Expand Down Expand Up @@ -89,3 +89,7 @@ sonic-slave-bash :
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
$(DOCKER_BUILD) ; }
@$(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'
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

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

**NOTE**: We recommend reserving 50G free space to build one platform.
Expand Down

0 comments on commit 41f226f

Please sign in to comment.