[fstab] Don't add swap that wasn't made new for us

This commit is contained in:
Adriaan de Groot 2020-02-16 21:13:37 +01:00
parent 158e11de1e
commit 1b80cf82de

View File

@ -218,7 +218,6 @@ class FstabGenerator(object):
else: else:
dct = self.generate_fstab_line_info(partition) dct = self.generate_fstab_line_info(partition)
if dct: if dct:
self.print_fstab_line(dct, file=fstab_file) self.print_fstab_line(dct, file=fstab_file)
@ -245,6 +244,10 @@ class FstabGenerator(object):
return None return None
if not mount_point: if not mount_point:
mount_point = "swap" mount_point = "swap"
# Existing swap partitins should not be used
if filesystem == "swap" and not partition["new"]:
libcalamares.utils.debug("fstab ignoring old swap {}".format(disk_name))
return None
options = self.get_mount_options(filesystem, mount_point) options = self.get_mount_options(filesystem, mount_point)