From beff4d4596645fe4ebc0cfec064689b9cc54a2e3 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Tue, 8 Jun 2021 16:24:20 -0300 Subject: [PATCH] AK3: ensure dtbo does not get flashed twice in multi-partition setups --- tools/ak3-core.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/ak3-core.sh b/tools/ak3-core.sh index 88c57bf..5df701f 100755 --- a/tools/ak3-core.sh +++ b/tools/ak3-core.sh @@ -418,12 +418,13 @@ flash_dtbo() { fi; done; - if [ "$dtbo" ]; then + if [ "$dtbo" -a ! -f dtbo_flashed ]; then dtboblock=/dev/block/bootdevice/by-name/dtbo$slot; if [ ! -e "$dtboblock" ]; then abort "dtbo partition could not be found. Aborting..."; fi; blockdev --setrw $dtboblock 2>/dev/null; + ui_print " " "$dtboblock"; if [ -f "$bin/flash_erase" -a -f "$bin/nandwrite" ]; then $bin/flash_erase $dtboblock 0 0; $bin/nandwrite -p $dtboblock $dtbo; @@ -436,6 +437,7 @@ flash_dtbo() { if [ $? != 0 ]; then abort "Flashing dtbo failed. Aborting..."; fi; + touch dtbo_flashed; fi; } ### write_boot (repack ramdisk then build, sign and write image and dtbo)