[Rear-users] SF.net SVN: rear:[687] trunk/usr/share/rear

jhoekx at users.sourceforge.net jhoekx at users.sourceforge.net
Fri Jul 15 08:34:22 CEST 2011


Revision: 687
          http://rear.svn.sourceforge.net/rear/?rev=687&view=rev
Author:   jhoekx
Date:     2011-07-15 06:34:21 +0000 (Fri, 15 Jul 2011)

Log Message:
-----------
Change BUILD_DIR layout to prevent accidental data loss.

Rear itself creates two directories in BUILD_DIR: root/ and tmp/, and rm -rf's them.
Stages can create directories, but have to clean them themselves. Since NETFS and USBFS create their own directories, they will in no case be rm -rf'ed.

BUILD_DIR was previously used as a temporary directory in some scripts. This patch corrects that usage.

Modified Paths:
--------------
    trunk/usr/share/rear/backup/NETFS/default/10_mount_NETFS_path.sh
    trunk/usr/share/rear/backup/NETFS/default/40_create_include_exclude_files.sh
    trunk/usr/share/rear/backup/NETFS/default/50_make_backup.sh
    trunk/usr/share/rear/backup/NETFS/default/98_umount_NETFS_dir.sh
    trunk/usr/share/rear/backup/RSYNC/default/45_calculate_req_space.sh
    trunk/usr/share/rear/backup/RSYNC/default/50_make_rsync_backup.sh
    trunk/usr/share/rear/backup/RSYNC/default/70_copy_backup_log.sh
    trunk/usr/share/rear/conf/GNU/Linux.conf
    trunk/usr/share/rear/lib/framework-functions.sh
    trunk/usr/share/rear/lib/mkdist-workflow.sh
    trunk/usr/share/rear/output/ISO/Linux-i386/30_create_isolinux.sh
    trunk/usr/share/rear/output/ISO/Linux-i386/80_create_isofs.sh
    trunk/usr/share/rear/output/ISO/Linux-ia64/20_mount_bootimg.sh
    trunk/usr/share/rear/output/ISO/Linux-ia64/30_create_bootimg.sh
    trunk/usr/share/rear/output/ISO/Linux-ia64/40_create_local_efi_dir.sh
    trunk/usr/share/rear/output/ISO/Linux-ia64/70_umount_bootimg.sh
    trunk/usr/share/rear/output/ISO/Linux-ia64/80_create_isofs.sh
    trunk/usr/share/rear/output/ISO/Linux-ppc64/30_create_yaboot.sh
    trunk/usr/share/rear/output/ISO/Linux-ppc64/80_create_isofs.sh
    trunk/usr/share/rear/output/PXE/default/80_copy_to_tftp.sh
    trunk/usr/share/rear/output/RSYNC/default/20_make_prefix_dir.sh
    trunk/usr/share/rear/output/RSYNC/default/90_copy_result_files.sh
    trunk/usr/share/rear/output/USB/Linux-i386/10_mount_USB.sh
    trunk/usr/share/rear/output/USB/Linux-i386/83_copy_kernel_initrd.sh
    trunk/usr/share/rear/output/USB/Linux-i386/98_umount_USB.sh
    trunk/usr/share/rear/output/default/20_make_boot_dir.sh
    trunk/usr/share/rear/output/default/94_grub_rescue.sh
    trunk/usr/share/rear/output/default/95_email_result_files.sh
    trunk/usr/share/rear/pack/Debian/ia64/30_copy_kernel.sh
    trunk/usr/share/rear/pack/Fedora/ia64/30_copy_kernel.sh
    trunk/usr/share/rear/pack/GNU/Linux/90_create_initramfs.sh
    trunk/usr/share/rear/pack/Linux-i386/30_copy_kernel.sh
    trunk/usr/share/rear/pack/Linux-ppc64/30_copy_kernel.sh
    trunk/usr/share/rear/restore/RSYNC/default/40_restore_rsync_backup.sh
    trunk/usr/share/rear/restore/RSYNC/default/80_copy_restore_log.sh

Modified: trunk/usr/share/rear/backup/NETFS/default/10_mount_NETFS_path.sh
===================================================================
--- trunk/usr/share/rear/backup/NETFS/default/10_mount_NETFS_path.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/backup/NETFS/default/10_mount_NETFS_path.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -2,6 +2,8 @@
 mkdir -p $v "$BUILD_DIR/netfs" >&2
 StopIfError "Could not mkdir '$BUILD_DIR/netfs'"
 
+AddExitTask "rmdir $v $BUILD_DIR/netfs >&2"
+
 # don't mount anything for tape backups
 if [ "$NETFS_PROTO" == "tape" ]; then
 	return 0

Modified: trunk/usr/share/rear/backup/NETFS/default/40_create_include_exclude_files.sh
===================================================================
--- trunk/usr/share/rear/backup/NETFS/default/40_create_include_exclude_files.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/backup/NETFS/default/40_create_include_exclude_files.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -2,20 +2,20 @@
 
 for k in "${BACKUP_PROG_INCLUDE[@]}" ; do
 	test "$k" && echo "$k"
-done > $BUILD_DIR/backup-include.txt
+done > $TMP_DIR/backup-include.txt
 # add the mountpoints that will be recovered to the backup include list
 while read mountpoint device junk ; do
 	if ! IsInArray "$mountpoint" "${EXCLUDE_MOUNTPOINTS[@]}" ; then
 		echo "$mountpoint"
 	fi
-done <"$VAR_DIR/recovery/mountpoint_device" >> $BUILD_DIR/backup-include.txt
+done <"$VAR_DIR/recovery/mountpoint_device" >> $TMP_DIR/backup-include.txt
 
 # exclude list
 for k in "${BACKUP_PROG_EXCLUDE[@]}" ; do
 	test "$k" && echo "$k"
-done > $BUILD_DIR/backup-exclude.txt
+done > $TMP_DIR/backup-exclude.txt
 # add also the excluded mount points to the backup exclude list
 for k in "${EXCLUDE_MOUNTPOINTS[@]}" ; do
 	test "$k" && echo "$k/"
-done >> $BUILD_DIR/backup-exclude.txt
+done >> $TMP_DIR/backup-exclude.txt
 

Modified: trunk/usr/share/rear/backup/NETFS/default/50_make_backup.sh
===================================================================
--- trunk/usr/share/rear/backup/NETFS/default/50_make_backup.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/backup/NETFS/default/50_make_backup.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -4,11 +4,11 @@
 Log "Include list:"
 while read -r ; do
 	Log "  $REPLY"
-done < $BUILD_DIR/backup-include.txt
+done < $TMP_DIR/backup-include.txt
 Log "Exclude list:"
 while read -r ; do
 	Log " $REPLY"
-done < $BUILD_DIR/backup-exclude.txt
+done < $TMP_DIR/backup-exclude.txt
 
 mkdir -p $v "${BUILD_DIR}/netfs/${NETFS_PREFIX}" >&2
 
@@ -20,24 +20,24 @@
 	(tar)
 		$BACKUP_PROG --sparse --block-number --totals --verbose --no-wildcards-match-slash --one-file-system --ignore-failed-read \
 			$BACKUP_PROG_OPTIONS ${BACKUP_PROG_BLOCKS:+-b $BACKUP_PROG_BLOCKS} $BACKUP_PROG_COMPRESS_OPTIONS \
-			-X $BUILD_DIR/backup-exclude.txt -C / -c -f "$backuparchive" \
-			$(cat $BUILD_DIR/backup-include.txt) $LOGFILE
+			-X $TMP_DIR/backup-exclude.txt -C / -c -f "$backuparchive" \
+			$(cat $TMP_DIR/backup-include.txt) $LOGFILE
 	;;
 	(rsync)
 		# make sure that the target is a directory
 		mkdir -p $v "$backuparchive" >&2
 		$BACKUP_PROG --sparse --archive --hard-links --one-file-system --verbose --delete --numeric-ids \
-			--exclude-from=$BUILD_DIR/backup-exclude.txt --delete-excluded \
-			$(cat $BUILD_DIR/backup-include.txt) "$backuparchive"
+			--exclude-from=$TMP_DIR/backup-exclude.txt --delete-excluded \
+			$(cat $TMP_DIR/backup-include.txt) "$backuparchive"
 	;;
 	(*)
 		Log "Using unsupported backup program '$BACKUP_PROG'"
 		$BACKUP_PROG $BACKUP_PROG_COMPRESS_OPTIONS \
-			$BACKUP_PROG_OPTIONS_CREATE_ARCHIVE $BUILD_DIR/backup-exclude.txt \
+			$BACKUP_PROG_OPTIONS_CREATE_ARCHIVE $TMP_DIR/backup-exclude.txt \
 			$BACKUP_PROG_OPTIONS $backuparchive \
-			$(cat $BUILD_DIR/backup-include.txt) $LOGFILE > $backuparchive
+			$(cat $TMP_DIR/backup-include.txt) $LOGFILE > $backuparchive
 	;;
-esac >"${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log"
+esac >"${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log"
 # important trick: the backup prog is the last in each case entry and the case .. esac is the last command
 # in the (..) subshell. As a result the return code of the subshell is the return code of the backup prog!
 ) &
@@ -55,7 +55,7 @@
 case "$BACKUP_PROG" in
 	(tar)
 		while sleep 1 ; kill -0 $BackupPID 2>&8; do
-			blocks="$(tail -1 ${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log | awk 'BEGIN { FS="[ :]" } /^block [0-9]+: / { print $2 }')"
+			blocks="$(tail -1 ${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log | awk 'BEGIN { FS="[ :]" } /^block [0-9]+: / { print $2 }')"
 			size="$((blocks*512))"
 			#echo -en "\e[2K\rArchived $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec]"
 			echo "INFO Archived $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec]" >&8
@@ -115,4 +115,4 @@
 fi
 
 ### Copy progress log to backup media
-cp $v "${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log" "${BUILD_DIR}/netfs/${NETFS_PREFIX}/${BACKUP_PROG_ARCHIVE}.log" >&2
+cp $v "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log" "${BUILD_DIR}/netfs/${NETFS_PREFIX}/${BACKUP_PROG_ARCHIVE}.log" >&2

Modified: trunk/usr/share/rear/backup/NETFS/default/98_umount_NETFS_dir.sh
===================================================================
--- trunk/usr/share/rear/backup/NETFS/default/98_umount_NETFS_dir.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/backup/NETFS/default/98_umount_NETFS_dir.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -14,5 +14,8 @@
 fi
 StopIfError "Could not unmount directory ${BUILD_DIR}/netfs"
 
+rmdir $v $BUILD_DIR/netfs >&2
+
 # the argument to RemoveExitTask has to be identical to the one given to AddExitTask
 RemoveExitTask "umount -f $v '$BUILD_DIR/netfs' >&2"
+RemoveExitTask "rmdir $v $BUILD_DIR/netfs >&2"
\ No newline at end of file

Modified: trunk/usr/share/rear/backup/RSYNC/default/45_calculate_req_space.sh
===================================================================
--- trunk/usr/share/rear/backup/RSYNC/default/45_calculate_req_space.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/backup/RSYNC/default/45_calculate_req_space.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -8,7 +8,7 @@
 	StopIfError "Failed to determine size of ${REPLY}."
 	fs_size=$(tail -n 1 $TMP_DIR/fs_size | awk '{print $3}')
 	_local_size=$((_local_size+fs_size))
-done < $BUILD_DIR/backup-include.txt
+done < $TMP_DIR/backup-include.txt
 LogPrint "Estimated size of local file systems is $((_local_size/1024)) MB"
 
 case $RSYNC_PROTO in

Modified: trunk/usr/share/rear/backup/RSYNC/default/50_make_rsync_backup.sh
===================================================================
--- trunk/usr/share/rear/backup/RSYNC/default/50_make_rsync_backup.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/backup/RSYNC/default/50_make_rsync_backup.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -3,11 +3,11 @@
 Log "Include list:"
 while read -r ; do
 	Log "  $REPLY"
-done < $BUILD_DIR/backup-include.txt
+done < $TMP_DIR/backup-include.txt
 Log "Exclude list:"
 while read -r ; do
 	Log " $REPLY"
-done < $BUILD_DIR/backup-exclude.txt
+done < $TMP_DIR/backup-exclude.txt
 
 LogPrint "Creating $BACKUP_PROG archive on '${RSYNC_HOST}:${RSYNC_PATH}'"
 
@@ -16,18 +16,18 @@
 	case "$(basename $BACKUP_PROG)" in
 
 		(rsync)
-			RSYNC_OPTIONS=( "${RSYNC_OPTIONS[@]}" --one-file-system --delete --exclude-from=$BUILD_DIR/backup-exclude.txt --delete-excluded )
+			RSYNC_OPTIONS=( "${RSYNC_OPTIONS[@]}" --one-file-system --delete --exclude-from=$TMP_DIR/backup-exclude.txt --delete-excluded )
 
 			case $RSYNC_PROTO in
 
 				(ssh)
-					Log $BACKUP_PROG "${RSYNC_OPTIONS[@]}" $(cat $BUILD_DIR/backup-include.txt) "${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/backup"
-					$BACKUP_PROG "${RSYNC_OPTIONS[@]}" $(cat $BUILD_DIR/backup-include.txt) \
+					Log $BACKUP_PROG "${RSYNC_OPTIONS[@]}" $(cat $TMP_DIR/backup-include.txt) "${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/backup"
+					$BACKUP_PROG "${RSYNC_OPTIONS[@]}" $(cat $TMP_DIR/backup-include.txt) \
 					"${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/backup"  #2>/dev/null
 					;;
 
 				(rsync)
-					$BACKUP_PROG "${RSYNC_OPTIONS[@]}" $(cat $BUILD_DIR/backup-include.txt) \
+					$BACKUP_PROG "${RSYNC_OPTIONS[@]}" $(cat $TMP_DIR/backup-include.txt) \
 					"${RSYNC_PROTO}://${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PORT}/${RSYNC_PATH}/${RSYNC_PREFIX}/backup"
 					;;
 
@@ -40,8 +40,8 @@
 			;;
 
 	esac
-	echo $? >$BUILD_DIR/retval
-) >"${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log" &
+	echo $? >$TMP_DIR/retval
+) >"${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log" &
 BackupPID=$!
 starttime=$SECONDS
 
@@ -83,8 +83,8 @@
 			;;
 
 			* )
-			nfile="$(tail -1 "${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log")"
-			#fsize="$(get_size $(tail -1 "${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log"))"
+			nfile="$(tail -1 "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log")"
+			#fsize="$(get_size $(tail -1 "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log"))"
 			[[ "$nfile" != "$ofile" ]] && {
 				fsize="$(get_size "$nfile")"
 				size=$((size+fsize))
@@ -110,7 +110,7 @@
 wait $BackupPID
 
 transfertime="$((SECONDS-starttime))"
-_rc="$(cat $BUILD_DIR/retval)"
+_rc="$(cat $TMP_DIR/retval)"
 
 sleep 1
 # everyone should see this warning, even if not verbose
@@ -124,7 +124,7 @@
 
 "
 
-_message="$(tail -14 ${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log)"
+_message="$(tail -14 ${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log)"
 if [ $_rc -eq 0 -a "$_message" ] ; then
 	LogPrint "$_message in $transfertime seconds."
 elif [ "$size" ]; then

Modified: trunk/usr/share/rear/backup/RSYNC/default/70_copy_backup_log.sh
===================================================================
--- trunk/usr/share/rear/backup/RSYNC/default/70_copy_backup_log.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/backup/RSYNC/default/70_copy_backup_log.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -2,20 +2,20 @@
 Timestamp=$(date +%Y%m%d.%H%M)
 
 # compress the log file first
-gzip "${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log"
-StopIfError "Could not gzip ${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log"
+gzip "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log"
+StopIfError "Could not gzip ${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log"
 
 case $RSYNC_PROTO in
 
 	(ssh)
-		$BACKUP_PROG -a "${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log.gz" \
+		$BACKUP_PROG -a "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log.gz" \
 		"${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/${BACKUP_PROG_ARCHIVE}-${Timestamp}.log.gz" 2>&8
 
 		$BACKUP_PROG -a "$LOGFILE" "${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/rear-${Timestamp}.log" 2>&8
 		;;
 
 	(rsync)
-		$BACKUP_PROG -a "${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}.log.gz" \
+		$BACKUP_PROG -a "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log.gz" \
 		"${RSYNC_PROTO}://${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PORT}/${RSYNC_PATH}/${RSYNC_PREFIX}/${BACKUP_PROG_ARCHIVE}-${Timestamp}.log.gz"
 
 		$BACKUP_PROG -a "$LOGFILE" "${RSYNC_PROTO}://${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PORT}/${RSYNC_PATH}/${RSYNC_PREFIX}//rear-${Timestamp}.log"

Modified: trunk/usr/share/rear/conf/GNU/Linux.conf
===================================================================
--- trunk/usr/share/rear/conf/GNU/Linux.conf	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/conf/GNU/Linux.conf	2011-07-15 06:34:21 UTC (rev 687)
@@ -37,6 +37,7 @@
 wc
 cut
 rm
+rmdir
 test
 init
 telinit

Modified: trunk/usr/share/rear/lib/framework-functions.sh
===================================================================
--- trunk/usr/share/rear/lib/framework-functions.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/lib/framework-functions.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -92,7 +92,9 @@
 		LogPrint "You should also rm -Rf $BUILD_DIR"
 	else
 		Log "Removing build area $BUILD_DIR"
-		rm -Rf $BUILD_DIR
+		rm -Rf $TMP_DIR
+		rm -Rf $ROOTFS_DIR
+		rmdir $v $BUILD_DIR >&2
 	fi
 	Log "End of program reached"
 }

Modified: trunk/usr/share/rear/lib/mkdist-workflow.sh
===================================================================
--- trunk/usr/share/rear/lib/mkdist-workflow.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/lib/mkdist-workflow.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -85,8 +85,8 @@
 	distarchive="/tmp/$prod_ver.tar.gz"
 	LogPrint "Creating archive '$distarchive'"
 
-	mkdir $BUILD_DIR/$prod_ver -v >&8
-	StopIfError "Could not mkdir $BUILD_DIR/$prod_ver"
+	mkdir $TMP_DIR/$prod_ver -v >&8
+	StopIfError "Could not mkdir $TMP_DIR/$prod_ver"
 
 	# use tar to copy the current rear while excluding development and obsolete files
 	tar -C / --exclude=hpasmcliOutput.txt --exclude=\*~ --exclude=\*.rpmsave\* \
@@ -94,16 +94,16 @@
 			"$SHARE_DIR" \
 			"$CONFIG_DIR" \
 			"$(get_path "$0")" |\
-		tar -C $BUILD_DIR/$prod_ver -x >&8
-	StopIfError "Could not copy files to $BUILD_DIR/$prod_ver"
+		tar -C $TMP_DIR/$prod_ver -x >&8
+	StopIfError "Could not copy files to $TMP_DIR/$prod_ver"
 
-	pushd $BUILD_DIR/$prod_ver >&8
-	StopIfError "Could not pushd $BUILD_DIR/$prod_ver"
+	pushd $TMP_DIR/$prod_ver >&8
+	StopIfError "Could not pushd $TMP_DIR/$prod_ver"
 
 	WORKFLOW_mkdist_postprocess
 
 	popd >&8
-	tar -C $BUILD_DIR -cvzf $distarchive $prod_ver >&8
+	tar -C $TMP_DIR -cvzf $distarchive $prod_ver >&8
 	StopIfError "Could not create $distarchive"
 
 }

Modified: trunk/usr/share/rear/output/ISO/Linux-i386/30_create_isolinux.sh
===================================================================
--- trunk/usr/share/rear/output/ISO/Linux-i386/30_create_isolinux.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/ISO/Linux-i386/30_create_isolinux.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -1,12 +1,12 @@
 set_syslinux_features
 
-cp -L $v "$ISO_ISOLINUX_BIN" $BUILD_DIR/boot/isolinux.bin >&2
+cp -L $v "$ISO_ISOLINUX_BIN" $TMP_DIR/boot/isolinux.bin >&2
 
-make_syslinux_config $BUILD_DIR/boot isolinux >$BUILD_DIR/boot/isolinux.cfg
+make_syslinux_config $TMP_DIR/boot isolinux >$TMP_DIR/boot/isolinux.cfg
 
 Log "Created isolinux configuration"
 
 # add all files that we need for booting to ISO_FILES
-ISO_FILES=( "${ISO_FILES[@]}" $BUILD_DIR/boot/* )
+ISO_FILES=( "${ISO_FILES[@]}" $TMP_DIR/boot/* )
 
 

Modified: trunk/usr/share/rear/output/ISO/Linux-i386/80_create_isofs.sh
===================================================================
--- trunk/usr/share/rear/output/ISO/Linux-i386/80_create_isofs.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/ISO/Linux-i386/80_create_isofs.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -23,9 +23,9 @@
 StopIfError "ISO_MKISOFS_BIN [$ISO_MKISOFS_BIN] not an executabel !"
 
 Log "Copying kernel"
-cp -pL $v $KERNEL_FILE $BUILD_DIR/kernel >&2
+cp -pL $v $KERNEL_FILE $TMP_DIR/kernel >&2
 
-ISO_FILES=( ${ISO_FILES[@]} $BUILD_DIR/kernel $BUILD_DIR/initrd.cgz )
+ISO_FILES=( ${ISO_FILES[@]} $TMP_DIR/kernel $TMP_DIR/initrd.cgz )
 Log "Starting '$ISO_MKISOFS_BIN'"
 LogPrint "Making ISO image"
 

Modified: trunk/usr/share/rear/output/ISO/Linux-ia64/20_mount_bootimg.sh
===================================================================
--- trunk/usr/share/rear/output/ISO/Linux-ia64/20_mount_bootimg.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/ISO/Linux-ia64/20_mount_bootimg.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -1,5 +1,5 @@
 # 20_mount_bootimg.sh
-dd if=/dev/zero of="$BUILD_DIR"/tmp/boot.img count=32000 bs=1024
-mkfs $v -t vfat "$BUILD_DIR"/tmp/boot.img >&2
-mkdir -p $v "$BUILD_DIR"/mnt >&2
-mount $v -o loop -t vfat "$BUILD_DIR"/tmp/boot.img "$BUILD_DIR"/mnt >&2
+dd if=/dev/zero of=$TMP_DIR/boot.img count=32000 bs=1024
+mkfs $v -t vfat $TMP_DIRboot.img >&2
+mkdir -p $v $TMP_DIR/mnt >&2
+mount $v -o loop -t vfat $TMP_DIR/boot.img $TMP_DIR/mnt >&2

Modified: trunk/usr/share/rear/output/ISO/Linux-ia64/30_create_bootimg.sh
===================================================================
--- trunk/usr/share/rear/output/ISO/Linux-ia64/30_create_bootimg.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/ISO/Linux-ia64/30_create_bootimg.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -21,22 +21,22 @@
 # finding elilo.efi is now done in the prep stage, not here.
 # therefore ELILO_BIN for sure contains the full path to elilo.efi
 
-mkdir $v -p $BUILD_DIR/mnt/boot >&2
-cp -L $v "$ELILO_BIN" $BUILD_DIR/mnt/boot >&2
+mkdir $v -p $TMP_DIR/mnt/boot >&2
+cp -L $v "$ELILO_BIN" $TMP_DIR/mnt/boot >&2
 StopIfError "Could not find $ELILO_BIN"
 
-cp $v $BUILD_DIR/initrd.cgz $BUILD_DIR/mnt/boot
+cp $v $TMP_DIR/initrd.cgz $TMP_DIR/mnt/boot
 
 #VMLINUX_KERNEL=`find / -xdev -name "vmlinu*-${KERNEL_VERSION}"`
-#cp "${VMLINUX_KERNEL}" $BUILD_DIR/mnt/boot/kernel
+#cp "${VMLINUX_KERNEL}" $TMP_DIR/mnt/boot/kernel
 
 # KERNEL_FILE is defined in pack/Linux-ia64/30_copy_kernel.sh script
-cp $v "${KERNEL_FILE}" $BUILD_DIR/mnt/boot/kernel >&2
+cp $v "${KERNEL_FILE}" $TMP_DIR/mnt/boot/kernel >&2
 StopIfError "Could not find ${KERNEL_FILE}"
 
-echo "$VERSION_INFO" >$BUILD_DIR/mnt/boot/message
+echo "$VERSION_INFO" >$TMP_DIR/mnt/boot/message
 
-cat >"$BUILD_DIR/mnt/boot/elilo.conf" <<EOF
+cat >"$TMP_DIR/mnt/boot/elilo.conf" <<EOF
 prompt
 timeout=50
 

Modified: trunk/usr/share/rear/output/ISO/Linux-ia64/40_create_local_efi_dir.sh
===================================================================
--- trunk/usr/share/rear/output/ISO/Linux-ia64/40_create_local_efi_dir.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/ISO/Linux-ia64/40_create_local_efi_dir.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -5,5 +5,5 @@
 # set the variable in config file /etc/rear/Linux-ia64.conf
 [ CREATE_LOCAL_EFI_DIR = false ] && return
 [ ! -f /boot/efi/efi/rear ] && mkdir -p /boot/efi/efi/rear
-cp $v $BUILD_DIR/mnt/boot/* /boot/efi/efi/rear/ >&2
+cp $v $TMP_DIR/mnt/boot/* /boot/efi/efi/rear/ >&2
 Log "Populated the local EFI boot directory /boot/efi/efi/rear"

Modified: trunk/usr/share/rear/output/ISO/Linux-ia64/70_umount_bootimg.sh
===================================================================
--- trunk/usr/share/rear/output/ISO/Linux-ia64/70_umount_bootimg.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/ISO/Linux-ia64/70_umount_bootimg.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -1,3 +1,3 @@
 # 90_umount_bootimg.sh
-umount $v "$BUILD_DIR"/tmp/boot.img >&2
-#rm -f $v "$BUILD_DIR"/tmp/boot.img >&2
+umount $v $TMP_DIR/boot.img >&2
+#rm -f $v $TMP_DIR/boot.img >&2

Modified: trunk/usr/share/rear/output/ISO/Linux-ia64/80_create_isofs.sh
===================================================================
--- trunk/usr/share/rear/output/ISO/Linux-ia64/80_create_isofs.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/ISO/Linux-ia64/80_create_isofs.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -29,15 +29,15 @@
 mkdir -p $v "$ISO_DIR" >&2
 StopIfError "Could not create ISO ouput directory ($ISO_DIR)"
 
-# move "$BUILD_DIR"/tmp/boot.img to $BUILD_DIR/isofs/boot
-mkdir -p $v "$BUILD_DIR/isofs" >&2
-mkdir -p $v "$BUILD_DIR/isofs/boot" >&2
-mv -f $v "$BUILD_DIR"/tmp/boot.img "$BUILD_DIR/isofs/boot" >&2
-pushd $BUILD_DIR/isofs >&8 # so that relative paths will work
+# move $TMP_DIR/boot.img to $TMP_DIR/isofs/boot
+mkdir -p $v "$TMP_DIR/isofs" >&2
+mkdir -p $v "$TMP_DIR/isofs/boot" >&2
+mv -f $v $TMP_DIR/boot.img "$TMP_DIR/isofs/boot" >&2
+pushd $TMP_DIR/isofs >&8 # so that relative paths will work
 $ISO_MKISOFS_BIN -o "$ISO_DIR/$ISO_PREFIX.iso" -b boot/boot.img -c boot/monboot.catalogi -pad \
 	-no-emul-boot -boot-load-size 4 -boot-info-table \
 	-R -J -volid "$ISO_VOLID" -v . >&8
-	#-R -J -volid "$ISO_VOLID" -v "$BUILD_DIR/isofs"  >&8
+	#-R -J -volid "$ISO_VOLID" -v "$TMP_DIR/isofs"  >&8
 	#-R -J -volid "$ISO_VOLID" -v "${ISO_FILES[@]}"  >&8
 StopIfError "Could not create ISO image"
 

Modified: trunk/usr/share/rear/output/ISO/Linux-ppc64/30_create_yaboot.sh
===================================================================
--- trunk/usr/share/rear/output/ISO/Linux-ppc64/30_create_yaboot.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/ISO/Linux-ppc64/30_create_yaboot.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -19,10 +19,10 @@
 #
 
 # create yaboot directory structure
-mkdir -p $v $BUILD_DIR/ppc >&2
-cp $v /usr/lib/yaboot/yaboot $BUILD_DIR/ppc/chrp >&2
+mkdir -p $v $TMP_DIR/ppc >&2
+cp $v /usr/lib/yaboot/yaboot $TMP_DIR/ppc/chrp >&2
 
-cat >"$BUILD_DIR/ppc/bootinfo.txt" <<EOF
+cat >"$TMP_DIR/ppc/bootinfo.txt" <<EOF
 <chrp-boot>
 <description>Rear</description>
 <os-name>Linux</os-name>
@@ -30,8 +30,8 @@
 </chrp-boot>
 EOF
 
-mkdir -p $v $BUILD_DIR/etc >&2
-cat >"$BUILD_DIR/etc/yaboot.conf" <<EOF
+mkdir -p $v $TMP_DIR/etc >&2
+cat >"$TMP_DIR/etc/yaboot.conf" <<EOF
 init-message = "\nRear boot\n\n"
 timeout=100
 default=Rear

Modified: trunk/usr/share/rear/output/ISO/Linux-ppc64/80_create_isofs.sh
===================================================================
--- trunk/usr/share/rear/output/ISO/Linux-ppc64/80_create_isofs.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/ISO/Linux-ppc64/80_create_isofs.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -29,7 +29,7 @@
 mkdir -p $v "$ISO_DIR" >&2
 StopIfError "Could not create ISO ouput directory ($ISO_DIR)"
 
-pushd $BUILD_DIR >&8 # so that relative paths will work
+pushd $TMP_DIR >&8 # so that relative paths will work
 $ISO_MKISOFS_BIN -o "$ISO_DIR/$ISO_PREFIX.iso" -U -chrp-boot \
 	-R -J -volid "$ISO_VOLID" -v -graft-points "${ISO_FILES[@]}" >&8
 StopIfError "Could not create ISO image"

Modified: trunk/usr/share/rear/output/PXE/default/80_copy_to_tftp.sh
===================================================================
--- trunk/usr/share/rear/output/PXE/default/80_copy_to_tftp.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/PXE/default/80_copy_to_tftp.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -26,13 +26,13 @@
 
 
 cp -pL $v "$KERNEL_FILE" "$PXE_TFTP_LOCAL_PATH/$PXE_KERNEL" >&2
-cp -a $v "$BUILD_DIR"/initrd.cgz "$PXE_TFTP_LOCAL_PATH/$PXE_INITRD" >&2
+cp -a $v "$TMP_DIR"/initrd.cgz "$PXE_TFTP_LOCAL_PATH/$PXE_INITRD" >&2
 
 echo "$VERSION_INFO" >"$PXE_TFTP_LOCAL_PATH/$PXE_MESSAGE"
 
 # TODO: umount remote TFTP path
 
-LogPrint "Copied kernel+initrd ($(du -shc $KERNEL_FILE "$BUILD_DIRinitrd.cgz"} | tail -n 1 | tr -s "\t " " " | cut -d " " -f 1 )) to $PXE_TFTP_PATH"
+LogPrint "Copied kernel+initrd ($(du -shc $KERNEL_FILE "$TMP_DIR/initrd.cgz"} | tail -n 1 | tr -s "\t " " " | cut -d " " -f 1 )) to $PXE_TFTP_PATH"
 
 # Add to result files
 RESULT_FILES=( "${RESULT_FILES[@]}" "$PXE_TFTP_LOCAL_PATH/$PXE_KERNEL" "$PXE_TFTP_LOCAL_PATH/$PXE_INITRD" "$PXE_TFTP_LOCAL_PATH/$PXE_MESSAGE" )

Modified: trunk/usr/share/rear/output/RSYNC/default/20_make_prefix_dir.sh
===================================================================
--- trunk/usr/share/rear/output/RSYNC/default/20_make_prefix_dir.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/RSYNC/default/20_make_prefix_dir.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -1,21 +1,21 @@
-# Create RSYNC_PREFIX under the local BUILD_DIR and also on remote rsync server
+# Create RSYNC_PREFIX under the local TMP_DIR and also on remote rsync server
 # RSYNC_PREFIX=$(uname -n) as set in default.conf
 
 # create temporary local work-spaces to collect files (we already make the remote backup dir with the correct mode!!)
-mkdir -p $v -m0750 "${BUILD_DIR}/rsync/${RSYNC_PREFIX}" >&2
-StopIfError "Could not mkdir '${BUILD_DIR}/rsync/${RSYNC_PREFIX}'"
-mkdir -p $v -m0755 "${BUILD_DIR}/rsync/${RSYNC_PREFIX}/backup" >&2
-StopIfError "Could not mkdir '${BUILD_DIR}/rsync/${RSYNC_PREFIX}/backup'"
+mkdir -p $v -m0750 "${TMP_DIR}/rsync/${RSYNC_PREFIX}" >&2
+StopIfError "Could not mkdir '${TMP_DIR}/rsync/${RSYNC_PREFIX}'"
+mkdir -p $v -m0755 "${TMP_DIR}/rsync/${RSYNC_PREFIX}/backup" >&2
+StopIfError "Could not mkdir '${TMP_DIR}/rsync/${RSYNC_PREFIX}/backup'"
 
 case $RSYNC_PROTO in
 
 	(ssh)
-		$BACKUP_PROG -a $v -r "${BUILD_DIR}/rsync/${RSYNC_PREFIX}" "${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}" >&8 2>&1
+		$BACKUP_PROG -a $v -r "${TMP_DIR}/rsync/${RSYNC_PREFIX}" "${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}" >&8 2>&1
 		StopIfError "Could not create '${RSYNC_PATH}/${RSYNC_PREFIX}' on remote ${RSYNC_HOST}"
 		;;
 
 	(rsync)
-		$BACKUP_PROG -a $v -r "${BUILD_DIR}/rsync/${RSYNC_PREFIX}" "${RSYNC_PROTO}://${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PORT}/${RSYNC_PATH}/" >&8
+		$BACKUP_PROG -a $v -r "${TMP_DIR}/rsync/${RSYNC_PREFIX}" "${RSYNC_PROTO}://${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PORT}/${RSYNC_PATH}/" >&8
 		StopIfError "Could not create '${RSYNC_PATH}/${RSYNC_PREFIX}' on remote ${RSYNC_HOST}"
 		;;
 

Modified: trunk/usr/share/rear/output/RSYNC/default/90_copy_result_files.sh
===================================================================
--- trunk/usr/share/rear/output/RSYNC/default/90_copy_result_files.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/RSYNC/default/90_copy_result_files.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -6,29 +6,29 @@
 # if called as mkbackuponly then we just don't have any result files.
 if test "$RESULT_FILES" ; then
 	Log "Copying files '${RESULT_FILES[@]}' to $RSYNC_URL location"
-	cp $v "${RESULT_FILES[@]}" "${BUILD_DIR}/rsync/${RSYNC_PREFIX}/" >&2
+	cp $v "${RESULT_FILES[@]}" "${TMP_DIR}/rsync/${RSYNC_PREFIX}/" >&2
 	StopIfError "Could not copy files to local rsync location"
 fi
 
-echo "$VERSION_INFO" >"${BUILD_DIR}/rsync/${RSYNC_PREFIX}/VERSION"
+echo "$VERSION_INFO" >"${TMP_DIR}/rsync/${RSYNC_PREFIX}/VERSION"
 StopIfError "Could not create VERSION file on local rsync location"
 
-cp $v $CONFIG_DIR/templates/RESULT_usage_$OUTPUT.txt "${BUILD_DIR}/rsync/${RSYNC_PREFIX}/README" >&2
+cp $v $CONFIG_DIR/templates/RESULT_usage_$OUTPUT.txt "${TMP_DIR}/rsync/${RSYNC_PREFIX}/README" >&2
 StopIfError "Could not copy usage file to local rsync location"
 
-cat "$LOGFILE" >"${BUILD_DIR}/rsync/${RSYNC_PREFIX}/rear.log"
+cat "$LOGFILE" >"${TMP_DIR}/rsync/${RSYNC_PREFIX}/rear.log"
 StopIfError "Could not copy $LOGFILE to local rsync location"
 
 case $RSYNC_PROTO in
 
 	(ssh)
-		Log "$BACKUP_PROG -a ${BUILD_DIR}/rsync/${RSYNC_PREFIX}/ ${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/"
-		$BACKUP_PROG -a "${BUILD_DIR}/rsync/${RSYNC_PREFIX}/" "${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/" 2>&8
+		Log "$BACKUP_PROG -a ${TMP_DIR}/rsync/${RSYNC_PREFIX}/ ${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/"
+		$BACKUP_PROG -a "${TMP_DIR}/rsync/${RSYNC_PREFIX}/" "${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PATH}/${RSYNC_PREFIX}/" 2>&8
 		;;
 
 	(rsync)
-		Log "$BACKUP_PROG -a ${BUILD_DIR}/rsync/${RSYNC_PREFIX}/ ${RSYNC_PROTO}://${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PORT}/${RSYNC_PATH}/${RSYNC_PREFIX}/"
-		$BACKUP_PROG -a "${BUILD_DIR}/rsync/${RSYNC_PREFIX}/" "${RSYNC_PROTO}://${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PORT}/${RSYNC_PATH}/${RSYNC_PREFIX}/"
+		Log "$BACKUP_PROG -a ${TMP_DIR}/rsync/${RSYNC_PREFIX}/ ${RSYNC_PROTO}://${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PORT}/${RSYNC_PATH}/${RSYNC_PREFIX}/"
+		$BACKUP_PROG -a "${TMP_DIR}/rsync/${RSYNC_PREFIX}/" "${RSYNC_PROTO}://${RSYNC_USER}@${RSYNC_HOST}:${RSYNC_PORT}/${RSYNC_PATH}/${RSYNC_PREFIX}/"
 		;;
 
 esac

Modified: trunk/usr/share/rear/output/USB/Linux-i386/10_mount_USB.sh
===================================================================
--- trunk/usr/share/rear/output/USB/Linux-i386/10_mount_USB.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/USB/Linux-i386/10_mount_USB.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -2,6 +2,7 @@
 if [[ ! -d "$BUILD_DIR/usbfs" ]]; then
 	mkdir -p $v "$BUILD_DIR/usbfs" >&2
 	StopIfError "Could not mkdir '$BUILD_DIR/usbfs'"
+	AddExitTask "rmdir $v $BUILD_DIR/usbfs >&2"
 fi
 
 # if a mount command is given, use that instead

Modified: trunk/usr/share/rear/output/USB/Linux-i386/83_copy_kernel_initrd.sh
===================================================================
--- trunk/usr/share/rear/output/USB/Linux-i386/83_copy_kernel_initrd.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/USB/Linux-i386/83_copy_kernel_initrd.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -4,7 +4,7 @@
 cp -pL $v "$KERNEL_FILE" "$BUILD_DIR/usbfs/$USB_PREFIX/kernel" >&2
 StopIfError "Could not create $BUILD_DIR/usbfs/$USB_PREFIX/kernel"
 
-cp -p $v "$BUILD_DIR/initrd.cgz" "$BUILD_DIR/usbfs/$USB_PREFIX/initrd.cgz" >&2
+cp -p $v "$TMP_DIR/initrd.cgz" "$BUILD_DIR/usbfs/$USB_PREFIX/initrd.cgz" >&2
 StopIfError "Could not create $BUILD_DIR/usbfs/$USB_PREFIX/initrd.cgz"
 
 Log "Copied kernel and initrd.cgz to $USB_PREFIX"

Modified: trunk/usr/share/rear/output/USB/Linux-i386/98_umount_USB.sh
===================================================================
--- trunk/usr/share/rear/output/USB/Linux-i386/98_umount_USB.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/USB/Linux-i386/98_umount_USB.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -9,5 +9,8 @@
 fi
 StopIfError "Could not unmount directory ${BUILD_DIR}/usbfs"
 
+rmdir $v $BUILD_DIR/usbfs >&2
+
 # argument to RemoveExitTask must be identical to AddExitTask
 RemoveExitTask "umount -f $v '$BUILD_DIR/usbfs' >&2"
+RemoveExitTask "rmdir $v $BUILD_DIR/usbfs >&2"
\ No newline at end of file

Modified: trunk/usr/share/rear/output/default/20_make_boot_dir.sh
===================================================================
--- trunk/usr/share/rear/output/default/20_make_boot_dir.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/default/20_make_boot_dir.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -1,3 +1,3 @@
 # create dir to keep all the boot files (besides kernel and initrd)
-mkdir -p $v "$BUILD_DIR/boot" >&2
-StopIfError "Could not mkdir $BUILD_DIR/boot"
+mkdir -p $v "$TMP_DIR/boot" >&2
+StopIfError "Could not mkdir $TMP_DIR/boot"

Modified: trunk/usr/share/rear/output/default/94_grub_rescue.sh
===================================================================
--- trunk/usr/share/rear/output/default/94_grub_rescue.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/default/94_grub_rescue.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -32,7 +32,7 @@
 
 available_space=$(df -Pk /boot | awk 'END { print $4 * 1024 }')
 used_space=$(total_filesize /boot/rear-kernel /boot/rear-initrd.cgz)
-required_space=$(total_filesize $KERNEL_FILE $BUILD_DIR/initrd.cgz)
+required_space=$(total_filesize $KERNEL_FILE $TMP_DIR/initrd.cgz)
 
 if (( available_space + used_space < required_space )); then
     LogPrint "WARNING: Not enough disk space available in /boot for GRUB rescue image"
@@ -95,5 +95,5 @@
 fi
 BugIfError "Unable to copy '$KERNEL_FILE' to /boot"
 
-cp -af $v $BUILD_DIR/initrd.cgz /boot/rear-initrd.cgz >&2
-BugIfError "Unable to copy '$BUILD_DIR/initrd.cgz' to /boot"
+cp -af $v $TMP_DIR/initrd.cgz /boot/rear-initrd.cgz >&2
+BugIfError "Unable to copy '$TMP_DIR/initrd.cgz' to /boot"

Modified: trunk/usr/share/rear/output/default/95_email_result_files.sh
===================================================================
--- trunk/usr/share/rear/output/default/95_email_result_files.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/output/default/95_email_result_files.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -29,10 +29,10 @@
 	done
 
 	create_mime_ending
-} > $BUILD_DIR/email.bin
+} > $TMP_DIR/email.bin
 
-MAIL_SIZE=( $(du -h $BUILD_DIR/email.bin) )
+MAIL_SIZE=( $(du -h $TMP_DIR/email.bin) )
 
 LogPrint "Mailing resulting files ($MAIL_SIZE) to ${RESULT_MAILTO[@]}"
-$RESULT_SENDMAIL "${RESULT_SENDMAIL_OPTIONS[@]}" <$BUILD_DIR/email.bin
+$RESULT_SENDMAIL "${RESULT_SENDMAIL_OPTIONS[@]}" <$TMP_DIR/email.bin
 LogPrintIfError "WARNING ! Sending Email with '$RESULT_SENDMAIL "${RESULT_SENDMAIL_OPTIONS[@]}"' failed."

Modified: trunk/usr/share/rear/pack/Debian/ia64/30_copy_kernel.sh
===================================================================
--- trunk/usr/share/rear/pack/Debian/ia64/30_copy_kernel.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/pack/Debian/ia64/30_copy_kernel.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -54,4 +54,4 @@
 fi
 
 Log "Found kernel $KERNEL_FILE"
-#cp -aL $v "$KERNEL_FILE" "$BUILD_DIR/kernel" >&2
+#cp -aL $v "$KERNEL_FILE" "$TMP_DIR/kernel" >&2

Modified: trunk/usr/share/rear/pack/Fedora/ia64/30_copy_kernel.sh
===================================================================
--- trunk/usr/share/rear/pack/Fedora/ia64/30_copy_kernel.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/pack/Fedora/ia64/30_copy_kernel.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -54,4 +54,4 @@
 fi
 
 Log "Found kernel $KERNEL_FILE"
-#cp -aL $v "$KERNEL_FILE" "$BUILD_DIR/kernel" >&2
+#cp -aL $v "$KERNEL_FILE" "$TMP_DIR/kernel" >&2

Modified: trunk/usr/share/rear/pack/GNU/Linux/90_create_initramfs.sh
===================================================================
--- trunk/usr/share/rear/pack/GNU/Linux/90_create_initramfs.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/pack/GNU/Linux/90_create_initramfs.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -24,6 +24,6 @@
 find . ! -name "*~"  |\
 	tee /dev/fd/8  |\
 	cpio -H newc --create --quiet  |\
-	gzip > "$BUILD_DIR/initrd.cgz"
+	gzip > "$TMP_DIR/initrd.cgz"
 StopIfError "Could not create initramfs archive"
 popd >&8

Modified: trunk/usr/share/rear/pack/Linux-i386/30_copy_kernel.sh
===================================================================
--- trunk/usr/share/rear/pack/Linux-i386/30_copy_kernel.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/pack/Linux-i386/30_copy_kernel.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -59,4 +59,4 @@
 fi
 
 Log "Found kernel $KERNEL_FILE"
-#cp -aL $v "$KERNEL_FILE" "$BUILD_DIR/kernel" >&2
+#cp -aL $v "$KERNEL_FILE" "$TMP_DIR/kernel" >&2

Modified: trunk/usr/share/rear/pack/Linux-ppc64/30_copy_kernel.sh
===================================================================
--- trunk/usr/share/rear/pack/Linux-ppc64/30_copy_kernel.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/pack/Linux-ppc64/30_copy_kernel.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -55,4 +55,4 @@
 fi
 
 Log "Found kernel $KERNEL_FILE"
-#cp -aL $v "$KERNEL_FILE" "$BUILD_DIR/kernel" >&2
+#cp -aL $v "$KERNEL_FILE" "$TMP_DIR/kernel" >&2

Modified: trunk/usr/share/rear/restore/RSYNC/default/40_restore_rsync_backup.sh
===================================================================
--- trunk/usr/share/rear/restore/RSYNC/default/40_restore_rsync_backup.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/restore/RSYNC/default/40_restore_rsync_backup.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -4,8 +4,8 @@
 	echo $(stat --format '%s' "/mnt/local/$1")
 }
 
-mkdir -p "${BUILD_DIR}/rsync/${NETFS_PREFIX}"
-StopIfError "Could not mkdir '$BUILD_DIR/rsync/${NETFS_PREFIX}'"
+mkdir -p "${TMP_DIR}/rsync/${NETFS_PREFIX}"
+StopIfError "Could not mkdir '$TMP_DIR/rsync/${NETFS_PREFIX}'"
 
 LogPrint "Restoring $BACKUP_PROG archive from '${RSYNC_HOST}:${RSYNC_PATH}'"
 
@@ -37,8 +37,8 @@
 			:
 			;;
 	esac
-	echo $? >$BUILD_DIR/retval
-) >"${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}-restore.log" &
+	echo $? >$TMP_DIR/retval
+) >"${TMP_DIR}/${BACKUP_PROG_ARCHIVE}-restore.log" &
 BackupPID=$!
 starttime=$SECONDS
 
@@ -51,7 +51,7 @@
 	(rsync)
 		
 		while sleep 1 ; kill -0 $BackupPID 2>/dev/null ; do
-			fsize="$(get_size $(tail -2 "${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}-restore.log" | head -n 1))"
+			fsize="$(get_size $(tail -2 "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}-restore.log" | head -n 1))"
 			size=$((size+fsize))
 			echo "INFO Restored $((size/1024/1024)) MiB [avg $((size/1024/(SECONDS-starttime))) KiB/sec]" >&8
 		done
@@ -81,7 +81,7 @@
 manually check the restored system to see wether it is complete.
 "
 
-_message="$(tail -14 ${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}-restore.log)"
+_message="$(tail -14 ${TMP_DIR}/${BACKUP_PROG_ARCHIVE}-restore.log)"
 
 if [ $_rc -eq 0 -a "$_message" ] ; then
         LogPrint "$_message in $transfertime seconds."

Modified: trunk/usr/share/rear/restore/RSYNC/default/80_copy_restore_log.sh
===================================================================
--- trunk/usr/share/rear/restore/RSYNC/default/80_copy_restore_log.sh	2011-07-14 22:05:16 UTC (rev 686)
+++ trunk/usr/share/rear/restore/RSYNC/default/80_copy_restore_log.sh	2011-07-15 06:34:21 UTC (rev 687)
@@ -5,7 +5,7 @@
 	chmod 0700 /mnt/local/root
 fi
 
-cp "${BUILD_DIR}/${BACKUP_PROG_ARCHIVE}-restore.log" /mnt/local/root/restore-$(date +%Y%m%d.%H%M).log
+cp "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}-restore.log" /mnt/local/root/restore-$(date +%Y%m%d.%H%M).log
 StopIfError "Could not copy ${BACKUP_PROG_ARCHIVE}-restore.log to /mnt/local/root"
 gzip /mnt/local/root/restore-$(date +%Y%m%d.%H%M).log
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rear-users mailing list