explicitly detach loop device on umount and silent losetup error

Umount detaches the loop device automatically, but let's make it
explicit to be sure. Additionally losetup gives:

losetup: /dev/loop0: detach failed: No such device or address

This is kind of expected, let's silent the error message.

Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
Christian Hesse 2015-05-28 08:59:41 +02:00 committed by Gerardo Exequiel Pozzi
parent f0452f22ca
commit b1011376cf
2 changed files with 2 additions and 2 deletions

View File

@ -182,7 +182,7 @@ archiso_mount_handler() {
fi fi
if [[ "${copytoram}" == "y" ]]; then if [[ "${copytoram}" == "y" ]]; then
umount /run/archiso/bootmnt umount -d /run/archiso/bootmnt
fi fi
} }

View File

@ -26,7 +26,7 @@ archiso_loop_mount_handler () {
archiso_mount_handler ${newroot} archiso_mount_handler ${newroot}
if [[ "${copytoram}" == "y" ]]; then if [[ "${copytoram}" == "y" ]]; then
losetup -d ${_dev_loop} losetup -d ${_dev_loop} 2>/dev/null
umount /run/archiso/img_dev umount /run/archiso/img_dev
fi fi
} }