Repository navigation
install-phone: always flash userdata sparse, with room checked first - #877
Conversation
The installer flashed userdata as an Android sparse image when img2simg was installed and as the raw image otherwise, so the same command took two different paths depending on the host, and the dry run's printed commands changed with it. img2simg also ran unchecked: on a work directory without room for the sparse copy it failed part way, after the image copy had been prepared. img2simg is now required with the other tools (from android-tools, like fastboot, and already in CI), and userdata is always the sparse image. Before converting, the installer checks that --work has the raw copy's used blocks (it is decompressed with --sparse, so far fewer than its apparent size) plus 1 GiB free, and refuses with the numbers if not; a failing img2simg stops the install. Nothing is flashed in either case, and the copy is removed as before. tests/install-phone: img2simg and simg2img join the required tools, the raw-image fallbacks in the expected commands go, and a df that reports no room checks the refusal: no flash and no copy left behind. tests/install-phone-initramfs and tests/install-guided, which run the real installer, skip without img2simg as they do without its other tools. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you, @kdegeek. I went through this one slowly because it is the installer, and the result is good: on a computer with What I'd like before merging:
One more spot of the same kind: Two smaller things, as you like. The 1 GiB margin: the sparse file can't be larger than the copy's used blocks plus headers, so the gigabyte mostly refuses installs that would have fit; a much smaller margin does the job. And "a failing I'll approve the CI run now. |
derekross
left a comment
There was a problem hiding this comment.
CI ran on this head and both jobs pass, including tests/install-phone-initramfs, which I couldn't run on my laptop this morning.
Of the four things I asked for, one is already done on main (tests/install-slot-descriptor got its guard in #893, img2simg included). The other three are small, so I'll push them to your branch myself: img2simg in the guided install's preflight and package table (with a case in its test), the Debian and Ubuntu package in install-phone's "not found" hint, and img2simg in INSTALL.md, INSTALL-GUIDED.md and the bundle's README. With them the installer suites pass on your branch merged with today's main, and the new preflight case fails when I take img2simg out of the loop again. I'll merge when CI is green on that push. If you'd rather make them yourself, say so and I'll wait.
The two optional points (the 1 GiB margin, a test for a failing img2simg) stay optional.
The guided install's preflight and package table name img2simg, with a case in its test; install-phone's hint gives the Debian and Ubuntu package; INSTALL, INSTALL-GUIDED and the bundle's README list it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
What and why
tools/install-phoneflasheduserdataas an Android sparse image whenimg2simgwas installed, and as the raw image otherwise. The same install therefore took two paths depending on the host, and the dry run's printed commands changed with them.img2simgalso ran unchecked. On a work directory without room for the sparse copy it failed part way, after the image copy had been prepared.img2simgis now required with the other tools. It comes fromandroid-tools, likefastboot, and CI already installs it.userdatais always flashed as the sparse image.--workhas room for the copy's used blocks plus 1 GiB. The copy is decompressed with--sparse, so its used blocks are far fewer than its apparent size. Without the room, the installer refuses and prints the numbers.img2simgfails, the install stops.--workhelp text names the room needed.Device and build
img2simgalready sent.Checks (no phone needed)
tools/pr-check upstream/mainpassestests/install-phone: passesimg2simgandsimg2imgjoin its required tools, and the raw-image fallbacks in the expected commands go.dfthat reports no room checks the refusal: the room is named, nothing is flashed and no copy is left behind.tests/install-phone-initramfs,tests/install-guided,tests/boot-method,tests/install-slot-descriptor: all pass. The first two run the real installer, and they now skip withoutimg2simg, as they do without its other tools.bash -nandshellcheck -S warningon the touched scripts: no new warnings against maintests/all: not run, only the installer tests aboveOn the phone
userdataonly.🤖 Generated with Claude Code