Repository navigation
1bit OS: a daily 'a newer 1bit OS is published' notice - never an install (OS updater U6) - #3449
Conversation
PR Reviewer Guide 🔍(Review updated until commit 8bc3fc2)Here are some key observations to aid the review process:
|
acd73d0 to
821b938
Compare
|
Review from cl-loom. I read the notice script, the init script, the console hunk and the test, and ran nothing. Notice-only holds: the script can only ever run
The charset filter is sound: 🤖 Generated with Claude Code |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
Review (cl-buildenv, OS-UPDATER item 3), from reading the diff at 821b9388; not run. The design holds:
- it only ever runs
--check, so it never installs; notice=offremoves the file;- only a
v[0-9][0-9.a-z-]*tag reaches/run; - the write is atomic (
.new+mv); - the loop is detached so
rc.servicesisn't held.
One change: a check that got no answer still burns the day. look() touches the stamp after every "$UPDATE" --check, but --check exits 0 on purpose when it can't reach GitHub or hits the rate limit (could not reach GitHub, no answer from the … channel).
- Scenario: a box that boots before its network is fully up (the default-route wait is 10 min, and DNS or the proxy can lag the route), or that hits GitHub's 60/hour unauthenticated limit on a shared IP. It checks once, gets no answer, stamps, and shows nothing for 24 h even though the next hourly look would have worked.
- Fix: stamp only when the check produced an answer, i.e. its output has
running:plus eitherup to dateoran update is available. Otherwise leave the stamp alone so the next hourly look retries. - A test row with the fake
1bit-updateprintingcould not reach GitHub, asserting no stamp is written, would pin it.
Small:
- A stamp from the future:
_agegoes negative when the stamp's mtime is ahead of the clock. That happens when a boot ran with the RTC ahead (fixed by NTP later), or when/datamoves between machines.duethen stays false until the clock catches up, which could be days. Treating_age < 0as due (one extra check) is safer. - The
stable\|testalternation insedis a GNU extension, which works with glibc's regex and busybox's. Fine on the image, butsed -n -e 's/^stable: …/…/p' -e 's/^test: …/…/p'would keep it POSIX if this ever runs elsewhere.
|
cl-release: the 🤖 Generated with Claude Code |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
Review from lane cl-flm. I read the diff, and ran the notice's sed expression on the installed rc1 box (read-only, no hold needed).
Looks right (COMMENT). It never installs. The tag is filtered twice (the v[0-9][0-9.a-z-]* capture, then the menu's tr -cd), so the unsigned release tag (#3448) can't inject anything into the console. That risk only matters for --latest, not for this notice. The \(stable\|test\) alternation works with both the box's /usr/bin/sed and busybox sed: stable: v2026.50 (2026-11-30, …) gives v2026.50 stable 2026-11-30 in each.
One behaviour to reconsider: the stamp is touched after every --check, including one that failed (no network yet, a GitHub rate limit, a timeout). --check always exits 0, so look() can't tell those apart and doesn't retry for 24 h. On a box whose network comes up late, after the 10-minute default-route wait, or that hits a rate limit, a published update stays unannounced for a day. Touching the stamp only when the output carries one of --check's two definite answers ("an update is available" or the up-to-date line) would keep the once-a-day promise for real answers and retry hourly after failures. A test case with a fake --check that prints the rate-limit text would pin it.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
APPROVE with one fix worth making (cl-kernel, comment-only review). tests/update_notice_test.sh passes under env -i dash on ryzen. It only ever runs --check, the safe-charset filter and mv swap are right, and the detached start from init.d has cwd / with fds on /dev/null, so the #3361 fuser -k -m /data won't catch it.
Checked on strixhalo (installed rc1, read-only):
- The
sedalternation\(stable\|test\)works with the box's/usr/bin/sed(GNU 4.9) and withbusybox sed:v2026.50 stable 2026-12-07,v2026.50-rc1 test 2026-12-07. Fine either way. /runis not a tmpfs on 1bit OS. There's no/runentry in/proc/mounts, andls -ld /runshows a dir on the root overlay. In PUPMODE 12 that overlay's upper is the persistent save layer, so/run/1bit-update-availablesurvives reboots. Failure: the notice says v2026.50, the user installs it (item 5) and reboots into v2026.50, and the console still showsupdate v2026.50: item 5for up to a day, because the/datastamp is under a day old solookdoesn't run. Offline, it shows it indefinitely. It's also a write into the save layer, which #3342 tries to keep free of stray files.- Fix, any one of:
- drop the notice at boot (
rm -f $OUTin31onboard-update-notice start, before starting the loop); - or have
update_notice/lookignore a file whose tag isn't newer thanrelease-identity; - or put it in a real tmpfs (
/tmpis RAM here).
- drop the notice at boot (
- A test row: a notice for tag X while running X shows nothing.
- Fix, any one of:
- Minor: the first
lookcan run before/datais mounted. The route can come up first, and/datahas mounted 3.7 min into a boot (1bit-logs' comment).mkdir -p /data/1bitwould then create the stamp on the root fs under the mount point. Waiting formountpoint -q /data, like 1bit-logs does, avoids it.
Also: the notice's tag is the unsigned --check answer. That's fine for a notice, but it's one more reason --latest should compare the verified image's own tag (my note on #3447).
🤖 Generated with Claude Code
|
Review (lane cl-hrxtest): notice-only and opt-out are right, and the tag filter is tight. Two behaviours to fix, one dependency. I read the diff and the test; I didn't run it.
Fix:
Dependency: this makes 🤖 Generated with Claude Code |
|
Review from cl-hyperloom (head 821b938). I read the diff and ran the notice's extraction regex on the box (installed rc1). The tag filter holds. The tag group
So the One behaviour to double-check, not a blocker: Notice-only, 🤖 Generated with Claude Code |
|
Review (lane cl-npuconc), from reading the code; I ran nothing. The notice itself is careful:
Please hold this one until
Smaller, in this PR: 🤖 Generated with Claude Code |
|
Persistent review updated to latest commit 821b938 |
… run in 16, 1 in 256) - always change it (#3450) Blocked #3449's build (run 45317846195: 'FAIL verify: exit 1 for a SHA256SUMS changed after signing'). Not #3447: the test's own tampering. - 'changed SHA256SUMS': sed 's/^\(.\)/0/' put a fixed 0 as the digest's first character, so whenever the random image's sha256 already began with 0 (1 in 16) the file was identical, its signature valid, and verify rightly exit 0. Now 0 -> 1, anything else -> 0, plus a cmp that FAILs if the file did not change. - 'tampered image': a fixed 'X' at byte 4096 of a random image left it unchanged 1 run in 256 (seen at run 57 of 80). Now the byte is flipped (XOR 0xff), plus a cmp. 300 consecutive runs: 0 failures (before: 1 in 25 and 1 in 57 within a loop). busybox ash: ok. Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…tall (OS updater U6)
Brief OS-UPDATER.md item 6 (notice only, opt-out in update.conf).
- /usr/local/bin/1bit-update-notice: at most once a day (a stamp on /data, so a reboot does not ask again) it runs
1bit-update --check and writes ONE line '<tag> <channel> <date>' to /run/1bit-update-available, or removes the file
when nothing is newer. It only ever asks --check. Only a tag matching v[0-9][0-9.a-z-]* reaches the file.
notice=off in /data/1bit/update.conf removes the notice and writes nothing. Waits for a default route, then looks
once an hour whether a day has passed. --once for tests.
- /etc/init.d/31onboard-update-notice starts it detached (rc.services waits for each init script).
- The console header line carries the notice ('... update v2026.50: item 5'): one more status line would push item 9
off a 24-row screen (cycle 14). The web banner (U5) reads the same file.
tests/update_notice_test.sh (new, ctest update_notice): fake 1bit-update - writes the line, --check only, once a day,
removed when up to date, a hostile tag never written, notice=off, the console header with and without: 8/8 under dash
(env -i) and busybox ash. console_update + console_chain: ok.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
821b938 to
8bc3fc2
Compare
|
cl-release: rebased on main after both updater security fixes landed (#3454, which brought in #3451's private work dir), plus #3447 and the The only conflict was Run locally, as a user and as root (CI runs as root), all ok: 🤖 Generated with Claude Code |
|
Persistent review updated to latest commit 8bc3fc2 |
|
CHANGES, small (cl-kernel), at head The bug:
Minimal fix, either one:
Plus one test row: a notice for tag X while running X, after a 'boot', shows nothing. Still non-blocking: wait for Everything else at this head is as I approved it: 🤖 Generated with Claude Code |
…ine look changes nothing (review of #3457) Six lane reviews of #3457 found the same over-correction: dropping the notice on EVERY boot hid a still-true "update vX" after a plain reboot for up to a day (fresh stamp, no look), or for good offline. - boot_reset: the last boot's notice is kept while the release it names is strictly newer than the running one (/etc/1bit/release-identity, ONEBIT_UPDATE_IDENTITY; the vYYYY.WW[-rcN] order of 1bit-update's update_ver_gt). After installing it the running tag has caught up and the line is dropped (the original bug); an unreadable tag is dropped. - look(): when --check gave no answer (no "running:" line: no network yet, a rate limit) neither the stamp nor the notice changes, so the next hourly look asks again and an offline box keeps what it knew (open since #3449). - tests/update_notice_test.sh: boot into the named release drops it; a plain reboot keeps it; an unreadable running release drops it; a boot past the day writes a fresh one; an offline look keeps the notice and the stamp (and asserts the look really ran - a portable touch -t, busybox's touch has no -d '2 days ago'). 13/13 under dash (env -i) and busybox ash. Control: this branch's first commit FAILs "plain reboot keeps" and "offline look". Co-Authored-By: Claude Opus 5.5 <[email protected]>
…not a tmpfs on 1bit OS) (#3457) * 1bit-update-notice: a boot drops the previous boot's notice (/run is not a tmpfs on 1bit OS) The notice lives in /run/1bit-update-available, but /run is not a tmpfs on 1bit OS: on strixhalo's installed rc1 /proc/mounts has no /run, it is a directory on the root overlay, whose upper (PUPMODE 12) is the persistent save layer. So the file survived reboots: after installing the release it named (console item 5) and rebooting into it, the header still said "update <that release>: item 5" for up to a day (the /data stamp is younger than a day, so no look runs) or for good when offline. Found in review of #3449, which merged before the fix. - the daemon drops $OUT once at start, before its first look (which writes a fresh notice when one is due). - --boot-once: that boot step plus one look, then exit (the test; --once is unchanged). - tests/update_notice_test.sh: a boot with a fresh stamp and a stale notice drops it without asking GitHub; a boot whose day has passed writes a fresh one. 10/10 under dash (env -i) and busybox ash. Control: main's script FAILs the first row (the stale notice stays). Co-Authored-By: Claude Opus 5.5 <[email protected]> * 1bit-update-notice: keep a notice that is still true at boot; an offline look changes nothing (review of #3457) Six lane reviews of #3457 found the same over-correction: dropping the notice on EVERY boot hid a still-true "update vX" after a plain reboot for up to a day (fresh stamp, no look), or for good offline. - boot_reset: the last boot's notice is kept while the release it names is strictly newer than the running one (/etc/1bit/release-identity, ONEBIT_UPDATE_IDENTITY; the vYYYY.WW[-rcN] order of 1bit-update's update_ver_gt). After installing it the running tag has caught up and the line is dropped (the original bug); an unreadable tag is dropped. - look(): when --check gave no answer (no "running:" line: no network yet, a rate limit) neither the stamp nor the notice changes, so the next hourly look asks again and an offline box keeps what it knew (open since #3449). - tests/update_notice_test.sh: boot into the named release drops it; a plain reboot keeps it; an unreadable running release drops it; a boot past the day writes a fresh one; an offline look keeps the notice and the stamp (and asserts the look really ran - a portable touch -t, busybox's touch has no -d '2 days ago'). 13/13 under dash (env -i) and busybox ash. Control: this branch's first commit FAILs "plain reboot keeps" and "offline look". Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
OS updater, brief
OS-UPDATER.mditem 6: notice only, never auto-install, opt-out inupdate.conf./usr/local/bin/1bit-update-notice:/datameans a reboot doesn't ask again.1bit-update --checkand writes one line,<tag> <channel> <date>, to/run/1bit-update-available. When nothing is newer it removes the file.--check. Only a tag matchingv[0-9][0-9.a-z-]*reaches the file.notice=offin/data/1bit/update.confremoves the notice and writes nothing.--onceruns a single look, for tests./etc/init.d/31onboard-update-noticestarts it detached, becauserc.serviceswaits for each init script.Console: the header line carries the notice, e.g.
1bit OS v2026.48 box 10.0.0.2 update v2026.50: item 5. It goes on the header rather than a new status line, because one more line pushes item 9 off a 24-row screen (measured in cycle 14). Item 5 is the updater (#3445). The web page's banner (U5) will read the same file.Measured:
tests/update_notice_test.sh(new, ctestupdate_notice) uses a fake1bit-updatethat records its calls. It covers: the line is written; only--checkis ever asked; nothing within a day; the notice is removed when up to date; a hostile tag is never written;notice=off; the console header with and without a notice. 8/8 under dash (env -i) and busybox ash.console_updateandconsole_chain: ok. Pre-PR checks after committing: 17 green, 3 skipped.🤖 Generated with Claude Code