build_library: detach after every losetup succeeded

To avoid issues with losetup not being cleaned up, we need to call
losetup --detach inside the retry loop.
This commit is contained in:
Dongsu Park 2019-06-29 09:19:51 +02:00
parent a8cafdb31c
commit 518f12983f

View File

@ -447,11 +447,10 @@ def PartitionLoop(options, partition):
except:
attempts += 1
time.sleep(1)
finally:
Sudo(['losetup', '--detach', loop_dev])
try:
yield loop_dev
finally:
Sudo(['losetup', '--detach', loop_dev])
yield loop_dev
def FormatPartition(options, part):
print "Formatting partition %s (%s) as %s" % (