From 32a52a13dfcb00a78a55ec80e5737e686e85bf53 Mon Sep 17 00:00:00 2001 From: mssonicbld <79238446+mssonicbld@users.noreply.github.com> Date: Mon, 21 Aug 2023 06:27:54 +0800 Subject: [PATCH] [E1031] add platform specific reboot command support (#15889) (#16216) --- device/celestica/x86_64-cel_e1031-r0/platform_reboot | 9 +++++++++ .../x86_64-cel_e1031-r0/platform_update_reboot_cause | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100755 device/celestica/x86_64-cel_e1031-r0/platform_reboot create mode 100755 device/celestica/x86_64-cel_e1031-r0/platform_update_reboot_cause diff --git a/device/celestica/x86_64-cel_e1031-r0/platform_reboot b/device/celestica/x86_64-cel_e1031-r0/platform_reboot new file mode 100755 index 000000000000..3bcaf6a8af09 --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/platform_reboot @@ -0,0 +1,9 @@ +#!/bin/bash + +declare -r CPLD_SETREG_PATH="/sys/bus/platform/devices/e1031.smc/setreg" + +sync ; sync +umount -fa > /dev/null 2&>1 + +# Board level power cycle +echo "0x0113 0xAA" > ${CPLD_SETREG_PATH} diff --git a/device/celestica/x86_64-cel_e1031-r0/platform_update_reboot_cause b/device/celestica/x86_64-cel_e1031-r0/platform_update_reboot_cause new file mode 100755 index 000000000000..9ffb2129c87f --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/platform_update_reboot_cause @@ -0,0 +1,8 @@ +#!/bin/bash + +REBOOT_USER=$(logname) +REBOOT_TIME=$(date) +declare -r REBOOT_CAUSE_FILE="/host/reboot-cause/reboot-cause.txt" + +echo "User issued 'reboot' with platform-specific command [User: ${REBOOT_USER}, Time: ${REBOOT_TIME}]" > ${REBOOT_CAUSE_FILE} +sync