Skip to content

Commit bff4efa

Browse files
committed
Merge branch 'master' into bookworm_migration_for_mgmt_framework_and_gnmi
2 parents 0650b83 + d3b18c4 commit bff4efa

File tree

66 files changed

+1810
-3418
lines changed

Some content is hidden

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

66 files changed

+1810
-3418
lines changed

dockers/docker-lldp/Dockerfile.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %}
2-
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
2+
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
33

44
ARG docker_container_name
55
ARG image_version

dockers/docker-snmp/Dockerfile.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python3_wheels, copy_files %}
2-
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
2+
FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
33

44
ARG docker_container_name
55
ARG image_version

dockers/docker-snmp/supervisord.conf

+8-8
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ command=/usr/sbin/rsyslogd -n -iNONE
2424
priority=1
2525
autostart=false
2626
autorestart=unexpected
27-
stdout_logfile=syslog
28-
stderr_logfile=syslog
27+
stdout_syslog=true
28+
stderr_syslog=true
2929
dependent_startup=true
3030

3131
[program:start]
@@ -34,8 +34,8 @@ priority=1
3434
autostart=true
3535
autorestart=false
3636
startsecs=0
37-
stdout_logfile=syslog
38-
stderr_logfile=syslog
37+
stdout_syslog=true
38+
stderr_syslog=true
3939
dependent_startup=true
4040
dependent_startup_wait_for=rsyslogd:running
4141

@@ -44,8 +44,8 @@ command=/usr/sbin/snmpd -f -LS0-2d -u Debian-snmp -g Debian-snmp -I -smux,mteTri
4444
priority=3
4545
autostart=false
4646
autorestart=false
47-
stdout_logfile=syslog
48-
stderr_logfile=syslog
47+
stdout_syslog=true
48+
stderr_syslog=true
4949
dependent_startup=true
5050
dependent_startup_wait_for=start:exited
5151

@@ -54,7 +54,7 @@ command=/usr/bin/env python3 -m sonic_ax_impl
5454
priority=4
5555
autostart=false
5656
autorestart=false
57-
stdout_logfile=syslog
58-
stderr_logfile=syslog
57+
stdout_syslog=true
58+
stderr_syslog=true
5959
dependent_startup=true
6060
dependent_startup_wait_for=snmpd:running

files/build_templates/docker_image_ctl.j2

+22-17
Original file line numberDiff line numberDiff line change
@@ -416,28 +416,33 @@ start() {
416416

417417
DOCKERCHECK=`docker inspect --type container ${DOCKERNAME} 2>/dev/null`
418418
if [ "$?" -eq "0" ]; then
419-
{%- if docker_container_name == "database" %}
420-
DOCKERMOUNT=""
419+
{%- if docker_container_name == "database" and sonic_asic_platform == "vs" %}
420+
echo "Removing existing ${DOCKERNAME} container"
421+
docker rm -f ${DOCKERNAME}
421422
{%- else %}
422-
DOCKERMOUNT=`getMountPoint "$DOCKERCHECK"`
423-
{%- endif %}
424-
if [ x"$DOCKERMOUNT" == x"$MOUNTPATH" ]; then
425-
CONTAINER_EXISTS="yes"
426-
preStartAction
427423
{%- if docker_container_name == "database" %}
428-
echo "Starting existing ${DOCKERNAME} container"
429-
docker start ${DOCKERNAME}
424+
DOCKERMOUNT=""
430425
{%- else %}
431-
echo "Starting existing ${DOCKERNAME} container with HWSKU $HWSKU"
432-
/usr/local/bin/container start ${DOCKERNAME}
426+
DOCKERMOUNT=`getMountPoint "$DOCKERCHECK"`
433427
{%- endif %}
434-
postStartAction
435-
exit $?
436-
fi
428+
if [ x"$DOCKERMOUNT" == x"$MOUNTPATH" ]; then
429+
CONTAINER_EXISTS="yes"
430+
preStartAction
431+
{%- if docker_container_name == "database" %}
432+
echo "Starting existing ${DOCKERNAME} container"
433+
docker start ${DOCKERNAME}
434+
{%- else %}
435+
echo "Starting existing ${DOCKERNAME} container with HWSKU $HWSKU"
436+
/usr/local/bin/container start ${DOCKERNAME}
437+
{%- endif %}
438+
postStartAction
439+
exit $?
440+
fi
437441

438-
# docker created with a different HWSKU, remove and recreate
439-
echo "Removing obsolete ${DOCKERNAME} container with HWSKU $DOCKERMOUNT"
440-
docker rm -f ${DOCKERNAME}
442+
# docker created with a different HWSKU, remove and recreate
443+
echo "Removing obsolete ${DOCKERNAME} container with HWSKU $DOCKERMOUNT"
444+
docker rm -f ${DOCKERNAME}
445+
{%- endif %}
441446
fi
442447

443448
{%- if docker_container_name == "database" %}

files/image_config/topology/topology.service

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ ExecStart=/usr/bin/topology.sh start
1212
ExecStop=/usr/bin/topology.sh stop
1313

1414
[Install]
15-
WantedBy=multi-user.target
16-
15+
WantedBy=sonic.target

files/image_config/topology/topology.sh

+91-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,99 @@ get_hwsku() {
2222
echo "${HWSKU}"
2323
}
2424

25+
bind_ports_to_ns() {
26+
PLATFORM="$1"
27+
HWSKU="$2"
28+
BIND="$3"
29+
30+
# Check if the directory exists
31+
if [[ ! -d "/usr/share/sonic/device/$PLATFORM/$HWSKU" ]]; then
32+
echo "Directory /usr/share/sonic/device/$PLATFORM/$HWSKU does not exist"
33+
exit 1
34+
fi
35+
36+
# Read NUM_ASIC from asic.conf file
37+
asic_conf="/usr/share/sonic/device/$PLATFORM/asic.conf"
38+
if [[ ! -f "$asic_conf" ]]; then
39+
echo "Error: $asic_conf file not found"
40+
exit 1
41+
fi
42+
43+
# Read NUM_ASIC from asic.conf file
44+
num_asic=$(awk -F "=" '/^NUM_ASIC=/ {print $2}' "$asic_conf")
45+
if [[ -z $num_asic ]]; then
46+
echo "NUM_ASIC not found in $asic_conf"
47+
exit 1
48+
fi
49+
50+
for ((asic_num = 0; asic_num < num_asic; asic_num++)); do
51+
echo "Processing $PLATFORM/$HWSKU/$asic_num"
52+
asic_dir="/usr/share/sonic/device/$PLATFORM/$HWSKU/$asic_num"
53+
54+
# Check if the directory exists for the ASIC number
55+
if [[ ! -d "$asic_dir" ]]; then
56+
echo "Directory $asic_dir does not exist"
57+
exit 1
58+
fi
59+
60+
lanemap_ini="$asic_dir/lanemap.ini"
61+
62+
if [[ ! -f "$lanemap_ini" ]]; then
63+
echo "lanemap.ini not found in $asic_dir"
64+
exit 1
65+
fi
66+
67+
# Loop through each line of lanemap.ini
68+
while IFS= read -r line; do
69+
# Extract interface before ":"
70+
intf=$(echo "$line" | cut -d ":" -f 1)
71+
if [[ $BIND == true ]]; then
72+
echo "Moving interface $intf to asic$asic_num"
73+
if [[ $intf == "Cpu0" ]]; then
74+
# Extract the numeric part of the interface name
75+
num="${prev#eth}"
76+
# Increment the numeric part
77+
((num++))
78+
# Construct the new interface name
79+
cur="eth$num"
80+
echo "Renaming $cur to $intf"
81+
ip link sev dev $cur down
82+
ip link set dev $cur name $intf
83+
fi
84+
ip link set dev $intf netns asic$asic_num
85+
sudo ip netns exec asic$asic_num ip link set dev $intf mtu 9100
86+
sudo ip netns exec asic$asic_num ip link set $intf up
87+
else
88+
echo "Moving interface $intf back to default ns"
89+
sudo ip netns exec asic$asic_num ip link set dev $intf netns 1
90+
if [[ $intf == "Cpu0" ]]; then
91+
# Extract the numeric part of the interface name
92+
num="${prev#eth}"
93+
# Increment the numeric part
94+
((num++))
95+
# Construct the new interface name
96+
cur="eth$num"
97+
echo "Renaming $intf to $cur"
98+
ip link set dev $intf down
99+
ip link set dev $intf name $cur
100+
ip link set dev $cur up
101+
fi
102+
fi
103+
prev=$intf
104+
done < "$lanemap_ini"
105+
done
106+
exit 0 # Exit script with success
107+
}
108+
109+
25110
start() {
26111
TOPOLOGY_SCRIPT="topology.sh"
27112
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
28113
HWSKU=`get_hwsku`
29-
if [[ $HWSKU != "" ]]; then
114+
if [[ $HWSKU == "msft_"* ]]; then
30115
/usr/share/sonic/device/$PLATFORM/$HWSKU/$TOPOLOGY_SCRIPT start
116+
elif [[ $HWSKU != "" ]]; then
117+
bind_ports_to_ns "$PLATFORM" "$HWSKU" true
31118
else
32119
echo "Failed to get HWSKU"
33120
exit 1
@@ -38,8 +125,10 @@ stop() {
38125
TOPOLOGY_SCRIPT="topology.sh"
39126
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`
40127
HWSKU=`get_hwsku`
41-
if [[ $HWSKU != "" ]]; then
128+
if [[ $HWSKU == "msft_"* ]]; then
42129
/usr/share/sonic/device/$PLATFORM/$HWSKU/$TOPOLOGY_SCRIPT stop
130+
elif [[ $HWSKU != "" ]]; then
131+
bind_ports_to_ns "$PLATFORM" "$HWSKU" false
43132
else
44133
echo "Failed to get HWSKU"
45134
exit 1

platform/innovium/sonic-platform-modules-wistron/6512-32r/modules/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ifneq ($(KERNELRELEASE),)
22
obj-m:= wistron_6512_32r_cpld.o wistron_6512_32r_fan.o \
33
wistron_6512_32r_oom.o wistron_6512_32r_psu.o \
4-
wistron_6512_32r_thermal.o i2c-imc.o \
4+
wistron_6512_32r_thermal.o i2c-imc.o oldjc42.o \
55
wistron_6512_32r_leds.o wistron_6512_32r_syseeprom.o
66
else
77
ifeq (,$(KERNEL_SRC))

platform/innovium/sonic-platform-modules-wistron/6512-32r/modules/i2c-imc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070

7171
/* DIMMs hold jc42 thermal sensors starting at i2c address 0x18 */
72-
#define DIMM_SENSOR_DRV "jc42"
72+
#define DIMM_SENSOR_DRV "oldjc42"
7373
#define DIMM_SENSOR_BASE_ADR 0x18
7474

7575

0 commit comments

Comments
 (0)