From 8925be6c8725c76b4a5f13f0b110759f9c4eecc8 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 6 May 2021 15:18:57 +0200 Subject: Adding in partition layout structure --- examples/guided.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'examples') 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.") -- cgit v1.2.3-70-g09d2