Fix flash bugs: remove netplan wifi conflict, suppress eth default route, force IPv4 for Tailscale install

- Remove 20-wifi.yaml netplan block (Bug 1): causes netplan to spawn its own wpa_supplicant instance, which claims ctrl_iface and blocks wpa_supplicant@wlan0.service. The per-interface systemd service is the correct approach.
- Add cleanup line to remove any pre-existing 20-wifi.yaml from the Armbian image.
- Patch 10-dhcp-all-interfaces.yaml to suppress default route on ethernet (Bug 2): without this, ethernet DHCP default route metric 100 beats WiFi metric 1024, routing internet traffic to ethernet which has no upstream. Causes Tailscale and firstboot to fail.
- Force IPv4 resolution in Tailscale curl (Bug 3): some homelab/ISP networks lack IPv6 internet routes. IPv6 DNS resolution for tailscale.com causes immediate curl failure on first boot.
This commit is contained in:
Cobra
2026-04-08 19:37:38 -04:00
parent 248ba78e15
commit 019a96b205
+25 -16
View File
@@ -482,21 +482,8 @@ section "Applying Configuration"
if [[ -n "$WIFI_SSID" ]]; then
step "Writing WiFi profile..."
# Netplan config (primary — renderer: networkd)
mkdir -p "${MOUNT_POINT}/etc/netplan"
cat > "${MOUNT_POINT}/etc/netplan/20-wifi.yaml" << EOF
network:
version: 2
renderer: networkd
wifis:
wlan0:
dhcp4: yes
dhcp6: no
access-points:
"${WIFI_SSID}":
password: "${WIFI_PASS}"
EOF
chmod 600 "${MOUNT_POINT}/etc/netplan/20-wifi.yaml"
# Remove any netplan wifi config — conflicts with wpa_supplicant@wlan0.service
rm -f "${MOUNT_POINT}/etc/netplan/20-wifi.yaml"
# wpa_supplicant direct config (backup — used by wpa_supplicant@wlan0.service)
mkdir -p "${MOUNT_POINT}/etc/wpa_supplicant"
@@ -543,6 +530,28 @@ EOF
info "WiFi profile written (SSID: ${WIFI_SSID})"
fi
# Patch ethernet netplan config to suppress default route
step "Patching ethernet netplan config..."
mkdir -p "${MOUNT_POINT}/etc/netplan"
cat > "${MOUNT_POINT}/etc/netplan/10-dhcp-all-interfaces.yaml" << 'EOF'
# Added by Armbian (modified: suppress default route on ethernet)
network:
version: 2
renderer: networkd
ethernets:
all-eth-interfaces:
match:
name: "e*"
dhcp4: yes
dhcp6: yes
ipv6-privacy: yes
dhcp4-overrides:
use-routes: false
dhcp6-overrides:
use-routes: false
EOF
info "Ethernet netplan patched"
# Root password
step "Setting root password..."
ROOT_PASS_HASH=$(openssl passwd -6 "$ROOT_PASS")
@@ -729,7 +738,7 @@ fi
# VPN setup
if [[ "${BB_VPN:-}" == "tailscale" && -n "${BB_TAILSCALE_KEY:-}" ]]; then
echo "[*] Installing Tailscale..."
curl -fsSL https://tailscale.com/install.sh | sh
curl -4 -fsSL https://tailscale.com/install.sh | sh
echo "[*] Connecting to Tailscale..."
tailscale up --auth-key="${BB_TAILSCALE_KEY}" --accept-routes || echo "[-] Tailscale auth failed"
# Remove auth key from config after use