Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-05-06 15:18:57 +0200
committerAnton Hvornum <anton.feeds@gmail.com>2021-05-06 15:18:57 +0200
commit8925be6c8725c76b4a5f13f0b110759f9c4eecc8 (patch)
tree6df37c7269cc83e7e44c073809d55ada29446fd2 /examples
parentc20be61e124ccb3f2434c6dc61016524ed936c7c (diff)
Adding in partition layout structure
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 069a89d5..8e267df9 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -24,11 +24,13 @@ def ask_user_questions():
except archinstall.RequirementError as err:
archinstall.log(err, fg="red")
+
# Before continuing, set the preferred keyboard layout/language in the current terminal.
# This will just help the user with the next following questions.
if len(archinstall.arguments['keyboard-language']):
archinstall.set_keyboard_language(archinstall.arguments['keyboard-language'])
+
# Set which region to download packages from during the installation
if not archinstall.arguments.get('mirror-region', None):
while True:
@@ -56,20 +58,27 @@ def ask_user_questions():
if archinstall.arguments.get('harddrives', None):
archinstall.storage['disk_layouts'] = archinstall.select_disk_layout(archinstall.arguments['harddrives'])
+
# Get disk encryption password (or skip if blank)
if archinstall.arguments['harddrives'] and archinstall.arguments.get('!encryption-password', None) is None:
if (passwd := archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): ')):
archinstall.arguments['!encryption-password'] = passwd
+
+ # Ask which boot-loader to use (will only ask if we're in BIOS (non-efi) mode)
archinstall.arguments["bootloader"] = archinstall.ask_for_bootloader()
+
+
# Get the hostname for the machine
if not archinstall.arguments.get('hostname', None):
archinstall.arguments['hostname'] = input('Desired hostname for the installation: ').strip(' ')
+
# Ask for a root password (optional, but triggers requirement for super-user if skipped)
if not archinstall.arguments.get('!root-password', None):
archinstall.arguments['!root-password'] = archinstall.get_password(prompt='Enter root password (Recommendation: leave blank to leave root disabled): ')
+
# Ask for additional users (super-user if root pw was not set)
archinstall.arguments['users'] = {}
archinstall.arguments['superusers'] = {}
@@ -80,12 +89,14 @@ def ask_user_questions():
archinstall.arguments['users'] = users
archinstall.arguments['superusers'] = {**archinstall.arguments['superusers'], **superusers}
+
# Ask for archinstall-specific profiles (such as desktop environments etc)
if not archinstall.arguments.get('profile', None):
archinstall.arguments['profile'] = archinstall.select_profile(archinstall.list_profiles(filter_top_level_profiles=True))
else:
archinstall.arguments['profile'] = archinstall.list_profiles()[archinstall.arguments['profile']]
+
# 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:
@@ -96,6 +107,7 @@ def ask_user_questions():
)
exit(1)
+
# Ask about audio server selection if one is not already set
if not archinstall.arguments.get('audio', None):
# only ask for audio server selection on a desktop profile
@@ -106,11 +118,13 @@ def ask_user_questions():
# we will not try to remove packages post-installation to not have audio, as that may cause multiple issues
archinstall.arguments['audio'] = None
+
# 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)
+
# 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.")
print("If you desire a web browser, such as firefox or chromium, you may specify it in the following prompt.")