index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
-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() |