diff options
author | Ilias Apalodimas <ilias.apalodimas@linaro.org> | 2019-08-07 16:54:19 +0300 |
---|---|---|
committer | Ilias Apalodimas <ilias.apalodimas@linaro.org> | 2019-08-07 16:54:19 +0300 |
commit | d2243aaf4faccb992c65ed3cf3c06d0a2e9293d8 (patch) | |
tree | 82ff63637fbabba421c13af0ccd1b39321312cfd /ledge-debian | |
parent | 15b6053cd0b80bc22442ec3ee41ffff7e0927e63 (diff) |
ledge: debian: delete loopback devices if image fails
Properly use losetup -d 'loop device' if the image generation failed
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Change-Id: Ic162e5520df50e2bc4df360d7aba6f983c8d67ce
Diffstat (limited to 'ledge-debian')
-rw-r--r-- | ledge-debian/builders-fai.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ledge-debian/builders-fai.sh b/ledge-debian/builders-fai.sh index e463d23a..6315b25a 100644 --- a/ledge-debian/builders-fai.sh +++ b/ledge-debian/builders-fai.sh @@ -8,8 +8,9 @@ LOOPDEV='loop4' cleanup_exit() { - cd ${WORKSPACE} - sudo umount -f "$BUILDDIR" || true + cd ${WORKSPACE} + sudo losetup -d /dev/"$LOOPDEV" || true + sudo umount -f "$BUILDDIR" || true } if ! sudo DEBIAN_FRONTEND=noninteractive apt-get -q=2 update; then @@ -78,7 +79,7 @@ for rootfs in ${ROOTFS}; do # our build procedure in the future device="$LOOPDEV"'p2' - sudo mount -o loop /dev/"$device" /mnt/ + sudo mount /dev/"$device" /mnt/ sudo tar caf out/rootfs-${image_name}.tar /mnt sudo chroot /mnt dpkg -l > out/${image_name}.packages sudo umount -f /mnt |