Skip to content

Commit

Permalink
Merge pull request #2359 from OSInside/fix_btrfs_data_sync
Browse files Browse the repository at this point in the history
Fixed mounting of subvolumes for data sync
  • Loading branch information
Conan-Kudo authored Aug 23, 2023
2 parents faa2a23 + aac9412 commit 472160b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions build-tests/x86/fedora/test-image-live-disk/appliance.kiwi
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<systemdisk name="fedora">
<volume name="@root=root"/>
<volume name="home" parent="/"/>
<volume name="var" parent="/"/>
</systemdisk>
<oemconfig>
<oem-resize>false</oem-resize>
Expand Down
11 changes: 9 additions & 2 deletions kiwi/volume_manager/btrfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def create_volumes(self, filesystem_name):
)

volume_mountpoint = toplevel
root_is_snapshot = self.custom_args['root_is_snapshot']

attributes = {
'parent': volume.parent or '',
Expand All @@ -239,7 +240,7 @@ def create_volumes(self, filesystem_name):
).lstrip(os.sep),
'subvol_name': volume.name
}
if self.custom_args['root_is_snapshot']:
if root_is_snapshot:
volume_mountpoint = self.mountpoint + \
f'/{self.root_volume_name}/.snapshots/1/snapshot/'
attributes = {
Expand All @@ -255,7 +256,13 @@ def create_volumes(self, filesystem_name):
device=self.device,
attributes=attributes,
mountpoint=os.path.normpath(
volume_mountpoint + os.sep + volume.realpath
os.sep.join(
[
volume_mountpoint,
self.root_volume_name if not root_is_snapshot else '',
volume.realpath
]
)
)
)
self.subvol_mount_list.append(
Expand Down

0 comments on commit 472160b

Please sign in to comment.