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@hvornum.se>2021-07-04 15:15:07 +0200
committerAnton Hvornum <anton@hvornum.se>2021-07-04 15:15:07 +0200
commitf2b0fcc6524226c99e38edd3fa03a3a68af33738 (patch)
treee767632447d5b868610a4aa0df1e793503e9cfeb /archinstall/lib/user_interaction.py
parent57bad26553166d6c1bfa81576089a29d56c970a7 (diff)
Added a filesystem check when marking for formatting, this should ensure that encrypted volumes get a proper filesystem without having to go through an extra step of selecting filesystem.
Diffstat (limited to 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 9f4ddc6d..197666a4 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -701,7 +701,23 @@ def manage_new_and_existing_partitions(block_device :BlockDevice) -> dict:
elif task == "Mark/Unmark a partition to be formatted (wipes data)":
if (partition := generic_select(block_device_struct["partitions"], 'Select which partition to mask for formatting: ', options_output=False)):
- # Negate the current encryption marking
+ # If we mark a partition for formatting, but the format is CRYPTO LUKS, there's no point in formatting it really
+ # without asking the user which inner-filesystem they want to use. Since the flag 'encrypted' = True is already set,
+ # it's safe to change the filesystem for this partition.
+ if block_device_struct["partitions"][block_device_struct["partitions"].index(partition)].get('filesystem', {}).get('format', 'crypto_LUKS') == 'crypto_LUKS':
+ if not block_device_struct["partitions"][block_device_struct["partitions"].index(partition)].get('filesystem', None):
+ block_device_struct["partitions"][block_device_struct["partitions"].index(partition)]['filesystem'] = {}
+
+ while True:
+ fstype = input("Enter a desired filesystem type for the partition: ").strip()
+ if not valid_fs_type(fstype):
+ log(f"Desired filesystem {fstype} is not a valid filesystem.", level=logging.ERROR, fg="red")
+ continue
+ break
+
+ block_device_struct["partitions"][block_device_struct["partitions"].index(partition)]['filesystem']['format'] = fstype
+
+ # Negate the current wipe marking
block_device_struct["partitions"][block_device_struct["partitions"].index(partition)]['format'] = not block_device_struct["partitions"][block_device_struct["partitions"].index(partition)].get('format', False)
elif task == "Mark/Unmark a partition as encrypted":