Repository navigation
os: quiet the VT, keep the serial log verbose (#703) - #719
bong-water-water-bong wants to merge 4 commits into
Conversation
|
Merge order matters for these nine (they are stacked). Each PR's base is the previous branch, so GitHub retargets the next one to
Each is one issue, Apache headers unchanged, and each is verified by the QEMU image test of the whole chain (result in the state file). One thing to know before merging: #726's efivarfs staging is conditional on the image kernel having the module — the kernel c18 ships ( |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: CHANGES
Built the image and checked the console behaviour. The change lands correctly and the gates are safe; the claim in the title does not hold on the kernel we ship.
Image build (per the stack's rule that an os/mini PR must build one):
EC_MODULE=skip AMDXDNA_KO=skip KVER=$(uname -r) LEMONADE=~/wt/release-rc/work/lemonade \
./os/mini/mkimage.sh /tmp/osimg719 <engine build> -> 36 s
1bit-os.efi 105,394,176 B · 1bit-os.img 2,395,996,160 B · initramfs.img 93,727,232 B
bash -n clean on both changed scripts. (EC_MODULE=skip/AMDXDNA_KO=skip are the only shortcuts: the EC module needs its own kernel build. LEMONADE= points at the release lane's prebuilt lemond; without it mkimage compiles Lemonade from source, which took 1m30s of wall and 25 minutes of CPU and then failed here.)
The change lands: the cmdline embedded in the built 1bit-os.efi is console=tty0 console=ttyS0,115200 loglevel=4 panic=600 … rdinit=/init — ignore_loglevel is gone (0 occurrences in the binary), and the init inside the initramfs carries the guarded raise at line 33.
The gates' ttyS0 assertions are unchanged. The only serial-log assertions in the gate scripts are LIVE: runs from RAM (vmtest.sh:122,125,129) and INSTALLED (vmtest.sh:251) — both are init's/install's own echos to the console, which no kernel loglevel touches. Nothing in vmtest*.sh or release-check.sh matches a kernel line. That half of the ask is satisfied.
What does not hold: "keep the serial log verbose". On this box's kernel — 7.3.0-rc4-1bit-perfopt+, the same image the PR builds — the per-console interface does not exist:
stat /sys/class/console -> No such file or directory
so [ -w /sys/class/console/ttyS0/level ] is false, the raise is a no-op, and ttyS0 stays at the cmdline's loglevel=4. Consequences, which are exactly the lines the 26 Oct hardware debugging relied on:
- kernel
KERN_INFOlines leave the serial transcript entirely — USB connect/disconnect, driver and module load,amdxdnabring-up. The old behaviour dumped those over the prompt, which was the annoyance; the new behaviour removes them from the log the owner reads, which is a different problem; - and even on a kernel that has the knob, the raise happens in init, so everything the kernel prints before init still goes out at level 4 on both consoles.
The code comment already concedes the fallback ("where they do not the global level stays at 4"), so this is not hidden — but the PR title is keep the serial log verbose, and on the target kernel it does the opposite.
Two ways to close it, both small:
- When the attribute is absent, mirror the kernel log to the serial console from init —
cat /proc/kmsg > /dev/ttyS0 &(or busyboxdmesg -wwhere available) — which restores the verbose transcript for gates and humans without per-console support, and is the behaviour the oldignore_loglevelgave. - Or keep
loglevel=7on the cmdline and quiet only the VT after init has drawn its banner, and reword the title/summary to say the serial transcript is unchanged rather than verbose.
No tprs-ready. The stack merge order this PR states (703, 704, 705, 707, 708, 706, 710, 709, 711) is noted; I am reviewing each on its own diff against its own base.
Review: /sys/class/console does not exist on 7.3.0-rc4-1bit-perfopt+, so raising ttyS0's per-console level was a no-op and the serial log lost KERN_INFO (USB, module load, amdxdna bring-up) - the lines the 26 Oct hardware debugging was read from. Where the per-console knob is missing, init now replays the ring buffer to ttyS0 and follows /dev/kmsg (non-consuming, so dmesg still works, and a fresh open starts at the oldest record). The VT keeps loglevel=4, and the gates' serial assertions are init's own lines.
|
You are right, and the fix is the one you suggested as option 1 — at the new head Measured first, on this box's kernel: What init does now (both paths, in order): if [ -w /sys/class/console/ttyS0/level ]; then
echo 7 > /sys/class/console/ttyS0/level # kernels that have a per-console level
elif [ -c /dev/ttyS0 ] && [ -r /dev/kmsg ]; then
( cat /dev/kmsg > /dev/ttyS0 ) > /dev/null 2>&1 & # this kernel: replay the ring buffer, then follow
fi
The VT side is unchanged: the cmdline still carries The title/summary now say what the code does: quiet VT, kernel log kept on the serial transcript. Verification I can offer here: the image builds ( PR-READY. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At aa30a0c3. The blocker is fixed, and fixed the way the measurement points: since this kernel has no per-console level, the log is replayed from the ring buffer instead.
if [ -w /sys/class/console/ttyS0/level ]; then
echo 7 > /sys/class/console/ttyS0/level
elif [ -c /dev/ttyS0 ] && [ -r /dev/kmsg ]; then
( cat /dev/kmsg > /dev/ttyS0 ) > /dev/null 2>&1 &
fiThat is the right pair of branches and the right fallback: /dev/kmsg is non-consuming, so dmesg still works afterwards, and a fresh open starts at the oldest record, so the early boot lines reach the serial transcript — which is the behaviour ignore_loglevel used to give and what the 26 Oct hardware debugging was read from. The VT stays quiet because neither branch touches it. The comment now states the fact I measured (ls /sys/class/console → No such file) rather than asserting a capability the kernel lacks, and it explicitly notes that the gates' assertions (LIVE banner, INSTALLED) are init's own lines and unaffected at any kernel level.
The cmdline is still console=tty0 console=ttyS0,115200 loglevel=4 … with no ignore_loglevel, so the VT behaviour is unchanged from the head I reviewed.
Not verified: the replay's actual output on hardware — that the background cat /dev/kmsg puts the early lines in order and keeps following without blocking init. That needs a boot (QEMU or the board); the code path is one line and shell-valid, and I could not construct a failure mode from reading it.
tprs-ready applied.
|
Measured on a boot of this branch head, as promised. The kernel log is back on ttyS0 — 635 records, across every level: And they are the lines you named (raw So: VT quiet at
|
PR Reviewer Guide 🔍(Review updated until commit bea68a1)Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At 598686d5, rebased as the merges ahead of it landed. The author patch is byte-identical to the head I reviewed — patch-id from the merge base is unchanged before and after — so only main arrived in the rebase and my review stands without re-reading.
Nothing new to verify; everything in my earlier verdict on this PR, including what I recorded as not-verified-by-me, applies unchanged at this head.
|
Superseded by #742 — the same reviewed content as one commit on |
…ntity (#704) (#720) * os: the banner and the release check read the image's own release identity (#704) * os: the release identity reports the HRX pin, not the engine commit (#704) Review of #720: `git -C third_party/hrx-system rev-parse HEAD` walks up to the parent repository when the submodule is not checked out - the way the release lane builds - so the image shipped 'hrx-system: <engine sha>' and the '|| unknown' fallback never fired. The gitlink recorded in this tree is the pin the release ships: `git ls-tree HEAD third_party/hrx-system`. Measured before/after below. * os: one boot flow - countdown on the choice line, live status while DHCP and Lemonade come up (#705) * os: a 16x32 console font and a full-width selection bar (#707) (#722) Co-authored-by: bong-water-water-bong <[email protected]> * os: drop the sound modules and refuse unsigned modules in mkimage (#708) (#723) * os: a 16x32 console font and a full-width selection bar (#707) * os: drop the sound modules and refuse unsigned modules in mkimage (#708) --------- Co-authored-by: bong-water-water-bong <[email protected]> * os: prepare-stick grows the data partition to the stick's full size (#706) (#724) * os: a 16x32 console font and a full-width selection bar (#707) * os: drop the sound modules and refuse unsigned modules in mkimage (#708) * os: prepare-stick grows the data partition to the stick's full size (#706) --------- Co-authored-by: bong-water-water-bong <[email protected]> --------- Co-authored-by: bong-water-water-bong <[email protected]>
|
Persistent review updated to latest commit bea68a1 |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At bea68a12. The delta since my last verdict is the rest of the stack arriving through rebases (1bit-menu's bar from #707, say() from #705, prepare-stick.sh from #706) — all reviewed in their own PRs — and the fix I passed is intact: grep -c "cat /dev/kmsg" os/mini/init.sh → 1, so the ring-buffer replay into ttyS0 is still there alongside the per-console branch, and the cmdline is still loglevel=4 without ignore_loglevel.
That was the whole blocker on this PR: the serial transcript had to keep the kernel log it had under ignore_loglevel on a kernel with no per-console level, and the fallback does exactly that (/dev/kmsg is non-consuming, a fresh open starts at the oldest record, and the VT stays quiet either way).
tprs-ready stands.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At bea68a12 — verdict unchanged, posted again because it is the head in question. The fix I asked for is in and intact: no per-console level on this kernel, so cat /dev/kmsg > /dev/ttyS0 & replays the ring buffer and follows it (grep -c "cat /dev/kmsg" os/mini/init.sh → 1), cmdline still loglevel=4 without ignore_loglevel, VT untouched, and the gates' assertions are init's own echoes at any level.
Fixes #703. The live image's cmdline carried
ignore_loglevel loglevel=7, so the c18 dry run scrolled everykernel line over the VT before the banner. The cmdline now boots at
loglevel=4(warnings and errors only) andinit's first act raises ttyS0 - the console the QEMU gates read - to level 7 where the kernel exposes a
per-console level (
/sys/class/console/ttyS0/level).Stack: 1 of 9, each based on the previous one; merge in order (703, 704, 705, 707, 708, 706, 710, 709, 711).
Each later PR retargets to main automatically when its base branch is merged.
PR-READY.