Skip to content

Commit 271501d

Browse files
authored
Merge pull request #12 from Azure/master
merge with master
2 parents 466d00b + 034f472 commit 271501d

364 files changed

Lines changed: 53683 additions & 44044 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
[submodule "sonic-linux-kernel"]
55
path = src/sonic-linux-kernel
66
url = https://github.com/Azure/sonic-linux-kernel
7-
branch = stretch
87
[submodule "sonic-sairedis"]
98
path = src/sonic-sairedis
109
url = https://github.com/Azure/sonic-sairedis

Makefile.work

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@
1313
# * SONIC_ENABLE_SYNCD_RPC: Enables rpc-based syncd builds.
1414
# * USERNAME: Desired username -- default at rules/config
1515
# * PASSWORD: Desired password -- default at rules/config
16-
# * KEEP_SLAVE_ON: Keeps slave container up after building-process concludes.
16+
# * KEEP_SLAVE_ON: Keeps slave container up and active after building process concludes.
17+
# * Note that rm=true is still set, so once user quits from the docker
18+
# * session, the docker will be removed.
19+
# * Please note that with current Stretch build structure,
20+
# * user of KEEP_SLAVE_ON feature will have to be conscious
21+
# * about which docker to stay inside after build is done.
22+
# * - If user desires to stay inside Stretch docker, please issue
23+
# * make KEEP_SLAVE_ON=yes stretch
24+
# * - If user desires to stay inside Jessie docker, please issue
25+
# * (a successful "make stretch" may be needed before the following command)
26+
# * make NOSTRETCH=1 KEEP_SLAVE_ON=yes <any jessie target>
1727
# * SOURCE_FOLDER: host path to be mount as /var/$(USER)/src, only effective when KEEP_SLAVE_ON=yes
1828
# * SONIC_BUILD_JOBS: Specifying number of concurrent build job(s) to run
1929
# * KERNEL_PROCURE_METHOD: Specifying method of obtaining kernel Debian package: download or build
@@ -48,7 +58,8 @@ SLAVE_IMAGE = sonic-slave-$(USER)
4858
SLAVE_DIR = sonic-slave
4959
endif
5060

51-
INSMOD_OVERLAY := sudo modprobe overlay
61+
OVERLAY_MODULE_CHECK := lsmod | grep "^overlay " > /dev/null 2>&1 || (echo "ERROR: Module 'overlay' not loaded. Try running 'sudo modprobe overlay'."; exit 1)
62+
5263
DOCKER_RUN := docker run --rm=true --privileged \
5364
-v $(PWD):/sonic \
5465
-w /sonic \
@@ -94,13 +105,13 @@ SONIC_BUILD_INSTRUCTION := make \
94105
.DEFAULT_GOAL := all
95106

96107
%::
108+
@$(OVERLAY_MODULE_CHECK)
97109
@docker inspect --type image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) &> /dev/null || \
98110
{ echo Image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) not found. Building... ; \
99111
$(DOCKER_BASE_BUILD) ; }
100112
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
101113
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
102114
$(DOCKER_BUILD) ; }
103-
@$(INSMOD_OVERLAY)
104115
ifeq "$(KEEP_SLAVE_ON)" "yes"
105116
ifdef SOURCE_FOLDER
106117
@$(DOCKER_RUN) -v $(SOURCE_FOLDER):/var/$(USER)/src $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_BUILD_INSTRUCTION) $@; /bin/bash"
@@ -116,13 +127,13 @@ sonic-slave-build :
116127
$(DOCKER_BUILD)
117128

118129
sonic-slave-bash :
130+
@$(OVERLAY_MODULE_CHECK)
119131
@docker inspect --type image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) &> /dev/null || \
120132
{ echo Image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) not found. Building... ; \
121133
$(DOCKER_BASE_BUILD) ; }
122134
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
123135
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
124136
$(DOCKER_BUILD) ; }
125-
@$(INSMOD_OVERLAY)
126137
@$(DOCKER_RUN) -t $(SLAVE_IMAGE):$(SLAVE_TAG) bash
127138

128139
showtag:

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,25 @@ To clone the code repository recursively, assuming git version 1.9 or newer:
4747

4848
To build SONiC installer image and docker images, run the following commands:
4949

50+
# Ensure the 'overlay' module is loaded on your development system
51+
sudo modprobe overlay
52+
53+
# Enter the source directory
5054
cd sonic-buildimage
5155

5256
# (Optional) Checkout a specific branch. By default, it uses master branch
5357
git checkout [branch_name]
5458

55-
# Execute make init once after cloning the repo, or fetched remote repo with submodule updates
59+
# Execute make init once after cloning the repo, or after fetching remote repo with submodule updates
5660
make init
5761

5862
# Execute make configure once to configure ASIC
5963
make configure PLATFORM=[ASIC_VENDOR]
6064

61-
# build debian stretch required targets (optional)
65+
# Build Debian Stretch required targets (Manual execution optional; will also be executed as part of the build)
6266
BLDENV=stretch make stretch
6367

64-
# build SONiC image
68+
# Build SONiC image
6569
make all
6670

6771
**NOTE**:

build_debian.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,14 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
227227
hping3 \
228228
python-scapy \
229229
tcptraceroute \
230-
mtr-tiny
230+
mtr-tiny \
231+
locales
232+
233+
#Adds a locale to a debian system in non-interactive mode
234+
sudo sed -i '/^#.* en_US.* /s/^#//' $FILESYSTEM_ROOT/etc/locale.gen && \
235+
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT locale-gen "en_US.UTF-8"
236+
sudo LANG=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT update-locale "LANG=en_US.UTF-8"
237+
sudo LANG=C chroot $FILESYSTEM_ROOT bash -c "find /usr/share/i18n/locales/ ! -name 'en_US' -type f -exec rm -f {} +"
231238

232239
# Install certain fundamental packages from stretch-backports in order to get
233240
# more up-to-date (but potentially less stable) versions

build_image.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ elif [ "$IMAGE_TYPE" = "aboot" ]; then
9595
zip -g $ABOOT_BOOT_IMAGE .imagehash
9696
rm .imagehash
9797
echo "SWI_VERSION=42.0.0" > version
98-
echo "SWI_MAX_HWEPOCH=1" >> version
98+
echo "SWI_MAX_HWEPOCH=2" >> version
9999
echo "SWI_VARIANT=US" >> version
100100
zip -g $OUTPUT_ABOOT_IMAGE version
101101
zip -g $ABOOT_BOOT_IMAGE version
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Accton-AS5712-54X t1

0 commit comments

Comments
 (0)