Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-05-06 15:18:57 +0200
committerAnton Hvornum <anton.feeds@gmail.com>2021-05-06 15:18:57 +0200
commit8925be6c8725c76b4a5f13f0b110759f9c4eecc8 (patch)
tree6df37c7269cc83e7e44c073809d55ada29446fd2 /archinstall
parentc20be61e124ccb3f2434c6dc61016524ed936c7c (diff)
Adding in partition layout structure
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/user_interaction.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index be01594e..981e1b29 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -484,6 +484,48 @@ def generic_select(options, input_text="Select one of the above by index or abso
return selected_option
+def select_partitions(block_devices :list):
+ return {
+ "/dev/sda": { # Block Device level
+ "wipe": False, # Safety flags
+ "partitions" : [ # Affected / New partitions
+ {
+ "PARTUUID" : "654bb317-1b73-4339-9a00-7222792f4ba9", # If existing partition
+ "wipe" : False, # Safety flags
+ "boot" : True, # Safety flags / new flags
+ "ESP" : True # Safety flags / new flags
+ }
+ ]
+ },
+ "/dev/sdb" : {
+ "wipe" : True,
+ "partitions" : [
+ {
+ # No PARTUUID required here since it's a new partition
+ "type" : "primary", # parted options
+ "size" : "100%",
+ "filesystem" : {
+ "encrypted" : True, # TODO: Not sure about this here
+ "format": "btrfs", # mkfs options
+ }
+ }
+ ]
+ }
+ }
+
+def select_disk_layout(block_devices :list):
+ modes = [
+ "Wipe all selected drives and use a best-effort default partition layout",
+ "Select which partitions to use (and what to do with them)"
+ ]
+
+ mode = input("Do you wish to ")
+
+ if mode == 'Select which partitions to use (and what to do with them)':
+ return select_partitions(block_devices)
+ else:
+ return get_default_partition_layout(block_devices)
+
def select_disk(dict_o_disks):
"""
Asks the user to select a harddrive from the `dict_o_disks` selection.