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:
+25
-16
@@ -482,21 +482,8 @@ section "Applying Configuration"
|
|||||||
if [[ -n "$WIFI_SSID" ]]; then
|
if [[ -n "$WIFI_SSID" ]]; then
|
||||||
step "Writing WiFi profile..."
|
step "Writing WiFi profile..."
|
||||||
|
|
||||||
# Netplan config (primary — renderer: networkd)
|
# Remove any netplan wifi config — conflicts with wpa_supplicant@wlan0.service
|
||||||
mkdir -p "${MOUNT_POINT}/etc/netplan"
|
rm -f "${MOUNT_POINT}/etc/netplan/20-wifi.yaml"
|
||||||
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"
|
|
||||||
|
|
||||||
# wpa_supplicant direct config (backup — used by wpa_supplicant@wlan0.service)
|
# wpa_supplicant direct config (backup — used by wpa_supplicant@wlan0.service)
|
||||||
mkdir -p "${MOUNT_POINT}/etc/wpa_supplicant"
|
mkdir -p "${MOUNT_POINT}/etc/wpa_supplicant"
|
||||||
@@ -543,6 +530,28 @@ EOF
|
|||||||
info "WiFi profile written (SSID: ${WIFI_SSID})"
|
info "WiFi profile written (SSID: ${WIFI_SSID})"
|
||||||
fi
|
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
|
# Root password
|
||||||
step "Setting root password..."
|
step "Setting root password..."
|
||||||
ROOT_PASS_HASH=$(openssl passwd -6 "$ROOT_PASS")
|
ROOT_PASS_HASH=$(openssl passwd -6 "$ROOT_PASS")
|
||||||
@@ -729,7 +738,7 @@ fi
|
|||||||
# VPN setup
|
# VPN setup
|
||||||
if [[ "${BB_VPN:-}" == "tailscale" && -n "${BB_TAILSCALE_KEY:-}" ]]; then
|
if [[ "${BB_VPN:-}" == "tailscale" && -n "${BB_TAILSCALE_KEY:-}" ]]; then
|
||||||
echo "[*] Installing Tailscale..."
|
echo "[*] Installing Tailscale..."
|
||||||
curl -fsSL https://tailscale.com/install.sh | sh
|
curl -4 -fsSL https://tailscale.com/install.sh | sh
|
||||||
echo "[*] Connecting to Tailscale..."
|
echo "[*] Connecting to Tailscale..."
|
||||||
tailscale up --auth-key="${BB_TAILSCALE_KEY}" --accept-routes || echo "[-] Tailscale auth failed"
|
tailscale up --auth-key="${BB_TAILSCALE_KEY}" --accept-routes || echo "[-] Tailscale auth failed"
|
||||||
# Remove auth key from config after use
|
# Remove auth key from config after use
|
||||||
|
|||||||
Reference in New Issue
Block a user