Repository navigation
Conversation
When debugfs can't copy build.prop out of an ext4 vendor.img, the tool refused with "build.prop can't be read from vendor.img; use -f to override" and dropped what debugfs had said, so a missing file, a full work directory and a damaged image all read the same. derekross#795 gave extract-vendor-chroot and extract-fingerprint-vendor debugfs's reason on this refusal; this gives it to the third extractor, in the same words: error: build.prop can't be read from vendor.img: dump: No space left on device while writing file; use -f to override dfs() now keeps debugfs's last stderr line in $reason, none when that line is only its banner, and the refusal adds it with derekross#795's ${reason:+: $reason} before "; use -f to override". The reason is the last line, as in derekross#795, rather than the line dfs() stopped on: with real debugfs 1.47.2 the two are the same line for a missing build.prop, an empty one, a full work directory, an image cut short and a damaged inode, and differ only for a damaged superblock, where the first line names the work directory's path ("The ext2 superblock is corrupt while trying to open .../vendor.img") and the last is "dump: Filesystem not open", what the other two tools print. A lookup error ends in a blank, which is dropped here because text follows it. The EROFS path has no debugfs and keeps its words; $reason is set empty before the format check, so nothing from the environment reaches it. -f, the exit status, the staging generation and every other refusal are unchanged; the map loop's, the registry's and the camera APEX's refusals are left as they are. Tested: tests/extract-vendor-firmware checks the whole refusal line for no build.prop and a failed copy (its stand-in debugfs now prints real debugfs's words for both), no reason for an empty build.prop or on EROFS, and on real ext4 images without build.prop or with a damaged superblock the line ends with what the host's debugfs says; with base's tool 4 of those checks fail, and only they. Each new line of the fix, undone, fails the suite, except the one that carries base's "|| return 1" over (debugfs exiting non-zero), which no check covered before either. The tool ran through its own command line on made-up ext4 image zips with the host's debugfs, before and after. tools/pr-check origin/main passes, and tests/all with a stand-in fastboot on PATH (main's tests/install-slot-descriptor needs one, and fails without it on main's own tree too). Not tested: Google factory images, a sparse or super.img vendor, debugfs exiting non-zero, and other e2fsprogs versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you, @only21mil. This is the third extractor I asked about on #795, done in the same words, and done narrowly: the check on which phone the image is for, Thank you also for the note that |
…nd a failure says why (#893) install-phone checks for its programs before it reads INSTALL_SLOT, so on a computer without fastboot the suite stopped tests/all (reported on #882 and #884). A stand-in at the end of PATH now answers command -v for whatever is missing; a real program always wins, and a stand-in that is ever run fails the suite. The failure report also read the wrong output file and printed only a cat error; it now shows the installer's message. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What and why
When debugfs can't copy
build.propout of an ext4vendor.img,tools/extract-vendor-firmwarerefuses but drops debugfs's message, so a missing file, a full work directory and a damaged image all read the same. As the maintainer suggested on #795, the refusal now ends with debugfs's reason in #795's words, so the three extractors agree.dfs()keeps debugfs's last stderr line (none if it is only the banner), and the refusal adds it before; use -f to override. I took the last line, as #795 does. It differs from the linedfs()stopped on only for a damaged superblock: there the first line names the work path, and the last,dump: Filesystem not open, is what the other two tools print. A lookup error's trailing blank is dropped, since text follows. EROFS,-f, the exit status, the staging generation and every other refusal are unchanged.AI agents made every run below. Reproduction: the real tool with the host's debugfs 1.47.2 on made-up ext4 image zips (
mkfs.ext4 -d), sandboxed, one outside fault per case: nobuild.prop, an empty one, the image cut short, a damaged inode or superblock, or a full tmpfs work directory. Controls: EROFS,-f, a good image. On main b87751a every refusal is the bare line; on e872440 five lines change, each ending with debugfs's reason, and the rest are identical. Both runs are in the block, untrimmed.Regression test (a stand-in, not the reproduction):
tests/extract-vendor-firmwarechecks the whole refusal line for nobuild.propand a failed copy (its stand-in debugfs now prints real debugfs's words), for an empty one and EROFS (no reason), and on real ext4 images withoutbuild.propor with a damaged superblock. With main's tool (EVF=), 4 checks fail, and only those.Device and build
uname -r): no phoneChecks (no phone needed)
tools/pr-check origin/mainpasses (AI agent)tests/allpasses (AI agent; with a stand-infastbooton PATH, see below)tests/packagespasses (or the packages I touched: none, so not run)versionbumped, and the new version is in the commit subject: no package changedCo-Authored-By:orAssisted-by:trailer, never aSigned-off-by:On the phone
super.imgsources; debugfs exiting non-zero; e2fsprogs releases other than 1.47.2userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)tools/phone-smokereportNot applicable: a laptop tool that never runs 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 e872440. That machine has no
fastboot, andtests/install-slot-descriptorstopstests/allwithout one, on main b87751a's own tree too; with a stand-infastbootthat exits 1 on PATH, it passes on both andtests/allpasses on e872440. e872440 merges cleanly with main 8934987 (git merge-tree), and the same runs on that merged tree print the same text as on e872440.Setup: Ubuntu 26.04 on x86_64, debugfs 1.47.2; one set of made-up image zips, read by both commits; the tool runs in a sandbox with that commit's
tools/first on PATH.Steps: build the made-up image zips → run the tool on each of the five faulty images → on the good image with the 8 MiB work directory → on the EROFS image → on the image without
build.propwith-f→ on the good image with roomBefore, on main b87751a0:
After, on e8724409:
Links: the maintainer's note on #795; the regression test,
tests/extract-vendor-firmwareat e872440. The scripts that build the images and drive the tool are not published; the reproduction paragraph above says what they do.Not shown:
super.imgsources.Generated with Claude Opus 5.5 in T3 Code Nightly