From 79e014efcb1678226ec2f1cbd23db84bb8c19271 Mon Sep 17 00:00:00 2001 From: Santhosh Kumar T <53558409+santhosh-kt@users.noreply.github.com> Date: Tue, 2 Aug 2022 22:25:49 +0530 Subject: [PATCH] [DellEMC] S6100 Platform Service optimization porting in 202205 (#11329) To reduce rc.local script execution time. Porting changes from [DellEMC] S6100 Platform Service optimization #10989 Changes: Moving platform-modules-s6100.service and s6100-lpc-monitor.service asynchronous to rc.local script. --- .../debian/platform-modules-s6100.init | 40 ------------------ .../debian/platform-modules-s6100.postinst | 6 +-- .../sonic-platform-modules-dell/debian/rules | 3 ++ .../s6100/scripts/s6100_platform.sh | 41 +++++++++++-------- .../systemd/platform-modules-s6100.service | 2 +- .../systemd/s6100-platform-startup.service | 2 +- 6 files changed, 30 insertions(+), 64 deletions(-) delete mode 100755 platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.init diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.init b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.init deleted file mode 100755 index c798b24ef2..0000000000 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.init +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -### BEGIN INIT INFO -# Provides: setup-board -# Required-Start: -# Required-Stop: -# Should-Start: -# Should-Stop: -# Default-Start: S -# Default-Stop: 0 6 -# Short-Description: Setup S6100 board. -### END INIT INFO - -case "$1" in -start) - echo -n "Setting up board... " - - /usr/local/bin/iom_power_on.sh - /usr/local/bin/s6100_platform.sh init - - echo "done." - ;; - -stop) - /usr/local/bin/s6100_platform.sh deinit - echo "done." - - ;; - -force-reload|restart) - echo "Not supported" - ;; - -*) - echo "Usage: /etc/init.d/platform-modules-s6100.init {start|stop}" - exit 1 - ;; -esac - -exit 0 diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.postinst b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.postinst index eda8f7c8a4..78c78fa003 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.postinst +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.postinst @@ -1,11 +1,7 @@ # postinst script for S6100 # Enable Dell-S6100-platform-service -depmod -a systemctl enable platform-modules-s6100.service -systemctl start platform-modules-s6100.service - -systemctl enable s6100-lpc-monitor.service -systemctl start s6100-lpc-monitor.service +systemctl start --no-block platform-modules-s6100.service #DEBHELPER# diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/rules b/platform/broadcom/sonic-platform-modules-dell/debian/rules index 8baafa1407..ab13dbfef0 100755 --- a/platform/broadcom/sonic-platform-modules-dell/debian/rules +++ b/platform/broadcom/sonic-platform-modules-dell/debian/rules @@ -90,6 +90,9 @@ override_dh_auto_install: override_dh_usrlocal: +override_dh_installmodules: + dh_installmodules --no-scripts; + override_dh_clean: dh_clean set -e; \ diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh index 15763bbc9e..34973002dc 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh @@ -3,6 +3,30 @@ #platform init script for Dell S6100 if [[ "$1" == "init" ]]; then + depmod -a + case "$(cat /proc/cmdline)" in + *SONIC_BOOT_TYPE=warm*) + TYPE='warm' + ;; + *SONIC_BOOT_TYPE=fastfast*) + TYPE='fastfast' + ;; + *SONIC_BOOT_TYPE=fast*|*fast-reboot*) + TYPE='fast' + ;; + *SONIC_BOOT_TYPE=soft*) + TYPE='soft' + ;; + *) + TYPE='cold' + esac + + if [[ "$TYPE" == "cold" ]]; then + /usr/local/bin/iom_power_on.sh + fi + + systemctl enable s6100-lpc-monitor.service + systemctl start --no-block s6100-lpc-monitor.service pericom="/sys/bus/pci/devices/0000:08:00.0" modprobe i2c-dev @@ -24,23 +48,6 @@ if [[ "$1" == "init" ]]; then systemctl start --no-block s6100-ssd-upgrade-status.service - case "$(cat /proc/cmdline)" in - *SONIC_BOOT_TYPE=warm*) - TYPE='warm' - ;; - *SONIC_BOOT_TYPE=fastfast*) - TYPE='fastfast' - ;; - *SONIC_BOOT_TYPE=fast*|*fast-reboot*) - TYPE='fast' - ;; - *SONIC_BOOT_TYPE=soft*) - TYPE='soft' - ;; - *) - TYPE='cold' - esac - if [[ "$TYPE" == "cold" ]]; then systemctl start s6100-platform-startup.service else diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/platform-modules-s6100.service b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/platform-modules-s6100.service index 4883ecf268..127426f098 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/platform-modules-s6100.service +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/platform-modules-s6100.service @@ -1,6 +1,6 @@ [Unit] Description=Dell S6100 Platform modules -Before=pmon.service determine-reboot-cause.service +Before=pmon.service determine-reboot-cause.service pcie-check.service system-health.service watchdog-control.service DefaultDependencies=no [Service] diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service index d7a40f4303..ecba7b0063 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service @@ -1,6 +1,6 @@ [Unit] Description=Dell S6100 Platform Startup Service -Before=pmon.service determine-reboot-cause.service +Before=pmon.service determine-reboot-cause.service pcie-check.service system-health.service watchdog-control.service DefaultDependencies=no [Service]