We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
no default value for uki key in configurations.json
(archinstall 2.7.0) 
When using archinstall in a system with no support for uefi, the user is not prompted to choose a value for the uki key. However, when running archinstall with a config file without a uki key defined, it errors out since there is no such key defined with a default value.

At least thats what I understood from the problem looking at PR(https://github.com/archlinux/archinstall/pull/1519).

Adding uki: false in the config file fixed this for me.

by the way, how is uefi supported checked? I though it was impossible to know from OS side

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `archinstall/scripts/guided.py`
Content:
```
1 from pathlib import Path
2 from typing import Any, TYPE_CHECKING, Optional
3 
4 import archinstall
5 from archinstall import info, debug
6 from archinstall import SysInfo
7 from archinstall.lib import locale
8 from archinstall.lib import disk
9 from archinstall.lib.global_menu import GlobalMenu
10 from archinstall.lib.configuration import ConfigurationOutput
11 from archinstall.lib.installer import Installer
12 from archinstall.lib.menu import Menu
13 from archinstall.lib.mirrors import use_mirrors, add_custom_mirrors
14 from archinstall.lib.models import AudioConfiguration
15 from archinstall.lib.models.bootloader import Bootloader
16 from archinstall.lib.models.network_configuration import NetworkConfiguration
17 from archinstall.lib.profile.profiles_handler import profile_handler
18 
19 if TYPE_CHECKING:
20 	_: Any
21 
22 
23 if archinstall.arguments.get('help'):
24 	print("See `man archinstall` for help.")
25 	exit(0)
26 
27 
28 def ask_user_questions():
29 	"""
30 		First, we'll ask the user for a bunch of user input.
31 		Not until we're satisfied with what we want to install
32 		will we continue with the actual installation steps.
33 	"""
34 
35 	# ref: https://github.com/archlinux/archinstall/pull/831
36 	# we'll set NTP to true by default since this is also
37 	# the default value specified in the menu options; in
38 	# case it will be changed by the user we'll also update
39 	# the system immediately
40 	global_menu = GlobalMenu(data_store=archinstall.arguments)
41 
42 	global_menu.enable('archinstall-language')
43 
44 	# Set which region to download packages from during the installation
45 	global_menu.enable('mirror_config')
46 
47 	global_menu.enable('locale_config')
48 
49 	global_menu.enable('disk_config', mandatory=True)
50 
51 	# Specify disk encryption options
52 	global_menu.enable('disk_encryption')
53 
54 	# Ask which boot-loader to use (will only ask if we're in UEFI mode, otherwise will default to GRUB)
55 	global_menu.enable('bootloader')
56 
57 	global_menu.enable('uki')
58 
59 	global_menu.enable('swap')
60 
61 	# Get the hostname for the machine
62 	global_menu.enable('hostname')
63 
64 	# Ask for a root password (optional, but triggers requirement for super-user if skipped)
65 	global_menu.enable('!root-password', mandatory=True)
66 
67 	global_menu.enable('!users', mandatory=True)
68 
69 	# Ask for archinstall-specific profiles_bck (such as desktop environments etc)
70 	global_menu.enable('profile_config')
71 
72 	# Ask about audio server selection if one is not already set
73 	global_menu.enable('audio_config')
74 
75 	# Ask for preferred kernel:
76 	global_menu.enable('kernels', mandatory=True)
77 
78 	global_menu.enable('packages')
79 
80 	if archinstall.arguments.get('advanced', False):
81 		# Enable parallel downloads
82 		global_menu.enable('parallel downloads')
83 
84 	# Ask or Call the helper function that asks the user to optionally configure a network.
85 	global_menu.enable('network_config')
86 
87 	global_menu.enable('timezone')
88 
89 	global_menu.enable('ntp')
90 
91 	global_menu.enable('additional-repositories')
92 
93 	global_menu.enable('__separator__')
94 
95 	global_menu.enable('save_config')
96 	global_menu.enable('install')
97 	global_menu.enable('abort')
98 
99 	global_menu.run()
100 
101 
102 def perform_installation(mountpoint: Path):
103 	"""
104 	Performs the installation steps on a block device.
105 	Only requirement is that the block devices are
106 	formatted and setup prior to entering this function.
107 	"""
108 	info('Starting installation')
109 	disk_config: disk.DiskLayoutConfiguration = archinstall.arguments['disk_config']
110 
111 	# Retrieve list of additional repositories and set boolean values appropriately
112 	enable_testing = 'testing' in archinstall.arguments.get('additional-repositories', [])
113 	enable_multilib = 'multilib' in archinstall.arguments.get('additional-repositories', [])
114 	run_mkinitcpio = not archinstall.arguments.get('uki')
115 	locale_config: locale.LocaleConfiguration = archinstall.arguments['locale_config']
116 	disk_encryption: disk.DiskEncryption = archinstall.arguments.get('disk_encryption', None)
117 
118 	with Installer(
119 		mountpoint,
120 		disk_config,
121 		disk_encryption=disk_encryption,
122 		kernels=archinstall.arguments.get('kernels', ['linux'])
123 	) as installation:
124 		# Mount all the drives to the desired mountpoint
125 		if disk_config.config_type != disk.DiskLayoutType.Pre_mount:
126 			installation.mount_ordered_layout()
127 
128 		installation.sanity_check()
129 
130 		if disk_config.config_type != disk.DiskLayoutType.Pre_mount:
131 			if disk_encryption and disk_encryption.encryption_type != disk.EncryptionType.NoEncryption:
132 				# generate encryption key files for the mounted luks devices
133 				installation.generate_key_files()
134 
135 		# Set mirrors used by pacstrap (outside of installation)
136 		if mirror_config := archinstall.arguments.get('mirror_config', None):
137 			if mirror_config.mirror_regions:
138 				use_mirrors(mirror_config.mirror_regions)
139 			if mirror_config.custom_mirrors:
140 				add_custom_mirrors(mirror_config.custom_mirrors)
141 
142 		installation.minimal_installation(
143 			testing=enable_testing,
144 			multilib=enable_multilib,
145 			mkinitcpio=run_mkinitcpio,
146 			hostname=archinstall.arguments.get('hostname', 'archlinux'),
147 			locale_config=locale_config
148 		)
149 
150 		if mirror_config := archinstall.arguments.get('mirror_config', None):
151 			installation.set_mirrors(mirror_config)  # Set the mirrors in the installation medium
152 
153 		if archinstall.arguments.get('swap'):
154 			installation.setup_swap('zram')
155 
156 		if archinstall.arguments.get("bootloader") == Bootloader.Grub and SysInfo.has_uefi():
157 			installation.add_additional_packages("grub")
158 
159 		installation.add_bootloader(
160 			archinstall.arguments["bootloader"],
161 			archinstall.arguments["uki"]
162 		)
163 
164 		# If user selected to copy the current ISO network configuration
165 		# Perform a copy of the config
166 		network_config: Optional[NetworkConfiguration] = archinstall.arguments.get('network_config', None)
167 
168 		if network_config:
169 			network_config.install_network_config(
170 				installation,
171 				archinstall.arguments.get('profile_config', None)
172 			)
173 
174 		if users := archinstall.arguments.get('!users', None):
175 			installation.create_users(users)
176 
177 		audio_config: Optional[AudioConfiguration] = archinstall.arguments.get('audio_config', None)
178 		if audio_config:
179 			audio_config.install_audio_config(installation)
180 		else:
181 			info("No audio server will be installed")
182 
183 		if archinstall.arguments.get('packages', None) and archinstall.arguments.get('packages', None)[0] != '':
184 			installation.add_additional_packages(archinstall.arguments.get('packages', None))
185 
186 		if profile_config := archinstall.arguments.get('profile_config', None):
187 			profile_handler.install_profile_config(installation, profile_config)
188 
189 		if timezone := archinstall.arguments.get('timezone', None):
190 			installation.set_timezone(timezone)
191 
192 		if archinstall.arguments.get('ntp', False):
193 			installation.activate_time_synchronization()
194 
195 		if archinstall.accessibility_tools_in_use():
196 			installation.enable_espeakup()
197 
198 		if (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw):
199 			installation.user_set_pw('root', root_pw)
200 
201 		# This step must be after profile installs to allow profiles_bck to install language pre-requisites.
202 		# After which, this step will set the language both for console and x11 if x11 was installed for instance.
203 		installation.set_keyboard_language(locale_config.kb_layout)
204 
205 		if profile_config := archinstall.arguments.get('profile_config', None):
206 			profile_config.profile.post_install(installation)
207 
208 		# If the user provided a list of services to be enabled, pass the list to the enable_service function.
209 		# Note that while it's called enable_service, it can actually take a list of services and iterate it.
210 		if archinstall.arguments.get('services', None):
211 			installation.enable_service(archinstall.arguments.get('services', []))
212 
213 		# If the user provided custom commands to be run post-installation, execute them now.
214 		if archinstall.arguments.get('custom-commands', None):
215 			archinstall.run_custom_user_commands(archinstall.arguments['custom-commands'], installation)
216 
217 		installation.genfstab()
218 
219 		info("For post-installation tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation")
220 
221 		if not archinstall.arguments.get('silent'):
222 			prompt = str(_('Would you like to chroot into the newly created installation and perform post-installation configuration?'))
223 			choice = Menu(prompt, Menu.yes_no(), default_option=Menu.yes()).run()
224 			if choice.value == Menu.yes():
225 				try:
226 					installation.drop_to_shell()
227 				except:
228 					pass
229 
230 	debug(f"Disk states after installing: {disk.disk_layouts()}")
231 
232 
233 if not archinstall.arguments.get('silent'):
234 	ask_user_questions()
235 
236 config_output = ConfigurationOutput(archinstall.arguments)
237 
238 if not archinstall.arguments.get('silent'):
239 	config_output.show()
240 
241 config_output.save()
242 
243 if archinstall.arguments.get('dry_run'):
244 	exit(0)
245 
246 if not archinstall.arguments.get('silent'):
247 	input(str(_('Press Enter to continue.')))
248 
249 fs_handler = disk.FilesystemHandler(
250 	archinstall.arguments['disk_config'],
251 	archinstall.arguments.get('disk_encryption', None)
252 )
253 
254 fs_handler.perform_filesystem_operations()
255 
256 perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
257
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/archinstall/scripts/guided.py b/archinstall/scripts/guided.py
--- a/archinstall/scripts/guided.py
+++ b/archinstall/scripts/guided.py
@@ -158,7 +158,7 @@
 
 		installation.add_bootloader(
 			archinstall.arguments["bootloader"],
-			archinstall.arguments["uki"]
+			archinstall.arguments.get('uki', False)
 		)
 
 		# If user selected to copy the current ISO network configuration

{"golden_diff": "diff --git a/archinstall/scripts/guided.py b/archinstall/scripts/guided.py\n--- a/archinstall/scripts/guided.py\n+++ b/archinstall/scripts/guided.py\n@@ -158,7 +158,7 @@\n \n \t\tinstallation.add_bootloader(\n \t\t\tarchinstall.arguments[\"bootloader\"],\n-\t\t\tarchinstall.arguments[\"uki\"]\n+\t\t\tarchinstall.arguments.get('uki', False)\n \t\t)\n \n \t\t# If user selected to copy the current ISO network configuration\n", "issue": "no default value for uki key in configurations.json\n(archinstall 2.7.0) \r\nWhen using archinstall in a system with no support for uefi, the user is not prompted to choose a value for the uki key. However, when running archinstall with a config file without a uki key defined, it errors out since there is no such key defined with a default value.\r\n\r\nAt least thats what I understood from the problem looking at PR(https://github.com/archlinux/archinstall/pull/1519).\r\n\r\nAdding uki: false in the config file fixed this for me.\r\n\r\nby the way, how is uefi supported checked? I though it was impossible to know from OS side\n", "before_files": [{"content": "from pathlib import Path\nfrom typing import Any, TYPE_CHECKING, Optional\n\nimport archinstall\nfrom archinstall import info, debug\nfrom archinstall import SysInfo\nfrom archinstall.lib import locale\nfrom archinstall.lib import disk\nfrom archinstall.lib.global_menu import GlobalMenu\nfrom archinstall.lib.configuration import ConfigurationOutput\nfrom archinstall.lib.installer import Installer\nfrom archinstall.lib.menu import Menu\nfrom archinstall.lib.mirrors import use_mirrors, add_custom_mirrors\nfrom archinstall.lib.models import AudioConfiguration\nfrom archinstall.lib.models.bootloader import Bootloader\nfrom archinstall.lib.models.network_configuration import NetworkConfiguration\nfrom archinstall.lib.profile.profiles_handler import profile_handler\n\nif TYPE_CHECKING:\n\t_: Any\n\n\nif archinstall.arguments.get('help'):\n\tprint(\"See `man archinstall` for help.\")\n\texit(0)\n\n\ndef ask_user_questions():\n\t\"\"\"\n\t\tFirst, we'll ask the user for a bunch of user input.\n\t\tNot until we're satisfied with what we want to install\n\t\twill we continue with the actual installation steps.\n\t\"\"\"\n\n\t# ref: https://github.com/archlinux/archinstall/pull/831\n\t# we'll set NTP to true by default since this is also\n\t# the default value specified in the menu options; in\n\t# case it will be changed by the user we'll also update\n\t# the system immediately\n\tglobal_menu = GlobalMenu(data_store=archinstall.arguments)\n\n\tglobal_menu.enable('archinstall-language')\n\n\t# Set which region to download packages from during the installation\n\tglobal_menu.enable('mirror_config')\n\n\tglobal_menu.enable('locale_config')\n\n\tglobal_menu.enable('disk_config', mandatory=True)\n\n\t# Specify disk encryption options\n\tglobal_menu.enable('disk_encryption')\n\n\t# Ask which boot-loader to use (will only ask if we're in UEFI mode, otherwise will default to GRUB)\n\tglobal_menu.enable('bootloader')\n\n\tglobal_menu.enable('uki')\n\n\tglobal_menu.enable('swap')\n\n\t# Get the hostname for the machine\n\tglobal_menu.enable('hostname')\n\n\t# Ask for a root password (optional, but triggers requirement for super-user if skipped)\n\tglobal_menu.enable('!root-password', mandatory=True)\n\n\tglobal_menu.enable('!users', mandatory=True)\n\n\t# Ask for archinstall-specific profiles_bck (such as desktop environments etc)\n\tglobal_menu.enable('profile_config')\n\n\t# Ask about audio server selection if one is not already set\n\tglobal_menu.enable('audio_config')\n\n\t# Ask for preferred kernel:\n\tglobal_menu.enable('kernels', mandatory=True)\n\n\tglobal_menu.enable('packages')\n\n\tif archinstall.arguments.get('advanced', False):\n\t\t# Enable parallel downloads\n\t\tglobal_menu.enable('parallel downloads')\n\n\t# Ask or Call the helper function that asks the user to optionally configure a network.\n\tglobal_menu.enable('network_config')\n\n\tglobal_menu.enable('timezone')\n\n\tglobal_menu.enable('ntp')\n\n\tglobal_menu.enable('additional-repositories')\n\n\tglobal_menu.enable('__separator__')\n\n\tglobal_menu.enable('save_config')\n\tglobal_menu.enable('install')\n\tglobal_menu.enable('abort')\n\n\tglobal_menu.run()\n\n\ndef perform_installation(mountpoint: Path):\n\t\"\"\"\n\tPerforms the installation steps on a block device.\n\tOnly requirement is that the block devices are\n\tformatted and setup prior to entering this function.\n\t\"\"\"\n\tinfo('Starting installation')\n\tdisk_config: disk.DiskLayoutConfiguration = archinstall.arguments['disk_config']\n\n\t# Retrieve list of additional repositories and set boolean values appropriately\n\tenable_testing = 'testing' in archinstall.arguments.get('additional-repositories', [])\n\tenable_multilib = 'multilib' in archinstall.arguments.get('additional-repositories', [])\n\trun_mkinitcpio = not archinstall.arguments.get('uki')\n\tlocale_config: locale.LocaleConfiguration = archinstall.arguments['locale_config']\n\tdisk_encryption: disk.DiskEncryption = archinstall.arguments.get('disk_encryption', None)\n\n\twith Installer(\n\t\tmountpoint,\n\t\tdisk_config,\n\t\tdisk_encryption=disk_encryption,\n\t\tkernels=archinstall.arguments.get('kernels', ['linux'])\n\t) as installation:\n\t\t# Mount all the drives to the desired mountpoint\n\t\tif disk_config.config_type != disk.DiskLayoutType.Pre_mount:\n\t\t\tinstallation.mount_ordered_layout()\n\n\t\tinstallation.sanity_check()\n\n\t\tif disk_config.config_type != disk.DiskLayoutType.Pre_mount:\n\t\t\tif disk_encryption and disk_encryption.encryption_type != disk.EncryptionType.NoEncryption:\n\t\t\t\t# generate encryption key files for the mounted luks devices\n\t\t\t\tinstallation.generate_key_files()\n\n\t\t# Set mirrors used by pacstrap (outside of installation)\n\t\tif mirror_config := archinstall.arguments.get('mirror_config', None):\n\t\t\tif mirror_config.mirror_regions:\n\t\t\t\tuse_mirrors(mirror_config.mirror_regions)\n\t\t\tif mirror_config.custom_mirrors:\n\t\t\t\tadd_custom_mirrors(mirror_config.custom_mirrors)\n\n\t\tinstallation.minimal_installation(\n\t\t\ttesting=enable_testing,\n\t\t\tmultilib=enable_multilib,\n\t\t\tmkinitcpio=run_mkinitcpio,\n\t\t\thostname=archinstall.arguments.get('hostname', 'archlinux'),\n\t\t\tlocale_config=locale_config\n\t\t)\n\n\t\tif mirror_config := archinstall.arguments.get('mirror_config', None):\n\t\t\tinstallation.set_mirrors(mirror_config)  # Set the mirrors in the installation medium\n\n\t\tif archinstall.arguments.get('swap'):\n\t\t\tinstallation.setup_swap('zram')\n\n\t\tif archinstall.arguments.get(\"bootloader\") == Bootloader.Grub and SysInfo.has_uefi():\n\t\t\tinstallation.add_additional_packages(\"grub\")\n\n\t\tinstallation.add_bootloader(\n\t\t\tarchinstall.arguments[\"bootloader\"],\n\t\t\tarchinstall.arguments[\"uki\"]\n\t\t)\n\n\t\t# If user selected to copy the current ISO network configuration\n\t\t# Perform a copy of the config\n\t\tnetwork_config: Optional[NetworkConfiguration] = archinstall.arguments.get('network_config', None)\n\n\t\tif network_config:\n\t\t\tnetwork_config.install_network_config(\n\t\t\t\tinstallation,\n\t\t\t\tarchinstall.arguments.get('profile_config', None)\n\t\t\t)\n\n\t\tif users := archinstall.arguments.get('!users', None):\n\t\t\tinstallation.create_users(users)\n\n\t\taudio_config: Optional[AudioConfiguration] = archinstall.arguments.get('audio_config', None)\n\t\tif audio_config:\n\t\t\taudio_config.install_audio_config(installation)\n\t\telse:\n\t\t\tinfo(\"No audio server will be installed\")\n\n\t\tif archinstall.arguments.get('packages', None) and archinstall.arguments.get('packages', None)[0] != '':\n\t\t\tinstallation.add_additional_packages(archinstall.arguments.get('packages', None))\n\n\t\tif profile_config := archinstall.arguments.get('profile_config', None):\n\t\t\tprofile_handler.install_profile_config(installation, profile_config)\n\n\t\tif timezone := archinstall.arguments.get('timezone', None):\n\t\t\tinstallation.set_timezone(timezone)\n\n\t\tif archinstall.arguments.get('ntp', False):\n\t\t\tinstallation.activate_time_synchronization()\n\n\t\tif archinstall.accessibility_tools_in_use():\n\t\t\tinstallation.enable_espeakup()\n\n\t\tif (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw):\n\t\t\tinstallation.user_set_pw('root', root_pw)\n\n\t\t# This step must be after profile installs to allow profiles_bck to install language pre-requisites.\n\t\t# After which, this step will set the language both for console and x11 if x11 was installed for instance.\n\t\tinstallation.set_keyboard_language(locale_config.kb_layout)\n\n\t\tif profile_config := archinstall.arguments.get('profile_config', None):\n\t\t\tprofile_config.profile.post_install(installation)\n\n\t\t# If the user provided a list of services to be enabled, pass the list to the enable_service function.\n\t\t# Note that while it's called enable_service, it can actually take a list of services and iterate it.\n\t\tif archinstall.arguments.get('services', None):\n\t\t\tinstallation.enable_service(archinstall.arguments.get('services', []))\n\n\t\t# If the user provided custom commands to be run post-installation, execute them now.\n\t\tif archinstall.arguments.get('custom-commands', None):\n\t\t\tarchinstall.run_custom_user_commands(archinstall.arguments['custom-commands'], installation)\n\n\t\tinstallation.genfstab()\n\n\t\tinfo(\"For post-installation tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation\")\n\n\t\tif not archinstall.arguments.get('silent'):\n\t\t\tprompt = str(_('Would you like to chroot into the newly created installation and perform post-installation configuration?'))\n\t\t\tchoice = Menu(prompt, Menu.yes_no(), default_option=Menu.yes()).run()\n\t\t\tif choice.value == Menu.yes():\n\t\t\t\ttry:\n\t\t\t\t\tinstallation.drop_to_shell()\n\t\t\t\texcept:\n\t\t\t\t\tpass\n\n\tdebug(f\"Disk states after installing: {disk.disk_layouts()}\")\n\n\nif not archinstall.arguments.get('silent'):\n\task_user_questions()\n\nconfig_output = ConfigurationOutput(archinstall.arguments)\n\nif not archinstall.arguments.get('silent'):\n\tconfig_output.show()\n\nconfig_output.save()\n\nif archinstall.arguments.get('dry_run'):\n\texit(0)\n\nif not archinstall.arguments.get('silent'):\n\tinput(str(_('Press Enter to continue.')))\n\nfs_handler = disk.FilesystemHandler(\n\tarchinstall.arguments['disk_config'],\n\tarchinstall.arguments.get('disk_encryption', None)\n)\n\nfs_handler.perform_filesystem_operations()\n\nperform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))\n", "path": "archinstall/scripts/guided.py"}], "after_files": [{"content": "from pathlib import Path\nfrom typing import Any, TYPE_CHECKING, Optional\n\nimport archinstall\nfrom archinstall import info, debug\nfrom archinstall import SysInfo\nfrom archinstall.lib import locale\nfrom archinstall.lib import disk\nfrom archinstall.lib.global_menu import GlobalMenu\nfrom archinstall.lib.configuration import ConfigurationOutput\nfrom archinstall.lib.installer import Installer\nfrom archinstall.lib.menu import Menu\nfrom archinstall.lib.mirrors import use_mirrors, add_custom_mirrors\nfrom archinstall.lib.models import AudioConfiguration\nfrom archinstall.lib.models.bootloader import Bootloader\nfrom archinstall.lib.models.network_configuration import NetworkConfiguration\nfrom archinstall.lib.profile.profiles_handler import profile_handler\n\nif TYPE_CHECKING:\n\t_: Any\n\n\nif archinstall.arguments.get('help'):\n\tprint(\"See `man archinstall` for help.\")\n\texit(0)\n\n\ndef ask_user_questions():\n\t\"\"\"\n\t\tFirst, we'll ask the user for a bunch of user input.\n\t\tNot until we're satisfied with what we want to install\n\t\twill we continue with the actual installation steps.\n\t\"\"\"\n\n\t# ref: https://github.com/archlinux/archinstall/pull/831\n\t# we'll set NTP to true by default since this is also\n\t# the default value specified in the menu options; in\n\t# case it will be changed by the user we'll also update\n\t# the system immediately\n\tglobal_menu = GlobalMenu(data_store=archinstall.arguments)\n\n\tglobal_menu.enable('archinstall-language')\n\n\t# Set which region to download packages from during the installation\n\tglobal_menu.enable('mirror_config')\n\n\tglobal_menu.enable('locale_config')\n\n\tglobal_menu.enable('disk_config', mandatory=True)\n\n\t# Specify disk encryption options\n\tglobal_menu.enable('disk_encryption')\n\n\t# Ask which boot-loader to use (will only ask if we're in UEFI mode, otherwise will default to GRUB)\n\tglobal_menu.enable('bootloader')\n\n\tglobal_menu.enable('uki')\n\n\tglobal_menu.enable('swap')\n\n\t# Get the hostname for the machine\n\tglobal_menu.enable('hostname')\n\n\t# Ask for a root password (optional, but triggers requirement for super-user if skipped)\n\tglobal_menu.enable('!root-password', mandatory=True)\n\n\tglobal_menu.enable('!users', mandatory=True)\n\n\t# Ask for archinstall-specific profiles_bck (such as desktop environments etc)\n\tglobal_menu.enable('profile_config')\n\n\t# Ask about audio server selection if one is not already set\n\tglobal_menu.enable('audio_config')\n\n\t# Ask for preferred kernel:\n\tglobal_menu.enable('kernels', mandatory=True)\n\n\tglobal_menu.enable('packages')\n\n\tif archinstall.arguments.get('advanced', False):\n\t\t# Enable parallel downloads\n\t\tglobal_menu.enable('parallel downloads')\n\n\t# Ask or Call the helper function that asks the user to optionally configure a network.\n\tglobal_menu.enable('network_config')\n\n\tglobal_menu.enable('timezone')\n\n\tglobal_menu.enable('ntp')\n\n\tglobal_menu.enable('additional-repositories')\n\n\tglobal_menu.enable('__separator__')\n\n\tglobal_menu.enable('save_config')\n\tglobal_menu.enable('install')\n\tglobal_menu.enable('abort')\n\n\tglobal_menu.run()\n\n\ndef perform_installation(mountpoint: Path):\n\t\"\"\"\n\tPerforms the installation steps on a block device.\n\tOnly requirement is that the block devices are\n\tformatted and setup prior to entering this function.\n\t\"\"\"\n\tinfo('Starting installation')\n\tdisk_config: disk.DiskLayoutConfiguration = archinstall.arguments['disk_config']\n\n\t# Retrieve list of additional repositories and set boolean values appropriately\n\tenable_testing = 'testing' in archinstall.arguments.get('additional-repositories', [])\n\tenable_multilib = 'multilib' in archinstall.arguments.get('additional-repositories', [])\n\trun_mkinitcpio = not archinstall.arguments.get('uki')\n\tlocale_config: locale.LocaleConfiguration = archinstall.arguments['locale_config']\n\tdisk_encryption: disk.DiskEncryption = archinstall.arguments.get('disk_encryption', None)\n\n\twith Installer(\n\t\tmountpoint,\n\t\tdisk_config,\n\t\tdisk_encryption=disk_encryption,\n\t\tkernels=archinstall.arguments.get('kernels', ['linux'])\n\t) as installation:\n\t\t# Mount all the drives to the desired mountpoint\n\t\tif disk_config.config_type != disk.DiskLayoutType.Pre_mount:\n\t\t\tinstallation.mount_ordered_layout()\n\n\t\tinstallation.sanity_check()\n\n\t\tif disk_config.config_type != disk.DiskLayoutType.Pre_mount:\n\t\t\tif disk_encryption and disk_encryption.encryption_type != disk.EncryptionType.NoEncryption:\n\t\t\t\t# generate encryption key files for the mounted luks devices\n\t\t\t\tinstallation.generate_key_files()\n\n\t\t# Set mirrors used by pacstrap (outside of installation)\n\t\tif mirror_config := archinstall.arguments.get('mirror_config', None):\n\t\t\tif mirror_config.mirror_regions:\n\t\t\t\tuse_mirrors(mirror_config.mirror_regions)\n\t\t\tif mirror_config.custom_mirrors:\n\t\t\t\tadd_custom_mirrors(mirror_config.custom_mirrors)\n\n\t\tinstallation.minimal_installation(\n\t\t\ttesting=enable_testing,\n\t\t\tmultilib=enable_multilib,\n\t\t\tmkinitcpio=run_mkinitcpio,\n\t\t\thostname=archinstall.arguments.get('hostname', 'archlinux'),\n\t\t\tlocale_config=locale_config\n\t\t)\n\n\t\tif mirror_config := archinstall.arguments.get('mirror_config', None):\n\t\t\tinstallation.set_mirrors(mirror_config)  # Set the mirrors in the installation medium\n\n\t\tif archinstall.arguments.get('swap'):\n\t\t\tinstallation.setup_swap('zram')\n\n\t\tif archinstall.arguments.get(\"bootloader\") == Bootloader.Grub and SysInfo.has_uefi():\n\t\t\tinstallation.add_additional_packages(\"grub\")\n\n\t\tinstallation.add_bootloader(\n\t\t\tarchinstall.arguments[\"bootloader\"],\n\t\t\tarchinstall.arguments.get('uki', False)\n\t\t)\n\n\t\t# If user selected to copy the current ISO network configuration\n\t\t# Perform a copy of the config\n\t\tnetwork_config: Optional[NetworkConfiguration] = archinstall.arguments.get('network_config', None)\n\n\t\tif network_config:\n\t\t\tnetwork_config.install_network_config(\n\t\t\t\tinstallation,\n\t\t\t\tarchinstall.arguments.get('profile_config', None)\n\t\t\t)\n\n\t\tif users := archinstall.arguments.get('!users', None):\n\t\t\tinstallation.create_users(users)\n\n\t\taudio_config: Optional[AudioConfiguration] = archinstall.arguments.get('audio_config', None)\n\t\tif audio_config:\n\t\t\taudio_config.install_audio_config(installation)\n\t\telse:\n\t\t\tinfo(\"No audio server will be installed\")\n\n\t\tif archinstall.arguments.get('packages', None) and archinstall.arguments.get('packages', None)[0] != '':\n\t\t\tinstallation.add_additional_packages(archinstall.arguments.get('packages', None))\n\n\t\tif profile_config := archinstall.arguments.get('profile_config', None):\n\t\t\tprofile_handler.install_profile_config(installation, profile_config)\n\n\t\tif timezone := archinstall.arguments.get('timezone', None):\n\t\t\tinstallation.set_timezone(timezone)\n\n\t\tif archinstall.arguments.get('ntp', False):\n\t\t\tinstallation.activate_time_synchronization()\n\n\t\tif archinstall.accessibility_tools_in_use():\n\t\t\tinstallation.enable_espeakup()\n\n\t\tif (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw):\n\t\t\tinstallation.user_set_pw('root', root_pw)\n\n\t\t# This step must be after profile installs to allow profiles_bck to install language pre-requisites.\n\t\t# After which, this step will set the language both for console and x11 if x11 was installed for instance.\n\t\tinstallation.set_keyboard_language(locale_config.kb_layout)\n\n\t\tif profile_config := archinstall.arguments.get('profile_config', None):\n\t\t\tprofile_config.profile.post_install(installation)\n\n\t\t# If the user provided a list of services to be enabled, pass the list to the enable_service function.\n\t\t# Note that while it's called enable_service, it can actually take a list of services and iterate it.\n\t\tif archinstall.arguments.get('services', None):\n\t\t\tinstallation.enable_service(archinstall.arguments.get('services', []))\n\n\t\t# If the user provided custom commands to be run post-installation, execute them now.\n\t\tif archinstall.arguments.get('custom-commands', None):\n\t\t\tarchinstall.run_custom_user_commands(archinstall.arguments['custom-commands'], installation)\n\n\t\tinstallation.genfstab()\n\n\t\tinfo(\"For post-installation tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation\")\n\n\t\tif not archinstall.arguments.get('silent'):\n\t\t\tprompt = str(_('Would you like to chroot into the newly created installation and perform post-installation configuration?'))\n\t\t\tchoice = Menu(prompt, Menu.yes_no(), default_option=Menu.yes()).run()\n\t\t\tif choice.value == Menu.yes():\n\t\t\t\ttry:\n\t\t\t\t\tinstallation.drop_to_shell()\n\t\t\t\texcept:\n\t\t\t\t\tpass\n\n\tdebug(f\"Disk states after installing: {disk.disk_layouts()}\")\n\n\nif not archinstall.arguments.get('silent'):\n\task_user_questions()\n\nconfig_output = ConfigurationOutput(archinstall.arguments)\n\nif not archinstall.arguments.get('silent'):\n\tconfig_output.show()\n\nconfig_output.save()\n\nif archinstall.arguments.get('dry_run'):\n\texit(0)\n\nif not archinstall.arguments.get('silent'):\n\tinput(str(_('Press Enter to continue.')))\n\nfs_handler = disk.FilesystemHandler(\n\tarchinstall.arguments['disk_config'],\n\tarchinstall.arguments.get('disk_encryption', None)\n)\n\nfs_handler.perform_filesystem_operations()\n\nperform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))\n", "path": "archinstall/scripts/guided.py"}]}