From f4e5e08aa8f1f464c926dadba94096b34b5aab61 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 24 May 2022 15:18:50 +0200 Subject: [PATCH 1/3] [fstab] Be more careful in setting up btrfs swap - do not use subprocess module in Python bits, - do +C (no-CoW) after turning compression off --- src/modules/fstab/main.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/modules/fstab/main.py b/src/modules/fstab/main.py index 95f10a643..2b261fc66 100755 --- a/src/modules/fstab/main.py +++ b/src/modules/fstab/main.py @@ -173,7 +173,6 @@ class FstabGenerator(object): for p in self.partitions]): password = "none" crypttab_options = "" - return dict( name=mapper_name, @@ -342,10 +341,8 @@ def create_swapfile(root_mount_point, root_btrfs): swapfile_path = os.path.join(root_mount_point, "swap/swapfile") with open(swapfile_path, "wb") as f: pass - o = subprocess.check_output(["chattr", "+C", swapfile_path]) - libcalamares.utils.debug("swapfile attributes: {!s}".format(o)) - o = subprocess.check_output(["btrfs", "property", "set", swapfile_path, "compression", "none"]) - libcalamares.utils.debug("swapfile compression: {!s}".format(o)) + libcalamares.utils.host_env_process_output(["btrfs", "property", "set", swapfile_path, "compression", "none"]) + libcalamares.utils.host_env_process_output(["chattr", "+C", swapfile_path]) # No Copy-on-Write else: swapfile_path = os.path.join(root_mount_point, "swapfile") with open(swapfile_path, "wb") as f: @@ -363,8 +360,7 @@ def create_swapfile(root_mount_point, root_btrfs): libcalamares.job.setprogress(0.2 + 0.3 * ( total / desired_size ) ) total += chunk os.chmod(swapfile_path, 0o600) - o = subprocess.check_output(["mkswap", swapfile_path]) - libcalamares.utils.debug("swapfile mkswap: {!s}".format(o)) + libcalamares.utils.host_env_process_output(["mkswap", swapfile_path]) libcalamares.job.setprogress(0.5) From cada0f2547fc681015844f005bdbf80e8a7e099c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 24 May 2022 15:25:31 +0200 Subject: [PATCH 2/3] Changes: pre-release housekeeping --- CHANGES-3.2 | 8 ++++++++ CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES-3.2 b/CHANGES-3.2 index 068b68aae..94898dfa5 100644 --- a/CHANGES-3.2 +++ b/CHANGES-3.2 @@ -8,6 +8,14 @@ contributors are listed. Note that Calamares does not have a historical changelog -- this log starts with version 3.2.0. The release notes on the website will have to do for older versions. +# 3.2.58.2 (2022-05-24) + +This is a extra-quick release for an issue that shows up when using a +swap **file** on a btrfs filesystem; the installation would fail with +a Python error, raised from btrfs-progs. Reported by Evan James, Erik +Dubois, TechXero. + + # 3.2.58.1 (2022-05-20) This is a hot-fix release for a regression in the *partition* module where diff --git a/CMakeLists.txt b/CMakeLists.txt index 34f5f71f5..28b2ce6a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ # TODO:3.3: Require CMake 3.12 cmake_minimum_required( VERSION 3.3 FATAL_ERROR ) project( CALAMARES - VERSION 3.2.58.1 + VERSION 3.2.58.2 LANGUAGES C CXX ) From ff7ceb2e2be953c490b8317fb3c08e6f0b3bc850 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 24 May 2022 15:56:34 +0200 Subject: [PATCH 3/3] [fstab] Replace two-step attribute-setting with one step --- src/modules/fstab/main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/fstab/main.py b/src/modules/fstab/main.py index 2b261fc66..0a9da8f2d 100755 --- a/src/modules/fstab/main.py +++ b/src/modules/fstab/main.py @@ -341,8 +341,7 @@ def create_swapfile(root_mount_point, root_btrfs): swapfile_path = os.path.join(root_mount_point, "swap/swapfile") with open(swapfile_path, "wb") as f: pass - libcalamares.utils.host_env_process_output(["btrfs", "property", "set", swapfile_path, "compression", "none"]) - libcalamares.utils.host_env_process_output(["chattr", "+C", swapfile_path]) # No Copy-on-Write + libcalamares.utils.host_env_process_output(["chattr", "+C", "+m", swapfile_path]) # No Copy-on-Write, no compression else: swapfile_path = os.path.join(root_mount_point, "swapfile") with open(swapfile_path, "wb") as f: