projects
/
grml-debootstrap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2be6b79
)
Try unmounting [..]/dev harder
author
Sebastian Pipping
<sebastian@pipping.org>
Tue, 2 Dec 2014 15:02:48 +0000
(16:02 +0100)
committer
Michael Prokop
<mika@grml.org>
Fri, 27 Feb 2015 13:37:08 +0000
(14:37 +0100)
Fixes #41 (GH-41, PR 50)
grml-debootstrap
patch
|
blob
|
history
diff --git
a/grml-debootstrap
b/grml-debootstrap
index
ffcb6aa
..
7a71239
100755
(executable)
--- a/
grml-debootstrap
+++ b/
grml-debootstrap
@@
-1338,6
+1338,26
@@
execute_scripts() {
}
# }}}
}
# }}}
+try_umount() {
+ local tries=$1
+ local mountpoint="$2"
+
+ for (( try=1; try<=tries; try++ )); do
+ if [[ ${try} -eq ${tries} ]]; then
+ # Last time, show errors this time
+ umount "${mountpoint}" && return 0
+ else
+ # Not last time, hide errors until fatal
+ if umount "${mountpoint}" 2>/dev/null ; then
+ return 0
+ else
+ sleep 1
+ fi
+ fi
+ done
+ return 1 # Tried enough
+}
+
# execute chroot-script {{{
chrootscript() {
if ! [ -r "$MNTPOINT/bin/chroot-script" ] ; then
# execute chroot-script {{{
chrootscript() {
if ! [ -r "$MNTPOINT/bin/chroot-script" ] ; then
@@
-1355,7
+1375,7
@@
chrootscript() {
else
chroot "$MNTPOINT" /bin/chroot-script ; RC=$?
fi
else
chroot "$MNTPOINT" /bin/chroot-script ; RC=$?
fi
-
umount
"$MNTPOINT"/dev
+
try_umount 3
"$MNTPOINT"/dev
eend $RC
fi
eend $RC
fi