Port the `futility vbutil_kernel --pack` code path used to sign
ChromeOS boot images into magiskboot as a new `sign-chromeos` action.
The kernel keyblock and data key are embedded into the executable, and
all signing parameters previously passed in sign_chromeos are
hardcoded. The output is bit-for-bit identical to the reference tool.
Rename the existing `sign` action to `sign-avb1` to disambiguate.
Remove the prebuilt futility binary and stop shipping the chromeos
assets folder; scripts now call magiskboot directly.
Assisted-by: Claude Opus 5.5
The usage blocks in docs/tools.md had drifted behind the actual CLI
output of the tools:
- su: add -d/--drop-cap (added in ff18cb8, missing from docs since 2023)
- resetprop: document wait mode (-w, NAME/OLD_VALUE), --compact,
-P, -Z and the mode-based flag semantics; the old block predated
the wait-mode rewrite entirely
- magiskboot unpack: document the 3:vendor_boot return value
(RETURN_VENDOR in bootimg.cpp)
- magiskboot split: document the -n flag (skip decompression)
- magiskboot cpio: document ls [-r] [PATH], fix test return values
to 0:stock/1:Magisk/2:unsupported (test returns on first match,
the old 'bitwise or-ed' wording was misleading), document the -n
flag of backup ORIG
All blocks now match the usage strings shipped in the binaries
(su.cpp, resetprop/cli.rs, boot/cli.rs, boot/cpio.rs).
Support dynamic zImage piggy payload sizes during repacking by updating
the zImage decompressor stub headers, symbol tables, and GOT entries.
Previously, magiskboot padded repacked zImage files to preserve the
exact original file size. For non-gzip compressed zImages (such as XZ),
repacking with a different payload size broke stub symbol resolution
and resulted in ununpackable or unbootable images.
Key changes:
- Encapsulate zImage parsing and patching in a dedicated struct ZImage
in Rust with CXX FFI, new_head, and new_tail methods.
- Locate piggy_end using table references or GOT table entries bounded
by LC0.
- Relocate LC0 table entries, LC1 table, and GOT table entries with
4-byte padding/alignment when payload size changes.
- Relocate R_ARM_GOTPC PC-relative literal pools in decompressor .text.
- Append uncompressed size for non-gzip algorithms per size_append.
- Remove zopfli compression support across magiskboot as dynamic zImage
piggy sizing supersedes the need for exact size matching.
Fix#9880
Assisted-by: Gemini 3.7 Flash
- actions: Update all actions/checkout references to v4
- magiskboot: Add missing new line to dtb help message
- docs: Update documents, fix some errors and remove outdated info