-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
When building with docker I am getting the error:
losetup: /pi-gen/work/2019-02-13-Raspbian/export-image/2019-02-13-Raspbian-lite.img: failed to set up loop device: No such file or directory
even though that file does exist.
To reproduce, make docker build stop at final rsync in export-image/prerun.sh . Loop devices are at kernel level outside the docker container, so they persist after the failure. They can be seen with the command losetup --list
The unmount_image function in scripts/common uses:
LOOP_DEVICES=$(losetup -j "${1}" | cut -f1 -d':')
but does not see the old loop devices, because the path is missing the "/pi-gen/work", so it is unable to remove them. I imagine the path difference is to do with the how the container views the filesystem. This can be solved by listing all the loop devices, and matching by filename (patch to follow).
There are a few older closed bugs mentioning the issue, #104 #193