Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py27
-rw-r--r--examples/swiss.py44
2 files changed, 47 insertions, 24 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 19b0d638..6f289caa 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -85,6 +85,10 @@ def ask_user_questions():
global_menu.enable('packages')
+ if archinstall.arguments.get('advanced', False):
+ # Enable parallel downloads
+ global_menu.enable('parallel downloads')
+
# Ask or Call the helper function that asks the user to optionally configure a network.
global_menu.enable('nic')
@@ -181,17 +185,22 @@ def perform_installation(mountpoint):
archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium
# Retrieve list of additional repositories and set boolean values appropriately
- enable_testing = 'testing' in archinstall.arguments.get('additional-repositories', None)
- enable_multilib = 'multilib' in archinstall.arguments.get('additional-repositories', None)
+ if archinstall.arguments.get('additional-repositories', None) is not None:
+ enable_testing = 'testing' in archinstall.arguments.get('additional-repositories', None)
+ enable_multilib = 'multilib' in archinstall.arguments.get('additional-repositories', None)
+ else:
+ enable_testing = False
+ enable_multilib = False
if installation.minimal_installation(testing=enable_testing, multilib=enable_multilib):
installation.set_locale(archinstall.arguments['sys-language'], archinstall.arguments['sys-encoding'].upper())
installation.set_hostname(archinstall.arguments['hostname'])
- if archinstall.arguments['mirror-region'].get("mirrors", None) is not None:
- installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium
- if archinstall.arguments['swap']:
+ if archinstall.arguments.get('mirror-region') is not None:
+ if archinstall.arguments.get("mirrors", None) is not None:
+ installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium
+ if archinstall.arguments.get('swap'):
installation.setup_swap('zram')
- if archinstall.arguments["bootloader"] == "grub-install" and archinstall.has_uefi():
+ if archinstall.arguments.get("bootloader") == "grub-install" and archinstall.has_uefi():
installation.add_additional_packages("grub")
installation.add_bootloader(archinstall.arguments["bootloader"])
@@ -253,11 +262,13 @@ def perform_installation(mountpoint):
if archinstall.arguments.get('custom-commands', None):
archinstall.run_custom_user_commands(archinstall.arguments['custom-commands'], installation)
+ installation.genfstab()
+
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 = 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():
+ if choice.value == Menu.yes():
try:
installation.drop_to_shell()
except:
@@ -272,7 +283,7 @@ if not (archinstall.check_mirror_reachable() or archinstall.arguments.get('skip-
archinstall.log(f"Arch Linux mirrors are not reachable. Please check your internet connection and the log file '{log_file}'.", level=logging.INFO, fg="red")
exit(1)
-if not archinstall.arguments.get('offline', False):
+if not archinstall.arguments.get('offline'):
latest_version_archlinux_keyring = max([k.pkg_version for k in archinstall.find_package('archlinux-keyring')])
# If we want to check for keyring updates
diff --git a/examples/swiss.py b/examples/swiss.py
index d0f02dc1..da45cd18 100644
--- a/examples/swiss.py
+++ b/examples/swiss.py
@@ -1,14 +1,14 @@
"""
Script swiss (army knife)
-Designed to make different workflows for the installation process. Which is controled by the argument --mode
+Designed to make different workflows for the installation process. Which is controlled by the argument --mode
mode full guides the full process of installation
mode only_hd only proceeds to the creation of the disk infraestructure (partition, mount points, encryption)
mode only_os processes only the installation of Archlinux and software at --mountpoint (or /mnt/archinstall)
mode minimal (still not implemented)
mode lineal. Instead of a menu, shows a sequence of selection screens (eq. to the old mode for guided.py)
-When using the argument --advanced. an aditional menu for several special parameters needed during installation appears
+When using the argument --advanced. an additional menu for several special parameters needed during installation appears
This script respects the --dry_run argument
@@ -158,29 +158,41 @@ class SetupMenu(archinstall.GeneralMenu):
super().__init__(data_store=storage_area)
def _setup_selection_menu_options(self):
- self.set_option('archinstall-language',
+ self.set_option(
+ 'archinstall-language',
archinstall.Selector(
_('Archinstall language'),
lambda x: self._select_archinstall_language(x),
- default='English',
- enabled=True))
- self.set_option('ntp',
- archinstall.Selector(
- 'Activate NTP',
- lambda x: select_activate_NTP(),
- default='Y',
- enabled=True))
- self.set_option('mode',
+ display_func=lambda x: x.display_name,
+ default=self.translation_handler.get_language_by_abbr('en'),
+ enabled=True
+ )
+ )
+
+ self.set_option(
+ 'ntp',
+ archinstall.Selector(
+ 'Activate NTP',
+ lambda x: select_activate_NTP(),
+ default='Y',
+ enabled=True
+ )
+ )
+
+ self.set_option(
+ 'mode',
archinstall.Selector(
'Excution mode',
lambda x : select_mode(),
default='full',
- enabled=True))
+ enabled=True)
+ )
+
for item in ['LC_ALL','LC_CTYPE','LC_NUMERIC','LC_TIME','LC_MESSAGES','LC_COLLATE']:
self.set_option(item,
archinstall.Selector(
f'{get_locale_mode_text(item)} locale',
- lambda x,item=item: select_installed_locale(item), # the parmeter is needed for the lambda in the loop
+ lambda x,item=item: select_installed_locale(item), # the parameter is needed for the lambda in the loop
enabled=True,
dependencies_not=['LC_ALL'] if item != 'LC_ALL' else []))
self.option('LC_ALL').set_enabled(True)
@@ -255,7 +267,7 @@ class MyMenu(archinstall.GlobalMenu):
self.option(entry).set_enabled(False)
self._update_install_text()
- def post_callback(self,option,value=None):
+ def post_callback(self,option=None,value=None):
self._update_install_text(self._execution_mode)
def _missing_configs(self,mode='full'):
@@ -286,7 +298,7 @@ class MyMenu(archinstall.GlobalMenu):
"""
-Instalation general subroutines
+Installation general subroutines
"""
def get_current_status():