From 97eb32bf5c9e6521780dc95fa9e17c203fb58dcb Mon Sep 17 00:00:00 2001 From: Chrysostomus Date: Mon, 7 Dec 2020 22:47:32 +0200 Subject: [PATCH] Correct the path of swapfile on btrfs --- src/modules/fstab/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/fstab/main.py b/src/modules/fstab/main.py index 9827198ce..6977ccad1 100644 --- a/src/modules/fstab/main.py +++ b/src/modules/fstab/main.py @@ -386,7 +386,12 @@ def run(): swap_choice = swap_choice.get( "swap", None ) if swap_choice and swap_choice == "file": # There's no formatted partition for it, so we'll sneak in an entry - partitions.append( dict(fs="swap", mountPoint=None, claimed=True, device="/swapfile", uuid=None) ) + root_partitions = [ p["fs"].lower() for p in partitions if p["mountPoint"] == "/" ] + root_btrfs = (root_partitions[0] == "btrfs") if root_partitions else False + if root_btrfs: + partitions.append( dict(fs="swap", mountPoint=None, claimed=True, device="/swap/swapfile", uuid=None) ) + else: + partitions.append( dict(fs="swap", mountPoint=None, claimed=True, device="/swapfile", uuid=None) ) else: swap_choice = None