This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/platform
Sudharsan Dhamal Gopalarathnam 119789719d
[202205][Mellanox]Check dmi file permission before access (#11346)
* [Mellanox]Check dmi file permission before access (#11309)

Signed-off-by: Sudharsan Dhamal Gopalarathnam sudharsand@nvidia.com

Why I did it
During the system boot up when 'show platform status' or 'show version' command is executed before STATE_DB CHASSIS_INFO table is populated, the show will try to fallback to use the platform API. The DMI file in mellanox platforms require root permission for access. So if the show commands are executed as admin or any other user, the following error log will appear in the syslog

Jun 28 17:21:25.612123 sonic ERR show: Fail to decode DMI /sys/firmware/dmi/entries/2-0/raw due to PermissionError(13, 'Permission denied')

How I did it
Check the file permission before accessing it.

How to verify it
Added UT to verify. Manually verified if the error log is not thrown.
2022-07-06 16:13:07 -07:00
..
barefoot [Arista] Update platform submodules (#10800) 2022-05-23 13:28:13 -07:00
broadcom Update platform/broadcom/sonic-platform-modules-nokia (#11107) 2022-06-22 23:09:01 +00:00
cavium Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
centec Update Linux kernel from 5.10.46 to 5.10.103 (#10634) 2022-05-10 13:46:31 -07:00
centec-arm64 Support symcrypt fips config for aboot/uboot (#10729) 2022-06-05 15:20:20 +00:00
checkout Platform/cisco-8000 module for sonic-buildimage (#8172) 2021-08-06 09:11:54 +08:00
components Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
generic [dockers] Rename 'docker-snmp-sv2' to 'docker-snmp' (#4699) 2020-06-11 16:04:23 -07:00
innovium Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
marvell [202205][BRCM_SAI] update Brcm SAI dependencies (#11173) 2022-06-17 05:02:00 -07:00
marvell-arm64 Support symcrypt fips config for aboot/uboot (#10729) 2022-06-05 15:20:20 +00:00
marvell-armhf [Marvell] Update armhf sai deb (#11296) 2022-07-05 16:11:39 +00:00
mellanox [202205][Mellanox]Check dmi file permission before access (#11346) 2022-07-06 16:13:07 -07:00
nephos Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
p4 Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
pddf Fix for Accton platform build failure when doing incremental build (#10541) 2022-05-09 12:17:38 -07:00
template Upgrade mellanox platform containers (syncd / saiserver / syncd-rpc) and pmon to bullseye (#10580) 2022-05-10 12:45:28 +03:00
vs [asan] add print_suppressions=0 to ASAN configs (#11252) 2022-06-28 16:11:05 +00:00