Reported: Core Settings -> WiFi "just returns to the core settings menu".
run_menu clears the screen the moment a handler returns, and every early
exit in wifi_menu returned without a pause - so whatever went wrong
(no adapter found, interface wouldn't come up, ...) was wiped before it
could be read.
- wifi_menu now runs the wizard (renamed wifi_configure) and always
pauses afterwards, success or failure.
- Adapter detection by type (/sys/class/net/*/wireless or phy80211),
falling back to wl* - not every adapter is named wl*. When none is
found, lists the interfaces that do exist.
- Clears a software rfkill block via sysfs before `ip link set up`
(rfkill isn't installed on a server); warns on a hard block; shows
ip's actual error if bringing the link up still fails.
- Writes its own $NETPLAN_DIR/60-kiosk-wifi.yaml instead of overwriting
the first *.yaml found - on a fresh install that's the installer's
50-cloud-init.yaml with the wired config, which it silently dropped.
- SSID/password written as YAML single-quoted scalars: a password with
" or \ produced invalid YAML before.
- Success = the WiFi interface itself has an IPv4 address (waits up to
30s), not "the machine has some IP". The SSH revert watchdog uses the
same test instead of pinging 8.8.8.8, which on a network without
internet reverted every working connection; with no previous WiFi file
it reverts by removing ours.
Tested with ip/netplan/sudo stubbed and netplan files in a scratch dir:
installer's wired file untouched, own file written, SSID
`Bob's "Café" #2` and password `p@ss"wo'rd\\:#x` round-trip through a
YAML parser exactly, no-address case reports instead of claiming
success, early errors stay on screen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cjz8a58eB5P9sUweqd3NHm