Issue signing system image using avbtool
Issue signing system image using avbtool
$ python avbtool info_image --image ../OrigFirmware/system.img
Footer version: 1.0
Image size: 2936012800 bytes
Original image size: 2889601024 bytes
VBMeta offset: 2935390208
VBMeta size: 2624 bytes
--
Minimum libavb version: 1.0
Header Block: 256 bytes
Authentication Block: 576 bytes
Auxiliary Block: 1792 bytes
Algorithm: SHA256_RSA4096
Rollback Index: 0
Flags: 0
Release String: 'avbtool 1.1.0'
Descriptors:
Hashtree descriptor:
Version of dm-verity: 1
Image Size: 2889601024 bytes
Tree Offset: 2889601024
Tree Size: 22761472 bytes
Data Block Size: 4096 bytes
Hash Block Size: 4096 bytes
FEC num roots: 2
FEC offset: 2912362496
FEC size: 23027712 bytes
Hash Algorithm: sha1
Partition Name: system
Salt: 53ba0caa0522fdd899acbe2a86675e173e9236c5262bbce0af54fc9c3410f28d
Root Digest: 0c0d26c3936a1b9999fbf2578dd611104cc8d158
Flags: 0
Kernel Cmdline descriptor:
Flags: 1
Kernel Cmdline: 'dm="1 vroot none ro 1,0 5643752 verity 1 PARTUUID=$(ANDROID_SYSTEM_PARTUUID) PARTUUID=$(ANDROID_SYSTEM_PARTUUID) 4096 4096 705469 705469 sha1 0c0d26c3936a1b9999fbf2578dd611104cc8d158 53ba0caa0522fdd899acbe2a86675e173e9236c5262bbce0af54fc9c3410f28d 10 $(ANDROID_VERITY_MODE) ignore_zero_blocks use_fec_from_device PARTUUID=$(ANDROID_SYSTEM_PARTUUID) fec_roots 2 fec_blocks 711026 fec_start 711026" root=/dev/dm-0'
Kernel Cmdline descriptor:
Flags: 2
Kernel Cmdline: 'root=PARTUUID=$(ANDROID_SYSTEM_PARTUUID)'
$ python avbtool add_hash_footer --image lineage_signed.img --partition_name system --partition_size 2936012800 --key rsa4096_vbmeta.pem --algorithm SHA256_RSA4096
$
$ls -l lineage_signed.img ../OrigFirmware/lineage-17.1-20201215-UNOFFICIAL-treble_arm64_avS.img ../OrigFirmware/system.img
-rw-r--r-- 1 x x 1874698496 Dec 23 16:34 lineage_signed.img
-rw-r--r-- 1 x x 1905398040 Dec 23 14:43 ../OrigFirmware/lineage-17.1-20201215-UNOFFICIAL-treble_arm64_avS.img
-rw-r--r-- 1 x x 2936012800 Dec 23 15:25 ../OrigFirmware/system.img
(23-12-2020, 12:00 PM)romelley ...
When trying to flash the modified file it fails (obviously I have created a vbmeta that will allow the signed system image). Any help or tips on how to correctly sign the lineage system image would be appreciated. Including any information on why it isnt being padded/expanded to the correct size.
fastboot flash -S 100M system system.img
fastboot erase userdata
(25-12-2020, 11:40 PM)xufa Hi.
I have the same G5K6, I have unlocked the bootloader, then created the custom vbmeta with the custom key for the boot partition, then created the boot image with magisk and signed with avbtool preserving the stock boot.img size,l then I flashed smoothly both images however I always get a boot loop, I havent managed to boot the tablet after flashing.
Can you send me your vbmeta and boot images? maybe these work also in my tablet.
I am desperated, keep trying and following all the guides in this webpage however there is nothing that works in my tablet.
I also tried this
fastboot -S 100M system system.img
after signing vbmeta for the system partition, and again I get a boot loop.
Am I missing something?
(04-01-2021, 01:03 PM)X3non(25-12-2020, 11:40 PM)xufa Hi.
I have the same G5K6, I have unlocked the bootloader, then created the custom vbmeta with the custom key for the boot partition, then created the boot image with magisk and signed with avbtool preserving the stock boot.img size,l then I flashed smoothly both images however I always get a boot loop, I havent managed to boot the tablet after flashing.
Can you send me your vbmeta and boot images? maybe these work also in my tablet.
I am desperated, keep trying and following all the guides in this webpage however there is nothing that works in my tablet.
I also tried this
fastboot -S 100M system system.img
after signing vbmeta for the system partition, and again I get a boot loop.
Am I missing something?
firmware for g5k6 is listed @ https://www.hovatek.com/forum/thread-20913.html ; should be able to fix and root your device using the firmware
(25-12-2020, 10:10 AM)hovatek(23-12-2020, 12:00 PM)romelley ...
When trying to flash the modified file it fails (obviously I have created a vbmeta that will allow the signed system image). Any help or tips on how to correctly sign the lineage system image would be appreciated. Including any information on why it isnt being padded/expanded to the correct size.
Without signing the system image, try this command
Code:fastboot -S 100M system system.img
fastboot erase userdata
Let me know what happens
sudo ./fastboot -S 100M flash system /media/ubuntu/writable/test/lineage-17.1-20201215-UNOFFICIAL-treble_arm64_avS.img
sending sparse 'system' 1/19 (102396 KB)...
OKAY [ 5.621s]
writing 'system' 1/19...
OKAY [ 3.616s]
sending sparse 'system' 2/19 (102396 KB)...
OKAY [ 5.703s]
writing 'system' 2/19...
OKAY [ 3.628s]
sending sparse 'system' 3/19 (102396 KB)...
OKAY [ 5.892s]
writing 'system' 3/19...
OKAY [ 3.600s]
sending sparse 'system' 4/19 (102396 KB)...
OKAY [ 5.741s]
writing 'system' 4/19...
OKAY [ 3.630s]
sending sparse 'system' 5/19 (102396 KB)...
OKAY [ 5.955s]
writing 'system' 5/19...
OKAY [ 3.606s]
sending sparse 'system' 6/19 (102396 KB)...
OKAY [ 5.725s]
writing 'system' 6/19...
OKAY [ 3.604s]
sending sparse 'system' 7/19 (102396 KB)...
OKAY [ 5.643s]
writing 'system' 7/19...
OKAY [ 3.641s]
sending sparse 'system' 8/19 (102396 KB)...
OKAY [ 6.020s]
writing 'system' 8/19...
OKAY [ 3.605s]
sending sparse 'system' 9/19 (96964 KB)...
OKAY [ 5.735s]
writing 'system' 9/19...
OKAY [ 3.423s]
sending sparse 'system' 10/19 (102396 KB)...
OKAY [ 5.985s]
writing 'system' 10/19...
OKAY [ 3.603s]
sending sparse 'system' 11/19 (102396 KB)...
OKAY [ 5.875s]
writing 'system' 11/19...
OKAY [ 3.600s]
sending sparse 'system' 12/19 (102396 KB)...
OKAY [ 6.133s]
writing 'system' 12/19...
OKAY [ 3.637s]
sending sparse 'system' 13/19 (102396 KB)...
OKAY [ 5.946s]
writing 'system' 13/19...
OKAY [ 3.606s]
sending sparse 'system' 14/19 (102396 KB)...
OKAY [ 5.982s]
writing 'system' 14/19...
OKAY [ 3.602s]
sending sparse 'system' 15/19 (102396 KB)...
OKAY [ 6.053s]
writing 'system' 15/19...
OKAY [ 3.618s]
sending sparse 'system' 16/19 (102396 KB)...
OKAY [ 6.105s]
writing 'system' 16/19...
OKAY [ 3.605s]
sending sparse 'system' 17/19 (102396 KB)...
OKAY [ 6.076s]
writing 'system' 17/19...
OKAY [ 3.601s]
sending sparse 'system' 18/19 (95452 KB)...
OKAY [ 5.647s]
writing 'system' 18/19...
OKAY [ 3.387s]
sending sparse 'system' 19/19 (29988 KB)...
OKAY [ 1.781s]
writing 'system' 19/19...
OKAY [ 1.128s]
finished. total time: 173.360s
sudo ./fastboot erase userdata
erasing 'userdata'...
OKAY [ 0.208s]
finished. total time: 0.208s
(25-12-2020, 10:10 AM)hovatek(23-12-2020, 12:00 PM)romelley ...
When trying to flash the modified file it fails (obviously I have created a vbmeta that will allow the signed system image). Any help or tips on how to correctly sign the lineage system image would be appreciated. Including any information on why it isnt being padded/expanded to the correct size.
Without signing the system image, try this command
Code:fastboot -S 100M system system.img
fastboot erase userdata
Let me know what happens
python avbtool add_hash_footer --image /media/ubuntu/writable/test/lineage-17.1-20201215-UNOFFICIAL-treble_arm64_avS.img --partition_name system --partition_size 2936012800 --key rsa4096_vbmeta.pem --algorithm SHA256_RSA4096
python avbtool info_image --image /media/ubuntu/writable/test/lineage-17.1-20201215-UNOFFICIAL-treble_arm64_avS.img
Footer version: 1.0
Image size: 2936012800 bytes
Original image size: 1937219584 bytes
VBMeta offset: 1937219584
VBMeta size: 2112 bytes
--
Minimum libavb version: 1.0 (Sparse)
Header Block: 256 bytes
Authentication Block: 576 bytes
Auxiliary Block: 1280 bytes
Algorithm: SHA256_RSA4096
Rollback Index: 0
Flags: 0
Release String: 'avbtool 1.1.0'
Descriptors:
Hash descriptor:
Image Size: 1937219584 bytes
Hash Algorithm: sha256
Partition Name: system
Salt: d0e07645d02fe4868daa1b8c29f198c2fee08b7bbbb80cf7aa14163b81b1f0c6
Digest: 481005bd79b46c1b51ee8a31794ab7b507a2ea93f7e55b31aa609497da1c927e
Flags: 0
python avbtool info_image --image /media/ubuntu/writable/test/lineage-17.1-20201215-UNOFFICIAL-treble_arm64_avS.img
Footer version: 1.0
Image size: 2936012800 bytes
Original image size: 1937219584 bytes
VBMeta offset: 1937219584
VBMeta size: 2112 bytes
--
Minimum libavb version: 1.0 (Sparse)
Header Block: 256 bytes
Authentication Block: 576 bytes
Auxiliary Block: 1280 bytes
Algorithm: SHA256_RSA4096
Rollback Index: 0
Flags: 0
Release String: 'avbtool 1.1.0'
Descriptors:
Hash descriptor:
Image Size: 1937219584 bytes
Hash Algorithm: sha256
Partition Name: system
Salt: d0e07645d02fe4868daa1b8c29f198c2fee08b7bbbb80cf7aa14163b81b1f0c6
Digest: 481005bd79b46c1b51ee8a31794ab7b507a2ea93f7e55b31aa609497da1c927e
Flags: 0
sudo ./fastboot flash vbmeta ../vbmeta_custom.img
target didn't report max-download-size
sending 'vbmeta' (1024 KB)...
OKAY [ 0.053s]
writing 'vbmeta'...
OKAY [ 0.377s]
finished. total time: 0.430s
sudo ./fastboot -S 100M flash system /media/ubuntu/writable/test/lineage-17.1-20201215-UNOFFICIAL-treble_arm64_avS.img
sending sparse 'system' 1/18 (102396 KB)...
OKAY [ 6.124s]
writing 'system' 1/18...
OKAY [ 3.618s]
sending sparse 'system' 2/18 (102396 KB)...
OKAY [ 5.976s]
writing 'system' 2/18...
OKAY [ 3.647s]
sending sparse 'system' 3/18 (102396 KB)...
OKAY [ 5.962s]
writing 'system' 3/18...
OKAY [ 3.632s]
sending sparse 'system' 4/18 (102396 KB)...
OKAY [ 5.891s]
writing 'system' 4/18...
OKAY [ 3.629s]
sending sparse 'system' 5/18 (102396 KB)...
OKAY [ 5.887s]
writing 'system' 5/18...
OKAY [ 3.623s]
sending sparse 'system' 6/18 (102396 KB)...
OKAY [ 6.114s]
writing 'system' 6/18...
OKAY [ 3.647s]
sending sparse 'system' 7/18 (102396 KB)...
OKAY [ 5.834s]
writing 'system' 7/18...
OKAY [ 3.631s]
sending sparse 'system' 8/18 (102396 KB)...
OKAY [ 6.143s]
writing 'system' 8/18...
OKAY [ 3.620s]
sending sparse 'system' 9/18 (96964 KB)...
OKAY [ 5.701s]
writing 'system' 9/18...
OKAY [ 3.431s]
sending sparse 'system' 10/18 (102396 KB)...
OKAY [ 5.899s]
writing 'system' 10/18...
OKAY [ 3.639s]
sending sparse 'system' 11/18 (102396 KB)...
OKAY [ 6.045s]
writing 'system' 11/18...
OKAY [ 3.616s]
sending sparse 'system' 12/18 (102396 KB)...
OKAY [ 5.926s]
writing 'system' 12/18...
OKAY [ 3.635s]
sending sparse 'system' 13/18 (102396 KB)...
OKAY [ 5.993s]
writing 'system' 13/18...
OKAY [ 3.656s]
sending sparse 'system' 14/18 (102396 KB)...
OKAY [ 6.137s]
writing 'system' 14/18...
OKAY [ 3.633s]
sending sparse 'system' 15/18 (102396 KB)...
OKAY [ 6.111s]
writing 'system' 15/18...
OKAY [ 3.655s]
sending sparse 'system' 16/18 (102396 KB)...
OKAY [ 6.011s]
writing 'system' 16/18...
OKAY [ 3.658s]
sending sparse 'system' 17/18 (102396 KB)...
OKAY [ 5.818s]
writing 'system' 17/18...
OKAY [ 3.634s]
sending sparse 'system' 18/18 (95460 KB)...
OKAY [ 5.692s]
writing 'system' 18/18...
OKAY [ 3.441s]
finished. total time: 172.313s
sudo ./fastboot erase userdata
erasing 'userdata'...
OKAY [ 0.613s]
finished. total time: 0.613s
(05-01-2021, 04:47 PM)xufa ...