Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-11-22 11:27:49 +0000
committerGitHub <noreply@github.com>2021-11-22 11:27:49 +0000
commit29d0b3d15570a12ad89feff8b49dd9be478e69c2 (patch)
tree7a10426dca04a436fc3bf7edc68b89ac70d1b866
parentc264fd466aca54bcc1a7210165ee143b5f0aa6f3 (diff)
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.
-rw-r--r--archinstall/lib/disk/user_guides.py25
-rw-r--r--examples/guided.py2
2 files changed, 17 insertions, 10 deletions
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" : {
diff --git a/examples/guided.py b/examples/guided.py
index 8486521d..a86aafd2 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -135,7 +135,7 @@ def ask_user_questions():
# Ask for a root password (optional, but triggers requirement for super-user if skipped)
if not archinstall.arguments.get('!root-password', None):
- archinstall.arguments['!root-password'] = archinstall.get_password(prompt='Enter root password (leave blank to disable disabled & create superuser): ')
+ archinstall.arguments['!root-password'] = archinstall.get_password(prompt='Enter root password (leave blank to disable root & create superuser): ')
# Ask for additional users (super-user if root pw was not set)
if not archinstall.arguments.get('!root-password', None) and not archinstall.arguments.get('!superusers', None):