Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/user_guides.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2022-04-26 13:17:40 +0200
committerGitHub <noreply@github.com>2022-04-26 13:17:40 +0200
commit12b5e2e4e9537fbae0ec21ced9d21482b29610d3 (patch)
treebeca57117b44080c161ca0142f07a90bdfee5ae1 /archinstall/lib/disk/user_guides.py
parent1bce561a0ca22d6735f9a46ee39e5e22e0c17cb8 (diff)
Adding compression as an option (#1084)
* Adding compression as an option * Ignore 'misaligned' ending parenthathese * Moved the 'mark compressed' logic into the sub block within manual disk operations. * Fixed flake8 complaints * Muting a complextion warning on manage_new_and_existing_partitions(). It is too complex, but not something that we'll bother with for v2.4.0. As this whole function could be replaced with a new and improved menu system split into tasks rather than one huge if/else.
Diffstat (limited to 'archinstall/lib/disk/user_guides.py')
-rw-r--r--archinstall/lib/disk/user_guides.py28
1 files changed, 24 insertions, 4 deletions
diff --git a/archinstall/lib/disk/user_guides.py b/archinstall/lib/disk/user_guides.py
index 90d323c7..63ec1d9b 100644
--- a/archinstall/lib/disk/user_guides.py
+++ b/archinstall/lib/disk/user_guides.py
@@ -23,12 +23,17 @@ def suggest_single_disk_layout(block_device :BlockDevice,
MIN_SIZE_TO_ALLOW_HOME_PART = 40 # GiB
using_subvolumes = False
using_home_partition = False
+ compression = False
if default_filesystem == 'btrfs':
prompt = 'Would you like to use BTRFS subvolumes with a default structure?'
choice = Menu(prompt, ['yes', 'no'], skip=False, default_option='yes').run()
using_subvolumes = choice == 'yes'
+ prompt = 'Would you like to use BTRFS compression?'
+ choice = Menu(prompt, ['yes', 'no'], skip=False, default_option='yes').run()
+ compression = choice == 'yes'
+
layout = {
block_device.path : {
"wipe" : True,
@@ -73,7 +78,8 @@ def suggest_single_disk_layout(block_device :BlockDevice,
"wipe" : True,
"mountpoint" : "/" if not using_subvolumes else None,
"filesystem" : {
- "format" : default_filesystem
+ "format" : default_filesystem,
+ "mount_options" : ["compress=zstd"] if compression else []
}
})
@@ -124,7 +130,8 @@ def suggest_single_disk_layout(block_device :BlockDevice,
"wipe" : True,
"mountpoint" : "/home",
"filesystem" : {
- "format" : default_filesystem
+ "format" : default_filesystem,
+ "mount_options" : ["compress=zstd"] if compression else []
}
})
@@ -151,6 +158,17 @@ def suggest_multi_disk_layout(block_devices :List[BlockDevice],
home_device = select_largest_device(block_devices, gigabytes=MIN_SIZE_TO_ALLOW_HOME_PART)
root_device = select_disk_larger_than_or_close_to(block_devices, gigabytes=ARCH_LINUX_INSTALLED_SIZE, filter_out=[home_device])
+ compression = False
+
+ if default_filesystem == 'btrfs':
+ # prompt = 'Would you like to use BTRFS subvolumes with a default structure?'
+ # choice = Menu(prompt, ['yes', 'no'], skip=False, default_option='yes').run()
+ # using_subvolumes = choice == 'yes'
+
+ prompt = 'Would you like to use BTRFS compression?'
+ choice = Menu(prompt, ['yes', 'no'], skip=False, default_option='yes').run()
+ compression = choice == 'yes'
+
log(f"Suggesting multi-disk-layout using {len(block_devices)} disks, where {root_device} will be /root and {home_device} will be /home", level=logging.DEBUG)
layout = {
@@ -193,7 +211,8 @@ def suggest_multi_disk_layout(block_devices :List[BlockDevice],
"wipe" : True,
"mountpoint" : "/",
"filesystem" : {
- "format" : default_filesystem
+ "format" : default_filesystem,
+ "mount_options" : ["compress=zstd"] if compression else []
}
})
if has_uefi():
@@ -208,7 +227,8 @@ def suggest_multi_disk_layout(block_devices :List[BlockDevice],
"wipe" : True,
"mountpoint" : "/home",
"filesystem" : {
- "format" : default_filesystem
+ "format" : default_filesystem,
+ "mount_options" : ["compress=zstd"] if compression else []
}
})