fstab: do not overwrite partition["mountPoint"]

When using BTRFS multiple subvolumes exist and whilst iterating them the
partition["mountPoint"] is inadvertently changed due to taking a
reference rather than a copy.

Closes: issue #2281
This commit is contained in:
Tj 2024-02-07 16:21:24 +00:00
parent 84c9fd457f
commit 1d996d1f9a

View File

@ -14,6 +14,7 @@
import os
import re
import copy
import libcalamares
@ -201,7 +202,7 @@ class FstabGenerator(object):
# so all subvolumes here should be safe to add to fstab
btrfs_subvolumes = libcalamares.globalstorage.value("btrfsSubvolumes")
for s in btrfs_subvolumes:
mount_entry = partition
mount_entry = copy.deepcopy(partition)
mount_entry["mountPoint"] = s["mountPoint"]
mount_entry["subvol"] = s["subvolume"]
dct = self.generate_fstab_line_info(mount_entry)