From 77e1407c5110b32259230c33f46912c87a834579 Mon Sep 17 00:00:00 2001 From: Masato Toyoshima Date: Tue, 14 Feb 2023 04:30:24 +0900 Subject: [PATCH] During installation, if a swap partition exists, enable swap. If there is no swap at all when the partition of the installation destination device is mounted, if a Swap partition exists, enable swap. --- src/modules/mount/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index cb36120d8..ddf46d8e9 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -307,7 +307,7 @@ def mount_partition(root_mount_point, partition, partitions, mount_options, moun mount_option) != 0: libcalamares.utils.warning("Cannot mount {}".format(device)) -def enable_swap_partition(swap_partitions): +def enable_swap_partitions(swap_partitions): try: for swap_device in swap_partitions: libcalamares.utils.host_env_process_output(["swapon", swap_device]) @@ -328,9 +328,8 @@ def run(): _("No partitions are defined for
{!s}
to use.").format("mount")) # swap - swap_partitions = [p['device'] for p in partitions if p['fs'] == 'linuxswap' and p['claimed'] == False ] - if ( swap_partitions != [] ): - enable_swap_partition(swap_partitions) + swap_partitions = [p['device'] for p in partitions if p['fs'] == 'linuxswap' ] + enable_swap_partitions(swap_partitions) root_mount_point = tempfile.mkdtemp(prefix="calamares-root-")