summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2014-03-20 16:24:49 (EDT)
committer P. J. McDermott <pjm@nac.net>2014-03-20 16:28:22 (EDT)
commit3634e440447005e4edb605eaf82c29fcf35937b1 (patch)
treef8de015ceff946dfeec6a55bd377c275e164c1a0
parent0591711cfb823cf6ee3629e6e9a3f706dbb76419 (diff)
miniprokit.sh: Improve umount kludge.
-rwxr-xr-xminiprokit.sh12
1 files changed, 8 insertions, 4 deletions
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
}