feat(network): replace systemd-networkd with NetworkManager and add broadcom-wl
- commit
- 11218e6abeb843f6c28b3e36911b3603962503e4
- author
- bnema · · 2025-10-21 21:14 UTC
- committer
- bnema · · 2025-10-21 18:05 UTC
- parent
- d367610
- signature
- unsigned
2 files · +33 -36
M install/config/network.sh +30 -36
| @@ -1,54 +1,48 @@ | |||
| 1 | 1 | #!/bin/bash | |
| 2 | - | # Configure network (systemd-networkd + systemd-resolved) | |
| 2 | + | # Configure network (NetworkManager) | |
| 3 | 3 | ||
| 4 | 4 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring network..." | |
| 5 | 5 | ||
| 6 | - | # Enable systemd-networkd for DHCP | |
| 7 | - | mkdir -p /mnt/etc/systemd/network | |
| 8 | - | ||
| 9 | - | cat > /mnt/etc/systemd/network/20-wired.network <<EOF | |
| 10 | - | [Match] | |
| 11 | - | Name=en* | |
| 12 | - | ||
| 13 | - | [Network] | |
| 14 | - | DHCP=yes | |
| 15 | - | EOF | |
| 16 | - | ||
| 17 | - | cat > /mnt/etc/systemd/network/25-wireless.network <<EOF | |
| 18 | - | [Match] | |
| 19 | - | Name=wl* | |
| 20 | - | ||
| 21 | - | [Network] | |
| 22 | - | DHCP=yes | |
| 23 | - | EOF | |
| 24 | - | ||
| 25 | - | # Enable services | |
| 26 | - | arch-chroot /mnt systemctl enable systemd-networkd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 27 | - | arch-chroot /mnt systemctl enable systemd-resolved >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 28 | - | ||
| 29 | - | # Enable iwd for WiFi | |
| 30 | - | arch-chroot /mnt systemctl enable iwd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 6 | + | # Enable NetworkManager service | |
| 7 | + | arch-chroot /mnt systemctl enable NetworkManager >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |
| 31 | 8 | ||
| 32 | 9 | # Migrate WiFi credentials from ISO if detected | |
| 33 | 10 | if [ -n "$ARCHUP_WIFI_SSID" ] && [ -n "$ARCHUP_WIFI_PASSPHRASE" ]; then | |
| 34 | 11 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Migrating WiFi credentials..." | |
| 35 | 12 | ||
| 36 | - | # Create iwd config directory in target system | |
| 37 | - | mkdir -p /mnt/var/lib/iwd | |
| 13 | + | # Create NetworkManager connection file | |
| 14 | + | cat > "/mnt/etc/NetworkManager/system-connections/${ARCHUP_WIFI_SSID}.nmconnection" <<EOF | |
| 15 | + | [connection] | |
| 16 | + | id=${ARCHUP_WIFI_SSID} | |
| 17 | + | uuid=$(uuidgen) | |
| 18 | + | type=wifi | |
| 19 | + | autoconnect=true | |
| 20 | + | ||
| 21 | + | [wifi] | |
| 22 | + | mode=infrastructure | |
| 23 | + | ssid=${ARCHUP_WIFI_SSID} | |
| 38 | 24 | ||
| 39 | - | # Create PSK file for the WiFi network | |
| 40 | - | cat > "/mnt/var/lib/iwd/${ARCHUP_WIFI_SSID}.psk" <<EOF | |
| 41 | - | [Security] | |
| 42 | - | PreSharedKey=$ARCHUP_WIFI_PASSPHRASE | |
| 25 | + | [wifi-security] | |
| 26 | + | key-mgmt=wpa-psk | |
| 27 | + | psk=${ARCHUP_WIFI_PASSPHRASE} | |
| 43 | 28 | ||
| 44 | - | [Settings] | |
| 45 | - | AutoConnect=true | |
| 29 | + | [ipv4] | |
| 30 | + | method=auto | |
| 31 | + | ||
| 32 | + | [ipv6] | |
| 33 | + | addr-gen-mode=default | |
| 34 | + | method=auto | |
| 35 | + | ||
| 36 | + | [proxy] | |
| 46 | 37 | EOF | |
| 47 | 38 | ||
| 39 | + | # Set correct permissions (NetworkManager requires 600) | |
| 40 | + | chmod 600 "/mnt/etc/NetworkManager/system-connections/${ARCHUP_WIFI_SSID}.nmconnection" | |
| 41 | + | ||
| 48 | 42 | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi credentials migrated: $ARCHUP_WIFI_SSID" | |
| 49 | 43 | echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 50 | 44 | fi | |
| 51 | 45 | ||
| 52 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Network configured (DHCP)" | |
| 46 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Network configured" | |
| 53 | 47 | ||
| 54 | - | echo "Enabled systemd-networkd and iwd" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| 48 | + | echo "Enabled NetworkManager" >> "$ARCHUP_INSTALL_LOG_FILE" | |
| @@ -1,54 +1,48 @@ | |||||
| 1 | #!/bin/bash | 1 | #!/bin/bash | ||
| 2 | - | # Configure network (systemd-networkd + systemd-resolved) | 2 | + | # Configure network (NetworkManager) |
| 3 | 3 | ||||
| 4 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring network..." | 4 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Configuring network..." | ||
| 5 | 5 | ||||
| 6 | - | # Enable systemd-networkd for DHCP | 6 | + | # Enable NetworkManager service |
| 7 | - | mkdir -p /mnt/etc/systemd/network | 7 | + | arch-chroot /mnt systemctl enable NetworkManager >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 |
| 8 | - | ||||
| 9 | - | cat > /mnt/etc/systemd/network/20-wired.network <<EOF | |||
| 10 | - | [Match] | |||
| 11 | - | Name=en* | |||
| 12 | - | ||||
| 13 | - | [Network] | |||
| 14 | - | DHCP=yes | |||
| 15 | - | EOF | |||
| 16 | - | ||||
| 17 | - | cat > /mnt/etc/systemd/network/25-wireless.network <<EOF | |||
| 18 | - | [Match] | |||
| 19 | - | Name=wl* | |||
| 20 | - | ||||
| 21 | - | [Network] | |||
| 22 | - | DHCP=yes | |||
| 23 | - | EOF | |||
| 24 | - | ||||
| 25 | - | # Enable services | |||
| 26 | - | arch-chroot /mnt systemctl enable systemd-networkd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 27 | - | arch-chroot /mnt systemctl enable systemd-resolved >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 28 | - | ||||
| 29 | - | # Enable iwd for WiFi | |||
| 30 | - | arch-chroot /mnt systemctl enable iwd >> "$ARCHUP_INSTALL_LOG_FILE" 2>&1 | |||
| 31 | 8 | ||||
| 32 | # Migrate WiFi credentials from ISO if detected | 9 | # Migrate WiFi credentials from ISO if detected | ||
| 33 | if [ -n "$ARCHUP_WIFI_SSID" ] && [ -n "$ARCHUP_WIFI_PASSPHRASE" ]; then | 10 | if [ -n "$ARCHUP_WIFI_SSID" ] && [ -n "$ARCHUP_WIFI_PASSPHRASE" ]; then | ||
| 34 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Migrating WiFi credentials..." | 11 | gum style --foreground 6 --padding "1 0 0 $PADDING_LEFT" "Migrating WiFi credentials..." | ||
| 35 | 12 | ||||
| 36 | - | # Create iwd config directory in target system | 13 | + | # Create NetworkManager connection file |
| 37 | - | mkdir -p /mnt/var/lib/iwd | 14 | + | cat > "/mnt/etc/NetworkManager/system-connections/${ARCHUP_WIFI_SSID}.nmconnection" <<EOF |
| 15 | + | [connection] | |||
| 16 | + | id=${ARCHUP_WIFI_SSID} | |||
| 17 | + | uuid=$(uuidgen) | |||
| 18 | + | type=wifi | |||
| 19 | + | autoconnect=true | |||
| 20 | + | ||||
| 21 | + | [wifi] | |||
| 22 | + | mode=infrastructure | |||
| 23 | + | ssid=${ARCHUP_WIFI_SSID} | |||
| 38 | 24 | ||||
| 39 | - | # Create PSK file for the WiFi network | 25 | + | [wifi-security] |
| 40 | - | cat > "/mnt/var/lib/iwd/${ARCHUP_WIFI_SSID}.psk" <<EOF | 26 | + | key-mgmt=wpa-psk |
| 41 | - | [Security] | 27 | + | psk=${ARCHUP_WIFI_PASSPHRASE} |
| 42 | - | PreSharedKey=$ARCHUP_WIFI_PASSPHRASE | |||
| 43 | 28 | ||||
| 44 | - | [Settings] | 29 | + | [ipv4] |
| 45 | - | AutoConnect=true | 30 | + | method=auto |
| 31 | + | ||||
| 32 | + | [ipv6] | |||
| 33 | + | addr-gen-mode=default | |||
| 34 | + | method=auto | |||
| 35 | + | ||||
| 36 | + | [proxy] | |||
| 46 | EOF | 37 | EOF | ||
| 47 | 38 | ||||
| 39 | + | # Set correct permissions (NetworkManager requires 600) | |||
| 40 | + | chmod 600 "/mnt/etc/NetworkManager/system-connections/${ARCHUP_WIFI_SSID}.nmconnection" | |||
| 41 | + | ||||
| 48 | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi credentials migrated: $ARCHUP_WIFI_SSID" | 42 | gum style --foreground 2 --padding "0 0 0 $PADDING_LEFT" "[OK] WiFi credentials migrated: $ARCHUP_WIFI_SSID" | ||
| 49 | echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" >> "$ARCHUP_INSTALL_LOG_FILE" | 43 | echo "WiFi credentials migrated: $ARCHUP_WIFI_SSID (auto-connect enabled)" >> "$ARCHUP_INSTALL_LOG_FILE" | ||
| 50 | fi | 44 | fi | ||
| 51 | 45 | ||||
| 52 | - | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Network configured (DHCP)" | 46 | + | gum style --foreground 2 --padding "0 0 1 $PADDING_LEFT" "[OK] Network configured" |
| 53 | 47 | ||||
| 54 | - | echo "Enabled systemd-networkd and iwd" >> "$ARCHUP_INSTALL_LOG_FILE" | 48 | + | echo "Enabled NetworkManager" >> "$ARCHUP_INSTALL_LOG_FILE" |
M install/extra.packages +3 -0
| @@ -19,6 +19,9 @@ p7zip | |||
| 19 | 19 | bluez | |
| 20 | 20 | bluez-utils | |
| 21 | 21 | ||
| 22 | + | # Alternative WiFi | |
| 23 | + | iwd | |
| 24 | + | ||
| 22 | 25 | # Modern CLI Tools (from Chaotic-AUR) | |
| 23 | 26 | eza | |
| 24 | 27 | zoxide | |
| @@ -19,6 +19,9 @@ p7zip | |||||
| 19 | bluez | 19 | bluez | ||
| 20 | bluez-utils | 20 | bluez-utils | ||
| 21 | 21 | ||||
| 22 | + | # Alternative WiFi | |||
| 23 | + | iwd | |||
| 24 | + | ||||
| 22 | # Modern CLI Tools (from Chaotic-AUR) | 25 | # Modern CLI Tools (from Chaotic-AUR) | ||
| 23 | eza | 26 | eza | ||
| 24 | zoxide | 27 | zoxide | ||