From c54915e2bc9d471600ae66836ce532266c985dc1 Mon Sep 17 00:00:00 2001 From: Philip Date: Sun, 20 Sep 2015 01:00:54 +0200 Subject: [PATCH] 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. --- initcpio/hooks/miso | 2 +- initcpio/hooks/miso_overlayfs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/initcpio/hooks/miso b/initcpio/hooks/miso index 9ebff4c..eeabd27 100644 --- a/initcpio/hooks/miso +++ b/initcpio/hooks/miso @@ -257,7 +257,7 @@ miso_mount_handler() { done < "${isomounts}" if [ "${copytoram}" = "y" ]; then - /bin/umount /bootmnt + /bin/umount -d /bootmnt else _mnt_bind /bootmnt "${newroot}/bootmnt" fi diff --git a/initcpio/hooks/miso_overlayfs b/initcpio/hooks/miso_overlayfs index 249a669..640542e 100644 --- a/initcpio/hooks/miso_overlayfs +++ b/initcpio/hooks/miso_overlayfs @@ -248,7 +248,7 @@ miso_mount_handler() { mount -t overlay overlay -olowerdir="${overlayfs:1}",upperdir="/rw_branch/upper",workdir="/rw_branch/work" "${newroot}/" if [ "${copytoram}" = "y" ]; then - /bin/umount /bootmnt + /bin/umount -d /bootmnt else _mnt_bind /bootmnt "${newroot}/bootmnt" fi