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

dag- at users.sourceforge.net dag- at users.sourceforge.net
Wed Jun 1 19:18:46 CEST 2011


Revision: 525
          http://rear.svn.sourceforge.net/rear/?rev=525&view=rev
Author:   dag-
Date:     2011-06-01 17:18:45 +0000 (Wed, 01 Jun 2011)

Log Message:
-----------
Get rid of progress during preparation phase.
(Also merge tape rewinding with script that needs it)

Modified Paths:
--------------
    trunk/usr/share/rear/prep/BACULA/default/45_check_BACULA_client_configured.sh
    trunk/usr/share/rear/prep/BACULA/default/50_check_BACULA_bconsole_results.sh
    trunk/usr/share/rear/prep/GNU/Linux/20_include_agetty.sh
    trunk/usr/share/rear/prep/ISO/GNU/Linux/32_verify_mkisofs.sh
    trunk/usr/share/rear/prep/ISO/Linux-i386/33_find_isolinux.sh
    trunk/usr/share/rear/prep/ISO/Linux-ia64/33_find_elilo_efi.sh
    trunk/usr/share/rear/prep/ISO/default/30_check_iso_dir.sh
    trunk/usr/share/rear/prep/ISO/default/32_check_cdrom_size.sh
    trunk/usr/share/rear/prep/OBDR/default/50_check_tape_label.sh
    trunk/usr/share/rear/prep/OBDR/default/70_write_OBDR_header.sh
    trunk/usr/share/rear/prep/TAPE/default/40_check_tape_drive.sh

Removed Paths:
-------------
    trunk/usr/share/rear/prep/OBDR/default/45_rewind_tape_drive.sh
    trunk/usr/share/rear/prep/OBDR/default/60_rewind_tape_drive.sh
    trunk/usr/share/rear/prep/TAPE/default/60_rewind_tape_drive.sh
    trunk/usr/share/rear/prep/default/01_progress_start.sh
    trunk/usr/share/rear/prep/default/99_progress_stop.sh

Modified: trunk/usr/share/rear/prep/BACULA/default/45_check_BACULA_client_configured.sh
===================================================================
--- trunk/usr/share/rear/prep/BACULA/default/45_check_BACULA_client_configured.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/BACULA/default/45_check_BACULA_client_configured.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -5,27 +5,24 @@
 
    ### Bacula support using bextract
    type -p bextract &>/dev/null
-   ProgressStopIfError $? "Bacula bextract is missing"
+   StopIfError "Bacula bextract is missing"
 
-   if [ ! -s /etc/bacula/bacula-sd.conf ]; then
-      ProgressStopIfError 1  "Bacula configuration file (bacula-sd.conf) missing"
-   fi
+   [ -s /etc/bacula/bacula-sd.conf ]
+   StopIfError "Bacula configuration file (bacula-sd.conf) missing"
 
 else
 
    ### Bacula support using bconsole
    type -p bacula-fd &>/dev/null
-   ProgressStopIfError $? "Bacula File Daemon is missing"
+   StopIfError "Bacula File Daemon is missing"
 
-   if [ ! -s /etc/bacula/bacula-fd.conf ]; then
-      ProgressStopIfError 1  "Bacula configuration file (bacula-fd.conf) missing"
-   fi
+   [ -s /etc/bacula/bacula-fd.conf ]
+   StopIfError "Bacula configuration file (bacula-fd.conf) missing"
 
    type -p bconsole &>/dev/null
-   ProgressStopIfError $? "Bacula console executable is missing"
+   StopIfError "Bacula console executable is missing"
 
-   if [ ! -s /etc/bacula/bconsole.conf ]; then
-      ProgressStopIfError 1  "Bacula configuration file (bconsole.conf) missing"
-   fi
+   [ -s /etc/bacula/bconsole.conf ]
+   StopIfError "Bacula configuration file (bconsole.conf) missing"
 
 fi

Modified: trunk/usr/share/rear/prep/BACULA/default/50_check_BACULA_bconsole_results.sh
===================================================================
--- trunk/usr/share/rear/prep/BACULA/default/50_check_BACULA_bconsole_results.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/BACULA/default/50_check_BACULA_bconsole_results.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -13,11 +13,12 @@
 #
 # is the director server present? Fetch from /etc/bacula/bconsole.conf file
 BACULA_DIRECTOR=$(grep -i address /etc/bacula/bconsole.conf | awk '{ print $3 }')
-[ -z "${BACULA_DIRECTOR}" ] && ProgressStopIfError 1 "Director not defined in /etc/bacula/bconsole.conf"
+[ "${BACULA_DIRECTOR}" ]
+StopIfError "Director not defined in /etc/bacula/bconsole.conf"
 
 if test "$PING"; then
 	ping -c 2 -q  $BACULA_DIRECTOR 1>&8
-	ProgressStopIfError $? "Backup host [$BACULA_DIRECTOR] not reachable."
+	StopIfError "Backup host [$BACULA_DIRECTOR] not reachable."
 else
 	Log "Skipping ping test"
 fi
@@ -29,17 +30,18 @@
 # "Connecting to Director 'director_name-fd:9101'"
 # "Connecting to Client 'bacula_client_name-fd at FQDN:9102"
 BACULA_CLIENT=`grep $(hostname -s) /etc/bacula/bacula-fd.conf | grep "\-fd" | awk '{print $3}' | cut -d"-" -f1`
-[ -z "${BACULA_CLIENT}" ] && ProgressStopIfError 1 "Client $(hostname -s) not defined in /etc/bacula/bacula-fd.conf"
+[ "${BACULA_CLIENT}" ]
+StopIfError "Client $(hostname -s) not defined in /etc/bacula/bacula-fd.conf"
 
 BACULA_RESULT=( `echo -e " status client=${BACULA_CLIENT}-fd" | bconsole |grep Connect ` )
 
 director=${BACULA_RESULT[3]}
 client=${BACULA_RESULT[9]}
 
-if test -z "$director" ; then
-	ProgressStopIfError 1 "Bacula director not reachable."
-elif test -z "$client" ;  then
-	ProgressStopIfError 1 "Bacula client status unknown on director."
-else
-	Log "Bacula director = $director, client = $client"
-fi
+[ "$director" ]
+StopIfError "Bacula director not reachable."
+
+[ "$client" ]
+StopIfError 1 "Bacula client status unknown on director."
+
+Log "Bacula director = $director, client = $client"

Modified: trunk/usr/share/rear/prep/GNU/Linux/20_include_agetty.sh
===================================================================
--- trunk/usr/share/rear/prep/GNU/Linux/20_include_agetty.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/GNU/Linux/20_include_agetty.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -11,7 +11,7 @@
 fi
 
 # Unless explicitly disabled
-if [[ ! "$USE_SERIAL_CONSOLE" =~ '^[yY1]' ]]; then
+if [[ ! "$USE_SERIAL_CONSOLE" =~ ^[yY1] ]]; then
     return
 fi
 

Modified: trunk/usr/share/rear/prep/ISO/GNU/Linux/32_verify_mkisofs.sh
===================================================================
--- trunk/usr/share/rear/prep/ISO/GNU/Linux/32_verify_mkisofs.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/ISO/GNU/Linux/32_verify_mkisofs.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -2,7 +2,7 @@
 #
 # default for ISO_MKISOFS_BIN is to check for mkisofs and genisoimage in the path
 
-test -x "$ISO_MKISOFS_BIN"
-ProgressStopIfError $? "Could not find 'mkisofs' compatible program. Please install 'mkisofs' or 'genisoimage' into your path or manually set ISO_MKISOFS_BIN [$ISO_MKISOFS_BIN]"
-ProgressStep
+[ -x "$ISO_MKISOFS_BIN" ]
+StopIfError "Could not find 'mkisofs' compatible program. Please install 'mkisofs' or 'genisoimage' into your path or manually set ISO_MKISOFS_BIN [$ISO_MKISOFS_BIN]"
+
 Log "Using '$ISO_MKISOFS_BIN' to create ISO images"

Modified: trunk/usr/share/rear/prep/ISO/Linux-i386/33_find_isolinux.sh
===================================================================
--- trunk/usr/share/rear/prep/ISO/Linux-i386/33_find_isolinux.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/ISO/Linux-i386/33_find_isolinux.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -10,9 +10,9 @@
 	done
 
 fi
+
 [[ -s "$ISO_ISOLINUX_BIN" ]]
-ProgressStopIfError $? "Could not find 'isolinux.bin'. Maybe you have to set ISO_ISOLINUX_BIN [$ISO_ISOLINUX_BIN] or install the syslinux package ?"
+StopIfError "Could not find 'isolinux.bin'. Maybe you have to set ISO_ISOLINUX_BIN [$ISO_ISOLINUX_BIN] or install the syslinux package ?"
 
 # Define the syslinux directory for later usage
 SYSLINUX_DIR=$(dirname $ISO_ISOLINUX_BIN)
-

Modified: trunk/usr/share/rear/prep/ISO/Linux-ia64/33_find_elilo_efi.sh
===================================================================
--- trunk/usr/share/rear/prep/ISO/Linux-ia64/33_find_elilo_efi.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/ISO/Linux-ia64/33_find_elilo_efi.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -10,5 +10,6 @@
 	done
 
 fi
-test -s "$ELILO_BIN" 
-ProgressStopIfError $? "Could not find 'elilo.efi'. Maybe you have to set ELILO_BIN [$ELILO_BIN] ?"
+
+[ -s "$ELILO_BIN" ]
+StopIfError "Could not find 'elilo.efi'. Maybe you have to set ELILO_BIN [$ELILO_BIN] ?"

Modified: trunk/usr/share/rear/prep/ISO/default/30_check_iso_dir.sh
===================================================================
--- trunk/usr/share/rear/prep/ISO/default/30_check_iso_dir.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/ISO/default/30_check_iso_dir.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -1,4 +1,3 @@
 # check ISO_DIR directory
-test -d "${ISO_DIR}" 
-ProgressStopIfError $? "The ISO output directory '${ISO_DIR}' does not exit"
-ProgressStep
+[ -d "${ISO_DIR}" ]
+StopIfError $? "The ISO output directory '${ISO_DIR}' does not exit"

Modified: trunk/usr/share/rear/prep/ISO/default/32_check_cdrom_size.sh
===================================================================
--- trunk/usr/share/rear/prep/ISO/default/32_check_cdrom_size.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/ISO/default/32_check_cdrom_size.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -5,7 +5,7 @@
 	*/*)	
 		let available=available/1024 # convert k-blocks to MBytes
 		test "${available}" -gt "${CDROM_SIZE}"
-		ProgressStopIfError $? "Not enough space in ${ISO_DIR} [$DEV]: only ${available} MB free, need ${CDROM_SIZE} MB"
+		StopIfError "Not enough space in ${ISO_DIR} [$DEV]: only ${available} MB free, need ${CDROM_SIZE} MB"
 		Log "ISO Directory '${ISO_DIR}' [$DEV] has $available MB free space"
 	;;
 	*)

Deleted: trunk/usr/share/rear/prep/OBDR/default/45_rewind_tape_drive.sh
===================================================================
--- trunk/usr/share/rear/prep/OBDR/default/45_rewind_tape_drive.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/OBDR/default/45_rewind_tape_drive.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -1 +0,0 @@
-link ../../TAPE/default/60_rewind_tape_drive.sh
\ No newline at end of file

Modified: trunk/usr/share/rear/prep/OBDR/default/50_check_tape_label.sh
===================================================================
--- trunk/usr/share/rear/prep/OBDR/default/50_check_tape_label.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/OBDR/default/50_check_tape_label.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -1,21 +1,23 @@
 # Check the tape label and verify that this tape can be erased
 
+LogPrint "Rewinding tape"
+
+# Rewind tape drive to read out tape label
+mt -f $TAPE_DEVICE rewind
+StopIfError "Problem with rewinding tape in drive '$TAPE_DEVICE'"
+
 # Turn compression off for reading tape label
 mt -f $TAPE_DEVICE compression off
-ProgressStopIfError $? "Could not disable compression on tape device '${TAPE_DEVICE}'"
-ProgressStep
+StopIfError "Could not disable compression on tape device '$TAPE_DEVICE'"
 
 # Set correct blocksize for reading tape label
 mt -f $TAPE_DEVICE setblk 512
-ProgressStopIfError $? "Could not set block size on tape device '${TAPE_DEVICE}'"
-ProgressStep
+StopIfError "Could not set block size on tape device '$TAPE_DEVICE'"
 
 # Read exactly one block
 TAPE_LABEL=$(dd if=$TAPE_DEVICE count=1)
-ProgressStopIfError $? "Could not read label from tape device '${TAPE_DEVICE}'"
-ProgressStep
+StopIfError "Could not read label from tape device '$TAPE_DEVICE'"
 
 # Match label
 [[ "REAR-000" == "${TAPE_LABEL:0:8}" ]]
-ProgressStopIfError $? "Tape ($TAPE_DEVICE) does not have the proper REAR-000 label. Use 'rear labeltape' to allow this tape to be used in OBDR mode."
-ProgressStep
+StopIfError "Tape ($TAPE_DEVICE) does not have the proper REAR-000 label. Use 'rear labeltape' to allow this tape to be used in OBDR mode."

Deleted: trunk/usr/share/rear/prep/OBDR/default/60_rewind_tape_drive.sh
===================================================================
--- trunk/usr/share/rear/prep/OBDR/default/60_rewind_tape_drive.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/OBDR/default/60_rewind_tape_drive.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -1 +0,0 @@
-link ../../TAPE/default/60_rewind_tape_drive.sh
\ No newline at end of file

Modified: trunk/usr/share/rear/prep/OBDR/default/70_write_OBDR_header.sh
===================================================================
--- trunk/usr/share/rear/prep/OBDR/default/70_write_OBDR_header.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/OBDR/default/70_write_OBDR_header.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -1,15 +1,21 @@
 # write the OBDR header to tape
 PROGS=( "${PROGS[@]}" dd )
 
-mt -f "${TAPE_DEVICE}" compression off
-ProgressStopIfError $? "Could not disable compression on tape device ${TAPE_DEVICE}"
-ProgressStep
+LogPrint "Writing OBDR header to tape in drive '$TAPE_DEVICE'"
 
-mt -f "${TAPE_DEVICE}" setblk 512
-ProgressStopIfError $? "Could not set block size on tape device ${TAPE_DEVICE}"
-ProgressStep
+mt -f  "$TAPE_DEVICE" rewind
+StopIfError "Problem with rewinding tape in drive '$TAPE_DEVICE'"
 
+mt -f "$TAPE_DEVICE" compression off
+StopIfError "Could not disable compression on tape device '$TAPE_DEVICE'"
+
+mt -f "$TAPE_DEVICE" setblk 512
+StopIfError "Could not set block size on tape device '$TAPE_DEVICE'"
+
 ### Make sure we set a tape label and total padding of 20 blocks of size 512
-printf 'REAR-000%10232s' ' ' | tr ' ' '\0' | dd of=${TAPE_DEVICE} bs=512 count=20
-ProgressStopIfError $? "OBDR header could not be written to tape device ${TAPE_DEVICE}"
-ProgressStep
+printf 'REAR-000%10232s' ' ' | tr ' ' '\0' | dd of=$TAPE_DEVICE bs=512 count=20
+StopIfError $? "OBDR header could not be written to tape device '$TAPE_DEVICE'"
+
+mt -f  "$TAPE_DEVICE" rewind
+StopIfError "Problem with rewinding tape in drive '$TAPE_DEVICE'"
+

Modified: trunk/usr/share/rear/prep/TAPE/default/40_check_tape_drive.sh
===================================================================
--- trunk/usr/share/rear/prep/TAPE/default/40_check_tape_drive.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/TAPE/default/40_check_tape_drive.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -9,18 +9,15 @@
 
 # Is a tape device provided
 [[ "${TAPE_DEVICE}" ]]
-ProgressStopIfError $? "No tape device (TAPE_DEVICE) defined."
-ProgressStep
+StopIfError "No tape device (TAPE_DEVICE) defined."
 
 # Write out tape status
 mt -f "${TAPE_DEVICE}" status >"$TMP_DIR/tape_status" 1>&2
-ProgressStopIfError $PIPESTATUS "Problem with reading tape device '${TAPE_DEVICE}'."
-ProgressStep
+StopIfError "Problem with reading tape device '${TAPE_DEVICE}'."
 
 # Log tape status
 cat $TMP_DIR/tape_status
 
 # Check if tape is not write protected
 ! grep -q WR_PROT "$TMP_DIR/tape_status"
-ProgressStopIfError $? "Tape in device '${TAPE_DEVICE}' is write protected."
-ProgressStep
+StopIfError "Tape in device '${TAPE_DEVICE}' is write protected."

Deleted: trunk/usr/share/rear/prep/TAPE/default/60_rewind_tape_drive.sh
===================================================================
--- trunk/usr/share/rear/prep/TAPE/default/60_rewind_tape_drive.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/TAPE/default/60_rewind_tape_drive.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -1,11 +0,0 @@
-# rewind tape drive
-
-# TODO: This might take a long while, we should give the user more feedback about
-# what is going on !
-
-SpinnerSleep 5		# for slower tape devices
-Log "Rewinding tape"
-mt -f  "${TAPE_DEVICE}" rewind 
-ProgressStopIfError $? "Problem with rewinding tape device '${TAPE_DEVICE}'"
-Log "Finished rewinding tape"
-ProgressStep

Deleted: trunk/usr/share/rear/prep/default/01_progress_start.sh
===================================================================
--- trunk/usr/share/rear/prep/default/01_progress_start.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/default/01_progress_start.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -1,2 +0,0 @@
-ProgressStart "The preparation phase"
-

Deleted: trunk/usr/share/rear/prep/default/99_progress_stop.sh
===================================================================
--- trunk/usr/share/rear/prep/default/99_progress_stop.sh	2011-06-01 17:15:47 UTC (rev 524)
+++ trunk/usr/share/rear/prep/default/99_progress_stop.sh	2011-06-01 17:18:45 UTC (rev 525)
@@ -1 +0,0 @@
-ProgressStop


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