AK3: unlock blocks before flash to handle post-incremental-OTA cases

This commit is contained in:
osm0sis committed 2020-11-27 18:02:22 -04:00
1 parent c137cbf93d
commit 4731595e88
1 file changed
+2
+2
View File
@@ -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;