summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Zhilkin2025-01-11 14:46:05 +0000
committerHauke Mehrtens2025-01-20 23:39:33 +0000
commitf5fd378e849e20823ce663351977f6f6d0a7dbac (patch)
tree15a8d28586251c7e77a6ea6e950bb42ae2d57782
parent4081bc3f6cb61df7b9608d6bdc0a103ab0c06d35 (diff)
downloadopenwrt-f5fd378e849e20823ce663351977f6f6d0a7dbac.tar.gz
mediatek: replace multiple fw_setenv calls by the bulk one
This commit replaces multiple fw_setenv calls by the bulk one to reduce flash writes. Thanks @Linaro1985 for the idea. Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com> Link: https://github.com/openwrt/openwrt/pull/17580 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (cherry picked from commit a6b0abf4661e4dc1449494e46340f75c44df81de)
-rwxr-xr-xtarget/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
index 2ad92b2f56..11bfad2e7b 100755
--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
@@ -40,13 +40,15 @@ xiaomi_initial_setup()
return 0
fi
- fw_setenv boot_wait on
- fw_setenv uart_en 1
- fw_setenv flag_boot_rootfs 0
- fw_setenv flag_last_success 1
- fw_setenv flag_boot_success 1
- fw_setenv flag_try_sys1_failed 8
- fw_setenv flag_try_sys2_failed 8
+ fw_setenv -s - <<-EOF
+ boot_wait on
+ uart_en 1
+ flag_boot_rootfs 0
+ flag_last_success 1
+ flag_boot_success 1
+ flag_try_sys1_failed 8
+ flag_try_sys2_failed 8
+ EOF
local board=$(board_name)
case "$board" in