From 29d0b3d15570a12ad89feff8b49dd9be478e69c2 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 22 Nov 2021 11:27:49 +0000 Subject: Simplified size definition in dict. (#752) * Simplified size definition in dict. Also changed from MiB to MB and GiB to GB on places where they were used, as BlockDevice().size now returns GB by default, so no math operations needed * Appended the /boot offset to /root when specifying /home start. --- archinstall/lib/disk/user_guides.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/disk/user_guides.py b/archinstall/lib/disk/user_guides.py index e9332b7b..a7d9a6e5 100644 --- a/archinstall/lib/disk/user_guides.py +++ b/archinstall/lib/disk/user_guides.py @@ -23,8 +23,8 @@ def suggest_single_disk_layout(block_device, default_filesystem=None): layout[block_device.path]['partitions'].append({ # Boot "type" : "primary", - "start" : "5MiB", - "size" : "513MiB", + "start" : "5MB", + "size" : "513MB", "boot" : True, "encrypted" : False, "format" : True, @@ -36,16 +36,23 @@ def suggest_single_disk_layout(block_device, default_filesystem=None): layout[block_device.path]['partitions'].append({ # Root "type" : "primary", - "start" : "518MiB", + "start" : "518MB", "encrypted" : False, "format" : True, - "size" : "100%" if (using_subvolumes or block_device.size < MIN_SIZE_TO_ALLOW_HOME_PART) else f"{min(block_device.size, 20)*1024}MiB", "mountpoint" : "/", "filesystem" : { "format" : default_filesystem } }) + # Set a size for / (/root) + if using_subvolumes or block_device.size < MIN_SIZE_TO_ALLOW_HOME_PART: + # We'll use subvolumes + # Or the disk size is too small to allow for a separate /home + layout[block_device.path]['partitions'][-1]['size'] = '100%' + else: + layout[block_device.path]['partitions'][-1]['size'] = f"{min(block_device.size, 20)}GB" + if default_filesystem == 'btrfs' and using_subvolumes: if input('Do you want to use a recommended structure? (Y/n): ').strip().lower() in ('', 'y', 'yes'): # https://btrfs.wiki.kernel.org/index.php/FAQ @@ -71,7 +78,7 @@ def suggest_single_disk_layout(block_device, default_filesystem=None): "type" : "primary", "encrypted" : False, "format" : True, - "start" : f"{min(block_device.size*0.2, 20)*1024}MiB", + "start" : f"{min(block_device.size+0.5, 20.5)}GB", "size" : "100%", "mountpoint" : "/home", "filesystem" : { @@ -115,8 +122,8 @@ def suggest_multi_disk_layout(block_devices, default_filesystem=None): layout[root_device.path]['partitions'].append({ # Boot "type" : "primary", - "start" : "5MiB", - "size" : "513MiB", + "start" : "5MB", + "size" : "513MB", "boot" : True, "encrypted" : False, "format" : True, @@ -128,7 +135,7 @@ def suggest_multi_disk_layout(block_devices, default_filesystem=None): layout[root_device.path]['partitions'].append({ # Root "type" : "primary", - "start" : "518MiB", + "start" : "518MB", "encrypted" : False, "format" : True, "size" : "100%", @@ -143,7 +150,7 @@ def suggest_multi_disk_layout(block_devices, default_filesystem=None): "type" : "primary", "encrypted" : False, "format" : True, - "start" : "4MiB", + "start" : "5MB", "size" : "100%", "mountpoint" : "/home", "filesystem" : { -- cgit v1.2.3-70-g09d2