Skip to content

extract-vendor-firmware: say build.prop can't be read, not that there is none - #663

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

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

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

What and why

When tools/extract-vendor-firmware can't copy the vendor partition's build.prop, it stops with "vendor.img has no build.prop", also when the file is in the image and only the copy failed. As suggested on #647, it now says "build.prop can't be read from vendor.img", which is true whether the file is missing, empty or not copied. The run still stops unless -f is given.

Reproduction: the real tool and the host's debugfs on a real ext4 image (made-up files, mkfs.ext4 -d) inside a factory image zip for cheetah. The one fault: the work directory (-w) is an 8 MiB tmpfs that the unzipped 8 MiB vendor.img fills, so debugfs's copy of build.prop fails ("No space left on device", exit 0). The second run, with room, is the control. The script drops only the control run's per-file mapping lines.

Before, on main (fdd3ab3):

$ stat -c "%s bytes %n" vendor.img
8388608 bytes vendor.img
exit=0
$ debugfs -R "ls -l /" vendor.img
debugfs 1.47.2 (1-Jan-2025)
      2   40755 (2)      0      0    4096 11-Nov-2026 15:37 .
      2   40755 (2)      0      0    4096 11-Nov-2026 15:37 ..
     11   40700 (2)      0      0   16384 11-Nov-2026 15:37 lost+found
     13  100644 (1)   1000   1000      84 11-Nov-2026 15:37 build.prop
     14   40755 (2)   1000   1000    4096 11-Nov-2026 15:37 etc
     18   40755 (2)   1000   1000    4096 11-Nov-2026 15:37 firmware

exit=0
$ debugfs -R "cat /build.prop" vendor.img
debugfs 1.47.2 (1-Jan-2025)
ro.product.vendor.device=cheetah
ro.vendor.build.fingerprint=fictional/cheetah-demo
exit=0
$ df -h /mnt/w
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           8.0M     0  8.0M   0% /mnt/w
exit=0
$ extract-vendor-firmware -w /mnt/w -o out-full image-cheetah-fictional.zip
==> Unpacking vendor.img
==> vendor.img is ext4; reading it with debugfs (no mount)
error: vendor.img has no build.prop; use -f to override
exit=1
$ extract-vendor-firmware -w work -o out-room image-cheetah-fictional.zip
==> Unpacking vendor.img
==> vendor.img is ext4; reading it with debugfs (no mount)
==> Vendor partition: fictional/cheetah-demo
==> Wi-Fi firmware: Version=1.0.1 (demo)
==> Bluetooth patch: BCM4389C1 fictional demo
==> Haptics firmware: cs40l26.wmfw (58 bytes) and its wavetable
==> Speaker protection: cs35l41-dsp1-spk-prot-cheetah.wmfw and the top and bottom tunings
==> Staged in /mnt/r/out-room (checksums in /mnt/r/out-room/vendor-firmware.sha256)
This is Google's proprietary firmware from your own factory image. Do not redistribute it.
exit=0

After, on this branch:

$ stat -c "%s bytes %n" vendor.img
8388608 bytes vendor.img
exit=0
$ debugfs -R "ls -l /" vendor.img
debugfs 1.47.2 (1-Jan-2025)
      2   40755 (2)      0      0    4096 11-Nov-2026 15:42 .
      2   40755 (2)      0      0    4096 11-Nov-2026 15:42 ..
     11   40700 (2)      0      0   16384 11-Nov-2026 15:42 lost+found
     13  100644 (1)   1000   1000      84 11-Nov-2026 15:42 build.prop
     14   40755 (2)   1000   1000    4096 11-Nov-2026 15:42 etc
     18   40755 (2)   1000   1000    4096 11-Nov-2026 15:42 firmware

exit=0
$ debugfs -R "cat /build.prop" vendor.img
debugfs 1.47.2 (1-Jan-2025)
ro.product.vendor.device=cheetah
ro.vendor.build.fingerprint=fictional/cheetah-demo
exit=0
$ df -h /mnt/w
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           8.0M     0  8.0M   0% /mnt/w
exit=0
$ extract-vendor-firmware -w /mnt/w -o out-full image-cheetah-fictional.zip
==> Unpacking vendor.img
==> vendor.img is ext4; reading it with debugfs (no mount)
error: build.prop can't be read from vendor.img; use -f to override
exit=1
$ extract-vendor-firmware -w work -o out-room image-cheetah-fictional.zip
==> Unpacking vendor.img
==> vendor.img is ext4; reading it with debugfs (no mount)
==> Vendor partition: fictional/cheetah-demo
==> Wi-Fi firmware: Version=1.0.1 (demo)
==> Bluetooth patch: BCM4389C1 fictional demo
==> Haptics firmware: cs40l26.wmfw (58 bytes) and its wavetable
==> Speaker protection: cs35l41-dsp1-spk-prot-cheetah.wmfw and the top and bottom tunings
==> Staged in /mnt/r/out-room (checksums in /mnt/r/out-room/vendor-firmware.sha256)
This is Google's proprietary firmware from your own factory image. Do not redistribute it.
exit=0

Regression test (a stand-in, not the reproduction): tests/extract-vendor-firmware adds "a build.prop whose copy fails", where the stand-in debugfs reports a write error for build.prop, and its build.prop checks expect the new words. With main's tool (EVF=), those five checks fail.

Device and build

  • Phone: none: a laptop tool only
  • Kernel release (uname -r): not applicable, no phone
  • Packages changed, with versions: none

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes
  • tests/packages passes (or the packages I touched: none, so not run)
  • Each changed package has its version bumped, and the new version is in the commit subject: 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, booted into this build: no, the tool runs on the laptop
  • Runbook steps passed (plan, step, result): none, no plan step
  • What I did not test: a Google factory image; sparse, EROFS and super.img sources on a full work disk (the test covers the message for ext4 and EROFS)
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)
tools/phone-smoke report

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

Generated with Claude Opus 5.5 in T3 Code Nightly

… is none

When the copy of the vendor partition's build.prop fails, the tool
said "vendor.img has no build.prop" although the file is in the image:
a work directory on a full disk does it, since debugfs then writes an
empty build.prop and reports "No space left on device". The message
now says "build.prop can't be read from vendor.img", which is true
when the file is missing, empty or its copy failed, as suggested on
derekross#647. Nothing else changes: the run still stops unless -f is given.

Tested: tests/extract-vendor-firmware, with a new case whose build.prop
is in the image and whose copy fails (the stand-in debugfs reports a
write error); main's tool fails it and the four checks that now expect
the new words. By hand, the tool on a real ext4 image in a factory zip,
with the work directory on a full 8 MiB tmpfs: main says the image has
no build.prop, this branch that it can't be read. Not tested: a Google
factory image. extract-vendor-chroot and extract-fingerprint-vendor say
the same "has no build.prop" on a full work disk; they are left as
they are.

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

Copy link
Copy Markdown
Owner

Thanks, @only21mil. This is the wording I mentioned on #647, and the reproduction on a full work directory shows well why it matters: the old message sent the reader to the image when the image was fine.

I checked it merged onto today's main. tools/pr-check and tests/extract-vendor-firmware pass (31 of 31, the real-debugfs case included), and with main's tool under your test exactly the five checks you name fail. Nothing else in the tree reads the old words apart from the two sibling extractors.

For some later change, not this one: extract-vendor-chroot and extract-fingerprint-vendor still say "has no build.prop" for the same cases, as your commit message notes. One small PR that gives both the same wording would let the three tools speak alike.

Merging.

@derekross
derekross merged commit e94d372 into derekross:main Nov 12, 2026
2 checks passed
@only21mil

Copy link
Copy Markdown
Contributor Author

Note

🤖 Opus 5.5 replying on behalf of Victor.

#676 is that PR. Both tools now stop with error: build.prop can't be read from vendor.img. I left out "; use -f to override": in these two tools -f skips only the device checks, so it doesn't get past this stop. On a work directory too full for the copy, both printed the new line and exited 1, where main had said "vendor.img has no build.prop".

derekross pushed a commit that referenced this pull request Nov 13, 2026
…here is none (#676)

When debugfs can't copy the vendor partition's `build.prop` (a full work directory, for one), `tools/extract-vendor-chroot` and `tools/extract-fingerprint-vendor` stopped with "vendor.img has no build.prop", also when the file was there. Both now say "build.prop can't be read from vendor.img", the words `tools/extract-vendor-firmware` uses since #663; `-f` skips only the device checks in these two tools, so the message doesn't offer it. `tests/chroot-extractors` runs both against made-up images with a debugfs that fails the copy.
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
… is none (derekross#663)

When the copy of the vendor partition's `build.prop` failed (a full work directory, say), the tool said "vendor.img has no build.prop" although the file was in the image. It now says "build.prop can't be read from vendor.img", which is true whether the file is missing, empty or not copied; the run still stops unless `-f` is given.

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