Beispiel #1
0
	def _post_processing(self):
		if archinstall.arguments.get('harddrives', None) 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'])
Beispiel #2
0
def ask_harddrives():
    # Ask which harddrives/block-devices we will install to
    # and convert them into archinstall.BlockDevice() objects.
    if archinstall.arguments.get('harddrives', None) is None:
        archinstall.arguments['harddrives'] = archinstall.generic_multi_select(
            archinstall.all_disks(),
            text=
            "Select one or more harddrives to use and configure (leave blank to skip this step): ",
            allow_empty=True)

    if not archinstall.arguments['harddrives']:
        archinstall.log("You decided to skip harddrive selection",
                        fg="red",
                        level=logging.INFO)
        archinstall.log(
            f"and will use whatever drive-setup is mounted at {archinstall.storage['MOUNT_POINT']} (experimental)",
            fg="red",
            level=logging.INFO)
        archinstall.log(
            "WARNING: Archinstall won't check the suitability of this setup",
            fg="red",
            level=logging.INFO)
        if input("Do you wish to continue ? [Y/n]").strip().lower() == 'n':
            exit(1)
    else:
        if archinstall.storage.get('disk_layouts', None) is None:
            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.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.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'])
Beispiel #3
0
    # 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()

    # 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)