Repository navigation
reboot-to, omamobile-modem: a deliberate restart doesn't cost the next boot its modem - #403
Conversation
… the next boot its modem reboot-to (and so bin/omamobile push) skips the clean stop that removes the latch, so the next boot refused the modem as if the last one had hung (derekross#390). The latch now names its boot and records ONLINE, and a latch from a boot that reached ONLINE and ended with reboot-to (its note, derekross#403) is cleared with the note. A start that never reached ONLINE, or a note for another boot, still refuses.
… the next boot its modem reboot-to (and so bin/omamobile push) skips the clean stop that removes the latch, so the next boot refused the modem as if the last one had hung (derekross#390). The latch now names its boot and records ONLINE, and a latch from a boot that reached ONLINE and ended with reboot-to (its note, derekross#403) is cleared with the note. A start that never reached ONLINE, or a note for another boot, still refuses.
… the next boot its modem reboot-to (and so bin/omamobile push) skips the clean stop that removes the latch, so the next boot refused the modem as if the last one had hung (derekross#390). The latch now names its boot and records ONLINE, and a latch from a boot that reached ONLINE and ended with reboot-to (its note, derekross#403) is cleared with the note. A start that never reached ONLINE, or a note for another boot, still refuses.
3acd4c3 to
31280c9
Compare
|
Rebased onto main after #398. The start script's new one-retry handling stays as it is; reboot-to's note now counts as a clean stop, so it removes the modem-up marker, its refused copies and the note, then the start goes on. A note from another boot changes nothing. The test runs both cases in their own folder, past the markers to the test stop point. omamobile-modem is 0.1.17. |
31280c9 to
43ef04e
Compare
|
CI caught that husky, felix, panther, lynx and raven carry their own copy of reboot-to.c, held to cheetah's by their tests. All seven copies now change the same way, each package one version up. On a phone without the modem stack the note is written and never read. |
|
Thank you for this, and for agreeing the shape with robotosaith on #390 first. Writing the boot ID through a temporary file with fsync and a synced rename, and accepting only a marker from the boot the note names, keeps the refusal exactly where it matters. I walked the 7 Pro's cases through the start script: a hang or reset still refuses once and then holds, the hold flag and a held boot survive a push, a bring-up that never reached ONLINE still refuses, and a Two things before I merge:
Smaller, no change needed from you: I'll write the squash subject with the versions (omamobile-modem 0.1.17 and the device packages). Your #371 and #372 claim the same device-cheetah and device-raven versions as this PR, and #371 and #407 the same device-tegu version, so the stack will move up one after this lands; I'll give the numbers on those PRs. One comment line in the start script would help the next reader: the note records that the restart was asked for, not that it finished, which leaves the same gap a clean |
43ef04e to
06c9f87
Compare
… the next boot its modem reboot-to (and so bin/omamobile push) skips the clean stop that removes the latch, so the next boot refused the modem as if the last one had hung (derekross#390). The latch now names its boot and records ONLINE, and a latch from a boot that reached ONLINE and ended with reboot-to (its note, derekross#403) is cleared with the note. A start that never reached ONLINE, or a note for another boot, still refuses.
|
Thanks. The body now says "Part of #390" (the inhibitor point stays open there), and the start script has the comment line: the note records that the restart was asked for, not that it finished, the same gap a clean |
… the next boot its modem reboot-to (and so bin/omamobile push) skips the clean stop that removes the latch, so the next boot refused the modem as if the last one had hung (derekross#390). The latch now names its boot and records ONLINE, and a latch from a boot that reached ONLINE and ended with reboot-to (its note, derekross#403) is cleared with the note. A start that never reached ONLINE, or a note for another boot, still refuses.
|
A 9a run of the same case (through #372's script, which reads the note the same way): CP ONLINE, then |
… the next boot its modem reboot-to (and so bin/omamobile push) skips the clean stop that removes the latch, so the next boot refused the modem as if the last one had hung (derekross#390). The latch now names its boot and records ONLINE, and a latch from a boot that reached ONLINE and ended with reboot-to (its note, derekross#403) is cleared with the note. A start that never reached ONLINE, or a note for another boot, still refuses.
|
Ran on raven today:
The case that started all this happened twice more today before the run: each |
…t boot its modem reboot-to restarts at once, so systemd never stops omamobile-modem.service, its --stopped never removes modem-up, and the next boot skipped the modem as if the last one had hung (derekross#390). bin/omamobile push ends this way. reboot-to now writes and syncs the boot ID it ends to /var/lib/omamobile/deliberate-restart before rebooting (best effort: nothing in the initramfs, where that folder doesn't exist). omamobile-modem-start treats a modem-up marker from the boot the note names as a clean stop: it removes the marker, its refused copies and the note, and starts. A hang or reset leaves no note and is still refused, and so is a bring-up that never reached ONLINE. Every device package's copy of reboot-to.c changes the same way (cheetah, tegu, husky, felix, panther, lynx, raven), since their tests hold them to cheetah's; each package's version moves up one. On a phone without the modem stack the note is written and never read. The 9a's own start (derekross#372) will use the note too.
reboot-to noted every boot it ended, so a restart in a later boot without the modem replaced the note for the boot that had it up. On the palmtop on 2026-11-04 a boot with the CP ONLINE ended with a push while the boot unit was disabled for a sleep series; the next pushes rewrote the note, and when the unit was enabled again its start refused on that boot's latch as if it had hung. The note is now written only when this boot's modem marker (the 7 Pro's modem-up, the 9a's modem-bringup-started) names it. Checked with a build pointed at a scratch directory: no marker, no note; a marker naming this boot (either name), a note; a marker naming another boot, no note.
|
One more commit, from this morning on the palmtop: reboot-to noted every boot it ended, so a reboot in a later boot without the modem replaced the note for the boot that had it up. A boot with the CP ONLINE ended with a push while the unit was disabled for a sleep series, the later pushes rewrote the note, and when the unit was enabled again it refused on that boot's latch as if it had hung. reboot-to now writes the note only when this boot's modem marker names it (modem-up on the 7 Pro, modem-bringup-started on the 9a). Rebased on main; the device and modem package tests pass. |
06c9f87 to
1706698
Compare
|
Thank you, and thank you to robotosaith for the raven run. All three cases behaved exactly as intended: What's left is on my side. I'll do the 7 Pro run I promised (the same three cases plus a smoke report) before I merge. At merge I'll set the versions: #416 shipped device-cheetah 0.1.44 since your last push, and #407 has since taken device-tegu 0.2.9, so I'll give each package the next free number. I'll write the squash subject and body with the full list of seven packages, since the description still mentions two copies. You don't need to push for any of this. |
…unclean end Main's 0.1.19 (derekross#634) starts the modem after one unclean end and holds it off after two in a row. The note still matters there: a reboot-to with the modem up would count as one of the two. The test now checks that a note naming another boot leaves the first unclean end counted and the second held, and that a note naming the marker's boot clears a counted copy too. AGENTS.md's stop-the-modem rule says what the note changes.
|
Merged up to main after #634 ( What changed here:
|
|
Thank you for the akita copy, and for reworking the test and the AGENTS sentence so quickly after #634 changed the ground under this. The new test cases read well: a note for another boot changes nothing, and a note for the marker's boot gets past the markers. Two things are still in the way, and one question.
The question: your 7 Pro branch lets the note clear the counted copies as well ( To answer what you raised: yes, I still want this after #634. It no longer saves a boot's modem, but it keeps two pushes in a row from holding it off, it keeps the one free unclean end for a real hang, and it gives the 9a's starter the note it already reads. The rule to stop the modem first stays, as your AGENTS text says. After the fixes it's on me: the 7 Pro run (a |
…e note keeps a counted unclean end reboot-to.c is linked into the initramfs against musl with no compiler builtins when a device package has no bootctl, and musl's vfprintf needs them: with the snprintf line that link fails with undefined __addtf3, __extenddftf2 and seven more. The line is strcpy and strcat now, in all eight copies, and device-cheetah's test refuses a printf-family call in the file. The note no longer removes the modem-up marker's counted copies. It keeps a deliberate restart from being counted as an unclean end, but it doesn't end a streak: a hang, a push and a second hang are held, as the 9a's starter already does. Main took 0.1.20, so this is 0.1.21.
|
You're right, I lost your point 2 under the merges. I'm sorry; it is done now (
Your question: keep the count. I agree, and it is changed: the note removes the marker and itself and no longer touches the |
|
Thank you, that was quick, and all three points are done as I asked. I checked this head (
CI is green on this head, and I ran the nine touched packages' tests on the branch merged onto today's main (which has gained #594 since your push): all pass. Nothing more is needed from you on the code. Two notes:
The rest is mine: the 7 Pro run (a |
…note # Conflicts: # packages/omamobile-device-tegu/version
|
Two pushes since your check, both from main moving:
|
The Pixel 6's package came to main with its own copy of reboot-to.c (derekross#222), held to the 7 Pro's by its test. This pull request changes that source (the note for a deliberate restart, no printf family), so the ninth copy gets the same file.
|
In my comment just above, the oriole commit is |
|
Thank you for catching the Pixel 6 copy as soon as #222 landed, and for the correction a minute later about which commit carries it. I checked this head ( Nothing more is needed from you on the code. For the record, so the numbers don't surprise anyone: main has since taken device-cheetah 0.1.51, and the branch says 0.1.51 as well, so as it stands the 7 Pro's package wouldn't get a new number; the same goes for husky (0.1.10), oriole (0.2.0) and tegu (0.2.16), whose source changes here without a bump. I'll set them at merge: cheetah 0.1.52, husky 0.1.11, oriole 0.2.1, tegu 0.2.17, and the others where your branch has them. Please don't chase them with another merge. One thing to know about: #459 (the usage text for an option) changes seven of the same files and was written before the Pixel 8a and Pixel 6 copies existed, so the two can't both land as they are. I'll sort the order out on #459; if this one goes first, the option check there moves in front of the note, so that What's left is mine: the 7 Pro run (a |
|
The Pixel 7 Pro run is done, and every case behaves as the PR says. Omarchy 4.5.0-3, What ran.
After every boot: no UFS error-handler pass, no I/O or ext4 error, no failed unit other than the held modem's own. The radio partitions matched my backup before the run and after it ( One thing I learned the hard way, and it belongs to #459 more than to this PR:
phone-smoke: cheetahKernel
The one "not ok" line is cpif's The phone is back on the published What's left is mine at merge, as I said: the version numbers (cheetah 0.1.52, husky 0.1.11, oriole 0.2.1, tegu 0.2.17, and the modem and raven numbers against #389), restaging the 7 Pro's boot files, and the order with #459. |
…bers #403's reboot-to needs (#683) #403 changed src/reboot-to.c in every device package, but four of them had no new number on its branch: main had moved to the same one, or the branch never bumped it. Without a new number the build keeps the old package, so those phones would not get the reboot-to that notes a deliberate restart. Three of the four here. Their packages carry no boot image, so the bump only rebuilds the binary. device-cheetah stays at 0.1.51 on purpose. Its package carries the Pixel 7 Pro's boot image, which release phones write to slot B at the update, and the image's inputs have changed twice since the last one that booted (#667): initramfs/init (#562) and reboot-to.c (#403). It gets 0.1.52 once an image built from this tree has booted on the 7 Pro, as 0.1.51 did. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…ounted (#684) Every Pixel 7 Pro boot with the modem up logs a few dozen error lines from CPIF: the modem sends on channels nothing on the phone opens (the second SIM's stack, the OEM channels, the router), and CPIF logs three lines for each message it drops. phone-smoke reported them as new errors in every report, which hid any error that really was new (the #403 run's report, 2026-11-11: 43 such lines in ten minutes, across oem_ipc0, oem_ipc1, oem_ipc3, umts_ipc1 and umts_router). They go in counted_errors, so the row still names and counts them, with no ceiling. umts_ipc0 is left out on purpose: it is the phone service's own channel, and a message dropped there stays a new error. Two test cases cover both. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
derekross#403 merged and shipped omamobile-modem 0.1.21 and device-raven 0.1.35, the numbers this branch also carried. The lines were equal, so the merge of main raised no conflict, and the Pixel 6 Pro's package would have kept its old build. Both take the next numbers. modem-sit stays at 0.3.35; other open pull requests claim it too, and it is set at merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The option check now comes before note_deliberate_restart() and prints with write(2); all nine copies identical, as in e296b53f (see its message for what was tested). I used AI help (Claude) to work on this.
…after derekross#403 Upstream's reboot-to notes a deliberate restart for the modem's next start (derekross#403, derekross#683). The Saga's copy must match the cheetah source (test/all), so it takes the new file; the note is only written on a boot with the modem up, which the Saga doesn't start yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and #562's init reaches installed phones (#691) The Pixel 7 Pro's package carries its boot image, and release phones write it to slot B at the update. Two of the image's inputs changed since 0.1.51: initramfs/init (#562: the optional root label check, development handover and RAM rescue keys, all unset for this phone) and reboot-to.c (#403: it notes a deliberate restart). 0.1.51 was held until an image built from this tree had booted on the phone. It has, on 2026-11-12, by the path a release phone takes: the package built with boot files staged from main on the release kernel (7.3.0-rc6-omamobile-g1a9d1d4e9289) and installed with pacman. Against 0.1.51's initramfs exactly two files differ, init and reboot-to; the dtbo is the same. The hook found four of slot B's five images already there and wrote vendor_kernel_boot_b, verified, with the previous slot B saved. After a clean restart the phone booted it: system running, no failed unit, /run 0755, the root filesystem mounted without recovery, no UFS error-handler pass, the modem ONLINE, and tools/phone-smoke passing. With this the 7 Pro's packaged reboot-to is #403's too. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…he 7 Pro's modem starts at boot by default (derekross#574) * AGENTS.md: stop the modem before a push or a reboot-to reboot-to is a raw reboot syscall and bin/omamobile push ends in it, so neither stops omamobile-modem.service. Its clean stop never runs, the modem-up marker stays, and on the 7 Pro, where the modem starts at boot, the next boot skips the modem once as if the last one had hung; a second unclean end in a row holds it off until --retry. That happened on 2026-11-08 after a reboot-to bootloader taken to charge a flat battery. Add a bullet to the push notes in section 2: stop the unit first, under the human's go for the reboot, or use systemctl reboot when no reason is needed; what the stop costs today (about 40 s, logged as failed, marker still removed); why this is not the restart the modem gotchas forbid; and that the open derekross#403 would make reboot-to count as a clean stop. The reboot-to gotcha and the NV overlay note in section 4 point to it; the NV note keeps nv-overlay capture as the narrower alternative. Part of derekross#532 (its docs request only; the watcher and SIGTERM fixes are package changes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * AGENTS.md, MODEM-PLAN: modem at boot by default, derekross#403's reach, B4 Addresses the review on derekross#574. - AGENTS.md, the modem restart gotcha: it still called the 7 Pro's stack at boot opt-in (`systemctl enable omamobile-modem-boot.target`), which stopped being true with derekross#398. It now says the stack starts by default since device-cheetah 0.1.43 (MODEM-PLAN M4.6b), and that `systemctl mask` keeps it off from the next boot, as the target, the package's install message and the device README say: `disable` doesn't remove device-cheetah's vendor wants link. - AGENTS.md section 2: derekross#403 doesn't make `reboot-to` a clean stop. Its note lets the next boot's start clear a `modem-up` marker from the boot `reboot-to` ended, but the CP's ordered power-off and the NV capture still run only in the unit's stop, so the advice to stop the modem first stands with derekross#403 merged too. - MODEM-PLAN M4.6 B4 rebooted with `reboot-to omamobile` and expected the clean stop's "modem stopped (...): modem-up removed", which a raw reboot syscall can't produce. The step is there to show that a reboot's stop clears the marker, so it now reboots through systemd, as N5 does, and its pass line takes today's "timeout" result (derekross#532). The recorded results are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * MODEM-PLAN: M4.6b B8 and B9b reboot through systemd, as B4 now does Part of the review on derekross#574. B8 plants another boot's modem-up marker so that "the reboot's clean stop keeps a marker that isn't this boot's", and its pass line reads the previous boot's "is another boot's ... kept"; B9b's planted reboot rests on the same stop hook, and its last "clean reboot" checks that `--stopped` removed the refused copies. All three rebooted with `reboot-to omamobile`, which stops no unit, so the stop hook they test never ran: the same gap as B4. They now reboot with `systemctl reboot`. The recorded results are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…counted as an unclean end (derekross#403) reboot-to skips systemd's shutdown, so the modem unit's stop never ran and the next boot counted its modem-up marker as a hang or reset; two pushes in a row held the modem off. reboot-to now notes the boot it ends (only when that boot's modem marker names it, written through a temporary file, fsync and a synced rename), and omamobile-modem-start doesn't count a marker from the boot the note names; an unclean end already counted stays counted, as on the 9a. All nine device packages' copies of reboot-to.c change together, and device-cheetah's test refuses a printf-family call in it, since the initramfs links it against musl without compiler builtins. The device packages whose number this leaves unchanged (cheetah, husky, oriole, tegu) get theirs in the commit that follows. Part of derekross#390. Tested on raven (robotosaith), the 9a (W4HO-ham) and the Pixel 7 Pro (2026-11-11, 7.3.0-rc6-omamobile-g1a9d1d4e9289): reboot-to with the modem up from a clean state and on top of a counted unclean end, a clean reboot, one and two forced restarts, and reboot-to from the held boot.
…bers derekross#403's reboot-to needs (derekross#683) derekross#403 changed src/reboot-to.c in every device package, but four of them had no new number on its branch: main had moved to the same one, or the branch never bumped it. Without a new number the build keeps the old package, so those phones would not get the reboot-to that notes a deliberate restart. Three of the four here. Their packages carry no boot image, so the bump only rebuilds the binary. device-cheetah stays at 0.1.51 on purpose. Its package carries the Pixel 7 Pro's boot image, which release phones write to slot B at the update, and the image's inputs have changed twice since the last one that booted (derekross#667): initramfs/init (derekross#562) and reboot-to.c (derekross#403). It gets 0.1.52 once an image built from this tree has booted on the 7 Pro, as 0.1.51 did. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…ounted (derekross#684) Every Pixel 7 Pro boot with the modem up logs a few dozen error lines from CPIF: the modem sends on channels nothing on the phone opens (the second SIM's stack, the OEM channels, the router), and CPIF logs three lines for each message it drops. phone-smoke reported them as new errors in every report, which hid any error that really was new (the derekross#403 run's report, 2026-11-11: 43 such lines in ten minutes, across oem_ipc0, oem_ipc1, oem_ipc3, umts_ipc1 and umts_router). They go in counted_errors, so the row still names and counts them, with no ceiling. umts_ipc0 is left out on purpose: it is the phone service's own channel, and a message dropped there stays a new error. Two test cases cover both. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…reboot-to and derekross#562's init reaches installed phones (derekross#691) The Pixel 7 Pro's package carries its boot image, and release phones write it to slot B at the update. Two of the image's inputs changed since 0.1.51: initramfs/init (derekross#562: the optional root label check, development handover and RAM rescue keys, all unset for this phone) and reboot-to.c (derekross#403: it notes a deliberate restart). 0.1.51 was held until an image built from this tree had booted on the phone. It has, on 2026-11-12, by the path a release phone takes: the package built with boot files staged from main on the release kernel (7.3.0-rc6-omamobile-g1a9d1d4e9289) and installed with pacman. Against 0.1.51's initramfs exactly two files differ, init and reboot-to; the dtbo is the same. The hook found four of slot B's five images already there and wrote vendor_kernel_boot_b, verified, with the previous slot B saved. After a clean restart the phone booted it: system running, no failed unit, /run 0755, the root filesystem mounted without recovery, no UFS error-handler pass, the modem ONLINE, and tools/phone-smoke passing. With this the 7 Pro's packaged reboot-to is derekross#403's too. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Part of #390, as proposed and agreed there.
reboot-torestarts at once, so systemd never stopsomamobile-modem.service, its--stoppednever removesmodem-up, and the next boot takes the last one for a hang. Sinceomamobile-modem0.1.19 (#634) that boot starts the modem all the same, but it counts as the one unclean end the guard allows: a secondreboot-tobefore a clean stop holds the modem off until--retry.bin/omamobile pushends inreboot-to.reboot-to(every device package's copy, kept identical to cheetah's) writes the boot ID it ends to/var/lib/omamobile/deliberate-restartbefore rebooting, through a temporary file,fsyncand a synced rename. It's best effort: in the initramfs, where that folder doesn't exist, there's no note and nothing changes.omamobile-modem-startdoesn't count amodem-upmarker that comes from the boot the note names: it removes the marker and the note, and starts. An unclean end already counted stays counted, as in the 9a's starter: the note keeps a push from being counted but doesn't end a streak, so a hang, a push and a second hang are held. A hang or a reset leaves no note, so it is still counted, and held at the second in a row. A note naming another boot clears nothing. The bring-up marker (a start that never reached ONLINE) isn't touched by the note.The 9a's own start (#372, merged) checks the same note.
Tests:
omamobile-modem'stest/all(a note for the marker's boot clears the marker, isn't reported as a hang and keeps a counted copy, so a hang after it is held; a note from another boot leaves the first unclean end counted and the second held), every copy compiled with-Wall -Wextra -Werror, cheetah's copy linked the waybin/omamobile initramfslinks it for a phone without bootctl (musl, no compiler builtins;reboot-to.chas no printf-family call, and device-cheetah's test holds it to that), the note function run on its own against a scratch folder (it writes this boot's ID),tests/packages, andtools/pr-check. Not yet run on a phone: robotosaith offered to run it on raven (a clean reboot,reboot-to, and a forced restart that should still be counted).Versions are one above main for each touched package (omamobile-modem 0.1.21); they are the maintainer's to set at merge.
The inhibitor that outlives a failed start, robotosaith's second point on #390, is left for a separate small fix.