Skip to content

Commit

Permalink
Merge pull request #3 from Azure/master
Browse files Browse the repository at this point in the history
Pull from Azure
  • Loading branch information
noaOrMlnx authored Mar 3, 2020
2 parents 952dfb1 + 41ae7a2 commit e8ece0f
Show file tree
Hide file tree
Showing 534 changed files with 39,109 additions and 2,918 deletions.
27 changes: 3 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,30 +109,9 @@ src/thrift/*
!src/thrift/Makefile

# Autogenerated Dockerfiles
sonic-slave/Dockerfile
sonic-slave-stretch/Dockerfile
sonic-slave-jessie/Dockerfile
dockers/docker-base/Dockerfile
dockers/docker-base-stretch/Dockerfile
dockers/docker-config-engine/Dockerfile
dockers/docker-config-engine-stretch/Dockerfile
dockers/docker-database/Dockerfile
dockers/docker-dhcp-relay/Dockerfile
dockers/docker-fpm-frr/Dockerfile
dockers/docker-fpm-gobgp/Dockerfile
dockers/docker-fpm-quagga/Dockerfile
dockers/docker-lldp-sv2/Dockerfile
dockers/docker-orchagent/Dockerfile
dockers/docker-platform-monitor/Dockerfile
dockers/docker-router-advertiser/Dockerfile
dockers/docker-snmp-sv2/Dockerfile
dockers/docker-teamd/Dockerfile
dockers/docker-sonic-mgmt/Dockerfile
dockers/docker-sonic-telemetry/Dockerfile
platform/*/docker-saiserver-*/Dockerfile
platform/*/docker-syncd-*/Dockerfile
platform/*/docker-syncd-*-rpc/Dockerfile
platform/vs/docker-sonic-vs/Dockerfile
sonic-slave*/Dockerfile
dockers/*/Dockerfile
platform/*/docker-*/Dockerfile

# Installer-related files and directories
installer/x86_64/platforms/
Expand Down
17 changes: 11 additions & 6 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,16 @@ ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64))
DOCKER_SERVICE_SAFE_KILLER := (MARCH_PID=`ps -eo pid,cmd | grep "[0-9] dockerd.*march" | awk '{print $$1}'`; echo "Killing march docker $$MARCH_PID"; [ -z "$$MARCH_PID" ] || sudo kill -9 "$$MARCH_PID";)
DOCKER_SERVICE_MULTIARCH_CHECK := ($(DOCKER_SERVICE_SAFE_KILLER); sudo rm -fr /var/run/march/; (echo "Starting docker march service..."; sudo $(SONIC_NATIVE_DOCKERD_FOR_MUTLIARCH) &) &>/dev/null ; sleep 2; sudo $(SONIC_USERFACL_DOCKERD_FOR_MUTLIARCH);)

# Docker service to load the compiled dockers-*.gz
SONIC_NATIVE_DOCKERD_FOR_DOCKERFS := rm -fr $(PWD)/dockerfs/; mkdir -p $(PWD)/dockerfs/; sudo dockerd --storage-driver=overlay2 --iptables=false \
--data-root $(PWD)/dockerfs/var/lib/docker/ --exec-root=$(PWD)/dockerfs/var/run/docker/ \
-H unix://$(PWD)/dockerfs/var/run/docker.sock -p $(PWD)/dockerfs/var/run/docker.pid &
SONIC_USERFACL_DOCKERD_FOR_DOCKERFS := setfacl -m user:$(USER):rw $(PWD)/dockerfs/var/run/docker.sock
DOCKER_SERVICE_DOCKERFS_CHECK := (sudo docker -H unix://$(PWD)/dockerfs/var/run/docker.sock info &> /dev/null && sudo kill -9 `sudo cat $(PWD)/dockerfs/var/run/docker.pid` && false) || (echo "Starting docker build service..."; (sudo $(SONIC_NATIVE_DOCKERD_FOR_DOCKERFS) ) &>/dev/null ; sleep 1; sudo $(SONIC_USERFACL_DOCKERD_FOR_DOCKERFS);)
# Docker service to load the compiled dockers-*.gz
# docker 19.0 version above has path/length restriction, so replaced it with soft link in /tmp/
# Also dockerd does mkdir on the provided softlink, so used two level path "d/d"
D_ROOT=/tmp/d/d
SONIC_NATIVE_DOCKERD_FOR_DOCKERFS := rm -fr $(PWD)/dockerfs; mkdir -p $(PWD)/dockerfs; sudo rm -fr /tmp/d; mkdir -p /tmp/d; ln -s -f $(PWD)/dockerfs $(D_ROOT); \
sudo dockerd --storage-driver=overlay2 --iptables=false \
--data-root $(D_ROOT)/var/lib/docker/ --exec-root=$(D_ROOT)/var/run/docker/ \
-H unix://$(D_ROOT)/var/run/docker.sock -p $(D_ROOT)/var/run/docker.pid &
SONIC_USERFACL_DOCKERD_FOR_DOCKERFS := setfacl -m user:$(USER):rw $(D_ROOT)/var/run/docker.sock
DOCKER_SERVICE_DOCKERFS_CHECK := (sudo docker -H unix://$(D_ROOT)/var/run/docker.sock info &> /dev/null && sudo kill -9 `sudo cat $(D_ROOT)/var/run/docker.pid` && false) || (echo "Starting docker build service..."; (sudo $(SONIC_NATIVE_DOCKERD_FOR_DOCKERFS) ) &> /tmp/dockerfs.log ; sleep 1; sudo $(SONIC_USERFACL_DOCKERD_FOR_DOCKERFS);)

endif

Expand Down Expand Up @@ -177,6 +181,7 @@ SONIC_BUILD_INSTRUCTION := make \
HTTP_PROXY=$(http_proxy) \
HTTPS_PROXY=$(https_proxy) \
SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) \
SONIC_ENABLE_RESTAPI=$(ENABLE_RESTAPI) \
EXTRA_JESSIE_TARGETS=$(EXTRA_JESSIE_TARGETS) \
$(SONIC_OVERRIDE_BUILD_VARS)

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ Nephos: [![Nephos](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/j
P4: [![P4](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/buildimage-p4-all/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/buildimage-p4-all)
VS: [![VS](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-all/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-all)

*201904*:
Broadcom: [![Broadcom](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201904/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201904/)
Mellanox: [![Mellanox](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-201904/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-201904/)
*201911*:
Innovium: [![Innovium](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201911/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201911/)
Broadcom: [![Broadcom](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201911/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201911/)
Mellanox: [![Mellanox](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-201911/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-201911/)
VS: [![VS](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-201911/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-201911)

*201811*:
Innovium: [![Innovium](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201811/badge/icon)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201811/)
Expand Down
37 changes: 34 additions & 3 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then
else
DOCKER_VERSION=5:18.09.8~3-0~debian-stretch
fi
LINUX_KERNEL_VERSION=4.9.0-9-2
LINUX_KERNEL_VERSION=4.9.0-11-2

## Working directory to prepare the file system
FILESYSTEM_ROOT=./fsroot
Expand Down Expand Up @@ -139,7 +139,9 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/initramfs-tools_*.deb || \
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/linux-image-${LINUX_KERNEL_VERSION}-*_${CONFIGURED_ARCH}.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install acl
[[ $CONFIGURED_ARCH == amd64 ]] && sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install dmidecode
if [[ $CONFIGURED_ARCH == amd64 ]]; then
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install dmidecode hdparm
fi

## Update initramfs for booting with squashfs+overlay
cat files/initramfs-tools/modules | sudo tee -a $FILESYSTEM_ROOT/etc/initramfs-tools/modules > /dev/null
Expand Down Expand Up @@ -176,6 +178,11 @@ sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/varlog
sudo cp files/initramfs-tools/union-fsck $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/union-fsck
pushd $FILESYSTEM_ROOT/usr/share/initramfs-tools/scripts/init-bottom && sudo patch -p1 < $OLDPWD/files/initramfs-tools/udev.patch; popd
if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then
sudo cp files/initramfs-tools/uboot-utils $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/uboot-utils
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/hooks/uboot-utils
cat files/initramfs-tools/modules.arm | sudo tee -a $FILESYSTEM_ROOT/etc/initramfs-tools/modules > /dev/null
fi

if [[ $CONFIGURED_ARCH == amd64 ]]; then
## Install latest intel ixgbe driver
Expand Down Expand Up @@ -272,7 +279,8 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
cgroup-tools \
ipmitool \
ndisc6 \
makedumpfile
makedumpfile \
conntrack


if [[ $CONFIGURED_ARCH == amd64 ]]; then
Expand Down Expand Up @@ -374,6 +382,12 @@ set /files/etc/sysctl.conf/net.ipv4.conf.all.arp_ignore 2
set /files/etc/sysctl.conf/net.ipv4.neigh.default.base_reachable_time_ms 1800000
set /files/etc/sysctl.conf/net.ipv6.neigh.default.base_reachable_time_ms 1800000
set /files/etc/sysctl.conf/net.ipv4.neigh.default.gc_thresh1 1024
set /files/etc/sysctl.conf/net.ipv6.neigh.default.gc_thresh1 1024
set /files/etc/sysctl.conf/net.ipv4.neigh.default.gc_thresh2 2048
set /files/etc/sysctl.conf/net.ipv6.neigh.default.gc_thresh2 2048
set /files/etc/sysctl.conf/net.ipv4.neigh.default.gc_thresh3 4096
set /files/etc/sysctl.conf/net.ipv6.neigh.default.gc_thresh3 4096
set /files/etc/sysctl.conf/net.ipv6.conf.default.forwarding 1
set /files/etc/sysctl.conf/net.ipv6.conf.all.forwarding 1
Expand Down Expand Up @@ -494,8 +508,25 @@ fi
## Remove gcc and python dev pkgs
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y remove gcc libpython2.7-dev

## Add mtd and uboot firmware tools package
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install u-boot-tools mtd-utils device-tree-compiler
sudo LANG=C chroot $FILESYSTEM_ROOT apt-mark manual u-boot-tools mtd-utils device-tree-compiler

## Update initramfs
sudo chroot $FILESYSTEM_ROOT update-initramfs -u
## Convert initrd image to u-boot format
if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then
INITRD_FILE=initrd.img-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH}
if [[ $CONFIGURED_ARCH == armhf ]]; then
INITRD_FILE=initrd.img-${LINUX_KERNEL_VERSION}-armmp
sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -A arm -O linux -T ramdisk -C gzip -d /boot/$INITRD_FILE /boot/u${INITRD_FILE}
## Overwriting the initrd image with uInitrd
sudo LANG=C chroot $FILESYSTEM_ROOT mv /boot/u${INITRD_FILE} /boot/$INITRD_FILE
elif [[ $CONFIGURED_ARCH == arm64 ]]; then
sudo cp -v $PLATFORM_DIR/${sonic_asic_platform}-${CONFIGURED_ARCH}/sonic_fit.its $FILESYSTEM_ROOT/boot/
sudo LANG=C chroot $FILESYSTEM_ROOT mkimage -f /boot/sonic_fit.its /boot/sonic_${CONFIGURED_ARCH}.fit
fi
fi

## Clean up apt
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y autoremove
Expand Down
2 changes: 1 addition & 1 deletion build_debug_docker_j2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ debs/{{ deb }}{{' '}}
{% if $3 is defined %}
{% if $3|length %}
RUN apt-get install -f -y \
RUN apt-get update && apt-get install -f -y \
{% for dbg in $3.split(' ') -%}
{{ dbg }}{{' '}}
{%- endfor %}
Expand Down
11 changes: 5 additions & 6 deletions device/accton/x86_64-accton_as4630_54pe-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,15 @@ def get_presence(self, port_num):
present_path = self.BASE_CPLD_PATH + "module_present_" + str(port_num)
self.__port_to_is_present = present_path

content="0"
try:
val_file = open(self.__port_to_is_present)
content = val_file.readline().rstrip()
val_file.close()
except IOError as e:
print "Error: unable to open file: %s" % str(e)
print "Error: unable to access file: %s" % str(e)
return False

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand Down
22 changes: 10 additions & 12 deletions device/accton/x86_64-accton_as5712_54x-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,15 @@ def get_presence(self, port_num):
present_path = present_path + "module_present_" + str(port_num)
self.__port_to_is_present = present_path

content="0"
try:
val_file = open(self.__port_to_is_present)
content = val_file.readline().rstrip()
val_file.close()
except IOError as e:
print "Error: unable to open file: %s" % str(e)
print "Error: unable to access file: %s" % str(e)
return False

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand All @@ -175,16 +174,15 @@ def get_low_power_mode_cpld(self, port_num):
q = self.qsfp_sb_remap(port_num)
lp_mode_path = lp_mode_path + str(q)

content="0"
try:
val_file = open(lp_mode_path)
content = val_file.readline().rstrip()
val_file.close()
except IOError as e:
print "Error: unable to open file: %s" % str(e)
print "Error: unable to access file: %s" % str(e)
return False

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand Down
20 changes: 9 additions & 11 deletions device/accton/x86_64-accton_as5812_54t-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,15 @@ def get_presence(self, port_num):
present_path = present_path + "module_present_" + str(port_num)
self.__port_to_is_present = present_path

content="0"
try:
val_file = open(self.__port_to_is_present)
content = val_file.readline().rstrip()
val_file.close()
except IOError as e:
print "Error: unable to open file: %s" % str(e)
print "Error: unable to access file: %s" % str(e)
return False

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand All @@ -129,16 +128,15 @@ def get_low_power_mode_cpld(self, port_num):
lp_mode_path = lp_mode_path + "module_lp_mode_"
lp_mode_path = lp_mode_path + str(port_num)

content="0"
try:
val_file = open(lp_mode_path)
content = val_file.readline().rstrip()
val_file.close()
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand Down
20 changes: 9 additions & 11 deletions device/accton/x86_64-accton_as5812_54x-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,15 @@ def get_presence(self, port_num):
present_path = present_path + "module_present_" + str(port_num)
self.__port_to_is_present = present_path

content="0"
try:
val_file = open(self.__port_to_is_present)
content = val_file.readline().rstrip()
val_file.close()
except IOError as e:
print "Error: unable to open file: %s" % str(e)
print "Error: unable to access file: %s" % str(e)
return False

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand All @@ -189,16 +188,15 @@ def get_low_power_mode_cpld(self, port_num):
q = self.qsfp_sb_remap(port_num)
lp_mode_path = lp_mode_path + str(q)

content = "0"
try:
val_file = open(lp_mode_path)
content = val_file.readline().rstrip()
val_file.close()
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand Down
14 changes: 6 additions & 8 deletions device/accton/x86_64-accton_as5835_54t-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,15 @@ def get_presence(self, port_num):
path = "/sys/bus/i2c/devices/3-0062/module_present_{0}"
port_ps = path.format(cage_num)

content="0"
try:
val_file = open(port_ps)
content = val_file.readline().rstrip()
val_file.close()
except IOError as e:
print "Error: unable to open file: %s" % str(e)
print "Error: unable to access file: %s" % str(e)
return False

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand All @@ -131,8 +130,7 @@ def get_low_power_mode_cpld(self, port_num):

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand Down
14 changes: 6 additions & 8 deletions device/accton/x86_64-accton_as5835_54x-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,15 @@ def get_presence(self, port_num):
path = "/sys/bus/i2c/devices/{0}/module_present_{1}"
port_ps = path.format(cpld_ps, cage_num)

content = "0"
try:
val_file = open(port_ps)
content = val_file.readline().rstrip()
val_file.close()
except IOError as e:
print "Error: unable to open file: %s" % str(e)
print "Error: unable to access file: %s" % str(e)
return False

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand All @@ -201,8 +200,7 @@ def get_low_power_mode_cpld(self, port_num):

content = val_file.readline().rstrip()
val_file.close()

# content is a string, either "0" or "1"

if content == "1":
return True

Expand Down
Loading

0 comments on commit e8ece0f

Please sign in to comment.