From d66b5470458d64b5ebf986d131594f53cf0803e4 Mon Sep 17 00:00:00 2001 From: Cobra Date: Tue, 7 Apr 2026 21:50:51 -0400 Subject: [PATCH] Fix wpa_supplicant conflict and firstboot robustness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove generic wpa_supplicant.service symlink when wpa_supplicant@wlan0 is enabled — both services fight over wlan0 causing WiFi instability and SSH drops - Add udev rule to disable WiFi power saving (aw859a drops connections under load with power save on) - Drop set -e from firstboot script so a failing step does not kill the whole run - Guard setup.sh call — skip gracefully if not present (dev/test scenario) Fixes #295 and #296 --- operator_setup.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/operator_setup.sh b/operator_setup.sh index 550e8be..8eb1366 100755 --- a/operator_setup.sh +++ b/operator_setup.sh @@ -534,6 +534,16 @@ EOF "${WPA_WANTS}/wpa_supplicant@wlan0.service" fi + # Disable the generic wpa_supplicant.service — it conflicts with @wlan0 instance + # Both would fight over wlan0, causing WiFi instability and SSH drops + rm -f "${MOUNT_POINT}/etc/systemd/system/multi-user.target.wants/wpa_supplicant.service" + + # Disable WiFi power saving — aw859a driver drops under load with power save on + mkdir -p "${MOUNT_POINT}/etc/udev/rules.d" + cat > "${MOUNT_POINT}/etc/udev/rules.d/70-wifi-pm.rules" << 'EOF' +ACTION=="add", SUBSYSTEM=="net", KERNEL=="wlan*", RUN+="/usr/sbin/iw dev %k set power_save off" +EOF + info "WiFi profile written (SSID: ${WIFI_SSID})" fi @@ -665,9 +675,9 @@ step "Installing first-boot service..." cat > "${MOUNT_POINT}/root/bb-firstboot-run.sh" << 'RUNEOF' #!/usr/bin/env bash # Runs once on first boot, then disables itself -set -euo pipefail LOG=/root/bb-firstboot.log exec >> "$LOG" 2>&1 +set -uo pipefail echo "=== BigBrother first-boot setup: $(date) ===" @@ -687,9 +697,13 @@ done source /root/bb-config.env -# Install BigBrother -cd /root/bb-src -bash setup.sh --enable-service +# Install BigBrother (skip if setup.sh not present — dev/test mode) +if [[ -f /root/bb-src/setup.sh ]]; then + cd /root/bb-src + bash setup.sh --enable-service || echo "[-] BigBrother setup.sh failed (non-fatal)" +else + echo "[-] bb-src/setup.sh not found — skipping BigBrother install" +fi # VPN setup if [[ "${BB_VPN:-}" == "tailscale" && -n "${BB_TAILSCALE_KEY:-}" ]]; then