Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-05-10 14:32:39 +0200
committerAnton Hvornum <anton.feeds@gmail.com>2021-05-10 14:32:39 +0200
commit6d5d9a1798e97b5e2d1db3339197ca2a767a6715 (patch)
tree4129678218c0ff59da067da9ef6c3db8e96235e7 /archinstall/lib/user_interaction.py
parent3e601ff9ab32947cc5a12b6059cde360b9191477 (diff)
Added Partition() properties: sector_size, start, end, boot, partition_type and a __dump__() function. As well as kept working on the partition logic of guided to have a more traditional workflow of adding/deleting partitions in a guided manner, as well as the ability to mark partitions as encrypted/boot and set target mountpoints.
Diffstat (limited to 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py34
1 files changed, 28 insertions, 6 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 57ea5349..050825cb 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -542,7 +542,7 @@ def wipe_and_create_partitions(block_device):
else:
partition_type = 'msdos'
- partitions_result = []
+ partitions_result = [block_device.__dump__()]
while True:
modes = [
@@ -581,11 +581,33 @@ def wipe_and_create_partitions(block_device):
else:
log(f"Invalid start, end or fstype for this partition. Ignoring this partition creation.", fg="red")
continue
-
- elif task == "Delete partition":
- elif task == "Assign mount-point for partition":
- elif task == "Mark a partition as encrypted":
- elif task == "Mark a partition as bootable (automatic for /boot)":
+ else:
+ for index, partition in enumerate(partitions_result):
+ print(partition)
+ print(f"{index}: {partition['start']} -> {partition['size']} ({partition['filesystem']['format']}{', mounting at: '+partition['mountpoint'] if partition['mountpoint'] else ''})")
+
+ if task == "Delete partition":
+ partition = generic_select(partitions_result, 'Select which partition to delete: ', options_output=False)
+ del(partitions_result[partition])
+ elif task == "Assign mount-point for partition":
+ partition = generic_select(partitions_result, 'Select which partition to mount where: ', options_output=False)
+ mountpoint = input('Select where to mount partition (leave blank to remove mountpoint): ').strip()
+
+ if len(mountpoint):
+ partitions_result[partition]['mountpoint'] = mountpoint
+ if mountpoint == '/boot':
+ log(f"Marked partition as bootable because mountpoint was set to /boot.", fg="yellow")
+ partitions_result[partition]['boot'] = True
+ else:
+ del(partitions_result[partition]['mountpoint'])
+
+ elif task == "Mark a partition as encrypted":
+ partition = generic_select(partitions_result, 'Select which partition to mark as encrypted: ', options_output=False)
+ partitions_result[partition]['encrypted'] = True
+
+ elif task == "Mark a partition as bootable (automatic for /boot)":
+ partition = generic_select(partitions_result, 'Select which partition to mark as bootable: ', options_output=False)
+ partitions_result[partition]['boot'] = True
def select_individual_blockdevice_usage(block_devices :list):
result = {}