Adding GKI signature in boot.img v4
The GKI will be verified in VTS, to ensure the boot.img contains
a valid generic kernel and ramdisk for release.
Note that the device bootloader should only verify boot.img
integrity against the boot vbmeta at the end of the boot partition
(or in the top-level vbmeta partition) in the Android Verified Boot
process. The bootloader need not check boot.img integrity against
this newly added boot signature.
This change adds a 4096 bytes of the boot image signature in
boot image v4. This is done by invoking `avbtool add_hash_footer ...`
to output the signed vbmeta to a separate file then appends it after
the ramdisk. This is done by supplying the following options for
avbtool:
--output_vbmeta_image
--do_not_append_vbmeta_image
The overall layout change in boot image v4 is as follows:
+---------------------+
| boot header | 4096 bytes
+---------------------+
| kernel | m pages
+---------------------+
| ramdisk | n pages
+---------------------+
| boot signature | g pages (new in boot.img v4)
+---------------------+
m = (kernel_size + 4096 - 1) / 4096
n = (ramdisk_size + 4096 - 1) / 4096
g = (signature_size + 4096 - 1) / 4096
Bug: 177862434
Test: atest --host mkbootimg_test
Change-Id: I9967d06bde0e18a12b84b5b0b568db09765fe305
6 files changed