From eab9dbabcc02e8078f8ee3cf278013d944f418cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Sch=C3=A4fer?= Date: Tue, 26 Sep 2017 16:21:49 +0200 Subject: [PATCH] Fixed order of volume mount list re-order mount_list by mountpoint hierarchy. This is needed because the handling of the fullsize volume and all other volumes is outside of the canonical order. If the fullsize volume forms a nested structure together with another volume the volume mount list must be re-ordered to avoid mounting the volumes in the wrong order --- kiwi/volume_manager/lvm.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kiwi/volume_manager/lvm.py b/kiwi/volume_manager/lvm.py index 8b7e01cf..5291f15d 100644 --- a/kiwi/volume_manager/lvm.py +++ b/kiwi/volume_manager/lvm.py @@ -159,6 +159,19 @@ class VolumeManagerLVM(VolumeManagerBase): full_size_volume.name, full_size_volume.realpath ) + # re-order mount_list by mountpoint hierarchy + # This is needed because the handling of the fullsize volume and + # all other volumes is outside of the canonical order. If the + # fullsize volume forms a nested structure together with another + # volume the volume mount list must be re-ordered to avoid + # mounting the volumes in the wrong order + volume_paths = {} + for volume_mount in self.mount_list: + volume_paths[volume_mount.mountpoint] = volume_mount + self.mount_list = [] + for mount_path in Path.sort_by_hierarchy(sorted(volume_paths.keys())): + self.mount_list.append(volume_paths[mount_path]) + def get_fstab(self, persistency_type, filesystem_name): """ Implements creation of the fstab entries. The method