Exemple #1
0
	def _select_profile(self):
		profile = archinstall.select_profile()

		# Check the potentially selected profiles preparations to get early checks if some additional questions are needed.
		if profile and profile.has_prep_function():
			namespace = f'{profile.namespace}.py'
			with profile.load_instructions(namespace=namespace) as imported:
				if not imported._prep_function():
					archinstall.log(' * Profile\'s preparation requirements was not fulfilled.', fg='red')
					exit(1)

		return profile
Exemple #2
0
            'superusers'] = archinstall.ask_for_superuser_account(
                'Create a required super-user with sudo privileges: ',
                forced=True)

    users, superusers = archinstall.ask_for_additional_users(
        'Enter a username to create a additional user (leave blank to skip & continue): '
    )
    archinstall.arguments['users'] = users
    archinstall.arguments['superusers'] = {
        **archinstall.arguments['superusers'],
        **superusers
    }

    # Ask for archinstall-specific profiles (such as desktop environments etc)
    if not archinstall.arguments.get('profile', None):
        archinstall.arguments['profile'] = archinstall.select_profile(
            archinstall.list_profiles())
    else:
        archinstall.arguments['profile'] = archinstall.list_profiles()[
            archinstall.arguments['profile']]

    # Check the potentially selected profiles preperations to get early checks if some additional questions are needed.
    if archinstall.arguments['profile'] and archinstall.arguments[
            'profile'].has_prep_function():
        with archinstall.arguments['profile'].load_instructions(
                namespace=f"{archinstall.arguments['profile'].namespace}.py"
        ) as imported:
            if not imported._prep_function():
                archinstall.log(
                    ' * Profile\'s preparation requirements was not fulfilled.',
                    bg='black',
                    fg='red')
Exemple #3
0
            'superusers'] = archinstall.ask_for_superuser_account(
                'Create a required super-user with sudo privileges: ',
                forced=True)

    users, superusers = archinstall.ask_for_additional_users(
        'Enter a username to create a additional user (leave blank to skip & continue): '
    )
    archinstall.arguments['users'] = users
    archinstall.arguments['superusers'] = {
        **archinstall.arguments['superusers'],
        **superusers
    }

    # Ask for archinstall-specific profiles (such as desktop environments etc)
    if not archinstall.arguments.get('profile', None):
        archinstall.arguments['profile'] = archinstall.select_profile(
            archinstall.list_profiles(filter_top_level_profiles=True))
    else:
        archinstall.arguments['profile'] = Profile(
            installer=None, path=archinstall.arguments['profile'])

    # Check the potentially selected profiles preparations to get early checks if some additional questions are needed.
    if archinstall.arguments['profile'] and archinstall.arguments[
            'profile'].has_prep_function():
        with archinstall.arguments['profile'].load_instructions(
                namespace=f"{archinstall.arguments['profile'].namespace}.py"
        ) as imported:
            if not imported._prep_function():
                archinstall.log(
                    ' * Profile\'s preparation requirements was not fulfilled.',
                    fg='red')
                exit(1)
Exemple #4
0
        archinstall.arguments[
            'superusers'] = archinstall.ask_for_superuser_account(
                'Create a required super-user with sudo privileges: ',
                forced=True)
        users, superusers = archinstall.ask_for_additional_users(
            'Enter a username to create a additional user (leave blank to skip & continue): '
        )
        archinstall.arguments['users'] = users
        archinstall.arguments['superusers'] = {
            **archinstall.arguments['superusers'],
            **superusers
        }

    # Ask for archinstall-specific profiles (such as desktop environments etc)
    if not archinstall.arguments.get('profile', None):
        archinstall.arguments['profile'] = archinstall.select_profile()

    # Check the potentially selected profiles preparations to get early checks if some additional questions are needed.
    if archinstall.arguments['profile'] and archinstall.arguments[
            'profile'].has_prep_function():
        with archinstall.arguments['profile'].load_instructions(
                namespace=f"{archinstall.arguments['profile'].namespace}.py"
        ) as imported:
            if not imported._prep_function():
                archinstall.log(
                    ' * Profile\'s preparation requirements was not fulfilled.',
                    fg='red')
                exit(1)

    # Ask about audio server selection if one is not already set
    if not archinstall.arguments.get('audio', None):
Exemple #5
0
                forced=True)

    users, superusers = archinstall.ask_for_additional_users(
        'Enter a username to create a additional user (leave blank to skip & continue): '
    )
    archinstall.arguments['users'] = users
    archinstall.arguments['superusers'] = {
        **archinstall.arguments['superusers'],
        **superusers
    }

    # Ask for archinstall-specific profiles (such as desktop environments etc)
    if not archinstall.arguments.get('profile', None):
        archinstall.arguments['profile'] = archinstall.select_profile(
            filter(
                lambda profile:
                (Profile(None, profile).is_top_level_profile()),
                archinstall.list_profiles()))
    else:
        archinstall.arguments['profile'] = archinstall.list_profiles()[
            archinstall.arguments['profile']]

    # Check the potentially selected profiles preparations to get early checks if some additional questions are needed.
    if archinstall.arguments['profile'] and archinstall.arguments[
            'profile'].has_prep_function():
        with archinstall.arguments['profile'].load_instructions(
                namespace=f"{archinstall.arguments['profile'].namespace}.py"
        ) as imported:
            if not imported._prep_function():
                archinstall.log(
                    ' * Profile\'s preparation requirements was not fulfilled.',
Exemple #6
0
	if len(new_user.strip()) == 0:
		if len(root_pw.strip()) == 0:
			archinstall.log(' * Since root is disabled, you need to create a least one (super) user!', bg='black', fg='red')
			continue
		break
	new_user_passwd = getpass.getpass(prompt=f'Password for user {new_user}: ')
	new_user_passwd_verify = getpass.getpass(prompt=f'Enter password again for verification: ')
	if new_user_passwd != new_user_passwd_verify:
		archinstall.log(' * Passwords did not match * ', bg='black', fg='red')
		continue

	users[new_user] = new_user_passwd
	break

while 1:
	profile = archinstall.select_profile(archinstall.list_profiles())
	if type(profile) != str: # Got a imported profile
		if not profile[1]._prep_function():
			archinstall.log(' * Profile\'s preperation requirements was not fulfilled.', bg='black', fg='red')
			continue
		profile = profile[0]._path # Once the prep is done, replace the selected profile with the profile name ("path") given from select_profile()
		break
	else:
		break

packages = input('Additional packages aside from base (space separated): ').split(' ')

"""
	Issue a final warning before we continue with something un-revertable.
"""
print(f' ! Formatting {harddrive} in 5...')