aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-05-21 10:30:58 -0400
committerDave Reisner <d@falconindy.com>2010-05-21 10:30:58 -0400
commit30148ad7086233424f76dade5915e40d70ab0eb7 (patch)
tree709b05dacbd6020527ec76cb2641681a6d8f6a15
parent0556c90be68fcc6f24107106b7c6af54f4eb7d0f (diff)
downloadsquashfu-30148ad7086233424f76dade5915e40d70ab0eb7.tar.gz
Revert "mount: streamline the unmount process."
This reverts commit ca3b3c91000d757461fcb7ad13a62b7a2a9d8fb3.
-rwxr-xr-xsquashfu25
1 files changed, 14 insertions, 11 deletions
diff --git a/squashfu b/squashfu
index a233ea4..7ef964b 100755
--- a/squashfu
+++ b/squashfu
@@ -128,9 +128,10 @@ unmount_union () {
# Args: none
# Returns: return code from umount
info "Unmounting union"
-
- $(mountpoint -q "$UNION_MOUNT") && umount "$UNION_MOUNT" 2>/dev/null
-
+ while [[ $(mountpoint "$UNION_MOUNT" | grep "is a mount") ]]; do
+ umount "$UNION_MOUNT" 2>/dev/null
+ sleep 1
+ done
return $?
}
@@ -138,9 +139,10 @@ unmount_squash () {
# Args: none
# Returns: return code from umount
info "Unmounting squash"
-
- $(mountpoint -q "$SQUASH_MOUNT") && umount "$SQUASH_MOUNT" 2>/dev/null
-
+ while [[ $(mountpoint "$SQUASH_MOUNT" | grep "is a mount") ]]; do
+ umount "$SQUASH_MOUNT" 2>/dev/null
+ sleep 1
+ done
return $?
}
@@ -153,7 +155,8 @@ unmount_all () {
fi
# Union MUST be unmounted first
- unmount_union && unmount_squash || die "Failure during unmounting"
+ unmount_union
+ unmount_squash
}
check_for_resquash () {
@@ -227,7 +230,7 @@ action_backup () {
info "Backup requested at $(date --rfc-3339=seconds)"
# Cleanup union, in case user was doing a rollback and forgot to unmount (or error on last run)
- mountpoint -q "$UNION_MOUNT" && unmount_union
+ mountpoint "$UNION_MOUNT" &>/dev/null && unmount_union
info "Creating new bin"
# Make a new bin for this incremenetal
@@ -238,7 +241,7 @@ action_backup () {
# Determine the mount order via binventory
local bin_order=($(sort -n -r -t: -k2 "$BINVENTORY" | cut -d: -f1))
- mountpoint -q "${SQUASH_MOUNT}" || mount_squash
+ mountpoint "${SQUASH_MOUNT}" &>/dev/null || mount_squash
mount_union_with_bins ${bin_order[@]}
# Die with error on mount, else start rsync
@@ -333,8 +336,8 @@ action_rollback () {
local num_to_mount=$(( ${#bin_list[@]} - $1 ))
- mountpoint -q "$UNION_MOUNT" && unmount_union
- mountpoint -q "$SQUASH_MOUNT" || mount_squash
+ mountpoint "$UNION_MOUNT" &>/dev/null && unmount_union
+ mountpoint "$SQUASH_MOUNT" &>/dev/null || mount_squash
mount_union_with_bins ${bin_list[@]:(-$num_to_mount)}