Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
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 /examples
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 'examples')
-rw-r--r--examples/guided.py29
-rw-r--r--examples/only_hd.py53
2 files changed, 0 insertions, 82 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 9071ce39..e14e58cf 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -22,34 +22,6 @@ archinstall.log(f"Graphics devices detected: {archinstall.graphics_devices().key
# For support reasons, we'll log the disk layout pre installation to match against post-installation layout
archinstall.log(f"Disk states before installing: {archinstall.disk_layouts()}", level=logging.DEBUG)
-def load_config():
- if archinstall.arguments.get('harddrives', None) is not None:
- if type(archinstall.arguments['harddrives']) is str:
- archinstall.arguments['harddrives'] = archinstall.arguments['harddrives'].split(',')
- archinstall.arguments['harddrives'] = [archinstall.BlockDevice(BlockDev) for BlockDev in archinstall.arguments['harddrives']]
- # Temporarily disabling keep_partitions if config file is loaded
- # Temporary workaround to make Desktop Environments work
- if archinstall.arguments.get('profile', None) is not None:
- if type(archinstall.arguments.get('profile', None)) is dict:
- archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)['path'])
- else:
- archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None))
- archinstall.storage['_desktop_profile'] = archinstall.arguments.get('desktop-environment', None)
- if archinstall.arguments.get('mirror-region', None) is not None:
- if type(archinstall.arguments.get('mirror-region', None)) is dict:
- archinstall.arguments['mirror-region'] = archinstall.arguments.get('mirror-region', None)
- else:
- selected_region = archinstall.arguments.get('mirror-region', None)
- archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]}
- if archinstall.arguments.get('sys-language', None) is not None:
- archinstall.arguments['sys-language'] = archinstall.arguments.get('sys-language', 'en_US')
- if archinstall.arguments.get('sys-encoding', None) is not None:
- archinstall.arguments['sys-encoding'] = archinstall.arguments.get('sys-encoding', 'utf-8')
- if archinstall.arguments.get('gfx_driver', None) is not None:
- archinstall.storage['gfx_driver_packages'] = archinstall.AVAILABLE_GFX_DRIVERS.get(archinstall.arguments.get('gfx_driver', None), None)
- if archinstall.arguments.get('servers', None) is not None:
- archinstall.storage['_selected_servers'] = archinstall.arguments.get('servers', None)
-
def ask_user_questions():
"""
@@ -325,7 +297,6 @@ if not archinstall.arguments.get('offline', False):
archinstall.log(f"Failed to update the keyring. Please check your internet connection and the log file '{log_file}'.", level=logging.INFO, fg="red")
exit(1)
-load_config()
if not archinstall.arguments.get('silent'):
ask_user_questions()
diff --git a/examples/only_hd.py b/examples/only_hd.py
index 755e00f5..f1bddbb2 100644
--- a/examples/only_hd.py
+++ b/examples/only_hd.py
@@ -5,28 +5,6 @@ import pathlib
import archinstall
-def load_mirror():
- if archinstall.arguments.get('mirror-region', None) is not None:
- if type(archinstall.arguments.get('mirror-region', None)) is dict:
- archinstall.arguments['mirror-region'] = archinstall.arguments.get('mirror-region', None)
- else:
- selected_region = archinstall.arguments.get('mirror-region', None)
- archinstall.arguments['mirror-region'] = {selected_region: archinstall.list_mirrors()[selected_region]}
-
-def load_localization():
- if archinstall.arguments.get('sys-language', None) is not None:
- archinstall.arguments['sys-language'] = archinstall.arguments.get('sys-language', 'en_US')
- if archinstall.arguments.get('sys-encoding', None) is not None:
- archinstall.arguments['sys-encoding'] = archinstall.arguments.get('sys-encoding', 'utf-8')
-
-def load_harddrives():
- if archinstall.arguments.get('harddrives', None) is not None:
- if type(archinstall.arguments['harddrives']) is str:
- archinstall.arguments['harddrives'] = archinstall.arguments['harddrives'].split(',')
- archinstall.arguments['harddrives'] = [archinstall.BlockDevice(BlockDev) for BlockDev in archinstall.arguments['harddrives']]
- # Temporarily disabling keep_partitions if config file is loaded
-
-
def ask_harddrives():
# Ask which harddrives/block-devices we will install to
# and convert them into archinstall.BlockDevice() objects.
@@ -63,35 +41,6 @@ def ask_harddrives():
if not archinstall.arguments.get('swap', None):
archinstall.arguments['swap'] = archinstall.ask_for_swap()
-def load_profiles():
- if archinstall.arguments.get('profile', None) is not None:
- if type(archinstall.arguments.get('profile', None)) is dict:
- archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None)['path'])
- else:
- archinstall.arguments['profile'] = archinstall.Profile(None, archinstall.arguments.get('profile', None))
-
-def load_desktop_profiles():
- # Temporary workaround to make Desktop Environments work
- archinstall.storage['_desktop_profile'] = archinstall.arguments.get('desktop-environment', None)
-
-def load_gfxdriver():
- if archinstall.arguments.get('gfx_driver', None) is not None:
- archinstall.storage['gfx_driver_packages'] = archinstall.AVAILABLE_GFX_DRIVERS.get(archinstall.arguments.get('gfx_driver', None), None)
-
-def load_servers():
- if archinstall.arguments.get('servers', None) is not None:
- archinstall.storage['_selected_servers'] = archinstall.arguments.get('servers', None)
-
-
-def load_config():
- load_harddrives()
- load_profiles()
- load_desktop_profiles()
- load_mirror()
- load_localization()
- load_gfxdriver()
- load_servers()
-
def ask_user_questions():
"""
First, we'll ask the user for a bunch of user input.
@@ -219,8 +168,6 @@ if not archinstall.check_mirror_reachable():
archinstall.log(f"Arch Linux mirrors are not reachable. Please check your internet connection and the log file '{log_file}'.", level=logging.INFO, fg="red")
exit(1)
-load_config()
-
if not archinstall.arguments.get('silent'):
ask_user_questions()