File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ def collect_part(self, part):
9696 part .os = []
9797
9898 ct = part .container
99+ ct_name = ct .get ("ContainerReference" , None )
100+
99101 by_role = {}
100102 by_device = {}
101103
@@ -121,10 +123,23 @@ def collect_part(self, part):
121123 if len (data ) != 1 or len (system ) != 1 :
122124 logging .info (f" Weird VG: { vg ['Volumes' ]} " )
123125 continue
126+ data = data [0 ]["DeviceIdentifier" ]
127+ system = system [0 ]["DeviceIdentifier" ]
128+
129+ volumes ["Data" ] = by_device [data ]
130+ volumes ["System" ] = by_device [system ]
124131
125- volumes ["Data" ] = by_device [data [0 ]["DeviceIdentifier" ]]
126- volumes ["System" ] = by_device [system [0 ]["DeviceIdentifier" ]]
127132 vgid = vg ["APFSVolumeGroupUUID" ]
133+
134+ if self .sysinfo .boot_uuid == vgid :
135+ for volume in self .dutil .disk_parts [ct_name ]["APFSVolumes" ]:
136+ if "MountedSnapshots" not in volume :
137+ continue
138+ snapshots = volume ["MountedSnapshots" ]
139+ if volume ["DeviceIdentifier" ] == system and len (snapshots ) == 1 :
140+ volumes = dict (volumes )
141+ volumes ["System" ]["DeviceIdentifier" ] = snapshots [0 ]["SnapshotBSD" ]
142+
128143 os = self .collect_os (part , volumes , vgid )
129144 logging .info (f" Found { os } " )
130145 part .os .append (os )
You can’t perform that action at this time.
0 commit comments