Skip to content

Commit

Permalink
base-files: minimize critical time in sysupgrade
Browse files Browse the repository at this point in the history
Attempt to minimize the time during which an interrupted nand sysupgrade
can lead to a non-functional device by flushing caches before starting
the upgrade procedure.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
  • Loading branch information
Lanchon authored and dangowrt committed Apr 19, 2022
1 parent 9a2f08f commit 9ba28f9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions package/base-files/files/lib/upgrade/nand.sh
Expand Up @@ -335,15 +335,16 @@ nand_upgrade_tar() {

# Recognize type of passed file and start the upgrade process
nand_do_upgrade() {
local file_type=$(identify $1)
local file_type=$(identify "$1")

[ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART=rootfs

sync
case "$file_type" in
"fit") nand_upgrade_fit $1;;
"ubi") nand_upgrade_ubinized $1;;
"ubifs") nand_upgrade_ubifs $1;;
*) nand_upgrade_tar $1;;
"fit") nand_upgrade_fit "$1";;
"ubi") nand_upgrade_ubinized "$1";;
"ubifs") nand_upgrade_ubifs "$1";;
*) nand_upgrade_tar "$1";;
esac
}

Expand Down

0 comments on commit 9ba28f9

Please sign in to comment.