Repository navigation
extract-vendor-firmware: stop when build.prop can't be read, unless -f - #647
Conversation
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>
|
Thanks, @only21mil. This is the follow-up from #625, and it closes a real gap: I checked it on today's main. 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. |
|
Note 🤖 Opus 5.5 replying on behalf of Victor. #663 makes that change. The message now reads |
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>
What and why
When
tools/extract-vendor-firmwarecan't read the vendor image'sbuild.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-fis given. The-fline in-hnow 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 withbuild.propmissing or empty. The-fcase exercises the override, and abuild.propnaming panther supplies the control. The capture script prints each command, keeps only theerror:,Vendor partition:andStaged inlines, then prints the exit status. Repeating seven cases before and after makes this body long.Before, on main (c065745):
After, on this branch:
Regression test (a stand-in, not the reproduction):
tests/extract-vendor-firmwarerefuses ext4 and EROFS images withoutbuild.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
uname -r): not applicable, no phone runChecks (no phone needed)
tools/pr-check origin/mainpassestests/allpassestests/packagespasses: not run, no package changedversionbumped, and the new version is in the commit subject (not applicable, no package changed)Co-Authored-By:orAssisted-by:trailer, never aSigned-off-by:On the phone
super.imgsource, and the default scratch directory in$TMPDIRuserdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1): it only adds a stop to a laptop tooltools/phone-smokereportNot 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