From b82042a0783f318bb17d15f8604635d3e883202c Mon Sep 17 00:00:00 2001 From: Gabriel C Date: Tue, 12 Sep 2017 12:39:09 +0200 Subject: [PATCH] fstab: fix btrfs with LUKS and systemd we forgot to fix that in #730 tested with efi/BIOS+LUKS+btrfs , efi/BIOS+btrfs --- src/modules/fstab/main.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/modules/fstab/main.py b/src/modules/fstab/main.py index 553eb65ef..3b639d68f 100644 --- a/src/modules/fstab/main.py +++ b/src/modules/fstab/main.py @@ -225,6 +225,7 @@ class FstabGenerator(object): def generate_fstab_line_info(self, partition): """ Generates information for each fstab entry. """ filesystem = partition["fs"].lower() + has_luks = "luksMapperName" in partition mount_point = partition["mountPoint"] disk_name = disk_name_for_partition(partition) is_ssd = disk_name in self.ssd_disks @@ -252,17 +253,28 @@ class FstabGenerator(object): self.root_is_ssd = is_ssd if filesystem == "btrfs" and "subvol" in partition: - return dict( - device="UUID=" + partition["uuid"], - mount_point=mount_point, - fs=filesystem, - options=",".join( - ["subvol={}".format(partition["subvol"]), options] - ), - check=check, - ) + if has_luks: + return dict( + device="/dev/mapper/" + partition["luksMapperName"], + mount_point=mount_point, + fs=filesystem, + options=",".join( + ["subvol={}".format(partition["subvol"]), options] + ), + check=check, + ) + else: + return dict( + device="UUID=" + partition["uuid"], + mount_point=mount_point, + fs=filesystem, + options=",".join( + ["subvol={}".format(partition["subvol"]), options] + ), + check=check, + ) - if "luksMapperName" in partition: + if has_luks: return dict(device="/dev/mapper/" + partition["luksMapperName"], mount_point=mount_point or "swap", fs=filesystem,