diff options
Diffstat (limited to 'recipes-core/initscripts/initscripts-1.0')
-rw-r--r-- | recipes-core/initscripts/initscripts-1.0/umountfs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/recipes-core/initscripts/initscripts-1.0/umountfs b/recipes-core/initscripts/initscripts-1.0/umountfs index 07379c4..b044a4a 100644 --- a/recipes-core/initscripts/initscripts-1.0/umountfs +++ b/recipes-core/initscripts/initscripts-1.0/umountfs @@ -78,6 +78,24 @@ 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" return |