Skip to content

omamobile-omarchy 0.1.32, bin/omamobile: pinned module trees, and no silent replacement in modules-push - #369

Merged
derekross merged 3 commits into
derekross:mainfrom
W4HO-ham:modules-keep-pinned
Nov 3, 2026
Merged

derekross merged 3 commits into
derekross:mainfrom
W4HO-ham:modules-keep-pinned

Conversation

@W4HO-ham

@W4HO-ham W4HO-ham commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

On 2026-11-02 the palmtop (Pixel 9a) stopped at the boot logo after a day of test kernels: the push back to its daily kernel replaced the daily's module tree with the kit's archive, and the hand-installed display and camera modules under extra/ and updates/ were gone. The cause (device/tegu NOTES, #368): omamobile-modules-cleanup keeps the running tree, the next boot's and the two newest others, so during a test boot it removed the older daily tree, and the push back found no marker and sent the archive over it.

Two changes:

  • modules-cleanup keeps pinned releases: any release listed one per line in /usr/lib/modules/.omamobile-pinned is kept ("keep : pinned"). A missing file is empty, lines that aren't release-shaped are ignored, and a symlinked file is skipped. test/modules-cleanup.sh covers a pinned older tree kept under three newer ones and a garbage line.
  • modules-push no longer replaces a tree silently: before replacing an existing tree it stages the archive and compares; if the installed tree has module files the archive lacks, or files that differ (under kernel/ too), it refuses, lists the paths and leaves the tree alone, unless OMAMOBILE_MODULES_REPLACE=1. A failed marker read now stops the push before any write, with the release, the expected checksum and what the read returned, instead of falling through to a replacement.

The module-push tests (11) and the cleanup tests (12), tests/boot-method and tools/pr-check pass. packages/omamobile-omarchy/test/all and tests/packages fail only on QML formatter errors in Background.qml and the notifications Service.qml, which fail the same way on an untouched main. On the palmtop the cleanup keeps 50 trees through a local drop-in until this ships.

@W4HO-ham
W4HO-ham force-pushed the modules-keep-pinned branch from bbcf8de to 8fcebbc Compare November 3, 2026 02:24
@W4HO-ham W4HO-ham changed the title omamobile-omarchy 0.1.29, bin/omamobile: pinned module trees, and no silent replacement in modules-push omamobile-omarchy 0.1.32, bin/omamobile: pinned module trees, and no silent replacement in modules-push Nov 3, 2026
@derekross

Copy link
Copy Markdown
Owner

Thanks, @W4HO-ham. Losing the palmtop's hand-installed display and camera modules to a push was a nasty one, and both halves of this are the right idea. Pins that don't use up rollback slots are neat, and a marker read that fails now stops the push instead of quietly reinstalling. The tests are thorough: tests/modules-push and the cleanup test pass here (23 cases), as do pr-check and CI.

Three things before it can merge:

  1. A fresh build looks like a hand edit. The guard refuses whenever an installed module differs from the incoming archive, but the same release name is often pushed again with new modules: cmd_push's own comment notes that a config change can keep the release name, and a -dirty tree keeps one release across edits. Every such re-push would refuse, so the override would become routine, and then it wipes exactly what you're protecting. Could you record what the push itself installed instead? For example, write sha256sum of every module from the archive into /usr/lib/modules/<rel>/.omamobile-modules.sha256 at install time, and on the next push refuse only for modules missing from that manifest (hand-added) or not matching it (hand-swapped), using your current comparison only for trees with no manifest yet. A test for "same release, rebuilt module, nothing hand-installed: installs" would cover it.
  2. cmp isn't always there. It comes from diffutils, which the release root image doesn't include (omamobile-fingerprint 0.1.15: depend on diffutils, and a missing cmp is never "differs" #379 ran into exactly this). Without it, every module reads as different. The manifest approach avoids cmp entirely; if you keep it, check for it up front and treat only its exit 1 as "different".
  3. In docs/RELEASES.md, "Since omamobile-omarchy 0.1.29" should be 0.1.32 (or whatever version it lands at).

Optional: the AGENTS.md line about modules-push replacing the whole folder needs updating to match; the marker read captures 2>&1, so an SSH warning would look like a mismatch; and a modules-cleanup --dry-run with one pinned release from the palmtop would be good to paste here.

@W4HO-ham
W4HO-ham force-pushed the modules-keep-pinned branch from 8fcebbc to 78a5071 Compare November 3, 2026 06:16
@W4HO-ham

W4HO-ham commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, all three done in a new commit, rebased on main:

  1. Each install writes sha256 sums of every module to /usr/lib/modules/<rel>/.omamobile-modules.sha256. The next push refuses only modules missing from it (added by hand) or not matching it (swapped by hand), and names them. A tree with no manifest is compared with the archive by checksum. New tests: same release with a rebuilt module and nothing hand-installed installs; after a manifested push, a hand-added and a hand-swapped module are each refused.
  2. No cmp anywhere now. The fixture puts a failing cmp on PATH, so a use would fail the tests.
  3. RELEASES says 0.1.32.

From the optional list: the marker read takes stdout only, with a test where an SSH warning on stderr doesn't trigger a reinstall, and the AGENTS.md line describes the guard. The modules-cleanup --dry-run with one pinned release needs the palmtop, which is down until the morning; I'll paste it then.

@derekross

Copy link
Copy Markdown
Owner

Thanks, this is the shape I hoped for: the manifest records what each push installed, a rebuilt tree under the same name goes in, and only a hand-added or hand-swapped module refuses; the tests cover each of those, no cmp anywhere, and the stdout-only marker read is a nice touch. One last thing: the new paragraph in docs/RELEASES.md §5.4 still describes the first version ("absent from the archive or has different contents"); could you reword it to the manifest rule, as the AGENTS line already does? Then I'll merge. Note for everyone: the first push after this onto a tree from before the manifest, under an unchanged release name with rebuilt modules, refuses once; that's the old comparison doing its job, and OMAMOBILE_MODULES_REPLACE=1 (or a new release name) gets past it. The dry-run paste from the palmtop can follow when it's back.

Keep explicitly pinned releases outside the module cleanup rollback count. Stage module archives and refuse replacement when installed drivers would be lost or changed, unless OMAMOBILE_MODULES_REPLACE=1 explicitly permits it. Stop push on marker read errors instead of treating them as an install request.

Add offline CLI coverage for replacement refusal, overrides, malformed archives and marker reads, plus cleanup pin tests and usage documentation.
…fest of what each push installed

The guard compared the installed tree with the incoming archive, so a fresh build pushed under the same release name (a -dirty tree, or a config change that keeps the name) looked like a hand edit, and the override would have become routine. Each install now writes sha256 sums of every module to .omamobile-modules.sha256. The next push refuses only modules missing from it (added by hand) or not matching it (swapped by hand). A tree from before the manifest is compared with the archive by checksum, so cmp, which the release root lacks, isn't needed.

The push reads the module marker from stdout only, so an SSH warning on stderr isn't taken for a mismatch. RELEASES names 0.1.32, and AGENTS.md describes the guard.
Section 5.4 still described the first version of the guard; it now gives the manifest rule and the one-time refusal on a tree from before it, as the AGENTS line does.
@W4HO-ham

W4HO-ham commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Done: RELEASES §5.4 now gives the manifest rule and the one-time refusal on a tree from before it. Rebased on main. The dry-run paste follows when the palmtop is back.

@W4HO-ham
W4HO-ham force-pushed the modules-keep-pinned branch from 78a5071 to f374299 Compare November 3, 2026 13:55
@derekross

Copy link
Copy Markdown
Owner

Thanks, @W4HO-ham, that wording is exactly the rule now, and the note about the one-time refusal
on an older tree saves the next person a surprise. Everything from both rounds is in: the manifest,
no cmp, the stdout-only marker read, AGENTS and RELEASES. I re-checked the 7 Pro's side, since
this is its push path too: the image steps are untouched, an ordinary push to a new release name
installs as before plus the manifest, and the release check accepts our push and -dirty
releases. CI is green on this head and it merges cleanly on today's main. Merging.

One optional idea for later: module_sums runs sha256sum once per module, and the 7 Pro's
release tree has about 1,800 of them, so each pass adds some seconds on the phone. One batched
sha256sum over find -print0 would make that negligible. The dry-run paste from the palmtop is
still welcome when it's up.

@derekross
derekross merged commit b746f5a into derekross:main Nov 3, 2026
2 checks passed
@Somnius

Somnius commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Short field report on the 8 Pro, in case it's useful. On 0.1.31 (installed before this landed) the cleanup timer removed my revert kernel's module tree while a test kernel was running. It keeps the running release, .omamobile-next, trees that arrived this boot, package-owned trees and the 2 newest others, and mine was the third. I flashed it back a few hours later and it came up with no touch, GPU, Wi-Fi or sound, only the bootloader framebuffer, and lsmod had one line. I put the tree back by hand with the modules-push steps, depmod, restarted the display service, udevadm trigger and the session, no reboot. For now I have OMAMOBILE_MODULES_KEEP=6 in a drop-in.

I see 0.1.32 adds .omamobile-pinned, so I'll update and expect this is covered. One idea: have the flash step pin the release it just flashed, so a kernel you flash back to is never rolled off. @derekross

robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants