From cbc3f04361f9e8602e0359317f255f5db70ac98f Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 15 Feb 2021 18:29:22 -0600 Subject: Add a supercap-full check to flash_upgrade --- recipes-core/initscripts/initscripts-1.0/umountfs | 10 ++++++++++ recipes-core/initscripts/initscripts_1.0.bbappend | 2 +- 2 files changed, 11 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 0827d72..b044a4a 100644 --- a/recipes-core/initscripts/initscripts-1.0/umountfs +++ b/recipes-core/initscripts/initscripts-1.0/umountfs @@ -80,11 +80,21 @@ err_leds() { flash_upgrade() { supercap=$(mts-io-sysfs show capability/supercap 2>/dev/null) if ((supercap == 1)) ; then + count=0 + while ((count < 180)) ; do 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 + full=$(mts-io-sysfs show supercap-full) + if ((full == 1)); then + break # Continue with flash + fi + logger -s -t 'flash_upgrade' -p daemon.err 'Supercap is not yet full. Wait for flash upgrade.' + ((count++)) + sleep 1 + done # Looping on 3 minute timeout fi if [ $# -ne 1 ]; then echo "need to specify flash-root" diff --git a/recipes-core/initscripts/initscripts_1.0.bbappend b/recipes-core/initscripts/initscripts_1.0.bbappend index c07757c..537fbee 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 .= ".45" +PR .= ".46" -- cgit v1.2.3