From 9a422725ab9a59f7f22c0a7dfeac4a6384814ed3 Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 12 Feb 2021 11:26:10 -0600 Subject: Do not do flash upgrade if no power --- recipes-core/initscripts/initscripts-1.0/umountfs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'recipes-core/initscripts/initscripts-1.0') diff --git a/recipes-core/initscripts/initscripts-1.0/umountfs b/recipes-core/initscripts/initscripts-1.0/umountfs index 07379c4..0827d72 100644 --- a/recipes-core/initscripts/initscripts-1.0/umountfs +++ b/recipes-core/initscripts/initscripts-1.0/umountfs @@ -78,6 +78,14 @@ err_leds() { flash_upgrade() { + supercap=$(mts-io-sysfs show capability/supercap 2>/dev/null) + if ((supercap == 1)) ; then + powerfail=$(mts-io-sysfs show power-fail) + if ((powerfail == 1)) ; then + logger -s -t 'flash_upgrade' -p daemon.err 'Power has failed. Skipping flash upgrade. Try again later' + return + fi + fi if [ $# -ne 1 ]; then echo "need to specify flash-root" return -- cgit v1.2.3