[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:
parent
1b80cf82de
commit
f9d9cd2df4
@ -232,14 +232,21 @@ class FstabGenerator(object):
|
|||||||
self.print_fstab_line(dct, file=fstab_file)
|
self.print_fstab_line(dct, file=fstab_file)
|
||||||
|
|
||||||
def generate_fstab_line_info(self, partition):
|
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 = partition["fs"].lower()
|
||||||
|
filesystem = FS_MAP.get(filesystem, filesystem)
|
||||||
has_luks = "luksMapperName" in partition
|
has_luks = "luksMapperName" in partition
|
||||||
mount_point = partition["mountPoint"]
|
mount_point = partition["mountPoint"]
|
||||||
disk_name = disk_name_for_partition(partition)
|
disk_name = disk_name_for_partition(partition)
|
||||||
is_ssd = disk_name in self.ssd_disks
|
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":
|
if not mount_point and not filesystem == "swap":
|
||||||
return None
|
return None
|
||||||
if not mount_point:
|
if not mount_point:
|
||||||
|
Loading…
Reference in New Issue
Block a user