[fstab] Replace two-step attribute-setting with one step

This commit is contained in:
Adriaan de Groot 2022-05-24 15:56:34 +02:00
parent cada0f2547
commit ff7ceb2e2b

View File

@ -341,8 +341,7 @@ def create_swapfile(root_mount_point, root_btrfs):
swapfile_path = os.path.join(root_mount_point, "swap/swapfile") swapfile_path = os.path.join(root_mount_point, "swap/swapfile")
with open(swapfile_path, "wb") as f: with open(swapfile_path, "wb") as f:
pass pass
libcalamares.utils.host_env_process_output(["btrfs", "property", "set", swapfile_path, "compression", "none"]) libcalamares.utils.host_env_process_output(["chattr", "+C", "+m", swapfile_path]) # No Copy-on-Write, no compression
libcalamares.utils.host_env_process_output(["chattr", "+C", swapfile_path]) # No Copy-on-Write
else: else:
swapfile_path = os.path.join(root_mount_point, "swapfile") swapfile_path = os.path.join(root_mount_point, "swapfile")
with open(swapfile_path, "wb") as f: with open(swapfile_path, "wb") as f: