Example #1
0
        archinstall.arguments['packages'] = [
            package for package in input(
                'Write additional packages to install (space separated, leave blank to skip): '
            ).split(' ') if len(package)
        ]

    # Verify packages that were given
    try:
        archinstall.validate_package_list(archinstall.arguments['packages'])
    except archinstall.RequirementError as e:
        archinstall.log(e, fg='red')
        exit(1)

    # Ask or Call the helper function that asks the user to optionally configure a network.
    if not archinstall.arguments.get('nic', None):
        archinstall.arguments['nic'] = archinstall.ask_to_configure_network()
        if not archinstall.arguments['nic']:
            archinstall.log(
                f"No network configuration was selected. Network is going to be unavailable until configured manually!",
                fg="yellow")

    if not archinstall.arguments.get('timezone', None):
        archinstall.arguments['timezone'] = archinstall.ask_for_a_timezone()


def perform_installation_steps():
    global SIG_TRIGGER

    print()
    print('This is your chosen configuration:')
    archinstall.log("-- Guided template chosen (with below config) --",
 def _setup_selection_menu_options(self):
     self._menu_options['keyboard-layout'] = \
      Selector('Select keyboard layout', lambda: archinstall.select_language('us'), default='us')
     self._menu_options['mirror-region'] = \
      Selector(
       'Select mirror region',
       lambda: archinstall.select_mirror_regions(),
       display_func=lambda x: list(x.keys()) if x else '[]',
       default={})
     self._menu_options['sys-language'] = \
      Selector('Select locale language', lambda: archinstall.select_locale_lang('en_US'), default='en_US')
     self._menu_options['sys-encoding'] = \
      Selector('Select locale encoding', lambda: archinstall.select_locale_enc('utf-8'), default='utf-8')
     self._menu_options['harddrives'] = \
      Selector(
       'Select harddrives',
       lambda: self._select_harddrives())
     self._menu_options['disk_layouts'] = \
      Selector(
       'Select disk layout',
       lambda: archinstall.select_disk_layout(
        archinstall.arguments['harddrives'],
        archinstall.arguments.get('advanced', False)
       ),
       dependencies=['harddrives'])
     self._menu_options['!encryption-password'] = \
      Selector(
       'Set encryption password',
       lambda: archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): '),
       display_func=lambda x: self._secret(x) if x else 'None',
       dependencies=['harddrives'])
     self._menu_options['swap'] = \
      Selector(
       'Use swap',
       lambda: archinstall.ask_for_swap(),
       default=True)
     self._menu_options['bootloader'] = \
      Selector(
       'Select bootloader',
       lambda: archinstall.ask_for_bootloader(archinstall.arguments.get('advanced', False)),)
     self._menu_options['hostname'] = \
      Selector('Specify hostname', lambda: archinstall.ask_hostname())
     self._menu_options['!root-password'] = \
      Selector(
       'Set root password',
       lambda: self._set_root_password(),
       display_func=lambda x: self._secret(x) if x else 'None')
     self._menu_options['!superusers'] = \
      Selector(
       'Specify superuser account',
       lambda: self._create_superuser_account(),
       dependencies_not=['!root-password'],
       display_func=lambda x: list(x.keys()) if x else '')
     self._menu_options['!users'] = \
      Selector(
       'Specify user account',
       lambda: self._create_user_account(),
       default={},
       display_func=lambda x: list(x.keys()) if x else '[]')
     self._menu_options['profile'] = \
      Selector(
       'Specify profile',
       lambda: self._select_profile(),
       display_func=lambda x: x if x else 'None')
     self._menu_options['audio'] = \
      Selector(
       'Select audio',
       lambda: archinstall.ask_for_audio_selection(archinstall.is_desktop_profile(archinstall.arguments.get('profile', None))))
     self._menu_options['kernels'] = \
      Selector(
       'Select kernels',
       lambda: archinstall.select_kernel(),
       default='linux')
     self._menu_options['packages'] = \
      Selector(
       'Additional packages to install',
       lambda: archinstall.ask_additional_packages_to_install(archinstall.arguments.get('packages', None)),
       default=[])
     self._menu_options['nic'] = \
      Selector(
       'Configure network',
       lambda: archinstall.ask_to_configure_network(),
       display_func=lambda x: x if x else 'Not configured, unavailable unless setup manually',
       default={})
     self._menu_options['timezone'] = \
      Selector('Select timezone', lambda: archinstall.ask_for_a_timezone())
     self._menu_options['ntp'] = \
      Selector(
       'Set automatic time sync (NTP)',
       lambda: archinstall.ask_ntp(),
       default=True)
     self._menu_options['install'] = \
      Selector(
       self._install_text(),
       enabled=True)
     self._menu_options['abort'] = Selector('Abort', enabled=True)