UAdded automatic enabling of swap partition before installation starts.
Mainly to suppress installer stoppages caused by oom killer.
This commit is contained in:
parent
719c6f2ff1
commit
0038751106
@ -307,12 +307,23 @@ def mount_partition(root_mount_point, partition, partitions, mount_options, moun
|
|||||||
mount_option) != 0:
|
mount_option) != 0:
|
||||||
libcalamares.utils.warning("Cannot mount {}".format(device))
|
libcalamares.utils.warning("Cannot mount {}".format(device))
|
||||||
|
|
||||||
|
<<<<<<< ours
|
||||||
def enable_swap_partitions(swap_partitions):
|
def enable_swap_partitions(swap_partitions):
|
||||||
try:
|
try:
|
||||||
for swap_device in swap_partitions:
|
for swap_device in swap_partitions:
|
||||||
libcalamares.utils.host_env_process_output(["swapon", swap_device])
|
libcalamares.utils.host_env_process_output(["swapon", swap_device])
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
libcalamares.utils.warning("Failed to swapon " + swap_device)
|
libcalamares.utils.warning("Failed to swapon " + swap_device)
|
||||||
|
||||||| base
|
||||||
|
=======
|
||||||
|
def enable_swap_partition(swap_device):
|
||||||
|
try:
|
||||||
|
for d in swap_device:
|
||||||
|
subprocess.check_call(["swapon", d])
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
raise Exception(_("Failed to swapon " + swap_device))
|
||||||
|
|
||||||
|
>>>>>>> theirs
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
"""
|
"""
|
||||||
@ -327,11 +338,19 @@ def run():
|
|||||||
return (_("Configuration Error"),
|
return (_("Configuration Error"),
|
||||||
_("No partitions are defined for <pre>{!s}</pre> to use.").format("mount"))
|
_("No partitions are defined for <pre>{!s}</pre> to use.").format("mount"))
|
||||||
|
|
||||||
|
<<<<<<< ours
|
||||||
# swap
|
# swap
|
||||||
swap_partitions = [p['device'] for p in partitions if p['fs'] == 'linuxswap' ]
|
swap_partitions = [p['device'] for p in partitions if ( p['fs'] == 'linuxswap' and p.get("claimed", None) )]
|
||||||
if ( swap_partitions != [] ):
|
if ( swap_partitions != [] ):
|
||||||
enable_swap_partition(swap_partitions)
|
enable_swap_partition(swap_partitions)
|
||||||
|
|
||||||
|
||||||| base
|
||||||
|
=======
|
||||||
|
swap_partitions = [p['device'] for p in partitions if ( p['fs'] == 'linuxswap' and p['claimed'] == True ) ]
|
||||||
|
if swap_partitions != [] :
|
||||||
|
enable_swap_partition(swap_partitions)
|
||||||
|
|
||||||
|
>>>>>>> theirs
|
||||||
root_mount_point = tempfile.mkdtemp(prefix="calamares-root-")
|
root_mount_point = tempfile.mkdtemp(prefix="calamares-root-")
|
||||||
|
|
||||||
# Get the mountOptions, if this is None, that is OK and will be handled later
|
# Get the mountOptions, if this is None, that is OK and will be handled later
|
||||||
|
Loading…
Reference in New Issue
Block a user