feat(gui): Add an optional testkey bootloader step to Firmware Flash - #96
Merged
Conversation
miner7222
force-pushed
the
feat/flash-optional-abl-bootloader
branch
from
September 4, 2026 06:53
ab66302 to
6befdd5
Compare
Lenovo-key firmware now resolves its signing key and model at the folder step, and a supplied testkey abl.elf lets the run re-sign without probing the device's own bootloader key. Co-authored-by: Claude (claude-opus-5) <noreply@anthropic.com> Co-authored-by: Codex (gpt-5.6-sol) <noreply@openai.com>
miner7222
force-pushed
the
feat/flash-optional-abl-bootloader
branch
from
September 4, 2026 10:11
6befdd5 to
224e0b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Installing testkey-signed firmware on a device whose bootloader trusts the Lenovo key previously meant downgrading the entire firmware first, just to get back to a bootloader that would accept the re-signed chain. That is slow, risky, and throws away the newer build the user actually wanted.
This lets the user hand LTBox a bootloader that still trusts the existing key. The run then re-signs the required partitions and flashes the supplied
abl.elfat the end, so the device boots the new firmware without a full-firmware downgrade.What changed
Firmware identity moves to the folder step. Pressing Next on the firmware folder now inspects
vbmeta_system.imgonce, reports the signing key and the model from the build fingerprint in a dialog, and caches the verdict. The flash worker consumes that cached result instead of classifying the same image a second time. A folder whosevbmeta_system.imgcannot be read blocks Next rather than failing later mid-run.New optional bootloader step. It appears only when the firmware is Lenovo-key signed and the fingerprint is not TB323FU / TB376FC / TB390FU. The step indicator grows to seven entries only in that case. Picking an
.elfextracts the AVB public key embedded in the ABL and labels it Test key / Lenovo key / Unknown; Next unlocks only for a test key, or when nothing is selected at all. Skipping the step leaves the run byte-for-byte identical to today.Worker. With a user-supplied ABL the run takes the testkey re-sign path unconditionally and no longer dumps the device's own bootloader. It still reads device
vbmeta_system, because the rollback-index floors from that dump are what keep the re-signed images from being rejected. The suppliedabl.elfis written toabl_a(LUN 4) last, after the rawprogram flash and the ARB overlays, in place of the device-ABL restore.ltbox_patch::abl_key. A pure-Rust port of the referenceextract_avbpublickey.py: LZMA-alone decode, PE scan, AVB key-blob validation (n0inv+ Montgomeryrr), AArch64 ADR/ADRP+ADD reference counting to pick the referenced key, then SHA-1 over the blob. Classification reuses the existingkey_map. The only dependency change promoteslzma-rust2, already present transitively, to a direct dependency — no new crate enters the graph.Verification
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings,cargo test --workspaceall clean (the pre-push hook runs these).LTBOX_TEST_ABL_DIR.🤖 Generated with Claude Code