diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install index 9aae95a161f7..b9b6abbb35e0 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install @@ -2,8 +2,9 @@ s6100/scripts/iom_power_*.sh usr/local/bin s6100/scripts/s6100_platform.sh usr/local/bin common/dell_i2c_utils.sh usr/local/bin common/io_rd_wr.py usr/local/bin +s6100/scripts/platform_reboot_override usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 +s6100/scripts/override.conf /etc/systemd/system/systemd-reboot.service.d common/dell_lpc_mon.sh usr/local/bin -common/platform_reboot usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/platform_sensors.py usr/local/bin s6100/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/platform_watchdog_enable.sh usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9100.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9100.install index 8bfdcd2e9944..bb3d869cf274 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9100.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9100.install @@ -3,7 +3,8 @@ z9100/scripts/z9100_platform.sh usr/local/bin common/dell_i2c_utils.sh usr/local/bin common/dell_lpc_mon.sh usr/local/bin common/io_rd_wr.py usr/local/bin -common/platform_reboot usr/share/sonic/device/x86_64-dell_z9100_c2538-r0 +z9100/scripts/platform_reboot_override usr/share/sonic/device/x86_64-dell_z9100_c2538-r0 +z9100/scripts/override.conf /etc/systemd/system/systemd-reboot.service.d z9100/scripts/platform_sensors.py usr/local/bin z9100/scripts/sensors usr/bin z9100/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/x86_64-dell_z9100_c2538-r0 diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/override.conf b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/override.conf new file mode 100644 index 000000000000..cd7458e7a8b2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/override.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=/usr/share/sonic/device/x86_64-dell_s6100_c2538-r0/platform_reboot_override diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_reboot_override b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_reboot_override new file mode 100755 index 000000000000..3e165630658b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_reboot_override @@ -0,0 +1,25 @@ +#!/usr/bin/python +import sys +import os +import struct + +PORT_RES = '/dev/port' + + +def portio_reg_write(resource, offset, val): + fd = os.open(resource, os.O_RDWR) + if(fd < 0): + print 'file open failed %s" % resource' + return + if(os.lseek(fd, offset, os.SEEK_SET) != offset): + print 'lseek failed on %s' % resource + return + ret = os.write(fd, struct.pack('B', val)) + if(ret != 1): + print 'write failed %d' % ret + return + os.close(fd) + +if __name__ == "__main__": + portio_reg_write(PORT_RES, 0xcf9, 0xe) + diff --git a/platform/broadcom/sonic-platform-modules-dell/z9100/scripts/override.conf b/platform/broadcom/sonic-platform-modules-dell/z9100/scripts/override.conf new file mode 100644 index 000000000000..2b3b32546615 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/z9100/scripts/override.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=/usr/share/sonic/device/x86_64-dell_z9100_c2538-r0/platform_reboot_override diff --git a/platform/broadcom/sonic-platform-modules-dell/z9100/scripts/platform_reboot_override b/platform/broadcom/sonic-platform-modules-dell/z9100/scripts/platform_reboot_override new file mode 100755 index 000000000000..3e165630658b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/z9100/scripts/platform_reboot_override @@ -0,0 +1,25 @@ +#!/usr/bin/python +import sys +import os +import struct + +PORT_RES = '/dev/port' + + +def portio_reg_write(resource, offset, val): + fd = os.open(resource, os.O_RDWR) + if(fd < 0): + print 'file open failed %s" % resource' + return + if(os.lseek(fd, offset, os.SEEK_SET) != offset): + print 'lseek failed on %s' % resource + return + ret = os.write(fd, struct.pack('B', val)) + if(ret != 1): + print 'write failed %d' % ret + return + os.close(fd) + +if __name__ == "__main__": + portio_reg_write(PORT_RES, 0xcf9, 0xe) +