Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/guided.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/guided.py')
-rw-r--r--examples/guided.py25
1 files changed, 7 insertions, 18 deletions
diff --git a/examples/guided.py b/examples/guided.py
index aabab3b5..2352b749 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -63,6 +63,7 @@ def load_config():
except:
raise ValueError("--disk_layouts=<json> needs either a JSON file or a JSON string given with a valid disk layout.")
+
def ask_user_questions():
"""
First, we'll ask the user for a bunch of user input.
@@ -70,12 +71,7 @@ def ask_user_questions():
will we continue with the actual installation steps.
"""
if not archinstall.arguments.get('keyboard-layout', None):
- while True:
- try:
- archinstall.arguments['keyboard-layout'] = archinstall.select_language(archinstall.list_keyboard_languages()).strip()
- break
- except archinstall.RequirementError as err:
- archinstall.log(err, fg="red")
+ archinstall.arguments['keyboard-layout'] = archinstall.select_language()
# Before continuing, set the preferred keyboard layout/language in the current terminal.
# This will just help the user with the next following questions.
@@ -84,12 +80,7 @@ def ask_user_questions():
# Set which region to download packages from during the installation
if not archinstall.arguments.get('mirror-region', None):
- while True:
- try:
- archinstall.arguments['mirror-region'] = archinstall.select_mirror_regions(archinstall.list_mirrors())
- break
- except archinstall.RequirementError as e:
- archinstall.log(e, fg="red")
+ archinstall.arguments['mirror-region'] = archinstall.select_mirror_regions()
if not archinstall.arguments.get('sys-language', None) and archinstall.arguments.get('advanced', False):
archinstall.arguments['sys-language'] = input("Enter a valid locale (language) for your OS, (Default: en_US): ").strip()
@@ -104,9 +95,7 @@ def ask_user_questions():
# Ask which harddrives/block-devices we will install to
# and convert them into archinstall.BlockDevice() objects.
if archinstall.arguments.get('harddrives', None) is None:
- archinstall.arguments['harddrives'] = archinstall.generic_multi_select(archinstall.all_disks(),
- text="Select one or more harddrives to use and configure (leave blank to skip this step): ",
- allow_empty=True)
+ archinstall.arguments['harddrives'] = archinstall.select_harddrives()
if archinstall.arguments.get('harddrives', None) is not None and archinstall.storage.get('disk_layouts', None) is None:
archinstall.storage['disk_layouts'] = archinstall.select_disk_layout(archinstall.arguments['harddrives'], archinstall.arguments.get('advanced', False))
@@ -150,7 +139,8 @@ def ask_user_questions():
# Check the potentially selected profiles preparations to get early checks if some additional questions are needed.
if archinstall.arguments['profile'] and archinstall.arguments['profile'].has_prep_function():
- with archinstall.arguments['profile'].load_instructions(namespace=f"{archinstall.arguments['profile'].namespace}.py") as imported:
+ namespace = f"{archinstall.arguments['profile'].namespace}.py"
+ with archinstall.arguments['profile'].load_instructions(namespace=namespace) as imported:
if not imported._prep_function():
archinstall.log(' * Profile\'s preparation requirements was not fulfilled.', fg='red')
exit(1)
@@ -162,8 +152,7 @@ def ask_user_questions():
# Ask for preferred kernel:
if not archinstall.arguments.get("kernels", None):
- kernels = ["linux", "linux-lts", "linux-zen", "linux-hardened"]
- archinstall.arguments['kernels'] = archinstall.select_kernel(kernels)
+ archinstall.arguments['kernels'] = archinstall.select_kernel()
# Additional packages (with some light weight error handling for invalid package names)
print("Only packages such as base, base-devel, linux, linux-firmware, efibootmgr and optional profile packages are installed.")