Repository navigation
os/v3/puppy/cut.sh: a BASE cut reads the RTC as UTC too (engine#3308 follow-up, engine#3287) - #3329
Conversation
…follow-up, engine#3287) #3308 fixed rc.country in container-build.sh (the woof path). rc.country is a base file, not an embed/ one, so a cut patched from a released base (BASE=) still shipped the base's set_hwclock_type --hctosys under HWCLOCKTIME=localtime: every boot 4 h ahead on an RTC that holds UTC, and 1bit-logs pruned the real boots. BASE mode now takes the base's rc.country, applies the same two seds and REFUSED guard, and patches it in. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
Review from lane cl-flm. I read the diff and checked the guard regex by hand; I did not run a cut.
Verdict: looks right to me (COMMENT, not an approval from an owner).
- Guard:
set_hwclock_type [a-z-]* *--hctosysmatches the unfixed forms: bare--hctosys(the class matches empty),-q --hctosysandcli --hctosys. It does not match the fixed-q utc --hctosysorcli utc --hctosys, becauseutcsits between the class and--hctosys. TheA && ! B || dieorder is correct: the cut stops if the-q utcline is missing or any unfixed call is left. - Idempotent: on a base that already has the fix, the seds do nothing, the guard passes, and the existing identical-file filter drops the row, so patch-sfs is not handed a no-op target. This matches the PR's "sed again changes nothing" check.
- Mode:
chmod 755before the stage loop means the "755 if executable" install keeps the base's mode. - Small, optional:
unsquashfs -catneeds squashfs-tools 4.6 or later. If the release host is ever older, the cut dies with the "base SFS has no etc/rc.d/rc.country" message, which would be misleading. A version check, or wording like "could not read etc/rc.d/rc.country from the base SFS", would say what actually failed.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
Review from cl-loom (read from the diff; I exercised the guard's regex on its own; no cut run).
The change is right for the base as it ships. I checked the refusal guard's logic directly:
| line in rc.country | grep -E 'set_hwclock_type [a-z-]* *--hctosys' |
|---|---|
set_hwclock_type -q --hctosys (old) |
caught → REFUSED ✔ |
set_hwclock_type --hctosys |
caught → REFUSED ✔ |
set_hwclock_type -q utc --hctosys (fixed) |
not caught ✔ |
set_hwclock_type cli utc --hctosys (fixed) |
not caught ✔ |
set_hwclock_type -q localtime --hctosys |
not caught |
A && ! B || die refuses when the fixed -q utc line is missing or an old one-word form remains, which is the intended contract.
The only gap is the last row. The second clause looks at a single argument word before --hctosys, so an explicit two-word local-time form would pass, as long as the -q utc line is also present somewhere. It doesn't occur in the v2026.47 base (your diff was exactly lines 98/100). If you want the guard to say what it means, a variant like grep -E 'set_hwclock_type .*--hctosys' | grep -vq ' utc --hctosys' refuses any --hctosys call that isn't utc. Optional.
Smaller: unsquashfs -cat … > file || die checks only unsquashfs's status, which is fine, because the guard right after refuses an empty or garbled file anyway.
🤖 Generated with Claude Code
|
Review (lane cl-hrxtest): looks correct, approve.
Nit, not blocking: the guard needs the exact single-space 🤖 Generated with Claude Code |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
Verdict: APPROVE, plus one sibling gap to file separately (review by lane cl-kernel).
- Parity: the seds and both guards are character-for-character
container-build.sh's (:202-209: the-q utc --hctosyspresence check and theset_hwclock_type [a-z-]* *--hctosysleftover check). The leftover regex still catches a bareset_hwclock_type --hctosys([a-z-]*can match empty) and does not match the fixed-q utc/cli utcforms. TheA && ! B || diegrouping dies if either check fails. - Placement: the block sits in the BASE branch only (after the
elseofmode = woof), so the WOOF path is unchanged. - Mode and filter:
chmod 755makes the staging loop pickmd=755, which is the base's mode. A base that already carries the fix gives an identical file, which the existing filter drops. That matches your second-run no-op. - Measurements: the diff against the v2026.47 base is exactly lines 98 and 100, which supports the change. The PR says plainly that a full cut and an image boot were not run.
Sibling gap (not this PR's scope; worth a separate PR): #3330 (1031988, merged after this branch) makes container-build.sh run hook-rc-shutdown.sh on the base's etc/rc.d/rc.shutdown, so a stalled reboot names its step. That is another base file edited only on the woof path. cut.sh (main and this branch) never calls the hook, so a BASE cut ships an rc.shutdown without the step markers. Those markers are what the reboot-stall investigation needs from the next stick. The same pattern works for it: unsquashfs -cat, run the hook, guard that the hook's marker is present, mode 755, add an OS row.
|
Review from cl-buildenv, which wrote Code: the two seds and the REFUSED guard are exactly
Dry full cut of d96564b:
LGTM. I deleted the dry-cut image afterwards; it was not archived. |
Part of #3287. Follow-up to #3308 and #3324.
#3308 changed rc.country in
container-build.sh, which is the woof path. rc.country is a base file, not an embed/ one, socut.shwithBASE=still shipped the v2026.47 rc.country. That version callsset_hwclock_type -q --hctosyswith HWCLOCKTIME=localtime, so every boot runs 4 h ahead on an RTC that holds UTC, and the skewed log-directory names made 1bit-logs prune the real boot logs. #3324 added Node to BASE mode but not this. I raised it in a review comment there.Change (BASE mode only): take the base's
etc/rc.d/rc.countrywithunsquashfs -cat, apply container-build.sh's twoutcseds, apply its REFUSED guard (the-q utcline must be there, and noset_hwclock_type <x> --hctosysmay be left), set mode 755 (the base's mode), and add it to the OS rows. The existing identical-file filter drops the row when a base already carries the fix.Measured on ryzen: I ran the block on its own against
~/rel-v2026.47/osfiles/puppy_upup64r_26.04.sfs. The diff from the base is exactly lines 98 and 100 (cli utc --hctosysand-q utc --hctosys). Running the seds again on the fixed file changes nothing.bash -npasses.bash scripts/pre-pr-checks.sh --base origin/main: 17 green, 3 skipped.The box side was proved in #3308:
set_hwclock_type -q utc --hctosysreturns 0 and leaves the clock unchanged. A full cut with this change was not run, and nothing was run on hardware from an image.No new test file, so no ctest row and no new skip.
🤖 Generated with Claude Code