aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorRodrigo Balerdi <lanchon@gmail.com>2022-04-15 07:20:28 -0300
committerDaniel Golle <daniel@makrotopia.org>2022-04-19 16:28:25 +0100
commit9ba28f978c76692876f4f5bc7ad66e8fc73084fb (patch)
tree542fdd4cd75c051beab6c63dc6450835e9a0fdf8 /package/base-files
parent9a2f08f6e704d733fea88b6b511f2fa06b8039f4 (diff)
downloadupstream-9ba28f978c76692876f4f5bc7ad66e8fc73084fb.tar.gz
upstream-9ba28f978c76692876f4f5bc7ad66e8fc73084fb.tar.bz2
upstream-9ba28f978c76692876f4f5bc7ad66e8fc73084fb.zip
base-files: minimize critical time in sysupgrade
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>
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/files/lib/upgrade/nand.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh
index 371bdf7d77..5ecdb0ff23 100644
--- a/package/base-files/files/lib/upgrade/nand.sh
+++ b/package/base-files/files/lib/upgrade/nand.sh
@@ -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
}