Skip to content

Commit

Permalink
bootsignature: includes dt image size for signed boot image
Browse files Browse the repository at this point in the history
BootSignature truncates the bootimage since dt image size wasn't
considered while calculating the signable bootimage size and thus
target fails to boot. This patch includes the device tree size in
the boot image and prevents it from truncating it and makes the
target boot fine.

[Jarl-Penguin]: Adapted for Android 12

Issue-id: YAM-27
Change-Id: Ieaa396159130875768231602cd58eb865d222872
  • Loading branch information
Ankit Gupta authored and mracar07 committed Aug 27, 2022
1 parent ca39788 commit bc8a567
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions verity/BootSignature.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ public static int getSignableImageSize(byte[] data) throws Exception {
"Invalid image header: invalid header length");
}
}
if (headerVersion > 4) {
length = length + ((headerVersion + pageSize - 1) / pageSize) * pageSize;
}

length = ((length + pageSize - 1) / pageSize) * pageSize;

Expand Down

0 comments on commit bc8a567

Please sign in to comment.