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.py31
1 files changed, 15 insertions, 16 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 15226668..19b0d638 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -3,7 +3,7 @@ import os
import time
import archinstall
-from archinstall import ConfigurationOutput
+from archinstall import ConfigurationOutput, Menu
from archinstall.lib.models.network_configuration import NetworkConfigurationHandler
if archinstall.arguments.get('help'):
@@ -45,9 +45,8 @@ def ask_user_questions():
# Set which region to download packages from during the installation
global_menu.enable('mirror-region')
- if archinstall.arguments.get('advanced', False):
- global_menu.enable('sys-language', True)
- global_menu.enable('sys-encoding', True)
+ global_menu.enable('sys-language')
+ global_menu.enable('sys-encoding')
# Ask which harddrives/block-devices we will install to
# and convert them into archinstall.BlockDevice() objects.
@@ -58,6 +57,10 @@ def ask_user_questions():
# Get disk encryption password (or skip if blank)
global_menu.enable('!encryption-password')
+ if archinstall.arguments.get('advanced', False) or archinstall.arguments.get('HSM', None):
+ # Enables the use of HSM
+ global_menu.enable('HSM')
+
# Ask which boot-loader to use (will only ask if we're in UEFI mode, otherwise will default to GRUB)
global_menu.enable('bootloader')
@@ -69,7 +72,6 @@ def ask_user_questions():
# Ask for a root password (optional, but triggers requirement for super-user if skipped)
global_menu.enable('!root-password')
- global_menu.enable('!superusers')
global_menu.enable('!users')
# Ask for archinstall-specific profiles (such as desktop environments etc)
@@ -131,6 +133,7 @@ def perform_installation(mountpoint):
Only requirement is that the block devices are
formatted and setup prior to entering this function.
"""
+
with archinstall.Installer(mountpoint, kernels=archinstall.arguments.get('kernels', ['linux'])) as installation:
# Mount all the drives to the desired mountpoint
# This *can* be done outside of the installation, but the installer can deal with it.
@@ -216,13 +219,8 @@ def perform_installation(mountpoint):
if archinstall.arguments.get('profile', None):
installation.install_profile(archinstall.arguments.get('profile', None))
- if archinstall.arguments.get('!users',{}):
- for user, user_info in archinstall.arguments.get('!users', {}).items():
- installation.user_create(user, user_info["!password"], sudo=False)
-
- if archinstall.arguments.get('!superusers',{}):
- for superuser, user_info in archinstall.arguments.get('!superusers', {}).items():
- installation.user_create(superuser, user_info["!password"], sudo=True)
+ if users := archinstall.arguments.get('!users', None):
+ installation.create_users(users)
if timezone := archinstall.arguments.get('timezone', None):
installation.set_timezone(timezone)
@@ -257,9 +255,9 @@ def perform_installation(mountpoint):
installation.log("For post-installation tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation", fg="yellow")
if not archinstall.arguments.get('silent'):
- prompt = 'Would you like to chroot into the newly created installation and perform post-installation configuration?'
- choice = archinstall.Menu(prompt, ['yes', 'no'], default_option='yes').run()
- if choice == 'yes':
+ prompt = str(_('Would you like to chroot into the newly created installation and perform post-installation configuration?'))
+ choice = Menu(prompt, Menu.yes_no(), default_option=Menu.yes()).run()
+ if choice == Menu.yes():
try:
installation.drop_to_shell()
except:
@@ -300,7 +298,8 @@ if archinstall.arguments.get('dry_run'):
exit(0)
if not archinstall.arguments.get('silent'):
- input('Press Enter to continue.')
+ input(str(_('Press Enter to continue.')))
+archinstall.configuration_sanity_check()
perform_filesystem_operations()
perform_installation(archinstall.storage.get('MOUNT_POINT', '/mnt'))