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 committed Aug 10, 2024
1 parent 6a082ba commit 0d38e6e
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 @@ -37,6 +37,9 @@ def get_device_path(device_id):

device_tree = STORAGE.get_proxy(DEVICE_TREE)
device_data = DeviceData.from_structure(device_tree.GetDeviceData(device_id))
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 0d38e6e

Please sign in to comment.