index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2022-03-28 16:04:24 +0200 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2022-03-28 16:04:24 +0200 |
commit | de80fdc153763583c081120cc60c8595d9de97d4 (patch) | |
tree | c5788d75f8998b3fff2c5ec0aa164b3f9130fcc5 /archinstall/lib | |
parent | 6c71f42b4728d5e6da3b020e8454c292ed972058 (diff) |
-rw-r--r-- | archinstall/lib/user_interaction/partitioning_conf.py | 11 |
diff --git a/archinstall/lib/user_interaction/partitioning_conf.py b/archinstall/lib/user_interaction/partitioning_conf.py index ef4ba885..64c23efe 100644 --- a/archinstall/lib/user_interaction/partitioning_conf.py +++ b/archinstall/lib/user_interaction/partitioning_conf.py @@ -2,7 +2,6 @@ from __future__ import annotations from typing import List, Any, Dict, Union, TYPE_CHECKING, Callable -from ..disk import BlockDevice, suggest_single_disk_layout, suggest_multi_disk_layout, valid_parted_position from ..menu import Menu from ..output import log @@ -10,6 +9,7 @@ from ..disk.validators import fs_types from .subvolume_config import SubvolumeList if TYPE_CHECKING: + from ..disk import BlockDevice from ..disk.partition import Partition _: Any @@ -92,8 +92,9 @@ def select_partition(title :str, partitions :List[Partition], multiple :bool = F return None -def get_default_partition_layout(block_devices: Union[BlockDevice, List[BlockDevice]], +def get_default_partition_layout(block_devices: Union['BlockDevice', List['BlockDevice']], advanced_options: bool = False) -> Dict[str, Any]: + from ..disk import suggest_single_disk_layout, suggest_multi_disk_layout if len(block_devices) == 1: return suggest_single_disk_layout(block_devices[0], advanced_options=advanced_options) @@ -112,7 +113,7 @@ def select_individual_blockdevice_usage(block_devices: list) -> Dict[str, Any]: return result -def manage_new_and_existing_partitions(block_device: BlockDevice) -> Dict[str, Any]: +def manage_new_and_existing_partitions(block_device: 'BlockDevice') -> Dict[str, Any]: block_device_struct = {"partitions": [partition.__dump__() for partition in block_device.partitions.values()]} # Test code: [part.__dump__() for part in block_device.partitions.values()] # TODO: Squeeze in BTRFS subvolumes here @@ -155,6 +156,8 @@ def manage_new_and_existing_partitions(block_device: BlockDevice) -> Dict[str, A break if task == new_partition: + from ..disk import valid_parted_position + # if partition_type == 'gpt': # # https://www.gnu.org/software/parted/manual/html_node/mkpart.html # # https://www.gnu.org/software/parted/manual/html_node/mklabel.html @@ -200,6 +203,8 @@ def manage_new_and_existing_partitions(block_device: BlockDevice) -> Dict[str, A fg="red") continue elif task == suggest_partition_layout: + from ..disk import suggest_single_disk_layout + if len(block_device_struct["partitions"]): prompt = _('{} contains queued partitions, this will remove those, are you sure?').format(block_device) choice = Menu(prompt, ['yes', 'no'], default_option='no').run() |