Repository navigation
install-phone: --verify-only reads and lists the shipped ramdisk too - #648
Conversation
--verify-only stopped before the ramdisk was read, so a bundle whose
ramdisk lz4 decodes but cpio can't list passed it ("The files check
out"), and only the full install of the same bundle stopped, after the
phone and the owner's questions. The maintainer named this on derekross#623.
Reading the ramdisk (the AVB footer refusal, vendor_ramdisk get,
lz4 -dc, cpio -it) now runs before the phone is contacted, for both
runs, in the work directory, which is set up there with its cleanup.
The key's append still comes after the questions and reuses that
listing and archive, so what a full install flashes is unchanged; most
of the diff is that move.
Tested: a bundle with a truncated cpio in valid lz4, run as
./install --unsigned --verify-only, exits 0 on main and stops with
cpio's reason and no fastboot call here. tests/install-phone-initramfs's
new --verify-only cases each fail with main's tool, and its byte
comparison passes under caller umask 077, 022 and 002;
tests/install-phone, tests/all and tools/pr-check pass. Not run on a
phone or with the guided installer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, @only21mil. This is exactly the follow-up I named on #623, and moving the read ahead of the phone is better than what I asked for: a bundle with a bad ramdisk now stops a full install before the first fastboot call, not after the owner has answered every question. I checked it on today's main. One change, please. Until now That matters when an install is already waiting at "Type the phone's codename" with its images staged there, and someone checks the download once more from a second terminal. The first run then flashes Could a On order: #563 and #616 both conflict with this one because of the moved block, so I'll merge this first and they rebase. |
Moving the ramdisk read ahead of the phone also moved the work directory's setup and cleanup trap there, so a --verify-only run, or an install refused before the owner's answers (another phone's --serial, a phone running from slot b, an answer it refuses), removed root.img, root.simg and ramdisk/ from --work on exit. If another install was waiting at "Type the phone's codename" with its images staged there, it then flashed boot_b, init_boot_b and vendor_boot_b and stopped on the missing vendor_kernel_boot image. On main neither run touched --work. The read now happens in mktemp -d "$work/verify.XXXXXX", which only its own run removes. The shared files, ramdisk/ and their cleanup are set up where main sets them up, after the answers, and the key's append reads the shipped archive from the read's directory. The flashed images and the paths the plan prints are unchanged. Tested: tests/install-phone-initramfs gains a case that stages root.simg and ramdisk/vendor_kernel_boot.img in --work, then runs --verify-only and an install refused for another --serial; both files must remain and nothing else may be left. It fails on the previous head's tool, each case on its own, and fails again with the read's trap removed, with the cleanup set up before the phone, or with the read's directory left out of the cleanup. tests/install-phone and tests/install-phone-initramfs pass, the latter under caller umask 077, 022 and 002 (the flashed images are the hook's byte for byte). No phone was used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Note 🤖 Opus 5.5 replying on behalf of Victor. Done in 017d669. The ramdisk is now read in The same move had made a full install that is refused before the answers (another |
|
Thanks, @only21mil. That is the change I asked for, and it's done the careful way: the read has its own I checked the new head merged onto today's main. Two small things for some later change, not this one. A run killed outright leaves its Merging. |
|
Note 🤖 Opus 5.5 replying on behalf of Victor. #682 handles the leftover directory. Each run holds a shared #681 adds the message: the installer stops with |
…43) (#687) The candidate lessons of four review rounds were never added: 251 of them, in the rounds' review files. Each round's were read against all of the existing lessons, merged where two reviews said the same thing, and cut to the ones that are a check that caught something real or a correction of a mistake of ours: 118 lessons and 8 corrections. round 49: L-658 to L-693 round 50: L-694 to L-724 round 51: L-725 to L-751 round 52: L-752 to L-775 Five near-duplicates between rounds were dropped at the merge (a second correction about #567's rollback index, a second floating-dialog screenshot rule, a second #648 scratch-directory rule, a third merge condition for kernel #224, a second "in review" wording check). Round 52's include what the round's review of the maintainer's own merges found, and three things from the day itself: the Omarchy 4.5 pin moved on an update test from a phone prepared in a way users' phones were not (C-42, with the lesson on what delivers a fix to each phone); a test build of reboot-to run with --help, which restarted the phone; and this file having outgrown one read. One lesson is new here: date's %3N is not a millisecond clock on uutils (L-765). The lesson files are rebalanced: 17 files, the largest 26 kB. tests/review-lessons passes, and all 692 earlier entries are unchanged. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…tten (#681) Since #648 the shipped ramdisk is read in a directory of its own in --work before the phone is contacted, so --verify-only creates the work directory; on a home that can't be written the run stopped at mkdir's or mktemp's own error, which with uutils coreutils doesn't name the path. It now stops with the installer's message, naming the directory and --work DIR, before the phone. tests/install-phone-initramfs covers a --work that can't be created and one that can't be written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…erekross#648) `--verify-only` stopped before the ramdisk step, so a bundle whose ramdisk lz4 or cpio can't read passed it and only a full install stopped, after the phone and the owner's questions. The read (the AVB footer refusal, `vendor_ramdisk get`, `lz4 -dc`, `cpio -it`) now runs before the phone in both runs, in a `verify.XXXXXX` directory of its own in `--work` that only that run removes, so another install's staged files there are left alone; the key's append still follows the answers and the flashed images are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…43) (derekross#687) The candidate lessons of four review rounds were never added: 251 of them, in the rounds' review files. Each round's were read against all of the existing lessons, merged where two reviews said the same thing, and cut to the ones that are a check that caught something real or a correction of a mistake of ours: 118 lessons and 8 corrections. round 49: L-658 to L-693 round 50: L-694 to L-724 round 51: L-725 to L-751 round 52: L-752 to L-775 Five near-duplicates between rounds were dropped at the merge (a second correction about derekross#567's rollback index, a second floating-dialog screenshot rule, a second derekross#648 scratch-directory rule, a third merge condition for kernel derekross#224, a second "in review" wording check). Round 52's include what the round's review of the maintainer's own merges found, and three things from the day itself: the Omarchy 4.5 pin moved on an update test from a phone prepared in a way users' phones were not (C-42, with the lesson on what delivers a fix to each phone); a test build of reboot-to run with --help, which restarted the phone; and this file having outgrown one read. One lesson is new here: date's %3N is not a millisecond clock on uutils (L-765). The lesson files are rebalanced: 17 files, the largest 26 kB. tests/review-lessons passes, and all 692 earlier entries are unchanged. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…tten (derekross#681) Since derekross#648 the shipped ramdisk is read in a directory of its own in --work before the phone is contacted, so --verify-only creates the work directory; on a home that can't be written the run stopped at mkdir's or mktemp's own error, which with uutils coreutils doesn't name the path. It now stops with the installer's message, naming the directory and --work DIR, before the phone. tests/install-phone-initramfs covers a --work that can't be created and one that can't be written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What and why
Follows the note on #623:
--verify-only(#641) stopped before the ramdisk step, so it passed a bundle whose ramdisk cpio can't list. Only a full install of that bundle stopped, after reaching the phone and asking the owner's questions.Reading the ramdisk (the AVB footer refusal,
vendor_ramdisk get,lz4 -dc,cpio -it) now runs before the phone in both runs, in a directory of its own in--work(mktemp -d "$work/verify.XXXXXX") that only that run removes. The image copy,ramdisk/and their cleanup are still set up after the answers, as on main, so a--verify-onlyrun, or an install refused before the answers, leaves another install's staged files in--workalone. The key's append still follows the questions and reuses that archive, so the flashed bytes don't change; most of the diff is that move (git diff --color-moved). A full install now stops there with the same message, before contacting the phone.A ramdisk lz4 can't decompress fails in the same step, so it is covered too; reproduced the same way, main passes it and this branch stops with lz4's error.
Before, on main. A local script builds a bundle as
tests/install-phone-initramfsdoes, with a truncated cpio in valid lz4, and copies in that revision'stools/install-phoneasinstall. It runs in a bwrap sandbox with the checkout at/mnt, only fastboot faked (it logs every call). The script strips colour codes and greps the full install's output.After, on this branch:
The case from the review on this PR: an install waiting at "Type the phone's codename" with its images staged in
--work, and a second run on the same--work. A second local script stagesroot.simgandramdisk/vendor_kernel_boot.imgthere and lists what is left; below are its lines for--verify-only, picked by grep with trailing spaces trimmed, on this PR's previous head and on this branch. Refused installs (another--serial, a phone on slot b, a refused answer) behave the same.Regression test (a stand-in, not the reproduction):
tests/install-phone-initramfsruns--verify-onlyagainst its failinglz4 -dcandcpio -itstand-ins, an AVB-signed ramdisk image and a non-vendor-boot image, checking the message and that fastboot is never called. Each case fails alone with main's tool. A second case stages those two files in--work, runs--verify-onlyand an install refused for another--serial, and checks both files remain and nothing else is left; each fails alone with the previous head's tool. The byte comparison passes under caller umask 077, 022 and 002.Device and build
uname -r): n/aChecks (no phone needed)
tools/pr-check origin/mainpassestests/allpasses (520 ok, 0 not ok)tests/packages: no package touchedversionbumped, and the new version is in the commit subject (no package changed)Co-Authored-By:orAssisted-by:trailer, never aSigned-off-by:On the phone
--unsigned); the guided installer, which isn't on main yetuserdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1):flash()and its allowlist are unchangedtools/phone-smokereportNot applicable: install-phone runs on the laptop (CONTRIBUTING.md §6.5).
Generated with Claude Opus 5.5 in T3 Code Nightly