Skip to content

os: one boot flow - a countdown on the choice line, live status while DHCP and Lemonade come up (#705) - #721

Merged
bong-water-water-bong merged 1 commit into
osv2/704-image-versionfrom
osv2/705-one-flow
Nov 1, 2026
Merged

bong-water-water-bong merged 1 commit into
osv2/704-image-versionfrom
osv2/705-one-flow

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Fixes #705. The c18 dry run showed a 12 s chooser, then a blank "starting" while DHCP and lemond came up.

The selection timer is now on the choice line itself ("choice [1] starts in 12 s", any key picks), so the
chooser is one screen. Each wait then says what it is: network: waiting for DHCP on eth0 -> network: <ip> on eth0, Lemonade: starting -> Lemonade: up on http://<ip>:13305/ (a real probe, 20 s), then engine: HRX0 ready (a llama-server --list-devices probe). All of it goes to the VT, the serial log and /data/boot.log.
PR-READY.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY

At cda97738 (own diff: os/mini/init.sh +49 −10).

Checked statically, and the one thing in it that could have bitten is explicitly fixed:

  • say() ordering. It moves to line 47, and its first use is line 55 — so the failure its own comment records ("it used to sit below the kernel link line, so the console lost that line to say: not found") is fixed rather than re-introduced. That was the only structural risk in the hunk.
  • Countdown. i=12, while [ "$i" -gt 0 ], repaint_choice, read -r -t 1 -n 1 c, i=$((i-1)), then unset -f repaint_choice — the decrement and the cleanup are both present, and read -r -t 1 was already used by the old loop, so busybox -t support is proven in this image rather than newly assumed.
  • Gate strings intact: grep -c "LIVE: runs from RAM" os/mini/init.sh → 1, so the QEMU gate's serial assertion still exists at this head.
  • bash -n clean.

The per-wait reporting (network: waiting for DHCP on <if> (state) then network: <addr|no address yet> on <if>, and say writing to console, tty1 and /data/boot.log) is the right fix for "no way to tell a wait from a hang": the same line lands in all three places the c18 dry run had to reconcile by hand.

Not verified, deferred deliberately: the behaviour itself — repaint rate, that a keypress beats the countdown, that the DHCP lines appear on ttyS0 — needs the QEMU gate, and I am not starting a second QEMU while another lane's os3i VM is live on this box. Per the new memory rule that run belongs in a systemd-run --user -p MemoryMax= unit, one at a time. If you want it gated before merge rather than after, say so and I will queue it behind the running VM.

tprs-ready applied. Merge order note: this sits on #720, which is CHANGES on a one-line hrx-system pin fix, so it cannot actually land until that is amended.

@bong-water-water-bong bong-water-water-bong added the tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied label Nov 1, 2026
@bong-water-water-bong
bong-water-water-bong merged commit 86dbe7e into osv2/704-image-version Nov 1, 2026
5 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the osv2/705-one-flow branch November 1, 2026 03:08
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

705 - Partially compliant

Compliant requirements:

  • The selection timer is now on the choice line itself with a countdown
  • The appliance screen shows live status updates for network, Lemonade, and engine
  • All messages go to screen, serial line, and /data/boot.log
  • QR code and URL appear when network and lemond are ready
  • tty1-only behavior maintained

Non-compliant requirements:

  • The PR does not explicitly mention the QR code appearing in the output, though it's implied by "URL appears the moment the IP and lemond are both there"

Requires further human verification:

  • Visual confirmation that the QR code and URL appear correctly in the terminal output
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Potential race condition in DHCP wait

The DHCP wait loop uses udhcpc -b -q -t 5 which runs in background, but the script immediately proceeds to check for IP address. If the DHCP process hasn't completed within the 5-second timeout, the script may not detect the IP address correctly, potentially causing the network status to show "no address yet" even when the interface has an IP. This could lead to a misleading status message.

    say "  network: waiting for DHCP on $i ($(cat /sys/class/net/$i/operstate 2>/dev/null || echo unknown))"
    udhcpc -i "$i" -b -q -t 5 -s /etc/udhcpc.script >/dev/null 2>&1
    a=$(ip -4 -o addr show dev "$i" scope global 2>/dev/null | awk '{print $4}' | cut -d/ -f1 | head -1)
    say "  network: ${a:-no address yet} on $i"
done
Possible infinite loop in Lemonade wait

The loop that waits for Lemonade to start uses wget -q -O /dev/null -T 1 with a 20-second timeout. If the network interface or the Lemonade service is not fully ready, this could cause the loop to run for the full 20 seconds, potentially leading to a long delay before the user sees the final status message. This could be mitigated by adding a more robust check for service readiness.

for i in $(seq 1 20); do
    for a in "$lhost" 127.0.0.1; do
        case "$a" in 0.0.0.0|::|'') continue ;; esac
        if wget -q -O /dev/null -T 1 "http://$a:$lport/" 2>/dev/null; then lup=1; break 2; fi
    done
    sleep 1
done
[ "$lup" = 1 ] && say "  Lemonade: up on http://$lhost:$lport/  (API key: $key)" ||
    say "  Lemonade: not answering yet after 20 s (log: /tmp/lemond.log; API key: $key)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 3/5 tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant