Changeset 27838 for branches/tap_branches/ippScripts/scripts/chip_imfile.pl
- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippScripts/scripts/chip_imfile.pl (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/ippScripts/scripts/chip_imfile.pl
r25555 r27838 8 8 use Sys::Hostname; 9 9 my $host = hostname(); 10 my $date = `date`; 10 11 print "\n\n"; 11 print "Starting script $0 on $host \n\n";12 print "Starting script $0 on $host at $date\n\n"; 12 13 13 14 use DateTime; … … 53 54 'reduction=s' => \$reduction, # Reduction class 54 55 'run-state=s' => \$run_state, # current state of the run (new, update) 55 'magicked '=> \$magicked, # magicked state of input file56 'magicked=s' => \$magicked, # magicked state of input file 56 57 'deburned=s' => \$deburned, # does deburned image exist? 57 58 'threads=s' => \$threads, # Number of threads to use for ppImage … … 134 135 $command = "$ppConfigDump -camera $camera -dump-recipe PPIMAGE -recipe PPIMAGE $recipe_ppImage -"; 135 136 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 136 run(command => $command, verbose => $verbose);137 run(command => $command, verbose => 0); 137 138 unless ($success) { 138 139 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 146 147 147 148 if ($useDeburnedImage) { 148 my $useBestBurntool = metadataLookupBool($recipeData, 'USE.BEST.BURNTOOL');149 150 ## Check that we have required programs:151 # print STDERR "Inside burntool loop!\n";152 my $regtool = can_run('regtool') or &my_die ("Can't find regtool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);153 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);154 my $burntool = can_run('burntool') or &my_die ("Can't find burntool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR);155 149 my $useBestBurntool = metadataLookupBool($recipeData, 'USE.BEST.BURNTOOL'); 150 151 ## Check that we have required programs: 152 # print STDERR "Inside burntool loop!\n"; 153 my $regtool = can_run('regtool') or &my_die ("Can't find regtool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 154 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 155 my $burntool = can_run('burntool') or &my_die ("Can't find burntool", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 156 156 157 ## Check the current burntool processing version: 157 158 my $regtool_state_cmd = "$regtool -processedimfile -exp_id $exp_id -class_id $class_id -limit 1"; … … 173 174 my $burntoolState = 999; 174 175 foreach my $regEntry (@$regData2) { 175 #print "$regEntry->{exp_id} $regEntry->{burntool_state}\n";176 print "$regEntry->{exp_id} $regEntry->{burntool_state}\n"; 176 177 177 178 if ($regEntry->{exp_id} == $exp_id) { … … 182 183 &my_die("Unable to find burntool_state in metadata", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 183 184 } 184 if ($burntoolState == 32767) {185 $burntoolState = 0;186 }185 if ($burntoolState == 32767) { 186 $burntoolState = 0; 187 } 187 188 188 189 ## Read camera config to get the current good burntool state : … … 190 191 my $camera_config_cmd = "$ppConfigDump -camera $camera -dump-camera -"; 191 192 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 192 run(command => $camera_config_cmd, verbose => $verbose);193 run(command => $camera_config_cmd, verbose => 0); 193 194 unless ($success) { 194 195 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); … … 206 207 } 207 208 208 if (abs($burntoolState) != $burntoolStateGood) { 209 if ($useBestBurntool) { 210 &my_die("Image burntool version does not match current accepted version.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 211 } 212 else { 213 warn ("Image burntool version does not match current accepted version. Continuing as requested."); 214 # Internally pretend that we're at a good version. 215 if ($burntoolState < -10) { 216 $burntoolState = -1 * $burntoolStateGood; 217 } 218 elsif ($burntoolState > 10) { 219 $burntoolState = $burntoolStateGood; 220 } 221 elsif ($burntoolState == 0) { 222 # 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 223 # that burntool has never been run on this image. We'll hope the database is wrong, but I don't really trust that. 224 warn ("burntool_state suggests no table will be found. This will likely crash."); 225 $burntoolState = -1 * $burntoolStateGood; 226 } 227 else { 228 &my_die("No valid burntool table will be found.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 229 } 230 } 231 } 209 print "burntool state vs burntoolStateGood : $burntoolState vs $burntoolStateGood\n"; 210 if (abs($burntoolState) != $burntoolStateGood) { 211 if ($useBestBurntool) { 212 &my_die("Image burntool version does not match current accepted version.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 213 } 214 else { 215 warn ("Image burntool version does not match current accepted version. Continuing as requested."); 216 # Internally pretend that we're at a good version. 217 if ($burntoolState < -10) { 218 $burntoolState = -1 * $burntoolStateGood; 219 } 220 elsif ($burntoolState > 10) { 221 $burntoolState = $burntoolStateGood; 222 } 223 elsif ($burntoolState == 0) { 224 # 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 225 # that burntool has never been run on this image. We'll hope the database is wrong, but I don't really trust that. 226 warn ("burntool_state suggests no table will be found. This will likely crash."); 227 $burntoolState = -1 * $burntoolStateGood; 228 } 229 else { 230 &my_die("No valid burntool table will be found.", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR); 231 } 232 } 233 } 232 234 233 235 ## We now know that we have an image that has been burntooled. … … 258 260 } 259 261 260 $burntool_cmd .= "$tempName in=${burntoolTable_uriReal} apply=t";262 $burntool_cmd .= "$tempName in=${burntoolTable_uriReal} persist=t apply=t"; 261 263 } 262 264 elsif ($burntoolState == $burntoolStateGood) { # Burntool information stored in a header table. 263 $burntool_cmd .= "$tempName apply=t";265 $burntool_cmd .= "$tempName persist=t apply=t"; 264 266 } 265 267 else { … … 375 377 if ($do_stats) { 376 378 my $outputStatsReal = $ipprc->file_resolve($outputStats); 377 &my_die("Couldn't find expected output file: $outputStats", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless -f $outputStatsReal;379 &my_die("Couldn't find expected output file: $outputStats", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputStatsReal); 378 380 379 381 # measure chip stats … … 398 400 &my_die("Couldn't find expected output file: $outputBin1\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin1); 399 401 &my_die("Couldn't find expected output file: $outputBin2\n", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($outputBin2); 402 if ($run_state eq 'new') { 403 &my_die("Couldn't find expected output file: $configuration", $exp_id, $chip_id, $class_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($configuration); 404 } 400 405 } 401 406 … … 411 416 $command .= " -uri $outputImage"; 412 417 $command .= " -path_base $outroot"; 413 $command .= " -magicked " if $magicked;418 $command .= " -magicked $magicked" if $magicked; 414 419 $command .= " -hostname $host" if defined $host; 415 420 $command .= " -dbname $dbname" if defined $dbname;
Note:
See TracChangeset
for help on using the changeset viewer.
