Generate entry for subvolume @swap
This commit is contained in:
parent
3f0612b4ad
commit
80a538665e
@ -183,7 +183,7 @@ class FstabGenerator(object):
|
|||||||
print(FSTAB_HEADER, file=fstab_file)
|
print(FSTAB_HEADER, file=fstab_file)
|
||||||
|
|
||||||
for partition in self.partitions:
|
for partition in self.partitions:
|
||||||
# Special treatment for a btrfs root with @ and @home
|
# Special treatment for a btrfs root with @, @home and @swap
|
||||||
# subvolumes
|
# subvolumes
|
||||||
if (partition["fs"] == "btrfs"
|
if (partition["fs"] == "btrfs"
|
||||||
and partition["mountPoint"] == "/"):
|
and partition["mountPoint"] == "/"):
|
||||||
@ -206,6 +206,13 @@ class FstabGenerator(object):
|
|||||||
dct = self.generate_fstab_line_info(home_entry)
|
dct = self.generate_fstab_line_info(home_entry)
|
||||||
if dct:
|
if dct:
|
||||||
self.print_fstab_line(dct, file=fstab_file)
|
self.print_fstab_line(dct, file=fstab_file)
|
||||||
|
elif line.endswith(b'path @swap'):
|
||||||
|
swap_part_entry = partition
|
||||||
|
swap_part_entry["mountPoint"] = "/swap"
|
||||||
|
swap_part_entry["subvol"] = "@swap"
|
||||||
|
dct = self.generate_fstab_line_info(swap_part_entry)
|
||||||
|
if dct:
|
||||||
|
self.print_fstab_line(dct, file=fstab_file)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
dct = self.generate_fstab_line_info(partition)
|
dct = self.generate_fstab_line_info(partition)
|
||||||
|
Loading…
Reference in New Issue
Block a user