Automatically re-sign ChromeOS images on repack

Instead of requiring scripts to detect ChromeOS images and sign them
after repacking, preallocate the vblock and append the kernel blob
trailer while repacking, then generate the vblock after all other
patching is done. The image is padded to its original size after
signing, same as other boot images.

The signer now only takes the kernel payload and returns the vblock,
hashing the kernel blob incrementally. The sign-chromeos action
streams its output to disk instead of building the whole signed
image in memory.

Since ChromeOS images no longer need special handling, unpack no
longer returns 2 for them, and all ChromeOS logic is removed from
the scripts.

Assisted-by: Claude Opus 5.5
This commit is contained in:
topjohnwu
2026-10-06 23:36:12 +00:00
parent da50b5586f
commit 43afdf16a8
7 changed files with 113 additions and 66 deletions
+3 -1
View File
@@ -37,7 +37,7 @@ Supported actions:
dumped to the file 'header', which can be used to modify header
configurations during repacking.
Return values:
0:valid 1:error 2:chromeos 3:vendor_boot
0:valid 1:error 3:vendor_boot
repack [-n] <origbootimg> [outbootimg]
Repack boot image components using files from the current directory
@@ -52,6 +52,8 @@ Supported actions:
If '-n' is provided, all compression operations will be skipped.
If env variable PATCHVBMETAFLAG is set to true, all disable flags in
the boot image's vbmeta header will be set.
ChromeOS boot images will be automatically re-signed with the
developer keys bundled in the executable.
verify <bootimg> [x509.pem]
Check whether the boot image is signed with AVB 1.0 signature.