Merge pull request #2102 from phoepsilonix/calamares
During installation, if a swap partition exists, enable swap.
This commit is contained in:
commit
8e1bd367c4
@ -307,6 +307,12 @@ 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_device):
|
||||
try:
|
||||
for d in swap_device:
|
||||
libcalamares.utils.host_env_process_output(["swapon", d])
|
||||
except subprocess.CalledProcessError:
|
||||
raise Exception(_("Failed to swapon " + swap_device))
|
||||
|
||||
def run():
|
||||
"""
|
||||
@ -321,6 +327,10 @@ def run():
|
||||
return (_("Configuration Error"),
|
||||
_("No partitions are defined for <pre>{!s}</pre> to use.").format("mount"))
|
||||
|
||||
swap_partitions = [p['device'] for p in partitions if ( p['fs'] == 'linuxswap' and p['claimed'] ) ]
|
||||
if swap_partitions != [] :
|
||||
enable_swap_partition(swap_partitions)
|
||||
|
||||
root_mount_point = tempfile.mkdtemp(prefix="calamares-root-")
|
||||
|
||||
# Get the mountOptions, if this is None, that is OK and will be handled later
|
||||
|
Loading…
Reference in New Issue
Block a user