Skip to content

Replace avbtool.py with avbtool-rs - #50

Merged
miner7222 merged 5 commits into
mainfrom
avbtool
Apr 15, 2026
Merged

miner7222 merged 5 commits into
mainfrom
avbtool

Conversation

@miner7222

@miner7222 miner7222 commented Apr 14, 2026 •

Copy link
Copy Markdown
Owner

No description provided.

Migrate all AVB operations from Python avbtool.py (AOSP) to Rust
avbtool-rs binary. This eliminates the openssl.exe runtime dependency
since avbtool-rs handles crypto internally.

Key changes:
- Remove vendor/avb submodule, add vendor/avbtool-rs submodule
- Rewrite bin/ltbox/patch/avb.py: replace module loading and Python API
  calls with subprocess invocations of avbtool-rs.exe
- Update constants.py: AVBTOOL_PY -> AVBTOOL_RS, AVB_DIR -> AVBTOOL_RS_DIR
- Update info_scan.py, utils.py, workflow.py for new binary path
- Add .github/workflows/build-avbtool-rs.yml CI workflow
- Update release.yml and build-archive.yml for avbtool-rs artifact
- Remove openssl.exe from test infra, build scripts, and CI artifacts
- Update all test mocks from _parse_avb_image/_get_avbtool_module to
  _get_avb_info, delete tests for removed functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@miner7222
miner7222 force-pushed the main branch 2 times, most recently from d9a00df to 24567ac Compare April 14, 2026 18:23
miner7222 and others added 2 commits April 15, 2026 14:22
Integration tests need avbtool-rs.exe which was not built during CI.
Reuse build-avbtool-rs.yml as workflow_call and download artifact to bin/tools.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
avbtool-rs now matches AOSP avbtool.py behavior exactly (alignment
checks, partition_size validation, release_string). LTBox falls back
to --dynamic_partition_size when the extracted partition_size is not
block-aligned or too tight for AOSP's 69632-byte metadata reservation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
extract_image_avb_info was using original_image_size + vbmeta_size
as partition_size, which is the data+metadata portion only. This
caused add_hash_footer to use --dynamic_partition_size, producing
images smaller than the actual partition and breaking boot.

Use stat().st_size instead, matching avbtool.py _parse_image
behavior that returns the full file size via ImageHandler.image_size.

Also remove the dynamic_partition_size fallback in
apply_avb_integrity_footer — with correct partition_size the AOSP
constraints are always met.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Keep the vendor/avb submodule entry in .gitmodules matching main
branch exactly, while adding vendor/avbtool-rs. This prevents
merge conflicts on .gitmodules when merging avbtool into main.
The vendor/avb directory itself was already removed from the tree.

Also restore qdlrs URL to miner7222/qdlrs (matching main).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@miner7222
miner7222 merged commit 735a634 into main Apr 15, 2026
15 of 17 checks passed
@miner7222
miner7222 deleted the avbtool branch April 15, 2026 14:09
@miner7222
miner7222 restored the avbtool branch April 24, 2026 12:07
@miner7222
miner7222 deleted the avbtool branch April 24, 2026 12:07
miner7222 added a commit that referenced this pull request Jul 14, 2026
Integrate qualcomm/qdlrs PR #50 at 5508b08 into the vendored library, preserve LTBox's transport and progress patches, and widen partition-dump LBAs to u64.

Co-authored-by: Grok (grok-4.5) <grok@x.ai>
Co-authored-by: Codex (gpt-5.6-sol) <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant