aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-01-08 23:45:33 -0500
committerDave Reisner <d@falconindy.com>2010-01-08 23:45:33 -0500
commiteef98cff5988cc236c5e66c34b35024b150d9904 (patch)
tree45cc2156db0f45128ba5bb0bc91b25b60ffea484
parent79aace04dec31aef79d40c2af69f469535964ae7 (diff)
downloadsquashfu-eef98cff5988cc236c5e66c34b35024b150d9904.tar.gz
Add support for checking custom mounts
-rwxr-xr-xsquashfu15
1 files changed, 13 insertions, 2 deletions
diff --git a/squashfu b/squashfu
index ce14860..b64be64 100755
--- a/squashfu
+++ b/squashfu
@@ -97,6 +97,7 @@ mount_union_ro () {
# Account for second arg from rollback function to mount at a different mountpoint
[[ -n "$2" ]] && {
MOUNT_POINT="$2";
+ echo "$2" >> /tmp/squashfu.custom
} || {
MOUNT_POINT="${BKUP_ROOT}/rw";
}
@@ -166,20 +167,30 @@ run_rsync() {
unmount_all () {
#Union must be unmounted first, or bad things happen
+ unmount_custom
unmount_union
unmount_seed
}
+unmount_custom () {
+ # Unmount any custom mounts from rollback operations
+ [[ -f /tmp/squashfu.custom ]] && {
+ while read mount; do
+ umount $mount
+ done < /tmp/squashfu.custom;
+ }
+}
+
unmount_seed () {
# Account for possibility of multiple mounts
- while [[ $(mountpoint "${BKUP_ROOT}/ro") ]]; do
+ while [[ $(mountpoint -q "${BKUP_ROOT}/ro") ]]; do
umount "${SEED}"
done
}
unmount_union () {
# Account for possibility of multiple mounts
- while [[ $(mountpoint "${BKUP_ROOT}/rw") ]]; do
+ while [[ $(mountpoint -q "${BKUP_ROOT}/rw") ]]; do
umount "${BKUP_ROOT}/rw"
done
}