armbian-next: refactor losetup -d ... into free_loop_device_insistent() which retries 10 times

This commit is contained in:
Ricardo Pardini
2023-01-03 16:06:31 +01:00
parent f679b81b10
commit 3bc8afd593
3 changed files with 15 additions and 15 deletions

View File

@@ -88,8 +88,7 @@ create_image_from_sdcard_rootfs() {
Called after unmounting both `/root` and `/boot`.
POST_UMOUNT_FINAL_IMAGE
display_alert "Freeing loop device" "${LOOP}"
losetup -d "${LOOP}"
free_loop_device_insistent "${LOOP}"
unset LOOP # unset so cleanup handler does not try it again
# We're done with ${MOUNT} by now, remove it.