Skip to content

Commit

Permalink
Resolve filename into associated loop device
Browse files Browse the repository at this point in the history
This fixes checking if given (disk image) file is mounted somewhere,
especially as /run/initramfs/repo.
PackagePayload._device_is_mounted_as_source() depends on it.

QubesOS/qubes-issues#6792
  • Loading branch information
marmarek authored and fepitre committed Dec 27, 2022
1 parent 87c3fd7 commit 180a7a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyanaconda/payload/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def get_device_path(device_name):

device_tree = STORAGE.get_proxy(DEVICE_TREE)
device_data = DeviceData.from_structure(device_tree.GetDeviceData(device_name))
if device_data.type == 'file' and device_data.children:
# resolve file path to associated loop device, if any
device_data = DeviceData.from_structure(device_tree.GetDeviceData(device_data.children[0]))
return device_data.path


Expand Down

0 comments on commit 180a7a5

Please sign in to comment.