Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/__init__.py
diff options
context:
space:
mode:
authorWerner Llácer <wllacer@gmail.com>2022-02-04 23:48:41 +0100
committerGitHub <noreply@github.com>2022-02-04 23:48:41 +0100
commit85f2938df9e7e34a08fd1b1acc7c8b41d14ccb54 (patch)
treeffdcdaf079861d6beb45307b94447c3b8851411f /archinstall/__init__.py
parent7fda1e42a41471353608a11ceb42c6949ef3d8a5 (diff)
Moving load_config from guided to \__init__.py (#887)
* The initializations done at the start of guided.py are now at archinstall/__init__.py The scripts have been changed accordingly * Correct definition of btrfs standard layout Co-authored-by: Anton Hvornum <anton@hvornum.se>
Diffstat (limited to 'archinstall/__init__.py')
-rw-r--r--archinstall/__init__.py34
1 files changed, 34 insertions, 0 deletions
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()