Skip to content

Commit bfaaba1

Browse files
authored
Merge pull request #1 from Azure/master
Merge Azure/sonic-buildimage
2 parents c29def6 + 95452b7 commit bfaaba1

2,394 files changed

Lines changed: 377282 additions & 55376 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.

.gitignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,91 @@ fs.*
88
target/
99
*.deb
1010
*.changes
11+
*.buildinfo
12+
*.tar
13+
*.xz
14+
*.gz
15+
*-dbg
16+
*dbg.j2
17+
*.img
1118

1219
# Subdirectories in src
20+
src/bash/*
21+
!src/bash/Makefile
22+
src/ixgbe/*
23+
!src/ixgbe/Makefile
24+
src/isc-dhcp/*
25+
!src/isc-dhcp/Makefile
26+
!src/isc-dhcp/patch
27+
src/socat/*
28+
!src/socat/Makefile
29+
!src/socat/*.patch
30+
src/tacacs/*
31+
src/tacacs/nsm/*
32+
src/tacacs/pam/*
33+
!src/tacacs/nsm/Makefile
34+
!src/tacacs/nsm/*.patch
35+
!src/tacacs/pam/Makefile
36+
!src/tacacs/pam/*.patch
1337
src/hiredis/*
1438
!src/hiredis/Makefile
1539
src/igb/*
1640
!src/igb/Makefile
1741
src/initramfs-tools/*
1842
!src/initramfs-tools/Makefile
43+
src/iproute2/*
44+
!src/iproute2/Makefile
1945
src/isc-dhcp/*
2046
!src/isc-dhcp/Makefile
2147
!src/isc-dhcp/patch/
2248
src/libnl3/*
2349
!src/libnl3/Makefile
2450
src/libteam/*
2551
!src/libteam/Makefile
52+
src/libyang/*
53+
!src/libyang/Makefile
2654
src/lldpd/*
2755
!src/lldpd/Makefile
2856
!src/lldpd/patch/
57+
src/lm-sensors/*
58+
!src/lm-sensors/Makefile
2959
src/mpdecimal/*
3060
!src/mpdecimal/Makefile
61+
src/python-click/*
62+
!src/python-click/Makefile
3163
src/python3/*
3264
!src/python3/Makefile
65+
src/radvd/*
66+
!src/radvd/Makefile
67+
!src/radvd/patch/
3368
src/redis/*
3469
!src/redis/Makefile
70+
src/smartmontools/*
71+
!src/smartmontools/Makefile
3572
src/snmpd/*
3673
!src/snmpd/Makefile
3774
src/sonic-device-data/src/device/
3875
src/sonic-device-data/src/debian/
3976
src/supervisor/*
4077
!src/supervisor/Makefile
4178
!src/supervisor/patch/
79+
src/swig/*
80+
!src/swig/Makefile
81+
src/telemetry/debian/*
82+
!src/telemetry/debian/changelog
83+
!src/telemetry/debian/compat
84+
!src/telemetry/debian/control
85+
!src/telemetry/debian/rules
86+
!src/telemetry/debian/telemetry.init.d
4287
src/thrift/*
88+
!src/thrift/patch/
4389
!src/thrift/Makefile
4490

4591
# Autogenerated Dockerfiles
4692
dockers/docker-base/Dockerfile
93+
dockers/docker-base-stretch/Dockerfile
4794
dockers/docker-config-engine/Dockerfile
95+
dockers/docker-config-engine-stretch/Dockerfile
4896
dockers/docker-database/Dockerfile
4997
dockers/docker-dhcp-relay/Dockerfile
5098
dockers/docker-fpm-frr/Dockerfile
@@ -58,6 +106,7 @@ dockers/docker-snmp-sv2/Dockerfile
58106
dockers/docker-teamd/Dockerfile
59107
dockers/docker-sonic-mgmt/Dockerfile
60108
dockers/docker-sonic-telemetry/Dockerfile
109+
platform/*/docker-saiserver-*/Dockerfile
61110
platform/*/docker-syncd-*/Dockerfile
62111
platform/*/docker-syncd-*-rpc/Dockerfile
63112
platform/vs/docker-sonic-vs/Dockerfile
@@ -69,3 +118,10 @@ installer/x86_64/platforms/
69118
src/sonic-config-engine/**/*.pyc
70119
src/sonic-config-engine/build
71120
src/sonic-config-engine/sonic_config_engine.egg-info
121+
src/sonic-daemon-base/**/*.pyc
122+
src/sonic-daemon-base/build
123+
src/sonic-daemon-base/sonic_daemon_base.egg-info
124+
125+
# Misc. files
126+
files/initramfs-tools/arista-convertfs
127+
files/initramfs-tools/union-mount

.gitmodules

100755100644
Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,45 +35,34 @@
3535
[submodule "src/sonic-utilities"]
3636
path = src/sonic-utilities
3737
url = https://github.com/Azure/sonic-utilities
38-
[submodule "platform/broadcom/sonic-platform-modules-s6000"]
39-
path = platform/broadcom/sonic-platform-modules-s6000
40-
url = https://github.com/Azure/sonic-platform-modules-s6000
4138
[submodule "platform/broadcom/sonic-platform-modules-arista"]
4239
path = platform/broadcom/sonic-platform-modules-arista
4340
url = https://github.com/aristanetworks/sonic
44-
[submodule "platform/broadcom/sonic-platform-modules-dell"]
45-
path = platform/broadcom/sonic-platform-modules-dell
46-
url = https://github.com/Azure/sonic-platform-modules-dell
47-
[submodule "platform/broadcom/sonic-platform-modules-ingrasys"]
48-
path = platform/broadcom/sonic-platform-modules-ingrasys
49-
url = https://github.com/Ingrasys-sonic/sonic-platform-modules-ingrasys
5041
[submodule "src/sonic-platform-common"]
5142
path = src/sonic-platform-common
5243
url = https://github.com/Azure/sonic-platform-common
5344
[submodule "src/sonic-platform-daemons"]
5445
path = src/sonic-platform-daemons
5546
url = https://github.com/Azure/sonic-platform-daemons
56-
[submodule "platform/broadcom/sonic-platform-modules-accton"]
57-
path = platform/broadcom/sonic-platform-modules-accton
58-
url = https://github.com/edge-core/sonic-platform-modules-accton.git
59-
[submodule "platform/broadcom/sonic-platform-modules-cel"]
60-
path = platform/broadcom/sonic-platform-modules-cel
61-
url = https://github.com/celestica-Inc/sonic-platform-modules-cel.git
6247
[submodule "src/sonic-frr/frr"]
6348
path = src/sonic-frr/frr
64-
url = https://github.com/FRRouting/frr.git
49+
url = https://github.com/Azure/sonic-frr.git
50+
branch = frr/7.0
6551
[submodule "platform/p4/p4-hlir/p4-hlir-v1.1"]
6652
path = platform/p4/p4-hlir/p4-hlir-v1.1
6753
url = https://github.com/p4lang/p4-hlir.git
6854
[submodule "platform/p4/SAI-P4-BM"]
6955
path = platform/p4/SAI-P4-BM
7056
url = https://github.com/Mellanox/SAI-P4-BM.git
71-
[submodule "platform/nephos/sonic-platform-modules-ingrasys"]
72-
path = platform/nephos/sonic-platform-modules-ingrasys
73-
url = https://github.com/Ingrasys-sonic/sonic-platform-modules-ingrasys-nephos.git
74-
[submodule "platform/broadcom/sonic-platform-modules-quanta"]
75-
path = platform/broadcom/sonic-platform-modules-quanta
76-
url = https://github.com/QuantaSwitchONIE/sonic-platform-modules-quanta.git
77-
[submodule "platform/broadcom/sonic-platform-modules-mitac"]
78-
path = platform/broadcom/sonic-platform-modules-mitac
79-
url = https://github.com/MiTAC-EBU/sonic-platform-modules-mitac.git
57+
[submodule "platform/barefoot/sonic-platform-modules-arista"]
58+
path = platform/barefoot/sonic-platform-modules-arista
59+
url = https://github.com/aristanetworks/sonic
60+
[submodule "platform/mellanox/hw-management/hw-mgmt"]
61+
path = platform/mellanox/hw-management/hw-mgmt
62+
url = https://github.com/Mellanox/hw-mgmt/
63+
[submodule "src/redis-dump-load"]
64+
path = src/redis-dump-load
65+
url = https://github.com/p/redis-dump-load.git
66+
[submodule "platform/mellanox/mlnx-sai/SAI-Implementation"]
67+
path = platform/mellanox/mlnx-sai/SAI-Implementation
68+
url = https://github.com/Mellanox/SAI-Implementation

Makefile

Lines changed: 14 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,125 +1,20 @@
1-
###############################################################################
2-
## Wrapper for starting make inside sonic-slave container
3-
#
4-
# Supported parameters:
5-
#
6-
# * PLATFORM: Specific platform we wish to build images for.
7-
# * BUILD_NUMBER: Desired version-number to pass to the building-system.
8-
# * ENABLE_DHCP_GRAPH_SERVICE: Enables get-graph service to fetch minigraph files
9-
# through http.
10-
# * SHUTDOWN_BGP_ON_START: Sets admin-down state for all bgp peerings after restart.
11-
# * ENABLE_PFCWD_ON_START: Enable PFC Watchdog (PFCWD) on server-facing ports
12-
# * by default for TOR switch.
13-
# * SONIC_ENABLE_SYNCD_RPC: Enables rpc-based syncd builds.
14-
# * USERNAME: Desired username -- default at rules/config
15-
# * PASSWORD: Desired password -- default at rules/config
16-
# * KEEP_SLAVE_ON: Keeps slave container up after building-process concludes.
17-
# * SOURCE_FOLDER: host path to be mount as /var/$(USER)/src, only effective when KEEP_SLAVE_ON=yes
18-
# * SONIC_BUILD_JOB: Specifying number of concurrent build job(s) to run
19-
#
20-
###############################################################################
1+
# SONiC make file
212

22-
SHELL = /bin/bash
23-
24-
USER := $(shell id -un)
25-
PWD := $(shell pwd)
26-
27-
# Remove lock file in case previous run was forcefully stopped
28-
$(shell rm -f .screen)
29-
30-
MAKEFLAGS += -B
31-
32-
SLAVE_BASE_TAG = $(shell sha1sum sonic-slave/Dockerfile | awk '{print substr($$1,0,11);}')
33-
SLAVE_TAG = $(shell cat sonic-slave/Dockerfile.user sonic-slave/Dockerfile | sha1sum | awk '{print substr($$1,0,11);}')
34-
SLAVE_BASE_IMAGE = sonic-slave-base
35-
SLAVE_IMAGE = sonic-slave-$(USER)
36-
37-
DOCKER_RUN := docker run --rm=true --privileged \
38-
-v $(PWD):/sonic \
39-
-w /sonic \
40-
-e "http_proxy=$(http_proxy)" \
41-
-e "https_proxy=$(https_proxy)" \
42-
-i$(if $(TERM),t,)
43-
44-
DOCKER_BASE_BUILD = docker build --no-cache \
45-
-t $(SLAVE_BASE_IMAGE) \
46-
--build-arg http_proxy=$(http_proxy) \
47-
--build-arg https_proxy=$(https_proxy) \
48-
sonic-slave && \
49-
docker tag $(SLAVE_BASE_IMAGE):latest $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG)
50-
51-
DOCKER_BUILD = docker build --no-cache \
52-
--build-arg user=$(USER) \
53-
--build-arg uid=$(shell id -u) \
54-
--build-arg guid=$(shell id -g) \
55-
--build-arg hostname=$(shell echo $$HOSTNAME) \
56-
-t $(SLAVE_IMAGE) \
57-
-f sonic-slave/Dockerfile.user \
58-
sonic-slave && \
59-
docker tag $(SLAVE_IMAGE):latest $(SLAVE_IMAGE):$(SLAVE_TAG)
60-
61-
SONIC_BUILD_INSTRUCTION := make \
62-
-f slave.mk \
63-
PLATFORM=$(PLATFORM) \
64-
BUILD_NUMBER=$(BUILD_NUMBER) \
65-
ENABLE_DHCP_GRAPH_SERVICE=$(ENABLE_DHCP_GRAPH_SERVICE) \
66-
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
67-
SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \
68-
ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \
69-
PASSWORD=$(PASSWORD) \
70-
USERNAME=$(USERNAME) \
71-
SONIC_BUILD_JOBS=$(SONIC_BUILD_JOBS) \
72-
HTTP_PROXY=$(http_proxy) \
73-
HTTPS_PROXY=$(https_proxy) \
74-
ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY)
75-
76-
.PHONY: sonic-slave-build sonic-slave-bash init reset
77-
78-
.DEFAULT_GOAL := all
3+
NOJESSIE ?= 0
794

805
%::
81-
@docker inspect --type image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) &> /dev/null || \
82-
{ echo Image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) not found. Building... ; \
83-
$(DOCKER_BASE_BUILD) ; }
84-
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
85-
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
86-
$(DOCKER_BUILD) ; }
87-
ifeq "$(KEEP_SLAVE_ON)" "yes"
88-
ifdef SOURCE_FOLDER
89-
@$(DOCKER_RUN) -v $(SOURCE_FOLDER):/var/$(USER)/src $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_BUILD_INSTRUCTION) $@; /bin/bash"
90-
else
91-
@$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) bash -c "$(SONIC_BUILD_INSTRUCTION) $@; /bin/bash"
92-
endif
93-
else
94-
@$(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) $(SONIC_BUILD_INSTRUCTION) $@
6+
@echo "+++ --- Making $@ --- +++"
7+
ifeq ($(NOJESSIE), 0)
8+
EXTRA_JESSIE_TARGETS=$(notdir $@) make -f Makefile.work jessie
959
endif
10+
BLDENV=stretch make -f Makefile.work $@
9611

97-
sonic-slave-build :
98-
$(DOCKER_BASE_BUILD)
99-
$(DOCKER_BUILD)
100-
101-
sonic-slave-bash :
102-
@docker inspect --type image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) &> /dev/null || \
103-
{ echo Image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) not found. Building... ; \
104-
$(DOCKER_BASE_BUILD) ; }
105-
@docker inspect --type image $(SLAVE_IMAGE):$(SLAVE_TAG) &> /dev/null || \
106-
{ echo Image $(SLAVE_IMAGE):$(SLAVE_TAG) not found. Building... ; \
107-
$(DOCKER_BUILD) ; }
108-
@$(DOCKER_RUN) -t $(SLAVE_IMAGE):$(SLAVE_TAG) bash
109-
110-
init :
111-
@git submodule update --init --recursive
112-
@git submodule foreach --recursive '[ -f .git ] && echo "gitdir: $$(realpath --relative-to=. $$(cut -d" " -f2 .git))" > .git'
12+
jessie:
13+
@echo "+++ Making $@ +++"
14+
ifeq ($(NOJESSIE), 0)
15+
make -f Makefile.work jessie
16+
endif
11317

114-
reset :
115-
@echo && echo -n "Warning! All local changes will be lost. Proceed? [y/N]: "
116-
@read ans && \
117-
if [ $$ans == y ]; then \
118-
git clean -xfdf; \
119-
git reset --hard; \
120-
git submodule foreach --recursive git clean -xfdf; \
121-
git submodule foreach --recursive git reset --hard; \
122-
git submodule update --init --recursive;\
123-
else \
124-
echo "Reset aborted"; \
125-
fi
18+
clean reset init configure showtag sonic-slave-build sonic-slave-bash :
19+
@echo "+++ Making $@ +++"
20+
BLDENV=stretch make -f Makefile.work $@

0 commit comments

Comments
 (0)