Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion archinstall/default_profiles/desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def packages(self) -> list[str]:
'wget',
'iwd',
'wireless_tools',
'wpa_supplicant',
'smartmontools',
'xdg-utils',
]
Expand Down
16 changes: 16 additions & 0 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,22 @@ def post_install_enable_networkd_resolved(*args: str, **kwargs: str) -> None:

return True

def configure_nm_iwd(self) -> None:
# Create NetworkManager config directory and write iwd backend conf
nm_conf_dir = self.target / 'etc/NetworkManager/conf.d'
nm_conf_dir.mkdir(parents=True, exist_ok=True)

iwd_backend_conf = nm_conf_dir / 'wifi_backend.conf'
iwd_backend_conf.write_text('[device]\nwifi.backend=iwd\n')

# Disable standalone iwd service
# and enable NetworkManager
def post_install_configure_nm_iwd(*args: str, **kwargs: str) -> None:
self.disable_service('iwd.service')
self.enable_service('NetworkManager.service')

self.post_base_install.append(post_install_configure_nm_iwd)

def mkinitcpio(self, flags: list[str]) -> bool:
for plugin in plugins.values():
if hasattr(plugin, 'on_mkinitcpio'):
Expand Down
2 changes: 2 additions & 0 deletions archinstall/lib/interactions/network_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ def ask_to_configure_network(preset: NetworkConfiguration | None) -> NetworkConf
return NetworkConfiguration(NicType.ISO)
case NicType.NM:
return NetworkConfiguration(NicType.NM)
case NicType.NM_IWD:
return NetworkConfiguration(NicType.NM_IWD)
case NicType.MANUAL:
preset_nics = preset.nics if preset else []
nics = ManualNetworkConfig(tr('Configure interfaces'), preset_nics).run()
Expand Down
16 changes: 14 additions & 2 deletions archinstall/lib/models/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@
class NicType(Enum):
ISO = 'iso'
NM = 'nm'
NM_IWD = 'nm_iwd'
MANUAL = 'manual'

def display_msg(self) -> str:
match self:
case NicType.ISO:
return tr('Copy ISO network configuration to installation')
case NicType.NM:
return tr('Use NetworkManager (necessary to configure internet graphically in GNOME and KDE Plasma)')
return tr('Use Network Manager (default backend)')
case NicType.NM_IWD:
return tr('Use Network Manager (iwd backend)')
case NicType.MANUAL:
return tr('Manual configuration')

Expand Down Expand Up @@ -148,11 +151,20 @@ def install_network_config(
enable_services=True, # Sources the ISO network configuration to the install medium.
)
case NicType.NM:
installation.add_additional_packages(['networkmanager'])
installation.add_additional_packages(['networkmanager', 'wpa_supplicant'])
if profile_config and profile_config.profile:
if profile_config.profile.is_desktop_profile():
installation.add_additional_packages(['network-manager-applet'])
installation.enable_service('NetworkManager.service')
case NicType.NM_IWD:
# Copy ISO config first for initial connectivity
installation.copy_iso_network_config(enable_services=False)
# Configure NetworkManager with iwd backend
installation.add_additional_packages('networkmanager')
if profile_config and profile_config.profile:
if profile_config.profile.is_desktop_profile():
installation.add_additional_packages('network-manager-applet')
installation.configure_nm_iwd()
case NicType.MANUAL:
for nic in self.nics:
installation.configure_nic(nic)
Expand Down