[fstab] Document the remapping of fs names

- Shuffle the code a little so it's clear where the remapping
  happens, and explain why we look for "swap" in fstab and
  "linuxswap" elsewhere.
This commit is contained in:
Adriaan de Groot 2020-02-16 21:42:08 +01:00
parent 1b80cf82de
commit f9d9cd2df4

View file

@ -232,14 +232,21 @@ class FstabGenerator(object):
self.print_fstab_line(dct, file=fstab_file)
def generate_fstab_line_info(self, partition):
""" Generates information for each fstab entry. """
"""
Generates information (a dictionary of fstab-fields)
for the given @p partition.
"""
# Some "fs" names need special handling in /etc/fstab, so remap them.
filesystem = partition["fs"].lower()
filesystem = FS_MAP.get(filesystem, filesystem)
has_luks = "luksMapperName" in partition
mount_point = partition["mountPoint"]
disk_name = disk_name_for_partition(partition)
is_ssd = disk_name in self.ssd_disks
filesystem = FS_MAP.get(filesystem, filesystem)
# Swap partitions are called "linuxswap" by parted.
# That "fs" is visible in GS, but that gets mapped
# to "swap", above, because that's the spelling needed in /etc/fstab
if not mount_point and not filesystem == "swap":
return None
if not mount_point: