From a68a23d10a08052091df9550d119810db94a2fdf Mon Sep 17 00:00:00 2001 From: HTV04 <53527582+HTV04@users.noreply.github.com> Date: Tue, 4 Jan 2022 08:31:21 -0500 Subject: Add prompt for /home partition (#801) --- archinstall/lib/disk/user_guides.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'archinstall/lib/disk/user_guides.py') diff --git a/archinstall/lib/disk/user_guides.py b/archinstall/lib/disk/user_guides.py index 8dbd15dd..3d48c104 100644 --- a/archinstall/lib/disk/user_guides.py +++ b/archinstall/lib/disk/user_guides.py @@ -9,6 +9,7 @@ def suggest_single_disk_layout(block_device, default_filesystem=None, advanced_o MIN_SIZE_TO_ALLOW_HOME_PART = 40 # Gb using_subvolumes = False + using_home_partition = False if default_filesystem == 'btrfs': using_subvolumes = input('Would you like to use BTRFS subvolumes with a default structure? (Y/n): ').strip().lower() in ('', 'y', 'yes') @@ -45,10 +46,14 @@ def suggest_single_disk_layout(block_device, default_filesystem=None, advanced_o } }) + if not using_subvolumes and block_device.size >= MIN_SIZE_TO_ALLOW_HOME_PART: + using_home_partition = input('Would you like to create a separate partition for /home? (Y/n): ').strip().lower() in ('', 'y', 'yes') + # Set a size for / (/root) - if using_subvolumes or block_device.size < MIN_SIZE_TO_ALLOW_HOME_PART: + if using_subvolumes or block_device.size < MIN_SIZE_TO_ALLOW_HOME_PART or not using_home_partition: # We'll use subvolumes # Or the disk size is too small to allow for a separate /home + # Or the user doesn't want to create a separate partition for /home layout[block_device.path]['partitions'][-1]['size'] = '100%' else: layout[block_device.path]['partitions'][-1]['size'] = f"{min(block_device.size, 20)}GB" @@ -69,7 +74,7 @@ def suggest_single_disk_layout(block_device, default_filesystem=None, advanced_o # else: # pass # ... implement a guided setup - elif block_device.size >= MIN_SIZE_TO_ALLOW_HOME_PART: + elif using_home_partition: # If we don't want to use subvolumes, # But we want to be able to re-use data between re-installs.. # A second partition for /home would be nice if we have the space for it -- cgit v1.2.3-70-g09d2