Beispiel #1
0
                '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')
Beispiel #2
0
                '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)
Beispiel #3
0
import archinstall
import time

for name, info in archinstall.list_profiles().items():
    # Tailored means it's a match for this machine
    # based on it's MAC address (or some other criteria
    # that fits the requirements for this machine specifically).
    if info['tailored']:
        print(f'Found a tailored profile for this machine called: "{name}".')
        print(f'Starting install in:')
        for i in range(10, 0, -1):
            print(f'{i}...')
            time.sleep(1)

        profile = archinstall.Profile(None, info['path'])
        profile.install()
        break
Beispiel #4
0
                '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'] = 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.',
                    fg='red')
                exit(1)
Beispiel #5
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...')
Beispiel #6
0
	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'] = {}
	if not archinstall.arguments.get('!root-password', None):
		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(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.',
					fg='red'
				)
				exit(1)

	# Ask about audio server selection if one is not already set
	if not archinstall.arguments.get('audio', None):