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