( network_config: NetworkConfiguration, installation: Installer, profile_config: ProfileConfiguration | None = None, )
| 6 | |
| 7 | |
| 8 | def install_network_config( |
| 9 | network_config: NetworkConfiguration, |
| 10 | installation: Installer, |
| 11 | profile_config: ProfileConfiguration | None = None, |
| 12 | ) -> None: |
| 13 | match network_config.type: |
| 14 | case NicType.ISO: |
| 15 | _ = installation.copy_iso_network_config( |
| 16 | enable_services=True, # Sources the ISO network configuration to the install medium. |
| 17 | ) |
| 18 | case NicType.NM | NicType.NM_IWD: |
| 19 | packages = ['networkmanager'] |
| 20 | |
| 21 | if network_config.type == NicType.NM: |
| 22 | packages.append('wpa_supplicant') |
| 23 | else: |
| 24 | packages.append('iwd') |
| 25 | |
| 26 | if profile_config and profile_config.profile: |
| 27 | if profile_config.profile.is_desktop_profile(): |
| 28 | packages.append('network-manager-applet') |
| 29 | |
| 30 | installation.add_additional_packages(packages) |
| 31 | installation.enable_service('NetworkManager.service') |
| 32 | |
| 33 | if network_config.type == NicType.NM_IWD: |
| 34 | _configure_nm_iwd(installation) |
| 35 | installation.disable_service('iwd.service') |
| 36 | |
| 37 | case NicType.IWD: |
| 38 | installation.add_additional_packages(['iwd']) |
| 39 | _configure_iwd_standalone(installation) |
| 40 | installation.enable_service('iwd.service') |
| 41 | installation.enable_service('systemd-networkd.service') |
| 42 | installation.enable_service('systemd-resolved.service') |
| 43 | |
| 44 | case NicType.MANUAL: |
| 45 | for nic in network_config.nics: |
| 46 | installation.configure_nic(nic) |
| 47 | installation.enable_service('systemd-networkd') |
| 48 | installation.enable_service('systemd-resolved') |
| 49 | |
| 50 | |
| 51 | def _configure_nm_iwd(installation: Installer) -> None: |
no test coverage detected