tps: Use more efficient method to get boot device
commitfd39d39648ec98134e7cdcdefda57bd751409847
authorsegfault <segfault@riseup.net>
Thu, 7 Mar 2024 00:24:58 +0000 (7 01:24 +0100)
committersegfault <segfault@riseup.net>
Mon, 11 Mar 2024 20:48:43 +0000 (11 21:48 +0100)
tree95ba08060eb9f20d559a1edcbf91cd66a2c15d59
parent9e11ab5ab6a96a67211e28b94d9dc4d11d9a9400
tps: Use more efficient method to get boot device

I've seen calls to ChangePassphrase fail because
udisks.get_block_for_dev timed out after 60 seconds even though the
udisks object was there.

The get_block_for_dev method is quite inefficient because it iterates
over all block devices and compares the device number. This commit gets
the udisks object in O(1) instead by resolving /dev/bilibop and using
the resulting device name to construct the udisks object path.
config/chroot_local-includes/usr/lib/python3/dist-packages/tps/device.py