Skip to content

fix: Wi-Fi forgotten at reboot (data-persist), plus first-boot hardening - #13

Merged
madeofpendletonwool merged 4 commits into
mainfrom
fix/data-persist-ssh-symlinks
Oct 17, 2026
Merged

madeofpendletonwool merged 4 commits into
mainfrom
fix/data-persist-ssh-symlinks

Conversation

@madeofpendletonwool

Copy link
Copy Markdown
Owner

Found setting up an x86 box from the ISO: it joined Wi-Fi from the setup hotspot, showed the pairing code, then the kiosk died. After a reboot it was "offline" and asked for Wi-Fi again.

The main bug: joined Wi-Fi never persisted

/etc/ssh/ssh_host_* are symlinks into /data (stage 20). data-persist cp -p'd each key onto its own target in both restore and save. cp refuses ("are the same file"), and under set -e the script stopped before the NetworkManager step. So:

  • boxd's post-join data-persist save failed, and the connection lived only in the tmpfs overlay
  • every boot after the first logged syncphony-data-prepare / syncphony-data-save as failed, and restored no Wi-Fi

copy_key skips a copy when both paths are already the same file (-ef). The new bats test uses the box's real symlinked layout; it fails without the fix. This affects Pis too (shared rootfs/ step).

Smaller fixes from the same session

  • /etc/hosts: name= changed the hostname but left the old name on the 127.0.1.1 line, so sudo said "unable to resolve host". config.SetHostname now syncs it, on the boot path and on boxd's setup save. SB_HOSTS points it elsewhere in tests.
  • cage -s: Ctrl+Alt+Fn was blocked, so a dead kiosk left no way to reach a console from the box's keyboard.
  • Kiosk StartLimitIntervalSec=0: systemd's default start limit could stop a fast-failing kiosk for good.
  • Clock-jump updates: with no RTC the box boots in the past. syncphony-update.timer plans 04:00 from that clock, and fires immediately once NTP corrects it. boxd update now skips non-manual runs outside the 04:00 hour.

ADRs 0002 and 0012 and the CHANGELOG are updated.

Testing

  • make test (64 bats + Go tests) and make lint pass in a golang:1.26-trixie container
  • Not yet verified on hardware: reinstall the x86 box from an ISO with this branch, join Wi-Fi, reboot, and confirm it reconnects by itself

Still open

  • The first kiosk death (Fatal Wayland communication error: Broken pipe, cage exiting under Chromium, about a minute after pairing showed) is unexplained. That boot's journal wasn't captured. With cage -s and the start-limit fix it should now recover, and be inspectable if not.
  • Failed unmounting data.mount at shutdown (seen in the journal, not investigated).

…ersisted

/etc/ssh/ssh_host_* are symlinks into /data (stage 20). Both restore and
save cp'd each key onto its own target, cp refused ("are the same file"),
and set -e ended the script before the NetworkManager step. A Wi-Fi joined
from the setup hotspot lived only in RAM, and every boot after the first
logged syncphony-data-prepare/-save as failed.

copy_key skips a copy when both paths are already the same file. The new
bats test uses the box's real layout (symlinked keys); it fails without
the fix.
name= renamed the box (hostnamectl) but left the image's old name in
/etc/hosts, so the box couldn't resolve itself: sudo printed "unable to
resolve host" on every call. config.SetHostname now syncs that line, on
the boot path and on boxd's setup save (which called hostnamectl itself
before). SB_HOSTS points it elsewhere in tests.
…lock jump

cage blocks VT switching unless started with -s, so a box whose kiosk
died showed a frozen screen and no way to log in from its own keyboard.
The consoles still ask for a password.

syncphony-update.timer plans its next 04:00 from the boot clock. A box
with no RTC boots in the past; once NTP corrects the clock that 04:00 is
gone and the timer fires immediately, mid-setup. boxd update now skips a
non-manual run outside the 04:00 hour.
…ixes

systemd's default start limit (5 starts in 10 s) stopped a fast-failing
kiosk for good, leaving the TV on a dead console. StartLimitIntervalSec=0
keeps Restart=always true.
@madeofpendletonwool
madeofpendletonwool merged commit b600bf3 into main Oct 17, 2026
3 checks passed
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.

1 participant