Merge branch 'release-3.2.58.2' into calamares

This commit is contained in:
Adriaan de Groot 2022-05-24 16:48:05 +02:00
commit bb395db9f4
2 changed files with 9 additions and 6 deletions

View File

@ -25,6 +25,13 @@ This release contains contributions from (alphabetically by first name):
- *partition* will cycle out a LUKS key if all the key slots are in use - *partition* will cycle out a LUKS key if all the key slots are in use
and a new key is added, rather than crashing the installer. (Thanks Arjen) and a new key is added, rather than crashing the installer. (Thanks Arjen)
# 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) # 3.2.58.1 (2022-05-20)

View File

@ -357,10 +357,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
o = subprocess.check_output(["chattr", "+C", swapfile_path]) libcalamares.utils.host_env_process_output(["chattr", "+C", "+m", swapfile_path]) # No Copy-on-Write, no compression
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))
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:
@ -378,8 +375,7 @@ def create_swapfile(root_mount_point, root_btrfs):
libcalamares.job.setprogress(0.2 + 0.3 * ( total / desired_size ) ) libcalamares.job.setprogress(0.2 + 0.3 * ( total / desired_size ) )
total += chunk total += chunk
os.chmod(swapfile_path, 0o600) os.chmod(swapfile_path, 0o600)
o = subprocess.check_output(["mkswap", swapfile_path]) libcalamares.utils.host_env_process_output(["mkswap", swapfile_path])
libcalamares.utils.debug("swapfile mkswap: {!s}".format(o))
libcalamares.job.setprogress(0.5) libcalamares.job.setprogress(0.5)