index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Werner Llácer <wllacer@gmail.com> | 2022-02-04 23:48:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 23:48:41 +0100 |
commit | 85f2938df9e7e34a08fd1b1acc7c8b41d14ccb54 (patch) | |
tree | ffdcdaf079861d6beb45307b94447c3b8851411f /archinstall | |
parent | 7fda1e42a41471353608a11ceb42c6949ef3d8a5 (diff) |
-rw-r--r-- | archinstall/__init__.py | 34 |
diff --git a/archinstall/__init__.py b/archinstall/__init__.py index ea0962b2..f0ce026c 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -165,6 +165,38 @@ def get_arguments(): del config['dry-run'] return config +def load_config(): + """ + refine and set some arguments. Formerly at the scripts + """ + if arguments.get('harddrives', None) is not None: + if type(arguments['harddrives']) is str: + arguments['harddrives'] = arguments['harddrives'].split(',') + arguments['harddrives'] = [BlockDevice(BlockDev) for BlockDev in arguments['harddrives']] + # Temporarily disabling keep_partitions if config file is loaded + # Temporary workaround to make Desktop Environments work + if arguments.get('profile', None) is not None: + if type(arguments.get('profile', None)) is dict: + arguments['profile'] = Profile(None, arguments.get('profile', None)['path']) + else: + arguments['profile'] = Profile(None, arguments.get('profile', None)) + storage['_desktop_profile'] = arguments.get('desktop-environment', None) + if arguments.get('mirror-region', None) is not None: + if type(arguments.get('mirror-region', None)) is dict: + arguments['mirror-region'] = arguments.get('mirror-region', None) + else: + selected_region = arguments.get('mirror-region', None) + arguments['mirror-region'] = {selected_region: list_mirrors()[selected_region]} + if arguments.get('sys-language', None) is not None: + arguments['sys-language'] = arguments.get('sys-language', 'en_US') + if arguments.get('sys-encoding', None) is not None: + arguments['sys-encoding'] = arguments.get('sys-encoding', 'utf-8') + if arguments.get('gfx_driver', None) is not None: + storage['gfx_driver_packages'] = AVAILABLE_GFX_DRIVERS.get(arguments.get('gfx_driver', None), None) + if arguments.get('servers', None) is not None: + storage['_selected_servers'] = arguments.get('servers', None) + + def post_process_arguments(arguments): storage['arguments'] = arguments if arguments.get('mount_point'): @@ -191,6 +223,8 @@ def post_process_arguments(arguments): del partition['format'] arguments['disk_layouts'] = layout_storage + load_config() + define_arguments() arguments = get_arguments() |