From befe258b96827692ad755067ba244940cc720e76 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Mon, 27 Feb 2017 17:23:08 -0400 Subject: [PATCH] AK2: repair unpackelf support on repeat dirty flashes - on Sony devices supporting standard boot.img on unloacked bootloaders first AK2 flash would convert from ELF to boot.img, but second flash would attempt to use unpackelf again and fail, so fallback to unpackbootimg - requires updated unpackelf binary for Sony ELF devices (see: https://github.com/osm0sis/unpackelf) --- tools/ak2-core.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ak2-core.sh b/tools/ak2-core.sh index 98ad57d..3476c74 100755 --- a/tools/ak2-core.sh +++ b/tools/ak2-core.sh @@ -32,7 +32,7 @@ dump_boot() { else dd if=$block of=/tmp/anykernel/boot.img; fi; - if [ -f "$bin/unpackelf" ]; then + if [ -f "$bin/unpackelf" -a "$($bin/unpackelf -i /tmp/anykernel/boot.img -h -q; echo $?)" != 0 ]; then $bin/unpackelf -i /tmp/anykernel/boot.img -o $split_img; mv -f $split_img/boot.img-ramdisk.cpio.gz $split_img/boot.img-ramdisk.gz; else