summaryrefslogtreecommitdiff
blob: a9859f5005ab016a5f3bdb08b392673e266b644b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Fixes errors like "umount: /var/lib/os-prober/mount: target is busy."
which can appear in some corner-cases.

Bug: https://bugzilla.redhat.com/903906

--- a/common.sh
+++ b/common.sh
@@ -336,3 +336,13 @@ linux_mount_boot () {
 
 	mountboot="$bootpart $mounted"
 }
+
+umount_exec=$(which umount)
+umount() {
+	if ! $umount_exec $@ 2> /dev/null; then
+		error "umount error, retrying after 1 sec"
+		sleep 1
+		$umount_exec $@
+	fi
+}
+