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.
This commit is contained in:
Philip 2015-09-20 01:00:54 +02:00
parent ea57a2a4d7
commit c54915e2bc
2 changed files with 2 additions and 2 deletions

View file

@ -257,7 +257,7 @@ miso_mount_handler() {
done < "${isomounts}" done < "${isomounts}"
if [ "${copytoram}" = "y" ]; then if [ "${copytoram}" = "y" ]; then
/bin/umount /bootmnt /bin/umount -d /bootmnt
else else
_mnt_bind /bootmnt "${newroot}/bootmnt" _mnt_bind /bootmnt "${newroot}/bootmnt"
fi fi

View file

@ -248,7 +248,7 @@ miso_mount_handler() {
mount -t overlay overlay -olowerdir="${overlayfs:1}",upperdir="/rw_branch/upper",workdir="/rw_branch/work" "${newroot}/" mount -t overlay overlay -olowerdir="${overlayfs:1}",upperdir="/rw_branch/upper",workdir="/rw_branch/work" "${newroot}/"
if [ "${copytoram}" = "y" ]; then if [ "${copytoram}" = "y" ]; then
/bin/umount /bootmnt /bin/umount -d /bootmnt
else else
_mnt_bind /bootmnt "${newroot}/bootmnt" _mnt_bind /bootmnt "${newroot}/bootmnt"
fi fi