MCPcopy Create free account
hub / github.com/archlinux/archinstall / suggest_single_disk_layout

Function suggest_single_disk_layout

archinstall/lib/disk/disk_menu.py:595–698  ·  view source on GitHub ↗
(
	device: BDevice,
	filesystem_type: FilesystemType | None = None,
	separate_home: bool | None = None,
)

Source from the content-addressed store, hash-verified

593
594
595async def suggest_single_disk_layout(
596 device: BDevice,
597 filesystem_type: FilesystemType | None = None,
598 separate_home: bool | None = None,
599) -> DeviceModification:
600 if not filesystem_type:
601 filesystem_type = await select_main_filesystem_format()
602
603 sector_size = device.device_info.sector_size
604 total_size = device.device_info.total_size
605 available_space = total_size
606 min_size_to_allow_home_part = Size(64, Unit.GiB, sector_size)
607
608 if filesystem_type == FilesystemType.BTRFS:
609 prompt = tr('Would you like to use BTRFS subvolumes with a default structure?') + '\n'
610
611 result = await Confirmation(
612 header=prompt,
613 allow_skip=False,
614 preset=True,
615 ).show()
616
617 using_subvolumes = result.item() == MenuItem.yes()
618 mount_options = await select_mount_options()
619 else:
620 using_subvolumes = False
621 mount_options = []
622
623 device_modification = DeviceModification(device, wipe=True)
624
625 using_gpt = device_handler.partition_table.is_gpt()
626
627 if using_gpt:
628 available_space = available_space.gpt_end()
629
630 available_space = available_space.align()
631
632 # Used for reference: https://wiki.archlinux.org/title/partitioning
633
634 boot_partition = _boot_partition(sector_size, using_gpt)
635 device_modification.add_partition(boot_partition)
636
637 if separate_home is False or using_subvolumes or total_size < min_size_to_allow_home_part:
638 using_home_partition = False
639 elif separate_home:
640 using_home_partition = True
641 else:
642 prompt = tr('Would you like to create a separate partition for /home?') + '\n'
643
644 result = await Confirmation(
645 header=prompt,
646 allow_skip=False,
647 preset=True,
648 ).show()
649
650 using_home_partition = result.item() == MenuItem.yes()
651
652 # root partition

Callers 2

Calls 15

add_partitionMethod · 0.95
SizeClass · 0.90
trFunction · 0.90
ConfirmationClass · 0.90
DeviceModificationClass · 0.90
select_mount_optionsFunction · 0.85
_boot_partitionFunction · 0.85
itemMethod · 0.80

Tested by

no test coverage detected