Skip to content

tools: the chroot extractors say build.prop can't be read, not that there is none - #676

Merged
derekross merged 3 commits into
derekross:mainfrom
only21mil:build/extractors-build-prop-message
Nov 13, 2026
Merged

derekross merged 3 commits into
derekross:mainfrom
only21mil:build/extractors-build-prop-message

Conversation

@only21mil

@only21mil only21mil commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What and why

When tools/extract-vendor-chroot or tools/extract-fingerprint-vendor can't copy the vendor partition's build.prop, they stop with "vendor.img has no build.prop", also when the file is in the image and only the copy failed. As suggested on #663, both now say "build.prop can't be read from vendor.img", the words tools/extract-vendor-firmware uses since then. I left out its "; use -f to override": here -f skips only the device checks, so it wouldn't help. The run still stops.

Reproduction: both real tools with the host's debugfs on real ext4 images (made-up files, mkfs.ext4 -d; vendor 8 MiB, system 4 MiB) in an image zip for cheetah. The one fault: the work directory (-w) is a 12 MiB tmpfs that the two unzipped images fill, so debugfs's copy of build.prop fails ("No space left on device", exit 0, an empty file). The runs with room are the control; they get past build.prop and stop later because the made-up system image has no runtime APEX. Nothing is trimmed.

Before, on main (e163141):

$ debugfs -R "ls -l /" vendor.img
debugfs 1.47.2 (1-Jan-2025)
      2   40755 (2)      0      0    4096 12-Nov-2026 00:46 .
      2   40755 (2)      0      0    4096 12-Nov-2026 00:46 ..
     11   40700 (2)      0      0   16384 12-Nov-2026 00:46 lost+found
     13   40755 (2)   1000   1000    4096 12-Nov-2026 00:46 bin
     14  100644 (1)   1000   1000      84 12-Nov-2026 00:46 build.prop
     15   40755 (2)   1000   1000    4096 12-Nov-2026 00:46 etc
     16   40755 (2)   1000   1000    4096 12-Nov-2026 00:46 firmware
     17   40755 (2)   1000   1000    4096 12-Nov-2026 00:46 lib64

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            12M     0   12M   0% /mnt/w
exit=0
$ extract-vendor-chroot -p gnss -w /mnt/w -o out-full image-cheetah-fictional.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: vendor.img has no build.prop
exit=1
$ extract-fingerprint-vendor -w /mnt/w -o out-full image-cheetah-fictional.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: vendor.img has no build.prop
exit=1
$ extract-vendor-chroot -p gnss -w work -o out-room image-cheetah-fictional.zip
==> Unpacking vendor.img
==> Unpacking system.img
==> Vendor partition: fictional/cheetah-demo
==> Reading the vendor partition
==> Reading the system partition
error: no system/apex/com.android.runtime.apex in system.img
exit=1
$ extract-fingerprint-vendor -w work -o out-room image-cheetah-fictional.zip
==> Unpacking vendor.img
==> Unpacking system.img
==> Vendor partition: fictional/cheetah-demo
==> Reading the vendor partition
==> Reading the system partition
error: no system/apex/com.android.runtime.apex in system.img
exit=1

The after capture below was taken on 40178ecf. Both extractor files are byte-identical there, at 80e07cb, the head the maintainer ran, and at the current head c8f0a9e (main merged in again), and re-runs on main 9d7ade2 and on c8f0a9e matched the original captures apart from image timestamps.

$ debugfs -R "ls -l /" vendor.img
debugfs 1.47.2 (1-Jan-2025)
      2   40755 (2)      0      0    4096 12-Nov-2026 00:48 .
      2   40755 (2)      0      0    4096 12-Nov-2026 00:48 ..
     11   40700 (2)      0      0   16384 12-Nov-2026 00:48 lost+found
     13   40755 (2)   1000   1000    4096 12-Nov-2026 00:48 bin
     14  100644 (1)   1000   1000      84 12-Nov-2026 00:48 build.prop
     15   40755 (2)   1000   1000    4096 12-Nov-2026 00:48 etc
     16   40755 (2)   1000   1000    4096 12-Nov-2026 00:48 firmware
     17   40755 (2)   1000   1000    4096 12-Nov-2026 00:48 lib64

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            12M     0   12M   0% /mnt/w
exit=0
$ extract-vendor-chroot -p gnss -w /mnt/w -o out-full image-cheetah-fictional.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img
exit=1
$ extract-fingerprint-vendor -w /mnt/w -o out-full image-cheetah-fictional.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img
exit=1
$ extract-vendor-chroot -p gnss -w work -o out-room image-cheetah-fictional.zip
==> Unpacking vendor.img
==> Unpacking system.img
==> Vendor partition: fictional/cheetah-demo
==> Reading the vendor partition
==> Reading the system partition
error: no system/apex/com.android.runtime.apex in system.img
exit=1
$ extract-fingerprint-vendor -w work -o out-room image-cheetah-fictional.zip
==> Unpacking vendor.img
==> Unpacking system.img
==> Vendor partition: fictional/cheetah-demo
==> Reading the vendor partition
==> Reading the system partition
error: no system/apex/com.android.runtime.apex in system.img
exit=1

Regression test (a stand-in, not the reproduction): the new tests/chroot-extractors, since neither tool had a test. Stand-ins for unzip and debugfs fail the copy as debugfs does on a full disk, and each tool must print the new words. With main's tools (XVC=, XFP=) both checks fail.

Device and build

  • Phone: none: laptop tools 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 tools run on the laptop
  • Runbook steps passed (plan, step, result): none, no plan step
  • What I did not test: a Google factory image; sparse and super.img sources on a full work disk; EROFS images, which both tools refuse before this line
  • 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: laptop tools that never run on a phone (CONTRIBUTING.md §6.5).

Generated with Claude Opus 5.5 in T3 Code Nightly

…here is none

When the copy of the vendor partition's build.prop failed (a full work
directory, say: debugfs then prints "No space left on device", exits 0
and leaves an empty file), extract-vendor-chroot and
extract-fingerprint-vendor said "vendor.img has no build.prop" although
the file was in the image. They now say "build.prop can't be read from
vendor.img", as extract-vendor-firmware does since derekross#663, which is true
whether the file is missing, empty or not copied. Unlike that tool they
offer no override: -f skips only the device checks, so the message
promises none, and the run still stops.

tests/chroot-extractors is new (neither tool had a test): stand-ins for
unzip and debugfs fail the copy as real debugfs does on a full disk, and
each tool must say the new words. With main's tools both checks fail.

Tested: the new test, tests/all and tools/pr-check origin/main, and both
tools on a real ext4 vendor image holding build.prop, with the host's
debugfs and the work directory on a full tmpfs. Not tested: a real
factory image, and EROFS images, which both tools refuse before this
line.

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

Copy link
Copy Markdown
Owner

Thanks, @only21mil. This is the follow-up I had in mind on #663: the three extractors now speak alike, and you were right to leave "; use -f to override" out here, since -f doesn't skip this line in these two tools.

I checked it merged onto today's main. With the conflict below resolved, tools/pr-check passes, tests/chroot-extractors passes, and with main's two tools under your test both checks fail on the old words, as you say.

One thing before I can merge: the branch conflicts with main in tests/all. #686 added tests/phone-demo-notes at the end of the file, in the same spot where you add yours. Please rebase and keep both, with yours last:

echo "# tests/phone-demo-notes"
tests/phone-demo-notes
echo "# tests/chroot-extractors"
tests/chroot-extractors

For some later change, not this one: both tools still throw away debugfs's own message, so the reader learns that the read failed but not why (in your reproduction, "No space left on device"). Passing its last line on in the error would close that.

The only conflict was the end of tests/all: both suites are kept there, tests/phone-demo-notes and then tests/chroot-extractors.

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

Copy link
Copy Markdown
Contributor Author

Note

🤖 Opus 5.5 replying on behalf of Victor.

I merged main into the branch with one merge commit instead of rebasing, so the head moved from 80e07cb, the one you ran, to 77e6975, and no history was rewritten or force-pushed.
The only conflict was tests/all. I kept both suites, with tests/chroot-extractors last as you asked, and both extractor files are unchanged from the head you ran.
I'll pass on debugfs's own message in its own PR.

The only conflict was at the end of tests/all: both suites are kept,
with tests/chroot-extractors after main's tests/install-guided.

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

Copy link
Copy Markdown
Contributor Author

Note

🤖 Opus 5.5 replying on behalf of Victor.

Main moved again (your #645 appends tests/install-guided at the same spot in tests/all), so I merged main once more.
The head moved from 77e6975 to c8f0a9e, again one merge commit with nothing rewritten.
tests/all keeps main's suites with tests/chroot-extractors last, and both extractor files are unchanged from the head you ran (80e07cb).

@derekross

Copy link
Copy Markdown
Owner

Thanks, @only21mil. The conflict is resolved the way I asked, with your suite last, and the two tools and the test are the same bytes as the head I ran.

Since then #712 changed the sort lines in both extractors, so I checked the merge again on today's main: it merges cleanly, each tool differs from main by your one message line, tools/pr-check and tests/chroot-extractors pass, and with main's two tools under your test both checks still fail on the old words. Merging.

Passing debugfs's own message on in its own pull request is fine, as you propose.

@derekross
derekross merged commit b03aa1d into derekross:main Nov 13, 2026
2 checks passed
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