Skip to content

extract-vendor-firmware: stop when build.prop can't be read, unless -f - #647

Merged
derekross merged 1 commit into
derekross:mainfrom
only21mil:build/extract-vendor-firmware-needs-build-prop
Nov 11, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
only21mil:build/extract-vendor-firmware-needs-build-prop

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

What and why

When tools/extract-vendor-firmware can't read the vendor image's build.prop (missing, empty, or a failed copy), it skips the device check and stages the image with exit 0, so another phone's firmware is staged without -f. This is the follow-up named on #625. Now it stops with "vendor.img has no build.prop", as the other two extractors do, unless -f is given. The -f line in -h now names both device checks, since the new error points there.

The runs exercise raw ext4, sparse ext4, EROFS and an image zip containing vendor.img, using the real tool and the host's debugfs, simg2img and fsck.erofs. The images contain made-up cheetah files with build.prop missing or empty. The -f case exercises the override, and a build.prop naming panther supplies the control. The capture script prints each command, keeps only the error:, Vendor partition: and Staged in lines, then prints the exit status. Repeating seven cases before and after makes this body long.

Before, on main (c065745):

$ extract-vendor-firmware -w work -o out-ext4 noprop.img
==> Staged in /mnt/r/out-ext4 (checksums in /mnt/r/out-ext4/vendor-firmware.sha256)
exit=0
$ extract-vendor-firmware -w work -o out-empty emptyprop.img
==> Staged in /mnt/r/out-empty (checksums in /mnt/r/out-empty/vendor-firmware.sha256)
exit=0
$ extract-vendor-firmware -w work -o out-sparse noprop-sparse.img
==> Staged in /mnt/r/out-sparse (checksums in /mnt/r/out-sparse/vendor-firmware.sha256)
exit=0
$ extract-vendor-firmware -w work -o out-erofs noprop-erofs.img
==> Staged in /mnt/r/out-erofs (checksums in /mnt/r/out-erofs/vendor-firmware.sha256)
exit=0
$ extract-vendor-firmware -w work -o out-zip image-pantah-fictional.zip
==> Staged in /mnt/r/out-zip (checksums in /mnt/r/out-zip/vendor-firmware.sha256)
exit=0
$ extract-vendor-firmware -w work -o out-force -f noprop.img
==> Staged in /mnt/r/out-force (checksums in /mnt/r/out-force/vendor-firmware.sha256)
exit=0
$ extract-vendor-firmware -w work -o out-control panther.img
error: vendor partition is for 'panther', not cheetah; use -f to override
exit=1

After, on this branch:

$ extract-vendor-firmware -w work -o out-ext4 noprop.img
error: vendor.img has no build.prop; use -f to override
exit=1
$ extract-vendor-firmware -w work -o out-empty emptyprop.img
error: vendor.img has no build.prop; use -f to override
exit=1
$ extract-vendor-firmware -w work -o out-sparse noprop-sparse.img
error: vendor.img has no build.prop; use -f to override
exit=1
$ extract-vendor-firmware -w work -o out-erofs noprop-erofs.img
error: vendor.img has no build.prop; use -f to override
exit=1
$ extract-vendor-firmware -w work -o out-zip image-pantah-fictional.zip
error: vendor.img has no build.prop; use -f to override
exit=1
$ extract-vendor-firmware -w work -o out-force -f noprop.img
==> Staged in /mnt/r/out-force (checksums in /mnt/r/out-force/vendor-firmware.sha256)
exit=0
$ extract-vendor-firmware -w work -o out-control panther.img
error: vendor partition is for 'panther', not cheetah; use -f to override
exit=1

Regression test (a stand-in, not the reproduction): tests/extract-vendor-firmware refuses ext4 and EROFS images without build.prop, an empty one and a real ext4 image without one, and stages with -f. With main's tool (EVF=): 4 check(s) failed; on this branch, 30 ok.

Device and build

  • Phone: none: tools only (the tool runs on the laptop)
  • Kernel release (uname -r): not applicable, no phone run
  • Packages changed, with versions: none

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes
  • tests/packages passes: not run, no package changed
  • Each changed package has its version bumped, and the new version is in the commit subject (not applicable, no package changed)
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

On the phone

  • I ran this on my own phone: no, the change is to a laptop tool
  • Runbook steps passed: none, no plan step
  • What I did not test: a Google factory image, a super.img source, and the default scratch directory in $TMPDIR
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1): it only adds a stop to a laptop tool
tools/phone-smoke report

Not applicable: a laptop-side tool change that never runs on a phone (CONTRIBUTING.md §6.5).

Generated with Claude Opus 5.5 in T3 Code Nightly

The vendor partition's build.prop is what tells cheetah's image from
panther's: android-info.txt lists both pantah boards. When build.prop
couldn't be read (missing, empty, or a failed copy), the device check
was skipped and the image was staged with exit 0, so another phone's
firmware could be installed without -f. extract-vendor-chroot and
extract-fingerprint-vendor already stop with "vendor.img has no
build.prop"; this one now does too, unless -f is given, which keeps
-f the way to override the device checks. The -f usage line now names
both checks.

Tested: tests/extract-vendor-firmware gains an ext4 and an EROFS image
with no build.prop and an ext4 image with an empty one (refused, the
previous outputs untouched), the same with -f (staged), and a real
ext4 image without build.prop read by the host's debugfs (refused).
The four refusals fail with main's tool, and the -f check fails when
the new stop ignores -f. The real tool, run on real ext4, sparse,
EROFS and factory zip images without build.prop, now stops on each.
Not tested: a Google factory image (none on the test machine) and a
phone (laptop-side only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derekross

Copy link
Copy Markdown
Owner

Thanks, @only21mil. This is the follow-up from #625, and it closes a real gap: android-info.txt lists both pantah boards, so build.prop is the only thing that tells a Pixel 7's vendor partition from a 7 Pro's, and an image without one was staged with no check at all.

I checked it on today's main. tools/pr-check and tests/extract-vendor-firmware pass on the head, and with main's tool under your test exactly the four new refusals fail. The other two extractors do stop with the same words, as you say. tools/phone-provision calls this tool without -f for the 7 Pro and the 6 Pro, and a real vendor partition always carries build.prop at its root, so nothing that worked before is refused now.

One small thing for some later change, not this one: the message says "has no build.prop" also when the file is there and the copy failed. "can't be read", as in your commit subject, would cover every case.

Merging.

@derekross
derekross merged commit 9ab5271 into derekross:main Nov 11, 2026
2 checks passed
@only21mil

Copy link
Copy Markdown
Contributor Author

Note

🤖 Opus 5.5 replying on behalf of Victor.

#663 makes that change. The message now reads build.prop can't be read from vendor.img; use -f to override. I reproduced the false case on an ext4 image that holds build.prop, with a work directory that the unpacked vendor.img fills so the copy fails: main stopped with "vendor.img has no build.prop", and #663 stops with the new message.

robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
derekross#647)

the vendor partition's build.prop is what tells cheetah's image from panther's, since android-info.txt lists both pantah boards. When it was missing, empty or the copy failed, the device check was skipped and the image staged with exit 0; the tool now stops with "vendor.img has no build.prop", as extract-vendor-chroot and extract-fingerprint-vendor do, unless `-f` is given. The test refuses ext4, EROFS and real ext4 images without one and stages with `-f`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.

2 participants