Fix iwd network installation and setup (#4271)
* Fix 4223 - IWD * Update * Update
This commit is contained in:
parent
cfdcebcacd
commit
8e34303175
|
|
@ -31,8 +31,6 @@ class DesktopProfile(Profile):
|
|||
'openssh',
|
||||
'htop',
|
||||
'wget',
|
||||
'iwd',
|
||||
'wireless_tools',
|
||||
'smartmontools',
|
||||
'xdg-utils',
|
||||
]
|
||||
|
|
|
|||
|
|
@ -805,14 +805,6 @@ class Installer:
|
|||
|
||||
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')
|
||||
|
||||
def mkinitcpio(self, flags: list[str]) -> bool:
|
||||
for plugin in plugins.values():
|
||||
if hasattr(plugin, 'on_mkinitcpio'):
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@ from archinstall.lib.models.network import NetworkConfiguration, NicType
|
|||
from archinstall.lib.models.profile import ProfileConfiguration
|
||||
|
||||
|
||||
class NetworkHandler:
|
||||
def install_network_config(
|
||||
self,
|
||||
network_config: NetworkConfiguration,
|
||||
installation: Installer,
|
||||
profile_config: ProfileConfiguration | None = None,
|
||||
|
|
@ -16,23 +14,22 @@ class NetworkHandler:
|
|||
enable_services=True, # Sources the ISO network configuration to the install medium.
|
||||
)
|
||||
case NicType.NM | NicType.NM_IWD:
|
||||
# Install NetworkManager package for both cases
|
||||
packages = ['networkmanager']
|
||||
# Default back-end only for non-iwd
|
||||
|
||||
if network_config.type == NicType.NM:
|
||||
packages.append('wpa_supplicant')
|
||||
else:
|
||||
packages.append('iwd')
|
||||
|
||||
installation.add_additional_packages(packages)
|
||||
|
||||
# Desktop profile -> Always add applet
|
||||
if profile_config and profile_config.profile:
|
||||
if profile_config.profile.is_desktop_profile():
|
||||
installation.add_additional_packages('network-manager-applet')
|
||||
packages.append('network-manager-applet')
|
||||
|
||||
installation.add_additional_packages(packages)
|
||||
installation.enable_service('NetworkManager.service')
|
||||
|
||||
if network_config.type == NicType.NM_IWD:
|
||||
# NM_IWD special handling
|
||||
installation.configure_nm_iwd()
|
||||
_configure_nm_iwd(installation)
|
||||
installation.disable_service('iwd.service')
|
||||
|
||||
case NicType.MANUAL:
|
||||
|
|
@ -40,3 +37,11 @@ class NetworkHandler:
|
|||
installation.configure_nic(nic)
|
||||
installation.enable_service('systemd-networkd')
|
||||
installation.enable_service('systemd-resolved')
|
||||
|
||||
|
||||
def _configure_nm_iwd(installation: Installer) -> None:
|
||||
nm_conf_dir = installation.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')
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ from archinstall.lib.mirrors import MirrorListHandler
|
|||
from archinstall.lib.models import Bootloader
|
||||
from archinstall.lib.models.device import DiskLayoutType, EncryptionType
|
||||
from archinstall.lib.models.users import User
|
||||
from archinstall.lib.network.network_handler import NetworkHandler
|
||||
from archinstall.lib.network.network_handler import install_network_config
|
||||
from archinstall.lib.output import debug, error, info
|
||||
from archinstall.lib.packages.util import check_version_upgrade
|
||||
from archinstall.lib.profile.profiles_handler import profile_handler
|
||||
|
|
@ -118,7 +118,7 @@ def perform_installation(
|
|||
installation.add_bootloader(config.bootloader_config.bootloader, config.bootloader_config.uki, config.bootloader_config.removable)
|
||||
|
||||
if config.network_config:
|
||||
NetworkHandler().install_network_config(
|
||||
install_network_config(
|
||||
config.network_config,
|
||||
installation,
|
||||
config.profile_config,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from archinstall.lib.menu.util import delayed_warning
|
|||
from archinstall.lib.models import Bootloader
|
||||
from archinstall.lib.models.profile import ProfileConfiguration
|
||||
from archinstall.lib.models.users import Password, User
|
||||
from archinstall.lib.network.network_handler import NetworkHandler
|
||||
from archinstall.lib.network.network_handler import install_network_config
|
||||
from archinstall.lib.output import debug, error, info
|
||||
from archinstall.lib.profile.profiles_handler import profile_handler
|
||||
from archinstall.lib.translationhandler import tr
|
||||
|
|
@ -40,7 +40,7 @@ def perform_installation(arch_config_handler: ArchConfigHandler) -> None:
|
|||
installation.add_bootloader(Bootloader.Systemd)
|
||||
|
||||
if config.network_config:
|
||||
NetworkHandler().install_network_config(
|
||||
install_network_config(
|
||||
config.network_config,
|
||||
installation,
|
||||
config.profile_config,
|
||||
|
|
|
|||
Loading…
Reference in New Issue