diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-15 11:15:11 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-15 11:15:11 -0500 |
commit | 812e2c7f19ea39a3195d7ba5af64717cc07dd237 (patch) | |
tree | 12e615ec7a678c030f0a3270651ddedb54969555 | |
parent | c53556525976ce4d80c8e25b4c55c4774090e30e (diff) | |
parent | 16851c48d41fc4931317ad3764116993fc8adda8 (diff) | |
download | squashfu-812e2c7f19ea39a3195d7ba5af64717cc07dd237.tar.gz |
Merge branch 'directsquash'
-rwxr-xr-x | squashfu | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -24,10 +24,17 @@ create_new_squash () { # Args: number of bins to be squashed (as determined by check_for_resquash), -1 on initial creation # Returns: 0 on success, non-zero on failure - # If making first seed, create it empty and return + # If making first seed, create it directly from source if [[ $1 -eq -1 ]]; then - mksquashfs "$UNION_MOUNT" "$SEED" -b 65536 >/dev/null - return $? + info "Creating seed from sources (this may take a while)" + mksquashfs "${INCLUDES[@]}" "$SEED" -b 65536 -e "${EXCLUDES[@]}" >/dev/null + if [[ $? -eq 0 ]]; then + mount_squash + info "Seed creation finished. It has been mounted at "$SQUASH_MOUNT" if you would like to make sure the proper files are included" + return 0; + else + die "There was an error creating the initial squash." + fi fi # Determine oldest $1 bins and mount them with the current squash @@ -243,7 +250,7 @@ action_backup () { mkdir -p "${BINS_DIR}" touch "$BINVENTORY" create_new_squash -1 - FIRST_RUN=1 + exit 0 fi info "Backup requested at $(date --rfc-3339=seconds)" @@ -257,8 +264,6 @@ action_backup () { check_for_resquash if [[ val=$? -gt 0 ]]; then create_new_squash $val - elif [[ $FIRST_RUN -eq 1 ]]; then - create_new_squash 1 fi # TODO: Report if requested |