Ejemplo n.º 1
0
        archinstall.storage['disk_layouts'] = archinstall.select_disk_layout(archinstall.arguments['harddrives'], archinstall.arguments.get('advanced', False))

    # 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

    if archinstall.arguments['harddrives'] and archinstall.arguments.get('!encryption-password', None):
        # If no partitions was marked as encrypted, but a password was supplied and we have some disks to format..
        # Then we need to identify which partitions to encrypt. This will default to / (root).
        if len(list(archinstall.encrypted_partitions(archinstall.storage['disk_layouts']))) == 0:
            archinstall.storage['disk_layouts'] = archinstall.select_encrypted_partitions(archinstall.storage['disk_layouts'], archinstall.arguments['!encryption-password'])

    # Ask which boot-loader to use (will only ask if we're in BIOS (non-efi) mode)
    if not archinstall.arguments.get("bootloader", None):
        archinstall.arguments["bootloader"] = archinstall.ask_for_bootloader(archinstall.arguments.get('advanced', False))

    if not archinstall.arguments.get('swap', None):
        archinstall.arguments['swap'] = archinstall.ask_for_swap()

    # 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 (leave blank to disable root & create superuser): ')

    # Ask for additional users (super-user if root pw was not set)
    if not archinstall.arguments.get('!root-password', None) and not archinstall.arguments.get('!superusers', None):
        archinstall.arguments['!superusers'] = archinstall.ask_for_superuser_account('Create a required super-user with sudo privileges: ', forced=True)
Ejemplo n.º 2
0
            archinstall.arguments[
                'filesystem'] = archinstall.ask_for_main_filesystem_format()
        archinstall.arguments['harddrive'].keep_partitions = False

    # Get disk encryption password (or skip if blank)
    if archinstall.arguments['harddrive'] 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
            archinstall.arguments[
                'harddrive'].encryption_password = archinstall.arguments[
                    '!encryption-password']
    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'] = {}
Ejemplo n.º 3
0
 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)