Skip to content

Commit

Permalink
Merge pull request #120 from Azure/master
Browse files Browse the repository at this point in the history
merge from Azure master
  • Loading branch information
Alex-Dai authored Oct 11, 2019
2 parents b4a4b26 + 2694e66 commit 459c619
Show file tree
Hide file tree
Showing 359 changed files with 28,485 additions and 4,961 deletions.
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
[submodule "src/sonic-frr/frr"]
path = src/sonic-frr/frr
url = https://github.com/Azure/sonic-frr.git
branch = frr/7.0
branch = frr/7.1
[submodule "platform/p4/p4-hlir/p4-hlir-v1.1"]
path = platform/p4/p4-hlir/p4-hlir-v1.1
url = https://github.com/p4lang/p4-hlir.git
Expand All @@ -66,3 +66,6 @@
[submodule "platform/mellanox/mlnx-sai/SAI-Implementation"]
path = platform/mellanox/mlnx-sai/SAI-Implementation
url = https://github.com/Mellanox/SAI-Implementation
[submodule "Switch-SDK-drivers"]
path = platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers
url = https://github.com/Mellanox/Switch-SDK-drivers
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ endif

clean reset init configure showtag sonic-slave-build sonic-slave-bash :
@echo "+++ Making $@ +++"
ifeq ($(NOJESSIE), 0)
make -f Makefile.work $@
endif
BLDENV=stretch make -f Makefile.work $@
4 changes: 3 additions & 1 deletion Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64))

DOCKER_MULTIARCH_CHECK := docker inspect --type image multiarch/qemu-user-static:register &> /dev/null || (echo "multiarch docker not found ..."; docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes)

DOCKER_SERVICE_MULTIARCH_CHECK := docker -H unix:///var/run/march/docker.sock info &> /dev/null || (echo "Docker march service not running..."; sudo rm -fr /var/run/march/docker*; (sudo $(SONIC_NATIVE_DOCKERD_FOR_MUTLIARCH) &) &>/dev/null ; sleep 1; sudo $(SONIC_USERFACL_DOCKERD_FOR_MUTLIARCH);)
DOCKER_SERVICE_MULTIARCH_CHECK := docker -H unix:///var/run/march/docker.sock info &> /dev/null || (echo "Docker march service not running..."; sudo rm -fr /var/run/march/; (sudo $(SONIC_NATIVE_DOCKERD_FOR_MUTLIARCH) &) &>/dev/null ; sleep 1; 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 \
Expand Down Expand Up @@ -184,8 +184,10 @@ SONIC_BUILD_INSTRUCTION := make \
%::
ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64))
@$(DOCKER_MULTIARCH_CHECK)
ifneq ($(BLDENV), )
@$(DOCKER_SERVICE_MULTIARCH_CHECK)
@$(DOCKER_SERVICE_DOCKERFS_CHECK)
endif
endif
@$(OVERLAY_MODULE_CHECK)

Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,23 @@ To build SONiC installer image and docker images, run the following commands:

## Usage for ARM Architecture
To build Arm32 bit for (ARMHF) plaform
ARM build has dependency in docker version 18,
if docker version is 19, downgrade to 18 as below
sudo apt-get install --allow-downgrades -y docker-ce=5:18.09.0~3-0~ubuntu-xenial
sudo apt-get install --allow-downgrades -y docker-ce-cli=5:18.09.0~3-0~ubuntu-xenial

# Execute make configure once to configure ASIC and ARCH

make configure PLATFORM=[ASIC_VENDOR] PLATFORM_ARCH=armhf

**example**:
make target/sonic-[ASIC_VENDER]-armhf.bin

# example:

make configure PLATFORM=marvell-armhf PLATFORM_ARCH=armhf

make target/sonic-marvell-armhf.bin



To build Arm64 bit for plaform
Expand All @@ -105,7 +113,7 @@ To build Arm64 bit for plaform

make configure PLATFORM=[ASIC_VENDOR] PLATFORM_ARCH=arm64

**example**:
# example:

make configure PLATFORM=marvell-arm64 PLATFORM_ARCH=arm64

Expand Down
44 changes: 11 additions & 33 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,11 @@ fi
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install busybox
echo '[INFO] Install SONiC linux kernel image'
## Note: duplicate apt-get command to ensure every line return zero
if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install cpio klibc-utils kmod libklibc udev linux-base
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/linux-image-*${CONFIGURED_ARCH}*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
fi
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/initramfs-tools-core_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/initramfs-tools_*.deb || \
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f
sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/linux-image-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH}_*.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
Expand Down Expand Up @@ -170,7 +165,7 @@ sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-premount/resize-

## Hook into initramfs: after partition mount and loop file mount
## 1. Prepare layered file system
## 2. Bind-mount docker working directory (docker aufs cannot work over aufs rootfs)
## 2. Bind-mount docker working directory (docker overlay storage cannot work over overlay rootfs)
sudo cp files/initramfs-tools/union-mount $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/union-mount
sudo chmod +x $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/union-mount
sudo cp files/initramfs-tools/varlog $FILESYSTEM_ROOT/etc/initramfs-tools/scripts/init-bottom/varlog
Expand Down Expand Up @@ -206,7 +201,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install docker-ce=${DOCKER_VERSION}
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y remove software-properties-common gnupg2

## Add docker config drop-in to select aufs, otherwise it may select other storage driver
## Add docker config drop-in to specify dockerd command line
sudo mkdir -p $FILESYSTEM_ROOT/etc/systemd/system/docker.service.d/
## Note: $_ means last argument of last command
sudo cp files/docker/docker.service.conf $_
Expand Down Expand Up @@ -342,31 +337,8 @@ sudo sed -i 's/^ListenAddress ::/#ListenAddress ::/' $FILESYSTEM_ROOT/etc/ssh/ss
sudo sed -i 's/^#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' $FILESYSTEM_ROOT/etc/ssh/sshd_config

## Config monit
sudo sed -i '
s/^# set logfile syslog/set logfile syslog/;
s/^\s*set logfile \/var/# set logfile \/var/;
s/^# set httpd port/set httpd port/;
s/^# use address localhost/ use address localhost/;
s/^# allow localhost/ allow localhost/;
s/^# allow admin:monit/ allow admin:monit/;
s/^# allow @monit/ allow @monit/;
s/^# allow @users readonly/ allow @users readonly/
' $FILESYSTEM_ROOT/etc/monit/monitrc

sudo tee -a $FILESYSTEM_ROOT/etc/monit/monitrc > /dev/null <<'EOF'
check filesystem root-overlay with path /
if space usage > 90% for 5 times within 10 cycles then alert
check filesystem var-log with path /var/log
if space usage > 90% for 5 times within 10 cycles then alert
check system $HOST
if memory usage > 50% for 5 times within 10 cycles then alert
if cpu usage (user) > 90% for 5 times within 10 cycles then alert
if cpu usage (system) > 90% for 5 times within 10 cycles then alert
check process rsyslog with pidfile /var/run/rsyslogd.pid
start program = "/bin/systemctl start rsyslog.service"
stop program = "/bin/systemctl stop rsyslog.service"
if totalmem > 800 MB for 5 times within 10 cycles then restart
EOF
sudo cp files/image_config/monit/monitrc $FILESYSTEM_ROOT/etc/monit/
sudo chmod 600 $FILESYSTEM_ROOT/etc/monit/monitrc

## Config sysctl
sudo mkdir -p $FILESYSTEM_ROOT/var/core
Expand Down Expand Up @@ -449,6 +421,9 @@ sudo cp files/dhcp/graphserviceurl $FILESYSTEM_ROOT/etc/dhcp/dhclient-exit-hooks
sudo cp files/dhcp/snmpcommunity $FILESYSTEM_ROOT/etc/dhcp/dhclient-exit-hooks.d/
sudo cp files/dhcp/vrf $FILESYSTEM_ROOT/etc/dhcp/dhclient-exit-hooks.d/
sudo cp files/dhcp/dhclient.conf $FILESYSTEM_ROOT/etc/dhcp/
if [ -f files/image_config/ntp/ntp ]; then
sudo cp ./files/image_config/ntp/ntp $FILESYSTEM_ROOT/etc/init.d/
fi

## Version file
sudo mkdir -p $FILESYSTEM_ROOT/etc/sonic
Expand All @@ -463,6 +438,9 @@ build_number: ${BUILD_NUMBER:-0}
built_by: $USER@$BUILD_HOSTNAME
EOF

## Copy over clean-up script
sudo cp ./files/scripts/core_cleanup.py $FILESYSTEM_ROOT/usr/bin/core_cleanup.py

## Copy ASIC config checksum
python files/build_scripts/generate_asic_config_checksum.py
if [[ ! -f './asic_config_checksum' ]]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# name lanes alias index speed
Ethernet0 13 tenGigE0 1 10000
Ethernet1 14 tenGigE1 2 10000
Ethernet2 15 tenGigE2 3 10000
Ethernet3 16 tenGigE3 4 10000
Ethernet4 21 tenGigE4 5 10000
Ethernet5 22 tenGigE5 6 10000
Ethernet6 23 tenGigE6 7 10000
Ethernet7 24 tenGigE7 8 10000
Ethernet8 25 tenGigE8 9 10000
Ethernet9 26 tenGigE9 10 10000
Ethernet10 27 tenGigE10 11 10000
Ethernet11 28 tenGigE11 12 10000
Ethernet12 29 tenGigE12 13 10000
Ethernet13 30 tenGigE13 14 10000
Ethernet14 31 tenGigE14 15 10000
Ethernet15 32 tenGigE15 16 10000
Ethernet16 45 tenGigE16 17 10000
Ethernet17 46 tenGigE17 18 10000
Ethernet18 47 tenGigE18 19 10000
Ethernet19 48 tenGigE19 20 10000
Ethernet20 49 tenGigE20 21 10000
Ethernet21 50 tenGigE21 22 10000
Ethernet22 51 tenGigE22 23 10000
Ethernet23 52 tenGigE23 24 10000
Ethernet24 53 tenGigE24 25 10000
Ethernet25 54 tenGigE25 26 10000
Ethernet26 55 tenGigE26 27 10000
Ethernet27 56 tenGigE27 28 10000
Ethernet28 57 tenGigE28 29 10000
Ethernet29 58 tenGigE29 30 10000
Ethernet30 59 tenGigE30 31 10000
Ethernet31 60 tenGigE31 32 10000
Ethernet32 61 tenGigE32 33 10000
Ethernet33 62 tenGigE33 34 10000
Ethernet34 63 tenGigE34 35 10000
Ethernet35 64 tenGigE35 36 10000
Ethernet36 65 tenGigE36 37 10000
Ethernet37 66 tenGigE37 38 10000
Ethernet38 67 tenGigE38 39 10000
Ethernet39 68 tenGigE39 40 10000
Ethernet40 69 tenGigE40 41 10000
Ethernet41 70 tenGigE41 42 10000
Ethernet42 71 tenGigE42 43 10000
Ethernet43 72 tenGigE43 44 10000
Ethernet44 73 tenGigE44 45 10000
Ethernet45 74 tenGigE45 46 10000
Ethernet46 75 tenGigE46 47 10000
Ethernet47 76 tenGigE47 48 10000
Ethernet48 97 tenGigE48 49 10000
Ethernet49 98 tenGigE49 49 10000
Ethernet50 99 tenGigE50 49 10000
Ethernet51 100 tenGigE51 49 10000
Ethernet52 101 tenGigE52 50 10000
Ethernet53 102 tenGigE53 50 10000
Ethernet54 103 tenGigE54 50 10000
Ethernet55 104 tenGigE55 50 10000
Ethernet56 81 tenGigE56 51 10000
Ethernet57 82 tenGigE57 51 10000
Ethernet58 83 tenGigE58 51 10000
Ethernet59 84 tenGigE59 51 10000
Ethernet60 105 tenGigE60 52 10000
Ethernet61 106 tenGigE61 52 10000
Ethernet62 107 tenGigE62 52 10000
Ethernet63 108 tenGigE63 52 10000
Ethernet64 109 tenGigE64 53 10000
Ethernet65 110 tenGigE65 53 10000
Ethernet66 111 tenGigE66 53 10000
Ethernet67 112 tenGigE67 53 10000
Ethernet68 77 tenGigE68 54 10000
Ethernet69 78 tenGigE69 54 10000
Ethernet70 79 tenGigE70 54 10000
Ethernet71 80 tenGigE71 54 10000
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td2-as5812-72x10G.config.bcm
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
os=unix
bcm_stat_flags=0
parity_enable=0
parity_correction=0

bcm_num_cos=8
l2_mem_entries=32768
l3_mem_entries=16384
l3_alpm_enable=2
ipv6_lpm_128b_enable=1

mmu_lossless=0
lls_num_l2uc=12
module_64ports=0

#SFI
serdes_if_type=9

port_init_cl72=0
phy_an_c73=5 # TSCMOD_CL73_CL37

#sdk6.5.5 only supports 156(default) or 125
#xgxs_lcpll_xtal_refclk=1
tslam_dma_enable=1
table_dma_enable=1

#for 72 ports with 48 10G ports and 6 40G ports for breakout mode
pbmp_oversubscribe=0x1fffffffffffffffffe
pbmp_xport_xe=0x1fffffffffffffffffe

rate_ext_mdio_divisor=96

#SFP+ 1-4 from WC3
portmap_1=13:10
portmap_2=14:10
portmap_3=15:10
portmap_4=16:10

#SFP+ 5-8 from WC5
portmap_5=21:10
portmap_6=22:10
portmap_7=23:10
portmap_8=24:10

#SFP+ 9-12 from WC6
portmap_9=25:10
portmap_10=26:10
portmap_11=27:10
portmap_12=28:10

#SFP+ 13-16 from WC7
portmap_13=29:10
portmap_14=30:10
portmap_15=31:10
portmap_16=32:10

#SFP+ 17-20 from WC11
portmap_17=45:10
portmap_18=46:10
portmap_19=47:10
portmap_20=48:10

#SFP+ 21-24 from WC12
portmap_21=49:10
portmap_22=50:10
portmap_23=51:10
portmap_24=52:10

#SFP+ 25-28 from WC13
portmap_25=53:10
portmap_26=54:10
portmap_27=55:10
portmap_28=56:10

#SFP+ 29-32 from WC14
portmap_29=57:10
portmap_30=58:10
portmap_31=59:10
portmap_32=60:10

#SFP+ 33-36 from WC15
portmap_33=61:10
portmap_34=62:10
portmap_35=63:10
portmap_36=64:10

#SFP+ 37-40 from WC16
portmap_37=65:10
portmap_38=66:10
portmap_39=67:10
portmap_40=68:10

#SFP+ 41-44 from WC17
portmap_41=69:10
portmap_42=70:10
portmap_43=71:10
portmap_44=72:10

#SFP+ 45-48 from WC18
portmap_45=73:10
portmap_46=74:10
portmap_47=75:10
portmap_48=76:10

# QSFP+ 49/WC24/port 49
portmap_49=97:10
portmap_50=98:10
portmap_51=99:10
portmap_52=100:10

# QSFP+ 51/WC25/port 50
portmap_53=101:10
portmap_54=102:10
portmap_55=103:10
portmap_56=104:10

# QSFP+ 53/WC20/port 51
portmap_57=81:10
portmap_58=82:10
portmap_59=83:10
portmap_60=84:10

# QSFP+ 50/WC26/port 52
portmap_61=105:10
portmap_62=106:10
portmap_63=107:10
portmap_64=108:10

# QSFP+ 52/WC27/port 53
portmap_65=109:10
portmap_66=110:10
portmap_67=111:10
portmap_68=112:10

# QSFP+ 54/WC19/port 54
portmap_69=77:10
portmap_70=78:10
portmap_71=79:10
portmap_72=80:10

# L3 ECMP
# - In Trident2, VP LAGs share the same table as ECMP group table.
# The first N entries are reserved for VP LAGs, where N is the value of the
# config property "max_vp_lags". By default this was set to 256
l3_max_ecmp_mode=1
max_vp_lags=0

stable_size=0x2000000
1 change: 1 addition & 0 deletions device/accton/x86_64-accton_as5812_54t-r0/default_sku
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Accton-AS5812-54T t1
3 changes: 3 additions & 0 deletions device/accton/x86_64-accton_as5812_54t-r0/installer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONSOLE_PORT=0x2f8
CONSOLE_DEV=1
CONSOLE_SPEED=115200
Loading

0 comments on commit 459c619

Please sign in to comment.