Skip to content

Commit

Permalink
Merged PR 7198722: Manual merge branch 'github/202012' into internal-…
Browse files Browse the repository at this point in the history
…202012

Due to confliction in files/image_config/platform/rc.local

Related work items: sonic-net#9248, sonic-net#10224, sonic-net#10923, sonic-net#12164, sonic-net#12775, sonic-net#12796, sonic-net#12806, sonic-net#12808
  • Loading branch information
qiluo-msft committed Nov 23, 2022
2 parents d7496da + 1db72df commit e1dba40
Show file tree
Hide file tree
Showing 20 changed files with 74 additions and 24 deletions.
3 changes: 3 additions & 0 deletions device/arista/x86_64-arista_7060_cx32s/platform-init
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Increase PCIe timeout value to 210ms
setpci -s01:00.0 CAP_EXP+0x28.B=6
setpci -s01:00.1 CAP_EXP+0x28.B=6
1 change: 1 addition & 0 deletions dockers/docker-orchagent/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ RUN apt-get update && \
bridge-utils \
conntrack \
ndppd \
pciutils \
# Needed for installing netifaces Python package
build-essential \
python3-dev
Expand Down
5 changes: 5 additions & 0 deletions dockers/docker-orchagent/docker-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ SUBTYPE=$(sonic-cfggen -d -v "DEVICE_METADATA['localhost']['subtype']")

chmod +x /usr/bin/wait_for_link.sh

# Executed platform specific initialization tasks.
if [ -x /usr/share/sonic/platform/platform-init ]; then
/usr/share/sonic/platform/platform-init
fi

# Executed HWSKU specific initialization tasks.
if [ -x /usr/share/sonic/hwsku/hwsku-init ]; then
/usr/share/sonic/hwsku/hwsku-init
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
https://github.com/CESNET/libyang.git==f95b730cc8d8903c68f1b463a0b4d2856ad4943f
https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b
https://github.com/jeroennijhof/pam_tacplus.git==e57022d3be8430f4c3c239cbb71eccbd547259f2
https://github.com/jeroennijhof/pam_tacplus.git==4f91b0de2be88d02984bef8fb0f64c213c650ed9
https://github.com/jpirko/libteam.git==c32369829b2b1881e25fab85d74aa0b3ad017dcb
https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774
https://github.com/sflow/host-sflow==7f233a17819ec68d25c09dfd67e3e5e1edf64a29
https://github.com/sflow/host-sflow==458295bcd2c598e5a121e8094eecbce56da126e4
https://github.com/sflow/sflowtool==bbb242e00caa94a23b26e3f93a5cae03ac6b13cb
https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0
https://salsa.debian.org/debian/libteam.git==f8808df228b00873926b5e7b998ad8b61368d4c5
Expand Down
6 changes: 3 additions & 3 deletions files/build/versions/default/versions-git
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
https://chromium.googlesource.com/chromium/tools/depot_tools.git==d06e475934f6496819f88ae0ab6a3a9d3e77ae6d
https://chromium.googlesource.com/chromium/tools/depot_tools.git==2fc7e1ffd58b00601b47a5126201e5162911e244
https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f
https://github.com/CESNET/libyang.git==f95b730cc8d8903c68f1b463a0b4d2856ad4943f
https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b
https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287
https://github.com/jeroennijhof/pam_tacplus.git==e57022d3be8430f4c3c239cbb71eccbd547259f2
https://github.com/jeroennijhof/pam_tacplus.git==4f91b0de2be88d02984bef8fb0f64c213c650ed9
https://github.com/jpirko/libteam.git==c32369829b2b1881e25fab85d74aa0b3ad017dcb
https://github.com/lguohan/gnxi.git==f2b11e45b16ab13485ae14933f30c18ee6336499
https://github.com/Marvell-switching/mrvl-prestera.git==21a100e01b2ab00229da35dd178d9b294c66303f
https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774
https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479
https://github.com/sflow/host-sflow==7f233a17819ec68d25c09dfd67e3e5e1edf64a29
https://github.com/sflow/host-sflow==458295bcd2c598e5a121e8094eecbce56da126e4
https://github.com/sflow/sflowtool==bbb242e00caa94a23b26e3f93a5cae03ac6b13cb
https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0
https://salsa.debian.org/debian/libteam.git==f8808df228b00873926b5e7b998ad8b61368d4c5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ importlib-metadata==5.0.0
importlib-resources==5.10.0
inflection==0.5.1
itsdangerous==2.1.2
jsonschema==4.17.0
jsonschema==4.17.1
jsonschema-spec==0.1.2
lazy-object-proxy==1.8.0
openapi-schema-validator==0.3.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ g++==4:8.3.0-1
g++-8==8.3.0-6
gcc==4:8.3.0-1
gcc-8==8.3.0-6
libarchive13==3.3.3-4+deb10u1
libarchive13==3.3.3-4+deb10u2
libasan5==8.3.0-6
libbinutils==2.31.1-16
libboost-atomic1.71.0==1.71.0-6~bpo10+1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ g++==4:8.3.0-1
g++-8==8.3.0-6
gcc==4:8.3.0-1
gcc-8==8.3.0-6
libarchive13==3.3.3-4+deb10u1
libarchive13==3.3.3-4+deb10u2
libasan5==8.3.0-6
libbinutils==2.31.1-16
libboost-atomic1.71.0==1.71.0-6~bpo10+1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ g++==4:8.3.0-1
g++-8==8.3.0-6
gcc==4:8.3.0-1
gcc-8==8.3.0-6
libarchive13==3.3.3-4+deb10u1
libarchive13==3.3.3-4+deb10u2
libasan5==8.3.0-6
libbinutils==2.31.1-16
libboost-atomic1.71.0==1.71.0-6~bpo10+1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ g++==4:8.3.0-1
g++-8==8.3.0-6
gcc==4:8.3.0-1
gcc-8==8.3.0-6
libarchive13==3.3.3-4+deb10u1
libarchive13==3.3.3-4+deb10u2
libasan5==8.3.0-6
libbinutils==2.31.1-16
libboost-atomic1.71.0==1.71.0-6~bpo10+1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ libapt-inst2.0==1.8.2.3
libapt-pkg-perl==0.1.34+b1
libarchive-cpio-perl==0.10-1
libarchive-zip-perl==1.64-1
libarchive13==3.3.3-4+deb10u1
libarchive13==3.3.3-4+deb10u2
libargon2-1==0~20171227-0.2
libasan5==8.3.0-6
libasm-java==7.0-1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
https://chromium.googlesource.com/chromium/tools/depot_tools.git==d06e475934f6496819f88ae0ab6a3a9d3e77ae6d
https://chromium.googlesource.com/chromium/tools/depot_tools.git==2fc7e1ffd58b00601b47a5126201e5162911e244
https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
https://chromium.googlesource.com/chromium/tools/depot_tools.git==d06e475934f6496819f88ae0ab6a3a9d3e77ae6d
https://chromium.googlesource.com/chromium/tools/depot_tools.git==2fc7e1ffd58b00601b47a5126201e5162911e244
https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f
9 changes: 8 additions & 1 deletion files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,19 @@ sudo mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/common
sudo cp {{ deb }} $FILESYSTEM_ROOT/$PLATFORM_DIR/common/
sudo ln -sf "../common/{{ debfilename }}" "$FILESYSTEM_ROOT/$PLATFORM_DIR/{{dev}}/{{ debfilename }}"
for f in $(find $FILESYSTEM_ROOT/var/cache/apt/archives -name "*.deb"); do
sudo mv $f $FILESYSTEM_ROOT/$PLATFORM_DIR/{{dev}}/
sudo mv $f $FILESYSTEM_ROOT/$PLATFORM_DIR/common/
sudo ln -sf "../common/$(basename $f)" "$FILESYSTEM_ROOT/$PLATFORM_DIR/{{dev}}/$(basename $f)"
done

sudo dpkg --root=$FILESYSTEM_ROOT -P {{ debname }}

{% endfor %}
# create a trivial apt repo if any of the debs have dependencies, including between lazy debs
if [ $(for f in $FILESYSTEM_ROOT/$PLATFORM_DIR/common/*.deb; do \
sudo dpkg -I $f | grep "Depends:\|Pre-Depends:"; done | wc -l) -gt 0 ]; then
(cd $FILESYSTEM_ROOT/$PLATFORM_DIR/common && sudo dpkg-scanpackages . | \
sudo gzip | sudo tee Packages.gz > /dev/null)
fi
{% endif %}

# Remove sshd host keys, and will regenerate on first sshd start. This needs to be
Expand Down
15 changes: 14 additions & 1 deletion files/image_config/platform/rc.local
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,20 @@ if [ -f $FIRST_BOOT_FILE ]; then
dpkg -i ${PYTHON_PLATFORM_MODULES_DEB}
mv ${PYTHON_PLATFORM_MODULES_DEB} /usr/share/sonic/device/$platform
fi
dpkg -i /host/image-$SONIC_VERSION/platform/$platform/*.deb
if [ -f /host/image-$SONIC_VERSION/platform/common/Packages.gz ]; then
# Use only the trivial repo and apt to support lazy package dependencies
mv /etc/apt/sources.list /etc/apt/sources.list.rc-local
echo "deb [trusted=yes] file:///host/image-$SONIC_VERSION/platform/common /" > /etc/apt/sources.list.d/sonic_debian_extension.list
LANG=C DEBIAN_FRONTEND=noninteractive apt-get update
LANG=C DEBIAN_FRONTEND=noninteractive apt-get -y install /host/image-$SONIC_VERSION/platform/$platform/*.deb
# Cleanup
rm -f /etc/apt/sources.list.d/sonic_debian_extension.list
rm -f /var/lib/apt/lists/_host_image-${SONIC_VERSION}_platform_common_Packages.lz4
# This is first boot so there should be no package lists or indices to restore, just the sources
mv /etc/apt/sources.list.rc-local /etc/apt/sources.list
else
dpkg -i /host/image-$SONIC_VERSION/platform/$platform/*.deb
fi
fi

sync
Expand Down
2 changes: 1 addition & 1 deletion platform/checkout/cisco-8000.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[module]
repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git
ref=202012-v0.120
ref=202012-v0.2.3
21 changes: 15 additions & 6 deletions src/sonic-config-engine/portconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,25 @@
#
# Helper Functions
#

# For python2 compatibility
def py2JsonStrHook(j):
if isinstance(j, unicode):
return j.encode('utf-8', 'backslashreplace')
if isinstance(j, list):
return [py2JsonStrHook(item) for item in j]
if isinstance(j, dict):
return {py2JsonStrHook(key): py2JsonStrHook(value)
for key, value in j.iteritems()}
return j

def readJson(filename):
# Read 'platform.json' or 'hwsku.json' file
try:
with open(filename) as fp:
try:
data = json.load(fp)
except json.JSONDecodeError:
print("Json file does not exist")
data_dict = ast.literal_eval(json.dumps(data))
return data_dict
if sys.version_info.major == 2:
return json.load(fp, object_hook=py2JsonStrHook)
return json.load(fp)
except Exception as e:
print("error occurred while parsing json: {}".format(sys.exc_info()[1]))
return None
Expand Down
12 changes: 12 additions & 0 deletions src/sonic-config-engine/tests/sample_platform.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"chassis": {
"psus": [
{
"name": "PSU 1",
"temperature": false
},
{
"name": "PSU 2",
"temperature": false
}
]
},
"interfaces": {
"Ethernet0": {
"index": "1,1,1,1",
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-sairedis
Submodule sonic-sairedis updated 1 files
+1 −1 SAI
2 changes: 1 addition & 1 deletion src/sonic-swss

0 comments on commit e1dba40

Please sign in to comment.