From 1bb19350497986cf795c8d37537a1344d8ec7049 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 ++++++++ recipes-core/initscripts/initscripts_1.0.bbappend | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'recipes-core/initscripts') 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 diff --git a/recipes-core/initscripts/initscripts_1.0.bbappend b/recipes-core/initscripts/initscripts_1.0.bbappend index c5bd486..c07757c 100644 --- a/recipes-core/initscripts/initscripts_1.0.bbappend +++ b/recipes-core/initscripts/initscripts_1.0.bbappend @@ -3,4 +3,4 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" # flash on reboot/umountfs needs regular umount (not busybox) RDEPENDS_${PN} += "util-linux-umount util-linux-mount bash" -PR .= ".44" +PR .= ".45" -- cgit v1.2.3