Index: trunk/ippScripts/scripts/chip_imfile.pl
===================================================================
--- trunk/ippScripts/scripts/chip_imfile.pl	(revision 26567)
+++ trunk/ippScripts/scripts/chip_imfile.pl	(revision 26901)
@@ -134,5 +134,5 @@
     $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe_ppImage -";
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-        run(command => $command, verbose => $verbose);
+        run(command => $command, verbose => 0);
     unless ($success) {
         $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
@@ -146,12 +146,12 @@
 
     if ($useDeburnedImage) {
-	my $useBestBurntool  = metadataLookupBool($recipeData, 'USE.BEST.BURNTOOL');
-
-	## Check that we have required programs:
-#	print STDERR "Inside burntool loop!\n";
-	my $regtool  = can_run('regtool') or &my_die ("Can't find regtool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
-	my $funpack  = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
-	my $burntool = can_run('burntool') or &my_die ("Can't find burntool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
-	
+        my $useBestBurntool  = metadataLookupBool($recipeData, 'USE.BEST.BURNTOOL');
+
+        ## Check that we have required programs:
+#       print STDERR "Inside burntool loop!\n";
+        my $regtool  = can_run('regtool') or &my_die ("Can't find regtool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+        my $funpack  = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+        my $burntool = can_run('burntool') or &my_die ("Can't find burntool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+
         ## Check the current burntool processing version:
         my $regtool_state_cmd = "$regtool -processedimfile -exp_id $exp_id -class_id $class_id -limit 1";
@@ -173,5 +173,5 @@
         my $burntoolState = 999;
         foreach my $regEntry (@$regData2) {
-#           print "$regEntry->{exp_id} $regEntry->{burntool_state}\n";
+           print "$regEntry->{exp_id} $regEntry->{burntool_state}\n";
 
             if ($regEntry->{exp_id} == $exp_id) {
@@ -182,7 +182,7 @@
             &my_die("Unable to find burntool_state in metadata", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
         }
-	if ($burntoolState == 32767) {
-	    $burntoolState = 0;
-	}
+        if ($burntoolState == 32767) {
+            $burntoolState = 0;
+        }
 
         ## Read camera config to get the current good burntool state :
@@ -190,5 +190,5 @@
         my $camera_config_cmd = "$ppConfigDump -camera $camera -dump-camera -";
         ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-            run(command => $camera_config_cmd, verbose => $verbose);
+            run(command => $camera_config_cmd, verbose => 0);
         unless ($success) {
             $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
@@ -206,28 +206,29 @@
         }
 
-	if (abs($burntoolState) != $burntoolStateGood) {
-	    if ($useBestBurntool) {
-		&my_die("Image burntool version does not match current accepted version.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
-	    }
-	    else {
-		warn ("Image burntool version does not match current accepted version. Continuing as requested.");
-		# Internally pretend that we're at a good version.
-		if ($burntoolState < -10) {
-		    $burntoolState = -1 * $burntoolStateGood;
-		}
-		elsif ($burntoolState > 10) {
-		    $burntoolState = $burntoolStateGood;
-		}
-		elsif ($burntoolState == 0) {
-		    # You've told me to use a deburned image, and that you don't care if it's the most recent. The database has told me
-		    # that burntool has never been run on this image. We'll hope the database is wrong, but I don't really trust that.
-		    warn ("burntool_state suggests no table will be found. This will likely crash.");
-		    $burntoolState = -1 * $burntoolStateGood;
-		}
-		else {
-		    &my_die("No valid burntool table will be found.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
-		}
-	    }
-	}
+        print "burntool state vs burntoolStateGood : $burntoolState vs $burntoolStateGood\n";
+        if (abs($burntoolState) != $burntoolStateGood) {
+            if ($useBestBurntool) {
+                &my_die("Image burntool version does not match current accepted version.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+            }
+            else {
+                warn ("Image burntool version does not match current accepted version. Continuing as requested.");
+                # Internally pretend that we're at a good version.
+                if ($burntoolState < -10) {
+                    $burntoolState = -1 * $burntoolStateGood;
+                }
+                elsif ($burntoolState > 10) {
+                    $burntoolState = $burntoolStateGood;
+                }
+                elsif ($burntoolState == 0) {
+                    # You've told me to use a deburned image, and that you don't care if it's the most recent. The database has told me
+                    # that burntool has never been run on this image. We'll hope the database is wrong, but I don't really trust that.
+                    warn ("burntool_state suggests no table will be found. This will likely crash.");
+                    $burntoolState = -1 * $burntoolStateGood;
+                }
+                else {
+                    &my_die("No valid burntool table will be found.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);
+                }
+            }
+        }
 
         ## We now know that we have an image that has been burntooled.
@@ -258,8 +259,8 @@
             }
 
-            $burntool_cmd .= "$tempName in=${burntoolTable_uriReal} apply=t";
+            $burntool_cmd .= "$tempName in=${burntoolTable_uriReal} persist=t apply=t";
         }
         elsif ($burntoolState == $burntoolStateGood) { # Burntool information stored in a header table.
-            $burntool_cmd .= "$tempName apply=t";
+            $burntool_cmd .= "$tempName persist=t apply=t";
         }
         else {
