From 3634e440447005e4edb605eaf82c29fcf35937b1 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 20 Mar 2014 16:24:49 -0400 Subject: miniprokit.sh: Improve umount kludge. --- diff --git a/miniprokit.sh b/miniprokit.sh index b911f3c..8e8af01 100755 --- a/miniprokit.sh +++ b/miniprokit.sh @@ -324,16 +324,20 @@ cmd_shell() chroot "${root}" /bin/sh printf '\nExiting...\n' - # umount sometimes complains that ${root}/dev is busy. Here's a kludge - # to try to avoid that. - sleep 1 case "$(cat "${root}/etc/proteanos_arch")" in *'-linux-'*) umount "${root}/dev/pts" umount "${root}/proc" umount "${root}/sys" - umount "${root}/dev" + while ! umount "${root}/dev"; do + # umount sometimes complains that ${root}/dev is + # busy. Here's a kludge to try to handle that. + # This is a bind mount, so we better make sure + # it gets unmounted; otherwise, `rm -Rf ${root}` + # can be painful. + sleep 1 + done ;; esac } -- cgit v0.9.1