diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-12 14:45:35 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-12 14:45:35 -0500 |
commit | 4c7c89066f5925e0600d6d640843e5db7745455b (patch) | |
tree | 72d2f9c30f4b6083e7982c07ef71c2a94bf71ea0 | |
parent | d8541fedb46a774ba358a2f762ada1df3cadf5d1 (diff) | |
download | squashfu-4c7c89066f5925e0600d6d640843e5db7745455b.tar.gz |
Refer to union mount and squash mount by variables rather than relative to the bkup_root
-rwxr-xr-x | squashfu | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -23,7 +23,7 @@ mount_squash () { # Arguments: none # Returns: return code of mount command debug "Mounting Squash" - mount -o loop,ro "$SEED" "${BKUP_ROOT}/ro" + mount -o loop,ro "$SEED" "$SQUASH_MOUNT" return $? } @@ -39,10 +39,10 @@ mount_union_with_bins () { branches="${branches}${BINS_DIR}/$bin=ro:" done fi - branches="${branches}${BKUP_ROOT}/ro=ro" + branches="${branches}${SQUASH_MOUNT}=ro" - debug "mount -t aufs none "${BKUP_ROOT}/rw" -o udba=reval,$branches" - mount -t aufs none "${BKUP_ROOT}/rw" -o udba=reval,$branches + debug "mount -t aufs none "$UNION_MOUNT" -o udba=reval,$branches" + mount -t aufs none "$UNION_MOUNT" -o udba=reval,$branches return $? } @@ -92,8 +92,8 @@ call_rsync () { # debug ": Options: ${RSYNC_OPTS[@]}" # debug ": Includes: ${INCLUDES[@]}" # debug ": Excludes: ${EXCLUDES[@]}" - debug "rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "${BKUP_ROOT}/rw"" - rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "${BKUP_ROOT}/rw" + debug "rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "$UNION_MOUNT"" + rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "$UNION_MOUNT" return $? } @@ -126,8 +126,8 @@ unmount_union () { # Args: none # Returns: return code from umount debug "Unmounting union" - while [[ $(mountpoint "${BKUP_ROOT}/rw" | grep "is a mount") ]]; do - umount "${BKUP_ROOT}/rw" 2>/dev/null + while [[ $(mountpoint "$UNION_MOUNT" | grep "is a mount") ]]; do + umount "$UNION_MOUNT" 2>/dev/null sleep 1 done return $? @@ -137,8 +137,8 @@ unmount_squash () { # Args: none # Returns: return code from umount debug "Unmounting squash" - while [[ $(mountpoint "${BKUP_ROOT}/ro" | grep "is a mount") ]]; do - umount "${BKUP_ROOT}/ro" 2>/dev/null + while [[ $(mountpoint "$SQUASH_MOUNT" | grep "is a mount") ]]; do + umount "$SQUASH_MOUNT" 2>/dev/null sleep 1 done return $? @@ -172,7 +172,7 @@ create_new_squash () { # If making first seed, create it empty and return if [[ $1 -eq -1 ]]; then - mksquashfs "${BKUP_ROOT}/rw" "$SEED" -b 65536 + mksquashfs "$UNION_MOUNT" "$SEED" -b 65536 return $? fi @@ -184,7 +184,7 @@ create_new_squash () { mount_union_with_bins ${old_bins[@]} # Create new squash with temp name - mksquashfs "${BKUP_ROOT}/rw" "$SEED.replace" -b 65536 + mksquashfs "$UNION_MOUNT" "$SEED.replace" -b 65536 # If the squash wasn't made correctly, we don't want to continue if [[ $? -ne 0 ]]; then @@ -247,8 +247,8 @@ action_backup () { done # If we got here, the user answered yes, so initialize a new structure - mkdir -p "${BKUP_ROOT}/rw" - mkdir -p "${BKUP_ROOT}/ro" + mkdir -p "$UNION_MOUNT" + mkdir -p "$SQUASH_MOUNT" mkdir -p "${BINS_DIR}" touch "$BINVENTORY" create_new_squash -1 @@ -295,7 +295,7 @@ action_rollback () { mount_union_with_bins ${bin_list[@]:(-$num_to_mount)} - info "Union is now mounted at '${BKUP_ROOT}/rw'" + info "Union is now mounted at '$UNION_MOUNT'" } action_report () { |