Repository navigation
install-phone: --work can be a path with a space - #646
Conversation
install-phone writes firstboot.conf, boot-update.conf and root's authorized_keys into the image copy through a debugfs command file, and named their host paths there bare. debugfs splits each command at blanks, so a --work directory with a space in its path made the writes miss, and the install stopped with "writing firstboot.conf into the image copy failed" before anything was flashed. Each of the three host paths now goes in debugfs's own double quotes, with any double quote doubled, the encoding derekross#625 gave the image extractors; the helper stays inline because the bundle ships install alone. Tested: tests/install-phone runs a full install with --work under a directory named 'a "spaced" dir' and reads the three files back from the flashed image (fails with main's tool, passes with this one); the host's debugfs 1.47.2 reads the quoting the same in a -f command file as in -R for a space, a double quote, a backslash, an apostrophe and a tab; a release bundle's ./install with only fastboot faked completes from a spaced --work, and the three files it writes are byte-identical to a plain --work run's (the password hash line checked against the PIN). Not tested: a phone; a path with a newline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, @only21mil. This is the last bare host path from the #625 note, and the fix is the same I checked it on today's main. A path with a newline still can't work, as you say; the read-backs stop it before anything is flashed, so that is fine as it is. Merging. |
install-phone named the three host files of its debugfs command file bare, and debugfs splits commands at blanks, so a `--work` directory with a space stopped the install with "writing firstboot.conf into the image copy failed" before anything was flashed. Each host path now goes in debugfs's double quotes with any double quote doubled, as derekross#625 did for the image extractors. `tests/install-phone` installs from a `--work` path with a space and a quote and reads the three files back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What and why
With
--workunder a path with a space,tools/install-phonestops with "writing firstboot.conf into the image copy failed" before flashing anything: its debugfs command file names the three$workfiles bare, and debugfs splits commands at blanks. Following your note on #625, each host path now goes in debugfs's double quotes with any"doubled, the same inlinedq()as the extractors. The host debugfs 1.47.2 reads that quoting in a-ffile as in-R(space,", backslash, apostrophe, tab).A release bundle's
./install --unsigned --work '<dir>/my work', only fastboot faked, in a sandbox with the checkout at/mnt. The script trims the install's output withgrepand strips colour codes. Before, on main:After, on this branch:
boot-update.confandauthorized_keysmatch byte for byte across the plain--workruns on main and this branch and the spaced run on this branch.firstboot.confmatches after normalizingPASSWORD_HASH, with each hash verified against the same PIN.Regression test (stand-in fastboot, not the reproduction):
tests/install-phoneinstalls with--workundera "spaced" dirand reads the three files back. It fails with main's tool, and if any one line loses its quotes.Device and build
uname -r): not applicableChecks (no phone needed)
tools/pr-check origin/mainpassestests/allpassestests/packagespasses (or the packages I touched: ...): no package touchedversionbumped, and the new version is in the commit subject: no package changedCo-Authored-By:orAssisted-by:trailer, never aSigned-off-by:On the phone
--workpath with a newline.userdata, 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).
Generated with Claude Opus 5.5 in T3 Code Nightly