Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
This commit is contained in:
Daniel Girtler 2023-05-04 00:37:55 +10:00 committed by GitHub
parent ec4ecbcb7a
commit 2d06cf592a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 7 deletions

View File

@ -6,7 +6,7 @@ from enum import Enum
from typing import List, Optional, Dict, Union, Any, TYPE_CHECKING, Tuple
from ..output import log
from ..storage import storage
from ..profile import ProfileConfiguration
if TYPE_CHECKING:
_: Any
@ -103,7 +103,11 @@ class NetworkConfigurationHandler:
def configuration(self):
return self._configuration
def config_installer(self, installation: Any):
def config_installer(
self,
installation: Any,
profile_config: Optional[ProfileConfiguration] = None
):
if self._configuration is None:
return
@ -122,8 +126,9 @@ class NetworkConfigurationHandler:
)
elif self._configuration.is_network_manager():
installation.add_additional_packages(["networkmanager"])
if (profile := storage['arguments'].get('profile_config')) and profile.is_desktop_type_profile:
installation.add_additional_packages(["network-manager-applet"])
if profile_config and profile_config.profile:
if profile_config.profile.is_desktop_type_profile():
installation.add_additional_packages(["network-manager-applet"])
installation.enable_service('NetworkManager.service')
def _parse_manual_config(self, configs: List[Dict[str, Any]]) -> Optional[List[NetworkConfiguration]]:

View File

@ -0,0 +1,3 @@
from .profile_menu import ProfileMenu, select_greeter, select_profile
from .profiles_handler import profile_handler
from .profile_model import ProfileConfiguration

View File

@ -181,7 +181,10 @@ def perform_installation(mountpoint: Path):
if network_config:
handler = NetworkConfigurationHandler(network_config)
handler.config_installer(installation)
handler.config_installer(
installation,
archinstall.arguments.get('profile_config', None)
)
if archinstall.arguments.get('packages', None) and archinstall.arguments.get('packages', None)[0] != '':
installation.add_additional_packages(archinstall.arguments.get('packages', None))

View File

@ -236,7 +236,10 @@ def perform_installation(mountpoint: Path, exec_mode: ExecutionMode):
if network_config:
handler = models.NetworkConfigurationHandler(network_config)
handler.config_installer(installation)
handler.config_installer(
installation,
archinstall.arguments.get('profile_config', None)
)
if archinstall.arguments.get('packages', None) and archinstall.arguments.get('packages', None)[0] != '':
installation.add_additional_packages(archinstall.arguments.get('packages', []))

View File

@ -144,7 +144,10 @@ def perform_installation(mountpoint: Path):
if network_config:
handler = NetworkConfigurationHandler(network_config)
handler.config_installer(installation)
handler.config_installer(
installation,
archinstall.arguments.get('profile_config', None)
)
if archinstall.arguments.get('packages', None) and archinstall.arguments.get('packages', None)[0] != '':
installation.add_additional_packages(archinstall.arguments.get('packages', []))