Skip to content

Commit 462aa14

Browse files
qiluo-msftbyu343
authored andcommitted
Add sysfs mount for pmon container (sonic-net#24017)
Why I did it For platform using sysfs, the current pmon is broken. admin@sonic:~$ docker exec -it pmon bash root@sonic:/# python3 Python 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> open('/sys/class/i2c-adapter/i2c-71/71-0050/eeprom', mode='r+b', buffering=0) Traceback (most recent call last): File "<stdin>", line 1, in <module> OSError: [Errno 30] Read-only file system: '/sys/class/i2c-adapter/i2c-71/71-0050/eeprom' After this fix admin@sonic:~$ docker exec -it pmon bash root@sonic:/# python3 Python 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> open('/sys/class/i2c-adapter/i2c-71/71-0050/eeprom', mode='r+b', buffering=0) <_io.FileIO name='/sys/class/i2c-adapter/i2c-71/71-0050/eeprom' mode='rb+' closefd=True> This regression was introduced by sonic-net#23457
1 parent 9c389b8 commit 462aa14

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rules/docker-platform-monitor.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /host/reboot-cause:/host/reboot-cause:r
5757
$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /host/pmon/stormond:/usr/share/stormond:rw
5858
$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /var/run/platform_cache:/var/run/platform_cache:ro
5959
$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /usr/share/sonic/device/pddf:/usr/share/sonic/device/pddf:ro
60+
# Add sysfs mounts for hardware access
61+
$(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /sys/:/sys/:rw
6062

6163
# Mount Arista python library on Aboot images to be used by plugins
6264
$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/libsfp-eeprom.so:/usr/lib/libsfp-eeprom.so:ro

0 commit comments

Comments
 (0)