From 4731595e882c401e05daa4f2ddac9a9732d75f83 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Fri, 27 Nov 2020 18:02:22 -0400 Subject: [PATCH] AK3: unlock blocks before flash to handle post-incremental-OTA cases --- tools/ak3-core.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ak3-core.sh b/tools/ak3-core.sh index 79f3a32..96d34ca 100755 --- a/tools/ak3-core.sh +++ b/tools/ak3-core.sh @@ -391,6 +391,7 @@ flash_boot() { elif [ "$(wc -c < boot-new.img)" -gt "$(wc -c < boot.img)" ]; then abort "New image larger than boot partition. Aborting..."; fi; + blockdev --setrw $block 2>/dev/null; if [ -f "$bin/flash_erase" -a -f "$bin/nandwrite" ]; then $bin/flash_erase $block 0 0; $bin/nandwrite -p $block boot-new.img; @@ -422,6 +423,7 @@ flash_dtbo() { if [ ! -e "$dtboblock" ]; then abort "dtbo partition could not be found. Aborting..."; fi; + blockdev --setrw $dtboblock 2>/dev/null; if [ -f "$bin/flash_erase" -a -f "$bin/nandwrite" ]; then $bin/flash_erase $dtboblock 0 0; $bin/nandwrite -p $dtboblock $dtbo;