Skip to content

tools: the chroot extractors say why build.prop can't be read - #795

Merged
derekross merged 1 commit into
derekross:mainfrom
only21mil:build/chroot-extractors-debugfs-reason
Nov 15, 2026
Merged

derekross merged 1 commit into
derekross:mainfrom
only21mil:build/chroot-extractors-debugfs-reason

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

What and why

When tools/extract-vendor-chroot or tools/extract-fingerprint-vendor can't copy build.prop out of vendor.img, they say so but drop debugfs's message, so the reader doesn't learn why. Following the maintainer's note on #676, both now end that error with debugfs's last line. It is kept in a variable, as a full work directory is one of the reasons; stdout and exit statuses don't change, and a banner alone gives no reason. For an image debugfs can't open, that last line is dump: Filesystem not open (the cause is on the line before); I kept to the last line, as asked. tools/extract-vendor-firmware drops it too, but the note named these two, so I left it.

AI agents made every run below. Reproduction: both real tools with the host's debugfs (1.47.2) on made-up ext4 images (mkfs.ext4 -d) in cheetah image zips, sandboxed with the checkout's tools/ on PATH. One outside fault per case: no build.prop, the image cut at 1 MiB, its inode damaged, the superblock damaged, or a 12 MiB tmpfs work directory the images fill; a good image with room is the control. On main 1a28cf3 all five print the same bare line in both tools; on 5bfb9f0 only those ten lines change, each ending with the reason. Both runs, untrimmed, are in the block.

Regression test (a stand-in, not the reproduction): tests/chroot-extractors checks the whole error line with a stand-in debugfs (a full disk; only the banner) and with the host's debugfs on made-up images without build.prop and cut short. With main's tools under it (XVC=, XFP=), 6 of 8 checks fail; the banner pair fails once the banner check is removed.

Bash removes trailing newlines; other whitespace is kept. The suite also passes with Arch's e2fsprogs 1.47.4. Rechecked against main 6649b766: git merge-tree is clean, and both runs match the transcripts.

Device and build

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

Checks (no phone needed)

  • tools/pr-check origin/main passes (AI agent)
  • tests/all passes (AI agent)
  • 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: laptop tools
  • Runbook steps passed (plan, step, result): none, no plan step
  • What I did not test: no agent ran a Google factory image; sparse and super.img sources; e2fsprogs releases other than 1.47.2 and 1.47.4
  • 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).

AI agents made every run in this description, on an x86_64 desktop running Ubuntu 26.04. The tests and checks ran on 5bfb9f0; each transcript below names its own commit.

Setup: Ubuntu 26.04 on x86_64, debugfs 1.47.2; the made-up images are built afresh for each commit, and the tools run in a sandbox with that commit's tools/ first on PATH.

Steps: build the made-up image zips → run both tools on each of the four faulty images → on the good image with the 12 MiB work directory → on the good image with room

Before, on main 1a28cf31:

$ extract-vendor-chroot -p gnss -w work -o out image-cheetah-missing.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img
exit=1
$ extract-fingerprint-vendor -w work -o out image-cheetah-missing.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 image-cheetah-truncated.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img
exit=1
$ extract-fingerprint-vendor -w work -o out image-cheetah-truncated.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 image-cheetah-inode.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img
exit=1
$ extract-fingerprint-vendor -w work -o out image-cheetah-inode.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 image-cheetah-unopenable.zip
==> Unpacking vendor.img
==> Unpacking system.img
Checksum errors in superblock!  Retrying...
error: build.prop can't be read from vendor.img
exit=1
$ extract-fingerprint-vendor -w work -o out image-cheetah-unopenable.zip
==> Unpacking vendor.img
==> Unpacking system.img
Checksum errors in superblock!  Retrying...
error: build.prop can't be read from vendor.img
exit=1
$ extract-vendor-chroot -p gnss -w /mnt/w -o out image-cheetah-good.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 image-cheetah-good.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 image-cheetah-good.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 image-cheetah-good.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

After, on 5bfb9f04:

$ extract-vendor-chroot -p gnss -w work -o out image-cheetah-missing.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img: /build.prop: File not found by ext2_lookup 
exit=1
$ extract-fingerprint-vendor -w work -o out image-cheetah-missing.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img: /build.prop: File not found by ext2_lookup 
exit=1
$ extract-vendor-chroot -p gnss -w work -o out image-cheetah-truncated.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img: dump: Attempt to read block from filesystem resulted in short read while reading ext2 file
exit=1
$ extract-fingerprint-vendor -w work -o out image-cheetah-truncated.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img: dump: Attempt to read block from filesystem resulted in short read while reading ext2 file
exit=1
$ extract-vendor-chroot -p gnss -w work -o out image-cheetah-inode.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img: dump: Inode checksum does not match inode while reading inode 14
exit=1
$ extract-fingerprint-vendor -w work -o out image-cheetah-inode.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img: dump: Inode checksum does not match inode while reading inode 14
exit=1
$ extract-vendor-chroot -p gnss -w work -o out image-cheetah-unopenable.zip
==> Unpacking vendor.img
==> Unpacking system.img
Checksum errors in superblock!  Retrying...
error: build.prop can't be read from vendor.img: dump: Filesystem not open
exit=1
$ extract-fingerprint-vendor -w work -o out image-cheetah-unopenable.zip
==> Unpacking vendor.img
==> Unpacking system.img
Checksum errors in superblock!  Retrying...
error: build.prop can't be read from vendor.img: dump: Filesystem not open
exit=1
$ extract-vendor-chroot -p gnss -w /mnt/w -o out image-cheetah-good.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img: dump: No space left on device while writing file
exit=1
$ extract-fingerprint-vendor -w /mnt/w -o out image-cheetah-good.zip
==> Unpacking vendor.img
==> Unpacking system.img
error: build.prop can't be read from vendor.img: dump: No space left on device while writing file
exit=1
$ extract-vendor-chroot -p gnss -w work -o out image-cheetah-good.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 image-cheetah-good.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

Links: the maintainer's note on #676; the regression test, tests/chroot-extractors at 5bfb9f0. The scripts that build the images and drive the tools are not published; the reproduction paragraph above says what they do.

Not shown:

  • No agent ran a Google factory image.
  • Sparse and super.img sources.
  • e2fsprogs releases other than 1.47.2 and 1.47.4.

Generated with Claude Opus 5.5 in T3 Code Nightly

When debugfs can't copy the vendor partition's build.prop,
tools/extract-vendor-chroot and tools/extract-fingerprint-vendor stop
with "build.prop can't be read from vendor.img" and throw debugfs's
own message away, so the reader learns that the read failed but not
why. As the maintainer suggested on derekross#676, the error now ends with
debugfs's last line on stderr, its reason: a missing file, a full work
directory, an image cut short, a damaged inode. The line is kept in a
variable rather than a file in the work directory, which may be the
thing that is full; debugfs's stdout still goes to the terminal, and
a failed copy where debugfs printed only its banner gets no reason.
Nothing else changes, exit statuses included.

Tested: tests/chroot-extractors, extended with the reason from a
stand-in debugfs, the banner-only case, and real debugfs on made-up
ext4 images without build.prop and cut short, whose expected reason
is read from debugfs itself, byte for byte, so another wording still
passes (6 of its 8 checks fail with main's tools; it also passes with
e2fsprogs 1.47.2 and 1.47.4); tests/extract-vendor-firmware;
tests/all; tools/pr-check origin/main. Both tools run by hand on
made-up images for five causes, before and after. Not tested: a real
factory image.

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

Copy link
Copy Markdown
Owner

Thank you, @only21mil. This is exactly what I hoped for from the note on #676. The refusal still rests on build.prop being empty, so nothing changes about when the tools stop, and now the reason comes with it. I ran tests/chroot-extractors on your branch merged with today's main (8 ok). With main's two tools put under it, 6 of the 8 fail, as you said. I also read the set -e and happy-path behaviour: the same as before apart from the message.

One for later, not for this PR: tools/extract-vendor-firmware still throws debugfs's reason away when it can't read build.prop, so a follow-up that gives it the same tail would make the three extractors agree. I'll merge this as it is.

@derekross
derekross merged commit fb7081c into derekross:main Nov 15, 2026
2 checks passed
derekross pushed a commit that referenced this pull request Nov 18, 2026
When debugfs can't copy build.prop out of an ext4 vendor.img the tool refused with one fixed line, so a missing file, a full work directory and a damaged image read the same. The refusal now ends with debugfs's last line, as extract-vendor-chroot and extract-fingerprint-vendor have since #795: "build.prop can't be read from vendor.img: dump: No space left on device while writing file; use -f to override". The EROFS path, -f, the exit status and every other refusal are unchanged.

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