Skip to content

Commit 19c4542

Browse files
committed
Merged PR 6004325: Manual merge github master to internal
Related work items: #49, #58, #107, sonic-net#247, sonic-net#249, sonic-net#277, sonic-net#593, sonic-net#597, sonic-net#1035, sonic-net#2130, sonic-net#2150, sonic-net#2165, sonic-net#2169, sonic-net#2178, sonic-net#2179, sonic-net#2187, sonic-net#2188, sonic-net#2191, sonic-net#2195, sonic-net#2197, sonic-net#2198, sonic-net#2200, sonic-net#2202, sonic-net#2206, sonic-net#2209, sonic-net#2211, sonic-net#2216, sonic-net#7909, sonic-net#8927, sonic-net#9681, sonic-net#9733, sonic-net#9746, sonic-net#9850, sonic-net#9967, sonic-net#10104, sonic-net#10152, sonic-net#10168, sonic-net#10228, sonic-net#10266, sonic-net#10288, sonic-net#10294, sonic-net#10313, sonic-net#10394, sonic-net#10403, sonic-net#10404, sonic-net#10421, sonic-net#10431, sonic-net#10437, sonic-net#10445, sonic-net#10457, sonic-net#10458, sonic-net#10465, sonic-net#10467, sonic-net#10469, sonic-net#10470, sonic-net#10474, sonic-net#10477, sonic-net#10478, sonic-net#10482, sonic-net#10485, sonic-net#10488, sonic-net#10489, sonic-net#10492, sonic-net#10494, sonic-net#10498, sonic-net#10501, sonic-net#10509, sonic-net#10512, sonic-net#10514, sonic-net#10516, sonic-net#10517, sonic-net#10523, sonic-net#10525, sonic-net#10531, sonic-net#10532, sonic-net#10538, sonic-net#10555, sonic-net#10557, sonic-net#10559, sonic-net#10561, sonic-net#10565, sonic-net#10572, sonic-net#10574, sonic-net#10576, sonic-net#10578, sonic-net#10581, sonic-net#10585, sonic-net#10587, sonic-net#10599, sonic-net#10607, sonic-net#10611, sonic-net#10616, sonic-net#10618, sonic-net#10619, sonic-net#10623, sonic-net#10624, sonic-net#10633, sonic-net#10646, sonic-net#10655, sonic-net#10660, sonic-net#10664, sonic-net#10680, sonic-net#10683
2 parents b969fa5 + 96a2d79 commit 19c4542

File tree

208 files changed

+10226
-1507
lines changed

Some content is hidden

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

208 files changed

+10226
-1507
lines changed

.azure-pipelines/azure-pipelines-UpgrateVersion.yml

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ parameters:
3838
- centec
3939
- centec-arm64
4040
- generic
41-
- innovium
4241
- marvell-armhf
4342
- mellanox
4443

.azure-pipelines/azure-pipelines-build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
swi_image: yes
5151

5252
- name: broadcom
53+
timeoutInMinutes: 1440
5354
variables:
5455
dbg_image: yes
5556
swi_image: yes
@@ -131,3 +132,4 @@ jobs:
131132
make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin
132133
fi
133134
displayName: "Build sonic image"
135+
- template: check-dirty-version.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
parameters:
2+
- name: connectionName
3+
type: string
4+
default: sonic-dev-connection
5+
- name: kevaultName
6+
type: string
7+
default: sonic-kv
8+
- name: certificateName
9+
type: string
10+
default: sonic-secure-boot
11+
12+
steps:
13+
- task: AzureKeyVault@2
14+
inputs:
15+
connectedServiceName: ${{ parameters.connectionName }}
16+
keyVaultName: ${{ parameters.kevaultName }}
17+
secretsFilter: ${{ parameters.certificateName }}
18+
19+
- script: |
20+
set -e
21+
TMP_FILE=$(mktemp)
22+
echo "$CERTIFICATE" | base64 -d > $TMP_FILE
23+
sudo mkdir -p /etc/certificates
24+
mkdir -p $(Build.StagingDirectory)/target
25+
# Save the public key
26+
openssl pkcs12 -in $TMP_FILE -clcerts --nokeys -nodes -passin pass: | sed -z -e "s/.*\(-----BEGIN CERTIFICATE\)/\1/" > $(SIGNING_CERT)
27+
# Save the private key
28+
openssl pkcs12 -in $TMP_FILE -nocerts -nodes -passin pass: | sed -z -e "s/.*\(-----BEGIN PRIVATE KEY\)/\1/" | sudo tee $(SIGNING_KEY) 1>/dev/null
29+
ls -lt $(SIGNING_CERT) $(SIGNING_KEY)
30+
rm $TMP_FILE
31+
env:
32+
CERTIFICATE: $(${{ parameters.certificateName }})
33+
displayName: "Save certificate"
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
steps:
2+
- script: |
3+
. functions.sh
4+
SONIC_VERSION=$(sonic_get_version)
5+
echo "SONIC_VERSION=$SONIC_VERSION"
6+
if [[ "$SONIC_VERSION" == *dirty* ]]; then
7+
# Print the detail dirty info
8+
git status --untracked-files=no -s --ignore-submodules
9+
10+
# Exit with error, if it is a PR build
11+
if [ "$(Build.Reason)" == "PullRequest" ]; then
12+
echo "Build failed for the dirty version: $SONIC_VERSION" 1>&2
13+
exit 1
14+
fi
15+
fi
16+
displayName: "Check the dirty version"

.azure-pipelines/docker-sonic-slave-template.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,13 @@ jobs:
101101
containerRegistry: ${{ parameters.registry_conn }}
102102
repository: $(VARIABLE_SLAVE_BASE_IMAGE)
103103
command: push
104-
tags: |
105-
$(VARIABLE_SLAVE_BASE_TAG)
106-
${{ if eq(variables['Build.SourceBranchName'], 'master') }}:
104+
${{ if eq(variables['Build.SourceBranchName'], 'master') }}:
105+
tags: |
106+
$(VARIABLE_SLAVE_BASE_TAG)
107107
latest
108+
${{ else }}:
109+
tags: |
110+
$(VARIABLE_SLAVE_BASE_TAG)
108111
- ${{ if ne(parameters.arch, 'amd64') }}:
109112
- task: Docker@2
110113
condition: ne(variables['Build.Reason'], 'PullRequest')

.azure-pipelines/docker-sonic-slave.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ stages:
6060
- ${{ each dist in parameters.dists }}:
6161
- ${{ if endswith(variables['Build.DefinitionName'], dist) }}:
6262
- ${{ each arch in parameters.arches }}:
63-
- ${{ if eq(variables['System.PullRequest.TargetBranch'], 'master') }}:
63+
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
6464
- template: docker-sonic-slave-template.yml
6565
parameters:
6666
pool: sonicbld

.azure-pipelines/official-build-cisco-8000.yml

+13
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,17 @@ resources:
2222
name: Cisco-8000-sonic/platform-cisco-8000
2323
endpoint: cisco-connection
2424

25+
2526
variables:
2627
- group: SONIC-AKV-STROAGE-1
2728
- name: StorageSASKey
2829
value: $(sonicstorage-SasToken)
30+
- name: SONIC_ENABLE_SECUREBOOT_SIGNATURE
31+
value: y
32+
- name: SIGNING_KEY
33+
value: /etc/certificates/sonic-secure-boot-private.pem
34+
- name: SIGNING_CERT
35+
value: $(Build.StagingDirectory)/target/sonic-secure-boot-public.pem
2936

3037
stages:
3138
- stage: Build
@@ -41,6 +48,7 @@ stages:
4148
parameters:
4249
buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}'
4350
preSteps:
51+
- template: azure-pipelines-download-certificate.yml
4452
- checkout: self
4553
submodules: recursive
4654
path: s
@@ -90,5 +98,10 @@ stages:
9098
StorageSASKey: $(StorageSASKey)
9199
condition: ne(variables['Build.Reason'], 'PullRequest')
92100
displayName: "Override cisco sai packages"
101+
- script: |
102+
echo "SONIC_ENABLE_SECUREBOOT_SIGNATURE := y" >> rules/config.user
103+
echo "SIGNING_KEY := $(SIGNING_KEY)" >> rules/config.user
104+
echo "SIGNING_CERT := $(SIGNING_CERT)" >> rules/config.user
105+
displayName: "Enable secure boot signature"
93106
jobGroups:
94107
- name: cisco-8000

.azure-pipelines/template-commonlib.yml

+23-17
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,39 @@ jobs:
22
- job: Build
33
timeoutInMinutes: 120
44
pool: sonicbld
5+
variables:
6+
- template: template-variables.yml
57
steps:
68
- checkout: self
79
clean: true
810
submodules: recursive
911
- script: |
1012
set -ex
11-
case $(Build.SourceBranchName) in
12-
202012 | 202106)
13-
bldenv=buster
14-
;;
15-
*)
16-
bldenv=bullseye
17-
;;
18-
esac
19-
BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y
20-
echo "##vso[task.setvariable variable=bldenv;]$bldenv"
13+
branch=$(Build.SourceBranchName)
14+
# DIST_MASTER is set in variable.
15+
BRANCH=DIST_${branch^^}
16+
bldenvs=${!BRANCH}
17+
[ "$bldenvs" == "" ] && bldenvs="$(COMMON_LIB_BUILD_ENVS)"
18+
for bldenv in $bldenvs
19+
do
20+
BLDENV=$bldenv make -f Makefile.work configure PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y
21+
done
22+
set +x
23+
echo "##vso[task.setvariable variable=bldenvs;]$bldenvs"
2124
displayName: Make configure
2225
- script: |
2326
set -ex
24-
LIBNL3_VERSION_BASE=$(grep "LIBNL3_VERSION_BASE =" rules/libnl3.mk | awk '{print$3}')
25-
LIBNL3_VERSION=$(grep "LIBNL3_VERSION =" rules/libnl3.mk | awk '{print$3}' | sed -e "s/(//" -e "s/)//" -e "s/\\$//" -e "s/LIBNL3_VERSION_BASE/$LIBNL3_VERSION_BASE/")
26-
BLDENV=$(bldenv) make -f Makefile.work target/debs/$(bldenv)/libnl-3-200_${LIBNL3_VERSION}_amd64.deb ENABLE_DOCKER_BASE_PULL=y
27+
for bldenv in $(bldenvs)
28+
do
29+
LIBNL3_VERSION_BASE=$(grep "LIBNL3_VERSION_BASE =" rules/libnl3.mk | awk '{print$3}')
30+
LIBNL3_VERSION=$(grep "LIBNL3_VERSION =" rules/libnl3.mk | awk '{print$3}' | sed -e "s/(//" -e "s/)//" -e "s/\\$//" -e "s/LIBNL3_VERSION_BASE/$LIBNL3_VERSION_BASE/")
31+
SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work target/debs/$bldenv/libnl-3-200_${LIBNL3_VERSION}_amd64.deb ENABLE_DOCKER_BASE_PULL=y
2732
28-
LIBYANG_VERSION_BASE=$(grep "LIBYANG_VERSION_BASE =" rules/libyang.mk | awk '{print$3}')
29-
LIBYANG_VERSION=$(grep "LIBYANG_VERSION =" rules/libyang.mk | awk '{print$3}' | sed -e "s/\\$//" -e "s/(//" -e "s/)//" -e "s/LIBYANG_VERSION_BASE/$LIBYANG_VERSION_BASE/")
30-
BLDENV=$(bldenv) make -f Makefile.work target/debs/$(bldenv)/libyang_${LIBYANG_VERSION}_amd64.deb
31-
find target -name *.deb | xargs -i cp {} $(Build.ArtifactStagingDirectory)
33+
LIBYANG_VERSION_BASE=$(grep "LIBYANG_VERSION_BASE =" rules/libyang.mk | awk '{print$3}')
34+
LIBYANG_VERSION=$(grep "LIBYANG_VERSION =" rules/libyang.mk | awk '{print$3}' | sed -e "s/\\$//" -e "s/(//" -e "s/)//" -e "s/LIBYANG_VERSION_BASE/$LIBYANG_VERSION_BASE/")
35+
SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work target/debs/$bldenv/libyang_${LIBYANG_VERSION}_amd64.deb
36+
done
37+
mv target $(Build.ArtifactStagingDirectory)
3238
displayName: Make common lib packages
3339
- publish: $(Build.ArtifactStagingDirectory)
3440
artifact: common-lib
+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
variables:
22
DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io'
3+
COMMON_LIB_BUILD_ENVS: 'bullseye'

.gitmodules

+6-3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@
6262
[submodule "src/redis-dump-load"]
6363
path = src/redis-dump-load
6464
url = https://github.com/p/redis-dump-load.git
65+
[submodule "src/scapy"]
66+
path = src/scapy
67+
url = https://github.com/secdev/scapy.git
6568
[submodule "platform/mellanox/mlnx-sai/SAI-Implementation"]
6669
path = platform/mellanox/mlnx-sai/SAI-Implementation
6770
url = https://github.com/Mellanox/SAI-Implementation
@@ -103,6 +106,6 @@
103106
[submodule "src/sonic-p4rt/sonic-pins"]
104107
path = src/sonic-p4rt/sonic-pins
105108
url = https://github.com/Azure/sonic-pins.git
106-
[submodule "src/thrift_0_14_1/thrift"]
107-
path = src/thrift_0_14_1/thrift
108-
url = https://github.com/apache/thrift.git
109+
[submodule "src/ptf-py3"]
110+
path = src/ptf-py3
111+
url = https://github.com/p4lang/ptf.git

Makefile.work

+12
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ ifneq ($(SONIC_DPKG_CACHE_SOURCE),)
188188
DOCKER_RUN += -v "$(SONIC_DPKG_CACHE_SOURCE):/dpkg_cache:rw"
189189
endif
190190

191+
ifeq ($(SONIC_ENABLE_SECUREBOOT_SIGNATURE), y)
192+
ifneq ($(SIGNING_KEY),)
193+
DOCKER_SIGNING_SOURCE := $(shell dirname $(SIGNING_KEY))
194+
DOCKER_RUN += -v "$(DOCKER_SIGNING_SOURCE):$(DOCKER_SIGNING_SOURCE):ro"
195+
endif
196+
ifneq ($(SIGNING_CERT),)
197+
DOCKER_SIGNING_SOURCE := $(shell dirname $(SIGNING_CERT))
198+
DOCKER_RUN += -v "$(DOCKER_SIGNING_SOURCE):$(DOCKER_SIGNING_SOURCE):ro"
199+
endif
200+
endif
201+
191202
ifeq ($(SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD), y)
192203
ifneq ($(MULTIARCH_QEMU_ENVIRON), y)
193204
DOCKER_RUN += -v /var/run/docker.sock:/var/run/docker.sock
@@ -297,6 +308,7 @@ SONIC_BUILD_INSTRUCTION := make \
297308
EXTRA_DOCKER_TARGETS=$(EXTRA_DOCKER_TARGETS) \
298309
BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \
299310
SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \
311+
SONIC_ENABLE_SECUREBOOT_SIGNATURE=$(SONIC_ENABLE_SECUREBOOT_SIGNATURE) \
300312
SONIC_DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \
301313
ENABLE_HOST_SERVICE_ON_START=$(ENABLE_HOST_SERVICE_ON_START) \
302314
SLAVE_DIR=$(SLAVE_DIR) \

build_debian.sh

+30-2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ sudo cp files/apt/apt.conf.d/{81norecommends,apt-{clean,gzip-indexes,no-language
113113
## Note: set lang to prevent locale warnings in your chroot
114114
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y update
115115
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y upgrade
116+
117+
echo '[INFO] Install and setup eatmydata'
118+
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install eatmydata
119+
sudo LANG=C chroot $FILESYSTEM_ROOT ln -s /usr/bin/eatmydata /usr/local/bin/dpkg
120+
echo 'Dir::Bin::dpkg "/usr/local/bin/dpkg";' | sudo tee $FILESYSTEM_ROOT/etc/apt/apt.conf.d/00image-install-eatmydata > /dev/null
121+
116122
echo '[INFO] Install packages for building image'
117123
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install makedev psmisc
118124

@@ -143,6 +149,23 @@ if [[ $CONFIGURED_ARCH == amd64 ]]; then
143149
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install dmidecode hdparm
144150
fi
145151

152+
## Sign the Linux kernel
153+
if [ "$SONIC_ENABLE_SECUREBOOT_SIGNATURE" = "y" ]; then
154+
if [ ! -f $SIGNING_KEY ]; then
155+
echo "Error: SONiC linux kernel signing key missing"
156+
exit 1
157+
fi
158+
if [ ! -f $SIGNING_CERT ]; then
159+
echo "Error: SONiC linux kernel signing certificate missing"
160+
exit 1
161+
fi
162+
163+
echo '[INFO] Signing SONiC linux kernel image'
164+
K=$FILESYSTEM_ROOT/boot/vmlinuz-${LINUX_KERNEL_VERSION}-amd64
165+
sbsign --key $SIGNING_KEY --cert $SIGNING_CERT --output /tmp/${K##*/} ${K}
166+
sudo cp -f /tmp/${K##*/} ${K}
167+
fi
168+
146169
## Update initramfs for booting with squashfs+overlay
147170
cat files/initramfs-tools/modules | sudo tee -a $FILESYSTEM_ROOT/etc/initramfs-tools/modules > /dev/null
148171

@@ -397,7 +420,8 @@ fi
397420
## Remove sshd host keys, and will regenerate on first sshd start
398421
sudo rm -f $FILESYSTEM_ROOT/etc/ssh/ssh_host_*_key*
399422
sudo cp files/sshd/host-ssh-keygen.sh $FILESYSTEM_ROOT/usr/local/bin/
400-
sudo cp -f files/sshd/sshd.service $FILESYSTEM_ROOT/lib/systemd/system/ssh.service
423+
sudo mkdir $FILESYSTEM_ROOT/etc/systemd/system/ssh.service.d
424+
sudo cp files/sshd/override.conf $FILESYSTEM_ROOT/etc/systemd/system/ssh.service.d/override.conf
401425
# Config sshd
402426
# 1. Set 'UseDNS' to 'no'
403427
# 2. Configure sshd to close all SSH connetions after 15 minutes of inactivity
@@ -460,7 +484,7 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'setup
460484
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'wheel==0.35.1'
461485

462486
# docker Python API package is needed by Ansible docker module as well as some SONiC applications
463-
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'docker==4.3.1'
487+
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'docker==5.0.3'
464488

465489
# Install scapy
466490
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'scapy==2.4.4'
@@ -586,6 +610,10 @@ scripts/collect_host_image_version_files.sh $TARGET_PATH $FILESYSTEM_ROOT
586610
# Remove GCC
587611
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y remove gcc
588612

613+
# Remove eatmydata
614+
sudo rm $FILESYSTEM_ROOT/etc/apt/apt.conf.d/00image-install-eatmydata $FILESYSTEM_ROOT/usr/local/bin/dpkg
615+
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y remove eatmydata
616+
589617
## Clean up apt
590618
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y autoremove
591619
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get autoclean

device/accton/x86_64-accton_as9716_32d-r0/pddf/pddf-device.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
],
5454
"custom_kos":
5555
[
56-
"pddf_custom_psu"
56+
"pddf_custom_psu",
57+
"accton_as9716_32d_ioport"
5758
]
5859
},
5960

device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/td3-a7050cx3-32s-32x100G.config.bcm

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ sai_trap_group_priority=1000
66
use_all_splithorizon_groups=1
77
riot_enable=1
88
sai_tunnel_support=1
9+
sai_tunnel_underlay_route_mode=1
910
riot_overlay_l3_intf_mem_size=4096
1011
riot_overlay_l3_egress_mem_size=32768
1112
l3_ecmp_levels=2
@@ -52,7 +53,7 @@ stable_size=0x5500000
5253
tdma_timeout_usec=15000000
5354
tslam_timeout_usec=15000000
5455
sai_optimized_mmu=1
55-
mmu_init_config="TD3-MSFT-T0-100G"
56+
mmu_init_config="TD3-MSFT-CUSTOM"
5657
buf.map.egress_pool0.ingress_pool=0
5758
buf.map.egress_pool1.ingress_pool=0
5859
buf.map.egress_pool2.ingress_pool=1

0 commit comments

Comments
 (0)