aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-01-09 01:22:32 -0500
committerDave Reisner <d@falconindy.com>2010-01-09 01:22:32 -0500
commitfd822d545c149553fb1f560720bae1fb44098250 (patch)
treed761fb0a9b285de75fca8a48f143dc898efda165
parentfa63376d5e91cd125e2c03b3c9a06c188af29dd0 (diff)
downloadsquashfu-fd822d545c149553fb1f560720bae1fb44098250.tar.gz
Lots of bug fixes
-rwxr-xr-xsquashfu11
1 files changed, 8 insertions, 3 deletions
diff --git a/squashfu b/squashfu
index 9228831..acb7e74 100755
--- a/squashfu
+++ b/squashfu
@@ -90,6 +90,8 @@ do_backup () {
mv "$SEED.replace" "$SEED"
}
+ cd "$BKUP_ROOT" && mkdir -p {rw,ro,bins/{1,2,3,4,5,6,7}}
+
unmount_all
[[ $REPORT ]] && query_usage full
@@ -120,7 +122,7 @@ mount_union_ro () {
branches="${branches}${BKUP_ROOT}/ro=ro"
# build and execute mount command
- debug "Mounting union as entirely read only through branch $1"
+ debug "mount -t aufs none "${MOUNT_POINT}" -o udba=reval,$branches"
mount -t aufs none "${MOUNT_POINT}" -o udba=reval,$branches
}
@@ -189,13 +191,14 @@ unmount_custom () {
while read mount; do
umount $mount
done < /tmp/squashfu.custom;
+ rm /tmp/squashfu.custom;
}
}
unmount_seed () {
# Account for possibility of multiple mounts
debug "Checking for and unmounting seed"
- while [[ $(mountpoint -q "${BKUP_ROOT}/ro") ]]; do
+ while [[ $(mountpoint "${BKUP_ROOT}/ro" | grep "is a mount") ]]; do
umount "${SEED}"
done
}
@@ -203,7 +206,7 @@ unmount_seed () {
unmount_union () {
# Account for possibility of multiple mounts
debug "Checking for and unmounting union"
- while [[ $(mountpoint -q "${BKUP_ROOT}/rw") ]]; do
+ while [[ $(mountpoint "${BKUP_ROOT}/rw" | grep "is a mount") ]]; do
debug "Found mount, attempting to unmount..."
umount "${BKUP_ROOT}/rw"
done
@@ -317,6 +320,8 @@ dispatch_rollback () {
unmount_custom
unmount_union
+ mount_seed
+
# Convert day to numerical day of week and mount
mount_union_ro $(date --date=$1 +%u) $2
}