Skip to content

Commit c111a68

Browse files
sudhanshukumar22lguohan
authored andcommitted
[docker-lldp]: sonic advertise meaningful SysDescription instead of debian (sonic-net#6114)
Sonic devices advertise meaningful system description along with Debian package information. before the fix: ------------- admin@sonic:~$ show lldp neighbors ------------------------------------------------------------------------------- LLDP neighbors: ------------------------------------------------------------------------------- Interface: Ethernet0, via: LLDP, RID: 3, Time: 0 day, 16:36:30 SysName: sonic SysDescr: Debian GNU/Linux 9 (stretch) Linux 4.9.0-11-2-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64 ------------------------------------------------------------------------------- After the fix: root@sonic:~# show lldp neighbors Ethernet16 ------------------------------------------------------------------------------- LLDP neighbors: ------------------------------------------------------------------------------- Interface: Ethernet16, via: LLDP, RID: 10, Time: 0 day, 00:01:00 SysName: sonic SysDescr: SONiC Software Version: SONiC.sonic_upstream_1.0_daily_201130_1501_62-dirty-20201130.203529 - HwSku: Accton-AS7816-64X - Distribution: Debian 10.6 - Kernel: 4.19.0-9-2-amd64 ------------------------------------------------------------------------------- Signed-off-by: sudhanshukumar22 <[email protected]>
1 parent 7305b55 commit c111a68

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

dockers/docker-lldp/Dockerfile.j2

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ COPY ["start.sh", "/usr/bin/"]
4343
COPY ["waitfor_lldp_ready.sh", "/usr/bin/"]
4444
COPY ["supervisord.conf.j2", "/usr/share/sonic/templates/"]
4545
COPY ["lldpd.conf.j2", "/usr/share/sonic/templates/"]
46+
COPY ["lldpdSysDescr.conf.j2", "/usr/share/sonic/templates/"]
4647
COPY ["lldpd", "/etc/default/"]
4748
COPY ["lldpmgrd", "/usr/bin/"]
4849
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
configure system description "SONiC Software Version: SONiC.{{ build_version }} - HwSku: {{ DEVICE_METADATA['localhost']['hwsku'] }} - Distribution: Debian {{ debian_version }} - Kernel: {{ kernel_version }}"

dockers/docker-lldp/start.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/usr/bin/env bash
2+
CFGGEN_PARAMS=" \
3+
-d \
4+
-t /usr/share/sonic/templates/lldpd.conf.j2 \
5+
-y /etc/sonic/sonic_version.yml \
6+
-t /usr/share/sonic/templates/lldpdSysDescr.conf.j2 \
7+
"
28

39
if [ "${RUNTIME_OWNER}" == "" ]; then
410
RUNTIME_OWNER="kube"
@@ -10,7 +16,7 @@ then
1016
${CTR_SCRIPT} -f lldp -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION}
1117
fi
1218

13-
sonic-cfggen -d -t /usr/share/sonic/templates/lldpd.conf.j2 > /etc/lldpd.conf
19+
sonic-cfggen $CFGGEN_PARAMS > /etc/lldpd.conf
1420

1521
mkdir -p /var/sonic
1622
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status

0 commit comments

Comments
 (0)