Index: /branches/eam_branches/20090715/DataStoreServer/scripts/dsfsindex
===================================================================
--- /branches/eam_branches/20090715/DataStoreServer/scripts/dsfsindex	(revision 25405)
+++ /branches/eam_branches/20090715/DataStoreServer/scripts/dsfsindex	(revision 25406)
@@ -60,5 +60,5 @@
 my $header = "# fileID          |bytes   |md5sum                          |type        |";
 
-$stmt = $dbh->prepare("SELECT * from dsFile WHERE fileset_id = $fs_id");
+$stmt = $dbh->prepare("SELECT * from dsFile WHERE fileset_id = $fs_id ORDER BY file_id");
 $stmt->execute();
 
Index: /branches/eam_branches/20090715/DataStoreServer/scripts/tabledefs.sql
===================================================================
--- /branches/eam_branches/20090715/DataStoreServer/scripts/tabledefs.sql	(revision 25405)
+++ /branches/eam_branches/20090715/DataStoreServer/scripts/tabledefs.sql	(revision 25406)
@@ -75,4 +75,7 @@
 # type specific column for type chip
 INSERT INTO dsFileType (type, type_col_0) VALUES('chip', 'chipname');
+INSERT INTO dsFileType (type, type_col_0) VALUES('dbinfo', 'component');
+INSERT INTO dsFileType (type, type_col_0) VALUES('text', 'component');
+INSERT INTO dsFileType (type, type_col_0) VALUES('tgz', 'component');
 
 # none of these types have any type specific columns
Index: /branches/eam_branches/20090715/DataStoreServer/web/cgi/dsgetindex
===================================================================
--- /branches/eam_branches/20090715/DataStoreServer/web/cgi/dsgetindex	(revision 25405)
+++ /branches/eam_branches/20090715/DataStoreServer/web/cgi/dsgetindex	(revision 25406)
@@ -140,7 +140,9 @@
             # 'text/plain' format
             print header('text/plain', '404 ERROR');
-            #print header('text/plain', '200 OK');
+#           print header('text/plain', '410 GONE');
+#            print header('text/plain', '200 OK');
             print @$stderr_buf;
             print STDERR @$stderr_buf;
+#            exit 410;
         }
     }
@@ -172,17 +174,26 @@
 #
 
-sub print_free_space {
-    use Filesys::Df;
-	# get free space
-	my $ref = df($DS_ROOT);
-	printf '<p>Free space: %.2f G (%.1f%%)</p>',
-		$ref->{bfree}/(1024*1024),
-		100.0*$ref->{bfree}/$ref->{blocks};
-        print "\n";
-}
+#sub print_free_space {
+#    use Filesys::Df;
+#	# get free space
+#	my $ref = df($DS_ROOT);
+#	printf '<p>Free space: %.2f G (%.1f%%)</p>',
+#		$ref->{bfree}/(1024*1024),
+#		100.0*$ref->{bfree}/$ref->{blocks};
+#        print "\n";
+#}
 sub pprint_pre {
 
     print header('text/html', '200 OK');
-    print start_html('Data Store');
+    my $name;
+    # note $fileset is not so we look at the name of the index script to determine the level
+    if ($program eq "dsfsindex") {
+        $name = $fileset;
+    } elsif ($program eq "dsprodindex") {
+        $name = "$product";
+    } else {
+        $name = "";
+    }
+    print start_html("IPP Data Store $name");
 
 
@@ -208,5 +219,5 @@
     print p();
 
-    print_free_space();
+#    print_free_space();
     print end_html();
 }
@@ -241,8 +252,10 @@
             # if this is a file request, use a download cgi
             if ($wpath =~ /\.fits\s*$/) {
-                    $wpath = '/ds-cgi/dsfits.cgi?'.substr($wpath, 4); # strip' /ds/'
+                # This doesn't work through the proxy
+                # The /ds-cgi gets tried on alala
+                #    $wpath = '/ds-cgi/dsfits.cgi?'.substr($wpath, 4); # strip' /ds/'
             }
 
-        print a({-href=>$wpath}, $toks[0]);
+        print a({-href=>$wpath, -type=>'image/x-fits'}, $toks[0]);
     }
 
Index: /branches/eam_branches/20090715/Nebulous/bin/neb-cull
===================================================================
--- /branches/eam_branches/20090715/Nebulous/bin/neb-cull	(revision 25405)
+++ /branches/eam_branches/20090715/Nebulous/bin/neb-cull	(revision 25406)
@@ -16,9 +16,10 @@
 use Pod::Usage qw( pod2usage );
 
-my ($server, $volume, $one_only);
+my ($min_copies, $server, $volume, $one_only);
 
 $server = $ENV{'NEB_SERVER'} unless $server;
 
 GetOptions(
+    'min_copies|m=i'=> \$min_copies,
     'server|s=s'    => \$server,
     'volume|v=s'    => \$volume,
@@ -41,9 +42,10 @@
     unless defined $neb;
 
+$volume ||= "any";
+$min_copies ||= 2;
+
 my @cull_args;    
 push @cull_args, $key;
-if (defined $volume) {
-    push @cull_args, $volume;
-}
+push @cull_args, $volume;
 
 if ($one_only) {
@@ -58,4 +60,5 @@
     }
 } else {
+    push @cull_args, $min_copies;
     unless (defined $neb->cull(@cull_args)) {
         die "failed to cull Nebulous key: $key - " . $neb->err;
Index: /branches/eam_branches/20090715/Nebulous/lib/Nebulous/Client.pm
===================================================================
--- /branches/eam_branches/20090715/Nebulous/lib/Nebulous/Client.pm	(revision 25405)
+++ /branches/eam_branches/20090715/Nebulous/lib/Nebulous/Client.pm	(revision 25406)
@@ -275,5 +275,5 @@
     my $self = shift;
 
-    my ($key, $vol_name) = validate_pos(@_,
+    my ($key, $vol_name, $min_copies) = validate_pos(@_,
         {
             type => SCALAR,
@@ -284,45 +284,45 @@
             optional    => 1,
         },
-    );
-
-    $log->debug( "entered - @_" );
-
-    my $locations;
+        {
+            # min copies
+            type        => SCALAR,
+            optional    => 1,
+        },
+    );
+
+    $min_copies ||= 1;
+
+    $log->debug( "entered - @_" );
+
+    my $stats = $self->stat($key);
+    my $instances = $stats->[6];
+    if ((not defined $instances) or ($instances == 0)) {
+        $self->set_err("can not cull - no instances");
+        $log->debug("leaving");
+        return;
+    }
+    if ($instances < $min_copies) {
+        $self->set_err("can not cull - not enough instances");
+        $log->debug("leaving");
+
+        return;
+    }
+
     # if vol_name is specified we need to stat the file to find out how many
     # instances there are on all volumes.  Otherwise we wouldn't know if it's
     # safe to remove the last instance on the specified volume.
     # XXX We need some way to determine which is the best instance to remove
+    my $locations;
     if (defined $vol_name) {
-        my @stats = $self->stat($key);
-        my $instances = $stats[6];
-        if (defined $instances and $instances < 2) {
-            $self->set_err("can not cull - not enough instances");
-            $log->debug("leaving");
-
-            return;
-        }
-
         $locations = $self->find_instances($key, $vol_name);
-        unless (defined $locations) {
-            $self->set_err( "no instances" );
-            $log->debug( "leaving" );
-
-            return;
-        }
     } else {
         $locations = $self->find_instances($key);
-        unless ($locations) {
-            $self->set_err( "no instances" );
-            $log->debug("leaving");
-
-            return;
-        }
-
-        if (scalar @{ $locations } < 2) {
-            $self->set_err("can not cull - not enough instances");
-            $log->debug("leaving");
-
-            return;
-        }
+    }
+
+    unless (defined $locations) {
+        $self->set_err( "no instances" );
+        $log->debug( "leaving" );
+
+        return;
     }
 
@@ -393,5 +393,5 @@
             }
             for (my $i = 1; $i < $stats->[6]; $i++) {
-                $self->cull($key);
+                $self->cull($key, "any", 1);
                 $removed++;
             }
Index: /branches/eam_branches/20090715/Nebulous/t/53_client_cull.t
===================================================================
--- /branches/eam_branches/20090715/Nebulous/t/53_client_cull.t	(revision 25405)
+++ /branches/eam_branches/20090715/Nebulous/t/53_client_cull.t	(revision 25406)
@@ -114,5 +114,5 @@
     $neb->cull();
 };
-like( $@, qr/1 - 2 were expected/, "no params" );
+like( $@, qr/1 - 3 were expected/, "no params" );
 
 Test::Nebulous->setup;
@@ -122,7 +122,7 @@
         proxy => "http://$hostport/nebulous",
     );
-    $neb->cull( 1, 2, 3 );
+    $neb->cull( 1, 2, 3, 4 );
 };
-like( $@, qr/1 - 2 were expected/, "too many params" );
+like( $@, qr/1 - 3 were expected/, "too many params" );
 
 Test::Nebulous->cleanup;
Index: /branches/eam_branches/20090715/Nebulous/t/72_neb-cull.t
===================================================================
--- /branches/eam_branches/20090715/Nebulous/t/72_neb-cull.t	(revision 25405)
+++ /branches/eam_branches/20090715/Nebulous/t/72_neb-cull.t	(revision 25406)
@@ -17,5 +17,5 @@
 
 use Apache::Test qw( -withtestmore );
-plan tests => 29;
+plan tests => 41;
 
 use lib qw( ./lib ./t );
@@ -71,4 +71,61 @@
     is($? >> 8, 255, "exit code");
     like($test->stdout, qr/^$/, "stdout");
+    like($test->stderr, qr/failed to cull Nebulous key/, "stderr");
+}
+
+Test::Nebulous->setup;
+
+{
+    my $key = 'foo';
+
+    my $neb = Nebulous::Client->new(
+        proxy => $neb_url,
+    );
+    $neb->create($key);
+    $neb->replicate($key);
+
+    $test->run(args => $key);
+
+    is($neb->stat($key)->[6], 1, "correct # of instances");
+    is($? >> 8, 0, "exit code");
+    like($test->stdout, qr/^$/, "stdout");
+    like($test->stderr, qr/^$/, "stderr");
+}
+
+Test::Nebulous->setup;
+
+{
+    my $key = 'foo';
+
+    my $neb = Nebulous::Client->new(
+        proxy => $neb_url,
+    );
+    $neb->create($key);
+    $neb->replicate($key);
+    $neb->replicate($key);
+
+    $test->run(args => $key);
+
+    is($neb->stat($key)->[6], 2, "correct # of instances");
+    is($? >> 8, 0, "exit code");
+    like($test->stdout, qr/^$/, "stdout");
+    like($test->stderr, qr/^$/, "stderr");
+}
+
+Test::Nebulous->setup;
+
+{
+    my $key = 'foo';
+
+    my $neb = Nebulous::Client->new(
+        proxy => $neb_url,
+    );
+    $neb->create($key);
+
+    $test->run(args => "--one_only " . $key);
+
+    is($neb->stat($key)->[6], 1, "correct # of instances");
+    is($? >> 8, 255, "exit code");
+    like($test->stdout, qr/^$/, "stdout");
     like($test->stderr, qr/not enough instances/, "stderr");
 }
@@ -85,46 +142,65 @@
     $neb->replicate($key);
 
-    $test->run(args => $key);
-
-    is($neb->stat($key)->[6], 1, "correct # of instances");
-    is($? >> 8, 0, "exit code");
-    like($test->stdout, qr/^$/, "stdout");
-    like($test->stderr, qr/^$/, "stderr");
-}
-
-Test::Nebulous->setup;
-
-{
-    my $key = 'foo';
-
-    my $neb = Nebulous::Client->new(
-        proxy => $neb_url,
-    );
-    $neb->create($key);
-    $neb->replicate($key);
-    $neb->replicate($key);
-
-    $test->run(args => $key);
-
-    is($neb->stat($key)->[6], 2, "correct # of instances");
-    is($? >> 8, 0, "exit code");
-    like($test->stdout, qr/^$/, "stdout");
-    like($test->stderr, qr/^$/, "stderr");
-}
-
-Test::Nebulous->setup;
-
-{
-    my $key = 'foo';
-
-    my $neb = Nebulous::Client->new(
-        proxy => $neb_url,
-    );
-    $neb->create($key);
-
     $test->run(args => "--one_only " . $key);
 
     is($neb->stat($key)->[6], 1, "correct # of instances");
-    is($? >> 8, 255, "exit code");
+    is($? >> 8, 0, "exit code");
+    like($test->stdout, qr/^$/, "stdout");
+    like($test->stderr, qr/^$/, "stderr");
+}
+
+Test::Nebulous->setup;
+
+{
+    my $key = 'foo';
+
+    my $neb = Nebulous::Client->new(
+        proxy => $neb_url,
+    );
+    $neb->create($key);
+    $neb->replicate($key);
+    $neb->replicate($key);
+
+    $test->run(args => "--one_only " . $key);
+
+    is($neb->stat($key)->[6], 1, "correct # of instances");
+    is($? >> 8, 0, "exit code");
+    like($test->stdout, qr/^$/, "stdout");
+    like($test->stderr, qr/^$/, "stderr");
+}
+
+Test::Nebulous->setup;
+
+{
+    my $key = 'foo';
+
+    my $neb = Nebulous::Client->new(
+        proxy => $neb_url,
+    );
+    $neb->create($key);
+    $neb->replicate($key);
+
+    $test->run(args => "--min_copies 1 " . $key);
+
+    is($neb->stat($key)->[6], 1, "correct # of instances");
+    is($? >> 8, 0, "exit code");
+    like($test->stdout, qr/^$/, "stdout");
+    like($test->stderr, qr/^$/, "stderr");
+}
+
+Test::Nebulous->setup;
+
+{
+    my $key = 'foo';
+
+    my $neb = Nebulous::Client->new(
+        proxy => $neb_url,
+    );
+    $neb->create($key);
+
+    $test->run(args => "--min_copies 1 " . $key);
+
+    is($neb->stat($key)->[6], 1, "correct # of instances");
+    is($? >> 8, 0, "exit code");
     like($test->stdout, qr/^$/, "stdout");
     like($test->stderr, qr/not enough instances/, "stderr");
@@ -141,26 +217,7 @@
     $neb->create($key);
     $neb->replicate($key);
-
-    $test->run(args => "--one_only " . $key);
-
-    is($neb->stat($key)->[6], 1, "correct # of instances");
-    is($? >> 8, 0, "exit code");
-    like($test->stdout, qr/^$/, "stdout");
-    like($test->stderr, qr/^$/, "stderr");
-}
-
-Test::Nebulous->setup;
-
-{
-    my $key = 'foo';
-
-    my $neb = Nebulous::Client->new(
-        proxy => $neb_url,
-    );
-    $neb->create($key);
-    $neb->replicate($key);
-    $neb->replicate($key);
-
-    $test->run(args => "--one_only " . $key);
+    $neb->replicate($key);
+
+    $test->run(args => "--min_copies 2 " . $key);
 
     is($neb->stat($key)->[6], 1, "correct # of instances");
Index: /branches/eam_branches/20090715/Ohana/src/getstar/include/dvoImagesAtCoords.h
===================================================================
--- /branches/eam_branches/20090715/Ohana/src/getstar/include/dvoImagesAtCoords.h	(revision 25405)
+++ /branches/eam_branches/20090715/Ohana/src/getstar/include/dvoImagesAtCoords.h	(revision 25406)
@@ -18,4 +18,13 @@
 Coords *MOSAIC;         // carries the mosaic into ReadImageHeader
 
+typedef struct {
+    int     id;
+    double  ra;
+    double  dec;
+    int     Nmatches;
+    int     *matches;
+    int     arrayLength;
+} Point;
+
 int WITH_PHU;
 int SOLO_PHU;
@@ -33,7 +42,5 @@
 Image *ReadImageFiles (char *filename, int *Nimages);
 int ReadImageHeader (Header *header, Image *image);
-int *MatchCoords(Image *, int, double, double, int *);
+int MatchCoords(Image *, int, Point *, int);
 
 int GetFileMode (Header *header);
-// int edge_check (double *x1, double *y1, double *x2, double *y2);
-// double opening_angle (double x1, double y1, double x2, double y2, double x3, double y3);
Index: /branches/eam_branches/20090715/Ohana/src/getstar/src/MatchCoords.c
===================================================================
--- /branches/eam_branches/20090715/Ohana/src/getstar/src/MatchCoords.c	(revision 25405)
+++ /branches/eam_branches/20090715/Ohana/src/getstar/src/MatchCoords.c	(revision 25406)
@@ -5,8 +5,8 @@
 
 /* given coordinate, find images in list that contain the point */
-int *MatchCoords (Image *dbImages, int NdbImages, double ra, double dec, int *Nmatch) {
+int MatchCoords (Image *dbImages, int NdbImages, Point *points, int Npoints) {
   
-  int i, j, N, addtolist, status;
-  int NMATCH, nmatch, *match;
+  int i, j, N;
+  int totalMatches = 0;
   Coords tcoords;
   double r, d;
@@ -15,10 +15,4 @@
   double xmin, xmax, ymin, ymax;
 
-  *Nmatch = 0;
-
-  /* match represents the subset of overlapping images */
-  nmatch = 0;
-  NMATCH = 20;
-  ALLOCATE (match, int, NMATCH);
 
   /* setup links for mosaic WRP and DIS entries */
@@ -40,5 +34,4 @@
     // Xi[4] = Xi[0]; Yi[4] = Yi[0];
 
-
     ymin = xmin = +FLT_MAX;
     ymax = xmax = -FLT_MAX;
@@ -50,23 +43,32 @@
     }
 
-    // transform input point to image coords
-    double x, y;
-    RD_to_XY(&x, &y, ra, dec, &dbImages[i].coords);
+    for (j = 0; j < Npoints; j++) {
+        Point *pt = points + j;
 
-    if ((x >= xmin && x <= xmax) && (y >= ymin && y <= ymax)) {
+        // transform input point to image coords
+        double x, y;
+        int status = RD_to_XY(&x, &y, pt->ra, pt->dec, &dbImages[i].coords);
 
-        match[nmatch] = i;
-        nmatch ++;
-        if (nmatch == NMATCH) {
-          NMATCH += 20;
-          REALLOCATE (match, int, NMATCH);
+        if (!status) {
+            // avoid matching antipodal skycells
+            continue;
+        }
+
+        if ((x >= xmin && x <= xmax) && (y >= ymin && y <= ymax)) {
+            totalMatches++;
+
+            pt->matches[pt->Nmatches] = i;
+            pt->Nmatches ++;
+
+            if (pt->Nmatches == pt->arrayLength) {
+                pt->arrayLength += 20;
+                REALLOCATE (pt->matches, int, pt->arrayLength);
+            }
         }
     }
-      
-  }
-  if (VERBOSE) fprintf (stderr, "found %d overlapping images\n", nmatch);
+ }
+ if (VERBOSE) fprintf (stderr, "found %d overlapping images\n", totalMatches);
   
-  *Nmatch = nmatch;
-  return (match);
+ return (totalMatches);
 }
   
Index: /branches/eam_branches/20090715/Ohana/src/getstar/src/dvoImagesAtCoords.c
===================================================================
--- /branches/eam_branches/20090715/Ohana/src/getstar/src/dvoImagesAtCoords.c	(revision 25405)
+++ /branches/eam_branches/20090715/Ohana/src/getstar/src/dvoImagesAtCoords.c	(revision 25406)
@@ -1,12 +1,6 @@
 # include "dvoImagesAtCoords.h"
 
-typedef struct {
-    int     id;
-    double  ra;
-    double  dec;
-} Point;
-
 static int readPoints(char *filename, Point **pointsOut);
-static int ListImagesAtCoords (Image *dbImages, int id, double ra, double dec, int *matches, int Nmatches);
+static int ListImagesAtCoords (Image *dbImages, Point *points, int Npoints);
 
 int main (int argc, char **argv) {
@@ -30,5 +24,5 @@
   if (astromFile) {
       dbImages = ReadImageFiles(astromFile, &NdbImages);
-    } else {
+  } else {
     /*** update the image table ***/
     /* setup image table format and lock */
@@ -53,10 +47,8 @@
   }
   
-  Point *pt;
-  for (i = 0, pt = points; i < Npoints; i++, pt++) {
-    matches = MatchCoords (dbImages, NdbImages, pt->ra, pt->dec, &Nmatches);
-    ListImagesAtCoords(dbImages, pt->id, pt->ra, pt->dec, matches, Nmatches);
+  if (MatchCoords (dbImages, NdbImages, points, Npoints)) {
+    ListImagesAtCoords(dbImages, points, Npoints);
   }
-
+  // XXX: should we exit with nonzero status if no matches were found?
   exit (0);
 }
@@ -83,6 +75,9 @@
 
     while ((Nread = fscanf(f, "%d %lf %lf\n", &pts[Npoints].id, &pts[Npoints].ra, &pts[Npoints].dec)) == 3) {
-        Npoints++;
-        if (Npoints >= LEN) {
+        pts[Npoints].Nmatches = 0;
+        ALLOCATE(pts[Npoints].matches, int, 20);
+        pts[Npoints].arrayLength = 20;
+
+        if (++Npoints >= LEN) {
             LEN += 20;
             REALLOCATE(pts, Point, LEN);
@@ -99,24 +94,33 @@
 }
 
-static int ListImagesAtCoords (Image *dbImages, int id, double ra, double dec, int *matches, int Nmatches)
+static int ListImagesAtCoords (Image *dbImages, Point *points, int Npoints) 
 {
+  int j;
   int i;
-  for (i = 0; i < Nmatches; i++) {
-    int N = matches[i];
+  for (j = 0; j < Npoints; j++) {
+      Point *pt = points + j;
+      for (i = 0; i < pt->Nmatches; i++) {
+        int N = pt->matches[i];
 
-    char *name;
-    // output of lookup is filename[class_id.hdr] for astrometry files
-    char *left_bracket = rindex(dbImages[N].name, '[');
-    if (left_bracket) {
-        name = strdup(left_bracket + 1);
-        // zap the .hdr]
-        char *dot = index(name, '.');
-        if (dot) {
-            *dot = 0;
+        char *name;
+        char *copy = NULL;
+        // output of lookup is filename[class_id.hdr] for astrometry files
+        char *left_bracket = rindex(dbImages[N].name, '[');
+        if (left_bracket) {
+            copy = strdup(left_bracket + 1);
+            name = copy;
+            // zap the .hdr]
+            char *dot = index(name, '.');
+            if (dot) {
+                *dot = 0;
+            }
+        } else {
+            name = dbImages[N].name;
         }
-    } else {
-        name = dbImages[N].name;
+        fprintf (stdout, "%d %lf %lf %s\n", pt->id, pt->ra, pt->dec, name);
+        if  (copy) {
+            free(copy);
+        }
     }
-    fprintf (stdout, "%d %lf %lf %s\n", id, ra, dec, name);
   }
   
Index: /branches/eam_branches/20090715/Ohana/src/opihi/dvo/dbExtractMeasures.c
===================================================================
--- /branches/eam_branches/20090715/Ohana/src/opihi/dvo/dbExtractMeasures.c	(revision 25405)
+++ /branches/eam_branches/20090715/Ohana/src/opihi/dvo/dbExtractMeasures.c	(revision 25406)
@@ -296,6 +296,6 @@
       value.Flt = pow (10.0, measure[0].dt * 0.4);
       break;
-    case MEAS_PHOTCODE: /* OK */
-      value.Int = measure[0].photcode;
+    case MEAS_PHOTCODE_EQUIV: /* OK */
+      value.Int = GetPhotcodeEquivCodebyCode (measure[0].photcode);
       break;
     case MEAS_TIME: /* OK */
Index: /branches/eam_branches/20090715/Ohana/src/opihi/dvo/dbFields.c
===================================================================
--- /branches/eam_branches/20090715/Ohana/src/opihi/dvo/dbFields.c	(revision 25405)
+++ /branches/eam_branches/20090715/Ohana/src/opihi/dvo/dbFields.c	(revision 25406)
@@ -11,5 +11,5 @@
     if (fields[i].photcode != NULL) {
       if (fields[i].photcode[0].type == PHOT_MAG) {
-	free (fields[i].photcode);
+        free (fields[i].photcode);
       }
     }
@@ -30,18 +30,18 @@
 int GetMagMode (char *string) {
 
-  if (!strcasecmp (string, "inst"))  	 return (MAG_INST);
-  if (!strcasecmp (string, "cat"))   	 return (MAG_CAT);
-  if (!strcasecmp (string, "sys"))   	 return (MAG_SYS);
-  if (!strcasecmp (string, "rel"))   	 return (MAG_REL);
-  if (!strcasecmp (string, "cal"))   	 return (MAG_CAL);
-  if (!strcasecmp (string, "ave"))   	 return (MAG_AVE);
-  if (!strcasecmp (string, "ref"))   	 return (MAG_REF);
-  if (!strcasecmp (string, "ap"))   	 return (MAG_APER);
-  if (!strcasecmp (string, "aper"))   	 return (MAG_APER);
-  if (!strcasecmp (string, "err"))   	 return (MAG_ERR);
+  if (!strcasecmp (string, "inst"))      return (MAG_INST);
+  if (!strcasecmp (string, "cat"))       return (MAG_CAT);
+  if (!strcasecmp (string, "sys"))       return (MAG_SYS);
+  if (!strcasecmp (string, "rel"))       return (MAG_REL);
+  if (!strcasecmp (string, "cal"))       return (MAG_CAL);
+  if (!strcasecmp (string, "ave"))       return (MAG_AVE);
+  if (!strcasecmp (string, "ref"))       return (MAG_REF);
+  if (!strcasecmp (string, "ap"))        return (MAG_APER);
+  if (!strcasecmp (string, "aper"))      return (MAG_APER);
+  if (!strcasecmp (string, "err"))       return (MAG_ERR);
   if (!strcasecmp (string, "photflags")) return (MAG_PHOT_FLAGS);
-  if (!strcasecmp (string, "chisq")) 	 return (MAG_CHISQ);
-  if (!strcasecmp (string, "ncode")) 	 return (MAG_NCODE);
-  if (!strcasecmp (string, "nphot")) 	 return (MAG_NPHOT);
+  if (!strcasecmp (string, "chisq"))     return (MAG_CHISQ);
+  if (!strcasecmp (string, "ncode"))     return (MAG_NCODE);
+  if (!strcasecmp (string, "nphot"))     return (MAG_NPHOT);
   return (MAG_NONE);
 }
@@ -140,59 +140,60 @@
   }
 
-  if (!strcasecmp (fieldName, "RA"))         ESCAPE (MEAS_RA,   	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "DEC"))        ESCAPE (MEAS_DEC,  	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "RA:AVE"))     ESCAPE (MEAS_RA_AVE,      	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "DEC:AVE"))    ESCAPE (MEAS_DEC_AVE,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "RA:ERR"))     ESCAPE (MEAS_RA_AVE_ERR,  	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "DEC:ERR"))    ESCAPE (MEAS_DEC_AVE_ERR, 	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "uRA"))        ESCAPE (MEAS_U_RA,        	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "uDEC"))       ESCAPE (MEAS_U_DEC,       	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "duRA"))       ESCAPE (MEAS_U_RA_ERR,    	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "duDEC"))      ESCAPE (MEAS_U_DEC_ERR,   	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "PAR"))        ESCAPE (MEAS_PAR,         	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "dPAR"))       ESCAPE (MEAS_PAR_ERR,        MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "dR"))         ESCAPE (MEAS_RA_OFFSET,   	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "dD"))         ESCAPE (MEAS_DEC_OFFSET,  	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "dR:FIT"))     ESCAPE (MEAS_RA_FIT_OFFSET,  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "dD:FIT"))     ESCAPE (MEAS_DEC_FIT_OFFSET, MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "dR:ERR"))     ESCAPE (MEAS_RA_OFFSET_ERR,  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "dD:ERR"))     ESCAPE (MEAS_DEC_OFFSET_ERR, MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "xp"))         ESCAPE (MEAS_XP,          	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "nmeas"))      ESCAPE (MEAS_NMEAS,       	  MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "nmiss"))      ESCAPE (MEAS_NMISS,       	  MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "objflags"))   ESCAPE (MEAS_OBJFLAGS,       MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "AIRMASS"))    ESCAPE (MEAS_AIRMASS,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "ALT"))        ESCAPE (MEAS_ALT,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "AZ"))         ESCAPE (MEAS_AZ,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "EXPTIME"))    ESCAPE (MEAS_EXPTIME,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "PHOTCODE"))   ESCAPE (MEAS_PHOTCODE,    	  MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "TIME"))       ESCAPE (MEAS_TIME,        	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "FWHM"))       ESCAPE (MEAS_FWHM,        	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "FWHM_MAJ"))   ESCAPE (MEAS_FWHM_MAJ,    	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "FWHM_MIN"))   ESCAPE (MEAS_FWHM_MIN,    	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "THETA"))      ESCAPE (MEAS_THETA,       	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "DOPHOT"))     ESCAPE (MEAS_DOPHOT,      	  MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "DB_FLAGS"))   ESCAPE (MEAS_DB_FLAGS,    	  MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "PHOT_FLAGS")) ESCAPE (MEAS_PHOT_FLAGS, 	  MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "XCCD"))       ESCAPE (MEAS_XCCD, 	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "YCCD"))       ESCAPE (MEAS_YCCD, 	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "XCCD:ERR"))   ESCAPE (MEAS_XCCD_ERR, 	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "YCCD:ERR"))   ESCAPE (MEAS_YCCD_ERR, 	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "XMOSAIC"))    ESCAPE (MEAS_XMOSAIC,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "YMOSAIC"))    ESCAPE (MEAS_YMOSAIC,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "XCHIP"))      ESCAPE (MEAS_XCCD, 	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "YCHIP"))      ESCAPE (MEAS_YCCD, 	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "XFPA"))       ESCAPE (MEAS_XMOSAIC,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "YFPA"))       ESCAPE (MEAS_YMOSAIC,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "DETID"))      ESCAPE (MEAS_DET_ID,     	  MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "OBJID"))      ESCAPE (MEAS_OBJ_ID,     	  MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "CATID"))      ESCAPE (MEAS_CAT_ID,     	  MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "IMAGEID"))    ESCAPE (MEAS_IMAGE_ID,       MAG_NONE, OPIHI_INT);
-  if (!strcasecmp (fieldName, "PSF_QF"))     ESCAPE (MEAS_PSF_QF,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "PSF_CHISQ"))  ESCAPE (MEAS_PSF_CHISQ,      MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "CR_NSIGMA"))  ESCAPE (MEAS_CR_NSIGMA,      MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "EXT_NSIGMA")) ESCAPE (MEAS_EXT_NSIGMA,     MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "SKY"))        ESCAPE (MEAS_SKY,     	  MAG_NONE, OPIHI_FLT);
-  if (!strcasecmp (fieldName, "SKY_ERR"))    ESCAPE (MEAS_dSKY,     	  MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "RA"))         	 ESCAPE (MEAS_RA,             MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "DEC"))        	 ESCAPE (MEAS_DEC,            MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "RA:AVE"))     	 ESCAPE (MEAS_RA_AVE,         MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "DEC:AVE"))    	 ESCAPE (MEAS_DEC_AVE,        MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "RA:ERR"))     	 ESCAPE (MEAS_RA_AVE_ERR,     MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "DEC:ERR"))    	 ESCAPE (MEAS_DEC_AVE_ERR,    MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "uRA"))        	 ESCAPE (MEAS_U_RA,           MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "uDEC"))       	 ESCAPE (MEAS_U_DEC,          MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "duRA"))       	 ESCAPE (MEAS_U_RA_ERR,       MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "duDEC"))      	 ESCAPE (MEAS_U_DEC_ERR,      MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "PAR"))        	 ESCAPE (MEAS_PAR,            MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "dPAR"))       	 ESCAPE (MEAS_PAR_ERR,        MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "dR"))         	 ESCAPE (MEAS_RA_OFFSET,      MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "dD"))         	 ESCAPE (MEAS_DEC_OFFSET,     MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "dR:FIT"))     	 ESCAPE (MEAS_RA_FIT_OFFSET,  MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "dD:FIT"))     	 ESCAPE (MEAS_DEC_FIT_OFFSET, MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "dR:ERR"))     	 ESCAPE (MEAS_RA_OFFSET_ERR,  MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "dD:ERR"))     	 ESCAPE (MEAS_DEC_OFFSET_ERR, MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "xp"))         	 ESCAPE (MEAS_XP,             MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "nmeas"))      	 ESCAPE (MEAS_NMEAS,          MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "nmiss"))      	 ESCAPE (MEAS_NMISS,          MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "objflags"))   	 ESCAPE (MEAS_OBJFLAGS,       MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "AIRMASS"))    	 ESCAPE (MEAS_AIRMASS,        MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "ALT"))        	 ESCAPE (MEAS_ALT,            MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "AZ"))         	 ESCAPE (MEAS_AZ,             MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "EXPTIME"))    	 ESCAPE (MEAS_EXPTIME,        MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "PHOTCODE"))   	 ESCAPE (MEAS_PHOTCODE,       MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "PHOTCODE:EQUIV")) ESCAPE (MEAS_PHOTCODE_EQUIV, MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "TIME"))       	 ESCAPE (MEAS_TIME,           MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "FWHM"))       	 ESCAPE (MEAS_FWHM,           MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "FWHM_MAJ"))   	 ESCAPE (MEAS_FWHM_MAJ,       MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "FWHM_MIN"))   	 ESCAPE (MEAS_FWHM_MIN,       MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "THETA"))      	 ESCAPE (MEAS_THETA,          MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "DOPHOT"))     	 ESCAPE (MEAS_DOPHOT,         MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "DB_FLAGS"))   	 ESCAPE (MEAS_DB_FLAGS,       MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "PHOT_FLAGS")) 	 ESCAPE (MEAS_PHOT_FLAGS,     MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "XCCD"))       	 ESCAPE (MEAS_XCCD,           MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "YCCD"))       	 ESCAPE (MEAS_YCCD,           MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "XCCD:ERR"))   	 ESCAPE (MEAS_XCCD_ERR,       MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "YCCD:ERR"))   	 ESCAPE (MEAS_YCCD_ERR,       MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "XMOSAIC"))    	 ESCAPE (MEAS_XMOSAIC,        MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "YMOSAIC"))    	 ESCAPE (MEAS_YMOSAIC,        MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "XCHIP"))      	 ESCAPE (MEAS_XCCD,           MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "YCHIP"))      	 ESCAPE (MEAS_YCCD,           MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "XFPA"))       	 ESCAPE (MEAS_XMOSAIC,        MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "YFPA"))       	 ESCAPE (MEAS_YMOSAIC,        MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "DETID"))      	 ESCAPE (MEAS_DET_ID,         MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "OBJID"))      	 ESCAPE (MEAS_OBJ_ID,         MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "CATID"))      	 ESCAPE (MEAS_CAT_ID,         MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "IMAGEID"))    	 ESCAPE (MEAS_IMAGE_ID,       MAG_NONE, OPIHI_INT);
+  if (!strcasecmp (fieldName, "PSF_QF"))     	 ESCAPE (MEAS_PSF_QF,         MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "PSF_CHISQ"))  	 ESCAPE (MEAS_PSF_CHISQ,      MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "CR_NSIGMA"))  	 ESCAPE (MEAS_CR_NSIGMA,      MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "EXT_NSIGMA")) 	 ESCAPE (MEAS_EXT_NSIGMA,     MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "SKY"))        	 ESCAPE (MEAS_SKY,            MAG_NONE, OPIHI_FLT);
+  if (!strcasecmp (fieldName, "SKY_ERR"))    	 ESCAPE (MEAS_dSKY,           MAG_NONE, OPIHI_FLT);
 
   // for words that don't parse, try a photcode
Index: /branches/eam_branches/20090715/Ohana/src/opihi/dvo/dbStackOps.c
===================================================================
--- /branches/eam_branches/20090715/Ohana/src/opihi/dvo/dbStackOps.c	(revision 25405)
+++ /branches/eam_branches/20090715/Ohana/src/opihi/dvo/dbStackOps.c	(revision 25406)
@@ -4,4 +4,7 @@
   stack[0].type   = DB_STACK_NONE;
   stack[0].name   = NULL;
+  stack[0].field  = 0;
+  stack[0].FltValue = 0.0;
+  stack[0].IntValue = 0;
 }
 
Index: /branches/eam_branches/20090715/Ohana/src/opihi/include/dvoshell.h
===================================================================
--- /branches/eam_branches/20090715/Ohana/src/opihi/include/dvoshell.h	(revision 25405)
+++ /branches/eam_branches/20090715/Ohana/src/opihi/include/dvoshell.h	(revision 25406)
@@ -83,4 +83,5 @@
       MEAS_AZ, 
       MEAS_PHOTCODE, 
+      MEAS_PHOTCODE_EQUIV, 
       MEAS_TIME, 
       MEAS_FWHM, 
Index: /branches/eam_branches/20090715/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
===================================================================
--- /branches/eam_branches/20090715/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 25405)
+++ /branches/eam_branches/20090715/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm	(revision 25406)
@@ -21,5 +21,4 @@
 
 use IPC::Cmd 0.36 qw( can_run run );
-
 use PS::IPP::Metadata::List qw( parse_md_list );
 use PS::IPP::Config qw( :standard );
@@ -34,6 +33,7 @@
     my $req_type = shift;   # required
     my $img_type = shift;   # required
-    my $id       = shift;   # required unless req_type eq bycoord
+    my $id       = shift;   # required unless req_type eq bycoord or byskycell
     my $component= shift;   # class_id or skycell_id
+    my $inverse  = shift;
     my $x        = shift;
     my $y        = shift;
@@ -43,7 +43,9 @@
     my $verbose  = shift;
 
+
     # we die in response to bad data in request files
     die "Unknown req_type: $req_type" if ($req_type ne "byid") and ($req_type ne "byexp")
                                         and ($req_type ne "bycoord") and ($req_type ne "bydiff");
+
     if (($req_type eq "byid") and ($img_type eq "diff")) {
         # lookups of all of the information for diff images requires a two level lookup to
@@ -51,29 +53,35 @@
         # in one place
         $req_type = "bydiff";
-    }
+        my $results = lookup_diff($ipprc, $image_db, $id, $component, 1, $inverse, $img_type, $verbose);
+        return $results;
+    }
+
     if ($req_type eq "bydiff") {
-        my $results = lookup_bydiff($ipprc, $image_db, $id, $img_type, $verbose);
+        my $results = lookup_diff($ipprc, $image_db, $id, $component, 0, $inverse, $img_type, $verbose);
         if (!$results) {
             return undef;
         }
-        if (($img_type eq "warp") or ($img_type eq "diff")) {
-            # lookup_bydiff has done all of the work
-            return [$results];
-        } elsif (($img_type eq "raw") or ($img_type eq "chip")) {
+        if ($img_type eq "diff") {
+            # lookup_diff has done all of the work
+            return $results;
+        } 
+
+        my $image = $results->[0];
+        if (($img_type eq "raw") or ($img_type eq "chip")) {
             $req_type = "byexp";
-            $id = $results->{exp_name};
+            $id = $image->{exp_name};
             return undef if !$id;
             # fall through and lookup byexp
-#        } elsif ($img_type eq "warp") {
-#            $req_type = "byid";
-#            $id = $results->{warp_id};
-#            $component = $results->{skycell_id};
-#            return undef if !$id;
-#            # fall through and lookup by warp_id 
+        } elsif ($img_type eq "warp") {
+            $req_type = "byid";
+            $id = $image->{warp_id};
+            $component = $image->{skycell_id};
+            return undef if !$id;
+            # fall through and lookup by warp_id
         } elsif ($img_type eq "stack") {
             $req_type = "byid";
-            $id = $results->{stack_id};
+            $id = $image->{stack_id};
             return undef if !$id;
-            # fall though and lookup by stack id
+            # fall though and lookup by stack_id
         } else {
             # shouldn't I check this elsewhere?
@@ -225,4 +233,9 @@
             # just above probably solved the problem I was trying to solve with this test)
             next if !$base;
+        } else {
+            # raw images don't have path_base yet. Manufacture one
+            my $uri = $image->{uri};
+            my $path_base = $uri =~ s/\.fits//g;
+            $image->{$path_base} = $path_base;
         }
         if (!$camera) {
@@ -254,8 +267,11 @@
     return $output;
 }
-sub lookup_bydiff {
+sub lookup_diff {
     my $ipprc    = shift;
     my $image_db = shift;
     my $id       = shift;
+    my $skycell_id = shift;
+    my $byid     = shift;
+    my $inverse  = shift;
     my $img_type = shift;
     my $verbose = shift;
@@ -268,5 +284,12 @@
     }
 
-    my $command = "$difftool -diffskyfile -diff_image_id $id -dbname $image_db";
+    my $command = "$difftool -diffskyfile -dbname $image_db";
+    
+    if ($byid) {
+        $command .= " -diff_id $id";
+    } else {
+        $command .= " -diff_skyfile_id $id";
+    }
+    $command .= " -skycell_id $skycell_id" if $skycell_id;
 
     # run the tool and parse the output
@@ -289,5 +312,5 @@
 
     my $n = @$images;
-    if ($n > 1) {
+    if (!$byid && ($n > 1)) {
         die ("difftool returned an unexpected number of diffskyfiles: $n");
     } elsif ($n == 0) {
@@ -295,78 +318,65 @@
     }
 
-    my $image = $images->[0];
-
-    my $skycell_id = $image->{skycell_id};
-
-    if ($image->{fault}) {
-        print STDERR "selected difference image $id $image->{diff_id} $skycell_id has fault: $image->{fault}\n";
-        return undef;
-    }
-
-    # The standard way to do a diff is warp - stack 
-    # so we interpret the requested image in that way
-
-    my $stack_id = $image->{stack2};
-    # XXX difftool currently returns max long long for null
-    # this line is ready if we switch the code to return zero for null
-    if ($stack_id and ($stack_id != 9223372036854775807)) {
-        $image->{stack_id} = $stack_id;
-    }
-
-    my $warp_id =  $image->{warp1};
-    # XXX difftool currently returns max long long for null
-    # this line is ready if we switch the code to return zero for null
-    if ($warp_id and ($warp_id != 9223372036854775807)) {
-        $image->{warp_id} = $warp_id;
-
-        ## now use the warp and go get the exposure information
-        $command = "warptool -warped -warp_id $warp_id -skycell_id $skycell_id -dbname $image_db -limit 1";
-        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-                    run(command => $command, verbose => $verbose);
-        unless ($success) {
-            # not sure if we should die here
-            print STDERR @$stderr_buf;
-            return undef;
-        }
-
-        my $buf = join "", @$stdout_buf;
-        if (!$buf) {
-            return undef;
-        }
-
-        my $mdcParser = PS::IPP::Metadata::Config->new;
-        my $warps = parse_md_fast($mdcParser, $buf)
-            or die ("Unable to parse metadata config doc");
-        my $warp = $warps->[0];
-
-        if ($img_type eq "warp") {
-            $image = $warp;
+    my @results;
+    foreach my $image (@$images) {
+        my $skycell_id = $image->{skycell_id};
+
+        if ($image->{fault}) {
+            print STDERR "selected difference image $id $image->{diff_id} $skycell_id has fault: $image->{fault}\n";
+            next;
+        }
+
+        # The standard way to do a diff is warp - stack 
+        # so we interpret the requested image in that way
+
+        my $stack_id = $image->{stack2};
+        # XXX difftool currently returns max long long for null
+        # this line is ready if we switch the code to return zero for null
+        if ($stack_id and ($stack_id != 9223372036854775807)) {
+            $image->{stack_id} = $stack_id;
+        }
+
+        my ($warp_id, $exp_id, $exp_name);
+        if ($inverse and !$image->{bothways}) {
+            print STDERR "Inverse images requested for diffRun that is not bothways. Ignoring.\n";
+            $inverse = 0;
+        }
+        if ($inverse) {
+            $warp_id =  $image->{warp2};
+            $exp_id = $image->{exp_id_2};
+            $exp_name = $image->{exp_name_2};
         } else {
-            $image->{exp_id} = $warp->{exp_id};
-            $image->{exp_name} = $warp->{exp_name};
-            $image->{camera} = $warp->{camera};
-        }
-    }
-
-    if (($img_type eq "diff") or ($img_type eq "warp")) {
-        # the $image is going to be returned directly in this case so we need to duplicate
-        # some of processing that lookup does for other img_types
-        $image->{image} = $image->{uri};
-        if ($image->{camera}) {
-            $ipprc->define_camera($image->{camera});
-            if ($img_type eq "diff") {
-                $image->{mask}   = $ipprc->filename("PPSUB.OUTPUT.MASK", $image->{path_base});
-                $image->{weight} = $ipprc->filename("PPSUB.OUTPUT.VARIANCE", $image->{path_base});
+            $warp_id =  $image->{warp1};
+            $exp_id = $image->{exp_id_1};
+            $exp_name = $image->{exp_name_1};
+        }
+        # XXX difftool currently returns max long long for null
+        # this line is ready if we switch the code to return zero for null
+        if ($warp_id and ($warp_id != 9223372036854775807)) {
+            $image->{warp_id} = $warp_id;
+            $image->{exp_id} = $exp_id;
+            $image->{exp_name} = $exp_name;
+        } else {
+            print STDERR "unexpected result warp_id not defined\n";
+            next;
+        }
+        if ($img_type eq "diff") {
+            # the $image is going to be returned directly in this case so we need to duplicate
+            # some of processing that lookup does for other img_types
+            if ($image->{camera}) {
+                $ipprc->define_camera($image->{camera});
+                my $filerule_base = $inverse ? "PPSUB.INVERSE" : "PPSUB.OUTPUT";
+                $image->{image}  = $ipprc->filename($filerule_base, $image->{path_base});
+                $image->{mask}   = $ipprc->filename($filerule_base . ".MASK", $image->{path_base});
+                $image->{weight} = $ipprc->filename($filerule_base . ".VARIANCE", $image->{path_base});
             } else {
-                $image->{mask}   = $ipprc->filename("PSWARP.OUTPUT.MASK",   $image->{path_base});
-                $image->{weight} = $ipprc->filename("PSWARP.OUTPUT.VARIANCE", $image->{path_base});
+                # XXX this will only happen if the minuend is not a warp
+                print STDERR "WARNING: cannot resolve camera so cannot get weight and mask images\n";
+                next;
             }
-        } else {
-            # XXX this will only happen if the minuend is not a warp
-            print STDERR "WARNING: cannot resolve camera so cannot get weight and mask images\n";
-        }
-    }
-
-    return $image;
+        }
+        push @results, $image;
+    }
+    return \@results;
 }
 
Index: /branches/eam_branches/20090715/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm
===================================================================
--- /branches/eam_branches/20090715/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm	(revision 25405)
+++ /branches/eam_branches/20090715/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm	(revision 25406)
@@ -22,4 +22,18 @@
                     $PSTAMP_SELECT_MASK
                     $PSTAMP_SELECT_WEIGHT
+                    $PSTAMP_SELECT_INVERSE
+                    $PSTAMP_SUCCESS
+                    $PSTAMP_SYSTEM_ERROR
+                    $PSTAMP_NOT_IMPLEMENTED
+                    $PSTAMP_UNKNOWN_ERROR
+                    $PSTAMP_DUP_REQUEST
+                    $PSTAMP_INVALID_REQUEST
+                    $PSTAMP_UNKNOWN_PRODUCT
+                    $PSTAMP_NO_IMAGE_MATCH
+                    $PSTAMP_NOT_DESTREAKED
+                    $PSTAMP_NOT_AVAILABLE
+                    $PSTAMP_GONE
+                    $PSTAMP_NO_JOBS_QUEUED
+                    $PSTAMP_NO_OVERLAP
                     );
 our %EXPORT_TAGS = (standard => [@EXPORT_OK]);
@@ -33,4 +47,23 @@
 our $PSTAMP_SELECT_MASK      = 2;
 our $PSTAMP_SELECT_WEIGHT    = 4;
+
+our $PSTAMP_SELECT_INVERSE   = 1024;
+
+# job and result codes
+# NOTE: these must match the values in pstamp/src/pstamp.h
+our $PSTAMP_SUCCESS          = 0;
+our $PSTAMP_SYSTEM_ERROR     = 10;
+our $PSTAMP_NOT_IMPLEMENTED  = 11;
+our $PSTAMP_UNKNOWN_ERROR    = 12;
+
+our $PSTAMP_DUP_REQUEST      = 20;
+our $PSTAMP_INVALID_REQUEST  = 21;
+our $PSTAMP_UNKNOWN_PRODUCT  = 22;
+our $PSTAMP_NO_IMAGE_MATCH   = 23;
+our $PSTAMP_NOT_DESTREAKED   = 24;
+our $PSTAMP_NOT_AVAILABLE    = 25;
+our $PSTAMP_GONE             = 26;
+our $PSTAMP_NO_JOBS_QUEUED   = 27;
+our $PSTAMP_NO_OVERLAP       = 28;
 
 use IPC::Cmd 0.36 qw( can_run run );
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/CVS/Entries
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/CVS/Entries	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/CVS/Entries	(revision 25406)
@@ -0,0 +1,8 @@
+/installcd-2.6.19.config/1.2/Fri Apr  4 21:09:33 2008//
+/installcd-stage1-minimal.spec/1.3/Fri Apr  4 21:09:33 2008/-kb/
+/installcd-stage2-minimal.spec/1.6/Fri Apr  4 21:09:33 2008/-kb/
+D/portage////
+/stage1.spec/1.3/Tue Jul  8 21:05:13 2008/-kb/
+/stage2.spec/1.3/Tue Jul  8 21:05:23 2008/-kb/
+/stage3.spec/1.3/Tue Jul  8 21:05:30 2008/-kb/
+/stage4.spec/1.1/Tue Jul  8 21:07:50 2008//
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/CVS/Repository
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/CVS/Repository	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/CVS/Repository	(revision 25406)
@@ -0,0 +1,1 @@
+datasys/IPP/hw/livecds/2007.0-specs
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/CVS/Root
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/CVS/Root	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/CVS/Root	(revision 25406)
@@ -0,0 +1,1 @@
+jhoblitt@cvs.pan-starrs.ifa.hawaii.edu:/cvsroot/pan-starrs
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/installcd-2.6.19.config
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/installcd-2.6.19.config	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/installcd-2.6.19.config	(revision 25406)
@@ -0,0 +1,2658 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.19-gentoo-r5
+# Sat Mar 10 22:04:41 2007
+#
+CONFIG_X86_64=y
+CONFIG_64BIT=y
+CONFIG_X86=y
+CONFIG_ZONE_DMA32=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_SEMAPHORE_SLEEPERS=y
+CONFIG_MMU=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_DMI=y
+CONFIG_AUDIT_ARCH=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_IPC_NS=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_BSD_PROCESS_ACCT=y
+CONFIG_BSD_PROCESS_ACCT_V3=y
+CONFIG_TASKSTATS=y
+# CONFIG_TASK_DELAY_ACCT is not set
+CONFIG_UTS_NS=y
+CONFIG_AUDIT=y
+CONFIG_AUDITSYSCALL=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_CPUSETS=y
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_TASK_XACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+# CONFIG_KALLSYMS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_MODVERSIONS=y
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+
+#
+# Block layer
+#
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+CONFIG_LSF=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+
+#
+# Processor type and features
+#
+CONFIG_X86_PC=y
+# CONFIG_X86_VSMP is not set
+CONFIG_MK8=y
+# CONFIG_MPSC is not set
+# CONFIG_GENERIC_CPU is not set
+CONFIG_X86_L1_CACHE_BYTES=64
+CONFIG_X86_L1_CACHE_SHIFT=6
+CONFIG_X86_INTERNODE_CACHE_BYTES=64
+CONFIG_X86_TSC=y
+CONFIG_X86_GOOD_APIC=y
+CONFIG_MICROCODE=m
+CONFIG_MICROCODE_OLD_INTERFACE=y
+CONFIG_X86_MSR=m
+CONFIG_X86_CPUID=m
+CONFIG_X86_IO_APIC=y
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_MTRR=y
+CONFIG_SMP=y
+CONFIG_SCHED_SMT=y
+CONFIG_SCHED_MC=y
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_PREEMPT_BKL=y
+# CONFIG_NUMA is not set
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_RESOURCES_64BIT=y
+CONFIG_NR_CPUS=32
+CONFIG_HOTPLUG_CPU=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_HPET_TIMER=y
+CONFIG_IOMMU=y
+CONFIG_CALGARY_IOMMU=y
+CONFIG_SWIOTLB=y
+CONFIG_X86_MCE=y
+CONFIG_X86_MCE_INTEL=y
+CONFIG_X86_MCE_AMD=y
+CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
+CONFIG_PHYSICAL_START=0x200000
+CONFIG_SECCOMP=y
+# CONFIG_CC_STACKPROTECTOR is not set
+CONFIG_HZ_100=y
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=100
+# CONFIG_REORDER is not set
+CONFIG_K8_NB=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_ISA_DMA_API=y
+CONFIG_GENERIC_PENDING_IRQ=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+CONFIG_PM_LEGACY=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_PM_SYSFS_DEPRECATED is not set
+CONFIG_SOFTWARE_SUSPEND=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_SUSPEND_SMP=y
+
+#
+# ACPI (Advanced Configuration and Power Interface) Support
+#
+CONFIG_ACPI=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_SLEEP_PROC_FS=y
+# CONFIG_ACPI_SLEEP_PROC_SLEEP is not set
+CONFIG_ACPI_AC=m
+CONFIG_ACPI_BATTERY=m
+CONFIG_ACPI_BUTTON=m
+CONFIG_ACPI_VIDEO=m
+CONFIG_ACPI_HOTKEY=m
+CONFIG_ACPI_FAN=m
+CONFIG_ACPI_DOCK=m
+CONFIG_ACPI_PROCESSOR=m
+CONFIG_ACPI_HOTPLUG_CPU=y
+CONFIG_ACPI_THERMAL=m
+CONFIG_ACPI_ASUS=m
+CONFIG_ACPI_IBM=m
+CONFIG_ACPI_TOSHIBA=m
+CONFIG_ACPI_BLACKLIST_YEAR=0
+# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_EC=y
+CONFIG_ACPI_POWER=y
+CONFIG_ACPI_SYSTEM=y
+CONFIG_X86_PM_TIMER=y
+CONFIG_ACPI_CONTAINER=m
+# CONFIG_ACPI_SBS is not set
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=m
+# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_STAT=m
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=m
+CONFIG_CPU_FREQ_GOV_USERSPACE=m
+CONFIG_CPU_FREQ_GOV_ONDEMAND=m
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
+
+#
+# CPUFreq processor drivers
+#
+CONFIG_X86_POWERNOW_K8=m
+CONFIG_X86_POWERNOW_K8_ACPI=y
+CONFIG_X86_SPEEDSTEP_CENTRINO=m
+CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y
+CONFIG_X86_ACPI_CPUFREQ=m
+
+#
+# shared options
+#
+# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set
+CONFIG_X86_P4_CLOCKMOD=m
+CONFIG_X86_SPEEDSTEP_LIB=m
+
+#
+# Bus options (PCI etc.)
+#
+CONFIG_PCI=y
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_MMCONFIG=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIEAER=y
+CONFIG_PCI_MSI=y
+# CONFIG_PCI_DEBUG is not set
+CONFIG_HT_IRQ=y
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+CONFIG_PCCARD=m
+# CONFIG_PCMCIA_DEBUG is not set
+CONFIG_PCMCIA=m
+CONFIG_PCMCIA_LOAD_CIS=y
+CONFIG_PCMCIA_IOCTL=y
+CONFIG_CARDBUS=y
+
+#
+# PC-card bridges
+#
+CONFIG_YENTA=m
+CONFIG_YENTA_O2=y
+CONFIG_YENTA_RICOH=y
+CONFIG_YENTA_TI=y
+CONFIG_YENTA_ENE_TUNE=y
+CONFIG_YENTA_TOSHIBA=y
+CONFIG_PD6729=m
+CONFIG_I82092=m
+CONFIG_PCCARD_NONSTATIC=m
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats / Emulations
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_IA32_EMULATION=y
+# CONFIG_IA32_AOUT is not set
+CONFIG_COMPAT=y
+CONFIG_SYSVIPC_COMPAT=y
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=m
+# CONFIG_XFRM_SUB_POLICY is not set
+CONFIG_NET_KEY=m
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+CONFIG_ASK_IP_FIB_HASH=y
+# CONFIG_IP_FIB_TRIE is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_MULTIPLE_TABLES=y
+# CONFIG_IP_ROUTE_FWMARK is not set
+CONFIG_IP_ROUTE_MULTIPATH=y
+# CONFIG_IP_ROUTE_MULTIPATH_CACHED is not set
+# CONFIG_IP_ROUTE_VERBOSE is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_NET_IPIP=m
+CONFIG_NET_IPGRE=m
+CONFIG_NET_IPGRE_BROADCAST=y
+CONFIG_IP_MROUTE=y
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+CONFIG_INET_AH=m
+CONFIG_INET_ESP=m
+CONFIG_INET_IPCOMP=m
+CONFIG_INET_XFRM_TUNNEL=m
+CONFIG_INET_TUNNEL=m
+CONFIG_INET_XFRM_MODE_TRANSPORT=m
+CONFIG_INET_XFRM_MODE_TUNNEL=m
+CONFIG_INET_XFRM_MODE_BEET=m
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+
+#
+# IP: Virtual Server Configuration
+#
+# CONFIG_IP_VS is not set
+CONFIG_IPV6=m
+CONFIG_IPV6_PRIVACY=y
+CONFIG_IPV6_ROUTER_PREF=y
+# CONFIG_IPV6_ROUTE_INFO is not set
+CONFIG_INET6_AH=m
+CONFIG_INET6_ESP=m
+CONFIG_INET6_IPCOMP=m
+# CONFIG_IPV6_MIP6 is not set
+CONFIG_INET6_XFRM_TUNNEL=m
+CONFIG_INET6_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_TRANSPORT=m
+CONFIG_INET6_XFRM_MODE_TUNNEL=m
+CONFIG_INET6_XFRM_MODE_BEET=m
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=m
+CONFIG_IPV6_TUNNEL=m
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+CONFIG_NETWORK_SECMARK=y
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+CONFIG_BRIDGE_NETFILTER=y
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NETFILTER_XTABLES=m
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
+# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set
+CONFIG_NETFILTER_XT_TARGET_DSCP=m
+CONFIG_NETFILTER_XT_TARGET_MARK=m
+CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
+# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set
+CONFIG_NETFILTER_XT_TARGET_SECMARK=m
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
+CONFIG_NETFILTER_XT_MATCH_COMMENT=m
+CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
+CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
+CONFIG_NETFILTER_XT_MATCH_DCCP=m
+CONFIG_NETFILTER_XT_MATCH_DSCP=m
+CONFIG_NETFILTER_XT_MATCH_ESP=m
+CONFIG_NETFILTER_XT_MATCH_HELPER=m
+CONFIG_NETFILTER_XT_MATCH_LENGTH=m
+CONFIG_NETFILTER_XT_MATCH_LIMIT=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_MARK=m
+CONFIG_NETFILTER_XT_MATCH_POLICY=m
+CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
+# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_QUOTA=m
+CONFIG_NETFILTER_XT_MATCH_REALM=m
+CONFIG_NETFILTER_XT_MATCH_SCTP=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
+CONFIG_NETFILTER_XT_MATCH_STRING=m
+CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+
+#
+# IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+CONFIG_IP_NF_CT_ACCT=y
+CONFIG_IP_NF_CONNTRACK_MARK=y
+CONFIG_IP_NF_CONNTRACK_SECMARK=y
+CONFIG_IP_NF_CONNTRACK_EVENTS=y
+CONFIG_IP_NF_CONNTRACK_NETLINK=m
+CONFIG_IP_NF_CT_PROTO_SCTP=m
+CONFIG_IP_NF_FTP=m
+CONFIG_IP_NF_IRC=m
+CONFIG_IP_NF_NETBIOS_NS=m
+CONFIG_IP_NF_TFTP=m
+CONFIG_IP_NF_AMANDA=m
+CONFIG_IP_NF_PPTP=m
+CONFIG_IP_NF_H323=m
+CONFIG_IP_NF_SIP=m
+# CONFIG_IP_NF_QUEUE is not set
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_MATCH_IPRANGE=m
+CONFIG_IP_NF_MATCH_TOS=m
+CONFIG_IP_NF_MATCH_RECENT=m
+CONFIG_IP_NF_MATCH_ECN=m
+CONFIG_IP_NF_MATCH_AH=m
+CONFIG_IP_NF_MATCH_TTL=m
+CONFIG_IP_NF_MATCH_OWNER=m
+CONFIG_IP_NF_MATCH_ADDRTYPE=m
+CONFIG_IP_NF_MATCH_HASHLIMIT=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_TARGET_LOG=m
+CONFIG_IP_NF_TARGET_ULOG=m
+CONFIG_IP_NF_TARGET_TCPMSS=m
+CONFIG_IP_NF_NAT=m
+CONFIG_IP_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=m
+CONFIG_IP_NF_TARGET_REDIRECT=m
+CONFIG_IP_NF_TARGET_NETMAP=m
+CONFIG_IP_NF_TARGET_SAME=m
+CONFIG_IP_NF_NAT_SNMP_BASIC=m
+CONFIG_IP_NF_NAT_IRC=m
+CONFIG_IP_NF_NAT_FTP=m
+CONFIG_IP_NF_NAT_TFTP=m
+CONFIG_IP_NF_NAT_AMANDA=m
+CONFIG_IP_NF_NAT_PPTP=m
+CONFIG_IP_NF_NAT_H323=m
+CONFIG_IP_NF_NAT_SIP=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_TOS=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_TARGET_CLUSTERIP=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP6_NF_QUEUE is not set
+CONFIG_IP6_NF_IPTABLES=m
+CONFIG_IP6_NF_MATCH_RT=m
+CONFIG_IP6_NF_MATCH_OPTS=m
+CONFIG_IP6_NF_MATCH_FRAG=m
+CONFIG_IP6_NF_MATCH_HL=m
+CONFIG_IP6_NF_MATCH_OWNER=m
+CONFIG_IP6_NF_MATCH_IPV6HEADER=m
+CONFIG_IP6_NF_MATCH_AH=m
+CONFIG_IP6_NF_MATCH_EUI64=m
+CONFIG_IP6_NF_FILTER=m
+CONFIG_IP6_NF_TARGET_LOG=m
+CONFIG_IP6_NF_TARGET_REJECT=m
+CONFIG_IP6_NF_MANGLE=m
+CONFIG_IP6_NF_TARGET_HL=m
+CONFIG_IP6_NF_RAW=m
+
+#
+# Bridge: Netfilter Configuration
+#
+# CONFIG_BRIDGE_NF_EBTABLES is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+CONFIG_ATM=m
+CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+CONFIG_BRIDGE=m
+CONFIG_VLAN_8021Q=m
+# CONFIG_DECNET is not set
+CONFIG_LLC=y
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+CONFIG_NET_SCHED=y
+# CONFIG_NET_SCH_CLK_JIFFIES is not set
+CONFIG_NET_SCH_CLK_GETTIMEOFDAY=y
+# CONFIG_NET_SCH_CLK_CPU is not set
+
+#
+# Queueing/Scheduling
+#
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_HTB=m
+CONFIG_NET_SCH_HFSC=m
+CONFIG_NET_SCH_ATM=m
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+# CONFIG_NET_SCH_NETEM is not set
+CONFIG_NET_SCH_INGRESS=m
+
+#
+# Classification
+#
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_BASIC=m
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+CONFIG_CLS_U32_PERF=y
+CONFIG_CLS_U32_MARK=y
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_EMATCH=y
+CONFIG_NET_EMATCH_STACK=32
+CONFIG_NET_EMATCH_CMP=m
+CONFIG_NET_EMATCH_NBYTE=m
+CONFIG_NET_EMATCH_U32=m
+CONFIG_NET_EMATCH_META=m
+CONFIG_NET_EMATCH_TEXT=m
+CONFIG_NET_CLS_ACT=y
+CONFIG_NET_ACT_POLICE=m
+CONFIG_NET_ACT_GACT=m
+CONFIG_GACT_PROB=y
+CONFIG_NET_ACT_MIRRED=m
+CONFIG_NET_ACT_IPT=m
+CONFIG_NET_ACT_PEDIT=m
+# CONFIG_NET_ACT_SIMP is not set
+# CONFIG_NET_CLS_IND is not set
+CONFIG_NET_ESTIMATOR=y
+
+#
+# Network testing
+#
+CONFIG_NET_PKTGEN=m
+# CONFIG_HAMRADIO is not set
+CONFIG_IRDA=m
+
+#
+# IrDA protocols
+#
+CONFIG_IRLAN=m
+CONFIG_IRNET=m
+CONFIG_IRCOMM=m
+CONFIG_IRDA_ULTRA=y
+
+#
+# IrDA options
+#
+CONFIG_IRDA_CACHE_LAST_LSAP=y
+CONFIG_IRDA_FAST_RR=y
+# CONFIG_IRDA_DEBUG is not set
+
+#
+# Infrared-port device drivers
+#
+
+#
+# SIR device drivers
+#
+CONFIG_IRTTY_SIR=m
+
+#
+# Dongle support
+#
+CONFIG_DONGLE=y
+CONFIG_ESI_DONGLE=m
+CONFIG_ACTISYS_DONGLE=m
+CONFIG_TEKRAM_DONGLE=m
+CONFIG_TOIM3232_DONGLE=m
+CONFIG_LITELINK_DONGLE=m
+CONFIG_MA600_DONGLE=m
+CONFIG_GIRBIL_DONGLE=m
+CONFIG_MCP2120_DONGLE=m
+CONFIG_OLD_BELKIN_DONGLE=m
+CONFIG_ACT200L_DONGLE=m
+
+#
+# Old SIR device drivers
+#
+
+#
+# Old Serial dongle support
+#
+
+#
+# FIR device drivers
+#
+CONFIG_USB_IRDA=m
+CONFIG_SIGMATEL_FIR=m
+CONFIG_NSC_FIR=m
+CONFIG_WINBOND_FIR=m
+CONFIG_SMC_IRCC_FIR=m
+CONFIG_ALI_FIR=m
+CONFIG_VLSI_FIR=m
+CONFIG_VIA_FIR=m
+CONFIG_MCS_FIR=m
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+# CONFIG_BT_CMTP is not set
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+CONFIG_BT_HCIUART=m
+CONFIG_BT_HCIUART_H4=y
+CONFIG_BT_HCIUART_BCSP=y
+CONFIG_BT_HCIBCM203X=m
+CONFIG_BT_HCIBPA10X=m
+CONFIG_BT_HCIBFUSB=m
+CONFIG_BT_HCIDTL1=m
+CONFIG_BT_HCIBT3C=m
+CONFIG_BT_HCIBLUECARD=m
+CONFIG_BT_HCIBTUART=m
+CONFIG_BT_HCIVHCI=m
+CONFIG_IEEE80211=m
+# CONFIG_IEEE80211_DEBUG is not set
+CONFIG_IEEE80211_CRYPT_WEP=m
+CONFIG_IEEE80211_CRYPT_CCMP=m
+CONFIG_IEEE80211_CRYPT_TKIP=m
+CONFIG_IEEE80211_SOFTMAC=m
+# CONFIG_IEEE80211_SOFTMAC_DEBUG is not set
+CONFIG_WIRELESS_EXT=y
+CONFIG_FIB_RULES=y
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+CONFIG_PARPORT_PC=m
+CONFIG_PARPORT_SERIAL=m
+CONFIG_PARPORT_PC_FIFO=y
+CONFIG_PARPORT_PC_SUPERIO=y
+CONFIG_PARPORT_PC_PCMCIA=m
+CONFIG_PARPORT_NOT_PC=y
+# CONFIG_PARPORT_GSC is not set
+CONFIG_PARPORT_AX88796=m
+CONFIG_PARPORT_1284=y
+
+#
+# Plug and Play support
+#
+CONFIG_PNP=y
+# CONFIG_PNP_DEBUG is not set
+
+#
+# Protocols
+#
+CONFIG_PNPACPI=y
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+CONFIG_PARIDE=m
+CONFIG_PARIDE_PARPORT=m
+
+#
+# Parallel IDE high-level drivers
+#
+CONFIG_PARIDE_PD=m
+CONFIG_PARIDE_PCD=m
+CONFIG_PARIDE_PF=m
+CONFIG_PARIDE_PT=m
+CONFIG_PARIDE_PG=m
+
+#
+# Parallel IDE protocol modules
+#
+CONFIG_PARIDE_ATEN=m
+CONFIG_PARIDE_BPCK=m
+CONFIG_PARIDE_COMM=m
+CONFIG_PARIDE_DSTR=m
+CONFIG_PARIDE_FIT2=m
+CONFIG_PARIDE_FIT3=m
+CONFIG_PARIDE_EPAT=m
+CONFIG_PARIDE_EPATC8=y
+CONFIG_PARIDE_EPIA=m
+CONFIG_PARIDE_FRIQ=m
+CONFIG_PARIDE_FRPW=m
+CONFIG_PARIDE_KBIC=m
+CONFIG_PARIDE_KTTI=m
+CONFIG_PARIDE_ON20=m
+CONFIG_PARIDE_ON26=m
+CONFIG_BLK_CPQ_DA=m
+CONFIG_BLK_CPQ_CISS_DA=m
+# CONFIG_CISS_SCSI_TAPE is not set
+CONFIG_BLK_DEV_DAC960=m
+CONFIG_BLK_DEV_UMEM=m
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+CONFIG_BLK_DEV_NBD=m
+CONFIG_BLK_DEV_SX8=m
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# Misc devices
+#
+# CONFIG_IBM_ASM is not set
+# CONFIG_SGI_IOC4 is not set
+CONFIG_TIFM_CORE=m
+CONFIG_TIFM_7XX1=m
+CONFIG_MSI_LAPTOP=m
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_IDE_MAX_HWIFS=8
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+# CONFIG_BLK_DEV_HD_IDE is not set
+CONFIG_BLK_DEV_IDEDISK=y
+CONFIG_IDEDISK_MULTI_MODE=y
+CONFIG_BLK_DEV_IDECS=m
+CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDETAPE=m
+CONFIG_BLK_DEV_IDEFLOPPY=m
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_CMD640=y
+CONFIG_BLK_DEV_CMD640_ENHANCED=y
+CONFIG_BLK_DEV_IDEPNP=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+CONFIG_BLK_DEV_OPTI621=y
+CONFIG_BLK_DEV_RZ1000=y
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+CONFIG_IDEDMA_PCI_AUTO=y
+# CONFIG_IDEDMA_ONLYDISK is not set
+CONFIG_BLK_DEV_AEC62XX=y
+CONFIG_BLK_DEV_ALI15X3=y
+# CONFIG_WDC_ALI15X3 is not set
+CONFIG_BLK_DEV_AMD74XX=y
+CONFIG_BLK_DEV_ATIIXP=y
+CONFIG_BLK_DEV_CMD64X=y
+CONFIG_BLK_DEV_TRIFLEX=y
+CONFIG_BLK_DEV_CY82C693=y
+CONFIG_BLK_DEV_CS5520=y
+CONFIG_BLK_DEV_CS5530=y
+CONFIG_BLK_DEV_HPT34X=y
+# CONFIG_HPT34X_AUTODMA is not set
+CONFIG_BLK_DEV_HPT366=y
+CONFIG_BLK_DEV_JMICRON=m
+CONFIG_BLK_DEV_SC1200=y
+CONFIG_BLK_DEV_PIIX=y
+CONFIG_BLK_DEV_IT821X=y
+CONFIG_BLK_DEV_NS87415=y
+CONFIG_BLK_DEV_PDC202XX_OLD=y
+# CONFIG_PDC202XX_BURST is not set
+CONFIG_BLK_DEV_PDC202XX_NEW=y
+CONFIG_BLK_DEV_SVWKS=y
+CONFIG_BLK_DEV_SIIMAGE=m
+CONFIG_BLK_DEV_SIS5513=y
+CONFIG_BLK_DEV_SLC90E66=y
+CONFIG_BLK_DEV_TRM290=y
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+CONFIG_IDEDMA_IVB=y
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+CONFIG_RAID_ATTRS=m
+CONFIG_SCSI=y
+CONFIG_SCSI_NETLINK=y
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_ST=m
+CONFIG_CHR_DEV_OSST=m
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=m
+CONFIG_CHR_DEV_SCH=m
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=m
+CONFIG_SCSI_FC_ATTRS=m
+CONFIG_SCSI_ISCSI_ATTRS=m
+CONFIG_SCSI_SAS_ATTRS=m
+CONFIG_SCSI_SAS_LIBSAS=m
+# CONFIG_SCSI_SAS_LIBSAS_DEBUG is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_ISCSI_TCP is not set
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=5000
+# CONFIG_AIC7XXX_DEBUG_ENABLE is not set
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+CONFIG_SCSI_AIC79XX=m
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=5000
+# CONFIG_AIC79XX_ENABLE_RD_STRM is not set
+# CONFIG_AIC79XX_DEBUG_ENABLE is not set
+CONFIG_AIC79XX_DEBUG_MASK=0
+# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
+CONFIG_SCSI_AIC94XX=m
+# CONFIG_AIC94XX_DEBUG is not set
+CONFIG_SCSI_ARCMSR=m
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=m
+CONFIG_MEGARAID_MAILBOX=m
+CONFIG_MEGARAID_LEGACY=m
+CONFIG_MEGARAID_SAS=m
+CONFIG_SCSI_HPTIOP=m
+CONFIG_SCSI_BUSLOGIC=m
+# CONFIG_SCSI_OMIT_FLASHPOINT is not set
+CONFIG_SCSI_DMX3191D=m
+CONFIG_SCSI_EATA=m
+CONFIG_SCSI_EATA_TAGGED_QUEUE=y
+CONFIG_SCSI_EATA_LINKED_COMMANDS=y
+CONFIG_SCSI_EATA_MAX_TAGS=16
+CONFIG_SCSI_FUTURE_DOMAIN=m
+CONFIG_SCSI_GDTH=m
+CONFIG_SCSI_IPS=m
+CONFIG_SCSI_INITIO=m
+CONFIG_SCSI_INIA100=m
+CONFIG_SCSI_PPA=m
+CONFIG_SCSI_IMM=m
+# CONFIG_SCSI_IZIP_EPP16 is not set
+# CONFIG_SCSI_IZIP_SLOW_CTR is not set
+CONFIG_SCSI_STEX=m
+CONFIG_SCSI_SYM53C8XX_2=m
+CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1
+CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
+CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
+CONFIG_SCSI_SYM53C8XX_MMIO=y
+# CONFIG_SCSI_IPR is not set
+CONFIG_SCSI_QLOGIC_1280=m
+CONFIG_SCSI_QLA_FC=m
+CONFIG_SCSI_QLA_ISCSI=m
+CONFIG_SCSI_LPFC=m
+CONFIG_SCSI_DC395x=m
+CONFIG_SCSI_DC390T=m
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# PCMCIA SCSI adapter support
+#
+CONFIG_PCMCIA_FDOMAIN=m
+CONFIG_PCMCIA_QLOGIC=m
+CONFIG_PCMCIA_SYM53C500=m
+
+#
+# Serial ATA (prod) and Parallel ATA (experimental) drivers
+#
+CONFIG_ATA=m
+CONFIG_SATA_AHCI=m
+CONFIG_SATA_SVW=m
+CONFIG_ATA_PIIX=m
+CONFIG_SATA_MV=m
+CONFIG_SATA_NV=m
+CONFIG_PDC_ADMA=m
+CONFIG_SATA_QSTOR=m
+CONFIG_SATA_PROMISE=m
+CONFIG_SATA_SX4=m
+CONFIG_SATA_SIL=m
+CONFIG_SATA_SIL24=m
+CONFIG_SATA_SIS=m
+CONFIG_SATA_ULI=m
+CONFIG_SATA_VIA=m
+CONFIG_SATA_VITESSE=m
+CONFIG_SATA_INTEL_COMBINED=y
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PCMCIA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_LINEAR=m
+CONFIG_MD_RAID0=m
+CONFIG_MD_RAID1=m
+CONFIG_MD_RAID10=m
+CONFIG_MD_RAID456=m
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=m
+CONFIG_MD_FAULTY=m
+CONFIG_BLK_DEV_DM=m
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+CONFIG_DM_ZERO=m
+CONFIG_DM_MULTIPATH=m
+CONFIG_DM_MULTIPATH_EMC=m
+CONFIG_BLK_DEV_DM_BBR=m
+
+#
+# Fusion MPT device support
+#
+CONFIG_FUSION=y
+CONFIG_FUSION_SPI=m
+CONFIG_FUSION_FC=m
+CONFIG_FUSION_SAS=m
+CONFIG_FUSION_MAX_SGE=128
+CONFIG_FUSION_CTL=m
+CONFIG_FUSION_LAN=m
+
+#
+# IEEE 1394 (FireWire) support
+#
+CONFIG_IEEE1394=m
+
+#
+# Subsystem Options
+#
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+# CONFIG_IEEE1394_OUI_DB is not set
+CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y
+CONFIG_IEEE1394_CONFIG_ROM_IP1394=y
+# CONFIG_IEEE1394_EXPORT_FULL_API is not set
+
+#
+# Device Drivers
+#
+# CONFIG_IEEE1394_PCILYNX is not set
+CONFIG_IEEE1394_OHCI1394=m
+
+#
+# Protocol Drivers
+#
+CONFIG_IEEE1394_VIDEO1394=m
+CONFIG_IEEE1394_SBP2=m
+CONFIG_IEEE1394_ETH1394=m
+CONFIG_IEEE1394_DV1394=m
+CONFIG_IEEE1394_RAWIO=m
+
+#
+# I2O device support
+#
+CONFIG_I2O=m
+# CONFIG_I2O_LCT_NOTIFY_ON_CHANGES is not set
+CONFIG_I2O_EXT_ADAPTEC=y
+CONFIG_I2O_EXT_ADAPTEC_DMA64=y
+CONFIG_I2O_CONFIG=m
+CONFIG_I2O_CONFIG_OLD_IOCTL=y
+CONFIG_I2O_BUS=m
+CONFIG_I2O_BLOCK=m
+CONFIG_I2O_SCSI=m
+CONFIG_I2O_PROC=m
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_IFB is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+CONFIG_NET_SB1000=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+CONFIG_MARVELL_PHY=m
+CONFIG_DAVICOM_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_LXT_PHY=m
+CONFIG_CICADA_PHY=m
+CONFIG_VITESSE_PHY=m
+CONFIG_SMSC_PHY=m
+CONFIG_FIXED_PHY=m
+CONFIG_FIXED_MII_10_FDX=y
+CONFIG_FIXED_MII_100_FDX=y
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=m
+CONFIG_HAPPYMEAL=m
+CONFIG_SUNGEM=m
+CONFIG_CASSINI=m
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+
+#
+# Tulip family network device support
+#
+CONFIG_NET_TULIP=y
+CONFIG_DE2104X=m
+CONFIG_TULIP=m
+CONFIG_TULIP_MWI=y
+CONFIG_TULIP_MMIO=y
+CONFIG_TULIP_NAPI=y
+CONFIG_TULIP_NAPI_HW_MITIGATION=y
+CONFIG_DE4X5=m
+CONFIG_WINBOND_840=m
+CONFIG_DM9102=m
+CONFIG_ULI526X=m
+CONFIG_PCMCIA_XIRCOM=m
+CONFIG_HP100=m
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+# CONFIG_PCNET32_NAPI is not set
+CONFIG_AMD8111_ETH=m
+# CONFIG_AMD8111E_NAPI is not set
+CONFIG_ADAPTEC_STARFIRE=m
+# CONFIG_ADAPTEC_STARFIRE_NAPI is not set
+CONFIG_B44=m
+CONFIG_FORCEDETH=m
+# CONFIG_FORCEDETH_NAPI is not set
+CONFIG_DGRS=m
+# CONFIG_EEPRO100 is not set
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+CONFIG_8139TOO_TUNE_TWISTER=y
+CONFIG_8139TOO_8129=y
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+CONFIG_SUNDANCE_MMIO=y
+CONFIG_VIA_RHINE=m
+CONFIG_VIA_RHINE_MMIO=y
+CONFIG_VIA_RHINE_NAPI=y
+CONFIG_NET_POCKET=y
+CONFIG_ATP=m
+CONFIG_DE600=m
+CONFIG_DE620=m
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+# CONFIG_E1000_NAPI is not set
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+CONFIG_YELLOWFIN=m
+CONFIG_R8169=m
+# CONFIG_R8169_NAPI is not set
+CONFIG_R8169_VLAN=y
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+CONFIG_SKY2=m
+# CONFIG_SK98LIN is not set
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_QLA3XXX=m
+
+#
+# Ethernet (10000 Mbit)
+#
+CONFIG_CHELSIO_T1=m
+CONFIG_IXGB=m
+# CONFIG_IXGB_NAPI is not set
+CONFIG_S2IO=m
+# CONFIG_S2IO_NAPI is not set
+CONFIG_MYRI10GE=m
+
+#
+# Token Ring devices
+#
+CONFIG_TR=y
+CONFIG_IBMOL=m
+CONFIG_3C359=m
+CONFIG_TMS380TR=m
+CONFIG_TMSPCI=m
+CONFIG_ABYSS=m
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+CONFIG_NET_WIRELESS_RTNETLINK=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+CONFIG_STRIP=m
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+CONFIG_PCMCIA_RAYCS=m
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_IPW2100=m
+CONFIG_IPW2100_MONITOR=y
+# CONFIG_IPW2100_DEBUG is not set
+CONFIG_IPW2200=m
+CONFIG_IPW2200_MONITOR=y
+CONFIG_IPW2200_RADIOTAP=y
+CONFIG_IPW2200_PROMISCUOUS=y
+CONFIG_IPW2200_QOS=y
+# CONFIG_IPW2200_DEBUG is not set
+CONFIG_AIRO=m
+CONFIG_HERMES=m
+CONFIG_PLX_HERMES=m
+CONFIG_TMD_HERMES=m
+CONFIG_NORTEL_HERMES=m
+CONFIG_PCI_HERMES=m
+CONFIG_ATMEL=m
+CONFIG_PCI_ATMEL=m
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+CONFIG_PCMCIA_HERMES=m
+CONFIG_PCMCIA_SPECTRUM=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+
+#
+# Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support
+#
+CONFIG_PRISM54=m
+CONFIG_USB_ZD1201=m
+CONFIG_HOSTAP=m
+CONFIG_HOSTAP_FIRMWARE=y
+CONFIG_HOSTAP_FIRMWARE_NVRAM=y
+CONFIG_HOSTAP_PLX=m
+CONFIG_HOSTAP_PCI=m
+CONFIG_HOSTAP_CS=m
+CONFIG_BCM43XX=m
+CONFIG_BCM43XX_DEBUG=y
+CONFIG_BCM43XX_DMA=y
+CONFIG_BCM43XX_PIO=y
+CONFIG_BCM43XX_DMA_AND_PIO_MODE=y
+# CONFIG_BCM43XX_DMA_MODE is not set
+# CONFIG_BCM43XX_PIO_MODE is not set
+CONFIG_ZD1211RW=m
+# CONFIG_ZD1211RW_DEBUG is not set
+CONFIG_NET_WIRELESS=y
+
+#
+# PCMCIA network device support
+#
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_3C589=m
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_PCMCIA_AXNET=m
+
+#
+# Wan interfaces
+#
+CONFIG_WAN=y
+CONFIG_DSCC4=m
+CONFIG_DSCC4_PCISYNC=y
+CONFIG_DSCC4_PCI_RST=y
+CONFIG_LANMEDIA=m
+CONFIG_HDLC=m
+CONFIG_HDLC_RAW=m
+CONFIG_HDLC_RAW_ETH=m
+CONFIG_HDLC_CISCO=m
+CONFIG_HDLC_FR=m
+CONFIG_HDLC_PPP=m
+
+#
+# X.25/LAPB support is disabled
+#
+CONFIG_PCI200SYN=m
+CONFIG_WANXL=m
+CONFIG_PC300=m
+CONFIG_PC300_MLPPP=y
+
+#
+# Cyclades-PC300 MLPPP support is disabled.
+#
+
+#
+# Refer to the file README.mlppp, provided by PC300 package.
+#
+CONFIG_FARSYNC=m
+CONFIG_DLCI=m
+CONFIG_DLCI_COUNT=24
+CONFIG_DLCI_MAX=8
+CONFIG_SBNI=m
+CONFIG_SBNI_MULTILINE=y
+
+#
+# ATM drivers
+#
+# CONFIG_ATM_DUMMY is not set
+# CONFIG_ATM_TCP is not set
+# CONFIG_ATM_LANAI is not set
+# CONFIG_ATM_ENI is not set
+# CONFIG_ATM_FIRESTREAM is not set
+# CONFIG_ATM_ZATM is not set
+# CONFIG_ATM_IDT77252 is not set
+# CONFIG_ATM_AMBASSADOR is not set
+# CONFIG_ATM_HORIZON is not set
+# CONFIG_ATM_FORE200E_MAYBE is not set
+# CONFIG_ATM_HE is not set
+CONFIG_FDDI=y
+CONFIG_DEFXX=m
+CONFIG_SKFP=m
+CONFIG_HIPPI=y
+CONFIG_ROADRUNNER=m
+# CONFIG_ROADRUNNER_LARGE_RINGS is not set
+CONFIG_PLIP=m
+CONFIG_PPP=m
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
+CONFIG_PPP_DEFLATE=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_MPPE=m
+CONFIG_PPPOE=m
+CONFIG_PPPOATM=m
+CONFIG_SLIP=m
+CONFIG_SLIP_COMPRESSED=y
+CONFIG_SLHC=m
+CONFIG_SLIP_SMART=y
+CONFIG_SLIP_MODE_SLIP6=y
+CONFIG_NET_FC=y
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+CONFIG_ISDN=m
+
+#
+# Old ISDN4Linux
+#
+# CONFIG_ISDN_I4L is not set
+
+#
+# CAPI subsystem
+#
+CONFIG_ISDN_CAPI=m
+# CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON is not set
+CONFIG_ISDN_CAPI_MIDDLEWARE=y
+CONFIG_ISDN_CAPI_CAPI20=m
+CONFIG_ISDN_CAPI_CAPIFS_BOOL=y
+CONFIG_ISDN_CAPI_CAPIFS=m
+
+#
+# CAPI hardware drivers
+#
+
+#
+# Active AVM cards
+#
+CONFIG_CAPI_AVM=y
+CONFIG_ISDN_DRV_AVMB1_B1PCI=m
+CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y
+CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m
+CONFIG_ISDN_DRV_AVMB1_AVM_CS=m
+CONFIG_ISDN_DRV_AVMB1_T1PCI=m
+CONFIG_ISDN_DRV_AVMB1_C4=m
+
+#
+# Active Eicon DIVA Server cards
+#
+CONFIG_CAPI_EICON=y
+CONFIG_ISDN_DIVAS=m
+CONFIG_ISDN_DIVAS_BRIPCI=y
+CONFIG_ISDN_DIVAS_PRIPCI=y
+CONFIG_ISDN_DIVAS_DIVACAPI=m
+CONFIG_ISDN_DIVAS_USERIDI=m
+CONFIG_ISDN_DIVAS_MAINT=m
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+CONFIG_INPUT_FF_MEMLESS=m
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+CONFIG_INPUT_JOYDEV=y
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_KEYBOARD_SUNKBD=m
+CONFIG_KEYBOARD_LKKBD=m
+CONFIG_KEYBOARD_XTKBD=m
+CONFIG_KEYBOARD_NEWTON=m
+CONFIG_KEYBOARD_STOWAWAY=m
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_MOUSE_VSXXXAA is not set
+CONFIG_INPUT_JOYSTICK=y
+CONFIG_JOYSTICK_ANALOG=m
+CONFIG_JOYSTICK_A3D=m
+CONFIG_JOYSTICK_ADI=m
+CONFIG_JOYSTICK_COBRA=m
+CONFIG_JOYSTICK_GF2K=m
+CONFIG_JOYSTICK_GRIP=m
+CONFIG_JOYSTICK_GRIP_MP=m
+CONFIG_JOYSTICK_GUILLEMOT=m
+CONFIG_JOYSTICK_INTERACT=m
+CONFIG_JOYSTICK_SIDEWINDER=m
+CONFIG_JOYSTICK_TMDC=m
+CONFIG_JOYSTICK_IFORCE=m
+CONFIG_JOYSTICK_IFORCE_USB=y
+CONFIG_JOYSTICK_IFORCE_232=y
+CONFIG_JOYSTICK_WARRIOR=m
+CONFIG_JOYSTICK_MAGELLAN=m
+CONFIG_JOYSTICK_SPACEORB=m
+CONFIG_JOYSTICK_SPACEBALL=m
+CONFIG_JOYSTICK_STINGER=m
+CONFIG_JOYSTICK_TWIDJOY=m
+CONFIG_JOYSTICK_DB9=m
+CONFIG_JOYSTICK_GAMECON=m
+CONFIG_JOYSTICK_TURBOGRAFX=m
+# CONFIG_JOYSTICK_JOYDUMP is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_PCSPKR=m
+# CONFIG_INPUT_UINPUT is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+CONFIG_SERIO_CT82C710=m
+CONFIG_SERIO_PARKBD=m
+CONFIG_SERIO_PCIPS2=m
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+CONFIG_GAMEPORT=m
+# CONFIG_GAMEPORT_NS558 is not set
+# CONFIG_GAMEPORT_L4 is not set
+# CONFIG_GAMEPORT_EMU10K1 is not set
+# CONFIG_GAMEPORT_FM801 is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_PNP=y
+CONFIG_SERIAL_8250_CS=m
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_PRINTER is not set
+CONFIG_PPDEV=m
+# CONFIG_TIPAR is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_INTEL=y
+CONFIG_HW_RANDOM_AMD=y
+CONFIG_HW_RANDOM_GEODE=y
+CONFIG_NVRAM=m
+CONFIG_RTC=m
+# CONFIG_GEN_RTC is not set
+CONFIG_DTLK=m
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+CONFIG_AGP=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=m
+CONFIG_AGP_SIS=m
+CONFIG_AGP_VIA=m
+CONFIG_DRM=m
+CONFIG_DRM_TDFX=m
+CONFIG_DRM_R128=m
+CONFIG_DRM_RADEON=m
+CONFIG_DRM_I810=m
+CONFIG_DRM_I830=m
+CONFIG_DRM_I915=m
+CONFIG_DRM_MGA=m
+CONFIG_DRM_SIS=m
+CONFIG_DRM_VIA=m
+CONFIG_DRM_SAVAGE=m
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_CARDMAN_4000 is not set
+# CONFIG_CARDMAN_4040 is not set
+CONFIG_MWAVE=m
+# CONFIG_PC8736x_GPIO is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_HPET is not set
+# CONFIG_HANGCHECK_TIMER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOPCF=m
+CONFIG_I2C_ALGOPCA=m
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+CONFIG_I2C_AMD756_S4882=m
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+CONFIG_I2C_I810=m
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_ISA=m
+CONFIG_I2C_NFORCE2=m
+CONFIG_I2C_OCORES=m
+CONFIG_I2C_PARPORT=m
+# CONFIG_I2C_PARPORT_LIGHT is not set
+CONFIG_I2C_PROSAVAGE=m
+CONFIG_I2C_SAVAGE4=m
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+# CONFIG_I2C_STUB is not set
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+CONFIG_I2C_VOODOO3=m
+CONFIG_I2C_PCA_ISA=m
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_SENSORS_DS1337=m
+CONFIG_SENSORS_DS1374=m
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+CONFIG_SENSORS_PCA9539=m
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_MAX6875=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+CONFIG_SENSORS_ABITUGURU=m
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ADM9240=m
+CONFIG_SENSORS_K8TEMP=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_ATXP1=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_F71805F=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_FSCPOS=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_GL520SM=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM63=m
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_PC87360=m
+CONFIG_SENSORS_SIS5595=m
+CONFIG_SENSORS_SMSC47M1=m
+CONFIG_SENSORS_SMSC47M192=m
+CONFIG_SENSORS_SMSC47B397=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_VT1211=m
+CONFIG_SENSORS_VT8231=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83791D=m
+CONFIG_SENSORS_W83792D=m
+CONFIG_SENSORS_W83L785TS=m
+CONFIG_SENSORS_W83627HF=m
+CONFIG_SENSORS_W83627EHF=m
+CONFIG_SENSORS_HDAPS=m
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+CONFIG_VIDEO_V4L1=y
+CONFIG_VIDEO_V4L1_COMPAT=y
+CONFIG_VIDEO_V4L2=y
+
+#
+# Video Capture Adapters
+#
+
+#
+# Video Capture Adapters
+#
+# CONFIG_VIDEO_ADV_DEBUG is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+# CONFIG_VIDEO_VIVI is not set
+# CONFIG_VIDEO_BT848 is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_W9966 is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SAA5246A is not set
+# CONFIG_VIDEO_SAA5249 is not set
+# CONFIG_TUNER_3036 is not set
+# CONFIG_VIDEO_STRADIS is not set
+# CONFIG_VIDEO_ZORAN is not set
+# CONFIG_VIDEO_SAA7134 is not set
+# CONFIG_VIDEO_MXB is not set
+# CONFIG_VIDEO_DPC is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+# CONFIG_VIDEO_CX88 is not set
+
+#
+# V4L USB devices
+#
+# CONFIG_VIDEO_PVRUSB2 is not set
+# CONFIG_VIDEO_EM28XX is not set
+CONFIG_VIDEO_USBVIDEO=m
+# CONFIG_USB_VICAM is not set
+# CONFIG_USB_IBMCAM is not set
+# CONFIG_USB_KONICAWC is not set
+CONFIG_USB_QUICKCAM_MESSENGER=m
+# CONFIG_USB_ET61X251 is not set
+# CONFIG_VIDEO_OVCAMCHIP is not set
+# CONFIG_USB_W9968CF is not set
+# CONFIG_USB_OV511 is not set
+# CONFIG_USB_SE401 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_STV680 is not set
+# CONFIG_USB_ZC0301 is not set
+# CONFIG_USB_PWC is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+# CONFIG_USB_DSBR is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+CONFIG_FIRMWARE_EDID=y
+CONFIG_FB=y
+# CONFIG_FB_DDC is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ARC is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_VGA16 is not set
+CONFIG_FB_VESA=y
+CONFIG_FB_VESA_STD=y
+# CONFIG_FB_VESA_TNG is not set
+CONFIG_VIDEO_SELECT=y
+# CONFIG_FB_HGA is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_NVIDIA is not set
+# CONFIG_FB_RIVA is not set
+# CONFIG_FB_INTEL is not set
+# CONFIG_FB_MATROX is not set
+# CONFIG_FB_RADEON is not set
+# CONFIG_FB_ATY128 is not set
+# CONFIG_FB_ATY is not set
+# CONFIG_FB_SAVAGE is not set
+# CONFIG_FB_SIS is not set
+# CONFIG_FB_NEOMAGIC is not set
+# CONFIG_FB_KYRO is not set
+# CONFIG_FB_3DFX is not set
+# CONFIG_FB_VOODOO1 is not set
+# CONFIG_FB_TRIDENT is not set
+# CONFIG_FB_GEODE is not set
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+# CONFIG_LOGO is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=m
+CONFIG_BACKLIGHT_DEVICE=y
+CONFIG_LCD_CLASS_DEVICE=m
+CONFIG_LCD_DEVICE=y
+CONFIG_FB_SPLASH=y
+
+#
+# Speakup console speech
+#
+CONFIG_SPEAKUP=y
+CONFIG_SPEAKUP_ACNTSA=y
+CONFIG_SPEAKUP_ACNTPC=y
+CONFIG_SPEAKUP_APOLLO=y
+CONFIG_SPEAKUP_AUDPTR=y
+CONFIG_SPEAKUP_BNS=y
+CONFIG_SPEAKUP_DECTLK=y
+CONFIG_SPEAKUP_DECEXT=y
+# CONFIG_SPEAKUP_DECPC is not set
+CONFIG_SPEAKUP_DTLK=y
+CONFIG_SPEAKUP_KEYPC=y
+CONFIG_SPEAKUP_LTLK=y
+CONFIG_SPEAKUP_SFTSYN=y
+CONFIG_SPEAKUP_SPKOUT=y
+CONFIG_SPEAKUP_TXPRT=y
+
+#
+# Enter the 3 to 6 character keyword from the list above, or none for no default synthesizer on boot up.
+#
+CONFIG_SPEAKUP_DEFAULT="none"
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+CONFIG_SND=m
+CONFIG_SND_TIMER=m
+CONFIG_SND_PCM=m
+CONFIG_SND_HWDEP=m
+CONFIG_SND_RAWMIDI=m
+CONFIG_SND_SEQUENCER=m
+# CONFIG_SND_SEQ_DUMMY is not set
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=m
+CONFIG_SND_PCM_OSS=m
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_RTCTIMER=m
+CONFIG_SND_SEQ_RTCTIMER_DEFAULT=y
+# CONFIG_SND_DYNAMIC_MINORS is not set
+CONFIG_SND_SUPPORT_OLD_API=y
+# CONFIG_SND_VERBOSE_PROCFS is not set
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+
+#
+# Generic devices
+#
+CONFIG_SND_MPU401_UART=m
+CONFIG_SND_OPL3_LIB=m
+CONFIG_SND_VX_LIB=m
+CONFIG_SND_AC97_CODEC=m
+CONFIG_SND_AC97_BUS=m
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+CONFIG_SND_MTS64=m
+# CONFIG_SND_SERIAL_U16550 is not set
+CONFIG_SND_MPU401=m
+
+#
+# PCI devices
+#
+CONFIG_SND_AD1889=m
+CONFIG_SND_ALS300=m
+CONFIG_SND_ALS4000=m
+CONFIG_SND_ALI5451=m
+CONFIG_SND_ATIIXP=m
+CONFIG_SND_ATIIXP_MODEM=m
+CONFIG_SND_AU8810=m
+CONFIG_SND_AU8820=m
+CONFIG_SND_AU8830=m
+CONFIG_SND_AZT3328=m
+CONFIG_SND_BT87X=m
+# CONFIG_SND_BT87X_OVERCLOCK is not set
+CONFIG_SND_CA0106=m
+CONFIG_SND_CMIPCI=m
+CONFIG_SND_CS4281=m
+CONFIG_SND_CS46XX=m
+CONFIG_SND_CS46XX_NEW_DSP=y
+CONFIG_SND_DARLA20=m
+CONFIG_SND_GINA20=m
+CONFIG_SND_LAYLA20=m
+CONFIG_SND_DARLA24=m
+CONFIG_SND_GINA24=m
+CONFIG_SND_LAYLA24=m
+CONFIG_SND_MONA=m
+CONFIG_SND_MIA=m
+CONFIG_SND_ECHO3G=m
+CONFIG_SND_INDIGO=m
+CONFIG_SND_INDIGOIO=m
+CONFIG_SND_INDIGODJ=m
+CONFIG_SND_EMU10K1=m
+CONFIG_SND_EMU10K1X=m
+CONFIG_SND_ENS1370=m
+CONFIG_SND_ENS1371=m
+CONFIG_SND_ES1938=m
+CONFIG_SND_ES1968=m
+CONFIG_SND_FM801=m
+# CONFIG_SND_FM801_TEA575X_BOOL is not set
+CONFIG_SND_HDA_INTEL=m
+CONFIG_SND_HDSP=m
+CONFIG_SND_HDSPM=m
+CONFIG_SND_ICE1712=m
+CONFIG_SND_ICE1724=m
+CONFIG_SND_INTEL8X0=m
+CONFIG_SND_INTEL8X0M=m
+CONFIG_SND_KORG1212=m
+CONFIG_SND_MAESTRO3=m
+CONFIG_SND_MIXART=m
+CONFIG_SND_NM256=m
+CONFIG_SND_PCXHR=m
+CONFIG_SND_RIPTIDE=m
+CONFIG_SND_RME32=m
+CONFIG_SND_RME96=m
+CONFIG_SND_RME9652=m
+CONFIG_SND_SONICVIBES=m
+CONFIG_SND_TRIDENT=m
+CONFIG_SND_VIA82XX=m
+CONFIG_SND_VIA82XX_MODEM=m
+CONFIG_SND_VX222=m
+CONFIG_SND_YMFPCI=m
+# CONFIG_SND_AC97_POWER_SAVE is not set
+
+#
+# USB devices
+#
+CONFIG_SND_USB_AUDIO=m
+CONFIG_SND_USB_USX2Y=m
+
+#
+# PCMCIA devices
+#
+CONFIG_SND_VXPOCKET=m
+CONFIG_SND_PDAUDIOCF=m
+
+#
+# Open Sound System
+#
+# CONFIG_SOUND_PRIME is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+CONFIG_USB_ISP116X_HCD=m
+CONFIG_USB_OHCI_HCD=m
+# CONFIG_USB_OHCI_BIG_ENDIAN is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=m
+CONFIG_USB_U132_HCD=m
+CONFIG_USB_SL811_HCD=m
+CONFIG_USB_SL811_CS=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_ACM=m
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DATAFAB=y
+CONFIG_USB_STORAGE_FREECOM=y
+CONFIG_USB_STORAGE_ISD200=y
+CONFIG_USB_STORAGE_DPCM=y
+CONFIG_USB_STORAGE_USBAT=y
+CONFIG_USB_STORAGE_SDDR09=y
+CONFIG_USB_STORAGE_SDDR55=y
+CONFIG_USB_STORAGE_JUMPSHOT=y
+CONFIG_USB_STORAGE_ALAUDA=y
+CONFIG_USB_STORAGE_KARMA=y
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=m
+CONFIG_USB_HIDINPUT=y
+CONFIG_USB_HIDINPUT_POWERBOOK=y
+# CONFIG_HID_FF is not set
+CONFIG_USB_HIDDEV=y
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+CONFIG_USB_AIPTEK=m
+CONFIG_USB_WACOM=m
+CONFIG_USB_ACECAD=m
+CONFIG_USB_KBTAB=m
+# CONFIG_USB_POWERMATE is not set
+CONFIG_USB_TOUCHSCREEN=m
+CONFIG_USB_TOUCHSCREEN_EGALAX=y
+CONFIG_USB_TOUCHSCREEN_PANJIT=y
+CONFIG_USB_TOUCHSCREEN_3M=y
+CONFIG_USB_TOUCHSCREEN_ITM=y
+CONFIG_USB_TOUCHSCREEN_ETURBO=y
+CONFIG_USB_TOUCHSCREEN_GUNZE=y
+# CONFIG_USB_YEALINK is not set
+CONFIG_USB_XPAD=m
+CONFIG_USB_ATI_REMOTE=m
+CONFIG_USB_ATI_REMOTE2=m
+# CONFIG_USB_KEYSPAN_REMOTE is not set
+CONFIG_USB_APPLETOUCH=m
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB Network Adapters
+#
+CONFIG_USB_CATC=m
+CONFIG_USB_KAWETH=m
+CONFIG_USB_PEGASUS=m
+CONFIG_USB_RTL8150=m
+CONFIG_USB_USBNET_MII=m
+CONFIG_USB_USBNET=m
+CONFIG_USB_NET_AX8817X=m
+CONFIG_USB_NET_CDCETHER=m
+# CONFIG_USB_NET_GL620A is not set
+CONFIG_USB_NET_NET1080=m
+# CONFIG_USB_NET_PLUSB is not set
+CONFIG_USB_NET_MCS7830=m
+# CONFIG_USB_NET_RNDIS_HOST is not set
+# CONFIG_USB_NET_CDC_SUBSET is not set
+CONFIG_USB_NET_ZAURUS=m
+# CONFIG_USB_MON is not set
+
+#
+# USB port drivers
+#
+CONFIG_USB_USS720=m
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_AIRCABLE=m
+CONFIG_USB_SERIAL_AIRPRIME=m
+CONFIG_USB_SERIAL_ARK3116=m
+# CONFIG_USB_SERIAL_BELKIN is not set
+CONFIG_USB_SERIAL_WHITEHEAT=m
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+CONFIG_USB_SERIAL_CP2101=m
+# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+CONFIG_USB_SERIAL_FUNSOFT=m
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IPAQ is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+# CONFIG_USB_SERIAL_GARMIN is not set
+CONFIG_USB_SERIAL_IPW=m
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KLSI is not set
+# CONFIG_USB_SERIAL_KOBIL_SCT is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+CONFIG_USB_SERIAL_MOS7720=m
+CONFIG_USB_SERIAL_MOS7840=m
+CONFIG_USB_SERIAL_NAVMAN=m
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_HP4X is not set
+# CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
+# CONFIG_USB_SERIAL_TI is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+CONFIG_USB_SERIAL_OPTION=m
+CONFIG_USB_SERIAL_OMNINET=m
+CONFIG_USB_EZUSB=y
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+CONFIG_USB_ADUTUX=m
+CONFIG_USB_AUERSWALD=m
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+CONFIG_USB_PHIDGET=m
+CONFIG_USB_PHIDGETKIT=m
+CONFIG_USB_PHIDGETMOTORCONTROL=m
+CONFIG_USB_PHIDGETSERVO=m
+# CONFIG_USB_IDMOUSE is not set
+CONFIG_USB_FTDI_ELAN=m
+CONFIG_USB_APPLEDISPLAY=m
+CONFIG_USB_SISUSBVGA=m
+CONFIG_USB_SISUSBVGA_CON=y
+# CONFIG_USB_LD is not set
+CONFIG_USB_TRANCEVIBRATOR=m
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+CONFIG_USB_ATM=m
+CONFIG_USB_SPEEDTOUCH=m
+CONFIG_USB_CXACRU=m
+CONFIG_USB_UEAGLEATM=m
+CONFIG_USB_XUSBATM=m
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+CONFIG_MMC=m
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_BLOCK=m
+CONFIG_MMC_SDHCI=m
+CONFIG_MMC_WBSD=m
+CONFIG_MMC_TIFM_SD=m
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
+# InfiniBand support
+#
+CONFIG_INFINIBAND=m
+# CONFIG_INFINIBAND_USER_MAD is not set
+# CONFIG_INFINIBAND_USER_ACCESS is not set
+CONFIG_INFINIBAND_ADDR_TRANS=y
+CONFIG_INFINIBAND_MTHCA=m
+# CONFIG_INFINIBAND_MTHCA_DEBUG is not set
+CONFIG_INFINIBAND_IPATH=m
+CONFIG_INFINIBAND_AMSO1100=m
+# CONFIG_INFINIBAND_AMSO1100_DEBUG is not set
+CONFIG_INFINIBAND_IPOIB=m
+# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
+CONFIG_INFINIBAND_SRP=m
+CONFIG_INFINIBAND_ISER=m
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+# CONFIG_EDAC is not set
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=m
+CONFIG_RTC_CLASS=m
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=m
+CONFIG_RTC_INTF_PROC=m
+CONFIG_RTC_INTF_DEV=m
+CONFIG_RTC_INTF_DEV_UIE_EMUL=y
+
+#
+# RTC drivers
+#
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_DS1307 is not set
+CONFIG_RTC_DRV_DS1553=m
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+CONFIG_RTC_DRV_DS1742=m
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+CONFIG_RTC_DRV_M48T86=m
+# CONFIG_RTC_DRV_TEST is not set
+CONFIG_RTC_DRV_V3020=m
+
+#
+# DMA Engine support
+#
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+CONFIG_NET_DMA=y
+
+#
+# DMA Devices
+#
+CONFIG_INTEL_IOATDMA=m
+
+#
+# Firmware Drivers
+#
+# CONFIG_EDD is not set
+CONFIG_DELL_RBU=m
+CONFIG_DCDBAS=m
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+CONFIG_EXT4DEV_FS=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+CONFIG_REISERFS_FS=y
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+CONFIG_REISERFS_FS_XATTR=y
+CONFIG_REISERFS_FS_POSIX_ACL=y
+CONFIG_REISERFS_FS_SECURITY=y
+CONFIG_JFS_FS=m
+CONFIG_JFS_POSIX_ACL=y
+CONFIG_JFS_SECURITY=y
+# CONFIG_JFS_DEBUG is not set
+# CONFIG_JFS_STATISTICS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_XFS_FS=y
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_SECURITY=y
+CONFIG_XFS_POSIX_ACL=y
+CONFIG_XFS_RT=y
+CONFIG_GFS2_FS=y
+CONFIG_GFS2_FS_LOCKING_NOLOCK=y
+CONFIG_GFS2_FS_LOCKING_DLM=y
+CONFIG_OCFS2_FS=y
+CONFIG_OCFS2_DEBUG_MASKLOG=y
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+CONFIG_QUOTACTL=y
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+CONFIG_GENERIC_ACL=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_ZISOFS_FS=y
+CONFIG_UDF_FS=y
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+# CONFIG_NTFS_RW is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_VMCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+# CONFIG_HUGETLBFS is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+CONFIG_CONFIGFS_FS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+CONFIG_SQUASHFS=y
+CONFIG_SQUASHFS_EMBEDDED=y
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
+# CONFIG_SQUASHFS_VMALLOC is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+CONFIG_NFS_V3=y
+# CONFIG_NFS_V3_ACL is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+# CONFIG_NFSD_V3_ACL is not set
+# CONFIG_NFSD_V4 is not set
+CONFIG_NFSD_TCP=y
+CONFIG_LOCKD=m
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=m
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=m
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_WEAK_PW_HASH is not set
+CONFIG_CIFS_XATTR=y
+CONFIG_CIFS_POSIX=y
+# CONFIG_CIFS_DEBUG2 is not set
+# CONFIG_CIFS_EXPERIMENTAL is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+CONFIG_LDM_PARTITION=y
+# CONFIG_LDM_DEBUG is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+CONFIG_KARMA_PARTITION=y
+CONFIG_EFI_PARTITION=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+CONFIG_DLM=y
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_UNUSED_SYMBOLS=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=15
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_RWSEMS is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_FRAME_POINTER is not set
+# CONFIG_UNWIND_INFO is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_DEBUG_RODATA is not set
+# CONFIG_IOMMU_DEBUG is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_BLKCIPHER=m
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_SHA512=m
+# CONFIG_CRYPTO_WP512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_CBC=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_TWOFISH_COMMON=m
+CONFIG_CRYPTO_TWOFISH_X86_64=m
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_AES=m
+CONFIG_CRYPTO_AES_X86_64=m
+CONFIG_CRYPTO_CAST5=m
+CONFIG_CRYPTO_CAST6=m
+CONFIG_CRYPTO_TEA=m
+CONFIG_CRYPTO_ARC4=m
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_DEFLATE=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_CRC32C=m
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Hardware crypto devices
+#
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=m
+CONFIG_CRC32=y
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=m
+CONFIG_TEXTSEARCH=y
+CONFIG_TEXTSEARCH_KMP=m
+CONFIG_TEXTSEARCH_BM=m
+CONFIG_TEXTSEARCH_FSM=m
+CONFIG_PLIST=y
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/installcd-stage1-minimal.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/installcd-stage1-minimal.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/installcd-stage1-minimal.spec	(revision 25406)
@@ -0,0 +1,96 @@
+subarch: amd64
+version_stamp: 2007.0
+target: livecd-stage1
+rel_type: default
+profile: default-linux/amd64/2007.0
+snapshot: 2007.0
+source_subpath: default/stage3-amd64-2007.0
+livecd/use:
+	-*
+	fbcon
+	ipv6
+	livecd
+	ncurses
+	nls
+	nptl
+	nptlonly
+	pam
+	readline
+	socks5
+	ssl
+	unicode
+
+livecd/packages:
+	net-misc/rsync
+	app-admin/passook
+	app-admin/pwgen
+	app-admin/syslog-ng
+	app-arch/unzip
+	app-editors/vim
+	app-misc/livecd-tools
+	app-misc/screen
+	app-misc/vlock
+	app-portage/mirrorselect
+	dev-lang/python
+	media-gfx/fbgrab
+	net-analyzer/tcptraceroute
+	net-analyzer/traceroute
+	net-dialup/bpalogin
+	net-dialup/mingetty
+#	net-dialup/penggy
+#	net-dialup/pptpclient
+#	net-dialup/rp-pppoe
+	net-fs/nfs-utils
+	net-irc/irssi
+	net-misc/dhcpcd
+	net-misc/iputils
+	net-misc/rdate
+	net-misc/vconfig
+#	net-wireless/ipw2100-firmware
+#	net-wireless/ipw2200-firmware
+	net-wireless/prism54-firmware
+	net-wireless/wireless-tools
+	net-wireless/wpa_supplicant
+#	net-wireless/zd1201-firmware
+	net-wireless/zd1211-firmware
+	sys-apps/apmd
+	sys-apps/eject
+	sys-apps/ethtool
+	sys-apps/fxload
+	sys-apps/hdparm
+	sys-apps/hwsetup
+	sys-apps/iproute2
+#	sys-apps/lssbus
+	sys-apps/memtester
+	sys-apps/netplug
+	sys-apps/parted
+#	sys-apps/powerpc-utils
+#	sys-apps/ibm-powerpc-utils
+#	sys-apps/ibm-powerpc-utils-papr
+	sys-apps/sdparm
+#	sys-block/partimage
+#	sys-block/qla-fc-firmware
+#	sys-boot/yaboot
+#	sys-devel/binutils-hppa64
+#	sys-devel/gcc-hppa64
+#	sys-fs/dmraid
+	sys-fs/dosfstools
+	sys-fs/e2fsprogs
+	sys-fs/evms
+#	sys-fs/hfsplusutils
+#	sys-fs/hfsutils
+#	sys-fs/iprutils
+	sys-fs/jfsutils
+	sys-fs/lsscsi
+	sys-fs/lvm2
+#	sys-fs/lvm-user
+#	sys-fs/mac-fdisk
+	sys-fs/mdadm
+#	sys-fs/multipath-tools
+	sys-fs/ntfsprogs
+	sys-fs/reiserfsprogs
+	sys-fs/xfsprogs
+	sys-libs/gpm
+	sys-power/acpid
+#	sys-power/apmd
+	www-client/links
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/installcd-stage2-minimal.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/installcd-stage2-minimal.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/installcd-stage2-minimal.spec	(revision 25406)
@@ -0,0 +1,344 @@
+subarch: amd64
+version_stamp: 2007.0-serial
+target: livecd-stage2
+rel_type: default
+profile: default-linux/amd64/2007.0
+snapshot: 2007.0
+source_subpath: default/livecd-stage1-amd64-2007.0
+portage_overlay: /usr/src/portage
+
+livecd/fstype: squashfs
+livecd/cdtar: /usr/lib/catalyst/livecd/cdtar/isolinux-3.09-memtest86+-cdtar.tar.bz2
+
+livecd/iso: /var/tmp/catalyst/builds/default/install-amd64-minimal-2007.0-serial.iso
+#livecd/splash_type: gensplash
+#livecd/splash_theme: livecd-2007.0
+
+livecd/volid: Gentoo Linux amd64 2007.0
+livecd/type: gentoo-release-minimal
+
+#livecd/overlay: /root/livecd/overlays/amd64-minimal
+
+#livecd/bootargs: dokeymap
+livecd/bootargs: console=tty0 console=ttyS0,115200
+livecd/gk_mainargs: --makeopts=-j16 --lvm2 --dmraid --evms2
+
+boot/kernel: gentoo
+boot/kernel/gentoo/sources: gentoo-sources
+
+#boot/kernel/gentoo/config: /root/livecd/kconfig/2007.0/amd64/installcd-2.6.19.config
+boot/kernel/gentoo/config: /root/2007.0-specs/installcd-2.6.19.config
+
+boot/kernel/gentoo/use: pcmcia usb -X png truetype -qt
+
+boot/kernel/gentoo/packages:
+	media-gfx/splashutils
+	media-gfx/splash-themes-livecd
+	sys-apps/pcmciautils
+	sys-fs/cryptsetup-luks
+#	net-wireless/rt2500
+# These were not stable at time of snapshot/release.
+#	net-wireless/at76c503a
+#	net-wireless/rtl8180
+#	net-wireless/rtl8187
+#	net-wireless/adm8211
+#	net-wireless/acx
+#	net-wireless/ipw3945
+
+livecd/unmerge:
+#	acl
+#	addpatches
+#	attr
+	alsa-headers
+	autoconf
+	autoconf-wrapper
+	automake
+	automake-wrapper
+#	bc
+#	bin86
+	binutils
+	binutils-config
+	bison
+	busybox
+#	ccache
+	cpio
+#	cronbase
+#	devfsd
+	diffutils
+#	distcc
+#	ed
+	expat
+	flex
+	gcc
+	gcc-config
+#	gcc-sparc64
+	genkernel
+	gentoo-sources
+	gettext
+	gnuconfig
+	groff
+#	grub
+	help2man
+	kgcc64
+#	lcms
+#	ld.so
+#	lib-compat
+#	libmng
+	libperl
+	libtool
+	linux-headers
+	m4
+	make
+	man
+	man-pages
+	miscfiles
+	pax-utils
+	patch
+	perl
+	perl-cleaner
+	perl-Test-Simple
+	PodParser
+	pycrypto
+	sandbox
+#	sash
+#	sysklogd
+#	tcp-wrappers
+	Test-Harness
+	texinfo
+#	ucl
+#	vanilla-sources
+
+livecd/empty:
+	/etc/bootsplash/gentoo
+	/etc/bootsplash/gentoo-highquality
+	/etc/cron.daily
+	/etc/cron.hourly
+	/etc/cron.monthly
+	/etc/cron.weekly
+	/etc/logrotate.d
+	/etc/modules.autoload.d
+	/etc/runlevels/single
+	/etc/skel
+	/etc/splash/emergence
+	/etc/splash/gentoo
+	/lib/dev-state
+	/lib/udev-state
+	/lib64/dev-state
+	/lib64/udev-state
+	/root/.ccache
+	/tmp
+	/usr/diet/include
+	/usr/diet/man
+	/usr/i386-gentoo-linux-uclibc
+	/usr/i386-pc-linux-gnu
+	/usr/i386-pc-linux-uclibc
+	/usr/include
+	/usr/lib/X11/config
+	/usr/lib/X11/doc
+	/usr/lib/X11/etc
+	/usr/lib/awk
+	/usr/lib/ccache
+	/usr/lib/gcc-config
+	/usr/lib/gconv
+	/usr/lib/nfs
+	/usr/lib/perl5
+	/usr/lib/portage
+	/usr/lib/python2.2
+	/usr/lib/python2.3
+	/usr/lib/python2.4/tests
+	/usr/lib64/X11/config
+	/usr/lib64/X11/doc
+	/usr/lib64/X11/etc
+	/usr/lib64/awk
+	/usr/lib64/ccache
+	/usr/lib64/gcc-config
+	/usr/lib64/gconv
+	/usr/lib64/nfs
+	/usr/lib64/perl5
+	/usr/lib64/portage
+	/usr/lib64/python2.2
+	/usr/lib64/python2.3
+	/usr/lib64/python2.4/tests
+	/usr/local
+	/usr/portage
+	/usr/powerpc-unknown-linux-gnu
+	/usr/powerpc64-unknown-linux-gnu
+	/usr/share/aclocal
+	/usr/share/baselayout
+	/usr/share/binutils-data
+	/usr/share/consolefonts/partialfonts
+	/usr/share/consoletrans
+	/usr/share/dict
+	/usr/share/doc
+	/usr/share/emacs
+	/usr/share/et
+	/usr/share/gcc-data
+	/usr/share/genkernel
+	/usr/share/gettext
+	/usr/share/glib-2.0
+	/usr/share/gnuconfig
+	/usr/share/gtk-doc
+	/usr/share/i18n
+	/usr/share/info
+	/usr/share/lcms
+	/usr/share/libtool
+	/usr/share/locale
+	/usr/share/man
+	/usr/share/perl
+	/usr/share/rfc
+	/usr/share/ss
+	/usr/share/state
+	/usr/share/texinfo
+	/usr/share/unimaps
+	/usr/share/zoneinfo
+	/usr/sparc-unknown-linux-gnu
+	/usr/src
+	/usr/x86_64-pc-linux-gnu
+	/var/cache
+	/var/db
+	/var/empty
+	/var/lib/portage
+	/var/lock
+	/var/log
+	/var/run
+	/var/spool
+	/var/state
+	/var/tmp
+
+livecd/rm:
+	/boot/System*
+	/boot/initr*
+	/boot/kernel*
+	/etc/*-
+	/etc/*.old
+	/etc/default/audioctl
+	/etc/dispatch-conf.conf
+	/etc/env.d/05binutils
+	/etc/env.d/05gcc
+	/etc/etc-update.conf
+	/etc/hosts.bck
+	/etc/issue*
+	/etc/genkernel.conf
+	/etc/make.conf
+	/etc/make.conf.example
+	/etc/make.globals
+	/etc/make.profile
+	/etc/man.conf
+	/etc/resolv.conf
+	/etc/splash/livecd-2007.0/12*
+	/etc/splash/livecd-2007.0/14*
+	/etc/splash/livecd-2007.0/16*
+	/etc/splash/livecd-2007.0/19*
+	/etc/splash/livecd-2007.0/6*
+	/etc/splash/livecd-2007.0/8*
+	/etc/splash/livecd-2007.0/images/background-12*
+	/etc/splash/livecd-2007.0/images/background-14*
+	/etc/splash/livecd-2007.0/images/background-16*
+	/etc/splash/livecd-2007.0/images/background-19*
+	/etc/splash/livecd-2007.0/images/background-6*
+	/etc/splash/livecd-2007.0/images/background-8*
+	/etc/splash/livecd-2007.0/images/verbose-12*
+	/etc/splash/livecd-2007.0/images/verbose-14*
+	/etc/splash/livecd-2007.0/images/verbose-16*
+	/etc/splash/livecd-2007.0/images/verbose-19*
+	/etc/splash/livecd-2007.0/images/verbose-6*
+	/etc/splash/livecd-2007.0/images/verbose-8*
+	/lib*/*.a
+	/lib*/*.la
+	/lib*/cpp
+	/lib*/security/pam_access.so
+	/lib*/security/pam_chroot.so
+	/lib*/security/pam_debug.so
+	/lib*/security/pam_ftp.so
+	/lib*/security/pam_issue.so
+	/lib*/security/pam_mail.so
+	/lib*/security/pam_mkhomedir.so
+	/lib*/security/pam_motd.so
+	/lib*/security/pam_postgresok.so
+	/lib*/security/pam_rhosts_auth.so
+	/lib*/security/pam_userdb.so
+	/root/.bash_history
+	/root/.viminfo
+	/sbin/fsck.cramfs
+	/sbin/fsck.minix
+	/sbin/mkfs.bfs
+	/sbin/mkfs.cramfs
+	/sbin/mkfs.minix
+	/usr/bin/addr2line
+	/usr/bin/ar
+	/usr/bin/as
+	/usr/bin/audioctl
+	/usr/bin/c++*
+	/usr/bin/cc
+	/usr/bin/cjpeg
+	/usr/bin/cpp
+	/usr/bin/djpeg
+	/usr/bin/ebuild
+	/usr/bin/emerge
+	/usr/bin/elftoaout
+	/usr/bin/f77
+	/usr/bin/g++*
+	/usr/bin/g77
+	/usr/bin/gcc*
+	/usr/bin/genkernel
+	/usr/bin/gprof
+	/usr/bin/i386-gentoo-linux-uclibc-*
+	/usr/bin/i386-pc-linux-*
+	/usr/bin/jpegtran
+	/usr/bin/ld
+	/usr/bin/libpng*
+	/usr/bin/nm
+	/usr/bin/objcopy
+	/usr/bin/objdump
+	/usr/bin/piggyback*
+	/usr/bin/portageq
+	/usr/bin/ranlib
+	/usr/bin/readelf
+	/usr/bin/repoman
+	/usr/bin/size
+	/usr/bin/powerpc-unknown-linux-gnu-*
+	/usr/bin/powerpc64-unknown-linux-gnu-*
+	/usr/bin/sparc-unknown-linux-gnu-*
+	/usr/bin/sparc64-unknown-linux-gnu-*
+	/usr/bin/strings
+	/usr/bin/strip
+	/usr/bin/tbz2tool
+	/usr/bin/x86_64-pc-linux-gnu-*
+	/usr/bin/xpak
+	/usr/bin/yacc
+	/usr/lib*/*.a
+	/usr/lib*/*.la
+	/usr/lib*/gcc-lib/*/*/libgcj*
+	/usr/sbin/archive-conf
+	/usr/sbin/bootsplash*
+	/usr/sbin/dispatch-conf
+	/usr/sbin/emaint
+	/usr/sbin/emerge-webrsync
+	/usr/sbin/env-update
+	/usr/sbin/fb*
+	/usr/sbin/fixpackages
+	/usr/sbin/quickpkg
+	/usr/sbin/regenworld
+	/usr/share/consolefonts/1*
+	/usr/share/consolefonts/7*
+	/usr/share/consolefonts/8*
+	/usr/share/consolefonts/9*
+	/usr/share/consolefonts/A*
+	/usr/share/consolefonts/C*
+	/usr/share/consolefonts/E*
+	/usr/share/consolefonts/G*
+	/usr/share/consolefonts/L*
+	/usr/share/consolefonts/M*
+	/usr/share/consolefonts/R*
+	/usr/share/consolefonts/a*
+	/usr/share/consolefonts/c*
+	/usr/share/consolefonts/dr*
+	/usr/share/consolefonts/g*
+	/usr/share/consolefonts/i*
+	/usr/share/consolefonts/k*
+	/usr/share/consolefonts/l*
+	/usr/share/consolefonts/r*
+	/usr/share/consolefonts/s*
+	/usr/share/consolefonts/t*
+	/usr/share/consolefonts/v*
+	/usr/share/misc/*.old
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/CVS/Entries
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/CVS/Entries	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/CVS/Entries	(revision 25406)
@@ -0,0 +1,2 @@
+/package.keywords/1.1.1.1/Thu Jul 19 03:12:23 2007/-kb/
+D
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/CVS/Repository
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/CVS/Repository	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/CVS/Repository	(revision 25406)
@@ -0,0 +1,1 @@
+datasys/IPP/hw/livecds/2007.0-specs/portage
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/CVS/Root
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/CVS/Root	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/CVS/Root	(revision 25406)
@@ -0,0 +1,1 @@
+jhoblitt@cvs.pan-starrs.ifa.hawaii.edu:/cvsroot/pan-starrs
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/package.keywords
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/package.keywords	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/portage/package.keywords	(revision 25406)
@@ -0,0 +1,1 @@
+sys-kernel/gentoo-sources ~amd64
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/stage1.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/stage1.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/stage1.spec	(revision 25406)
@@ -0,0 +1,10 @@
+subarch: amd64
+target: stage1
+version_stamp: 2007.0
+rel_type: default
+profile: default-linux/amd64/2007.0
+snapshot: 2007.0
+source_subpath: default/stage3-amd64-2007.0
+cflags: -O2 -pipe -march=k8
+portage_confdir: /etc/portage
+portage_overlay: /usr/src/portage_overlay
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/stage2.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/stage2.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/stage2.spec	(revision 25406)
@@ -0,0 +1,10 @@
+subarch: amd64
+target: stage2
+version_stamp: 2007.0
+rel_type: default
+profile: default-linux/amd64/2007.0
+snapshot: 2007.0
+source_subpath: default/stage1-amd64-2007.0
+cflags: -O2 -pipe -march=k8
+portage_confdir: /etc/portage
+portage_overlay: /usr/src/portage_overlay
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/stage3.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/stage3.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/stage3.spec	(revision 25406)
@@ -0,0 +1,10 @@
+subarch: amd64
+target: stage3
+version_stamp: 2007.0
+rel_type: default
+profile: default-linux/amd64/2007.0
+snapshot: 2007.0
+source_subpath: default/stage2-amd64-2007.0
+cflags: -O2 -pipe -march=k8
+portage_confdir: /etc/portage
+portage_overlay: /usr/src/portage_overlay
Index: /branches/eam_branches/20090715/catalyst/2007.0-specs/stage4.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2007.0-specs/stage4.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2007.0-specs/stage4.spec	(revision 25406)
@@ -0,0 +1,11 @@
+subarch: amd64
+version_stamp: 2007.0
+target: stage4
+rel_type: default
+profile: default-linux/amd64/2007.0
+snapshot: 2007.0
+source_subpath: default/stage2-amd64-2007.0
+portage_confdir: /etc/portage
+portage_overlay: /usr/src/portage_overlay
+# stage4/use: ipv6 socks5 fbcon ncurses readline ssl
+stage4/packages: ipp-node
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/2.6.28-rc7-00105-gfeaf384.conf
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/2.6.28-rc7-00105-gfeaf384.conf	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/2.6.28-rc7-00105-gfeaf384.conf	(revision 25406)
@@ -0,0 +1,2076 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.28-rc7
+# Thu Dec  4 13:39:10 2008
+#
+CONFIG_64BIT=y
+# CONFIG_X86_32 is not set
+CONFIG_X86_64=y
+CONFIG_X86=y
+CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_CLOCKSOURCE_WATCHDOG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_FAST_CMPXCHG_LOCAL=y
+CONFIG_MMU=y
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_ARCH_HAS_CPU_RELAX=y
+CONFIG_ARCH_HAS_DEFAULT_IDLE=y
+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
+CONFIG_HAVE_SETUP_PER_CPU_AREA=y
+CONFIG_HAVE_CPUMASK_OF_CPU_MAP=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ZONE_DMA32=y
+CONFIG_ARCH_POPULATES_NODE_MAP=y
+CONFIG_AUDIT_ARCH=y
+CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_PENDING_IRQ=y
+CONFIG_X86_SMP=y
+CONFIG_USE_GENERIC_SMP_HELPERS=y
+CONFIG_X86_64_SMP=y
+CONFIG_X86_HT=y
+CONFIG_X86_BIOS_REBOOT=y
+CONFIG_X86_TRAMPOLINE=y
+# CONFIG_KTIME_SCALAR is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_LOCK_KERNEL=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+CONFIG_AUDIT=y
+CONFIG_AUDITSYSCALL=y
+CONFIG_AUDIT_TREE=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=19
+CONFIG_CGROUPS=y
+# CONFIG_CGROUP_DEBUG is not set
+CONFIG_CGROUP_NS=y
+# CONFIG_CGROUP_FREEZER is not set
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CPUSETS=y
+CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
+CONFIG_GROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+# CONFIG_RT_GROUP_SCHED is not set
+CONFIG_USER_SCHED=y
+# CONFIG_CGROUP_SCHED is not set
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_RESOURCE_COUNTERS=y
+CONFIG_MM_OWNER=y
+CONFIG_CGROUP_MEM_RES_CTLR=y
+CONFIG_SYSFS_DEPRECATED=y
+CONFIG_SYSFS_DEPRECATED_V2=y
+CONFIG_PROC_PID_CPUSET=y
+CONFIG_RELAY=y
+CONFIG_NAMESPACES=y
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+# CONFIG_EMBEDDED is not set
+CONFIG_UID16=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
+CONFIG_COMPAT_BRK=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+CONFIG_PROFILING=y
+# CONFIG_MARKERS is not set
+CONFIG_OPROFILE=y
+# CONFIG_OPROFILE_IBS is not set
+CONFIG_HAVE_OPROFILE=y
+CONFIG_KPROBES=y
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_KRETPROBES=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+CONFIG_STOP_MACHINE=y
+CONFIG_BLOCK=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLOCK_COMPAT=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+# CONFIG_DEFAULT_AS is not set
+# CONFIG_DEFAULT_DEADLINE is not set
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+CONFIG_PREEMPT_NOTIFIERS=y
+CONFIG_CLASSIC_RCU=y
+CONFIG_FREEZER=y
+
+#
+# Processor type and features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_SMP=y
+CONFIG_X86_FIND_SMP_CONFIG=y
+CONFIG_X86_MPPARSE=y
+CONFIG_X86_PC=y
+# CONFIG_X86_ELAN is not set
+# CONFIG_X86_VOYAGER is not set
+# CONFIG_X86_GENERICARCH is not set
+# CONFIG_X86_VSMP is not set
+# CONFIG_PARAVIRT_GUEST is not set
+CONFIG_MEMTEST=y
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 is not set
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MGEODEGX1 is not set
+# CONFIG_MGEODE_LX is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+# CONFIG_MVIAC7 is not set
+# CONFIG_MPSC is not set
+# CONFIG_MCORE2 is not set
+CONFIG_GENERIC_CPU=y
+CONFIG_X86_CPU=y
+CONFIG_X86_L1_CACHE_BYTES=128
+CONFIG_X86_INTERNODE_CACHE_BYTES=128
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_L1_CACHE_SHIFT=7
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_TSC=y
+CONFIG_X86_CMPXCHG64=y
+CONFIG_X86_CMOV=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=64
+CONFIG_X86_DEBUGCTLMSR=y
+CONFIG_CPU_SUP_INTEL=y
+CONFIG_CPU_SUP_AMD=y
+CONFIG_CPU_SUP_CENTAUR_64=y
+CONFIG_X86_DS=y
+CONFIG_X86_PTRACE_BTS=y
+CONFIG_HPET_TIMER=y
+CONFIG_HPET_EMULATE_RTC=y
+CONFIG_DMI=y
+CONFIG_GART_IOMMU=y
+# CONFIG_CALGARY_IOMMU is not set
+CONFIG_AMD_IOMMU=y
+CONFIG_SWIOTLB=y
+CONFIG_IOMMU_HELPER=y
+CONFIG_NR_CPUS=32
+# CONFIG_SCHED_SMT is not set
+CONFIG_SCHED_MC=y
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_X86_LOCAL_APIC=y
+CONFIG_X86_IO_APIC=y
+CONFIG_X86_MCE=y
+CONFIG_X86_MCE_INTEL=y
+CONFIG_X86_MCE_AMD=y
+# CONFIG_I8K is not set
+CONFIG_MICROCODE=m
+CONFIG_MICROCODE_INTEL=y
+# CONFIG_MICROCODE_AMD is not set
+CONFIG_MICROCODE_OLD_INTERFACE=y
+CONFIG_X86_MSR=y
+CONFIG_X86_CPUID=y
+CONFIG_ARCH_PHYS_ADDR_T_64BIT=y
+CONFIG_NUMA=y
+CONFIG_K8_NUMA=y
+CONFIG_X86_64_ACPI_NUMA=y
+CONFIG_NODES_SPAN_OTHER_NODES=y
+# CONFIG_NUMA_EMU is not set
+CONFIG_NODES_SHIFT=8
+CONFIG_ARCH_SPARSEMEM_DEFAULT=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_SELECT_MEMORY_MODEL=y
+# CONFIG_FLATMEM_MANUAL is not set
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+CONFIG_SPARSEMEM_MANUAL=y
+CONFIG_SPARSEMEM=y
+CONFIG_NEED_MULTIPLE_NODES=y
+CONFIG_HAVE_MEMORY_PRESENT=y
+CONFIG_SPARSEMEM_EXTREME=y
+CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
+CONFIG_SPARSEMEM_VMEMMAP=y
+
+#
+# Memory hotplug is currently incompatible with Software Suspend
+#
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_MIGRATION=y
+CONFIG_RESOURCES_64BIT=y
+CONFIG_PHYS_ADDR_T_64BIT=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_UNEVICTABLE_LRU=y
+CONFIG_MMU_NOTIFIER=y
+# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set
+CONFIG_X86_RESERVE_LOW_64K=y
+CONFIG_MTRR=y
+# CONFIG_MTRR_SANITIZER is not set
+CONFIG_X86_PAT=y
+# CONFIG_EFI is not set
+CONFIG_SECCOMP=y
+# CONFIG_HZ_100 is not set
+# CONFIG_HZ_250 is not set
+CONFIG_HZ_300=y
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=300
+CONFIG_SCHED_HRTICK=y
+CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
+CONFIG_PHYSICAL_START=0x200000
+CONFIG_RELOCATABLE=y
+CONFIG_PHYSICAL_ALIGN=0x200000
+CONFIG_HOTPLUG_CPU=y
+CONFIG_COMPAT_VDSO=y
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
+
+#
+# Power management and ACPI options
+#
+CONFIG_ARCH_HIBERNATION_HEADER=y
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+CONFIG_PM_SLEEP_SMP=y
+CONFIG_PM_SLEEP=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION="/dev/sda2"
+CONFIG_ACPI=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_PROCFS=y
+CONFIG_ACPI_PROCFS_POWER=y
+CONFIG_ACPI_SYSFS_POWER=y
+CONFIG_ACPI_PROC_EVENT=y
+CONFIG_ACPI_AC=y
+CONFIG_ACPI_BATTERY=y
+CONFIG_ACPI_BUTTON=y
+CONFIG_ACPI_FAN=y
+CONFIG_ACPI_DOCK=y
+CONFIG_ACPI_PROCESSOR=y
+CONFIG_ACPI_HOTPLUG_CPU=y
+CONFIG_ACPI_THERMAL=y
+CONFIG_ACPI_NUMA=y
+# CONFIG_ACPI_WMI is not set
+# CONFIG_ACPI_ASUS is not set
+# CONFIG_ACPI_TOSHIBA is not set
+# CONFIG_ACPI_CUSTOM_DSDT is not set
+CONFIG_ACPI_BLACKLIST_YEAR=0
+# CONFIG_ACPI_DEBUG is not set
+# CONFIG_ACPI_PCI_SLOT is not set
+CONFIG_ACPI_SYSTEM=y
+CONFIG_X86_PM_TIMER=y
+CONFIG_ACPI_CONTAINER=y
+# CONFIG_ACPI_SBS is not set
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_DEBUG=y
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+
+#
+# CPUFreq processor drivers
+#
+CONFIG_X86_ACPI_CPUFREQ=y
+CONFIG_X86_POWERNOW_K8=y
+CONFIG_X86_POWERNOW_K8_ACPI=y
+# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
+# CONFIG_X86_P4_CLOCKMOD is not set
+
+#
+# shared options
+#
+CONFIG_X86_ACPI_CPUFREQ_PROC_INTF=y
+# CONFIG_X86_SPEEDSTEP_LIB is not set
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+
+#
+# Memory power savings
+#
+# CONFIG_I7300_IDLE is not set
+
+#
+# Bus options (PCI etc.)
+#
+CONFIG_PCI=y
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_MMCONFIG=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_DMAR is not set
+# CONFIG_INTR_REMAP is not set
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIEAER=y
+# CONFIG_PCIEASPM is not set
+CONFIG_ARCH_SUPPORTS_MSI=y
+CONFIG_PCI_MSI=y
+CONFIG_PCI_LEGACY=y
+# CONFIG_PCI_DEBUG is not set
+# CONFIG_HT_IRQ is not set
+CONFIG_ISA_DMA_API=y
+CONFIG_K8_NB=y
+# CONFIG_PCCARD is not set
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Executable file formats / Emulations
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_COMPAT_BINFMT_ELF=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_IA32_EMULATION=y
+CONFIG_IA32_AOUT=y
+CONFIG_COMPAT=y
+CONFIG_COMPAT_FOR_U64_ALIGNMENT=y
+CONFIG_SYSVIPC_COMPAT=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+CONFIG_NET_IPIP=m
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+CONFIG_INET_TUNNEL=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+CONFIG_IPV6=y
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+# CONFIG_INET6_AH is not set
+# CONFIG_INET6_ESP is not set
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET6_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET6_XFRM_MODE_BEET is not set
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
+# CONFIG_NETLABEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+CONFIG_IP_SCTP=m
+# CONFIG_SCTP_DBG_MSG is not set
+# CONFIG_SCTP_DBG_OBJCNT is not set
+# CONFIG_SCTP_HMAC_NONE is not set
+# CONFIG_SCTP_HMAC_SHA1 is not set
+CONFIG_SCTP_HMAC_MD5=y
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_TCPPROBE is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_PHONET is not set
+CONFIG_WIRELESS=y
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_OLD_REGULATORY=y
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+CONFIG_PNP=y
+CONFIG_PNP_DEBUG_MESSAGES=y
+
+#
+# Protocols
+#
+CONFIG_PNPACPI=y
+CONFIG_BLK_DEV=y
+CONFIG_BLK_DEV_FD=y
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_CRYPTOLOOP=m
+CONFIG_BLK_DEV_NBD=m
+# CONFIG_BLK_DEV_SX8 is not set
+# CONFIG_BLK_DEV_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_HD is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_IBM_ASM is not set
+# CONFIG_PHANTOM is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_SONY_LAPTOP is not set
+# CONFIG_THINKPAD_ACPI is not set
+# CONFIG_INTEL_MENLOW is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_SGI_XP is not set
+# CONFIG_HP_ILO is not set
+# CONFIG_SGI_GRU is not set
+# CONFIG_C2PORT is not set
+CONFIG_HAVE_IDE=y
+CONFIG_IDE=y
+
+#
+# Please see Documentation/ide/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_IDE_GD=y
+CONFIG_IDE_GD_ATA=y
+# CONFIG_IDE_GD_ATAPI is not set
+CONFIG_BLK_DEV_IDECD=y
+CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+CONFIG_BLK_DEV_IDEACPI=y
+# CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_PLATFORM is not set
+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_IDEPNP is not set
+
+#
+# PCI IDE chipsets support
+#
+# CONFIG_BLK_DEV_GENERIC is not set
+# CONFIG_BLK_DEV_OPTI621 is not set
+# CONFIG_BLK_DEV_RZ1000 is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_ATIIXP is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_JMICRON is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_IT8213 is not set
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SIS5513 is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_BLK_DEV_TC86C001 is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+CONFIG_SCSI_NETLINK=y
+# CONFIG_SCSI_PROC_FS is not set
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_ST=m
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_CONSTANTS=y
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=y
+CONFIG_SCSI_FC_ATTRS=y
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+CONFIG_SCSI_SAS_ATTRS=y
+CONFIG_SCSI_SAS_LIBSAS=m
+# CONFIG_SCSI_SAS_ATA is not set
+CONFIG_SCSI_SAS_HOST_SMP=y
+CONFIG_SCSI_SAS_LIBSAS_DEBUG=y
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+CONFIG_BLK_DEV_3W_XXXX_RAID=m
+CONFIG_SCSI_3W_9XXX=m
+CONFIG_SCSI_ACARD=m
+CONFIG_SCSI_AACRAID=m
+CONFIG_SCSI_AIC7XXX=m
+CONFIG_AIC7XXX_CMDS_PER_DEVICE=32
+CONFIG_AIC7XXX_RESET_DELAY_MS=5000
+CONFIG_AIC7XXX_DEBUG_ENABLE=y
+CONFIG_AIC7XXX_DEBUG_MASK=0
+CONFIG_AIC7XXX_REG_PRETTY_PRINT=y
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+CONFIG_SCSI_AIC79XX=y
+CONFIG_AIC79XX_CMDS_PER_DEVICE=32
+CONFIG_AIC79XX_RESET_DELAY_MS=4000
+# CONFIG_AIC79XX_DEBUG_ENABLE is not set
+CONFIG_AIC79XX_DEBUG_MASK=0
+# CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
+CONFIG_SCSI_AIC94XX=m
+CONFIG_AIC94XX_DEBUG=y
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
+CONFIG_SCSI_ARCMSR=m
+CONFIG_SCSI_ARCMSR_AER=y
+CONFIG_MEGARAID_NEWGEN=y
+CONFIG_MEGARAID_MM=y
+CONFIG_MEGARAID_MAILBOX=y
+# CONFIG_MEGARAID_LEGACY is not set
+CONFIG_MEGARAID_SAS=y
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_MVSAS is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_SRP is not set
+# CONFIG_SCSI_DH is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_ATA_ACPI=y
+CONFIG_SATA_PMP=y
+CONFIG_SATA_AHCI=y
+CONFIG_SATA_SIL24=y
+CONFIG_ATA_SFF=y
+CONFIG_SATA_SVW=y
+CONFIG_ATA_PIIX=y
+# CONFIG_SATA_MV is not set
+CONFIG_SATA_NV=y
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+CONFIG_SATA_SIL=y
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+CONFIG_SATA_VIA=y
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ACPI is not set
+# CONFIG_PATA_ALI is not set
+CONFIG_PATA_AMD=y
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+CONFIG_ATA_GENERIC=y
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+CONFIG_PATA_SERVERWORKS=y
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+CONFIG_PATA_VIA=y
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_PATA_SCH is not set
+CONFIG_MD=y
+CONFIG_BLK_DEV_MD=y
+CONFIG_MD_AUTODETECT=y
+CONFIG_MD_LINEAR=y
+CONFIG_MD_RAID0=y
+CONFIG_MD_RAID1=y
+CONFIG_MD_RAID10=y
+CONFIG_MD_RAID456=y
+CONFIG_MD_RAID5_RESHAPE=y
+CONFIG_MD_MULTIPATH=y
+# CONFIG_MD_FAULTY is not set
+CONFIG_BLK_DEV_DM=y
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=m
+CONFIG_DM_SNAPSHOT=m
+CONFIG_DM_MIRROR=m
+# CONFIG_DM_ZERO is not set
+# CONFIG_DM_MULTIPATH is not set
+# CONFIG_DM_DELAY is not set
+# CONFIG_DM_UEVENT is not set
+CONFIG_FUSION=y
+CONFIG_FUSION_SPI=y
+# CONFIG_FUSION_FC is not set
+CONFIG_FUSION_SAS=y
+CONFIG_FUSION_MAX_SGE=128
+# CONFIG_FUSION_CTL is not set
+# CONFIG_FUSION_LOGGING is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# Enable only one of the two stacks, unless you know what you are doing
+#
+# CONFIG_FIREWIRE is not set
+CONFIG_IEEE1394=y
+CONFIG_IEEE1394_OHCI1394=y
+# CONFIG_IEEE1394_PCILYNX is not set
+# CONFIG_IEEE1394_SBP2 is not set
+# CONFIG_IEEE1394_ETH1394_ROM_ENTRY is not set
+# CONFIG_IEEE1394_ETH1394 is not set
+CONFIG_IEEE1394_RAWIO=y
+# CONFIG_IEEE1394_VIDEO1394 is not set
+# CONFIG_IEEE1394_DV1394 is not set
+# CONFIG_IEEE1394_VERBOSEDEBUG is not set
+# CONFIG_I2O is not set
+# CONFIG_MACINTOSH_DRIVERS is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=y
+# CONFIG_VETH is not set
+# CONFIG_NET_SB1000 is not set
+# CONFIG_ARCNET is not set
+CONFIG_PHYLIB=m
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+CONFIG_NET_VENDOR_3COM=y
+CONFIG_VORTEX=m
+CONFIG_TYPHOON=m
+# CONFIG_ENC28J60 is not set
+CONFIG_NET_TULIP=y
+# CONFIG_DE2104X is not set
+CONFIG_TULIP=y
+# CONFIG_TULIP_MWI is not set
+# CONFIG_TULIP_MMIO is not set
+# CONFIG_TULIP_NAPI is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_DM9102 is not set
+# CONFIG_ULI526X is not set
+# CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+CONFIG_NET_PCI=y
+CONFIG_PCNET32=m
+CONFIG_AMD8111_ETH=m
+CONFIG_ADAPTEC_STARFIRE=m
+CONFIG_B44=m
+CONFIG_B44_PCI_AUTOSELECT=y
+CONFIG_B44_PCICORE_AUTOSELECT=y
+CONFIG_B44_PCI=y
+CONFIG_FORCEDETH=m
+# CONFIG_FORCEDETH_NAPI is not set
+# CONFIG_EEPRO100 is not set
+CONFIG_E100=m
+CONFIG_FEALNX=m
+CONFIG_NATSEMI=m
+CONFIG_NE2K_PCI=m
+CONFIG_8139CP=m
+CONFIG_8139TOO=m
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_R6040 is not set
+CONFIG_SIS900=m
+CONFIG_EPIC100=m
+CONFIG_SUNDANCE=m
+# CONFIG_SUNDANCE_MMIO is not set
+CONFIG_TLAN=m
+CONFIG_VIA_RHINE=m
+# CONFIG_VIA_RHINE_MMIO is not set
+# CONFIG_SC92031 is not set
+# CONFIG_ATL2 is not set
+CONFIG_NETDEV_1000=y
+CONFIG_ACENIC=m
+# CONFIG_ACENIC_OMIT_TIGON_I is not set
+CONFIG_DL2K=m
+CONFIG_E1000=m
+CONFIG_E1000E=m
+CONFIG_IP1000=m
+CONFIG_IGB=m
+# CONFIG_IGB_LRO is not set
+CONFIG_IGB_DCA=y
+CONFIG_NS83820=m
+CONFIG_HAMACHI=m
+# CONFIG_YELLOWFIN is not set
+CONFIG_R8169=m
+CONFIG_SIS190=m
+CONFIG_SKGE=m
+# CONFIG_SKGE_DEBUG is not set
+CONFIG_SKY2=m
+# CONFIG_SKY2_DEBUG is not set
+CONFIG_VIA_VELOCITY=m
+CONFIG_TIGON3=m
+CONFIG_BNX2=m
+CONFIG_QLA3XXX=m
+# CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+# CONFIG_JME is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+# CONFIG_IWLWIFI_LEDS is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_NET_FC is not set
+CONFIG_NETCONSOLE=y
+# CONFIG_NETCONSOLE_DYNAMIC is not set
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+CONFIG_INPUT_POLLDEV=m
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=m
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_DEVKMEM=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_PNP=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_CONSOLE_POLL=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+CONFIG_IPMI_HANDLER=m
+CONFIG_IPMI_PANIC_EVENT=y
+CONFIG_IPMI_PANIC_STRING=y
+CONFIG_IPMI_DEVICE_INTERFACE=m
+CONFIG_IPMI_SI=m
+CONFIG_IPMI_WATCHDOG=m
+CONFIG_IPMI_POWEROFF=m
+CONFIG_HW_RANDOM=y
+CONFIG_HW_RANDOM_INTEL=y
+CONFIG_HW_RANDOM_AMD=y
+CONFIG_NVRAM=y
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_MWAVE is not set
+# CONFIG_PC8736x_GPIO is not set
+CONFIG_RAW_DRIVER=y
+CONFIG_MAX_RAW_DEVS=256
+CONFIG_HPET=y
+CONFIG_HPET_MMAP=y
+CONFIG_HANGCHECK_TIMER=m
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+CONFIG_DEVPORT=y
+CONFIG_I2C=m
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=m
+CONFIG_I2C_HELPER_AUTO=y
+CONFIG_I2C_ALGOBIT=m
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# PC SMBus host controller drivers
+#
+CONFIG_I2C_ALI1535=m
+CONFIG_I2C_ALI1563=m
+CONFIG_I2C_ALI15X3=m
+CONFIG_I2C_AMD756=m
+# CONFIG_I2C_AMD756_S4882 is not set
+CONFIG_I2C_AMD8111=m
+CONFIG_I2C_I801=m
+# CONFIG_I2C_ISCH is not set
+CONFIG_I2C_PIIX4=m
+CONFIG_I2C_NFORCE2=m
+# CONFIG_I2C_NFORCE2_S4985 is not set
+CONFIG_I2C_SIS5595=m
+CONFIG_I2C_SIS630=m
+CONFIG_I2C_SIS96X=m
+CONFIG_I2C_VIA=m
+CONFIG_I2C_VIAPRO=m
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+CONFIG_I2C_OCORES=m
+CONFIG_I2C_SIMTEC=m
+
+#
+# External I2C/SMBus adapter drivers
+#
+CONFIG_I2C_PARPORT_LIGHT=m
+CONFIG_I2C_TAOS_EVM=m
+CONFIG_I2C_TINY_USB=m
+
+#
+# Graphics adapter I2C/DDC channel drivers
+#
+CONFIG_I2C_VOODOO3=m
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_PCA_PLATFORM is not set
+CONFIG_I2C_STUB=m
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_DS1682=m
+# CONFIG_AT24 is not set
+CONFIG_SENSORS_EEPROM=m
+CONFIG_SENSORS_PCF8574=m
+# CONFIG_PCF8575 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+CONFIG_SENSORS_PCF8591=m
+CONFIG_SENSORS_MAX6875=m
+CONFIG_SENSORS_TSL2550=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_BITBANG is not set
+
+#
+# SPI Protocol Masters
+#
+# CONFIG_SPI_AT25 is not set
+# CONFIG_SPI_SPIDEV is not set
+# CONFIG_SPI_TLE62X0 is not set
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_GPIOLIB is not set
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_BATTERY_DS2760 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+CONFIG_HWMON=y
+CONFIG_HWMON_VID=m
+CONFIG_SENSORS_ABITUGURU=m
+CONFIG_SENSORS_ABITUGURU3=m
+# CONFIG_SENSORS_AD7414 is not set
+CONFIG_SENSORS_AD7418=m
+# CONFIG_SENSORS_ADCXX is not set
+CONFIG_SENSORS_ADM1021=m
+CONFIG_SENSORS_ADM1025=m
+CONFIG_SENSORS_ADM1026=m
+CONFIG_SENSORS_ADM1029=m
+CONFIG_SENSORS_ADM1031=m
+CONFIG_SENSORS_ADM9240=m
+# CONFIG_SENSORS_ADT7462 is not set
+CONFIG_SENSORS_ADT7470=m
+# CONFIG_SENSORS_ADT7473 is not set
+CONFIG_SENSORS_K8TEMP=m
+CONFIG_SENSORS_ASB100=m
+CONFIG_SENSORS_ATXP1=m
+CONFIG_SENSORS_DS1621=m
+CONFIG_SENSORS_I5K_AMB=m
+CONFIG_SENSORS_F71805F=m
+CONFIG_SENSORS_F71882FG=m
+CONFIG_SENSORS_F75375S=m
+CONFIG_SENSORS_FSCHER=m
+CONFIG_SENSORS_FSCPOS=m
+CONFIG_SENSORS_FSCHMD=m
+CONFIG_SENSORS_GL518SM=m
+CONFIG_SENSORS_GL520SM=m
+CONFIG_SENSORS_CORETEMP=m
+# CONFIG_SENSORS_IBMAEM is not set
+CONFIG_SENSORS_IBMPEX=m
+CONFIG_SENSORS_IT87=m
+CONFIG_SENSORS_LM63=m
+# CONFIG_SENSORS_LM70 is not set
+CONFIG_SENSORS_LM75=m
+CONFIG_SENSORS_LM77=m
+CONFIG_SENSORS_LM78=m
+CONFIG_SENSORS_LM80=m
+CONFIG_SENSORS_LM83=m
+CONFIG_SENSORS_LM85=m
+CONFIG_SENSORS_LM87=m
+CONFIG_SENSORS_LM90=m
+CONFIG_SENSORS_LM92=m
+CONFIG_SENSORS_LM93=m
+# CONFIG_SENSORS_MAX1111 is not set
+CONFIG_SENSORS_MAX1619=m
+CONFIG_SENSORS_MAX6650=m
+CONFIG_SENSORS_PC87360=m
+CONFIG_SENSORS_PC87427=m
+CONFIG_SENSORS_SIS5595=m
+CONFIG_SENSORS_DME1737=m
+CONFIG_SENSORS_SMSC47M1=m
+CONFIG_SENSORS_SMSC47M192=m
+CONFIG_SENSORS_SMSC47B397=m
+# CONFIG_SENSORS_ADS7828 is not set
+CONFIG_SENSORS_THMC50=m
+CONFIG_SENSORS_VIA686A=m
+CONFIG_SENSORS_VT1211=m
+CONFIG_SENSORS_VT8231=m
+CONFIG_SENSORS_W83781D=m
+CONFIG_SENSORS_W83791D=m
+CONFIG_SENSORS_W83792D=m
+CONFIG_SENSORS_W83793=m
+CONFIG_SENSORS_W83L785TS=m
+# CONFIG_SENSORS_W83L786NG is not set
+CONFIG_SENSORS_W83627HF=m
+CONFIG_SENSORS_W83627EHF=m
+CONFIG_SENSORS_HDAPS=m
+# CONFIG_SENSORS_LIS3LV02D is not set
+CONFIG_SENSORS_APPLESMC=m
+# CONFIG_HWMON_DEBUG_CHIP is not set
+CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_SOFT_WATCHDOG=m
+CONFIG_ACQUIRE_WDT=m
+CONFIG_ADVANTECH_WDT=m
+CONFIG_ALIM1535_WDT=m
+CONFIG_ALIM7101_WDT=m
+CONFIG_SC520_WDT=m
+CONFIG_EUROTECH_WDT=m
+CONFIG_IB700_WDT=m
+CONFIG_IBMASR=m
+CONFIG_WAFER_WDT=m
+CONFIG_I6300ESB_WDT=m
+CONFIG_ITCO_WDT=m
+# CONFIG_ITCO_VENDOR_SUPPORT is not set
+# CONFIG_IT8712F_WDT is not set
+# CONFIG_IT87_WDT is not set
+# CONFIG_HP_WATCHDOG is not set
+CONFIG_SC1200_WDT=m
+CONFIG_PC87413_WDT=m
+CONFIG_60XX_WDT=m
+CONFIG_SBC8360_WDT=m
+CONFIG_CPU5_WDT=m
+CONFIG_SMSC37B787_WDT=m
+CONFIG_W83627HF_WDT=m
+CONFIG_W83697HF_WDT=m
+# CONFIG_W83697UG_WDT is not set
+CONFIG_W83877F_WDT=m
+CONFIG_W83977F_WDT=m
+CONFIG_MACHZ_WDT=m
+CONFIG_SBC_EPX_C3_WATCHDOG=m
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB=m
+CONFIG_SSB_SPROM=y
+CONFIG_SSB_PCIHOST_POSSIBLE=y
+CONFIG_SSB_PCIHOST=y
+# CONFIG_SSB_B43_PCI_BRIDGE is not set
+# CONFIG_SSB_DEBUG is not set
+CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
+CONFIG_SSB_DRIVER_PCICORE=y
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_REGULATOR is not set
+
+#
+# Multimedia devices
+#
+
+#
+# Multimedia core support
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_VIDEO_MEDIA is not set
+
+#
+# Multimedia drivers
+#
+CONFIG_DAB=y
+# CONFIG_USB_DABUSB is not set
+
+#
+# Graphics support
+#
+CONFIG_AGP=y
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+# CONFIG_AGP_SIS is not set
+# CONFIG_AGP_VIA is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=256
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+CONFIG_HID_COMPAT=y
+CONFIG_HID_A4TECH=y
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_BRIGHT=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+CONFIG_HID_CYPRESS=y
+CONFIG_HID_DELL=y
+CONFIG_HID_EZKEY=y
+CONFIG_HID_GYRATION=y
+CONFIG_HID_LOGITECH=y
+# CONFIG_LOGITECH_FF is not set
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+CONFIG_HID_PANTHERLORD=y
+# CONFIG_PANTHERLORD_FF is not set
+CONFIG_HID_PETALYNX=y
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+CONFIG_HID_SUNPLUS=y
+# CONFIG_THRUSTMASTER_FF is not set
+# CONFIG_ZEROPLUS_FF is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_SUSPEND is not set
+# CONFIG_USB_OTG is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_WHCI_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+CONFIG_USB_PRINTER=y
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
+#
+
+#
+# see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_VST is not set
+# CONFIG_USB_GADGET is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+CONFIG_NEW_LEDS=y
+CONFIG_LEDS_CLASS=m
+
+#
+# LED drivers
+#
+# CONFIG_LEDS_PCA9532 is not set
+# CONFIG_LEDS_HP_DISK is not set
+# CONFIG_LEDS_CLEVO_MAIL is not set
+# CONFIG_LEDS_PCA955X is not set
+
+#
+# LED Triggers
+#
+# CONFIG_LEDS_TRIGGERS is not set
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=m
+CONFIG_RTC_DRV_DS1374=m
+CONFIG_RTC_DRV_DS1672=m
+CONFIG_RTC_DRV_MAX6900=m
+CONFIG_RTC_DRV_RS5C372=m
+CONFIG_RTC_DRV_ISL1208=m
+CONFIG_RTC_DRV_X1205=m
+CONFIG_RTC_DRV_PCF8563=m
+CONFIG_RTC_DRV_PCF8583=m
+CONFIG_RTC_DRV_M41T80=m
+CONFIG_RTC_DRV_M41T80_WDT=y
+CONFIG_RTC_DRV_S35390A=m
+CONFIG_RTC_DRV_FM3130=m
+# CONFIG_RTC_DRV_RX8581 is not set
+
+#
+# SPI RTC drivers
+#
+CONFIG_RTC_DRV_M41T94=m
+CONFIG_RTC_DRV_DS1305=m
+# CONFIG_RTC_DRV_DS1390 is not set
+CONFIG_RTC_DRV_MAX6902=m
+CONFIG_RTC_DRV_R9701=m
+CONFIG_RTC_DRV_RS5C348=m
+# CONFIG_RTC_DRV_DS3234 is not set
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=m
+# CONFIG_RTC_DRV_DS1286 is not set
+CONFIG_RTC_DRV_DS1511=m
+CONFIG_RTC_DRV_DS1553=m
+CONFIG_RTC_DRV_DS1742=m
+CONFIG_RTC_DRV_STK17TA8=m
+CONFIG_RTC_DRV_M48T86=m
+# CONFIG_RTC_DRV_M48T35 is not set
+CONFIG_RTC_DRV_M48T59=m
+# CONFIG_RTC_DRV_BQ4802 is not set
+CONFIG_RTC_DRV_V3020=m
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_DMADEVICES=y
+
+#
+# DMA Devices
+#
+CONFIG_INTEL_IOATDMA=m
+CONFIG_DMA_ENGINE=y
+
+#
+# DMA Clients
+#
+CONFIG_NET_DMA=y
+# CONFIG_DMATEST is not set
+CONFIG_DCA=m
+# CONFIG_UIO is not set
+# CONFIG_STAGING is not set
+CONFIG_STAGING_EXCLUDE_BUILD=y
+
+#
+# Firmware Drivers
+#
+# CONFIG_EDD is not set
+CONFIG_FIRMWARE_MEMMAP=y
+# CONFIG_DELL_RBU is not set
+# CONFIG_DCDBAS is not set
+CONFIG_DMIID=y
+# CONFIG_ISCSI_IBFT_FIND is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+CONFIG_EXT2_FS_XATTR=y
+CONFIG_EXT2_FS_POSIX_ACL=y
+CONFIG_EXT2_FS_SECURITY=y
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+CONFIG_EXT3_FS_POSIX_ACL=y
+CONFIG_EXT3_FS_SECURITY=y
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_FILE_LOCKING=y
+CONFIG_XFS_FS=m
+CONFIG_XFS_QUOTA=y
+CONFIG_XFS_POSIX_ACL=y
+# CONFIG_XFS_RT is not set
+# CONFIG_XFS_DEBUG is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+CONFIG_QUOTA=y
+# CONFIG_QUOTA_NETLINK_INTERFACE is not set
+CONFIG_PRINT_QUOTA_WARNING=y
+CONFIG_QFMT_V1=m
+CONFIG_QFMT_V2=m
+CONFIG_QUOTACTL=y
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=m
+CONFIG_FUSE_FS=m
+CONFIG_GENERIC_ACL=y
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+CONFIG_NTFS_FS=m
+# CONFIG_NTFS_DEBUG is not set
+CONFIG_NTFS_RW=y
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_PROC_VMCORE=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=y
+CONFIG_NFSD_V2_ACL=y
+CONFIG_NFSD_V3=y
+CONFIG_NFSD_V3_ACL=y
+CONFIG_NFSD_V4=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_EXPORTFS=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_REGISTER_V4 is not set
+CONFIG_RPCSEC_GSS_KRB5=y
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+CONFIG_NLS_ISO8859_15=y
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+CONFIG_ENABLE_WARN_DEPRECATED=y
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_UNUSED_SYMBOLS=y
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
+CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_DEBUG_LOCK_ALLOC=y
+# CONFIG_PROVE_LOCKING is not set
+CONFIG_LOCKDEP=y
+# CONFIG_LOCK_STAT is not set
+CONFIG_DEBUG_LOCKDEP=y
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_VIRTUAL is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_FRAME_POINTER is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_CPU_STALL_DETECTOR is not set
+# CONFIG_KPROBES_SANITY_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_LKDTM is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+
+#
+# Tracers
+#
+# CONFIG_FUNCTION_TRACER is not set
+# CONFIG_IRQSOFF_TRACER is not set
+# CONFIG_SYSPROF_TRACER is not set
+# CONFIG_SCHED_TRACER is not set
+# CONFIG_CONTEXT_SWITCH_TRACER is not set
+# CONFIG_BOOT_TRACER is not set
+# CONFIG_STACK_TRACER is not set
+# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set
+# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_KGDB=y
+CONFIG_KGDB_SERIAL_CONSOLE=y
+# CONFIG_KGDB_TESTS is not set
+# CONFIG_STRICT_DEVMEM is not set
+CONFIG_X86_VERBOSE_BOOTUP=y
+CONFIG_EARLY_PRINTK=y
+# CONFIG_EARLY_PRINTK_DBGP is not set
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+# CONFIG_DEBUG_PER_CPU_MAPS is not set
+# CONFIG_X86_PTDUMP is not set
+CONFIG_DEBUG_RODATA=y
+# CONFIG_DIRECT_GBPAGES is not set
+# CONFIG_DEBUG_RODATA_TEST is not set
+# CONFIG_DEBUG_NX_TEST is not set
+# CONFIG_IOMMU_DEBUG is not set
+# CONFIG_MMIOTRACE is not set
+CONFIG_IO_DELAY_TYPE_0X80=0
+CONFIG_IO_DELAY_TYPE_0XED=1
+CONFIG_IO_DELAY_TYPE_UDELAY=2
+CONFIG_IO_DELAY_TYPE_NONE=3
+CONFIG_IO_DELAY_0X80=y
+# CONFIG_IO_DELAY_0XED is not set
+# CONFIG_IO_DELAY_UDELAY is not set
+# CONFIG_IO_DELAY_NONE is not set
+CONFIG_DEFAULT_IO_DELAY_TYPE=0
+# CONFIG_DEBUG_BOOT_PARAMS is not set
+# CONFIG_CPA_DEBUG is not set
+# CONFIG_OPTIMIZE_INLINING is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+CONFIG_SECURITY=y
+# CONFIG_SECURITYFS is not set
+# CONFIG_SECURITY_NETWORK is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_SECURITY_ROOTPLUG is not set
+CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
+CONFIG_XOR_BLOCKS=y
+CONFIG_ASYNC_CORE=y
+CONFIG_ASYNC_MEMCPY=y
+CONFIG_ASYNC_XOR=y
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+# CONFIG_CRYPTO_FIPS is not set
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_MANAGER=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=m
+# CONFIG_CRYPTO_LRW is not set
+CONFIG_CRYPTO_PCBC=m
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=m
+# CONFIG_CRYPTO_XCBC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CRC32C_INTEL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=m
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_AES_X86_64 is not set
+# CONFIG_CRYPTO_ANUBIS is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SALSA20_X86_64 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_TWOFISH_X86_64 is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
+CONFIG_HAVE_KVM=y
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM=m
+CONFIG_KVM_INTEL=m
+CONFIG_KVM_AMD=m
+# CONFIG_VIRTIO_PCI is not set
+# CONFIG_VIRTIO_BALLOON is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_FIRST_BIT=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+CONFIG_CRC_CCITT=m
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=m
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=m
+CONFIG_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage1-nomultilib.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage1-nomultilib.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage1-nomultilib.spec	(revision 25406)
@@ -0,0 +1,9 @@
+subarch: amd64
+target: stage1
+version_stamp: hardened+nomultilib-2008.0
+rel_type: hardened
+profile: hardened/linux/amd64/2008.0/no-multilib
+snapshot: 2008.0
+source_subpath: hardened/stage3-amd64-hardened-2007.0
+cflags: -O2 -pipe -fforce-addr
+cxxflags: -O2 -pipe -fforce-addr
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage1.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage1.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage1.spec	(revision 25406)
@@ -0,0 +1,9 @@
+subarch: amd64
+target: stage1
+version_stamp: hardened-2008.0
+rel_type: hardened
+profile: hardened/linux/amd64/2008.0
+snapshot: 2008.0
+source_subpath: hardened/stage3-amd64-hardened-multilib-2007.0
+cflags: -O2 -pipe -fforce-addr
+cxxflags: -O2 -pipe -fforce-addr
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage2-nomultilib.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage2-nomultilib.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage2-nomultilib.spec	(revision 25406)
@@ -0,0 +1,9 @@
+subarch: amd64
+target: stage2
+version_stamp: hardened+nomultilib-2008.0
+rel_type: hardened
+profile: hardened/linux/amd64/2008.0/no-multilib
+snapshot: 2008.0
+source_subpath: hardened/stage1-amd64-hardened+nomultilib-2008.0
+cflags: -O2 -pipe -fforce-addr
+cxxflags: -O2 -pipe -fforce-addr
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage2.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage2.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage2.spec	(revision 25406)
@@ -0,0 +1,9 @@
+subarch: amd64
+target: stage2
+version_stamp: hardened-2008.0
+rel_type: hardened
+profile: hardened/linux/amd64/2008.0
+snapshot: 2008.0
+source_subpath: hardened/stage1-amd64-hardened-2008.0
+cflags: -O2 -pipe -fforce-addr
+cxxflags: -O2 -pipe -fforce-addr
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage3-nomultilib.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage3-nomultilib.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage3-nomultilib.spec	(revision 25406)
@@ -0,0 +1,9 @@
+subarch: amd64
+target: stage3
+version_stamp: hardened+nomultilib-2008.0
+rel_type: hardened
+profile: hardened/linux/amd64/2008.0/no-multilib
+snapshot: 2008.0
+source_subpath: hardened/stage2-amd64-hardened+nomultilib-2008.0
+cflags: -O2 -pipe -fforce-addr
+cxxflags: -O2 -pipe -fforce-addr
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage3.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage3.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/hardened/stage3.spec	(revision 25406)
@@ -0,0 +1,9 @@
+subarch: amd64
+target: stage3
+version_stamp: hardened-2008.0
+rel_type: hardened
+profile: hardened/linux/amd64/2008.0
+snapshot: 2008.0
+source_subpath: hardened/stage2-amd64-hardened-2008.0
+cflags: -O2 -pipe -fforce-addr
+cxxflags: -O2 -pipe -fforce-addr
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/installcd-stage1.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/installcd-stage1.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/installcd-stage1.spec	(revision 25406)
@@ -0,0 +1,123 @@
+subarch: amd64
+version_stamp: 2008.0
+target: livecd-stage1
+rel_type: default
+profile: default/linux/amd64/2008.0/no-multilib
+snapshot: 2008.0
+source_subpath: default/stage3-amd64-2008.0
+livecd/use:
+	-*
+	deprecated
+	fbcon
+	ipv6
+	livecd
+	loop-aes
+	lvm1
+	ncurses
+	nls
+	nptl
+	nptlonly
+	pam
+	readline
+	socks5
+	ssl
+	unicode
+
+livecd/packages:
+        net-misc/rsync
+	app-accessibility/brltty
+	app-admin/hddtemp
+	app-admin/passook
+	app-admin/pwgen
+	app-admin/syslog-ng
+	app-arch/unzip
+	app-editors/vim
+	app-misc/screen
+	app-misc/vlock
+	app-portage/mirrorselect
+	app-text/wgetpaste
+	media-gfx/fbgrab
+	net-analyzer/tcptraceroute
+	net-analyzer/traceroute
+	net-dialup/mingetty
+### Masked (no keywords)
+#	net-dialup/penggy
+	net-dialup/pptpclient
+	net-dialup/rp-pppoe
+	net-fs/nfs-utils
+	net-irc/irssi
+	net-misc/dhcpcd
+	net-misc/iputils
+	net-misc/ntp
+	net-misc/rdate
+	net-misc/vconfig
+	net-proxy/dante
+	net-proxy/ntlmaps
+	net-proxy/tsocks
+### Masked (~amd64)
+#	net-wireless/b43-fwcutter
+### Masked (~amd64)
+#	net-wireless/bcm43xx-fwcutter
+#	net-wireless/ipw2100-firmware
+#	net-wireless/ipw2200-firmware
+#	net-wireless/iwl3945-ucode
+#	net-wireless/iwl4965-ucode
+#	net-wireless/prism54-firmware
+#	net-wireless/wireless-tools
+#	net-wireless/wpa_supplicant
+#	net-wireless/zd1201-firmware
+#	net-wireless/zd1211-firmware
+	sys-apps/apmd
+	sys-apps/eject
+	sys-apps/ethtool
+	sys-apps/fxload
+	sys-apps/hdparm
+	sys-apps/hwsetup
+	sys-apps/iproute2
+### Masked (no keywords)
+#	sys-apps/lssbus
+	sys-apps/memtester
+	sys-apps/netplug
+	sys-apps/parted
+### Masked (no keywords)
+#	sys-apps/powerpc-utils
+### Masked (no keywords)
+#	sys-apps/ibm-powerpc-utils
+### Masked (no keywords)
+#	sys-apps/ibm-powerpc-utils-papr
+	sys-apps/sdparm
+### Masked (~amd64)
+#	sys-block/partimage
+	sys-block/qla-fc-firmware
+### Masked (no keywords)
+#	sys-boot/yaboot
+### Masked (no keywords)
+#	sys-devel/binutils-hppa64
+### Masked (no keywords)
+#	sys-devel/gcc-hppa64
+	sys-fs/cryptsetup
+	sys-fs/dmraid
+	sys-fs/dosfstools
+	sys-fs/e2fsprogs
+	sys-fs/evms
+	sys-boot/syslinux
+# commented by JH as the ebuilds were masked
+#	sys-fs/hfsplusutils
+#	sys-fs/hfsutils
+### Masked (no keywords)
+#	sys-fs/iprutils
+	sys-fs/jfsutils
+	sys-fs/lsscsi
+	sys-fs/lvm2
+#	sys-fs/lvm-user
+	sys-fs/mac-fdisk
+	sys-fs/mdadm
+	sys-fs/multipath-tools
+	sys-fs/ntfsprogs
+	sys-fs/reiserfsprogs
+	sys-fs/xfsprogs
+	sys-libs/gpm
+	sys-power/acpid
+### Masked (no keywords)
+#	sys-power/apmd
+	www-client/links
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/installcd-stage2-minimal.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/installcd-stage2-minimal.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/installcd-stage2-minimal.spec	(revision 25406)
@@ -0,0 +1,313 @@
+subarch: amd64
+version_stamp: 2008.0
+target: livecd-stage2
+rel_type: default
+profile: default/linux/amd64/2008.0/no-multilib
+snapshot: 2008.0
+source_subpath: default/livecd-stage1-amd64-2008.0
+
+livecd/bootargs: console=tty0 console=ttyS0,115200
+livecd/cdtar: /usr/lib/catalyst/livecd/cdtar/isolinux-elilo-memtest86+-cdtar.tar.bz2
+livecd/fstype: squashfs
+livecd/gk_mainargs: --lvm --dmraid --evms --mdadm --makeopts=-j8
+livecd/iso: /var/tmp/catalyst/builds/default/install-amd64-minimal-2008.0.iso
+livecd/type: gentoo-release-minimal
+livecd/volid: Gentoo Linux amd64 2008.0
+
+boot/kernel: gentoo
+
+boot/kernel/gentoo/sources: gentoo-sources
+boot/kernel/gentoo/config: /root/2008.0-specs/2.6.28-rc7-00105-gfeaf384.conf
+boot/kernel/gentoo/use:
+	-*
+	atm
+	deprecated
+	fbcon
+	fbcondecor
+	ipv6
+	livecd
+	loop-aes
+	lvm1
+	mng
+	ncurses
+	nls
+	nptl
+	nptlonly
+	pam
+	png
+	readline
+	socks5
+	ssl
+	truetype
+	unicode
+	usb
+
+boot/kernel/gentoo/packages:
+	net-dialup/globespan-adsl
+# These were not stable at time of snapshot/release.
+#	net-wireless/rtl8180
+#	net-wireless/rtl8187
+#	net-wireless/adm8211
+#	net-wireless/acx
+#	net-wireless/ipw3945
+#	net-wireless/rt2500
+	sys-apps/pcmciautils
+
+livecd/unmerge:
+	app-admin/eselect
+	app-admin/eselect-ctags
+	app-admin/eselect-vi
+	app-admin/perl-cleaner
+	app-admin/python-updater
+	app-arch/cpio
+	dev-libs/gmp
+	dev-libs/libxml2
+	dev-libs/mpfr
+	dev-libs/popt
+	dev-python/pycrypto
+	dev-util/pkgconfig
+	perl-core/PodParser
+	perl-core/Test-Harness
+	sys-apps/debianutils
+	sys-apps/diffutils
+	sys-apps/file
+	sys-apps/groff
+	sys-apps/man
+	sys-apps/man-pages
+	sys-apps/miscfiles
+#	sys-apps/portage
+#	sys-apps/sandbox
+	sys-apps/texinfo
+	sys-devel/autoconf
+	sys-devel/autoconf-wrapper
+	sys-devel/automake
+	sys-devel/automake-wrapper
+	sys-devel/binutils
+	sys-devel/binutils-config
+	sys-devel/bison
+	sys-devel/flex
+	sys-devel/gcc
+	sys-devel/gcc-config
+	sys-devel/gettext
+	sys-devel/gnuconfig
+	sys-devel/libtool
+	sys-devel/m4
+	sys-devel/make
+	sys-devel/patch
+	sys-libs/db
+	sys-libs/gdbm
+	sys-libs/libkudzu
+	sys-kernel/genkernel
+	sys-kernel/linux-headers
+
+livecd/empty:
+	/etc/cron.daily
+	/etc/cron.hourly
+	/etc/cron.monthly
+	/etc/cron.weekly
+	/etc/logrotate.d
+	/etc/modules.autoload.d
+	/etc/rsync
+	/etc/runlevels/single
+	/etc/skel
+	/lib/dev-state
+	/lib/udev-state
+	/lib64/dev-state
+	/lib64/udev-state
+	/root/.ccache
+	/tmp
+	/usr/diet/include
+	/usr/diet/man
+	/usr/i386-gentoo-linux-uclibc
+	/usr/i386-pc-linux-gnu
+	/usr/i386-pc-linux-uclibc
+	/usr/include
+	/usr/lib/X11/config
+	/usr/lib/X11/doc
+	/usr/lib/X11/etc
+	/usr/lib/awk
+	/usr/lib/ccache
+	/usr/lib/gcc-config
+	/usr/lib/gconv
+	/usr/lib/nfs
+	/usr/lib/perl5/site_perl
+	/usr/lib/portage
+	/usr/lib/python2.2
+	/usr/lib/python2.3
+	/usr/lib/python2.4/test
+	/usr/lib64/X11/config
+	/usr/lib64/X11/doc
+	/usr/lib64/X11/etc
+	/usr/lib64/awk
+	/usr/lib64/ccache
+	/usr/lib64/gcc-config
+	/usr/lib64/gconv
+	/usr/lib64/nfs
+	/usr/lib64/perl5/site_perl
+	/usr/lib64/portage
+	/usr/lib64/python2.2
+	/usr/lib64/python2.3
+	/usr/lib64/python2.4/test
+	/usr/local
+	/usr/portage
+	/usr/powerpc-unknown-linux-gnu
+	/usr/powerpc64-unknown-linux-gnu
+	/usr/share/aclocal
+	/usr/share/baselayout
+	/usr/share/binutils-data
+	/usr/share/consolefonts/partialfonts
+	/usr/share/consoletrans
+	/usr/share/dict
+	/usr/share/doc
+	/usr/share/emacs
+	/usr/share/et
+	/usr/share/gcc-data
+	/usr/share/genkernel
+	/usr/share/gettext
+	/usr/share/glib-2.0
+	/usr/share/gnuconfig
+	/usr/share/gtk-doc
+	/usr/share/i18n
+	/usr/share/info
+	/usr/share/lcms
+	/usr/share/libtool
+	/usr/share/locale
+	/usr/share/man
+	/usr/share/rfc
+	/usr/share/ss
+	/usr/share/state
+	/usr/share/texinfo
+	/usr/share/unimaps
+	/usr/share/zoneinfo
+	/usr/sparc-unknown-linux-gnu
+	/usr/src
+	/usr/x86_64-pc-linux-gnu
+	/var/cache
+	/var/empty
+	/var/lib/portage
+	/var/lock
+	/var/log
+	/var/run
+	/var/spool
+	/var/state
+	/var/tmp
+
+livecd/rm:
+	/boot/System*
+	/boot/initr*
+	/boot/kernel*
+	/etc/*-
+	/etc/*.old
+	/etc/default/audioctl
+	/etc/dispatch-conf.conf
+	/etc/env.d/05binutils
+	/etc/env.d/05gcc
+	/etc/etc-update.conf
+	/etc/hosts.bck
+	/etc/issue*
+	/etc/genkernel.conf
+	/etc/make.conf*
+	/etc/make.globals
+	/etc/make.profile
+	/etc/man.conf
+	/etc/resolv.conf
+	/lib*/*.a
+	/lib*/*.la
+	/lib*/cpp
+	/lib*/security/pam_access.so
+	/lib*/security/pam_chroot.so
+	/lib*/security/pam_debug.so
+	/lib*/security/pam_ftp.so
+	/lib*/security/pam_issue.so
+	/lib*/security/pam_mail.so
+	/lib*/security/pam_mkhomedir.so
+	/lib*/security/pam_motd.so
+	/lib*/security/pam_postgresok.so
+	/lib*/security/pam_rhosts_auth.so
+	/lib*/security/pam_userdb.so
+	/root/.bash_history
+	/root/.viminfo
+	/sbin/*.static
+	/sbin/fsck.cramfs
+	/sbin/fsck.minix
+	/sbin/mkfs.bfs
+	/sbin/mkfs.cramfs
+	/sbin/mkfs.minix
+	/usr/bin/addr2line
+	/usr/bin/ar
+	/usr/bin/as
+	/usr/bin/audioctl
+	/usr/bin/c++*
+	/usr/bin/cc
+	/usr/bin/cjpeg
+	/usr/bin/cpp
+	/usr/bin/djpeg
+	/usr/bin/ebuild
+	/usr/bin/emerge
+	/usr/bin/elftoaout
+	/usr/bin/f77
+	/usr/bin/g++*
+	/usr/bin/g77
+	/usr/bin/gcc*
+	/usr/bin/genkernel
+	/usr/bin/gprof
+	/usr/bin/i386-gentoo-linux-uclibc-*
+	/usr/bin/i386-pc-linux-*
+	/usr/bin/jpegtran
+	/usr/bin/ld
+	/usr/bin/libpng*
+	/usr/bin/nm
+	/usr/bin/objcopy
+	/usr/bin/objdump
+	/usr/bin/piggyback*
+	/usr/bin/portageq
+	/usr/bin/ranlib
+	/usr/bin/readelf
+	/usr/bin/repoman
+	/usr/bin/size
+	/usr/bin/powerpc-unknown-linux-gnu-*
+	/usr/bin/powerpc64-unknown-linux-gnu-*
+	/usr/bin/sparc-unknown-linux-gnu-*
+	/usr/bin/sparc64-unknown-linux-gnu-*
+	/usr/bin/strings
+	/usr/bin/strip
+	/usr/bin/tbz2tool
+	/usr/bin/x86_64-pc-linux-gnu-*
+	/usr/bin/xpak
+	/usr/bin/yacc
+	/usr/lib*/*.a
+	/usr/lib*/*.la
+	/usr/lib*/perl5/site_perl
+	/usr/lib*/gcc-lib/*/*/libgcj*
+	/usr/sbin/archive-conf
+	/usr/sbin/dispatch-conf
+	/usr/sbin/emaint
+	/usr/sbin/emerge-webrsync
+	/usr/sbin/env-update
+	/usr/sbin/fb*
+	/usr/sbin/fixpackages
+	/usr/sbin/quickpkg
+	/usr/sbin/regenworld
+	/usr/share/consolefonts/1*
+	/usr/share/consolefonts/7*
+	/usr/share/consolefonts/8*
+	/usr/share/consolefonts/9*
+	/usr/share/consolefonts/A*
+	/usr/share/consolefonts/C*
+	/usr/share/consolefonts/E*
+	/usr/share/consolefonts/G*
+	/usr/share/consolefonts/L*
+	/usr/share/consolefonts/M*
+	/usr/share/consolefonts/R*
+	/usr/share/consolefonts/a*
+	/usr/share/consolefonts/c*
+	/usr/share/consolefonts/dr*
+	/usr/share/consolefonts/g*
+	/usr/share/consolefonts/i*
+	/usr/share/consolefonts/k*
+	/usr/share/consolefonts/l*
+	/usr/share/consolefonts/r*
+	/usr/share/consolefonts/s*
+	/usr/share/consolefonts/t*
+	/usr/share/consolefonts/v*
+	/usr/share/misc/*.old
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/livecd-stage1.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/livecd-stage1.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/livecd-stage1.spec	(revision 25406)
@@ -0,0 +1,167 @@
+subarch: amd64
+version_stamp: installer-2008.0
+target: livecd-stage1
+rel_type: default
+profile: default/linux/amd64/2008.0/desktop
+snapshot: 2008.0
+source_subpath: default/stage3-amd64-desktop-2008.0
+livecd/use:
+	branding
+	livecd
+	loop-aes
+	socks5
+
+livecd/packages:
+	app-accessibility/brltty
+	app-admin/hddtemp
+	app-admin/ide-smart
+	app-admin/logrotate
+	app-admin/passook
+	app-admin/pwgen
+	app-admin/sudo
+	app-admin/syslog-ng
+	app-arch/mt-st
+	app-benchmarks/cpuburn
+#	app-cdr/cdrkit
+	app-crypt/gnupg
+#	app-editors/emacs
+	app-editors/vim
+	app-misc/mc
+	app-misc/screen
+	app-misc/vlock
+#	app-office/openoffice-bin
+#	app-office/openoffice
+	app-portage/gentoolkit
+	app-portage/mirrorselect
+	app-portage/ufed
+	app-text/wgetpaste
+	dev-util/ccache
+	dev-util/cvs
+	dev-util/git
+	dev-util/subversion
+	gnome-base/gdm
+#	gnome-base/gnome
+	xfce-base/xfce4
+	mail-client/mozilla-thunderbird
+#	mail-client/mozilla-thunderbird-bin
+	media-gfx/fbgrab
+#	media-sound/audacious
+	net-analyzer/netcat
+	net-analyzer/nmap
+	net-analyzer/tcpdump
+#	net-analyzer/tcptraceroute
+	net-analyzer/traceroute
+	net-dialup/mingetty
+	net-dialup/minicom
+### Masked (no keywords)
+#	net-dialup/penggy
+	net-dialup/pptpclient
+	net-dialup/rp-pppoe
+	net-firewall/iptables
+	net-fs/mount-cifs
+	net-fs/nfs-utils
+	net-im/pidgin
+	net-irc/irssi
+	net-irc/xchat
+	net-misc/bridge-utils
+	net-misc/dhcpcd
+	net-misc/iputils
+	net-misc/ntp
+	net-misc/rdate
+	net-misc/rdesktop
+	net-misc/vconfig
+	net-misc/vpnc
+	net-misc/whois
+	net-p2p/bittorrent
+	net-proxy/dante
+	net-proxy/ntlmaps
+	net-proxy/tsocks
+### Masked (~amd64)
+#	net-wireless/b43-fwcutter
+### Masked (~amd64)
+#	net-wireless/bcm43xx-fwcutter
+	net-wireless/ipw2100-firmware
+	net-wireless/ipw2200-firmware
+	net-wireless/iwl3945-ucode
+	net-wireless/iwl4965-ucode
+	net-wireless/prism54-firmware
+	net-wireless/wireless-tools
+	net-wireless/wpa_supplicant
+	net-wireless/zd1201-firmware
+	net-wireless/zd1211-firmware
+### Masked (no keywords)
+#	sys-apps/apmd
+	sys-apps/eject
+	sys-apps/ethtool
+	sys-apps/fxload
+	sys-apps/gli
+	sys-apps/hdparm
+	sys-apps/hwsetup
+### Masked (no keywords)
+#	sys-apps/ibm-powerpc-utils
+### Masked (no keywords)
+#	sys-apps/ibm-powerpc-utils-papr
+	sys-apps/iproute2
+### Masked (no keywords)
+#	sys-apps/lssbus
+	sys-apps/memtester
+	sys-apps/netplug
+	sys-apps/parted
+### Masked (no keywords)
+#	sys-apps/powerpc-utils
+	sys-apps/sdparm
+	sys-apps/sg3_utils
+	sys-apps/slocate
+	sys-apps/smartmontools
+	sys-block/aoetools
+	sys-block/disktype
+### Masked (-amd64)
+#	sys-block/gpart
+### Masked (~amd64)
+#	sys-block/partimage
+	sys-block/qla-fc-firmware
+### Masked (no keywords)
+#	sys-boot/aboot
+### Masked (no keywords)
+#	sys-boot/elilo
+	sys-boot/grub
+#	sys-boot/lilo
+	sys-boot/syslinux
+### Masked (no keywords)
+#	sys-boot/yaboot
+### Masked (no keywords)
+#	sys-devel/binutils-hppa64
+	sys-devel/distcc
+### Masked (no keywords)
+#	sys-devel/gcc-hppa64
+	sys-fs/cryptsetup
+	sys-fs/dmraid
+	sys-fs/dosfstools
+	sys-fs/e2fsprogs
+	sys-fs/evms
+	sys-fs/hfsplusutils
+	sys-fs/hfsutils
+### Masked (no keywords)
+#	sys-fs/iprutils
+	sys-fs/jfsutils
+	sys-fs/lsscsi
+	sys-fs/lvm2
+#	sys-fs/lvm-user
+	sys-fs/mac-fdisk
+	sys-fs/mdadm
+	sys-fs/ntfsprogs
+	sys-fs/reiserfsprogs
+	sys-fs/xfsprogs
+	sys-kernel/genkernel
+	sys-libs/gpm
+	sys-power/acpid
+	sys-process/htop
+	sys-process/vixie-cron
+	www-client/links
+	www-client/mozilla-firefox
+#	www-client/mozilla-firefox-bin
+	x11-base/xorg-server
+	x11-base/xorg-x11
+	x11-drivers/synaptics
+	x11-themes/gdm-themes-livecd
+	x11-themes/gentoo-artwork-livecd
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/livecd-stage2.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/livecd-stage2.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/livecd-stage2.spec	(revision 25406)
@@ -0,0 +1,66 @@
+subarch: amd64
+version_stamp: 2008.0
+target: livecd-stage2
+rel_type: default
+profile: default/linux/amd64/2008.0/desktop
+snapshot: 2008.0
+source_subpath: default/livecd-stage1-amd64-installer-2008.0
+
+livecd/bootargs: dokeymap
+livecd/cdtar: /usr/lib/catalyst/livecd/cdtar/isolinux-elilo-memtest86+-cdtar.tar.bz2
+livecd/fsscript: /var/svnroot/releng/trunk/releases/2008.0/scripts/livecd.sh
+livecd/fstype: squashfs
+livecd/gk_mainargs: --lvm --dmraid --evms --mdadm --makeopts=-j8
+livecd/iso: /release/buildroot/amd64-default/builds/default/livecd-amd64-installer-2008.0.iso
+livecd/type: gentoo-release-livecd
+livecd/volid: Gentoo Linux 2008.0 amd64 LiveCD
+livecd/xsession: xfce
+livecd/xdm: gdm
+
+livecd/overlay: /var/svnroot/releng/trunk/releases/2008.0/overlays/common/overlay/livecd
+livecd/root_overlay: /var/svnroot/releng/trunk/releases/2008.0/overlays/common/root_overlay
+
+boot/kernel: gentoo
+boot/kernel/gentoo/sources: gentoo-sources
+boot/kernel/gentoo/config: /var/svnroot/releng/trunk/releases/2008.0/kconfig/amd64/livecd-2.6.24.config
+boot/kernel/gentoo/use: atm fbcondecor mng png truetype usb
+boot/kernel/gentoo/packages:
+	media-libs/alsa-oss
+	media-sound/alsa-utils
+### Masked (~amd64)
+#	net-dialup/fcdsl
+### Masked (~amd64)
+#	net-dialup/fritzcapi
+	net-dialup/globespan-adsl
+### Masked (~amd64)
+#	net-dialup/slmodem
+	net-misc/br2684ctl
+### Masked (~amd64)
+#	net-wireless/acx
+	net-wireless/hostap-utils
+#	net-wireless/ipw3945
+#	net-wireless/madwifi-ng-tools
+#	net-wireless/rt2500
+### Masked (~amd64)
+#	net-wireless/rtl8187
+	sys-apps/pcmciautils
+	sys-fs/ntfs3g
+
+livecd/empty:
+	/var/tmp
+	/var/empty
+	/var/run
+	/var/state
+	/var/cache/edb/dep
+	/tmp
+	/usr/portage
+	/usr/src
+	/root/.ccache
+	/usr/share/genkernel/pkg/x86/cpio
+
+livecd/rm:
+	/etc/*-
+	/etc/*.old
+	/root/.viminfo
+	/var/log/*.log
+	/usr/share/genkernel/pkg/x86/*.bz2
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/livedvd-stage1.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/livedvd-stage1.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/livedvd-stage1.spec	(revision 25406)
@@ -0,0 +1,300 @@
+subarch: amd64
+version_stamp: installer-2008.0
+target: livecd-stage1
+rel_type: default
+profile: default/linux/amd64/2008.0/desktop
+snapshot: 2008.0
+source_subpath: default/stage3-amd64-desktop-2008.0
+livecd/use:
+	branding
+	livecd
+	loop-aes
+	socks5
+
+livecd/packages:
+	app-accessibility/brltty
+	app-admin/gkrellm
+	app-admin/hddtemp
+	app-admin/ide-smart
+	app-admin/logrotate
+	app-admin/passook
+	app-admin/pwgen
+	app-admin/quickswitch
+	app-admin/sudo
+	app-admin/superadduser
+	app-admin/syslog-ng
+### Masked (~amd64)
+#	app-admin/testdisk
+	app-arch/alien
+	app-arch/mt-st
+	app-arch/unrar
+	app-arch/unzip
+	app-benchmarks/cpuburn
+	app-cdr/bin2iso
+	app-cdr/cdrdao
+	app-cdr/cdrkit
+	app-cdr/dvd+rw-tools
+	app-cdr/gnomebaker
+	app-cdr/k3b
+	app-cdr/nrg2iso
+	app-crypt/gnupg
+	app-editors/bluefish
+	app-editors/emacs
+	app-editors/gvim
+	app-editors/vim
+	app-editors/xemacs
+	app-forensics/chkrootkit
+	app-laptop/i8kutils
+### Compile fails
+#	app-misc/beagle
+	app-misc/mc
+	app-misc/pax-utils
+	app-misc/screen
+### Masked (~amd64)
+#	app-misc/splitvt
+	app-misc/vlock
+	app-office/dia
+	app-office/gnucash
+	app-office/gnumeric
+	app-office/koffice
+	app-office/openoffice
+#	app-office/openoffice-bin
+	app-office/scribus
+	app-pda/gtkpod
+	app-pda/ipodslave
+	app-portage/herdstat
+	app-portage/genlop
+	app-portage/gentoolkit
+	app-portage/gentoolkit-dev
+	app-portage/layman
+	app-portage/mirrorselect
+	app-portage/portage-utils
+	app-portage/ufed
+	app-shells/bash-completion
+	app-shells/gentoo-bashcomp
+	app-shells/tcsh
+	app-shells/zsh
+	app-shells/zsh-completion
+	app-text/tetex
+	app-text/wgetpaste
+	dev-util/anjuta
+	dev-util/ccache
+	dev-util/cvs
+	dev-util/git
+	dev-util/indent
+	dev-util/kdbg
+	dev-util/kdesvn
+	dev-util/kdevelop
+	dev-util/ltrace
+	dev-util/strace
+	dev-util/subversion
+	dev-util/valgrind
+	gnome-base/gnome
+	gnome-extra/evolution-exchange
+	gnome-base/gdm
+### Masked (~amd64)
+#	gnome-extra/gsynaptics
+	gnome-extra/sensors-applet
+	kde-base/kde-meta
+	kde-base/kooka
+	mail-client/evolution
+	mail-client/mozilla-thunderbird
+	mail-client/mozilla-thunderbird-bin
+	mail-client/sylpheed
+	mail-client/claws-mail
+### Masked (~amd64)
+#	media-gfx/blender
+	media-gfx/digikam
+	media-gfx/fbgrab
+	media-gfx/gimp
+	media-gfx/gimp-print
+	media-gfx/gtkam
+	media-gfx/inkscape
+	media-gfx/xsane
+	media-sound/amarok
+	media-sound/audacious
+	media-sound/audacity
+	media-sound/easytag
+	media-sound/gnomeradio
+	media-sound/grip
+	media-sound/hydrogen
+	media-sound/rhythmbox
+	media-video/dvdrip
+	media-video/gqcam
+#	media-video/gxine
+	media-video/lsdvd
+	media-video/mplayer
+### Masked (~amd64)
+#	media-video/mplayer-bin
+	media-video/ogle-gui
+	media-video/vlc
+	media-video/xine-ui
+	media-video/kmplayer
+	net-analyzer/ettercap
+	net-analyzer/netcat
+	net-analyzer/nmap
+	net-analyzer/snort
+	net-analyzer/tcpdump
+	net-analyzer/tcptraceroute
+	net-analyzer/traceroute
+	net-analyzer/wireshark
+	net-dialup/mingetty
+	net-dialup/minicom
+### Masked (no keyword)
+#	net-dialup/penggy
+	net-dialup/pptpclient
+	net-dialup/rp-pppoe
+	net-firewall/iptables
+	net-firewall/kmyfirewall
+	net-ftp/ncftp
+	net-fs/mount-cifs
+	net-fs/nfs-utils
+	net-fs/samba
+	net-im/pidgin
+	net-irc/irssi
+	net-irc/xchat
+	net-misc/bridge-utils
+	net-misc/dhcpcd
+	net-misc/iputils
+	net-misc/ntp
+	net-misc/rdate
+	net-misc/rdesktop
+	net-misc/tightvnc
+	net-misc/vconfig
+	net-misc/vpnc
+	net-misc/whois
+	net-nntp/pan
+	net-p2p/bittorrent
+	net-p2p/limewire
+	net-print/cups
+	net-proxy/dante
+	net-proxy/ntlmaps
+	net-proxy/tsocks
+### Masked (~amd64)
+#	net-wireless/aircrack-ng
+### Masked (~amd64)
+#	net-wireless/airsnort
+### Masked (~amd64)
+#	net-wireless/b43-fwcutter
+### Masked (~amd64)
+#	net-wireless/bcm43xx-fwcutter
+	net-wireless/gnome-bluetooth
+	net-wireless/ipw2100-firmware
+	net-wireless/ipw2200-firmware
+	net-wireless/iwl3945-ucode
+	net-wireless/iwl4965-ucode
+	net-wireless/kdebluetooth
+	net-wireless/prism54-firmware
+	net-wireless/wepattack
+	net-wireless/wireless-tools
+	net-wireless/wpa_supplicant
+	net-wireless/zd1201-firmware
+	net-wireless/zd1211-firmware
+	rox-base/rox
+### Masked
+#	sys-apps/apmd
+	sys-apps/dmidecode
+	sys-apps/eject
+	sys-apps/ethtool
+	sys-apps/fxload
+	sys-apps/gli
+	sys-apps/gradm
+	sys-apps/hdparm
+	sys-apps/hwsetup
+### Masked (no keyword)
+#	sys-apps/ibm-powerpc-utils
+### Masked (no keyword)
+#	sys-apps/ibm-powerpc-utils-papr
+	sys-apps/iproute2
+	sys-apps/ivman
+### Masked (no keyword)
+#	sys-apps/lssbus
+	sys-apps/memtester
+	sys-apps/netplug
+	sys-apps/parted
+	sys-apps/pcsc-lite
+	sys-apps/pmount
+### Masked (no keyword)
+#	sys-apps/powerpc-utils
+### Masked (~amd64)
+#	sys-apps/qtparted
+### Compile fails
+#	sys-apps/rsbac-admin
+	sys-apps/sdparm
+	sys-apps/sg3_utils
+	sys-apps/slocate
+	sys-apps/smartmontools
+### Masked (~amd64)
+#	sys-apps/tuxonice-userui
+	sys-block/aoetools
+	sys-block/disktype
+### Masked (-amd64)
+#	sys-block/gpart
+	sys-block/gparted
+	sys-block/mpt-status
+### Masked (~amd64)
+#	sys-block/partimage
+	sys-block/qla-fc-firmware
+### Masked (no keyword)
+#	sys-boot/aboot
+### Masked (no keyword)
+#	sys-boot/elilo
+	sys-boot/grub
+	sys-boot/lilo
+	sys-boot/syslinux
+### Masked (no keyword)
+#	sys-boot/yaboot
+### Masked (no keyword)
+#	sys-devel/binutils-hppa64
+	sys-devel/distcc
+### Masked (no keyword)
+#	sys-devel/gcc-hppa64
+	sys-devel/gdb
+	sys-fs/cryptsetup
+	sys-fs/dmraid
+	sys-fs/dosfstools
+	sys-fs/e2fsprogs
+	sys-fs/evms
+### Masked (~amd64)
+#	sys-fs/hfsplusutils
+	sys-fs/hfsutils
+### Masked (no keyword)
+#	sys-fs/iprutils
+	sys-fs/jfsutils
+	sys-fs/lsscsi
+	sys-fs/lvm2
+	sys-fs/mac-fdisk
+	sys-fs/mdadm
+	sys-fs/multipath-tools
+	sys-fs/ntfsprogs
+	sys-fs/reiserfsprogs
+	sys-fs/quota
+	sys-fs/xfsprogs
+	sys-fs/xfsdump
+	sys-kernel/genkernel
+	sys-libs/gpm
+	sys-power/acpid
+	sys-power/apcupsd
+	sys-process/htop
+	sys-process/lsof
+	sys-process/vixie-cron
+	www-client/epiphany-extensions
+	www-client/galeon
+	www-client/links
+	www-client/mozilla-firefox
+	www-client/mozilla-firefox-bin
+	www-client/opera
+	www-client/seamonkey
+	www-client/seamonkey-bin
+	x11-base/xorg-x11
+	x11-drivers/synaptics
+	x11-misc/xscreensaver
+### Masked (no keyword)
+#	x11-plugins/gkrellm-plugins
+	x11-themes/gdm-themes-livecd
+	x11-themes/gentoo-artwork-livecd
+	x11-wm/afterstep
+	x11-wm/enlightenment
+	x11-wm/fluxbox
+	x11-wm/windowmaker
+	xfce-base/xfce4
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/livedvd-stage2.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/livedvd-stage2.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/livedvd-stage2.spec	(revision 25406)
@@ -0,0 +1,66 @@
+subarch: amd64
+version_stamp: 2008.0
+target: livecd-stage2
+rel_type: default
+profile: default/linux/amd64/2008.0/desktop
+snapshot: 2008.0
+source_subpath: default/livecd-stage1-amd64-installer-2008.0
+
+livecd/bootargs: dokeymap
+livecd/cdtar: /usr/lib/catalyst/livecd/cdtar/isolinux-elilo-memtest86+-cdtar.tar.bz2
+livecd/fsscript: /var/svnroot/releng/trunk/releases/2008.0/scripts/livecd.sh
+livecd/fstype: squashfs
+livecd/gk_mainargs: --lvm --dmraid --evms --mdadm --makeopts=-j8
+livecd/iso: /var/tmp/catalyst/builds/default/livedvd-amd64-installer-2008.0.iso
+livecd/type: gentoo-release-livecd
+livecd/volid: Gentoo Linux AMD64 LiveDVD
+livecd/xdm: gdm
+livecd/xsession: xfce
+
+livecd/overlay: /var/svnroot/releng/trunk/releases/2008.0/overlays/common/overlay/livedvd
+livecd/root_overlay: /var/svnroot/releng/trunk/releases/2008.0/overlays/common/root_overlay
+
+boot/kernel: gentoo
+
+boot/kernel/gentoo/sources: gentoo-sources
+boot/kernel/gentoo/config: /var/svnroot/releng/trunk/releases/2008.0/kconfig/amd64/livecd-2.6.24.config
+boot/kernel/gentoo/use: atm fbcondecor mng png truetype usb
+boot/kernel/gentoo/packages:
+	media-libs/alsa-oss
+	media-sound/alsa-utils
+### Masked (no keyword)
+#	net-dialup/fcdsl
+### Masked (~amd64)
+#	net-dialup/fritzcapi
+	net-dialup/globespan-adsl
+### Masked (~amd64)
+#	net-dialup/slmodem
+	net-misc/br2684ctl
+### Masked (~amd64)
+#	net-wireless/acx
+	net-wireless/hostap-utils
+#	net-wireless/ipw3945
+#	net-wireless/madwifi-ng-tools
+#	net-wireless/rt2500
+### Masked (~amd64)
+#	net-wireless/rtl8187
+	sys-apps/pcmciautils
+
+livecd/empty:
+	/var/tmp
+	/var/empty
+	/var/run
+	/var/state
+	/var/cache/edb/dep
+	/tmp
+	/usr/portage
+	/usr/src
+	/root/.ccache
+	/usr/share/genkernel/pkg/amd64/cpio
+
+livecd/rm:
+	/etc/*-
+	/etc/*.old
+	/root/.viminfo
+	/var/log/*.log
+	/usr/share/genkernel/pkg/amd64/*.bz2
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/stage1.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/stage1.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/stage1.spec	(revision 25406)
@@ -0,0 +1,10 @@
+subarch: amd64
+target: stage1
+version_stamp: 2008.0
+rel_type: default
+profile: default/linux/amd64/2008.0
+snapshot: 2008.0
+source_subpath: default/stage3-amd64-2007.0
+cflags: -O2 -pipe -march=k8
+portage_confdir: /etc/portage
+portage_overlay: /usr/src/portage_overlay
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/stage2-desktop.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/stage2-desktop.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/stage2-desktop.spec	(revision 25406)
@@ -0,0 +1,7 @@
+subarch: amd64
+target: stage2
+version_stamp: desktop-2008.0
+rel_type: default
+profile: default/linux/amd64/2008.0/desktop
+snapshot: 2008.0
+source_subpath: default/stage1-amd64-2008.0
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/stage2.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/stage2.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/stage2.spec	(revision 25406)
@@ -0,0 +1,10 @@
+subarch: amd64
+target: stage2
+version_stamp: 2008.0
+rel_type: default
+profile: default/linux/amd64/2008.0
+snapshot: 2008.0
+source_subpath: default/stage1-amd64-2008.0
+cflags: -O2 -pipe -march=k8
+portage_confdir: /etc/portage
+portage_overlay: /usr/src/portage_overlay
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/stage3-desktop.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/stage3-desktop.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/stage3-desktop.spec	(revision 25406)
@@ -0,0 +1,7 @@
+subarch: amd64
+target: stage3
+version_stamp: desktop-2008.0
+rel_type: default
+profile: default/linux/amd64/2008.0/desktop
+snapshot: 2008.0
+source_subpath: default/stage2-amd64-desktop-2008.0
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/stage3.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/stage3.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/stage3.spec	(revision 25406)
@@ -0,0 +1,10 @@
+subarch: amd64
+target: stage3
+version_stamp: 2008.0
+rel_type: default
+profile: default/linux/amd64/2008.0
+snapshot: 2008.0
+source_subpath: default/stage2-amd64-2008.0
+cflags: -O2 -pipe -march=k8
+portage_confdir: /etc/portage
+portage_overlay: /usr/src/portage_overlay
Index: /branches/eam_branches/20090715/catalyst/2008.0-specs/stage4.spec
===================================================================
--- /branches/eam_branches/20090715/catalyst/2008.0-specs/stage4.spec	(revision 25406)
+++ /branches/eam_branches/20090715/catalyst/2008.0-specs/stage4.spec	(revision 25406)
@@ -0,0 +1,10 @@
+subarch: amd64
+target: stage4
+version_stamp: 2008.0
+rel_type: default
+profile: default/linux/amd64/2008.0
+snapshot: 2008.0
+source_subpath: default/stage2-amd64-2008.0
+portage_confdir: /etc/portage
+portage_overlay: /usr/src/portage_overlay
+stage4/packages: ipp-node
Index: /branches/eam_branches/20090715/dbconfig/add.md
===================================================================
--- /branches/eam_branches/20090715/dbconfig/add.md	(revision 25406)
+++ /branches/eam_branches/20090715/dbconfig/add.md	(revision 25406)
@@ -0,0 +1,25 @@
+addRun METADATA
+    add_id          S64     0       # Primary Key AUTO_INCREMENT
+    cam_id          S64     0       # Key INDEX(add_id,cam_id) fkey(cam_id) ref camRun(cam_id)
+    state           STR     64      # key
+    workdir         STR     255
+    workdir_state   STR     64
+    label           STR	    64
+    dvodb	    STR	    255
+    magicked        S64     0
+END
+
+addProcessedExp METADATA
+    add_id          S64     0       # Primary Key AUTO_INCREMENT
+    dtime_addstar   F32     0.0
+
+    n_stars         S32     0
+    
+    path_base	    STR	    255
+    fault           S16     0       # Key NOT NULL
+END
+
+addMask METADATA
+    label           STR    64       # Primary Key
+END
+    
Index: /branches/eam_branches/20090715/dbconfig/changes.txt
===================================================================
--- /branches/eam_branches/20090715/dbconfig/changes.txt	(revision 25405)
+++ /branches/eam_branches/20090715/dbconfig/changes.txt	(revision 25406)
@@ -1206,2 +1206,44 @@
 ALTER TABLE magicDSRun ADD COLUMN inv_magic_id BIGINT AFTER magic_id;
 ALTER TABLE magicDSRun ADD FOREIGN KEY (inv_magic_id) REFERENCES magicRun(magic_id);
+
+-- Adding columns for debugging publishing problems
+
+ALTER TABLE publishDone ADD COLUMN hostname VARCHAR(64) AFTER path_base;
+ALTER TABLE publishDone ADD COLUMN dtime_script FLOAT AFTER hostname;
+
+-- Version 1.1.55
+-- addstar stage tables:
+
+CREATE TABLE addRun (
+    add_id BIGINT AUTO_INCREMENT,
+    cam_id BIGINT,
+    state VARCHAR(64),
+    workdir VARCHAR(255),
+    workdir_state VARCHAR(64),
+    label VARCHAR(64),
+    dvodb VARCHAR(255),
+    magicked BIGINT,
+    PRIMARY KEY(add_id),
+    KEY(add_id),
+    KEY(cam_id),
+    KEY(state),
+    KEY(workdir_state),
+    KEY(label),
+    INDEX(add_id, cam_id),
+    FOREIGN KEY(cam_id) REFERENCES camRun(cam_id)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+CREATE TABLE addProcessedExp (
+    add_id BIGINT AUTO_INCREMENT,
+    dtime_addstar FLOAT,
+    n_stars INT,
+    path_base VARCHAR(255),
+    fault SMALLINT NOT NULL,
+    PRIMARY KEY(add_id),
+    FOREIGN KEY(add_id) REFERENCES addRun(add_id)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
+
+CREATE TABLE addMask (
+    label VARCHAR(64),
+    PRIMARY KEY(label)
+) ENGINE=innodb DEFAULT CHARSET=latin1;
Index: /branches/eam_branches/20090715/dbconfig/ipp.m4
===================================================================
--- /branches/eam_branches/20090715/dbconfig/ipp.m4	(revision 25405)
+++ /branches/eam_branches/20090715/dbconfig/ipp.m4	(revision 25406)
@@ -14,4 +14,5 @@
 include(chip.md)
 include(cam.md)
+include(add.md)
 include(fake.md)
 include(warp.md)
Index: /branches/eam_branches/20090715/dbconfig/publish.md
===================================================================
--- /branches/eam_branches/20090715/dbconfig/publish.md	(revision 25405)
+++ /branches/eam_branches/20090715/dbconfig/publish.md	(revision 25406)
@@ -1,23 +1,25 @@
 # Tables for publishing data to a science client
 
-publishClient   METADATA 
-    client_id   S64         0       # Primary Key AUTO_INCREMENT
-    product     STR	    64
-    stage	STR	    64
-    workdir     STR	    255
-    comment     STR         255
+publishClient    METADATA 
+    client_id    S64         0       # Primary Key AUTO_INCREMENT
+    product      STR         64
+    stage        STR         64
+    workdir      STR         255
+    comment      STR         255
+END              
+                 
+publishRun       METADATA
+    pub_id       S64         0       # Primary Key AUTO_INCREMENT
+    client_id    S64         0
+    stage_id     S64         0
+    label        STR         64
+    state        STR         64
+END              
+                 
+publishDone      METADATA
+    pub_id       S64         0       # Primary Key
+    path_base    STR         255
+    hostname     STR         64
+    dtime_script F32         0.0
+    fault        S16         0
 END
-
-publishRun	METADATA
-    pub_id      S64         0       # Primary Key AUTO_INCREMENT
-    client_id   S64         0
-    stage_id    S64         0
-    label       STR         64
-    state       STR         64
-END
-
-publishDone	METADATA
-    pub_id      S64         0       # Primary Key
-    path_base	STR	    255
-    fault	S16	    0
-END
Index: /branches/eam_branches/20090715/hardware/bios_cds/mkdisk.sh
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/mkdisk.sh	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/mkdisk.sh	(revision 25406)
@@ -0,0 +1,1 @@
+mkisofs -r -b winb500.IMA -c boot.catalog -o $1.iso $1
Index: /branches/eam_branches/20090715/hardware/bios_cds/s2892-cd/flash.bat
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s2892-cd/flash.bat	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s2892-cd/flash.bat	(revision 25406)
@@ -0,0 +1,1 @@
+phlash16 2892V205.wph /BBL /mode=3 /s
Index: /branches/eam_branches/20090715/hardware/bios_cds/s2892-cd/readme.txt
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s2892-cd/readme.txt	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s2892-cd/readme.txt	(revision 25406)
@@ -0,0 +1,7 @@
+You will need two floppy disks to flash the BIOS 
+Disk1 -bootable DOS/WIN98 disk with no memory managers (i.e. HIMEM.SYS or EMMM386)
+Disk2 -blank diskette unzip files in this archive (Phlash16.EXE XXXXX.wph & flash.bat)
+
+Step 1- boot with a DISK1 (DOS/Win98 boot diskette)
+Step 2- Replace DISK1 with DISK2 and type "flash"
+
Index: /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd/README.txt
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd/README.txt	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd/README.txt	(revision 25406)
@@ -0,0 +1,6 @@
+To Flash this BIOS you will need two floppy disks. 
+One boot disk (Win98 DOS recommended) and one blank floppy disk.
+step 1 - Extract all files from the archive to the blank floppy. Label this disk "BIOS FLASH".
+step 2 - Boot the system from boot disk.
+step 4 - Insert the disk labeled "BIOS FLASH" and type "flash" 
+step 5 - If problems are encountered try to reset CMOS 
Index: /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd/areca/ARC1280/143-70417/version.143.txt
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd/areca/ARC1280/143-70417/version.143.txt	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd/areca/ARC1280/143-70417/version.143.txt	(revision 25406)
@@ -0,0 +1,5 @@
+Versions List :
+
+ARCXXXXBIOS.BIN 	V1.17f	Date: 2007-04-11
+ARCXXXXBOOT.BIN	V1.43	Date: 2007-04-17
+ARCXXXXFIRM.BIN	V1.42	Date: 2007-04-17
Index: /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd/areca/ARC1280/144-80128/version.txt
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd/areca/ARC1280/144-80128/version.txt	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd/areca/ARC1280/144-80128/version.txt	(revision 25406)
@@ -0,0 +1,5 @@
+Versions List :
+
+ARCXXXXBIOS.BIN 	V1.21	Date: 2007-10-11
+ARCXXXXBOOT.BIN	V1.44	Date: 2008-01-28
+ARCXXXXFIRM.BIN	V1.44	Date: 2008-01-31
Index: /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/areca/ARC1280/143-70417/version.143.txt
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/areca/ARC1280/143-70417/version.143.txt	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/areca/ARC1280/143-70417/version.143.txt	(revision 25406)
@@ -0,0 +1,5 @@
+Versions List :
+
+ARCXXXXBIOS.BIN 	V1.17f	Date: 2007-04-11
+ARCXXXXBOOT.BIN	V1.43	Date: 2007-04-17
+ARCXXXXFIRM.BIN	V1.42	Date: 2007-04-17
Index: /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/areca/ARC1280/144-80128/version.txt
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/areca/ARC1280/144-80128/version.txt	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/areca/ARC1280/144-80128/version.txt	(revision 25406)
@@ -0,0 +1,5 @@
+Versions List :
+
+ARCXXXXBIOS.BIN 	V1.21	Date: 2007-10-11
+ARCXXXXBOOT.BIN	V1.44	Date: 2008-01-28
+ARCXXXXFIRM.BIN	V1.44	Date: 2008-01-31
Index: /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/s2912/README.txt
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/s2912/README.txt	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/s2912/README.txt	(revision 25406)
@@ -0,0 +1,6 @@
+To Flash this BIOS you will need two floppy disks. 
+One boot disk (Win98 DOS recommended) and one blank floppy disk.
+step 1 - Extract all files from the archive to the blank floppy. Label this disk "BIOS FLASH".
+step 2 - Boot the system from boot disk.
+step 4 - Insert the disk labeled "BIOS FLASH" and type "flash" 
+step 5 - If problems are encountered try to reset CMOS 
Index: /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/s2912/flsah.bat
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/s2912/flsah.bat	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s2912-cd2/s2912/flsah.bat	(revision 25406)
@@ -0,0 +1,1 @@
+phlash16 2912V303.WPH /bbl /mode=3 /s /c /MFG
Index: /branches/eam_branches/20090715/hardware/bios_cds/s5397-cd-v104/s5397/Flash Text.txt
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s5397-cd-v104/s5397/Flash Text.txt	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s5397-cd-v104/s5397/Flash Text.txt	(revision 25406)
@@ -0,0 +1,5 @@
+CAUTION: To update, make sure that you are using a Win95 or Win98 boot disk ONLY.  Also make sure to press the F5 
+key immediately once the floppy disk starts to be used so that all memory resident programs will be blocked out.  If this is 
+not accomplished then you will get an error during the flash procedure instructing that HIMEM programs are present and 
+the flash will be halted.  Then at the A: prompt simply type in "flash" and the rest will be handled by the files included in 
+your download.
Index: /branches/eam_branches/20090715/hardware/bios_cds/s5397-cd-v104/s5397/flash.bat
===================================================================
--- /branches/eam_branches/20090715/hardware/bios_cds/s5397-cd-v104/s5397/flash.bat	(revision 25406)
+++ /branches/eam_branches/20090715/hardware/bios_cds/s5397-cd-v104/s5397/flash.bat	(revision 25406)
@@ -0,0 +1,1 @@
+PHLASH16 5397v104.WPH /BBL /MODE=3
Index: /branches/eam_branches/20090715/ippScripts/Build.PL
===================================================================
--- /branches/eam_branches/20090715/ippScripts/Build.PL	(revision 25405)
+++ /branches/eam_branches/20090715/ippScripts/Build.PL	(revision 25406)
@@ -49,4 +49,5 @@
         scripts/chip_imfile.pl
         scripts/camera_exp.pl
+        scripts/addstar_run.pl
         scripts/fake_imfile.pl
         scripts/warp_overlap.pl
Index: /branches/eam_branches/20090715/ippScripts/scripts/addstar_run.pl
===================================================================
--- /branches/eam_branches/20090715/ippScripts/scripts/addstar_run.pl	(revision 25406)
+++ /branches/eam_branches/20090715/ippScripts/scripts/addstar_run.pl	(revision 25406)
@@ -0,0 +1,250 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+use Carp;
+
+## report the program and machine
+use Sys::Hostname;
+my $host = hostname();
+print "\n\n";
+print "Starting script $0 on $host\n\n";
+
+use DateTime;
+my $mjd_start = DateTime->now->mjd;   # MJD of starting script
+
+use vars qw( $VERSION );
+$VERSION = '0.01';
+
+use IPC::Cmd 0.36 qw( can_run run );
+use PS::IPP::Metadata::Config;
+use PS::IPP::Metadata::List qw( parse_md_list );
+use PS::IPP::Config 1.01 qw( :standard );
+use File::Temp qw( tempfile );
+
+use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+use Pod::Usage qw( pod2usage );
+
+# Look for programs we need
+my $missing_tools;
+#my $camtool = can_run('camtool') or (warn "Can't find camtool" and $missing_tools = 1);
+my $addtool = can_run('addtool') or (warn "Can't find addtool" and $missing_tools = 1);
+#my $ppImage = can_run('ppImage') or (warn "Can't find ppImage" and $missing_tools = 1);
+my $ppConfigDump = can_run('ppConfigDump') or (warn "Can't find ppConfigDump" and $missing_tools = 1);
+#my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);
+#my $psastro = can_run('psastro') or (warn "Can't find psastro" and $missing_tools = 1);
+my $addstar = can_run('addstar') or (warn "Can't find addstar" and $missing_tools = 1);
+if ($missing_tools) {
+    warn("Can't find required tools.");
+    exit($PS_EXIT_CONFIG_ERROR);
+}
+
+my ( $exp_tag, $add_id, $camera, $outroot, $camroot, $recipe, $dbname, $reduction, $dvodb, $verbose, $no_update,
+     $no_op, $redirect, $save_temps, $run_state);
+GetOptions(
+    'exp_tag=s'          => \$exp_tag, # Exposure identifier
+    'add_id=s'          => \$add_id, # Camtool identifier
+    'recipe=s'          => \$recipe, # Recipe to use
+    'camera|c=s'        => \$camera, # Camera
+    'dbname|d=s'        => \$dbname, # Database name
+    'outroot|w=s'       => \$outroot, # output file base name
+    'camroot|w=s'       => \$camroot, # camera stage root name.
+    'reduction=s'       => \$reduction, # Reduction class
+    'dvodb|w=s'         => \$dvodb,  # output DVO database
+    'run-state=s'       => \$run_state, # 'new' or 'update'
+    'verbose'           => \$verbose,   # Print to stdout
+    'no-update'         => \$no_update, # Update the database?
+    'no-op'             => \$no_op, # Don't do any operations?
+    'redirect-output'   => \$redirect,
+    'save-temps'        => \$save_temps, # Save temporary files?
+    ) or pod2usage( 2 );
+
+pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
+pod2usage(
+          -msg => "Required options: --exp_tag --add_id --camera --outroot",
+          -exitval => 3,
+          ) unless
+    defined $exp_tag and
+    defined $add_id and
+    defined $outroot and
+    defined $camera;
+
+my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $add_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
+
+my $logDest = $ipprc->filename("LOG.EXP", $outroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
+
+if (not defined $run_state) { $run_state = 'new'; }
+if ($run_state eq 'update') {
+    $logDest .= '.update';
+}
+
+if ($redirect) {
+    $ipprc->redirect_output($logDest) or my_die( "Unable to redirect output", $add_id, $PS_EXIT_SYS_ERROR );
+    print "\n\n";
+    print "Starting script $0 on $host\n\n";
+    print "COMMAND IS: @ARGV\n\n";
+}
+
+# Recipes to use based on reduction class
+$reduction = 'DEFAULT' unless defined $reduction;
+
+my $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR'); # Recipe to use
+&my_die("Unrecognised ADDSTAR recipe", $add_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_addstar;
+
+#my $recipe_psastro = $ipprc->reduction($reduction, 'PSASTRO'); # Recipe to use
+#&my_die("Unrecognised PSASTRO recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_psastro;
+
+my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
+
+my $cmdflags;
+
+# Get list of component files
+my $files;                      # Array of component files
+{
+    my $command = "$addtool -pendingexp -add_id $add_id"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform addtool: $error_code", $add_id, $error_code);
+    }
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config doc", $add_id, $PS_EXIT_PROG_ERROR);
+    
+    # extract the metadata for the files into a hash list
+    $files = parse_md_list($metadata) or
+        &my_die("Unable to parse metadata list", $add_id, $PS_EXIT_PROG_ERROR);   
+}
+
+my $chipObjectsExist = 0;
+
+# Output products
+$ipprc->outroot_prepare($outroot);
+
+# the camera configurations should define the psastro output to be a single file (MEF), regardless of the inputs
+my $fpaObjects = $ipprc->filename("PSASTRO.OUTPUT",     $camroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
+my $traceDest  = $ipprc->filename("TRACE.EXP",          $outroot) or &my_die("Missing entry from camera config", $add_id, $PS_EXIT_CONFIG_ERROR);
+
+if ($run_state eq 'update') {
+    $traceDest .= '.update';
+}
+
+# convert supplied DVO database name to UNIX filename
+my $dvodbReal;
+if (defined $dvodb) {
+    $dvodbReal = $ipprc->dvo_catdir( $dvodb ); # catdir for DVO
+    $dvodbReal = $ipprc->convert_filename_absolute( $dvodbReal );
+}
+
+my $dtime_addstar = 0;
+
+unless ($no_op) {
+    if (defined $dvodbReal and ($run_state eq 'new')) {
+	## XXX the camera analysis can either save the full set of
+	## detections, or just the image metadata, in the dvodb
+	
+	## get the addstar recipe for this camera and CAMERA reduction
+	my $command = "$ppConfigDump -camera $camera -recipe ADDSTAR $recipe_addstar -dump-recipe ADDSTAR -";
+	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+	    run(command => $command, verbose => $verbose);
+	unless ($success) {
+	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	    &my_die("Unable to perform ppConfigDump: $error_code", $add_id, $PS_EXIT_SYS_ERROR);
+	}
+	my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
+	    &my_die("Unable to parse metadata config doc", $add_id, $PS_EXIT_SYS_ERROR);
+	
+	## allow the dvodb to save only images, or the full detection set
+	my $imagesOnly = metadataLookupBool($recipeData, 'IMAGES.ONLY');
+	
+	# XXX this construct requires the user to have a valid .ptolemyrc
+	# XXX which in turn points at ippconfig/dvo.site
+	# require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default)
+	# XXX this needs to be converted to addstar_client...
+
+	my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
+	$command  = "$addstar -D CAMERA $camdir -update";
+	$command .= " -image" if $imagesOnly;
+	$command .= " -D CATDIR $dvodbReal";
+	
+	my $realFile = $ipprc->file_resolve($fpaObjects);
+	$command .= " $realFile";
+	
+	my $mjd_addstar_start = DateTime->now->mjd;   # MJD of starting script
+	
+	( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+	    run(command => $command, verbose => $verbose);
+	unless ($success) {
+	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	    &my_die("Unable to perform addstar: $error_code", $add_id, $error_code);
+	}
+	$dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start);   # MJD of starting script
+    }
+}
+
+
+# This needs to be updated when addtool is written. BROKEN
+my $fpaCommand = "$addtool -add_id $add_id";
+if ($run_state eq 'new') {
+    $fpaCommand .= " -addprocessedexp";
+    $fpaCommand .= " -path_base $outroot";
+    $fpaCommand .= " $cmdflags";
+    $fpaCommand .= " -dtime_addstar $dtime_addstar";
+} else {
+    $fpaCommand .= " -updaterun -state full";
+}
+$fpaCommand .= " -dbname $dbname" if defined $dbname;
+
+# Add the result into the database
+unless ($no_update) {
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $fpaCommand, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        warn("Unable to add result to database: $error_code\n");
+        exit($error_code);
+    }
+} else {
+    print "skipping command: $fpaCommand\n";
+}
+
+
+sub my_die
+{
+    my $msg = shift; # Warning message on die
+    my $add_id = shift; # Camtool identifier
+    my $exit_code = shift; # Exit code to add
+
+    $exit_code = $PS_EXIT_PROG_ERROR unless defined $exit_code;
+
+    carp($msg);
+    if (defined $add_id and not $no_update) {
+# This needs to be updated when addtool is written. BROKEN
+        my $command = "$addtool -add_id $add_id";
+        if ($run_state eq 'new') {
+            $command .= " -addprocessedexp";
+            $command .= " -uri UNKNOWN";
+            $command .= " -fault $exit_code";
+            $command .= " -path_base $outroot";
+            $command .= " -path_base $outroot" if defined $outroot;
+            $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
+        } else {
+            $command .= " -updateprocessedexp";
+            $command .= " -fault $exit_code";
+        }
+        $command .= " -dbname $dbname" if defined $dbname;
+        system ($command);
+    }
+    exit $exit_code;
+}
+
+
+END {
+    my $status = $?;
+    system("sync") == 0
+        or die "failed to execute sync: $!" ;
+    $? = $status;
+}
+
+__END__
Index: /branches/eam_branches/20090715/ippScripts/scripts/camera_exp.pl
===================================================================
--- /branches/eam_branches/20090715/ippScripts/scripts/camera_exp.pl	(revision 25405)
+++ /branches/eam_branches/20090715/ippScripts/scripts/camera_exp.pl	(revision 25406)
@@ -93,6 +93,6 @@
 &my_die("Unrecognised JPEG recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe2;
 
-my $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR'); # Recipe to use
-&my_die("Unrecognised ADDSTAR recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_addstar;
+#my $recipe_addstar = $ipprc->reduction($reduction, 'ADDSTAR'); # Recipe to use
+#&my_die("Unrecognised ADDSTAR recipe", $cam_id, $PS_EXIT_CONFIG_ERROR) unless defined $recipe_addstar;
 
 my $recipe_psastro = $ipprc->reduction($reduction, 'PSASTRO'); # Recipe to use
@@ -205,5 +205,5 @@
 }
 
-my $dtime_addstar = 0;
+#my $dtime_addstar = 0;
 
 unless ($no_op) {
@@ -297,47 +297,47 @@
 
         # run addstar on the output fpaObjects (if a DVO database is defined)
-        if (defined $dvodbReal and ($run_state eq 'new')) {
-
-            ## XXX the camera analysis can either save the full set of
-            ## detections, or just the image metadata, in the dvodb
-
-            ## get the addstar recipe for this camera and CAMERA reduction
-            $command = "$ppConfigDump -camera $camera -recipe ADDSTAR $recipe_addstar -dump-recipe ADDSTAR -";
-            ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-                run(command => $command, verbose => $verbose);
-            unless ($success) {
-                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-                &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_SYS_ERROR);
-            }
-            my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
-                &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_SYS_ERROR);
-
-            ## allow the dvodb to save only images, or the full detection set
-            my $imagesOnly = metadataLookupBool($recipeData, 'IMAGES.ONLY');
-
-            # XXX this construct requires the user to have a valid .ptolemyrc
-            # XXX which in turn points at ippconfig/dvo.site
-            # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default)
-            # XXX this needs to be converted to addstar_client...
-
-            my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
-            my $command;
-            $command  = "$addstar -D CAMERA $camdir -update";
-            $command .= " -image" if $imagesOnly;
-            $command .= " -D CATDIR $dvodbReal";
-
-            my $realFile = $ipprc->file_resolve($fpaObjects);
-            $command .= " $realFile";
-
-            my $mjd_addstar_start = DateTime->now->mjd;   # MJD of starting script
-
-            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-                run(command => $command, verbose => $verbose);
-            unless ($success) {
-                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
-                &my_die("Unable to perform addstar: $error_code", $cam_id, $error_code);
-            }
-            $dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start);   # MJD of starting script
-        }
+#         if (defined $dvodbReal and ($run_state eq 'new')) {
+
+#             ## XXX the camera analysis can either save the full set of
+#             ## detections, or just the image metadata, in the dvodb
+
+#             ## get the addstar recipe for this camera and CAMERA reduction
+#             $command = "$ppConfigDump -camera $camera -recipe ADDSTAR $recipe_addstar -dump-recipe ADDSTAR -";
+#             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+#                 run(command => $command, verbose => $verbose);
+#             unless ($success) {
+#                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+#                 &my_die("Unable to perform ppConfigDump: $error_code", $cam_id, $PS_EXIT_SYS_ERROR);
+#             }
+#             my $recipeData = $mdcParser->parse(join "", @$stdout_buf) or
+#                 &my_die("Unable to parse metadata config doc", $cam_id, $PS_EXIT_SYS_ERROR);
+
+#             ## allow the dvodb to save only images, or the full detection set
+#             my $imagesOnly = metadataLookupBool($recipeData, 'IMAGES.ONLY');
+
+#             # XXX this construct requires the user to have a valid .ptolemyrc
+#             # XXX which in turn points at ippconfig/dvo.site
+#             # require a defined output dvo database to run addstar (ie, refuse to use the .ptolemyrc default)
+#             # XXX this needs to be converted to addstar_client...
+
+#             my $camdir = $ipprc->dvo_cameradir(); # Camera directory for addstar
+#             my $command;
+#             $command  = "$addstar -D CAMERA $camdir -update";
+#             $command .= " -image" if $imagesOnly;
+#             $command .= " -D CATDIR $dvodbReal";
+
+#             my $realFile = $ipprc->file_resolve($fpaObjects);
+#             $command .= " $realFile";
+
+#             my $mjd_addstar_start = DateTime->now->mjd;   # MJD of starting script
+
+#             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+#                 run(command => $command, verbose => $verbose);
+#             unless ($success) {
+#                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+#                 &my_die("Unable to perform addstar: $error_code", $cam_id, $error_code);
+#             }
+#             $dtime_addstar = 86400.0*(DateTime->now->mjd - $mjd_addstar_start);   # MJD of starting script
+#         }
     }
 }
@@ -353,5 +353,5 @@
     $fpaCommand .= " -hostname $host" if defined $host;
     $fpaCommand .= " -dtime_script $dtime_script";
-    $fpaCommand .= " -dtime_addstar $dtime_addstar";
+#    $fpaCommand .= " -dtime_addstar $dtime_addstar";
 } else {
     $fpaCommand .= " -updaterun -state full";
Index: /branches/eam_branches/20090715/ippScripts/scripts/ipp_cleanup.pl
===================================================================
--- /branches/eam_branches/20090715/ippScripts/scripts/ipp_cleanup.pl	(revision 25405)
+++ /branches/eam_branches/20090715/ippScripts/scripts/ipp_cleanup.pl	(revision 25406)
@@ -60,8 +60,8 @@
 
 
-my %stages = ( chip => 1, camera => 1, fake => 1, warp => 1, stack => 1, diff  => 1,
-	       detrend.process.imfile => 1, detrend.process.exp => 1, detrend.stack.imfile => 1,
-	       detrend.normstat.imfile => 1, detrend.norm.imfile => 1, detrend.norm.exp => 1,
-	       detrend.resid.imfile => 1, detrend.resid.exp => 1 );
+my %stages = ( "chip" => 1, "camera" => 1, "fake" => 1, "warp" => 1, "stack" => 1, "diff"  => 1,
+	       "detrend.process.imfile" => 1, "detrend.process.exp" => 1, "detrend.stack.imfile" => 1,
+	       "detrend.normstat.imfile" => 1, "detrend.norm.imfile" => 1, "detrend.norm.exp" => 1,
+	       "detrend.resid.imfile" => 1, "detrend.resid.exp" => 1 );
 unless ($stages{$stage}) {
     die "unknown stage $stage for ipp_cleanup.pl\n";
@@ -119,7 +119,8 @@
         # don't clean up unless the data needed to update is available
         # modes goto_purged and goto_scrubbed will remove files even if the config is non-existent
+	# goto_scrubbed now requires the config file to not exist.
         if ($mode eq "goto_cleaned") {
             my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
-	    print STDERR "CHIP: CONFIG_FILE : $config_file\n";
+
             if (!$config_file or ! -e $config_file) {
                 print STDERR "skipping cleanup for chipRun $stage_id $class_id "
@@ -128,4 +129,13 @@
             }
         }
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
+
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping scrubbed for chipRun $stage_id $class_id "
+		    . " because config file is present\n";
+		$status = 0;
+	    }
+	}
 
         if ($status) {
@@ -144,9 +154,9 @@
                 addFilename (\@files, "PPIMAGE.OUTPUT.FPA1", $path_base, $class_id);
                 addFilename (\@files, "PPIMAGE.OUTPUT.FPA2", $path_base, $class_id);
-                addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id);
-                addFilename (\@files, "PPIMAGE.BIN2", $path_base, $class_id);
+                addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id);          # clean?
+                addFilename (\@files, "PPIMAGE.BIN2", $path_base, $class_id);          # clean?
                 addFilename (\@files, "PPIMAGE.JPEG1", $path_base, $class_id);
                 addFilename (\@files, "PPIMAGE.JPEG2", $path_base, $class_id);
-                addFilename (\@files, "PPIMAGE.STATS", $path_base, $class_id);
+                addFilename (\@files, "PPIMAGE.STATS", $path_base, $class_id);         #clean?
                 addFilename (\@files, "PPIMAGE.CONFIG", $path_base, $class_id);
             }
@@ -160,7 +170,12 @@
             if ($mode eq "goto_purged") {
                 $command .= " -topurgedimfile";
-            } else {
+            }
+	    elsif ($mode eq "goto_cleaned") {
                 $command .= " -tocleanedimfile";
             }
+	    elsif ($mode eq "goto_scrubbed") {
+		$command .= " -toscrubbedimfile";
+	    }
+
             $command .= " -dbname $dbname" if defined $dbname;
 
@@ -218,4 +233,5 @@
     my $status = 1;
     # don't clean up unless the data needed to update is available
+    # goto_scrubbed now requires the config file to not be present
     if ($mode eq "goto_cleaned") {
         my $config_file = $ipprc->filename("PSASTRO.CONFIG", $path_base);
@@ -226,8 +242,16 @@
         }
     }
+    elsif ($mode eq "goto_scrubbed") {
+	my $config_file = $ipprc->filename("PSASTRO.CONFIG", $path_base);
+
+	if ($config_file and -e $config_file) {
+	    print STDERR "skipping cleanup for camRun $stage_id because config file ($config_file) is present\n";
+	    $status = 0;
+	}
+    }
     if ($status) {
         my @files = ();
         # delete the temporary image datafiles
-        addFilename (\@files, "PSASTRO.OUTPUT", $path_base);
+#        addFilename (\@files, "PSASTRO.OUTPUT", $path_base);
         if ($mode eq "goto_purged") {
             # additional files to remove for 'purge' mode
@@ -246,5 +270,5 @@
 	}
         if ($mode eq "goto_scrubbed") {
-            $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned";
+            $command = "$camtool -updaterun -cam_id $stage_id -set_state scrubbed";
 	}
         if ($mode eq "goto_purged") {
@@ -311,4 +335,13 @@
             }
         }
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PSWARP.CONFIG", $path_base, $skycell_id);
+
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping scrubbed for warpRun $stage_id $skycell_id" .
+		    " because config file is present\n";
+		$status = 0;
+	    }
+	}
         if ($status) {
             # delete the temporary image datafiles
@@ -316,5 +349,5 @@
             addFilename(\@files, "PSWARP.OUTPUT.MASK", $path_base, $skycell_id);
             addFilename(\@files, "PSWARP.OUTPUT.VARIANCE", $path_base, $skycell_id);
-            addFilename(\@files, "PSWARP.OUTPUT.SOURCES", $path_base, $skycell_id);
+#            addFilename(\@files, "PSWARP.OUTPUT.SOURCES", $path_base, $skycell_id);
 
             if ($mode eq "goto_purged") {
@@ -337,7 +370,11 @@
             if ($mode eq "goto_purged") {
                 $command .= " -topurgedskyfile";
-            } else {
+            } 
+	    elsif ($mode eq "goto_cleaned") {
                 $command .= " -tocleanedskyfile";
             }
+	    elsif ($mode eq "goto_scrubbed") {
+		$command .= " -toscrubbedskyfile";
+	    }
             $command .= " -dbname $dbname" if defined $dbname;
 
@@ -395,6 +432,5 @@
 	if ($mode eq "goto_cleaned") {
 	    my $config_file = $ipprc->filename("PPSTACK.CONFIG", $path_base, $skycell_id);
-	    print STDERR "MY CONFIG FILE = $config_file\n";
-	    printf(STDERR "BOOLS: %d %d %d %s\n",!$config_file, ! -e $config_file, -e $config_file,$config_file);
+
 	    $config_file =~ s%^file://%%;
 	    if (!$config_file or ! -e $config_file) {
@@ -404,4 +440,13 @@
 	    }
 	    $config_file = 'file://' . $config_file;
+	}
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PPSTACK.CONFIG", $path_base, $skycell_id);
+	    $config_file =~ s%^file://%%;
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping scrubbed for stackRun $stage_id $skycell_id" .
+		    " because config file is present\n";
+		$status = 0;
+	    }
 	}
 	if ($status) {
@@ -428,6 +473,10 @@
 	    if ($mode eq "goto_purged") {
 		$command .= " -updaterun -state purged";
-	    } else {
+	    } 
+	    elsif ($mode eq "goto_cleaned") {
 		$command .= " -updaterun -state cleaned";
+	    }
+	    elsif ($mode eq "goto_scrubbed") {
+		$command .= " -updaterun -state scrubbed";
 	    }
 	    $command .= " -dbname $dbname" if defined $dbname;
@@ -485,6 +534,5 @@
 	if ($mode eq "goto_cleaned") {
 	    my $config_file = $ipprc->filename("PPSUB.CONFIG", $path_base, $skycell_id);
-	    print STDERR "MY CONFIG FILE = $config_file\n";
-	    printf(STDERR "BOOLS: %d %d %d %s\n",!$config_file, ! -e $config_file, -e $config_file,$config_file);
+
 	    $config_file =~ s%^file://%%;
 	    if (!$config_file or ! -e $config_file) {
@@ -495,4 +543,13 @@
 	    $config_file = 'file://' . $config_file;
 	}
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PPSUB.CONFIG", $path_base, $skycell_id);
+	    $config_file =~ s%^file://%%;
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping scrubbed for diffRun $stage_id $skycell_id" .
+		    " because config file ($config_file) is present\n";
+		$status = 0;
+	    }
+	}
 	if ($status) {
 	    # delete the temporary image datafiles
@@ -504,4 +561,5 @@
 	    addFilename(\@files, "PPSUB.INVERSE.MASK", $path_base, $skycell_id);
 	    addFilename(\@files, "PPSUB.INVERSE.VARIANCE", $path_base, $skycell_id);
+
 	    addFilename(\@files, "PPSUB.INPUT.CONV", $path_base, $skycell_id);
 	    addFilename(\@files, "PPSUB.INPUT.CONV.MASK", $path_base, $skycell_id);
@@ -529,10 +587,15 @@
 	if ($status) {
 	    my $command = "$difftool -diff_id $stage_id";
-#	    my $command = "$difftool -diff_id $stage_id -skycell_id $skycell_id";
+
 	    if ($mode eq "goto_purged") {
 		$command .= " -updaterun -state purged";
-	    } else {
+	    }
+	    elsif ($mode eq "goto_cleaned") {
 		$command .= " -updaterun -state cleaned";
 	    }
+	    elsif ($mode eq "goto_scrubbed") {
+		$command .= " -updaterun -state scrubbed";
+	    }
+
 	    $command .= " -dbname $dbname" if defined $dbname;
 	    
@@ -545,5 +608,5 @@
 	} else {
 	    my $command = "$difftool -updaterun -diff_id $stage_id -state $error_state";
-#	    my $command = "$difftool -updaterun -diff_id $stage_id -skycell_id $skycell_id -state $error_state";
+
 	    $command .= " -dbname $dbname" if defined $dbname;
 	    
@@ -560,7 +623,1208 @@
 }
 if ($stage eq 'fake') {
-    die "ipp_cleanup.pl -stage fake not yet implemented. Probably will just mark database cleaned.\n";
+    print STDERR "This does not seem to work at present, as no files exist. Terminating quietly.\n";
+    exit(0);
+    die "--stage_id required for stage fake\n" if !$stage_id;
+    ### select the imfiles for this entry
+
+    # this stage uses 'chiptool'
+    my $faketool = can_run('faketool') or die "Can't find faketool";
+
+    # Get list of component imfiles
+    # XXX may need a different my_die for each stage
+    my $imfiles;                      # Array of component files
+    my $command = "$faketool -pendingcleanupimfile -fake_id $stage_id"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform faketool: $error_code", "fake", $stage_id, $error_code);
+    }
+
+    # if there are no fakeProcessedImfiles (@$stdout_buf == 0), the reset the state to 'new'
+    if (@$stdout_buf == 0)  {
+	my $command = "$faketool -fake_id $stage_id -updaterun -set_state new";
+	$command .= " -dbname $dbname" if defined $dbname;
+
+	my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+	    run(command => $command, verbose => $verbose);
+	unless ($success) {
+	    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	    &my_die("Unable to perform faketool: $error_code", "fake", $stage_id, $error_code);
+	}
+	exit 0;
+    }
+
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config doc", "fake", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    # extract the metadata for the files into a hash list
+    $imfiles = parse_md_list($metadata) or
+        &my_die("Unable to parse metadata list", "fake", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    # loop over all of the imfiles, determine the path_base and class_id for each
+    foreach my $imfile (@$imfiles) {
+        my $class_id = $imfile->{class_id};
+        my $path_base = $imfile->{path_base};
+        my $status = 1;
+
+        # don't clean up unless the data needed to update is available
+        # modes goto_purged and goto_scrubbed will remove files even if the config is non-existent
+	# goto_scrubbed now requires the config file to not exist.
+        if ($mode eq "goto_cleaned") {
+            my $config_file = $ipprc->filename("PPSIM.CONFIG", $path_base, $class_id);
+
+            if (!$config_file or ! -e $config_file) {
+                print STDERR "skipping cleanup for fakeRun $stage_id $class_id "
+                    . " because config file is missing\n";
+                $status = 0;
+            }
+        }
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PPSIM.CONFIG", $path_base, $class_id);
+
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping scrubbed for fakeRun $stage_id $class_id "
+		    . " because config file is present\n";
+		$status = 0;
+	    }
+	}
+
+        if ($status) {
+            # array of actual filenames to delete
+            my @files = ();
+
+            # delete the temporary image datafiles
+            addFilename (\@files, "PPSIM.OUTPUT.MEF", $path_base, $class_id);
+            addFilename (\@files, "PPSIM.OUTPUT.SPL", $path_base, $class_id);
+            addFilename (\@files, "PPSIM.FAKE.CHIP", $path_base, $class_id);
+            addFilename (\@files, "PPSIM.FORCE.CHIP", $path_base, $class_id);
+            if ($mode eq "goto_purged") {
+                # additional files to remove for 'purge' mode
+		addFilename (\@files, "PPSIM.SOURCES", $path_base, $class_id);
+		addFilename (\@files, "PPSIM.FAKE.SOURCES", $path_base, $class_id);
+		addFilename (\@files, "PPSIM.FORCE.SOURCES", $path_base, $class_id);
+            }
+
+            # actual command to delete the files
+            $status = &delete_files (\@files);
+        }
+
+        if ($status)  {
+            my $command = "$faketool -fake_id $stage_id -class_id $class_id";
+            if ($mode eq "goto_purged") {
+                $command .= " -topurgedimfile";
+            }
+	    elsif ($mode eq "goto_cleaned") {
+                $command .= " -tocleanedimfile";
+            }
+	    elsif ($mode eq "goto_scrubbed") {
+		$command .= " -toscrubbedimfile";
+	    }
+
+            $command .= " -dbname $dbname" if defined $dbname;
+
+            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+                    run(command => $command, verbose => $verbose);
+            unless ($success) {
+                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+                &my_die("Unable to perform faketool: $error_code", "fake", $stage_id, $error_code);
+            }
+        } else {
+
+	    # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will go to error_* (matching the goto_*)
+	    my $command = "$faketool -updateprocessedimfile -fake_id $stage_id -class_id $class_id -set_state $error_state";
+	    $command .= " -dbname $dbname" if defined $dbname;
+
+            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+                    run(command => $command, verbose => $verbose);
+            unless ($success) {
+                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+                &my_die("Unable to perform faketool: $error_code", "fake", $stage_id, $error_code);
+            }
+        }
+    }
+    exit 0;
+
 } 
-# fake : faketool : -pendingcleanupimfile (loop over imfiles)
+# Detrend stages
+if ($stage eq "detrend.process.imfile") {
+
+    die "--stage_id required for stage detrend.process.imfile\n" if !$stage_id;
+    ### select the imfiles for this entry
+
+    # this stage uses 'dettool'
+    my $dettool = can_run('dettool') or die "Can't find chiptool";
+
+    # Get list of component imfiles
+    # XXX may need a different my_die for each stage
+    my $imfiles;                      # Array of component files
+    my $command = "$dettool -pendingcleanup_processedimfile -det_id $stage_id"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform dettool: $error_code", "detrend.process.imfile", $stage_id, $error_code);
+    }
+
+    # if there are no detProcessedImfiles (@$stdout_buf == 0), the reset the state to 'new'
+    if (@$stdout_buf == 0)  {
+	exit 0; # Silently exit if there's nothing to do.  I don't know how we'd ever get here, but let's be safe.
+    }
+
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    # extract the metadata for the files into a hash list
+    $imfiles = parse_md_list($metadata) or
+        &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    # loop over all of the imfiles, determine the path_base and class_id for each
+    foreach my $imfile (@$imfiles) {
+	my $exp_id   = $imfile->{exp_id};
+        my $class_id = $imfile->{class_id};
+        my $path_base = $imfile->{path_base};
+        my $status = 1;
+
+        # don't clean up unless the data needed to update is available
+        # modes goto_purged and goto_scrubbed will remove files even if the config is non-existent
+	# goto_scrubbed now requires the config file to not exist.
+	
+	# Possibly not the correct config file, but simtest doesn't leave any around to check.
+        if ($mode eq "goto_cleaned") {
+            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
+
+            if (!$config_file or ! -e $config_file) {
+                print STDERR "skipping cleanup for detrend.process.imfile $stage_id $class_id "
+                    . " because config file is missing\n";
+                $status = 0;
+            }
+        }
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
+
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping scrubbed for detrend.process.imfile $stage_id $class_id "
+		    . " because config file is present\n";
+		$status = 0;
+	    }
+	}
+
+        if ($status) {
+            # array of actual filenames to delete
+            my @files = ();
+
+            # delete the temporary image datafiles
+            addFilename (\@files, "PPIMAGE.OUTPUT", $path_base, $class_id);
+            addFilename (\@files, "PPIMAGE.OUTPUT.MASK", $path_base, $class_id);
+            addFilename (\@files, "PPIMAGE.OUTPUT.VARIANCE", $path_base, $class_id);
+            if ($mode eq "goto_purged") {
+                # additional files to remove for 'purge' mode
+		addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id);
+		addFilename (\@files, "PPIMAGE.BIN2", $path_base, $class_id);
+                addFilename (\@files, "PPIMAGE.STATS", $path_base, $class_id);
+            }
+
+            # actual command to delete the files
+            $status = &delete_files (\@files);
+        }
+
+        if ($status)  {
+            my $command = "$dettool -det_id $stage_id -exp_id $exp_id -class_id $class_id -updateprocessedimfile";
+            if ($mode eq "goto_purged") {
+                $command .= " -data_state purged";
+            }
+	    elsif ($mode eq "goto_cleaned") {
+                $command .= " -data_state cleaned";
+            }
+	    elsif ($mode eq "goto_scrubbed") {
+		$command .= " -data_state scrubbed";
+	    }
+
+            $command .= " -dbname $dbname" if defined $dbname;
+
+            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+                    run(command => $command, verbose => $verbose);
+            unless ($success) {
+                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+                &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+            }
+
+        } else {
+
+	    # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will go to error_* (matching the goto_*)
+	    my $command = "$dettool -updateprocessedimfile -det_id $stage_id -exp_id $exp_id -class_id $class_id -data_state $error_state";
+	    $command .= " -dbname $dbname" if defined $dbname;
+
+            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+                    run(command => $command, verbose => $verbose);
+            unless ($success) {
+                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+                &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+            }
+        }
+    }
+
+    # Check to see if we can mark the whole detRunSummary object as cleaned.
+
+    $command = "$dettool -pendingcleanup_detrunsummary -det_id $stage_id"; 
+    $command .= " -dbname $dbname" if defined $dbname;
+    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+    }
+    if (@$stdout_buf != 0) {
+	$metadata = $mdcParser->parse(join "", @$stdout_buf) or
+	    &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	my $exps = parse_md_list($metadata) or
+	    &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	
+	foreach my $exp (@$exps) {
+	    my $iteration = $exp->{iteration};
+	    my $command;
+	    if ($mode eq "goto_cleaned") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+	    }
+	}
+    }
+    
+    exit 0;
+}
+if ($stage eq "detrend.process.exp") {
+    die "--stage_id required for stage $stage\n" if !$stage_id;
+    # this stage uses 'dettool'
+    my $dettool = can_run('dettool') or die "Can't find dettool";
+
+    # Get list of component imfiles
+    # XXX may need a different my_die for each stage
+    my $exps;                      # Array of component files
+    my $command = "$dettool -pendingcleanup_processedexp -det_id $stage_id"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+    }
+    
+    if (@$stdout_buf == 0) {
+	exit 0; #silently abort. I need to fix this for propers
+    }
+
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    $exps = parse_md_list($metadata) or
+        &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+
+    foreach my $exp (@$exps) {
+	my $path_base = $exp->{path_base};
+	my $exp_id    = $exp->{exp_id};
+
+	my $status = 1;
+	# don't clean up unless the data needed to update is available
+	# goto_scrubbed now requires the config file to not be present
+	if ($mode eq "goto_cleaned") {
+	    my $config_file = $ipprc->filename("PSIMAGE.CONFIG", $path_base);
+	    
+	    if (!$config_file or ! -e $config_file) {
+		print STDERR "skipping cleanup for $stage $stage_id because config file is missing\n";
+		$status = 0;
+	    }
+	}
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PSIMAGE.CONFIG", $path_base);
+	    
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping cleanup for $stage $stage_id because config file ($config_file) is present\n";
+		$status = 0;
+	    }
+	}
+	if ($status) {
+	    my @files = ();
+	    # delete the temporary image datafiles
+	    # I can't find anything to put here
+	    if ($mode eq "goto_purged") {
+		# additional files to remove for 'purge' mode
+		addFilename (\@files, "PPIMAGE.JPEG1", $path_base);
+		addFilename (\@files, "PPIMAGE.JPEG2", $path_base);
+	    }
+	    # actual command to delete the files
+	    $status = &delete_files (\@files);
+	}
+	
+	if ($status)  {
+	    my $command;
+	    if ($mode eq "goto_cleaned") {
+		$command = "$dettool -updateprocessedexp -det_id $stage_id -exp_id $exp_id -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command = "$dettool -updateprocessedexp -det_id $stage_id -exp_id $exp_id -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command = "$dettool -updateprocessedexp -det_id $stage_id -exp_id $exp_id -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	} else {
+	    # since 'camera' has only a single imfile, we can just update the run
+	    my $command = "$dettool -updateprocessedexp -det_id $stage_id -exp_id $exp_id -data_state $error_state";
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	    exit $PS_EXIT_UNKNOWN_ERROR;
+	}
+    }
+    # Check to see if we can mark the whole detRunSummary object as cleaned.
+
+    $command = "$dettool -pendingcleanup_detrunsummary -det_id $stage_id"; 
+    $command .= " -dbname $dbname" if defined $dbname;
+    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+    }
+    if (@$stdout_buf != 0) {
+	$metadata = $mdcParser->parse(join "", @$stdout_buf) or
+	    &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	$exps = parse_md_list($metadata) or
+	    &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	
+	foreach my $exp (@$exps) {
+	    my $iteration = $exp->{iteration};
+	    my $command;
+	    if ($mode eq "goto_cleaned") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+	    }
+	}
+    }
+
+    exit 0;
+}
+if ($stage eq "detrend.stack.imfile") {
+    
+    die "--stage_id required for stage $stage\n" if !$stage_id;
+
+    # this stage uses 'dettool'
+    my $dettool = can_run('dettool') or die "Can't find dettool";
+
+    # Get list of component imfiles
+    my $stacks;                  # Array reference of component files
+    my $command = "$dettool -pendingcleanup_stacked -det_id $stage_id"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+    }
+    my $metadata = $mdcParser->parse(join "", @{ $stdout_buf }) or 
+	&my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    $stacks = parse_md_list($metadata) or 
+	&my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+    
+    my @files = ();
+    foreach my $stack (@{ $stacks }) {
+	# detStackedImfile does not have a path_base column.  This is inconvenient, as it means we need to calculate it.
+	my $path_base = $stack->{uri};
+	my $iteration = $stack->{iteration};
+	my $class_id  = $stack->{class_id};
+
+	$path_base =~ s/\.fits$//; # That should do it?
+
+	my $status = 1;
+
+# 	if ($mode eq "goto_cleaned") {
+# 	    my $config_file = $ipprc->filename("PPMERGE.CONFIG", $path_base, $stage_id);
+
+# 	    $config_file =~ s%^file://%%;
+# 	    if (!$config_file or ! -e $config_file) {
+# 		print STDERR "skipping cleanup for $stage $stage_id $path_base" .
+# 		    " because config file is missing\n";
+# 		$status = 0;
+# 	    }
+# 	    $config_file = 'file://' . $config_file;
+# 	}
+# 	elsif ($mode eq "goto_scrubbed") {
+# 	    my $config_file = $ipprc->filename("PPMERGE.CONFIG", $path_base, $stage_id);
+# 	    $config_file =~ s%^file://%%;
+# 	    if ($config_file and -e $config_file) {
+# 		print STDERR "skipping scrubbed for $stage $stage_id $path_base" .
+# 		    " because config file is present\n";
+# 		$status = 0;
+# 	    }
+# 	}
+
+	if ($status) {
+	    # delete the temporary image datafiles
+	    # There's no convenient way to get the detrend type, so I'm queueing all of them for deletion.
+	    # I understand that they all point to the same filename right now, but that may not be true in
+	    # the future.
+	    addFilename(\@files, "PPMERGE.OUTPUT.MASK", $path_base, $stage_id);
+	    addFilename(\@files, "PPMERGE.OUTPUT.BIAS", $path_base, $stage_id);
+	    addFilename(\@files, "PPMERGE.OUTPUT.DARK", $path_base, $stage_id);
+	    addFilename(\@files, "PPMERGE.OUTPUT.SHUTTER", $path_base, $stage_id);
+	    addFilename(\@files, "PPMERGE.OUTPUT.FLAT", $path_base, $stage_id);
+	    addFilename(\@files, "PPMERGE.OUTPUT.FRINGE", $path_base, $stage_id);
+	    
+
+	    addFilename(\@files, "PPMERGE.OUTPUT.SIGMA", $path_base, $stage_id);
+	    addFilename(\@files, "PPMERGE.OUTPUT.COUNT", $path_base, $stage_id);
+
+	    if ($mode eq "goto_purged") {
+		# additional files to remove for 'purge' mode
+#		addFilename(\@files, "PPMERGE.OUTPUT", $path_base, $stage_id);
+	    }
+
+	    $status = &delete_files(\@files);
+	}
+
+	if ($status) {
+	    my $command = "$dettool -det_id $stage_id -iteration $iteration -class_id $class_id";
+	    if ($mode eq "goto_purged") {
+		$command .= " -updatestacked -data_state purged";
+	    } 
+	    elsif ($mode eq "goto_cleaned") {
+		$command .= " -updatestacked -data_state cleaned";
+	    }
+	    elsif ($mode eq "goto_scrubbed") {
+		$command .= " -updatestacked -data_state scrubbed";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	} else {
+	    my $command = "$dettool -updatestacked  -det_id $stage_id -iteration $iteration -class_id $class_id -data_state $error_state";
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	    exit $PS_EXIT_UNKNOWN_ERROR;
+	}
+    }
+    # Check to see if we can mark the whole detRunSummary object as cleaned.
+
+    $command = "$dettool -pendingcleanup_detrunsummary -det_id $stage_id"; 
+    $command .= " -dbname $dbname" if defined $dbname;
+    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+    }
+    if (@$stdout_buf != 0) {
+	$metadata = $mdcParser->parse(join "", @$stdout_buf) or
+	    &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	my $exps = parse_md_list($metadata) or
+	    &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	
+	foreach my $exp (@$exps) {
+	    my $iteration = $exp->{iteration};
+	    my $command;
+	    if ($mode eq "goto_cleaned") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+	    }
+	}
+    }
+    exit 0;
+}
+if ($stage eq "detrend.normstat.imfile") {
+    print STDERR "I'm not convinced there's anything to clean up from stage $stage\n";
+    die "--stage_id required for stage $stage\n" if !$stage_id;
+    # this stage uses 'camtool'
+    my $dettool = can_run('dettool') or die "Can't find dettool";
+
+    my $command = "$dettool -pendingcleanup_normalizedstat -det_id $stage_id"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+    }
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    my $exps = parse_md_list($metadata) or
+        &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    foreach my $exp (@$exps) {
+#	my $path_base = $exp->{path_base};
+	my $iteration = $exp->{iteration};
+	my $class_id  = $exp->{class_id};
+
+	my $status = 1;
+	if ($status)  {
+	    my $command = "$dettool -updatenormalizedstat -det_id $stage_id -iteration $iteration -class_id $class_id";
+	    if ($mode eq "goto_cleaned") {
+		$command .= " -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command .= " -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command .= " -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		print STDERR "WTF: $success TTT $error_code QQQ\n";
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	} else {
+	    my $command = "$dettool -updatenormalizedstat -det_id $stage_id -iteration $iteration -class_id $class_id -data_state $error_state";
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	    exit $PS_EXIT_UNKNOWN_ERROR;
+	}
+    }
+    # Check to see if we can mark the whole detRunSummary object as cleaned.
+
+    $command = "$dettool -pendingcleanup_detrunsummary -det_id $stage_id"; 
+    $command .= " -dbname $dbname" if defined $dbname;
+    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+    }
+    if (@$stdout_buf != 0) {
+	$metadata = $mdcParser->parse(join "", @$stdout_buf) or
+	    &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	$exps = parse_md_list($metadata) or
+	    &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	
+	foreach my $exp (@$exps) {
+	    my $iteration = $exp->{iteration};
+	    my $command;
+	    if ($mode eq "goto_cleaned") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+	    }
+	}
+    }
+
+    exit 0;
+
+}
+if ($stage eq "detrend.norm.imfile") {
+    die "--stage_id required for stage $stage\n" if !$stage_id;
+    # this stage uses 'dettool'
+    my $dettool = can_run('dettool') or die "Can't find dettool";
+
+    # Get list of component imfiles
+    # XXX may need a different my_die for each stage
+    my $exps;                      # Array of component files
+    my $command = "$dettool -pendingcleanup_normalizedimfile -det_id $stage_id"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+    }
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    $exps = parse_md_list($metadata) or
+        &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    foreach my $exp (@$exps) {
+	my $path_base = $exp->{path_base};
+	my $iteration = $exp->{iteration};
+	my $class_id  = $exp->{class_id};
+
+	my $status = 1;
+	# don't clean up unless the data needed to update is available
+	# goto_scrubbed now requires the config file to not be present
+	if ($mode eq "goto_cleaned") {
+	    my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
+	    
+	    if (!$config_file or ! -e $config_file) {
+		print STDERR "skipping cleanup for $stage $stage_id because config file is missing\n";
+		$status = 0;
+	    }
+	}
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
+	    
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping cleanup for $stage $stage_id because config file ($config_file) is present\n";
+		$status = 0;
+	    }
+	}
+	if ($status) {
+	    my @files = ();
+
+	    if ($mode eq "goto_purged") {
+		# additional files to remove for 'purge' mode
+		addFilename (\@files, "PPIMAGE.OUTPUT.FPA1", $path_base);
+		addFilename (\@files, "PPIMAGE.OUTPUT.FPA2", $path_base);
+
+		addFilename (\@files, "PPIMAGE.OUTPUT", $path_base);
+		addFilename (\@files, "PPIMAGE.STATS", $path_base);
+	    }
+	    # actual command to delete the files
+	    $status = &delete_files (\@files);
+	}
+	
+	if ($status)  {
+	    my $command = "$dettool -updatenormalizedimfile -det_id $stage_id -iteration $iteration -class_id $class_id";
+	    if ($mode eq "goto_cleaned") {
+		$command .= " -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command .= " -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command .= " -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	} else {
+	    my $command = "$dettool -updatenormalizedimfile -det_id $stage_id -iteration $iteration -class_id $class_id -data_state $error_state";
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	    exit $PS_EXIT_UNKNOWN_ERROR;
+	}
+    }
+    # Check to see if we can mark the whole detRunSummary object as cleaned.
+
+    $command = "$dettool -pendingcleanup_detrunsummary -det_id $stage_id"; 
+    $command .= " -dbname $dbname" if defined $dbname;
+    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+    }
+    if (@$stdout_buf != 0) {
+	$metadata = $mdcParser->parse(join "", @$stdout_buf) or
+	    &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	$exps = parse_md_list($metadata) or
+	    &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	
+	foreach my $exp (@$exps) {
+	    my $iteration = $exp->{iteration};
+	    my $command;
+	    if ($mode eq "goto_cleaned") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+	    }
+	}
+    }
+
+    exit 0;
+}
+if ($stage eq "detrend.norm.exp") {
+    die "--stage_id required for stage $stage\n" if !$stage_id;
+    # this stage uses 'dettool'
+    my $dettool = can_run('dettool') or die "Can't find dettool";
+
+    # Get list of component imfiles
+    # XXX may need a different my_die for each stage
+    my $exps;                      # Array of component files
+    my $command = "$dettool -pendingcleanup_normalizedexp -det_id $stage_id"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+    }
+
+    if (@$stdout_buf == 0) {
+	exit 0;
+    }
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    $exps = parse_md_list($metadata) or
+        &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    foreach my $exp (@$exps) {
+	my $exp_id = $exp->{exp_id};
+	my $iteration = $exp->{iteration};
+	my $path_base = $exp->{path_base};
+
+	my $status = 1;
+	# don't clean up unless the data needed to update is available
+	# goto_scrubbed now requires the config file to not be present
+	if ($mode eq "goto_cleaned") {
+	    my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
+	    
+	    if (!$config_file or ! -e $config_file) {
+		print STDERR "skipping cleanup for $stage $stage_id because config file is missing\n";
+		$status = 0;
+	    }
+	}
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
+	    
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping cleanup for $stage $stage_id because config file ($config_file) is present\n";
+		$status = 0;
+	    }
+	}
+	if ($status) {
+	    my @files = ();
+	    # delete the temporary image datafiles
+	    if ($mode eq "goto_purged") {
+		# additional files to remove for 'purge' mode
+		addFilename (\@files, "PPIMAGE.JPEG1", $path_base);
+		addFilename (\@files, "PPIMAGE.JPEG2", $path_base);
+	    }
+	    # actual command to delete the files
+	    $status = &delete_files (\@files);
+	}
+	
+	if ($status)  {
+	    my $command = "$dettool -updatenormalizedexp -det_id $stage_id -iteration $iteration";
+	    if ($mode eq "goto_cleaned") {
+		$command .= " -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command .= " -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command .= " -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		print STDERR " residexp had an issue setting the state:? $success $error_code\n";
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	} else {
+	    my $command = "$dettool -updatenormalizedexp -det_id $stage_id -exp_id $exp_id -iteration $iteration -data_state $error_state";
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	    exit $PS_EXIT_UNKNOWN_ERROR;
+	}
+    }
+    # Check to see if we can mark the whole detRunSummary object as cleaned.
+
+    $command = "$dettool -pendingcleanup_detrunsummary -det_id $stage_id"; 
+    $command .= " -dbname $dbname" if defined $dbname;
+    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+    }
+    if (@$stdout_buf != 0) {
+	$metadata = $mdcParser->parse(join "", @$stdout_buf) or
+	    &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	$exps = parse_md_list($metadata) or
+	    &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	
+	foreach my $exp (@$exps) {
+	    my $iteration = $exp->{iteration};
+	    my $command;
+	    if ($mode eq "goto_cleaned") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+	    }
+	}
+    }
+    exit 0;
+}
+if ($stage eq "detrend.resid.imfile") {
+
+    die "--stage_id required for stage $stage\n" if !$stage_id;
+    ### select the imfiles for this entry
+
+    # this stage uses 'dettool'
+    my $dettool = can_run('dettool') or die "Can't find dettool";
+
+    # Get list of component imfiles
+    # XXX may need a different my_die for each stage
+    my $imfiles;                      # Array of component files
+    my $command = "$dettool -pendingcleanup_residimfile -det_id $stage_id"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform dettool: $error_code", "detrend.process.imfile", $stage_id, $error_code);
+    }
+
+    if (@$stdout_buf == 0) {
+	exit 0;
+    }
+
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    # extract the metadata for the files into a hash list
+    $imfiles = parse_md_list($metadata) or
+        &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    # loop over all of the imfiles, determine the path_base and class_id for each
+    foreach my $imfile (@$imfiles) {
+        my $class_id = $imfile->{class_id};
+	my $iteration = $imfile->{iteration};
+	my $exp_id = $imfile->{exp_id};
+        my $path_base = $imfile->{path_base};
+        my $status = 1;
+
+        # don't clean up unless the data needed to update is available
+        # modes goto_purged and goto_scrubbed will remove files even if the config is non-existent
+	# goto_scrubbed now requires the config file to not exist.
+	
+	# Possibly not the correct config file, but simtest doesn't leave any around to check.
+        if ($mode eq "goto_cleaned") {
+            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
+
+            if (!$config_file or ! -e $config_file) {
+                print STDERR "skipping cleanup for $stage $stage_id $class_id "
+                    . " because config file is missing\n";
+                $status = 0;
+            }
+        }
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base, $class_id);
+
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping scrubbed for $stage $stage_id $class_id "
+		    . " because config file is present\n";
+		$status = 0;
+	    }
+	}
+
+        if ($status) {
+            # array of actual filenames to delete
+            my @files = ();
+
+            # delete the temporary image datafiles
+            addFilename (\@files, "PPIMAGE.OUTPUT", $path_base, $class_id);
+            if ($mode eq "goto_purged") {
+                # additional files to remove for 'purge' mode
+		addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id);
+		addFilename (\@files, "PPIMAGE.BIN2", $path_base, $class_id);
+                addFilename (\@files, "PPIMAGE.STATS", $path_base, $class_id);
+            }
+
+            # actual command to delete the files
+            $status = &delete_files (\@files);
+        }
+
+        if ($status)  {
+            my $command = "$dettool -updateresidimfile -det_id $stage_id -exp_id $exp_id -iteration $iteration -class_id $class_id";
+            if ($mode eq "goto_purged") {
+                $command .= " -data_state purged";
+            }
+	    elsif ($mode eq "goto_cleaned") {
+                $command .= " -data_state cleaned";
+            }
+	    elsif ($mode eq "goto_scrubbed") {
+		$command .= " -data_state scrubbed";
+	    }
+
+            $command .= " -dbname $dbname" if defined $dbname;
+
+            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+                    run(command => $command, verbose => $verbose);
+            unless ($success) {
+                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+                &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+            }
+        } else {
+	    my $command = "$dettool -updateresidimfile -det_id $stage_id -exp_id $exp_id -iteration $iteration -class_id $class_id -data_state $error_state";
+	    $command .= " -dbname $dbname" if defined $dbname;
+
+            my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+                    run(command => $command, verbose => $verbose);
+            unless ($success) {
+                $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+                &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+            }
+        }
+    }
+    # Check to see if we can mark the whole detRunSummary object as cleaned.
+
+    $command = "$dettool -pendingcleanup_detrunsummary -det_id $stage_id"; 
+    $command .= " -dbname $dbname" if defined $dbname;
+    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+    }
+    if (@$stdout_buf != 0) {
+	$metadata = $mdcParser->parse(join "", @$stdout_buf) or
+	    &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	my $exps = parse_md_list($metadata) or
+	    &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	
+	foreach my $exp (@$exps) {
+	    my $iteration = $exp->{iteration};
+	    my $command;
+	    if ($mode eq "goto_cleaned") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+	    }
+	}
+    }
+
+    exit 0;
+}
+if ($stage eq "detrend.resid.exp") {
+    die "--stage_id required for stage $stage\n" if !$stage_id;
+    # this stage uses 'camtool'
+    my $dettool = can_run('dettool') or die "Can't find dettool";
+
+    # Get list of component imfiles
+    # XXX may need a different my_die for each stage
+    my $exps;                      # Array of component files
+    my $command = "$dettool -pendingcleanup_residexp -det_id $stage_id"; # Command to run
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+    }
+    # This is a hack to bomb out until I can diagnose why pantasks wants to keep running this
+    if (@$stdout_buf == 0) {
+	exit 0;
+    }
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config doc", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    $exps = parse_md_list($metadata) or
+        &my_die("Unable to parse metadata list", "$stage", $stage_id, $PS_EXIT_PROG_ERROR);
+
+    foreach my $exp (@$exps) {
+	my $exp_id = $exp->{exp_id};
+	my $iteration = $exp->{iteration};
+	my $path_base = $exp->{path_base};
+#	my $class_id  = $exp->{class_id} 
+	my $status = 1;
+	# don't clean up unless the data needed to update is available
+	# goto_scrubbed now requires the config file to not be present
+	if ($mode eq "goto_cleaned") {
+	    my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
+	    
+	    if (!$config_file or ! -e $config_file) {
+		print STDERR "skipping cleanup for $stage $stage_id because config file is missing\n";
+		$status = 0;
+	    }
+	}
+	elsif ($mode eq "goto_scrubbed") {
+	    my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
+	    
+	    if ($config_file and -e $config_file) {
+		print STDERR "skipping cleanup for $stage $stage_id because config file ($config_file) is present\n";
+		$status = 0;
+	    }
+	}
+	if ($status) {
+	    my @files = ();
+	    # delete the temporary image datafiles
+	    if ($mode eq "goto_purged") {
+		# additional files to remove for 'purge' mode
+                addFilename (\@files, "PPIMAGE.JPEG1", $path_base);#, $class_id);
+                addFilename (\@files, "PPIMAGE.JPEG2", $path_base);#, $class_id);
+	    }
+	    # actual command to delete the files
+	    $status = &delete_files (\@files);
+	}
+	
+	if ($status)  {
+	    my $command = "$dettool -updateresidexp -det_id $stage_id -exp_id $exp_id -iteration $iteration";
+	    if ($mode eq "goto_cleaned") {
+		$command .= " -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command .= " -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command .= " -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		print STDERR " residexp had an issue setting the state:? $success $error_code\n";
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	} else {
+	    my $command = "$dettool -updateresidexp -det_id $stage_id -exp_id $exp_id -iteration $iteration -data_state $error_state";
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
+	    }
+	    exit $PS_EXIT_UNKNOWN_ERROR;
+	}
+    }
+    # Check to see if we can mark the whole detRunSummary object as cleaned.
+
+    $command = "$dettool -pendingcleanup_detrunsummary -det_id $stage_id"; 
+    $command .= " -dbname $dbname" if defined $dbname;
+    ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = run(command => $command, verbose => $verbose);
+    unless ($success) {
+	$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+	&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+    }
+    if (@$stdout_buf != 0) {
+	$metadata = $mdcParser->parse(join "", @$stdout_buf) or
+	    &my_die("Unable to parse metadata config doc", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	$exps = parse_md_list($metadata) or
+	    &my_die("Unable to parse metadata list", "$stage (detRunSummary)", $stage_id, $PS_EXIT_PROG_ERROR);
+	
+	foreach my $exp (@$exps) {
+	    my $iteration = $exp->{iteration};
+	    my $command;
+	    if ($mode eq "goto_cleaned") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state cleaned";
+	    }
+	    if ($mode eq "goto_scrubbed") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state scrubbed";
+	    }
+	    if ($mode eq "goto_purged") {
+		$command = "$dettool -updatedetrunsummary -det_id $stage_id -iteration $iteration -data_state purged";
+	    }
+	    $command .= " -dbname $dbname" if defined $dbname;
+	    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+		run(command => $command, verbose => $verbose);
+	    unless ($success) {
+		$error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+		&my_die("Unable to perform dettool: $error_code", "$stage (detRunSummary)", $stage_id, $error_code);
+	    }
+	}
+    }
+    exit 0;
+}
+
 
 die "ipp_cleanup.pl -stage $stage not yet implemented\n";
@@ -570,9 +1834,26 @@
     my $files = shift; # reference to a list of files to unlink
 
+#     open(TMPLOG,">>/tmp/czw.cleanup.log");
+#     flock(TMPLOG,2);
+
     # this script is, of course, very dangerous.
     foreach my $file (@$files) {
         print STDERR "unlinking $file\n";
+# 	print TMPLOG "$stage $stage_id $file";
+# 	my $ff = $file;
+# 	$ff =~ s%^file://%%;
+# 	unless (-e $ff) {
+# 	    print TMPLOG "\t File not found\n";
+# 	}
+# 	else {
+# 	    print TMPLOG "\n";
+# 	}
+
         $ipprc->file_delete($file);
     }
+
+#     flock(TMPLOG,8);
+#     close(TMPLOG);
+
     return 1;
 }
Index: /branches/eam_branches/20090715/ippScripts/scripts/ipp_image_path.pl
===================================================================
--- /branches/eam_branches/20090715/ippScripts/scripts/ipp_image_path.pl	(revision 25405)
+++ /branches/eam_branches/20090715/ippScripts/scripts/ipp_image_path.pl	(revision 25406)
@@ -108,7 +108,7 @@
             # remove the leading "file://" if present
             $path =~ s/^file\:\/\///;
+            $nfiles++;
+            print "$path\n";
         }
-        $nfiles++;
-        print "$path\n";
     }
     if (!$nfiles) {
Index: /branches/eam_branches/20090715/ippScripts/scripts/magic_destreak.pl
===================================================================
--- /branches/eam_branches/20090715/ippScripts/scripts/magic_destreak.pl	(revision 25405)
+++ /branches/eam_branches/20090715/ippScripts/scripts/magic_destreak.pl	(revision 25406)
@@ -207,4 +207,8 @@
     my ($image, $mask, $ch_mask, $weight, $astrom, $sources);
 
+    # if we're destreaking a bothways diff need to combine the
+    # two streaks files
+    my ($allstreaks_fh, $allstreaks_name);
+
     if ($stage eq "raw") {
         $image = $uri;
@@ -239,4 +243,16 @@
         $weight = $ipprc->filename("PPSUB.OUTPUT.VARIANCE", $path_base);
         $sources    = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $path_base);
+
+        if ($inv_streaks) {
+            # create a temporary file containing the contents of the 
+            # two streaks files
+            ($allstreaks_fh, $allstreaks_name) = tempfile ("/tmp/all.streaks.XXXX",
+                    UNLINK => !$save_temps);
+
+            combine_streaks($allstreaks_fh, $streaks, $inv_streaks);
+
+            # apply the combined streaks to both the forward and inverse diffs
+            $streaks = $allstreaks_name;
+        }
     }
 
@@ -272,5 +288,5 @@
         $sources = $ipprc->filename("PPSUB.INVERSE.SOURCES", $path_base);
 
-        my $command = "$streaksremove -stage $stage -tmproot $tmproot -streaks $inv_streaks -image $image";
+        my $command = "$streaksremove -stage $stage -tmproot $tmproot -streaks $streaks -image $image";
 
         $command .= " -recovery $recoveryroot" if defined $recoveryroot;
@@ -402,4 +418,52 @@
 }
 
+sub combine_streaks
+{
+    my $fout = shift;
+    my $fn1 = shift;
+    my $fn2 = shift;
+
+    my ($n1, @streaks1) = read_streaks_file($fn1);
+    my_die("failed to read streaks from $fn1", $magic_ds_id, $component,
+        $PS_EXIT_UNKNOWN_ERROR) if $n1 < 0;
+
+    my ($n2, @streaks2) = read_streaks_file($fn2);
+    my_die("failed to read streaks from $fn2", $magic_ds_id, $component,
+        $PS_EXIT_UNKNOWN_ERROR) if $n2 < 0;
+
+    print $fout $n1 + $n2 . "\n";
+
+    foreach my $line (@streaks1, @streaks2) {
+        print $fout $line;
+    }
+
+    close $fout 
+        or my_die("failed to close combined streaks file", $magic_ds_id,
+                     $component, $PS_EXIT_UNKNOWN_ERROR);
+}
+
+sub read_streaks_file
+{
+    my $filename = shift;
+    my $fh;
+    open $fh, "<$filename" or my_die("failed to open $filename",
+                    $magic_ds_id, $component, $PS_EXIT_UNKNOWN_ERROR);
+
+    # first line is the number of streaks
+    my $line = <$fh>;
+    chomp $line;
+    my $nstreaks = $line;
+
+    my @streaks;
+
+    foreach $line (<$fh>) {
+        push @streaks, $line;
+    }
+
+    close $fh;
+
+    return ($nstreaks, @streaks);
+}
+
 
 sub my_die
Index: /branches/eam_branches/20090715/ippScripts/scripts/magic_destreak_revert.pl
===================================================================
--- /branches/eam_branches/20090715/ippScripts/scripts/magic_destreak_revert.pl	(revision 25405)
+++ /branches/eam_branches/20090715/ippScripts/scripts/magic_destreak_revert.pl	(revision 25406)
@@ -180,53 +180,28 @@
     $bsources = $ipprc->filename("PSWARP.OUTPUT.SOURCES", $backup_path_base);
 } elsif ($stage eq "diff") {
-    my $name = $inverse ? "PPSUB.INVERSE" : "PPSUB.OUTPUT"; # Base name for images
+    my $name = "PPSUB.OUTPUT";
     $image  = $ipprc->filename($name, $path_base);
     $mask   = $ipprc->filename("$name.MASK", $path_base);
     $weight = $ipprc->filename("$name.VARIANCE", $path_base);
-    $sources = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $path_base);
+    $sources = $ipprc->filename("$name.SOURCES", $path_base);
     $bimage  = $ipprc->filename($name, $backup_path_base);
     $bmask   = $ipprc->filename("$name.MASK", $backup_path_base);
     $bweight = $ipprc->filename("$name.VARIANCE", $backup_path_base);
-    $bsources = $ipprc->filename("PPSUB.OUTPUT.SOURCES", $backup_path_base);
-}
-
-if ($image) {
-    revert_file($image, $bimage) or
-        &my_die("failed to restore image file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
-}
-
-if ($mask) {
-    if (!revert_file($mask, $bmask)) {
-        if ($stage eq 'chip') {
-            # don't fail if the mask file (from the camera stage) fails to revert.
-            # It probably doesn't exist
-            # XXX: Handle this properly
-            print STDERR "failure to revert mask file, ignored\n";
-        } else {
-            &my_die("failed to restore mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
-        }
-    }
-}
-
-if ($ch_mask) {
-    if (!revert_file($ch_mask, $bch_mask)) {
-        &my_die("failed to restore chip mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
-    }
-} 
-
-
-if ($weight) {
-    revert_file($weight, $bweight) or
-        &my_die("failed to restore variance image", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
-}
-
-if ($sources) {
-    revert_file($sources, $bsources) or
-        &my_die("failed to restore sources file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
-}
-
-if ($astrom) {
-    revert_file($astrom, $bastrom) or
-        &my_die("failed to restore astrometry file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
+    $bsources = $ipprc->filename("$name.SOURCES", $backup_path_base);
+}
+
+revert_files($image, $mask, $weight, $sources, $astrom, $bimage, $bmask, $bweight, $bsources, $bastrom);
+
+if ($stage eq "diff") {
+    my $name = "PPSUB.INVERSE";
+    $image  = $ipprc->filename($name, $path_base);
+    $mask   = $ipprc->filename("$name.MASK", $path_base);
+    $weight = $ipprc->filename("$name.VARIANCE", $path_base);
+    $sources = $ipprc->filename("$name.SOURCES", $path_base);
+    $bimage  = $ipprc->filename($name, $backup_path_base);
+    $bmask   = $ipprc->filename("$name.MASK", $backup_path_base);
+    $bweight = $ipprc->filename("$name.VARIANCE", $backup_path_base);
+    $bsources = $ipprc->filename("$name.SOURCES", $backup_path_base);
+    revert_files($image, $mask, $weight, $sources, undef, $bimage, $bmask, $bweight, $bsources, undef);
 }
 
@@ -254,4 +229,57 @@
 
 ### Pau.
+
+sub revert_files {
+    my $image = shift;
+    my $mask = shift;
+    my $weight = shift;
+    my $sources = shift;
+    my $astrom = shift;
+    my $bimage = shift;
+    my $bmask = shift;
+    my $bweight = shift;
+    my $bsources = shift;
+    my $bastrom = shift;
+
+    if ($image) {
+        revert_file($image, $bimage) or
+            &my_die("failed to restore image file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
+    }
+
+    if ($mask) {
+        if (!revert_file($mask, $bmask)) {
+            if ($stage eq 'chip') {
+                # don't fail if the mask file (from the camera stage) fails to revert.
+                # It probably doesn't exist
+                # XXX: Handle this properly
+                print STDERR "failure to revert mask file, ignored\n";
+            } else {
+                &my_die("failed to restore mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
+            }
+        }
+    }
+
+    if ($ch_mask) {
+        if (!revert_file($ch_mask, $bch_mask)) {
+            &my_die("failed to restore chip mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
+        }
+    } 
+
+
+    if ($weight) {
+        revert_file($weight, $bweight) or
+            &my_die("failed to restore variance image", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
+    }
+
+    if ($sources) {
+        revert_file($sources, $bsources) or
+            &my_die("failed to restore sources file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
+    }
+
+    if ($astrom) {
+        revert_file($astrom, $bastrom) or
+            &my_die("failed to restore astrometry file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
+    }
+}
 
 sub check_keyword
Index: /branches/eam_branches/20090715/ippScripts/scripts/publish_file.pl
===================================================================
--- /branches/eam_branches/20090715/ippScripts/scripts/publish_file.pl	(revision 25405)
+++ /branches/eam_branches/20090715/ippScripts/scripts/publish_file.pl	(revision 25406)
@@ -39,18 +39,19 @@
 
 # Parse the command-line arguments
-my ( $pub_id, $exp_id, $camera, $stage, $stage_id, $format, $product, $workdir );
-my ( $dbname, $verbose, $no_update, $save_temps, $redirect );
+my ( $pub_id, $camera, $stage, $stage_id, $fileset, $format, $product, $workdir );
+my ( $dbname, $verbose, $no_update, $no_op, $save_temps, $redirect );
 
 GetOptions(
     'pub_id=s'          => \$pub_id, # Publish identifier
-    'exp_id=s'          => \$exp_id, # Exposure identifier
     'camera=s'          => \$camera, # Camera name
     'stage=s'           => \$stage,       # Stage of interest
     'stage_id=s'        => \$stage_id,    # Stage identifier
     'product=s'         => \$product,     # Datastore product name
+    'fileset=s'         => \$fileset,     # Fileset name
     'workdir=s'         => \$workdir,     # Working directory
     'dbname=s'          => \$dbname,    # Database name
     'verbose'           => \$verbose,   # Print to stdout
     'no-update'         => \$no_update, # Don't update the database?
+    'no-op'             => \$no_op, # Don't do any operations
     'save-temps'        => \$save_temps, # Save temporary files?
     'redirect-output'   => \$redirect,   # Redirect output to log file?
@@ -58,8 +59,7 @@
 
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
-pod2usage( -msg => "Required options: --pub_id --exp_id --camera --stage --stage_id --product --workdir",
+pod2usage( -msg => "Required options: --pub_id --camera --stage --stage_id --product --workdir",
            -exitval => $PS_EXIT_CONFIG_ERROR) unless
     defined $pub_id and
-    defined $exp_id and
     defined $camera and
     defined $product and
@@ -68,5 +68,5 @@
     defined $workdir;
 
-my $outroot = "$workdir/$product.$pub_id.$exp_id"; # Output root name
+my $outroot = "$workdir/$product.$pub_id"; # Output root name
 
 my $ipprc = PS::IPP::Config->new( $camera ) or
@@ -79,20 +79,9 @@
 my $mdcParser = PS::IPP::Metadata::Config->new;
 
-
-# Retrieve file name of interest
-my %files;                      # Input filenames
-my %zp;                         # Zero points
-{
-    my $command;                # Command to run
-
-    if ($stage eq 'diff') {
-        $command =  "difftool -diffskyfile -diff_id $stage_id";
-    } elsif ($stage eq 'camera') {
-        $command =  "camtool -processedexp -cam_id $stage_id";
-    } else {
-        &my_die( "Unrecognised stage: $stage", $pub_id, $PS_EXIT_CONFIG_ERROR );
-    }
+my ($dsFile, $dsFileName) = tempfile("/tmp/publish.$pub_id.ds.XXXX", UNLINK => !$save_temps );
+
+if ($stage eq 'camera') {
+    my $command =  "camtool -processedexp -cam_id $stage_id";
     $command .= " -dbname $dbname" if defined $dbname;
-
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
         run(command => $command, verbose => $verbose);
@@ -105,4 +94,31 @@
         &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);
 
+    &my_die("More than one entry for cam_id $stage_id", $pub_id, $PS_EXIT_PROG_ERROR) if scalar @$components > 1;
+
+    my $comp = $$components[0]; # Component of interest
+    my $path_base = $comp->{path_base}; # Base name for file
+    my $file = $ipprc->filename( "PSASTRO.OUTPUT", $path_base );
+    $file = $ipprc->file_resolve($file);
+    my $cam_id = $comp->{cam_id};
+    my $name = "cam_$cam_id";
+    print $dsFile "$file|||$product|$name|\n";
+} elsif ($stage eq 'diff') {
+    my $command =  "difftool -diffskyfile -diff_id $stage_id";
+    $command .= " -dbname $dbname" if defined $dbname;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $success;
+
+    my $metadata = $mdcParser->parse(join "", @$stdout_buf) or
+        &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR);
+
+    my $components = parse_md_list($metadata) or
+        &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR);
+
+    my ($mopsPositiveFile, $mopsPositiveFileName) = tempfile("/tmp/publish.$pub_id.mops.pos.XXXX", UNLINK => !$save_temps ) if $product eq 'IPP-MOPS';
+    my ($mopsNegativeFile, $mopsNegativeFileName) = tempfile("/tmp/publish.$pub_id.mops.neg.XXXX", UNLINK => !$save_temps ) if $product eq 'IPP-MOPS';
+
+    my %positive;               # Data for positive diff detections
+    my %negative;               # Data for negative diff detections
     foreach my $comp ( @$components ) {
         my $path_base = $comp->{path_base}; # Base name for file
@@ -111,51 +127,78 @@
         (carp "Bad zpt_obs or exp_time for component" and next) if not defined $comp->{zpt_obs} or not defined $comp->{exp_time};
         my $zp = $comp->{zpt_obs} + 2.5 * log($comp->{exp_time}) / log(10);
-
-        if ($stage eq 'diff') {
-            my $skycell_id = $comp->{skycell_id};
-            $files{"$skycell_id.pos"} = $ipprc->filename( "PPSUB.OUTPUT.SOURCES", $path_base );
-            $files{"$skycell_id.neg"} = $ipprc->filename( "PPSUB.INVERSE.SOURCES", $path_base ) if
-                defined $comp->{bothways} and $comp->{bothways};
-            $zp{"$skycell_id.pos"} = $zp;
-            $zp{"$skycell_id.neg"} = $zp if defined $comp->{bothways} and $comp->{bothways};
-        } elsif ($stage eq 'camera') {
-            my $cam_id = $comp->{cam_id};
-            $files{$cam_id} = $ipprc->filename( "PSASTRO.OUTPUT", $path_base );
-            $zp{$cam_id} = $zp;
+        my $astrom = sqrt($comp->{sigma_ra_1}**2 + $comp->{sigma_dec_1}**2);
+
+        my $skycell_id = $comp->{skycell_id};
+        my $filename = $ipprc->filename( "PPSUB.OUTPUT.SOURCES", $path_base );
+        $filename = $ipprc->file_resolve($filename);
+
+        my $data = { zp => $zp,
+                     zp_err => $comp->{zpt_stdev},
+                     astrom => sqrt($comp->{sigma_ra_1}**2 + $comp->{sigma_dec_1}**2),
+                     exp_name => $comp->{exp_name_1},
+                     exp_id => $comp->{exp_id_1},
+                     chip_id => $comp->{chip_id_1},
+                     cam_id => $comp->{cam_id_1},
+                     fake_id => $comp->{fake_id_1},
+                     warp_id => $comp->{warp1},
+                     diff_id => $comp->{diff_id},
+                     direction => 1,
+        };
+
+        diff_check(\%positive, $data, "positive");
+
+        if ($product eq 'IPP-MOPS') {
+            print $mopsPositiveFile "$filename\n";
+        } else {
+            print $dsFile "$filename|||$product|${skycell_id}.pos|\n";
+        }
+
+        # Negative direction
+        if (defined $comp->{bothways} and $comp->{bothways}) {
+            my $filename = $ipprc->filename( "PPSUB.INVERSE.SOURCES", $path_base );
+            $filename = $ipprc->file_resolve($filename);
+
+            my $data = { zp => $zp,
+                         zp_err => $comp->{zpt_stdev},
+                         astrom => sqrt($comp->{sigma_ra_2}**2 + $comp->{sigma_dec_2}**2),
+                         exp_name => $comp->{exp_name_2},
+                         exp_id => $comp->{exp_id_2},
+                         chip_id => $comp->{chip_id_2},
+                         cam_id => $comp->{cam_id_2},
+                         fake_id => $comp->{fake_id_2},
+                         warp_id => $comp->{warp2},
+                         diff_id => $comp->{diff_id},
+                         direction => 0,
+            };
+
+            diff_check(\%negative, $data, "negative");
+
+            if ($product eq 'IPP-MOPS') {
+                print $mopsNegativeFile "$filename\n";
+            } else {
+                print $dsFile "$filename|||$product|${skycell_id}.neg|\n";
+            }
         }
     }
-}
-
-# Prepare for data store input
-my ($listFile, $listFileName) = tempfile("/tmp/publish.$pub_id.list.XXXX", UNLINK => !$save_temps );
-
-# Process each file
-foreach my $comp ( keys %files ) {
-    my $file = $ipprc->file_resolve( $files{$comp} ) or
-        &my_die("Unable to resolve file $files{$comp}", $pub_id, $PS_EXIT_SYS_ERROR);
-    my_die("Unable to find file $file", $pub_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $file );
-
-    my $zp = $zp{$comp};
-    if ($product eq "IPP-MOPS") {
-        my $outuri = "$outroot.$comp.fits";
-        my $out = $ipprc->file_resolve( $outuri, 'create' ) or
-            &my_die( "Unable to resolve output file $outuri", $pub_id, $PS_EXIT_SYS_ERROR);
-
-        my $command = "$ppMops $file $zp $out";
-        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
-            run(command => $command, verbose => $verbose);
-        &my_die( "Unable to translate $file", $pub_id, $PS_EXIT_SYS_ERROR) unless $success;
-        &my_die( "Unable to find translated file $out", $pub_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $out );
-        $file = $out;
+
+    close $mopsPositiveFile;
+    close $mopsNegativeFile;
+
+    if ($product eq 'IPP-MOPS') {
+        if (scalar keys %positive > 0) {
+            my $output = mops_combine(\%positive, "$outroot.pos.mops", $mopsPositiveFileName);
+            print $dsFile "$output|||$product|positive|\n";
+        }
+        if (scalar keys %negative > 0) {
+            my $output = mops_combine(\%negative, "$outroot.neg.mops", $mopsNegativeFileName);
+            print $dsFile "$output|||$product|negative|\n";
+        }
     }
-
-    # format: filename|filesize|md5sum|filetype|
-    # note: since we omit filesize and md5sum, dsreg will calculate them
-    print $listFile "$file|||$product|$comp|\n";
-}
-
+}
+
+close $dsFile;
 
 unless ($no_update) {
-    my $command = "$dsreg --add $stage.$stage_id --copy --abspath --product $product --type $product --list $listFileName";
+    my $command = "$dsreg --add $stage.$stage_id --copy --abspath --product $product --type $product --list $dsFileName";
 
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -166,4 +209,7 @@
 unless ($no_update) {
     my $command = "$pubtool -add -pub_id $pub_id -path_base $outroot";
+    $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
+    $command .= " -hostname $host" if defined $host;
+
     $command .= " -dbname $dbname" if defined $dbname;
 
@@ -176,4 +222,73 @@
 
 ### Pau.
+
+# Check inputs for a diff
+sub diff_check
+{
+    my $data = shift;           # Data hash
+    my $comp = shift;           # Component data
+    my $name = shift;           # Name of component
+
+    $data->{zp} = $comp->{zp} unless defined $data->{zp};
+    $data->{zp_err} = $comp->{zp_err} unless defined $data->{zp_err};
+    $data->{astrom} = $comp->{astrom} unless defined $data->{astrom};
+    $data->{exp_name} = $comp->{exp_name} unless defined $data->{exp_name};
+    $data->{exp_id} = $comp->{exp_id} unless defined $data->{exp_id};
+    $data->{chip_id} = $comp->{chip_id} unless defined $data->{chip_id};
+    $data->{cam_id} = $comp->{cam_id} unless defined $data->{cam_id};
+    $data->{fake_id} = $comp->{fake_id} unless defined $data->{fake_id};
+    $data->{warp_id} = $comp->{warp_id} unless defined $data->{warp_id};
+    $data->{diff_id} = $comp->{diff_id} unless defined $data->{diff_id};
+    $data->{direction} = $comp->{direction} unless defined $data->{direction};
+
+    &my_die("zp value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{zp} and $comp->{zp} != $data->{zp};
+    &my_die("zp_err value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{zp_err} and $comp->{zp_err} != $data->{zp_err};
+    &my_die("astrom value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{astrom} and $comp->{astrom} != $data->{astrom};
+    &my_die("exp_name value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{exp_name} and $comp->{exp_name} ne $data->{exp_name};
+    &my_die("exp_id value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{exp_id} and $comp->{exp_id} != $data->{exp_id};
+    &my_die("chip_id value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{chip_id} and $comp->{chip_id} != $data->{chip_id};
+    &my_die("cam_id value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{cam_id} and $comp->{cam_id} != $data->{cam_id};
+    &my_die("fake_id value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{fake_id} and $comp->{fake_id} != $data->{fake_id};
+    &my_die("warp_id value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{warp_id} and $comp->{warp_id} != $data->{warp_id};
+    &my_die("diff_id value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{diff_id} and $comp->{diff_id} != $data->{diff_id};
+    &my_die("direction value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{direction} and $comp->{direction} != $data->{direction};
+
+    return 1;
+}
+
+# Combine multiple files for MOPS
+sub mops_combine
+{
+    my $data = shift;           # Data
+    my $output = shift;         # Output name
+    my $input = shift;          # Input name
+
+    $output = $ipprc->file_resolve( $output, 'create' ) or
+        &my_die( "Unable to resolve output file $output", $pub_id, $PS_EXIT_SYS_ERROR);
+
+    my $command = "$ppMops $input $output";
+    $command .= " -exp_name " . $data->{exp_name} if defined $data->{exp_name};
+    $command .= " -exp_id " . $data->{exp_id} if defined $data->{exp_id};
+    $command .= " -chip_id " . $data->{chip_id} if defined $data->{chip_id};
+    $command .= " -cam_id " . $data->{cam_id} if defined $data->{cam_id};
+    $command .= " -fake_id " . $data->{fake_id} if defined $data->{fake_id};
+    $command .= " -warp_id " . $data->{warp_id} if defined $data->{warp_id};
+    $command .= " -diff_id " . $data->{diff_id} if defined $data->{diff_id};
+    $command .= " -inverse" if defined $data->{direction} and $data->{direction} == 0;
+    $command .= " -zp " . $data->{zp} if defined $data->{zp};
+    $command .= " -zp_error " . $data->{zp_err} if defined $data->{zp_err};
+    $command .= " -astrom_rms " . $data->{astrom} if defined $data->{astrom};
+
+    unless ($no_op) {
+        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+            run(command => $command, verbose => $verbose);
+        &my_die( "Unable to translate", $pub_id, $PS_EXIT_SYS_ERROR) unless $success;
+        &my_die( "Unable to find translated file $output", $pub_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists( $output );
+    } else {
+        print "Not running: $command\n";
+    }
+
+    return $output;
+}
 
 
@@ -191,4 +306,6 @@
         $command .= " -pub_id $pub_id";
         $command .= " -path_base $outroot";
+        $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400));
+        $command .= " -hostname $host" if defined $host;
         $command .= " -fault $fault";
         $command .= " -dbname $dbname" if defined $dbname;
Index: /branches/eam_branches/20090715/ippScripts/scripts/stack_skycell.pl
===================================================================
--- /branches/eam_branches/20090715/ippScripts/scripts/stack_skycell.pl	(revision 25405)
+++ /branches/eam_branches/20090715/ippScripts/scripts/stack_skycell.pl	(revision 25406)
@@ -65,4 +65,6 @@
 
 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $stack_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
+$| = 1;
+print "I've set up: $stack_id\n";
 
 # XXX camera is not known here; cannot use filerules...
@@ -107,4 +109,6 @@
 &my_die("Stack list contains less than two elements", $stack_id, $PS_EXIT_SYS_ERROR) unless
     scalar @$files >= 2;
+
+print "I've loaded my inputs: $stack_id\n";
 
 # Parse the list of input files to get the tesselation, skycell identifiers and camera
@@ -146,4 +150,6 @@
 }
 
+print "I've configured everything: $stack_id\n";
+
 # Generate MDC file with the inputs
 my $tess_base = basename($tess_id);
@@ -180,4 +186,6 @@
     print $listFile "END\n\n";
 }
+
+print "I've checked everything: $stack_id\n";
 
 # Get the output filenames
@@ -200,4 +208,5 @@
 
 my $cmdflags;
+
 
 # Perform stacking
@@ -265,5 +274,6 @@
 #       &my_die("Couldn't find expected output file: $bin2Name",    $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name);
     }
-
+    
+    print "I've stacked $listName: $stack_id\n";
 }
 
@@ -298,4 +308,6 @@
 }
 
+print "I've updated teh database: $stack_id\n";
+
 
 my $my_die_called = 0;
@@ -372,4 +384,5 @@
 }
 
+print "I've reached the end of processing with a code of $?: $stack_id\n";
 
 END {
Index: /branches/eam_branches/20090715/ippScripts/scripts/summit_copy.pl
===================================================================
--- /branches/eam_branches/20090715/ippScripts/scripts/summit_copy.pl	(revision 25405)
+++ /branches/eam_branches/20090715/ippScripts/scripts/summit_copy.pl	(revision 25406)
@@ -12,4 +12,5 @@
 use Sys::Hostname;
 
+use Digest::MD5::File qw( file_md5_hex );
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
 use Pod::Usage qw( pod2usage );
@@ -21,5 +22,5 @@
 
 # Parse the command-line arguments
-my ( $uri, $filename, $compress, $bytes, $md5, $nebulous, $exp_name, $inst, $telescope, $class, $class_id, $end_stage, $workdir,
+my ( $uri, $filename, $compress, $bytes, $md5, $nebulous, $exp_name, $inst, $telescope, $class, $class_id, 
      $dbname, $verbose, $no_update, $no_op, $timeout, $copies );
 GetOptions(
@@ -35,6 +36,4 @@
        'class=s'        => \$class,     # Class level
        'class_id=s'     => \$class_id,  # Class identifier
-       'end_stage=s'    => \$end_stage, # end of processing
-       'workdir=s'      => \$workdir,   # workdir
        'dbname=s'       => \$dbname,    # Database name
        'verbose'        => \$verbose,   # Print to stdout
@@ -62,8 +61,12 @@
 my $pztool = can_run('pztool')
     or (warn "Can't find pztool" and $missing_tools = 1);
+my $neblocate = can_run('neb-locate')
+    or (warn "Can't find neb-locate" and $missing_tools = 1);
 if ($missing_tools) {
     warn("Can't find required tools.");
     exit($PS_EXIT_CONFIG_ERROR);
 }
+
+my $ipprc = PS::IPP::Config->new();
 
 # dsget command
@@ -97,4 +100,11 @@
 }
 
+#
+# Find all instances of the new file and make sure they have the
+# same checksum and size.
+# if so pass the results to pztool to the results in pzDownloadImfile.
+# uncomment this to turn on
+# my ($new_bytes, $new_md5) = check_instances($filename, $nebulous, $compress);
+
 # command to update database
 $command  = "$pztool -copydone";
@@ -106,8 +116,10 @@
 $command .= " -class_id $class_id";
 $command .= " -uri $filename";
-# $command .= " -workdir $workdir";
 $command .= " -hostname $host";
-# $command .= " -end_stage $end_stage" if defined $end_stage;
 $command .= " -dbname $dbname" if defined $dbname;
+
+# XXX: TODO: see above. Don't do this until pztool and the DB have
+# been updated
+# $command .= " -md5sum $new_md5 -bytes $new_bytes";
 
 # update the database
@@ -122,4 +134,86 @@
 } else {
     print "skipping command: $command\n";
+}
+
+sub get_file_params
+{
+    my $filename = shift;
+
+    my $size = -s $filename;
+    my $md5 = file_md5_hex($filename);
+
+    return ($size, $md5);
+}
+
+sub check_instances {
+    my $filename = shift;
+    my $nebulous = shift;
+    my $compress = shift;
+
+    my @instances;
+    if ($nebulous) {
+        my $command = "$neblocate --path --all $filename";
+        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf )
+            = run(command => $command, verbose => $verbose);
+        unless ($success) {
+            $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+            my_die("Unable to perform neb-locate: $error_code",
+                $exp_name,
+                $inst,
+                $telescope,
+                $class,
+                $class_id,
+                $uri,
+                $error_code
+            );
+        }
+        @instances = split "\n", join "", @$stdout_buf;
+    } else {
+        if (!defined $ipprc) {
+            # we don't usually need this so defer instantaiating it
+            $ipprc = PS::IPP::Config->new();
+        }
+        my $resolved = $ipprc->file_resolve($filename);
+        if ($resolved) {
+            $instances[0] = $resolved;
+        }
+    }
+    if (! scalar @instances) {
+        my_die("no instances",
+                    $exp_name,
+                    $inst,
+                    $telescope,
+                    $class,
+                    $class_id,
+                    $uri,
+                    $PS_EXIT_UNKNOWN_ERROR
+            );
+    }
+
+    my ($new_bytes, $new_md5) = get_file_params($instances[0]);
+        
+    for (my $i = 1; $i < scalar @instances; $i++) {
+        my ($b, $m) = get_file_params($instances[$i]);
+        my $error = "";
+        if ($b ne $new_bytes) {
+            $error = "size of $instances[$i] does not match $instances[0]";
+        } elsif ($m != $new_md5) {
+            $error = "md5sum of $instances[$i] does not match $instances[0]";
+        }
+        if ($error) {
+            my_die($error,
+                    $exp_name,
+                    $inst,
+                    $telescope,
+                    $class,
+                    $class_id,
+                    $uri,
+                    $PS_EXIT_DATA_ERROR
+            );
+        }
+    }
+
+    return ($new_bytes, $new_md5);
+    
 }
 
Index: /branches/eam_branches/20090715/ippTests/tap/mailTestResults.pl
===================================================================
--- /branches/eam_branches/20090715/ippTests/tap/mailTestResults.pl	(revision 25406)
+++ /branches/eam_branches/20090715/ippTests/tap/mailTestResults.pl	(revision 25406)
@@ -0,0 +1,34 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+use Email::Send;
+
+my $email="ps-ipp-dev\@ifa.hawaii.edu";
+
+my $today = `date -u +%Y%m%d`;
+my $logfile = "/data/ipp001.0/ippTests/tap/summary";
+
+my @logcontents;
+
+#check existence of log file
+if (open (FPTR, $logfile)) {
+  @logcontents = <FPTR>;
+  } else {
+  @logcontents = "FAIL: Can't Open File: $logfile\n";
+}
+close (FPTR);
+
+my $message =<<END;
+To: $email
+From: giebink\@ifa.hawaii.edu
+Subject: $ARGV[0] test summary $today
+
+@logcontents
+
+END
+
+my $sender = Email::Send->new({mailer => 'SMTP'});
+$sender->mailer_args([Host => 'hale.ifa.hawaii.edu']);
+$sender->send($message);
Index: /branches/eam_branches/20090715/ippTests/tap/proveParser.pl
===================================================================
--- /branches/eam_branches/20090715/ippTests/tap/proveParser.pl	(revision 25406)
+++ /branches/eam_branches/20090715/ippTests/tap/proveParser.pl	(revision 25406)
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -w
+#parse tap test output
+#write summary portion to file
+
+use strict;
+use warnings;
+
+open (IF,"</data/ipp001.0/ippTests/tap/out") or die "Cannot open out file";
+open (OF, ">/data/ipp001.0/ippTests/tap/summary") or die "Cannot open summary file";
+
+my $flag = 0;
+
+while (<IF>) {
+  print $_;
+  if (/^Failed Test/) {
+    $flag = 1;
+  }
+  if ($flag == 1) {
+    print OF $_;
+  }
+}
+
+close (IF);
+close (OF);
Index: /branches/eam_branches/20090715/ippTests/tap/tapTest.pl
===================================================================
--- /branches/eam_branches/20090715/ippTests/tap/tapTest.pl	(revision 25406)
+++ /branches/eam_branches/20090715/ippTests/tap/tapTest.pl	(revision 25406)
@@ -0,0 +1,46 @@
+#!/usr/bin/perl -w
+#run weekly by cron
+
+#define directories with TAP tests
+my @testDirs = ('psLib', 'psModules', 'Nebulous-Server', 'Nebulous');
+
+#delete modules with tap tests
+system `rm -rf /data/ipp001.0/ippTests/tap/ipp/Nebulous`;
+
+#delete Nebulous binaries
+system `rm -rf /data/ipp001.0/ippTests/tap/usr/*`;
+
+#check out new versions, build the tests
+#run the tests and save output to file
+#parse the output and mail the results to IPP-DEV
+my $dir;
+foreach $dir (@testDirs) {
+    system `svn co http://svn.pan-starrs.ifa.hawaii.edu/repo/ipp/trunk/$dir /data/ipp001.0/ippTests/tap/ipp/$dir`;
+    chdir "/data/ipp001.0/ippTests/tap/ipp/$dir";
+    
+    if ($dir =~ m/^Nebulous-Server$/) {
+        system ("perl Build.PL --prefix=/data/ipp001.0/ippTests/tap/usr");
+        system ("Build install");
+        system ("Build test > /data/ipp001.0/ippTests/tap/summary");
+        system ("/data/ipp001.0/ippTests/tap/mailTestResults.pl $dir");
+        
+    } elsif ($dir =~ m/^Nebulous$/) {
+        chdir "/data/ipp001.0/ippTests/tap/ipp/$dir/nebclient";
+        system ("autogen.sh --prefix=/data/ipp001.0/ippTests/tap/usr");
+        system ("/usr/bin/make");
+        chdir "/data/ipp001.0/ippTests/tap/ipp/$dir";
+        system ("perl Build.PL --prefix=/data/ipp001.0/ippTests/tap/usr");
+        system ("Build install");
+        system ("Build test > /data/ipp001.0/ippTests/tap/summary");
+        system ("/data/ipp001.0/ippTests/tap/mailTestResults.pl $dir");
+        
+    } else {
+        system ("autogen.sh --enable-tests");
+        system ("make");
+        chdir "/data/ipp001.0/ippTests/tap/ipp/$dir/test";
+        system ("./test.pl > /data/ipp001.0/ippTests/tap/out");
+        system ("/data/ipp001.0/ippTests/tap/proveParser.pl");
+        system ("/data/ipp001.0/ippTests/tap/mailTestResults.pl $dir");
+    }
+}
+
Index: /branches/eam_branches/20090715/magic/Makefile.in
===================================================================
--- /branches/eam_branches/20090715/magic/Makefile.in	(revision 25405)
+++ /branches/eam_branches/20090715/magic/Makefile.in	(revision 25406)
@@ -12,5 +12,5 @@
 
 update:
-	# get the source code (replace this with SVN interactions)
+# get the source code (replace this with SVN interactions)
 	tar xvzf ~/magic.tgz
 	tar xvzf ~/ssa-core-cpp.tgz
Index: /branches/eam_branches/20090715/magic/censorObjects/src/censorLoop.c
===================================================================
--- /branches/eam_branches/20090715/magic/censorObjects/src/censorLoop.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/censorObjects/src/censorLoop.c	(revision 25406)
@@ -22,5 +22,4 @@
  */
 bool censorLoop (pmConfig *config) {
-
     pmChip *chip;
     pmCell *cell;
@@ -28,4 +27,7 @@
 
     psTimerStart ("censor");
+
+
+
 
     // select the current recipe
@@ -51,4 +53,5 @@
 
     pmFPAview *view = pmFPAviewAlloc (0);
+
     bool badMaskFile = false;
 
@@ -59,12 +62,39 @@
     if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
 
+    // check PHU header to see if we are using mosaic-level or per-chip astrometry
+    bool bilevelAstrometry = false;
+    pmHDU *phu = pmFPAviewThisPHU (view, input->fpa);
+    if (phu) {
+      char *ctype = psMetadataLookupStr (NULL, phu->header, "CTYPE1");
+      if (ctype) bilevelAstrometry = !strcmp (&ctype[4], "-DIS");
+    }
+    if (bilevelAstrometry) {
+      pmAstromReadBilevelMosaic (input->fpa, phu->header);
+    } 
+
     while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) {
 	psTrace ("censor", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);
 	if (!chip->process || !chip->file_exists) { continue; }
-
+	
 	// check on the mask file at this level if possible
 	badMaskFile = censorBadFileByView(badMaskFile, inMask, config, view);
 
 	if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE;
+
+	// read WCS data from the corresponding header
+
+	pmHDU *hdu = pmFPAviewThisHDU (view, input->fpa);
+	
+	if (bilevelAstrometry) {
+	  if (!pmAstromReadBilevelChip (chip, hdu->header)) {
+	    psWarning("Could not get WCS information from header for chip %d, skipping", view->chip); 
+	    continue;
+	  }
+	} else {
+	  if (!pmAstromReadWCS(input->fpa, chip, hdu->header, 1.0)) {
+	    psWarning( "Unable to read WCS astrometry from chip %d, skipping", view->chip);
+	    continue;
+	  }
+	}
 
 	while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) {
Index: /branches/eam_branches/20090715/magic/remove/src/Line.c
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/Line.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/Line.c	(revision 25406)
@@ -36,5 +36,5 @@
     // If the current line is not vertical, check to see if the point
     // is inside the two endpoints independent of direction
-    
+
     if (line->begin.x != line->end.x)
     {
@@ -59,11 +59,11 @@
     ux = line->end.x - line->begin.x;
     uy = line->end.y - line->begin.y;
-    
+
     vx = x - line->begin.x;
     vy = y - line->begin.y;
-    
+
     double u_u = ux * ux + uy * uy;                         // (u . u)
     double u_v = ux * vx + uy * vy;                         // (u . v)
-    
+
     if (u_v <= 0) return vx * vx + vy * vy;                 // (v . v)
     if (u_u <= u_v)
@@ -73,8 +73,8 @@
         return wx * wx + wy * wy;                           // (w . w)
     }
-    
+
     // Compute P(b) is the base of the perpendicular dropped from tuple to
     // the line
-    
+
     b = u_v / u_u;
     px = vx - b * ux;
@@ -109,25 +109,25 @@
     double wx  = first->begin.x - second->begin.x;
     double wy  = first->begin.y - second->begin.y;
-    
+
     // Calculate the perpendicular product, dt
-    
+
     double dt = dx1 * dy2 - dy1 * dx2;
-    
+
     // Are the lines parallel?
-    
+
     if (fabs (dt) <= 1e-8)
     {
         // Check to see if they are overlap
-        
+
         if (dx1 * wy - dy1 * wx != 0 || dx2 * wy - dy2 * wx != 0) return 0;
-        
+
         // The line are coplanar, so check to see if they are degenerate
-        
+
         len1 = dx1 * dx1 + dy1 * dy1;
         len2 = dx2 * dx2 + dy2 * dy2;
-        
+
         // First, check to see if both lines are points and if they are
         // distinct tuples
-        
+
         if (len1 == 0 && len2 == 0)
         {
@@ -137,8 +137,8 @@
             return 1;
         }
-        
+
         // Check to see if the first line is a point and is inside the
         // second line
-        
+
         if (len1 == 0)
         {
@@ -148,8 +148,8 @@
                 return 0;
         }
-        
+
         // Check to see if the second line is a point and is inside the
         // first line
-        
+
         if (len2 == 0)
         {
@@ -159,14 +159,14 @@
                 return 0;
         }
-        
+
         // Since both lines are coplanar and have length, search for
         // overlap tuples
-        
+
         w2x = first->end.x - second->begin.x;
         w2y = first->end.y - second->begin.y;
-        
+
         t0 = (dx2 != 0) ? wx  / dx2 : wy  / dy2;
         t1 = (dx2 != 0) ? w2x / dx2 : w2y / dy2;
-        
+
         if (t0 > t1) SwapDouble (&t0, &t1);
         if ((inFirstSegment || inSecondSegment) && (t0 > 1 || t1 < 0))
@@ -176,27 +176,27 @@
         t0 = (t0 < 0) ? 0 : t0;             // Clip to min 0
         t1 = (t1 > 1) ? 1 : t1;             // Clip to max 1
-        
+
         // Set the first tuple of intersection
-        
+
         tuple1->x = second->begin.x + t0 * dx2;
         tuple1->y = second->begin.y + t0 * dy2;
-        
+
         // Check to see if the intersection is a single tuple
-        
+
         if (t0 == t1) return 1;
-        
+
         // Otherwise, set the second tuple of intersection as well
-        
+
         tuple2->x = second->begin.x + t1 * dx2;
         tuple2->y = second->begin.y + t1 * dy2;
         return 2;
     }
-    
+
     // The segments are skew and may intersect in a tuple.
     // Get the intersect parameter for the first line
-    
+
     double i1 = (dx2 * wy - dy2 * wx) / dt;
     if (inFirstSegment && (i1 < 0 || i1 > 1)) return 0;
-    
+
     // Get the intersect parameter for the second line
 
@@ -226,4 +226,9 @@
     vertices[3].x = 0;       vertices[3].y = numRows;
 
+    clipLine.begin.x = 0;
+    clipLine.begin.y = 0;
+    clipLine.end.x = 0;
+    clipLine.end.y = 0;
+
     for (i = 0; i < 4 && found < 2; ++i)
     {
@@ -237,5 +242,5 @@
                 ++found;
             }
-            else if (tuple1.x != clipLine.begin.x || 
+            else if (tuple1.x != clipLine.begin.x ||
                      tuple1.y != clipLine.begin.y)
             {
@@ -245,7 +250,7 @@
         }
     }
-    
+
     // If two endpoints are found, clip the line
-    
+
     if (found > 1)
     {
@@ -283,4 +288,9 @@
     vertices[3].x = minX; vertices[3].y = maxY;
 
+    clipLine.begin.x = 0;
+    clipLine.begin.y = 0;
+    clipLine.end.x = 0;
+    clipLine.end.y = 0;
+
     for (i = 0; i < 4 && found < 2; ++i)
     {
@@ -294,5 +304,5 @@
                 ++found;
             }
-            else if (tuple1.x != clipLine.begin.x || 
+            else if (tuple1.x != clipLine.begin.x ||
                      tuple1.y != clipLine.begin.y)
             {
@@ -302,7 +312,7 @@
         }
     }
-    
+
     // If two endpoints are found, clip the line
-    
+
     if (found > 1)
     {
@@ -360,5 +370,5 @@
     @param[out] pixels list of PixelPos pointers corresponding
                        based on the line settings
-    @param[in] line Line to map to pixels   
+    @param[in] line Line to map to pixels
     @param[in] numCols maximum X (columns) for the line
     @param[in] numRows maximum Y (rows) for the line            */
@@ -367,17 +377,16 @@
 {
     Line offsetLine;
-    PixelPos *pixel;
     double slope, xOffset, yOffset, xMid, yMid;
     int x, y, xBegin = numCols, yBegin = numRows, xEnd = 0, yEnd = 0;
 
     // Extract the endpoints
-    
+
     double x1 = line->begin.x;
     double y1 = line->begin.y;
     double x2 = line->end.x;
     double y2 = line->end.y;
-    
+
     // Determine the width and height of the line
-    
+
     double dx = x2 - x1;
     double dy = y2 - y1;
@@ -403,5 +412,5 @@
 
     // Step point by point based on the dominate axis
-    
+
     if (fabs (dx) > fabs (dy))
     {
@@ -411,5 +420,5 @@
         // If line is back to front, reorder endpoints and recompute
         // the line width and height
-        
+
         if (x1 > x2)
         {
@@ -421,10 +430,10 @@
 
         // Compute the slope of the line
-        
+
         slope = dy / dx;
-        
+
         // Compute the x and y offsets for the line width extent
 
-        if (xBegin > xEnd) 
+        if (xBegin > xEnd)
             SwapInt (&xBegin, &xEnd);
         else
@@ -451,5 +460,5 @@
     }
     else
-    {       
+    {
         // -------------------
         // vertical(ish) lines
@@ -457,5 +466,5 @@
         // If line is back to front, reorder endpoints and recompute
         // the line width and height
-        
+
         if (y1 > y2)
         {
@@ -465,9 +474,9 @@
             dy = y2 - y1;
         }
-        
+
         // Compute the slope of the line
-        
+
         slope = dx / dy;
-        
+
         // Compute the x and y offsets for the line width extent
 
@@ -481,5 +490,5 @@
         xMid = x1 + slope * (yBegin - y1);
         xOffset = fabs (halfWidth * dr / dy);
-        
+
         for (y = yBegin; y != yEnd; ++y)
         {
Index: /branches/eam_branches/20090715/magic/remove/src/Makefile.simple
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/Makefile.simple	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/Makefile.simple	(revision 25406)
@@ -36,9 +36,9 @@
 
 STREAKSFLAGS=-DSTREAKS_COMPRESS_OUTPUT=1
-OPTFLAGS= -g -O2
+OPTFLAGS= -g -O2 -Wall -Werror
 #OPTFLAGS= -g
-CFLAGS=`psmodules-config --cflags` -std=gnu99 ${OPTFLAGS} ${STREAKSFLAGS}
-#CFLAGS=`psmodules-config --cflags` -std=gnu99 ${OPTFLAGS}
-LDFLAGS=`psmodules-config --libs`
+CFLAGS=`psmodules-config --cflags` `pslib-config --cflags` -std=gnu99 ${OPTFLAGS} ${STREAKSFLAGS}
+#CFLAGS=`psmodules-config --cflags` `pslib-config --cflags` -std=gnu99 ${OPTFLAGS}
+LDFLAGS=`psmodules-config --libs` `pslib-config --libs`
 
 PROGRAMS= streaksremove streaksreplace streakscompare streaksrelease isdestreaked
Index: /branches/eam_branches/20090715/magic/remove/src/isdestreaked.c
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/isdestreaked.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/isdestreaked.c	(revision 25406)
@@ -18,6 +18,5 @@
     psFits *fits = psFitsOpen(fileName, "r");
     if (!fits) {
-        psError(PS_ERR_UNKNOWN, false, "failed to open fits file: %s\n", fileName);
-        psErrorStackPrint(stderr, "");
+        psErrorStackPrint(stderr, "failed to open fits file: %s\n", fileName);
         exit(PS_EXIT_DATA_ERROR);
     }
@@ -25,6 +24,5 @@
     psMetadata *header = psFitsReadHeader(NULL, fits);
     if (!header) {
-        psError(PS_ERR_IO, false, "failed to read header for: %s", fileName);
-        psErrorStackPrint(stderr, "");
+        psErrorStackPrint(stderr, "failed to read header for: %s", fileName);
         exit(PS_EXIT_DATA_ERROR);
     }
Index: /branches/eam_branches/20090715/magic/remove/src/streaksastrom.c
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/streaksastrom.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/streaksastrom.c	(revision 25406)
@@ -93,5 +93,5 @@
     // since the transform already accounts for the chip parity we just use the cell parity
     astrom->xParity = (double) xParityCell;
-    astrom->yParity = (double) yParityCell; 
+    astrom->yParity = (double) yParityCell;
 
     astrom->numCols = numCols;
@@ -135,5 +135,5 @@
 
 void
-cellToChipInt(int *xChip, int *yChip, strkAstrom *astrom, int xCell, int yCell)
+cellToChipInt(unsigned int *xChip, unsigned int *yChip, strkAstrom *astrom, int xCell, int yCell)
 {
     if (astrom->xParity > 0) {
@@ -148,5 +148,5 @@
     }
 }
- 
+
 bool
 SkyToLocal(strkPt *outPt, strkAstrom *astrom, double ra, double dec)
@@ -156,5 +156,4 @@
 
     pmFPA *fpa   = (pmFPA *) astrom->fpa;
-    pmChip *chip = (pmChip *) astrom->chip;
 
     // find the RA,DEC coords of the 0,0 pixel for this chip:
@@ -183,5 +182,4 @@
 
     pmFPA *fpa   = (pmFPA *) astrom->fpa;
-    pmChip *chip = (pmChip *) astrom->chip;
 
     // find the RA,DEC coords of the 0,0 pixel for this chip:
@@ -251,5 +249,5 @@
     pmChip *chip = (pmChip *) astrom->chip;
     pmAstromObj *pt = (pmAstromObj *) astrom->pt;
-    
+
     pt->sky->r = ra;
     pt->sky->d = dec;
@@ -276,5 +274,5 @@
     pmChip *chip = (pmChip *) astrom->chip;
     pmAstromObj *pt = (pmAstromObj *) astrom->pt;
-    
+
     cellToChip(&pt->chip->x, &pt->chip->y, astrom, x, y);
 
@@ -294,5 +292,5 @@
 }
 
- 
+
 static bool
 readAstrometry(streakFiles *sf)
@@ -362,5 +360,5 @@
             break;
         }
-    } 
+    }
     if (!sf->chip) {
         psError(PS_ERR_UNKNOWN, true, "Failed to find chip with data.");
Index: /branches/eam_branches/20090715/magic/remove/src/streakscompare.c
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/streakscompare.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/streakscompare.c	(revision 25406)
@@ -5,5 +5,4 @@
 int main(int argc, char *argv[])
 {
-    long i;
     bool status;
 
@@ -35,5 +34,5 @@
     int numErrors = 0;
     for (int component = 0; component < ncomponents; component++) {
-        if (component && !(psFitsMoveExtNum(file1->fits, 1, true) 
+        if (component && !(psFitsMoveExtNum(file1->fits, 1, true)
                            && psFitsMoveExtNum(file2->fits, 1, true))) {
             streaksExit("failed to advance to next extesion\n", PS_EXIT_DATA_ERROR);
@@ -45,5 +44,5 @@
         psImage *image2 = file2->image;
 
-        // TODO: do more sanity checking. For example check that extname's  (if any) match 
+        // TODO: do more sanity checking. For example check that extname's  (if any) match
         // check for matching image cubes
         if (image1 && image2) {
@@ -68,5 +67,5 @@
                         error = ! isnan(value1) && isnan(value2);
                     }
-                    
+
                     if (error) {
                         numErrors++;
Index: /branches/eam_branches/20090715/magic/remove/src/streaksextern.h
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/streaksextern.h	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/streaksextern.h	(revision 25406)
@@ -54,5 +54,5 @@
             pixels
 */
-    
+
 extern StreakPixels *streak_on_component(Streaks *streaks, strkAstrom *astrom,
                                          int numCols, int numRows);
Index: /branches/eam_branches/20090715/magic/remove/src/streaksio.c
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/streaksio.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/streaksio.c	(revision 25406)
@@ -12,5 +12,5 @@
 // Assumptions about the file structure of non-raw files
 // The 'image' for each file (image, mask weight) is contained in the first
-// extension. 
+// extension.
 
 
@@ -625,5 +625,5 @@
         streaksExit("", PS_EXIT_DATA_ERROR);
     }
- 
+
     bool status;
     in->extname = psMetadataLookupStr(&status, in->header, "EXTNAME");
@@ -654,5 +654,15 @@
             streaksExit("", PS_EXIT_DATA_ERROR);
         }
-        psImage *image = (psImage *) (in->imagecube->data[0]);
+
+        // Ensure input is of the expected type
+        psDataType expected = isMask ? PS_TYPE_IMAGE_MASK : PS_TYPE_F32; // Expected type for image
+        for (int i = 0; i < in->imagecube->n; i++) {
+            psImage *image = in->imagecube->data[i]; // Image of interest
+            if (image->type.type != expected) {
+                psImage *temp = psImageCopy(NULL, image, expected);
+                psFree(image);
+                in->imagecube->data[i] = temp;
+            }
+        }
     }
     setDataExtent(stage, in, (stage == IPP_STAGE_RAW) && !isMask);
@@ -671,4 +681,5 @@
     sfile->fits->options = psFitsOptionsAlloc();
     sfile->fits->options->scaling = PS_FITS_SCALE_MANUAL;
+    sfile->fits->options->fuzz = false;
     sfile->fits->options->bitpix = bitpix;
     sfile->fits->options->bscale = bscale;
@@ -925,6 +936,4 @@
 replicateOutputs(streakFiles *sfiles)
 {
-    bool status = false;
-
     if (!replicate(sfiles->outImage, sfiles->inImage)) {
         psError(PM_ERR_SYS, false, "failed to replicate outImage.");
@@ -973,5 +982,5 @@
 
         if (!nebSwap(server, in->name, out->name)) {
-            psError(PM_ERR_SYS, true, "failed to swap files for: %s.",
+            psError(PM_ERR_SYS, true, "failed to swap files for %s: %s.",
                 in->name, nebErr(server));
             return false;
@@ -1097,7 +1106,7 @@
 setMaskedToNAN(streakFiles *sfiles, psU32 maskMask, bool printCounts)
 {
-        int maskedPixels = 0;
-        int nandPixels = 0;
-        int nandWeights = 0;
+        long maskedPixels = 0;
+        long nandPixels = 0;
+        long nandWeights = 0;
 
         psImage *image = sfiles->outImage->image;
@@ -1117,12 +1126,12 @@
                 // these gets are not necessary, we could just set the pixels to nan
                 // but I want to get the counts
-                double imageVal  = psImageGet(image, x, y);
+                double imageVal  = image->data.F32[y][x];
                 psU32 maskVal;
                 if (sfiles->stage == IPP_STAGE_RAW) {
-                    int xChip, yChip;
+                    unsigned int xChip, yChip;
                     cellToChipInt(&xChip, &yChip, sfiles->astrom, x, y);
-                    maskVal = psImageGet(mask, xChip, yChip);
+                    maskVal = mask->data.PS_TYPE_IMAGE_MASK_DATA[yChip][xChip];
                 } else {
-                    maskVal = psImageGet(mask, x, y);
+                    maskVal = mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x];
                 }
                 if (maskVal & maskMask) {
@@ -1130,11 +1139,11 @@
                     if (!isExciseValue(imageVal, sfiles->inImage->exciseValue)) {
                         ++nandPixels;
-                        psImageSet(image, x, y, exciseValue);
+                        image->data.F32[y][x] = exciseValue;
                     }
                     if (weight) {
-                        double weightVal = weight ? psImageGet(weight, x, y) : 0;
+                        double weightVal = weight ? weight->data.F32[y][x] : 0;
                         if (!isnan(weightVal)) {
                             ++nandWeights;
-                            psImageSet(weight, x, y, NAN);
+                            weight->data.F32[y][x] = NAN;
                         }
                     }
@@ -1144,5 +1153,5 @@
         if (printCounts) {
             psLogMsg(sfiles->program_name, PS_LOG_INFO, "time to NAN mask pixels: %f\n", psTimerClear("NAN_MASKED"));
-            int totalPixels = image->numRows * image->numCols;
+            long totalPixels = image->numRows * image->numCols;
             psLogMsg(sfiles->program_name, PS_LOG_INFO, "pixels:        %10ld\n", totalPixels);
             psLogMsg(sfiles->program_name, PS_LOG_INFO, "masked pixels: %10ld %4.2f%%\n", maskedPixels, 100. * maskedPixels / totalPixels);
@@ -1215,13 +1224,10 @@
         if (SFILE_IS_IMAGE(in)) {
             // Turn off compression (code adapted from pmFPAWrite)
-#ifdef SAVE_AND_RESTORE_COMPRESSION
             int bitpix = out->fits->options ? out->fits->options->bitpix : 0; // Desired bits per pixel
             psFitsCompression *compress = psFitsCompressionGet(out->fits); // Current compression options
-#endif
             if (!psFitsSetCompression(out->fits, PS_FITS_COMPRESS_NONE, NULL, 0, 0, 0)) {
                 psError(PM_ERR_UNKNOWN, false, "failed to turn off compression for extension %d\n", extnum);
                 streaksExit("", PS_EXIT_UNKNOWN_ERROR);
             }
-#ifdef SAVE_AND_RESTORE_COMPRESSION
             if (out->fits->options) {
                 out->fits->options->bitpix = 0;
@@ -1238,5 +1244,4 @@
                 streaksExit("", PS_EXIT_UNKNOWN_ERROR);
             }
-#endif
         } else {
             copyTable(out, in, extnum);
Index: /branches/eam_branches/20090715/magic/remove/src/streaksrelease.c
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/streaksrelease.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/streaksrelease.c	(revision 25406)
@@ -3,8 +3,4 @@
 static pmConfig *parseArguments(int argc, char **argv);
 static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll);
-static StreakPixels * getStreakPixels(streakFiles *sfiles, Streaks *streaks);
-static void exciseNonWarpedPixels(streakFiles *sfiles, double newMaskValue);
-static bool warpedPixel(streakFiles *sfiles, PixelPos *cellCoord);
-static void excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, double newMaskValue);
 static void writeImages(streakFiles *sf, bool exciseImageCube);
 
@@ -12,6 +8,4 @@
 main(int argc, char *argv[])
 {
-    bool status;
-
     psLibInit(NULL);
     psTimerStart("STREAKSREMOVE");
@@ -25,5 +19,5 @@
     // Values to set for masked pixels
     psU32 maskStreak = 0;           // for the image and weight (usually NAN, MAXINT for integer images)
-    psU32 maskMask = 0;             // value looked up for MASK.STREAK 
+    psU32 maskMask = 0;             // value looked up for MASK.STREAK
 
     // Does true work here?
@@ -216,5 +210,5 @@
         // image data directly from psFits
         readImage(sf->inImage, sf->extnum, sf->stage, false);
-        
+
         // astrom struct is only needed for raw stage, and only the chip to cell parameters are used
         sf->astrom = streakSetAstrometry(sf->astrom, sf->stage, NULL, NULL, false,
@@ -304,5 +298,5 @@
             initValue = NAN;
         } else {
-            // otherwise write it to the output 
+            // otherwise write it to the output
             writeImageCube(sf->outImage, sf->inImage->imagecube, extname, sf->extnum);
             initValue = 0;
Index: /branches/eam_branches/20090715/magic/remove/src/streaksremove.c
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/streaksremove.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/streaksremove.c	(revision 25406)
@@ -12,10 +12,11 @@
 static pmConfig *parseArguments(int argc, char **argv);
 static bool readAndCopyToOutput(streakFiles *sf, bool exciseAll);
-static void exciseNonWarpedPixels(streakFiles *sfiles, double newMaskValue);
+static void exciseNonWarpedPixels(streakFiles *sfiles, psImageMaskType newMaskValue);
 static bool warpedPixel(streakFiles *sfiles, int x, int y);
-static void excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, double newMaskValue);
+static void excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, psImageMaskType newMaskValue);
 static void writeImages(streakFiles *sf, bool exciseImageCube);
 static void updateAstrometry(streakFiles *sfiles);
-static void censorSources(streakFiles *sfiles, psU32 maskStreak);
+static void censorSources(streakFiles *sfiles, psImageMaskType maskStreak);
+static long censorPixels(streakFiles *sfiles, psImage * pixels, bool checkNonWarpedPixels, psU16 maskStreak);
 
 int
@@ -35,5 +36,5 @@
     // Values to set for masked pixels
     psU32 maskStreak = 0;           // for the image and weight (usually NAN, MAXINT for integer images)
-    psU32 maskMask = 0;             // value looked up for MASK.STREAK 
+    psU32 maskMask = 0;             // value looked up for MASK.STREAK
 
     psString streaksFileName = psMetadataLookupStr(NULL, config->arguments, "STREAKS");
@@ -42,5 +43,5 @@
     Streaks *streaks = readStreaksFile(streaksFileName);
     if (!streaks) {
-        psError(PS_ERR_UNKNOWN, "failed to read streaks file: %s", streaksFileName);
+        psError(PS_ERR_UNKNOWN, false, "failed to read streaks file: %s", streaksFileName);
         streaksExit("", PS_EXIT_PROG_ERROR);
     }
@@ -83,5 +84,5 @@
         psLogMsg("streaksremove", PS_LOG_INFO, "time to compute warped pixels: %f\n", cwp_t);
     }
-    
+
     if (sfiles->stage == IPP_STAGE_RAW) {
         // Except for raw stage, all of our (GPC1) files have one image extension.
@@ -97,6 +98,6 @@
     }
 
-    int totalPixels = 0;
-    int totalStreakPixels = 0;
+    long totalPixels = 0;
+    long totalStreakPixels = 0;
 
     // Iterate through each component of the input (except for raw images there is only one)
@@ -132,5 +133,5 @@
                                                         sfiles->inImage->numRows);
             psLogMsg("streaksremove", PS_LOG_INFO, "time to get streak pixels: %f\n", psTimerClear("GET_STREAK_PIXELS"));
-            
+
             // if this extension contained an image, excise the streaked pixels.
             // otherwise it contained an image cube (video cell) which is handled in the if block
@@ -146,22 +147,7 @@
                 }
 
-
                 psTimerStart("REMOVE_STREAKS");
 
-                for (int y=0 ; y < sfiles->inImage->numRows; y++) {
-                    for (int x = 0; x < sfiles->inImage->numCols; x++) {
-                        if (psImageGet(pixels, x, y)) {
-                            ++totalStreakPixels;
-                            if (!checkNonWarpedPixels || warpedPixel(sfiles, x, y)) {
-
-                                excisePixel(sfiles, x, y, true, maskStreak);
-
-                            } else {
-                                // This pixel was not included in any warp and has thus already excised
-                                // by exciseNonWarpedPixels
-                            }
-                        }
-                    }
-                }
+                totalStreakPixels += censorPixels(sfiles, pixels, checkNonWarpedPixels, maskStreak);
 
                 psLogMsg("streaksremove", PS_LOG_INFO, "time to remove streak pixels: %f\n", psTimerClear("REMOVE_STREAKS"));
@@ -172,5 +158,5 @@
                 }
 
-            } else { 
+            } else {
                 // this component contains an image cube
                 // For now excise it completely
@@ -215,7 +201,6 @@
 
     if (!replicateOutputs(sfiles)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to replicate output files");
+        psErrorStackPrint(stderr, "failed to replicate output files");
         deleteTemps(sfiles);
-        psErrorStackPrint(stderr, "");
         exit(PS_EXIT_UNKNOWN_ERROR);
     }
@@ -247,5 +232,5 @@
     pmConceptsDone();
     pmModelClassCleanup();
-    streaksNebulousCleanup(); 
+    streaksNebulousCleanup();
     pmConfigDone();
     psLogMsg("streaksremove", PS_LOG_INFO, "time to run streaksremove: %f\n", psTimerClear("STREAKSREMOVE"));
@@ -255,4 +240,27 @@
 
     return 0;
+}
+
+static long
+censorPixels(streakFiles *sfiles, psImage *pixels, bool checkNonWarpedPixels, psU16 maskStreak)
+{
+    long streakPixels = 0;
+
+    for (int y=0 ; y < sfiles->inImage->numRows; y++) {
+        for (int x = 0; x < sfiles->inImage->numCols; x++) {
+            if (psImageGet(pixels, x, y)) {
+                ++streakPixels;
+                if (!checkNonWarpedPixels || warpedPixel(sfiles, x, y)) {
+
+                    excisePixel(sfiles, x, y, true, maskStreak);
+
+                } else {
+                    // This pixel was not included in any warp and has thus already excised
+                    // by exciseNonWarpedPixels
+                }
+            }
+        }
+    }
+    return streakPixels;
 }
 
@@ -356,5 +364,5 @@
             true);
     }
-    
+
     if ((argnum = psArgumentGet(argc, argv, "-keepnonwarped"))) {
         psArgumentRemove(argnum, &argc, argv);
@@ -374,5 +382,5 @@
         psArgumentRemove(argnum, &argc, argv);
     }
-        
+
     // if skycells are not provided then we have to execise all pixels  unless -keepnonwarped
     pmConfigFileSetsMD(config->arguments, &argc, argv, "SKYCELLS", "-skycell", "-skycelllist");
@@ -628,5 +636,5 @@
             initValue = NAN;
         } else {
-            // otherwise write it to the output 
+            // otherwise write it to the output
             writeImageCube(sf->outImage, sf->inImage->imagecube, extname, sf->extnum);
             initValue = 0;
@@ -666,5 +674,5 @@
 
 static void
-excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, double newMaskValue)
+excisePixel(streakFiles *sfiles, unsigned int x, unsigned int y, bool streak, psImageMaskType newMaskValue)
 {
     double exciseValue = sfiles->inImage->exciseValue;
@@ -675,17 +683,17 @@
     }
 
-    double imageValue  = psImageGet (sfiles->inImage->image,  x, y);
+    float imageValue  = sfiles->inImage->image->data.F32[y][x];
     if (sfiles->recImage && !isExciseValue(imageValue, sfiles->inImage->exciseValue) ) {
-        psImageSet (sfiles->recImage->image,  x, y, imageValue);
+        sfiles->recImage->image->data.F32[y][x] = imageValue;
     }
 
     if (sfiles->transparentStreaks == 0) {
-        psImageSet (sfiles->outImage->image,  x, y, exciseValue);
+        sfiles->outImage->image->data.F32[y][x] = exciseValue;
     } else {
         if (streak) {
             // as a visualization aid don't mask the pixel, just change the intensity
-            psImageSet (sfiles->outImage->image,  x, y, imageValue + sfiles->transparentStreaks);
+            sfiles->outImage->image->data.F32[y][x] = imageValue + sfiles->transparentStreaks;
         } else {
-            psImageSet (sfiles->outImage->image,  x, y, exciseValue);
+            sfiles->outImage->image->data.F32[y][x] = exciseValue;
         }
     }
@@ -693,21 +701,21 @@
     if (sfiles->outWeight) {
         if (sfiles->recWeight) {
-            double weightValue = psImageGet (sfiles->inWeight->image, x, y);
-            psImageSet (sfiles->recWeight->image, x, y, weightValue);
+            sfiles->recWeight->image->data.F32[y][x] = sfiles->inWeight->image->data.F32[y][x];
         }
         // Assume that weight images are always a floating point type
-        psImageSet (sfiles->outWeight->image, x, y, NAN);
+        sfiles->outWeight->image->data.F32[y][x] = NAN;
     }
     if (sfiles->outMask) {
         if (sfiles->recMask) {
-            double maskValue   = psImageGet (sfiles->inMask->image,   x, y);
-            psImageSet (sfiles->recMask->image,   x, y, maskValue);
-        }
-        psImageSet (sfiles->outMask->image,   x, y, newMaskValue);
+            sfiles->recMask->image->data.PS_TYPE_IMAGE_MASK_DATA[y][x] =
+                sfiles->inMask->image->data.PS_TYPE_IMAGE_MASK_DATA[y][x];
+        }
+        sfiles->outMask->image->data.PS_TYPE_IMAGE_MASK_DATA[y][x] =
+            sfiles->inMask->image->data.PS_TYPE_IMAGE_MASK_DATA[y][x] | newMaskValue;
     }
 }
 
 static void
-exciseNonWarpedPixels(streakFiles *sfiles, double newMaskValue)
+exciseNonWarpedPixels(streakFiles *sfiles, psImageMaskType newMaskValue)
 {
     int cell_x0 = sfiles->astrom->cell_x0;
@@ -785,5 +793,5 @@
 // streak mask
 static void
-censorSources(streakFiles *sfiles, psU32 maskStreak)
+censorSources(streakFiles *sfiles, psImageMaskType maskStreak)
 {
     if ((!sfiles->inSources) || (!sfiles->outMask)) {
@@ -799,63 +807,98 @@
     sFile *out = sfiles->outSources;
 
-    in->header = psFitsReadHeader(NULL, in->fits);
-    if (!in->header) {
-        psError(PS_ERR_IO, false, "failed to read header from %s", in->resolved_name);
+
+    // Primary header, should be "something.hdr"
+    {
+        psMetadata *header = psFitsReadHeader(NULL, in->fits);
+        if (!header) {
+            psError(PS_ERR_IO, false, "failed to read header from %s", in->resolved_name);
+            streaksExit("", PS_EXIT_DATA_ERROR);
+        }
+
+        bool status;
+        psString extname = psMetadataLookupStr(&status, header, "EXTNAME");
+        if (!extname) {
+            psError(PS_ERR_IO, false, "failed to find extname in header of %s", in->resolved_name);
+            streaksExit("", PS_EXIT_DATA_ERROR);
+        }
+        addDestreakKeyword(header);
+
+        if (!psFitsWriteBlank(out->fits, header, extname)) {
+            psError(PS_ERR_IO, false, "failed to write blank in header of %s", in->resolved_name);
+            streaksExit("", PS_EXIT_DATA_ERROR);
+        }
+        psFree(header);
+    }
+
+    // Extension with PSF fits, should be "something.psf"
+    {
+        if (!psFitsMoveExtNum(in->fits, 1, true)) {
+            psErrorStackPrint(stderr, "failed to read header from %s", in->resolved_name);
+            streaksExit("", PS_EXIT_DATA_ERROR);
+        }
+
+        psMetadata *header = psFitsReadHeader(NULL, in->fits);
+        if (!header) {
+            psErrorStackPrint(stderr, "failed to read header from %s", in->resolved_name);
+            streaksExit("", PS_EXIT_DATA_ERROR);
+        }
+        psString extname = psMetadataLookupStr(NULL, header, "EXTNAME");
+        if (!extname) {
+            psError(PS_ERR_IO, false, "failed to find extname in header of %s", in->resolved_name);
+            streaksExit("", PS_EXIT_DATA_ERROR);
+        }
+
+        psArray *inTable = psFitsReadTable(in->fits);
+        if (!inTable->n) {
+            psErrorStackPrint(stderr, "table in %s is empty", in->resolved_name);
+            streaksExit("", PS_EXIT_DATA_ERROR);
+        }
+
+        psArray *outTable = psArrayAllocEmpty(inTable->n);
+        int j = 0;
+        int numCensored = 0;
+        for (int i = 0 ; i < inTable->n; i++) {
+            psMetadata *row = inTable->data[i];
+
+            psF32 x = psMetadataLookupF32(NULL, row, "X_PSF");
+            psF32 y = psMetadataLookupF32(NULL, row, "Y_PSF");
+
+            psImageMaskType mask = maskImage->data.PS_TYPE_IMAGE_MASK_DATA[(int)y][(int)x];
+
+            // Key the source if the center pixel is not masked with maskStreak
+            if (!(mask & maskStreak) ) {
+                psArraySet(outTable, j++, row);
+            } else {
+                numCensored++;
+            }
+        }
+
+        // get rid of unused elements (don't know if this is necessary)
+        psArrayRealloc(outTable, j);
+
+        addDestreakKeyword(header);
+        if (psArrayLength(outTable) > 0) {
+            printf("Censored %d sources\n", numCensored);
+            if (! psFitsWriteTable(out->fits, header, outTable, extname)) {
+                psErrorStackPrint(stderr, "failed to write table to %s", out->resolved_name);
+                streaksExit("", PS_EXIT_DATA_ERROR);
+            }
+        } else {
+            printf("Censored ALL %d sources\n", numCensored);
+            if (! psFitsWriteTableEmpty(out->fits, header, inTable->data[0], extname)) {
+                psErrorStackPrint(stderr, "failed to write empty table to %s", out->resolved_name);
+                streaksExit("", PS_EXIT_DATA_ERROR);
+            }
+        }
+        psFree(header);
+        psFree(outTable);
+        psFree(inTable);
+    }
+
+    // XXX Will need to update to handle extension with extended sources, etc.
+
+    if (!psFitsClose(out->fits)) {
+        psErrorStackPrint(stderr, "failed to close table %s", out->resolved_name);
         streaksExit("", PS_EXIT_DATA_ERROR);
     }
-
-    bool status;
-    psString extname = psMetadataLookupStr(&status, in->header, "EXTNAME");
-    if (!extname) {
-        psError(PS_ERR_IO, false, "failed to find extname in header of %s", in->resolved_name);
-        streaksExit("", PS_EXIT_DATA_ERROR);
-    }
-
-    psArray *inTable = psFitsReadTable(in->fits);
-    if (!inTable->n) {
-        psError(PS_ERR_IO, false, "table in %s is empty", in->resolved_name);
-        streaksExit("", PS_EXIT_DATA_ERROR);
-    }
-
-    psArray *outTable = psArrayAllocEmpty(inTable->n);
-    int j = 0;
-    int numCensored = 0;
-    for (int i = 0 ; i < inTable->n; i++) {
-        psMetadata *row = inTable->data[i];
-
-        psF32 x = psMetadataLookupF32 (&status, row, "X_PSF");
-        psF32 y = psMetadataLookupF32 (&status, row, "Y_PSF");
-        
-        psU32 mask = psImageGet(maskImage, x, y);
-
-        // Key the source if the center pixel is not masked with maskStreak
-        if (! (mask & maskStreak) ) {
-            psArraySet(outTable, j++, row);
-        } else {
-            numCensored++;
-        }
-    }
-
-    // get rid of unused elements (don't know if this is necessary)
-    psArrayRealloc(outTable, j);
-
-    addDestreakKeyword(in->header);
-    if (psArrayLength(outTable) > 0) {
-        printf("Censored %d sources\n", numCensored);
-        if (! psFitsWriteTable(out->fits, in->header, outTable, extname)) {
-            psError(PS_ERR_IO, false, "failed to write table to %s", out->resolved_name);
-            streaksExit("", PS_EXIT_DATA_ERROR);
-        }
-    } else {
-        printf("Censored ALL %d sources\n", numCensored);
-        if (! psFitsWriteTableEmpty(out->fits, in->header, inTable->data[0], extname)) {
-            psError(PS_ERR_IO, false, "failed to write empty table to %s", out->resolved_name);
-            streaksExit("", PS_EXIT_DATA_ERROR);
-        }
-    }
-
-    if (!psFitsClose(out->fits)) {
-        psError(PS_ERR_IO, false, "failed to close table %s", out->resolved_name);
-        streaksExit("", PS_EXIT_DATA_ERROR);
-    }
-}
+}
Index: /branches/eam_branches/20090715/magic/remove/src/streaksremove.h
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/streaksremove.h	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/streaksremove.h	(revision 25406)
@@ -84,5 +84,5 @@
 // can't declare this in streaksastrom due to header file ordering
 extern void cellToChip(double *xChip, double *yChip, strkAstrom *astrom, double xCell, double yCell);
-extern void cellToChipInt(int *xChip, int *yChip, strkAstrom *astrom, int xCell, int yCell);
+extern void cellToChipInt(unsigned int *xChip, unsigned int *yChip, strkAstrom *astrom, int xCell, int yCell);
 
 extern bool computeWarpedPixels(streakFiles *sf);
Index: /branches/eam_branches/20090715/magic/remove/src/streaksreplace.c
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/streaksreplace.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/streaksreplace.c	(revision 25406)
@@ -8,8 +8,5 @@
 int main(int argc, char *argv[])
 {
-    long i;
     bool status;
-    StreakPixels *pixels;
-    PixelPos *pixelPos;
 
     psLibInit(NULL);
@@ -92,6 +89,5 @@
 
     if (!replicateOutputs(sfiles)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to replicate output files");
-        psErrorStackPrint(stderr, "");
+        psErrorStackPrint(stderr, "failed to replicate output files");
         exit(PS_EXIT_UNKNOWN_ERROR);
     }
@@ -172,5 +168,5 @@
             true);
     }
-    
+
     bool gotMask = false;
     if ((argnum = psArgumentGet(argc, argv, "-mask"))) {
@@ -353,5 +349,5 @@
         // we have an image cube
         double initValue;
-        // otherwise write it to the output 
+        // otherwise write it to the output
         writeImageCube(sf->outImage, sf->recImage->imagecube, extname, sf->extnum);
 
Index: /branches/eam_branches/20090715/magic/remove/src/streaksutil.c
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/streaksutil.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/streaksutil.c	(revision 25406)
@@ -44,5 +44,5 @@
 // we just bail out
 void streaksExit(psString str, int exitCode) {
-    psErrorStackPrint(stderr, str);
+    psErrorStackPrint(stderr, "%s", str);
     if (ourStreakFiles) {
         deleteTemps(ourStreakFiles);
Index: /branches/eam_branches/20090715/magic/remove/src/warpedpixels.c
===================================================================
--- /branches/eam_branches/20090715/magic/remove/src/warpedpixels.c	(revision 25405)
+++ /branches/eam_branches/20090715/magic/remove/src/warpedpixels.c	(revision 25406)
@@ -23,5 +23,5 @@
 
     psRegion     *bounds = pmChipPixels(sf->chip);
-    
+
     int width  = bounds->x1 - bounds->x0;
     int height = bounds->y1 - bounds->y0;
@@ -83,5 +83,5 @@
 
     /* now set up our wrapper to the chip astrometry to apply to the whole chip */
-    sf->astrom = streakSetAstrometry(sf->astrom, sf->stage, sf->inAstrom->fpa, sf->chip, false, NULL, 
+    sf->astrom = streakSetAstrometry(sf->astrom, sf->stage, sf->inAstrom->fpa, sf->chip, false, NULL,
         sf->warpedPixels->numCols, sf->warpedPixels->numRows);
 
@@ -106,5 +106,5 @@
         // convert corner of skycell to sky coordinates
         if (!pmAstromWCStoSky(&sky, wcs, &pt[i])) {
-            psError(PS_ERR_IO, false, "failed to convert pt %d of %s to sky coords: %s", fileName);
+            psErrorStackPrint(stderr, "failed to convert pt %d of %s to sky coords", i, fileName);
             streaksExit("", PS_EXIT_DATA_ERROR);
         }
@@ -112,5 +112,5 @@
         // convert to chip coordinates
         if (!skyToCell(&p, sf->astrom, sky.r, sky.d)) {
-            psError(PS_ERR_IO, false, "failed to convert pt %d of %s to sky coords: %s", fileName);
+            psErrorStackPrint(stderr, "failed to convert pt %d of %s to sky coords", i, fileName);
             streaksExit("", PS_EXIT_DATA_ERROR);
         }
@@ -171,5 +171,5 @@
 }
 
-// x as a function of y for the line between two points 
+// x as a function of y for the line between two points
 // Note: the caller guarentees that the y's of the two points are different
 static double xOfY(psPlane *pI, psPlane *pJ, int y)
@@ -212,5 +212,5 @@
  * To compute the overlap of a quadrilateral with a set of
  * points we transform the 4 corners to image coordinates
- * and name the 4 points of the quad 
+ * and name the 4 points of the quad
             pt 0 is left most (bottom most corner)
             pt 1 is bottom most (right most corner)
@@ -238,5 +238,5 @@
 
                 3
-                 C       
+                 C
          ---------------2           left boundary:  line 0_1 y < pt0.y
                  B                                  line 0_3 y >= pt0.y
@@ -249,5 +249,5 @@
               C
         0----------------
-              B     
+              B
       ----------------2
               A
@@ -258,5 +258,5 @@
 
         3       2
-            
+
             B
 
@@ -265,8 +265,8 @@
 (region A and C are empty in the case where the points form a rectangle)
 */
-            
+
 /*
     Name the corners
-    The following algorithm works for points that form a quadrilateral 
+    The following algorithm works for points that form a quadrilateral
     I think it also works for the situation where 3 points are co-linear
     and we have a triangle, but that isn't important for our purposes
@@ -313,5 +313,5 @@
         pt[i] = pt[i+1];
     }
-            
+
     // now find the right most (top most) of the remaining 2 points
     if ((pt[0].x > pt[1].x) ||
Index: /branches/eam_branches/20090715/ppImage/src/Makefile.am
===================================================================
--- /branches/eam_branches/20090715/ppImage/src/Makefile.am	(revision 25405)
+++ /branches/eam_branches/20090715/ppImage/src/Makefile.am	(revision 25406)
@@ -54,4 +54,5 @@
 	ppImageDefineFile.c \
 	ppImageSetMaskBits.c \
+	ppImageBurntoolMask.c \
 	ppImageParityFlip.c \
 	ppImageCheckCTE.c \
Index: /branches/eam_branches/20090715/ppImage/src/ppImage.h
===================================================================
--- /branches/eam_branches/20090715/ppImage/src/ppImage.h	(revision 25405)
+++ /branches/eam_branches/20090715/ppImage/src/ppImage.h	(revision 25406)
@@ -26,4 +26,5 @@
     bool doMaskBuild;                   // Build internal mask
     bool doVarianceBuild;               // Build internal variance map
+    bool doMaskBurntool;                // mask potential burntool trails
     bool doMaskSat;                     // mask saturated pixels
     bool doMaskLow;                     // mask low pixels
@@ -74,5 +75,5 @@
     psImageMaskType darkMask;           // Mask value to give bad dark pixels
     psImageMaskType blankMask;          // Mask value to give blank pixels
-
+    psImageMaskType burntoolMask;       // Suspect pixels that fall where a burntool trail is expected.
     // non-linear correction parameters
     psDataType nonLinearType;
@@ -82,5 +83,5 @@
     // options for the analysis
     pmOverscanOptions *overscan;        // Overscan options
-
+    int burntoolTrails;
     // binning parameters
     int xBin1;                          // x-binning, scale 1
@@ -156,4 +157,6 @@
 bool ppImageCheckCTE(pmConfig *config, ppImageOptions *options, pmFPAview *view);
 
+bool ppImageBurntoolMask(pmConfig *config, ppImageOptions *options, pmFPAview *view, pmReadout *mask);
+
 // Record which detrend file was used for the detrending
 bool ppImageDetrendRecord(
Index: /branches/eam_branches/20090715/ppImage/src/ppImageBurntoolMask.c
===================================================================
--- /branches/eam_branches/20090715/ppImage/src/ppImageBurntoolMask.c	(revision 25406)
+++ /branches/eam_branches/20090715/ppImage/src/ppImageBurntoolMask.c	(revision 25406)
@@ -0,0 +1,100 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/* #define PPIMAGE_BURNTOOL_DEBUG 1 */
+
+#include "ppImage.h"
+
+bool ppImageBurntoolMask (pmConfig *config, ppImageOptions *options, pmFPAview *view,pmReadout *mask) {
+  bool status = true;
+  int burntool_cell;
+  /* Find input filename */
+  pmFPAfile *inputFile = psMetadataLookupPtr(&status , config->files, "PPIMAGE.INPUT");
+  if (!status) {
+    psError(PS_ERR_IO,false, "Unable to identify inputFile");
+    return(false);
+  }
+  psFits *fits = inputFile->fits;
+
+  /* Read input header, and find the burntool data table. */
+  if (!psFitsMoveExtName(fits,"burntool_areas")) {
+    psError(PS_ERR_IO,false, "Unable to find extension burntool_areas");
+    return(false);
+  }
+  long Nrows = psFitsTableSize(fits);  
+
+  long row = 0;
+
+  psLogMsg ("ppImageBurntoolMask", 4, "Inside burntool mask %ld", Nrows);
+
+  /* Redirects and Memory juggling. */
+  view->readout = 0;
+  psImage *image = mask->mask;
+
+  
+  /* Set the maskValue from the recipes. */
+  psImageMaskType maskValue = options->burntoolMask;
+#ifdef PPIMAGE_BURNTOOL_DEBUG
+  psLogMsg("ppImageBurntoolMask", 4, "Status: %ld %d\n",Nrows,maskValue);
+#endif
+
+  burntool_cell = view->cell;
+  burntool_cell = (view->cell % 8) * 8 + (view->cell - (view->cell % 8)) / 8;
+  psLogMsg("ppImageBurntoolMask", 4, "Cell mapping: %d %d %d\n",view->cell,burntool_cell,-1);
+  for (row = 0; row < Nrows; row++) {
+    psMetadata *rowMD = psFitsReadTableRow(fits,row);
+
+    if (psMetadataLookupS32(&status,rowMD,"cell") == burntool_cell) {
+      if (((options->burntoolTrails & 0x01)&&(psMetadataLookupS32(&status,rowMD,"nfit") == 0))||
+	  ((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1))||
+	  ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0))) {
+	/*       If the fit fails, burntool reports zero here.  This
+		 signifies that it expected to see a trail (else why
+		 fit) but did not find it when it attempted to
+		 correct. */
+#ifdef PPIMAGE_BURNTOOL_DEBUG
+	psLogMsg ("ppImageBurntoolMask", 4, "Masking! %d (%d %d %d) %d %d",
+		  psMetadataLookupS32(&status,rowMD,"cell"),
+		  ((options->burntoolTrails & 0x0001)&&(psMetadataLookupS32(&status,rowMD,"nfit") == 0)),
+		  ((options->burntoolTrails & 0x02)&&(psMetadataLookupS32(&status,rowMD,"up") == 1)),
+		  ((options->burntoolTrails & 0x04)&&(psMetadataLookupS32(&status,rowMD,"up") == 0)),
+		  options->burntoolTrails,
+		  maskValue
+		  );
+#endif
+	for (int i = psMetadataLookupS32(&status,rowMD,"sxfit");
+	     i <= psMetadataLookupS32(&status,rowMD,"exfit");
+	     i++) {
+
+	  if (psMetadataLookupS32(&status,rowMD,"up") == 0) {
+	    for (int j = 0; j <= psMetadataLookupS32(&status,rowMD,"y1p"); j++) {
+/* #ifdef PPIMAGE_BURNTOOL_DEBUG */
+/* 	      psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n", */
+/* 		       i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue); */
+/* #endif */
+	      image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
+	    }
+	  }
+	  else {
+	    for (int j = psMetadataLookupS32(&status,rowMD,"y1m"); j < image->numRows ; j++) {
+/* #ifdef PPIMAGE_BURNTOOL_DEBUG */
+/* 	      psLogMsg("ppImageBurntoolMask", 4, "Noisy!: %d %d %d %d\n", */
+/* 		       i,j,image->data.PS_TYPE_IMAGE_MASK_DATA[j][i],maskValue); */
+/* #endif */
+	      image->data.PS_TYPE_IMAGE_MASK_DATA[j][i] |= maskValue;
+	    }
+	  }
+	}
+
+      }
+    }
+    psFree(rowMD);
+  }
+
+  return(status);
+}
+	    
+
+
+    
Index: /branches/eam_branches/20090715/ppImage/src/ppImageDetrendReadout.c
===================================================================
--- /branches/eam_branches/20090715/ppImage/src/ppImageDetrendReadout.c	(revision 25405)
+++ /branches/eam_branches/20090715/ppImage/src/ppImageDetrendReadout.c	(revision 25406)
@@ -26,4 +26,8 @@
         pmMaskBadPixels(input, mask, options->maskValue);
     }
+    if (options->doMaskBurntool) {
+      ppImageBurntoolMask(config,options,view,input);
+    }
+
 
 # if 0
Index: /branches/eam_branches/20090715/ppImage/src/ppImageOptions.c
===================================================================
--- /branches/eam_branches/20090715/ppImage/src/ppImageOptions.c	(revision 25405)
+++ /branches/eam_branches/20090715/ppImage/src/ppImageOptions.c	(revision 25406)
@@ -21,4 +21,5 @@
     options->doMaskSat       = false;   // mask saturated pixels
     options->doMaskLow       = false;   // mask low pixels
+    options->doMaskBurntool  = false;   // mask potential burntool trails
     options->doVarianceBuild = false;   // Build internal variance
     options->doMask          = false;   // Mask bad pixels
@@ -64,5 +65,6 @@
     options->blankMask       = 0x00;    // Blank (no data, cell gap) pixels (supplied to pmChipMosaic, pmFPAMosaic)
     options->markValue       = 0x00;    // A safe bit for internal marking
-
+    options->burntoolMask    = 0x00;    // Suspect pixels that fall where a burntool trail is expected.
+    options->burntoolTrails  = 0x07;    // Which types of burntool areas to mask.
     // crosstalk options
     options->doCrosstalkMeasure = false;   // measure crosstalk
@@ -219,4 +221,5 @@
     options->doMaskSat   = psMetadataLookupBool(NULL, recipe, "MASK.SATURATED");
     options->doMaskLow   = psMetadataLookupBool(NULL, recipe, "MASK.LOW");
+    options->doMaskBurntool = psMetadataLookupBool(NULL, recipe, "MASK.BURNTOOL");
     options->doVarianceBuild = psMetadataLookupBool(NULL, recipe, "VARIANCE.BUILD");
 
@@ -245,13 +248,20 @@
     options->applyParity = psMetadataLookupBool(NULL, recipe, "APPLY.CELL.PARITY");
 
+    options->burntoolTrails = psMetadataLookupS32(&status, recipe, "BURNTOOL.TRAILS");
+    fprintf(stderr,"TRAILS: %d %d %d\n",options->burntoolTrails,psMetadataLookupS32(&status,recipe,"BURNTOOL.TRAILS"),status);
+    if (!status) {
+      psWarning("BURNTOOL.TRAILS not found in recipe: setting to default value.\n");
+    }
+    
     // binned image options
     options->xBin1 = psMetadataLookupS32(&status, recipe, "BIN1.XBIN");
     if (!status) {
         psWarning("BIN1.XBIN not found in recipe: setting to default value.\n");
+	options->xBin1 = 4;
     }
     options->yBin1 = psMetadataLookupS32(&status, recipe, "BIN1.YBIN");
     if (!status) {
         psWarning("BIN1.YBIN not found in recipe: setting to default value.\n");
-        options->yBin1 = 16;
+        options->yBin1 = 4;
     }
 
Index: /branches/eam_branches/20090715/ppImage/src/ppImageSetMaskBits.c
===================================================================
--- /branches/eam_branches/20090715/ppImage/src/ppImageSetMaskBits.c	(revision 25405)
+++ /branches/eam_branches/20090715/ppImage/src/ppImageSetMaskBits.c	(revision 25406)
@@ -38,4 +38,8 @@
     psAssert (options->lowMask, "low mask not set");
 
+    // mask for suspect regions due to burntool
+    options->burntoolMask = pmConfigMaskGet("BURNTOOL",config);
+    psAssert (options->burntoolMask, "burntool mask not set");
+    
     // save MASK and MARK on the PSPHOT recipe
     psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE);
Index: /branches/eam_branches/20090715/ppStack/src/ppStackCombineFinal.c
===================================================================
--- /branches/eam_branches/20090715/ppStack/src/ppStackCombineFinal.c	(revision 25405)
+++ /branches/eam_branches/20090715/ppStack/src/ppStackCombineFinal.c	(revision 25406)
@@ -56,14 +56,19 @@
         }
         psKernel *covar = options->covariances->data[i]; // Covariance matrix
+        if (!covar) {
+            continue;
+        }
         float weight = options->weightings->data.F32[i]; // Weight to apply
         psBinaryOp(covar->image, covar->image, "*", psScalarAlloc(weight, PS_TYPE_F32));
         sumWeights += weight;
     }
-    pmReadout *outRO = options->outRO;  // Output readout
-    outRO->covariance = psImageCovarianceSum(options->covariances);
-    psBinaryOp(outRO->covariance->image, outRO->covariance->image, "/",
-               psScalarAlloc(sumWeights, PS_TYPE_F32));
-    psFree(options->covariances); options->covariances = NULL;
-    psImageCovarianceTransfer(outRO->variance, outRO->covariance);
+    if (sumWeights > 0.0) {
+        pmReadout *outRO = options->outRO;  // Output readout
+        outRO->covariance = psImageCovarianceSum(options->covariances);
+        psBinaryOp(outRO->covariance->image, outRO->covariance->image, "/",
+                   psScalarAlloc(sumWeights, PS_TYPE_F32));
+        psFree(options->covariances); options->covariances = NULL;
+        psImageCovarianceTransfer(outRO->variance, outRO->covariance);
+    }
 
 #ifdef TESTING
Index: /branches/eam_branches/20090715/ppStack/src/ppStackMatch.c
===================================================================
--- /branches/eam_branches/20090715/ppStack/src/ppStackMatch.c	(revision 25405)
+++ /branches/eam_branches/20090715/ppStack/src/ppStackMatch.c	(revision 25406)
@@ -14,5 +14,5 @@
 #define FAKE_SIZE 1                     // Size of fake convolution kernel
 #define SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_SATURATED | \
-                     PM_SOURCE_MODE_CR_LIMIT) // Mask to apply to input sources
+                     PM_SOURCE_MODE_CR_LIMIT | PM_SOURCE_MODE_EXT_LIMIT) // Mask to apply to input sources
 #define FAINT_SOURCE_FRAC 1.0e-4         // Set minimum flux to this fraction of faintest source flux
 #define COVAR_FRAC 0.01                 // Truncation fraction for covariance matrix
@@ -87,5 +87,5 @@
     x->n = y->n = numGood;
 
-    psTree *tree = psTreePlant(2, 2, x, y); // kd tree
+    psTree *tree = psTreePlant(2, 2, PS_TREE_EUCLIDEAN, x, y); // kd tree
 
     psArray *filtered = psArrayAllocEmpty(numGood); // Filtered list of sources
@@ -162,4 +162,38 @@
 }
 
+// Renormalise a readout's variance map
+bool stackRenormaliseReadout(const pmConfig *config, // Configuration
+                             pmReadout *readout      // Readout to renormalise
+    )
+{
+    bool mdok; // Status of metadata lookups
+
+    psMetadata *recipe = psMetadataLookupPtr(NULL, config->recipes, PPSTACK_RECIPE); // Recipe for ppStack
+    psAssert(recipe, "Need PPSTACK recipe");
+
+    if (!psMetadataLookupBool(&mdok, recipe, "RENORM")) return true;
+
+    int num = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM");
+    if (!mdok) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "RENORM.NUM is not set in the recipe");
+        return false;
+    }
+    float minValid = psMetadataLookupF32(&mdok, recipe, "RENORM.MIN");
+    if (!mdok) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "RENORM.MIN is not set in the recipe");
+        return false;
+    }
+    float maxValid = psMetadataLookupF32(&mdok, recipe, "RENORM.MAX");
+    if (!mdok) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "RENORM.MAX is not set in the recipe");
+        return false;
+    }
+
+    psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask
+
+    return pmReadoutVarianceRenormalise(readout, maskBad, num, minValid, maxValid);
+}
+
+
 
 bool ppStackMatch(pmReadout *readout, ppStackOptions *options, int index, const pmConfig *config)
@@ -222,18 +256,4 @@
             }
             psFitsClose(fits);
-
-            // Add in variance factor
-            pmSubtractionKernels *kernels = psMetadataLookupPtr(NULL, conv->analysis,
-                                                                PM_SUBTRACTION_ANALYSIS_KERNEL); // Kernels
-            float vf = pmSubtractionVarianceFactor(kernels, 0.0, 0.0, false); // Variance factor
-            psMetadataItem *vfItem = psMetadataLookup(readout->parent->concepts, "CELL.VARFACTOR");
-            if (!isfinite(vf)) {
-                vf = 1.0;
-            }
-            if (isfinite(vfItem->data.F32)) {
-                vfItem->data.F32 *= vf;
-            } else {
-                vfItem->data.F32 = vf;
-            }
 
             if (!readImage(&readout->image, options->imageNames->data[index], config) ||
@@ -302,6 +322,6 @@
 
             if (!pmReadoutFakeFromSources(fake, readout->image->numCols, readout->image->numRows,
-                                          stampSources, NULL, NULL, options->psf, NAN, footprint + size,
-                                          false, true)) {
+                                          stampSources, SOURCE_MASK, NULL, NULL, options->psf,
+                                          NAN, footprint + size, false, true)) {
                 psError(PS_ERR_UNKNOWN, false, "Unable to generate fake image with target PSF.");
                 psFree(fake);
@@ -413,16 +433,4 @@
             }
 
-            // Set the variance factor
-            psMetadataItem *vfItem = psMetadataLookup(readout->parent->concepts, "CELL.VARFACTOR");
-            float vf = psMetadataLookupF32(NULL, conv->analysis, PM_SUBTRACTION_ANALYSIS_VARFACTOR_1);
-            if (!isfinite(vf)) {
-                vf = 1.0;
-            }
-            if (isfinite(vfItem->data.F32)) {
-                vfItem->data.F32 *= vf;
-            } else {
-                vfItem->data.F32 = vf;
-            }
-
             // Replace original images with convolved
             psFree(readout->image);
@@ -512,5 +520,5 @@
         psBinaryOp(readout->variance, readout->variance, "*", psScalarAlloc(PS_SQR(norm), PS_TYPE_F32));
     }
-   
+
     // Ensure the background value is zero
     psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for background
@@ -521,11 +529,16 @@
     } else {
       if (!psMetadataLookupBool(NULL, config->arguments, "PPSTACK.SKIP.BG.SUB")) {
-	psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)",
-		 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV));
-	(void)psBinaryOp(readout->image, readout->image, "-",
-			 psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32));
+        psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)",
+                 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV));
+        (void)psBinaryOp(readout->image, readout->image, "-",
+                         psScalarAlloc(psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32));
       }
     }
-    
+
+    if (!stackRenormaliseReadout(config, readout)) {
+        psFree(rng);
+        psFree(bg);
+        return false;
+    }
 
     // Measure the variance level for the weighting
Index: /branches/eam_branches/20090715/ppStack/src/ppStackSources.c
===================================================================
--- /branches/eam_branches/20090715/ppStack/src/ppStackSources.c	(revision 25405)
+++ /branches/eam_branches/20090715/ppStack/src/ppStackSources.c	(revision 25406)
@@ -123,5 +123,5 @@
         pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout
         pmPSF *psf = psMetadataLookupPtr(NULL, config->arguments, "PSF.TARGET"); // PSF for fake image
-        pmReadoutFakeFromSources(fake, FAKE_COLS, FAKE_ROWS, sourceLists->data[i],
+        pmReadoutFakeFromSources(fake, FAKE_COLS, FAKE_ROWS, sourceLists->data[i], 0,
                                  NULL, NULL, psf, 5, 0, false, true);
         psString name = NULL;
Index: /branches/eam_branches/20090715/ppSub/src/ppSubMatchPSFs.c
===================================================================
--- /branches/eam_branches/20090715/ppSub/src/ppSubMatchPSFs.c	(revision 25405)
+++ /branches/eam_branches/20090715/ppSub/src/ppSubMatchPSFs.c	(revision 25406)
@@ -260,6 +260,10 @@
     pmConceptsCopyFPA(refConv->parent->parent->parent, refRO->parent->parent->parent, true, true);
 
-    psImageCovarianceTransfer(inConv->variance, inConv->covariance);
-    psImageCovarianceTransfer(refConv->variance, refConv->covariance);
+    if (inConv->variance) {
+        psImageCovarianceTransfer(inConv->variance, inConv->covariance);
+    }
+    if (refConv->variance) {
+        psImageCovarianceTransfer(refConv->variance, refConv->covariance);
+    }
 
     return true;
Index: /branches/eam_branches/20090715/ppSub/src/ppSubVarianceRescale.c
===================================================================
--- /branches/eam_branches/20090715/ppSub/src/ppSubVarianceRescale.c	(revision 25405)
+++ /branches/eam_branches/20090715/ppSub/src/ppSubVarianceRescale.c	(revision 25406)
@@ -28,178 +28,30 @@
     bool mdok; // Status of metadata lookups
 
-    psMetadata *ppSubRecipe = psMetadataLookupPtr(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSub
-    psAssert(ppSubRecipe, "Need PPSUB recipe");
+    psMetadata *recipe = psMetadataLookupPtr(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSub
+    psAssert(recipe, "Need PPSUB recipe");
 
-    if (!psMetadataLookupBool(&mdok, ppSubRecipe, "VARIANCE.RESCALE")) return true; 
+    if (!psMetadataLookupBool(&mdok, recipe, "RENORM")) return true;
+
+    int num = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM");
+    if (!mdok) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "RENORM.NUM is not set in the recipe");
+        return false;
+    }
+    float minValid = psMetadataLookupF32(&mdok, recipe, "RENORM.MIN");
+    if (!mdok) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "RENORM.MIN is not set in the recipe");
+        return false;
+    }
+    float maxValid = psMetadataLookupF32(&mdok, recipe, "RENORM.MAX");
+    if (!mdok) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "RENORM.MAX is not set in the recipe");
+        return false;
+    }
 
     psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask
 
     pmFPAview *view = ppSubViewReadout(); // View to readout
-    pmReadout *outRO = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT"); // Output image
+    pmReadout *readout = pmFPAfileThisReadout(config->files, view, "PPSUB.OUTPUT"); // Output image
 
-    psImage *image    = outRO->image;	 // Image of interest
-    psImage *variance = outRO->variance; // Variance image
-    psImage *mask     = outRO->mask;	 // Mask of interest
-
-    psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS);
-
-    psLogMsg("psLib.psImageBackground", PS_LOG_DETAIL, "Generating the signal-to-noise image");
-
-    // generate an image representing the signal/noise:
-    psImage *SN = psImageCopy (NULL, outRO->image, PS_TYPE_F32); 
-
-    int nx = image->numCols; // Size of image
-    int ny = image->numRows; // Size of image
-
-    for (int y = 0; y < ny; y++) {
-        for (int x = 0; x < nx; x++) {
-            if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskBad) {
-                SN->data.F32[y][x] = 0.0;
-		continue;
-            } 
-            if (!isfinite(image->data.F32[y][x])) {
-                SN->data.F32[y][x] = 0.0;
-		continue;
-            } 
-            if (!isfinite(variance->data.F32[y][x]) || (variance->data.F32[y][x] < 0.0)) {
-                SN->data.F32[y][x] = 0.0;
-		continue;
-            } 
-	    SN->data.F32[y][x] = image->data.F32[y][x] / sqrt(variance->data.F32[y][x]);
-        }
-    }
-
-    // these should not be chosen by the user: only a ROBUST version makes sense
-    psStats *stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
-
-    int Nsubset = psMetadataLookupS32(&mdok, ppSubRecipe, "VARIANCE.RESCALE.NSAMPLE");
-    psAssert (mdok, "missing VARIANCE.RESCALE.NSAMPLE in ppSub recipe");
-    
-    const int Npixels = nx*ny; // Total number of pixels
-    Nsubset = PS_MIN(Nsubset, Npixels); // Number of pixels in subset
-    psLogMsg("psLib.psImageBackground", PS_LOG_DETAIL, "Searching for %d pixels in S/N image", Nsubset);
-
-    psVector *values = psVectorAllocEmpty(Nsubset, PS_TYPE_F32); // Vector containing subsample
-
-    // Minimum and maximum values
-    float min = +PS_MAX_F32;
-    float max = -PS_MAX_F32;
-
-    // select a subset of the image pixels to measure the stats
-    long n = 0;                         // Number of actual pixels in subset
-    if (Nsubset >= Npixels) {
-	// if we have an image smaller than Nsubset, just loop over the image pixels
-	for (int iy = 0; iy < ny; iy++) {
-	    for (int ix = 0; ix < nx; ix++) {
-		if (!isfinite(image->data.F32[iy][ix]) || (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] & maskBad)) {
-		    continue;
-		}
-
-		float value = SN->data.F32[iy][ix];
-		min = PS_MIN(value, min);
-		max = PS_MAX(value, max);
-		values->data.F32[n] = value;
-		n++;
-	    }
-	}
-    } else {
-	for (long i = 0; i < Nsubset; i++) {
-	    double frnd = psRandomUniform(rng);
-	    int pixel = Npixels * frnd;
-	    int ix = pixel % nx;
-	    int iy = pixel / nx;
-
-	    if (!isfinite(image->data.F32[iy][ix]) || (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] & maskBad)) {
-		continue;
-	    }
-
-	    float value = SN->data.F32[iy][ix];
-	    min = PS_MIN(value, min);
-	    max = PS_MAX(value, max);
-	    values->data.F32[n] = value;
-	    n++;
-	}
-    }
-    if (n < 0.01*Nsubset) {
-        psLogMsg("psLib.psImageBackground", PS_LOG_DETAIL, "Unable to measure image background: too few data points (%ld)", n);
-        psFree(values);
-        return false;
-    }
-    values->n = n;
-    psFree (SN);
-
-    psLogMsg("psLib.psImageBackground", PS_LOG_DETAIL, "Using for %ld pixels in S/N image", values->n);
-
-    if (!psVectorStats (stats, values, NULL, NULL, 0)) {
-	if (psTraceGetLevel("psLib.imageops") >= 5) {
-	    FILE *f = fopen ("vector.dat", "w");
-	    int fd = fileno(f);
-	    p_psVectorPrint (fd, values, "values");
-	    fclose (f);
-	}
-	psError(PS_ERR_UNKNOWN, false, "Unable to measure statistics for image background "
-		"(%dx%d, (row0,col0) = (%d,%d)",
-		image->numRows, image->numCols, image->row0, image->col0);
-	psFree(values);
-	return false;
-    }
-    if (psTraceGetLevel("psLib.imageops") >= 6) {
-	FILE *f = fopen ("vector.dat", "w");
-	int fd = fileno(f);
-	p_psVectorPrint (fd, values, "values");
-	fclose (f);
-    }
-    psFree (values);
-    psLogMsg ("ppSub", PS_LOG_INFO, "background stdev %f\n", stats->robustStdev);
-
-    float minValid = psMetadataLookupF32(&mdok, ppSubRecipe, "VARIANCE.RESCALE.MIN.VALID");
-    psAssert (mdok, "missing VARIANCE.RESCALE.MIN.VALID in ppSub recipe");
-
-    float maxValid = psMetadataLookupF32(&mdok, ppSubRecipe, "VARIANCE.RESCALE.MAX.VALID");
-    psAssert (mdok, "missing VARIANCE.RESCALE.MAX.VALID in ppSub recipe");
-
-    psLogMsg("psLib.psImageBackground", PS_LOG_DETAIL, "Stdev of S/N image: %f (mean: %f)", stats->robustStdev, stats->robustMedian);
-
-    // valid range of correction; 0.66 to 1.5 (skip if in range 0.98 to 1.02)
-    if ((stats->robustStdev < minValid) || (stats->robustStdev > maxValid)) {
-	psWarning ("background stdev (%f) is out of allowed range; not correcting\n", stats->robustStdev);
-	// XXX set quality to poor
-	psFree (stats);
-	return true;
-    }
-
-    // valid range of correction; 0.66 to 1.5 (skip if in range 0.98 to 1.02)
-    // if ((stats->robustStdev > 0.98) && (stats->robustStdev > 1.02)) {
-    // 	psLogMsg ("ppSub", PS_LOG_INFO, "background stdev (%f) is close to 1.0; do not modify variance\n", stats->robustStdev);
-    // 	// XXX set quality to poor
-    // 	psFree (stats);
-    // 	return true;
-    // }
-
-    float varianceFactor = PS_SQR(stats->robustStdev);
-    psLogMsg ("ppSub", PS_LOG_INFO, "background stdev is not 1.0: multiplying variance by %f\n", varianceFactor);
-    for (int y = 0; y < ny; y++) {
-        for (int x = 0; x < nx; x++) {
-            if (mask && mask->data.PS_TYPE_IMAGE_MASK_DATA[y][x] & maskBad) {
-		continue;
-            } 
-            if (!isfinite(image->data.F32[y][x])) {
-		continue;
-            } 
-            if (!isfinite(variance->data.F32[y][x]) || (variance->data.F32[y][x] < 0.0)) {
-		continue;
-            } 
-	    variance->data.F32[y][x] *= varianceFactor;
-        }
-    }
-
-    pmFPA *outFPA = outRO->parent->parent->parent;
-    pmHDU *outHDU = outFPA->hdu;        // Output HDU
-
-    char history[80];
-    snprintf (history, 80, "Rescaled variance by %6.4f (stdev by %6.4f)", varianceFactor, stats->robustStdev);
-    psMetadataAddStr(outHDU->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history);
-
-    psFree (stats);
-    return true;
+    return pmReadoutVarianceRenormalise(readout, maskBad, num, minValid, maxValid);
 }
Index: /branches/eam_branches/20090715/psastro/src/psastroChipAstrom.c
===================================================================
--- /branches/eam_branches/20090715/psastro/src/psastroChipAstrom.c	(revision 25405)
+++ /branches/eam_branches/20090715/psastro/src/psastroChipAstrom.c	(revision 25406)
@@ -97,5 +97,6 @@
                 // write the elapsed time here; this will be updated in psastroMosaicAstrometry, if called
                 psMetadataAddF32 (updates, PS_LIST_TAIL, "DT_ASTR", PS_META_REPLACE, "elapsed psastro time", psTimerMark ("psastroAnalysis"));
-
+		
+		fpa->wcsCDkeys = psMetadataLookupBool(&status, recipe , "PSASTRO.WCS.USECDKEYS");
                 pmAstromWriteWCS (updates, fpa, chip, NONLIN_TOL);
 
Index: /branches/eam_branches/20090715/psconfig/tagsets/ipp-2.9.libs
===================================================================
--- /branches/eam_branches/20090715/psconfig/tagsets/ipp-2.9.libs	(revision 25405)
+++ /branches/eam_branches/20090715/psconfig/tagsets/ipp-2.9.libs	(revision 25406)
@@ -20,4 +20,5 @@
 
 # Build tools
+bin m4                   NONE           NONE   m4-1.4.13.tar.gz         m4-1.4.13        N NONE NONE NONE
 bin autoconf             NONE           NONE   autoconf-2.63.tar.gz     autoconf-2.63    N NONE NONE NONE
 bin automake             NONE           NONE   automake-1.10.tar.gz     automake-1.10    N NONE NONE NONE
Index: /branches/eam_branches/20090715/pstamp/scripts/Makefile.am
===================================================================
--- /branches/eam_branches/20090715/pstamp/scripts/Makefile.am	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/scripts/Makefile.am	(revision 25406)
@@ -4,4 +4,5 @@
 install_files = \
 	pstamp_finish.pl \
+	pstamp_insert_request.pl \
 	pstamp_job_run.pl \
 	pstamp_listjobs.pl \
Index: /branches/eam_branches/20090715/pstamp/scripts/pstamp_finish.pl
===================================================================
--- /branches/eam_branches/20090715/pstamp/scripts/pstamp_finish.pl	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/scripts/pstamp_finish.pl	(revision 25406)
@@ -8,4 +8,5 @@
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
 use Pod::Usage qw( pod2usage );
+use Carp;
 
 use Time::Local;
@@ -47,5 +48,4 @@
 
 my $ipprc = PS::IPP::Config->new(); # IPP Configuration
-
 if ($redirect_output) {
     my $logDest = "$out_dir/psfinish.$req_id.log";
@@ -68,4 +68,7 @@
 }
 
+if ($product eq "NULL") {
+    stop_request_and_exit($req_id, $PS_EXIT_PROG_ERROR);
+}
 
 my $outputDataStoreRoot = metadataLookupStr($ipprc->{_siteConfig}, 'DATA_STORE_ROOT');
@@ -94,5 +97,5 @@
         if (!mkdir $out_dir) {
             print STDERR "cannot create output directory $out_dir";
-            stop_request($req_id, $PS_EXIT_UNKNOWN_ERROR);
+            stop_request_and_exit($req_id, $PS_EXIT_UNKNOWN_ERROR);
         }
 
@@ -102,10 +105,10 @@
         # request
         print STDERR "output directory $out_dir exists but is not a directory";
-        stop_request($req_id, $PS_EXIT_UNKNOWN_ERROR);
+        stop_request_and_exit($req_id, $PS_EXIT_UNKNOWN_ERROR);
     }
 
     if (! -e $req_file ) {
         print STDERR "request file $req_file is missing\n";
-        stop_request($req_id, $PS_EXIT_CONFIG_ERROR);
+        stop_request_and_exit($req_id, $PS_EXIT_CONFIG_ERROR);
     }
 
@@ -117,5 +120,5 @@
         # point 
         print STDERR "failed to read request_file $req_file" ;
-        stop_request($req_id, $PS_EXIT_CONFIG_ERROR);
+        stop_request_and_exit($req_id, $PS_EXIT_CONFIG_ERROR);
     }
 
@@ -154,14 +157,6 @@
                 print STDERR "Request $req_id produced no jobs.\n"
             }
-            # No Jobs. 
-            # XXXX Ouch. We need results for each rownum (each request specification) in the request file 
-            # including those that produced no jobs.
-            # for now add an entry for rownum 1 and a phony error code.
-            # we've included parse_error.txt to the fileset if it exists
-            #
-            my $rownum = 0;
-            my $fault = 42; # get a real error code
-            print $tdf "$rownum|$fault|0|0|";
-            print $tdf "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|\n";
+            # This should not happen. A fake job should be queued
+            stop_request_and_exit($req_id, $PS_EXIT_PROG_ERROR);
         } else {
             my $metadata = $mdcParser->parse($output) or die("Unable to parse metdata config doc");
@@ -182,4 +177,11 @@
         my $exp_id = $job->{exp_id};
 
+        if ($fault eq $PSTAMP_DUP_REQUEST) {
+            # this request had a duplicate request name. We can't put the results
+            # on the data store since the product name is already used
+            # maybe we could be more clever about this and choose a fileset name
+            stop_request_and_exit($req_id, $fault);
+        }
+
         my ($row, $req_info, $project) = get_request_info($rows, $rownum);
 
@@ -188,5 +190,7 @@
         if (!$image_db) {
             carp("failed to find imagedb for project: $project");
-            stop_request($req_id, $PS_EXIT_CONFIG_ERROR);
+            if (!$fault) {
+                stop_request_and_exit($req_id, $PS_EXIT_CONFIG_ERROR);
+            }
         }
 
@@ -227,4 +231,5 @@
                 print $tdf "$exp_info|";
                 print $tdf "$req_info|";
+                print $tdf "\n";
             }
         } else {
@@ -251,5 +256,5 @@
         # register the fileset
         my $command = "$dsreg --list $reglist_name --add $fileset --product $product --type PSRESULTS";
-        $command .= " --link --datapath $out_dir";
+        $command .= " --link --datapath $out_dir --ps0 $req_id";
         $command .= " --dbname $dbname" if $dbname;
 
@@ -277,5 +282,5 @@
 }
 
-sub stop_request {
+sub stop_request_and_exit {
     my $req_id = shift;
     my $fault  = shift;
@@ -299,8 +304,14 @@
     my $row = $rows->{$rownum};
 
+    # these may be set to null during processing
+    my $component = $row->{COMPONENT};
+    $component = "null" if !$component;
+    my $tess_id = $row->{TESS_ID};
+    $tess_id = "null" if !$tess_id;
+
     # This is ugly, error prone and hard to change.
     # Create a results file module and provide a list of the names (we have the data in the columns)
     my $rowinfo = "$row->{PROJECT}|$row->{JOB_TYPE}|$row->{REQ_TYPE}|$row->{IMG_TYPE}|";
-    $rowinfo   .= "$row->{ID}|$row->{TESS_ID}|$row->{COMPONENT}|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|";
+    $rowinfo   .= "$row->{ID}|$tess_id|$component|$row->{OPTION_MASK}|$row->{MJD_MIN}|$row->{MJD_MAX}|";
     $rowinfo   .= "$row->{REQFILT}|$row->{COORD_MASK}|$row->{CENTER_X}|$row->{CENTER_Y}|";
     $rowinfo   .= "$row->{WIDTH}|$row->{HEIGHT}";
@@ -313,5 +324,5 @@
     my $exp_id = shift;
 
-    if (!$exp_id) {
+    if (!$exp_id or !$image_db) {
         # no exposure id just return zeros
         # XXX: we could put a value in for filter, but we don't have a good place to find it
Index: /branches/eam_branches/20090715/pstamp/scripts/pstamp_insert_request.pl
===================================================================
--- /branches/eam_branches/20090715/pstamp/scripts/pstamp_insert_request.pl	(revision 25406)
+++ /branches/eam_branches/20090715/pstamp/scripts/pstamp_insert_request.pl	(revision 25406)
@@ -0,0 +1,143 @@
+#!/bin/env perl
+###
+#
+# create a postage stamp request
+#
+###
+
+use warnings;
+use strict;
+
+use Carp;
+use Getopt::Long qw( GetOptions );
+use Sys::Hostname;
+use File::Copy;
+use POSIX qw( strftime );
+
+my $host = hostname();
+my $verbose = 0;
+my $dbname;
+my $dbserver;
+my $tmp_req_file;
+my $workdir;
+
+GetOptions(
+    'tmp_req_file=s'=>  \$tmp_req_file,
+    'workdir=s'     =>  \$workdir,
+    'dbname=s'      =>  \$dbname,
+    'dbserver=s'    =>  \$dbserver,
+    'verbose'       =>  \$verbose,
+);
+
+die "required arguments --tmp_req_file --workdir --dbname --dbserver"
+    if( !defined($tmp_req_file) or !defined($workdir) or !defined ($dbname)
+        or !defined($dbserver));
+use IPC::Cmd 0.36 qw( can_run run );
+
+use PS::IPP::Config qw( :standard );
+
+use Cwd;
+
+my $cwd = cwd();
+
+my $missing_tools;
+
+my $pstamptool = can_run('pstamptool')  or (warn "Can't find pstamptool"  and $missing_tools = 1);
+my $pstampdump = can_run('pstampdump')  or (warn "Can't find pstampdump"  and $missing_tools = 1);
+
+if ($missing_tools) {
+    warn("Can't find required tools.");
+    exit ($PS_EXIT_CONFIG_ERROR);
+}
+
+my ($extname, $extver, $req_name);
+{
+    my $command = "$pstampdump -headeronly $tmp_req_file";
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        print STDERR @$stderr_buf;
+        exit $error_code >> 8;
+    }
+    my $output = join "", @$stdout_buf;
+    ($extname, $extver, $req_name) = split " ", $output;
+    if ($extname and ($extname ne "PS1_PS_REQUEST")) {
+        print STDERR "invalid request file\n";
+        exit $PS_EXIT_DATA_ERROR;
+    }
+    if (!defined $req_name) {
+        print STDERR "invalid request file no REQ_NAME\n";
+        exit $PS_EXIT_DATA_ERROR;
+    }
+}
+
+my $datestr = strftime "%Y%m%d", gmtime;
+my $datedir = "$workdir/webreq/$datestr";
+if (! -e $datedir ) {
+    if (!  mkdir $datedir ) {
+        print STDERR  "failed to create working directory $datedir";
+        exit $PS_EXIT_CONFIG_ERROR;
+    }
+}
+
+my $webreq_num = get_webreq_num();
+my $req_file = "$datedir/web_$webreq_num.fits";
+
+if (!copy( $tmp_req_file, $req_file)) {
+    die("Unable to copy request file $tmp_req_file to $req_file");
+}
+
+# Queue the request
+my $req_id = 0;
+{
+
+    my $command = "$pstamptool -addreq -name $req_name -uri $req_file -ds_id 0";
+    $command .= " -dbname $dbname" if $dbname;
+    $command .= " -dbserver $dbserver" if $dbserver;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        my $errbuf = join "", @$stderr_buf;
+        print STDERR $errbuf;
+        if ($errbuf =~ /Duplicate entry/) {
+            print "Request Name $req_name has already been used";
+            exit $PS_EXIT_DATA_ERROR;
+        } else {
+            exit $PS_EXIT_UNKNOWN_ERROR;
+        }
+    }
+    $req_id = ${$stdout_buf}[0];
+}
+
+print "$req_id $req_name\n";
+
+exit 0;
+
+# Temporary hack
+# webrequest number is stored in a file in the current directory
+#
+# get this number from the database
+sub get_webreq_num
+{
+    my $filename = "$workdir/webreq_num.txt";
+    if (! open IN, "+< $filename" ) {
+        my $initial_num = 1;
+        open IN, "> $filename" or die "can't open $filename";
+        print IN "$initial_num\n" or die "failed to initialize $filename";
+        close IN;
+        return $initial_num;
+    }
+
+    my $webreq_num = <IN>;
+    chomp $webreq_num;
+
+    print STDERR "$webreq_num\n" if $verbose;
+
+    my $next = $webreq_num + 1;
+    truncate IN, 0;
+    seek IN, 0, 0;
+    print IN "$next\n";
+
+    close IN;
+    return $webreq_num;
+}
Index: /branches/eam_branches/20090715/pstamp/scripts/pstamp_job_run.pl
===================================================================
--- /branches/eam_branches/20090715/pstamp/scripts/pstamp_job_run.pl	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/scripts/pstamp_job_run.pl	(revision 25406)
@@ -11,4 +11,5 @@
 use Sys::Hostname;
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
+use Carp;
 use File::Basename;
 use Digest::MD5::File qw( file_md5_hex );
@@ -137,5 +138,5 @@
     }
 } elsif ($jobType eq "get_image") {
-    my_die( "get_image jobs not working right now", $job_id, $PS_EXIT_CONFIG_ERROR);
+    my_die( "get_image jobs not working right now", $job_id, $PS_EXIT_PROG_ERROR);
 
     my $uri = "";
@@ -201,5 +202,5 @@
     my $exit_code = shift;      # Exit code to add
 
-    $exit_code = $PS_EXIT_PROG_ERROR unless defined $exit_code;
+    $exit_code = $PS_EXIT_PROG_ERROR unless $exit_code;
 
     carp($msg);
@@ -208,4 +209,6 @@
         $command .= " -job_id $job_id";
         $command .= " -fault $exit_code";
+        # XXX: fix pstamptool to not require -state when -fault with nonzero value is provided
+        $command .= " -state run";
         $command .= " -dbname $dbname" if defined $dbname;
         $command .= " -dbserver $dbserver" if defined $dbserver;
Index: /branches/eam_branches/20090715/pstamp/scripts/pstamp_listjobs.pl
===================================================================
--- /branches/eam_branches/20090715/pstamp/scripts/pstamp_listjobs.pl	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/scripts/pstamp_listjobs.pl	(revision 25406)
@@ -12,5 +12,5 @@
 my $verbose;
 my $dbname;
-my $dserver;
+my $dbserver;
 
 GetOptions(
Index: /branches/eam_branches/20090715/pstamp/scripts/pstamp_parser_run.pl
===================================================================
--- /branches/eam_branches/20090715/pstamp/scripts/pstamp_parser_run.pl	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/scripts/pstamp_parser_run.pl	(revision 25406)
@@ -14,4 +14,12 @@
 use File::Basename qw( basename dirname);
 use POSIX qw( strftime );
+use Carp;
+use IPC::Cmd 0.36 qw( can_run run );
+
+use PS::IPP::Metadata::Config;
+use PS::IPP::Metadata::Stats;
+use PS::IPP::Metadata::List qw( parse_md_list );
+
+use PS::IPP::Config qw( :standard );
 
 my $req_id;
@@ -39,26 +47,21 @@
 }
 
-die "--req_id --uri --product are required" 
+my $missing_tools;
+
+my $pstamptool  = can_run('pstamptool')  or (warn "Can't find pstamptool"  and $missing_tools = 1);
+my $pstampparse = can_run('pstampparse.pl') or (warn "Can't find pstampparse.pl" and $missing_tools = 1);
+my $dqueryparse = can_run('dqueryparse.pl') or (warn "Can't find dqueryparse.pl" and $missing_tools = 1);
+my $dsget = can_run('dsget') or (warn "Can't find dsget" and $missing_tools = 1);
+
+if ($missing_tools) {
+    warn("Can't find required tools.");
+    exit ($PS_EXIT_CONFIG_ERROR);
+}
+
+
+my_die("--req_id --uri --product are required", $req_id, $PS_EXIT_CONFIG_ERROR)
     if !defined($req_id) or
        !defined($uri) or
        !defined($product);
-
-use IPC::Cmd 0.36 qw( can_run run );
-
-use PS::IPP::Metadata::Config;
-use PS::IPP::Metadata::Stats;
-use PS::IPP::Metadata::List qw( parse_md_list );
-
-use PS::IPP::Config qw($PS_EXIT_SUCCESS
-		       $PS_EXIT_UNKNOWN_ERROR
-		       $PS_EXIT_SYS_ERROR
-		       $PS_EXIT_CONFIG_ERROR
-		       $PS_EXIT_PROG_ERROR
-		       $PS_EXIT_DATA_ERROR
-		       $PS_EXIT_TIMEOUT_ERROR
-		       metadataLookupStr
-		       metadataLookupBool
-		       caturi
-		       );
 
 my $ipprc = PS::IPP::Config->new(); # IPP Configuration
@@ -80,10 +83,12 @@
 my $datedir = "$pstamp_workdir/$datestr";
 if (! -e $datedir ) {
-    mkdir $datedir or die "failed to create working directory $datedir for request id $req_id";
+    mkdir $datedir or my_die( "failed to create working directory $datedir for request id $req_id", $req_id,
+        $PS_EXIT_CONFIG_ERROR);
 }
 
 my $workdir = "$datedir/$req_id";
 if (! -e $workdir ) {
-    mkdir $workdir or die "failed to create working directory $workdir for request id $req_id";
+    mkdir $workdir or my_die("failed to create working directory $workdir for request id $req_id", $req_id,
+        $PS_EXIT_CONFIG_ERROR);
 }
 
@@ -96,16 +101,4 @@
 exit ($PS_EXIT_CONFIG_ERROR) unless defined $defaultDSProduct;
     
-my $missing_tools;
-
-my $pstamptool  = can_run('pstamptool')  or (warn "Can't find pstamptool"  and $missing_tools = 1);
-my $pstampparse = can_run('pstampparse.pl') or (warn "Can't find pstampparse.pl" and $missing_tools = 1);
-my $dqueryparse = can_run('dqueryparse.pl') or (warn "Can't find dqueryparse.pl" and $missing_tools = 1);
-my $dsget = can_run('dsget') or (warn "Can't find dsget" and $missing_tools = 1);
-
-if ($missing_tools) {
-    warn("Can't find required tools.");
-    exit ($PS_EXIT_CONFIG_ERROR);
-}
-
 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files
 
@@ -119,18 +112,18 @@
         run(command => $command, verbose => $verbose);
     unless ($success) {
-        die("Unable to perform $command error code: $error_code");
+        my_die("Unable to perform $command error code: $error_code", $req_id, $error_code >> 8);
     }
 } elsif ($uri ne $new_uri) {
     # put a link to the file into the workdir
     if (-e $new_uri) {
-        unlink $new_uri or die "failed to unlink $new_uri";
+        unlink $new_uri or my_die("failed to unlink $new_uri", $req_id, $PS_EXIT_UNKNOWN_ERROR);
     }
     if (! symlink $uri, $new_uri) {
-        die ("failed to link request file $uri to workdir $workdir");
+        my_die ("failed to link request file $uri to workdir $workdir", $req_id, $PS_EXIT_UNKNOWN_ERROR);
     }
 }
 $uri = $new_uri;
 
-die "request file $uri not found" if ! -e $uri;
+my_die("request file $uri not found", $req_id, $PS_EXIT_UNKNOWN_ERROR) if ! -e $uri;
 
 #  if product was not defined (in database), use the default
@@ -200,4 +193,6 @@
     unlink $error_file_name if (-e $error_file_name);
 
+    # Run the parser
+
     my $command = "$parse_cmd";
     my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
@@ -261,2 +256,20 @@
     }
 }
+
+sub my_die {
+    my $msg = shift;
+    my $req_id = shift;
+    my $fault = shift;
+
+    carp($msg);
+
+    my $command = "$pstamptool -updatereq -req_id $req_id  -fault $fault";
+    $command   .= " -dbname $dbname" if $dbname;
+    $command   .= " -dbserver $dbserver" if $dbserver;
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        die("Unable to perform $command error code: $error_code");
+    }
+    exit $fault;
+}
Index: /branches/eam_branches/20090715/pstamp/scripts/pstamp_webrequest.pl
===================================================================
--- /branches/eam_branches/20090715/pstamp/scripts/pstamp_webrequest.pl	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/scripts/pstamp_webrequest.pl	(revision 25406)
@@ -82,5 +82,5 @@
 my $cur_dir = getcwd();
 #print STDERR "cur_dir is $cur_dir\n";
-my $request_name = "web" . get_webreq_num();
+my $request_name = "web_" . get_webreq_num();
 my $request_file = "$cur_dir/$request_name.fits";
 {
@@ -136,5 +136,5 @@
 }
 
-print "$req_id";
+print "$req_id $request_name";
 
 exit 0;
Index: /branches/eam_branches/20090715/pstamp/scripts/pstampparse.pl
===================================================================
--- /branches/eam_branches/20090715/pstamp/scripts/pstampparse.pl	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/scripts/pstampparse.pl	(revision 25406)
@@ -14,4 +14,6 @@
 use PS::IPP::PStamp::Job qw( :standard );
 use File::Temp qw(tempfile);
+use File::Basename qw(basename);
+use Carp;
 
 my $verbose;
@@ -91,9 +93,28 @@
 # make sure the file contains what we are expecting
 
-die "$request_file_name is not a PS1_PS_REQEST" if $extname ne "PS1_PS_REQUEST";
-die "REQ_NAME not found in $request_file_name"  if (!$req_name);
-die "wrong EXTVER $extver found in $request_file_name" if ($extver ne "1");
-
+# we shouldn't get here if this is the case so just die. No need to notify the client
+my_die("$request_file_name is not a PS1_PS_REQEST", $PS_EXIT_PROG_ERROR) if $extname ne "PS1_PS_REQUEST";
+my_die("REQ_NAME not found in $request_file_name", $PS_EXIT_PROG_ERROR)  if (!$req_name);
+my_die("wrong EXTVER $extver found in $request_file_name", $PS_EXIT_PROG_ERROR) if ($extver ne "1");
+
+# check for duplicate request name
 if ($req_id and !$no_update) {
+    my $command = "$pstamptool -listreq  -name $req_name -not_req_id $req_id";
+    $command .= " -dbname $dbname" if $dbname;
+    $command .= " -dbserver $dbserver" if $dbserver;
+    # no verbose so that error message about request not found doesn't appear in parse_error.txt
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => 0);
+    my $exitStatus = $error_code >> 8;
+    if ($success) {
+        # -listreq succeeded duplicate request name
+        insertFakeJobForRow(undef, 0, $PSTAMP_DUP_REQUEST);
+        exit 0;
+    }
+}
+
+if ($req_id and !$no_update) {
+    # update the database with the request name. This will be used as the
+    # the output data store's product name
     my $command = "$pstamptool -updatereq -req_id $req_id  -name $req_name";
     $command .= " -outProduct $product";
@@ -103,5 +124,5 @@
         run(command => $command, verbose => $verbose);
     unless ($success) {
-        die "$command failed";
+        my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR);
     }
 }
@@ -120,5 +141,5 @@
     }
     my $table =  $mdcParser->parse(join "", @$stdout_buf) or
-        die("Unable to parse metdata config doc");
+        my_die("Unable to parse metdata config doc", $PS_EXIT_UNKNOWN_ERROR);
 
     $rows = parse_md_list($table);
@@ -143,4 +164,14 @@
     # parameters that select the images of interest
     my $project  = $row->{PROJECT};
+
+    # note: resolve_project avoids running pstamptool every time by remembering the
+    # last project resolved
+    my $proj_hash = resolve_project($ipprc, $project, $dbname, $dbserver);
+    if (!$proj_hash) {
+        print STDERR "project $project not found\n"  if $verbose;
+        insertFakeJobForRow($row, 1, $PSTAMP_UNKNOWN_PRODUCT);
+        $num_jobs++;
+        next;
+    }
     my $req_type = $row->{REQ_TYPE};
     $stage = $row->{IMG_TYPE};
@@ -153,18 +184,32 @@
 
     my $option_mask= $row->{OPTION_MASK};
-
-    die "valid region of interest is required to make postage stamps"
-        if (($job_type eq "stamp") and ! validROI($row));
+    my $inverse = ($option_mask & $PSTAMP_SELECT_INVERSE) ? 1 : 0;
+    $row->{inverse} = $inverse;
 
     my $skycenter = $row->{skycenter} = ! ($row->{COORD_MASK} & $PSTAMP_CENTER_IN_PIXELS);
-    $component = "" if (defined($component) and ($component eq "null" or $component eq "all"));
+
+    my $search_component = (!defined($component) or ($component eq "null")) ? "" : $component;
     
-    die "job_type is list_uri but mode is $mode" if ($job_type eq "list_uri") and ($mode ne "list_uri");
-
-
-    # note: resolve_project avoids running pstamptool every time by remembering the
-    # last project resolved
-    my $proj_hash = resolve_project($ipprc, $project, $dbname, $dbserver);
-    die "project $project not found\n" unless $proj_hash;
+    if (!$skycenter and !$search_component) {
+        print STDERR "COMPONENT must be specified for pixel coordinate ROI\n" if $verbose;
+        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
+        $num_jobs++;
+        next;
+    }
+
+    $search_component = "" if $search_component eq "all";
+
+    if (($job_type eq "stamp") and ! validROI($row)) {
+        print STDERR "invalid ROI for row $rownum\n" if $verbose;
+        insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
+        $num_jobs++;
+        next;
+    }
+
+    
+    # $mode list_uri is a debugging mode (it may used by the http interface)
+    # if this happens just croak
+    my_die("job_type is list_uri but mode is $mode", $PS_EXIT_PROG_ERROR) if ($job_type eq "list_uri") and ($mode ne "list_uri");
+
 
     my $image_db   = $proj_hash->{dbname};
@@ -172,15 +217,24 @@
     $need_magic = $proj_hash->{need_magic};
 
+    # Temporary hack so that MOPS can get at non-magicked data
+    if ($product eq "mops-pstamp-results") {
+        $need_magic = 0;
+    }
+
     # collect rows with the same images of interest in a list so that they
-    # can be processed optimially
+    # can be looked up together
     if (@rowList) {
         my $firstRow = $rowList[0];
-        # XXX: the collecting might work with !$skycenter but I need to think about it
-        if ($skycenter and same_images_of_interest($row, $firstRow)) {
+        # note order of these parameters matters
+        if (same_images_of_interest($firstRow, $row)) {
+
+            # add this row to the list and move on
             push @rowList, $row;
-            # On to the next row
+
             next;
+
         } else {
-            # queue the jobs for this set of rows
+            # this row has different selectors
+            # queue the jobs for the ones we've collected
             $num_jobs += queueJobs($mode, \@rowList, $imageList);
             @rowList = ();
@@ -188,22 +242,31 @@
     }
 
+    # look up images for the current row
     if ($req_type eq "bycoord") {
-        die "center must be specified in sky coordintes for bycoord" if ( ! $skycenter);
-        die "lookup bycoord is not yet implemented";
+        if (!$skycenter) {
+            print STDERR "center must be specified in sky coordintes for bycoord" if $verbose;
+            insertFakeJobForRow($row, 1, $PSTAMP_INVALID_REQUEST);
+            $num_jobs++;
+            next;
+        }
+        print STDERR "lookup bycoord is not yet implemented" if $verbose;
+        insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED);
+        $num_jobs++;
+        next;
     } else {
-
-        # Call PS::IPP::PStamp::Job's locate_images routine to get the parameters for this
-        # request specification. An array reference is returned
+        # Call PS::IPP::PStamp::Job locate_images subroutine to get the images for this
+        # request specification. An array reference is returned.
         my ($x, $y);
-        $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $component, $skycenter,
-                $x, $y, $mjd_min, $mjd_max, $filter, $verbose);
-    }
-
-    if (!$imageList or !@$imageList) {
-        print STDERR "no matching images found for row $rownum\n";
-        next;
-    }
-    $row->{need_magic} = $need_magic;
-    push @rowList, $row;
+
+        $imageList = locate_images($ipprc, $image_db, $req_type, $stage, $id, $search_component,
+                $inverse, $skycenter, $x, $y, $mjd_min, $mjd_max, $filter, $verbose);
+
+        if (!$imageList or !@$imageList) {
+            print STDERR "no matching images found for row $rownum\n" if $verbose;
+            # note in this case queueJobs inserts the fake job for these rows
+        }
+        $row->{need_magic} = $need_magic;
+        push @rowList, $row;
+    }
 }
 
@@ -212,15 +275,12 @@
 }
 
-if ($mode eq "queue_jobs") {
-    if ($num_jobs) {
-        exit 0;
-    } else {
-        # no jobs queued return error to get the request stopped
-        # TODO: need to define meaningful error codes
-        exit $PS_EXIT_UNKNOWN_ERROR;
-    }
-} else {
-    exit 0;
-}
+if (($mode eq "queue_jobs") and ($num_jobs eq 0)) {
+    print STDERR "no jobs created for $req_name\n" if $verbose;
+    insertFakeJobForRow(undef, 0, $PSTAMP_UNKNOWN_ERROR);
+}
+
+# PAU
+
+exit 0;
 
 
@@ -232,4 +292,29 @@
     my $have_skycells = shift;
     my $need_magic = shift;
+
+    my $num_jobs = 0;
+    my $rownum = $row->{ROWNUM};
+    my $components = $row->{components};
+
+    my $roi_string;
+
+    # note values were insured to be numbers in validROI()
+    my $x = $row->{CENTER_X};
+    my $y = $row->{CENTER_Y};
+    my $w = $row->{WIDTH};
+    my $h = $row->{HEIGHT};
+    my $coord_mask = $row->{COORD_MASK};
+    if ($x && ($x ne "null") && $y && ($y ne "null") && $w && ($w ne "null") && $h && ($h ne "null")) {
+        if ($coord_mask & $PSTAMP_CENTER_IN_PIXELS) {
+            $roi_string = "-pixcenter $x $y";
+        } else {
+            $roi_string = "-skycenter $x $y";
+        }
+        if ($coord_mask & $PSTAMP_RANGE_IN_PIXELS) {
+            $roi_string .= " -pixrange $w $h";
+        } else {
+            $roi_string .= " -arcrange $w $h";
+        }
+    }
 
     # loop over images
@@ -244,33 +329,18 @@
 
         # skip this component if it is not in the list for this row
-        next if !$row->{components}->{$component};
-
-        my $rownum = $row->{ROWNUM};
-
-        my $roi_string;
-
-        # note values were insured to be numbers in validROI()
-        my $x = $row->{CENTER_X};
-        my $y = $row->{CENTER_Y};
-        my $w = $row->{WIDTH};
-        my $h = $row->{HEIGHT};
-        my $coord_mask = $row->{COORD_MASK};
-        if ($x && ($x ne "null") && $y && ($y ne "null") && $w && ($w ne "null") && $h && ($h ne "null")) {
-            if ($coord_mask & $PSTAMP_CENTER_IN_PIXELS) {
-                $roi_string = "-pixcenter $x $y";
-            } else {
-                $roi_string = "-skycenter $x $y";
-            }
-            if ($coord_mask & $PSTAMP_RANGE_IN_PIXELS) {
-                $roi_string .= " -pixrange $w $h";
-            } else {
-                $roi_string .= " -arcrange $w $h";
-            }
-        }
+        next if ! $components->{$component};
+
+        $job_num++;
 
         my $imagefile = $image->{image};
         if (($stage ne "stack") and ($need_magic and !$image->{magicked})) {
-            # XXX: should we add a faulted job so the client can know what happened?
-            print STDERR "skippping non-magicked image $imagefile\n" if $verbose;
+            # XXX: should we add a faulted job so the client can know what happened if no images come back?
+            print STDERR "skipping non-magicked image $imagefile\n" if $verbose;
+
+            # for now assume yes.
+
+            insertFakeJobForRow($row, $job_num, $PSTAMP_NOT_DESTREAKED);
+            $num_jobs++;
+
             next;
         }
@@ -282,6 +352,4 @@
         }
 
-        $job_num++;
-
         # add astrometry file for raw and chip images if one is available
         if (($stage eq "chip") || ($stage eq "raw")) {
@@ -298,20 +366,37 @@
         }
 
-        my $output_base = "$out_dir/${rownum}_${job_num}";
+        my $base = basename($image->{path_base});
+        # XXX: TODO use filerule for this. I don't have a camera defined here
+        if (($stage eq 'chip') and ($image->{camera} eq 'GPC1')) {
+            $base = "${base}.${component}";
+        }
+
+        my $output_base = "$out_dir/${rownum}_${job_num}_${base}";
         my $argslist = "${output_base}.args";
 
         # copy the argument list to a file
-        open ARGSLIST, ">$argslist" or die "failed to open $argslist";
+        open ARGSLIST, ">$argslist" or my_die("failed to open $argslist", $PS_EXIT_UNKNOWN_ERROR);
         print ARGSLIST "$args\n";
-        close ARGSLIST or die "failed to close $argslist";
-
-        # XXX: TODO: here is where we need to check whether or not the source inputs still exist
-        # and if not, queue an update job and set the job state appropriately.
+        close ARGSLIST or my_die("failed to close $argslist", $PS_EXIT_UNKNOWN_ERROR);
 
         my $newState = "run";
+        my $fault = 0;
+
+        if (($stage ne 'stack') and ($stage ne 'raw')) {
+            if (($image->{state} eq 'goto_purged') or ($image->{data_state} eq 'purged')) {
+                $newState = 'stop';
+                $fault = $PSTAMP_GONE;
+            } elsif (($image->{data_state} ne 'full') or ($image->{state} ne 'full' )) {
+                # XXX here is where we need to queue an update job
+                # for now just say that the image is not available
+                $newState = 'stop';
+                $fault = $PSTAMP_NOT_AVAILABLE;
+            }
+        }
 
         $num_jobs++;
         my $command = "$pstamptool -addjob  -req_id $req_id -job_type $row->{JOB_TYPE}"
                         . " -outputBase $output_base -rownum $rownum -state $newState";
+        $command .= " -fault $fault" if $fault;
         $command .= " -exp_id $exp_id" if $exp_id;
         $command .= " -dbname $dbname" if $dbname;
@@ -331,5 +416,5 @@
                 # should we keep going for other uris? If so how do we report that some
                 # of the work that the request wanted isn't going to get done
-                die "failed to queue job for request $req_id";
+                my_die("failed to queue job for request $req_id", $PS_EXIT_UNKNOWN_ERROR);
             }
         } else {
@@ -337,7 +422,13 @@
         }
     }
+    if ( $num_jobs == 0 ) {
+        print STDERR "no jobs for row $rownum\n" if $verbose;
+        insertFakeJobForRow($row, 1, $PSTAMP_NO_OVERLAP);
+        $num_jobs = 1;
+    }
     return $num_jobs;
 }
 
+# queue jobs for a collection of request specifications that have the same Images of Interest
 sub queueJobs
 {
@@ -358,14 +449,19 @@
         }
     } elsif ($job_type eq "get_image") {
-        die "get_image jobs not implemented yet";
+        print STDERR "get_image jobs not implemented yet" if $verbose;
+        foreach my $row (@$rowList) {
+            insertFakeJobForRow($row, 1, $PSTAMP_NOT_IMPLEMENTED);
+            $num_jobs++;
+        }
     } else {
-        my $thisRun;
-
-        my ($pointsList, $pointsListName) = tempfile ("/tmp/pointsList.XXXX", UNLINK => !$save_temps);
-        foreach my $row (@$rowList) {
-            print $pointsList "$row->{ROWNUM} $row->{CENTER_X} $row->{CENTER_Y}\n";
-            $row->{components} = {};
-        }
-        close $pointsList;
+        if (!$imageList or (scalar @$imageList eq 0)) {
+            # we didn't find any images for this set of rows. Insert a fake job to carry
+            # the status back to the requestor
+            foreach my $row (@$rowList) {
+                insertFakeJobForRow($row, 1, $PSTAMP_NO_IMAGE_MATCH);
+                $num_jobs++;
+            }
+            return $num_jobs;
+        }
 
         my $have_skycells;
@@ -376,8 +472,46 @@
         }
         
+        my $thisRun;
+
+        my $npoints = 0;
+        my ($pointsList, $pointsListName);
+        if (scalar @$imageList > 1) {
+            ($pointsList, $pointsListName) = tempfile ("/tmp/pointsList.XXXX", UNLINK => !$save_temps);
+            foreach my $row (@$rowList) {
+                $row->{components} = {};
+                if ($row->{skycenter}) {
+                    print $pointsList "$row->{ROWNUM} $row->{CENTER_X} $row->{CENTER_Y}\n";
+                    $npoints++;
+                } else {
+                    # this row's center is in pixel coordinates add all images to the component list for this row
+                    foreach my $i (@$imageList) {
+                        my $component = $have_skycells ? $i->{skycell_id} : $i->{class_id};
+                        my_die( "image found with no value for component", $PS_EXIT_UNKNOWN_ERROR)
+                                if !$component;
+                        $row->{components}->{$component} = 1;
+                    }
+                }
+            }
+            close $pointsList;
+        } else {
+            # only one image. Avoid the expense of dvoImagesAtCoords. 
+            # queue the job and let ppstamp figure out if the center is valid for the image
+            # the resulting result code will be the same.
+            foreach my $row (@$rowList) {
+                $row->{components} = {};
+                my $i = $imageList->[0];
+                my $component = $have_skycells ? $i->{skycell_id} : $i->{class_id};
+                my_die( "image found with no value for component", $PS_EXIT_UNKNOWN_ERROR) if !$component;
+                $row->{components}->{$component} = 1;
+            }
+        }
+
         my $tess_dir_abs;
         my $last_tess_id = "";
         while ($thisRun = getOneRun($stage, $imageList)) {
-            {
+            if ($npoints) {
+                my_die( "pointsListName is not defined", $PS_EXIT_PROG_ERROR) if !$pointsListName;
+                # we collected a set of sky coordinates above.
+                # filter the images so that only those that contain the centers of the ROIs are processed
                 my $command = "$dvoImagesAtCoords $pointsListName";
                 if ($have_skycells) {
@@ -391,5 +525,5 @@
                 } else {
                     my $astrom = $thisRun->[0]->{astrom};
-                    die "no astrometry file found" if !$astrom;
+                    my_die( "no astrometry file found", $PS_EXIT_UNKNOWN_ERROR) if !$astrom;
                     my $astrom_resolved = $ipprc->file_resolve($astrom);
                     $command .= " -astrom $astrom_resolved";
@@ -400,5 +534,5 @@
                     print STDERR @$stderr_buf;
                     my $rc = $error_code >> 8;
-                    die "dvoImagesAtCoords failed: $rc";
+                    my_die( "dvoImagesAtCoords failed: $rc", $PS_EXIT_UNKNOWN_ERROR);
                 }
                 # now we have a list of row numbers and components
@@ -410,5 +544,5 @@
                     my ($rownum, undef, undef, $component) = split " ", $line;
 
-                    # I guess since we need this function we should be useing a hash for rowList 
+                    # I guess since we need this function we should be using a hash for rowList 
                     my $row = findRow($rownum, $rowList);
                     $row->{components}->{$component} = 1;
@@ -422,4 +556,43 @@
     }
     return $num_jobs;
+}
+sub insertFakeJobForRow
+{
+    my $row = shift;
+    my $job_num = shift;
+    my $fault = shift;
+
+    my ($job_type, $rownum);
+    if ($row) {
+        $job_type = $row->{JOB_TYPE};
+        $rownum = $row->{ROWNUM};
+    } else {
+        $job_type = "none";
+        $rownum = 0;
+    }
+
+    my $command = "$pstamptool -addjob  -req_id $req_id -job_type $job_type"
+                        . " -rownum $rownum -state stop -fault $fault";
+    $command .= " -dbname $dbname" if $dbname;
+    $command .= " -dbserver $dbserver" if $dbserver;
+
+    if ($mode eq "list_job") { 
+        # this is a debugging mode, just print the pstamptool that would have run
+        # this is sort of like the mode -noupdate that some other tools support
+        print "$command\n";
+    } elsif (!$no_update) {
+        # mode eq "queue_job"
+        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+            run(command => $command, verbose => $verbose);
+        unless ($success) {
+            print STDERR @$stderr_buf;
+            # XXX TODO: now what? Should we mark the error state for the request?
+            # should we keep going for other uris? If so how do we report that some
+            # of the work that the request wanted isn't going to get done
+            my_die("failed to queue job for request $req_id", $PS_EXIT_UNKNOWN_ERROR);
+        }
+    } else {
+        print "skipping command: $command\n";
+    }
 }
 
@@ -440,5 +613,5 @@
         return $image->{diff_id};
     } else {
-        die "unenexpected stage: $stage found";
+        my_die("unenexpected stage: $stage found", $PS_EXIT_PROG_ERROR);
     }
 }
@@ -476,8 +649,13 @@
     return 0 if ($r1->{IMG_TYPE} ne $r2->{IMG_TYPE});
     return 0 if ($r1->{ID} ne $r2->{ID});
+    return 0 if ($r1->{inverse} ne $r2->{inverse});
 
     if (defined($r1->{COMPONENT})) {
         return 0 if !defined $r2->{COMPONENT} or ($r1->{COMPONENT} ne $r2->{COMPONENT});
     } elsif (defined($r2->{COMPONENT})) {
+        # if first row has no component all of the images will be retrieved, so
+        # the fact that this row has a component is ok. Fall through to return 1
+        # XXX Nope this doesn't work. It is consistent with the other logic in some way
+        # that i haven't fully thought through
         return 0;
     }
@@ -514,2 +692,14 @@
     return undef;
 }
+
+sub my_die
+{
+    my $msg = shift;
+    my $fault = shift;
+
+    carp $msg;
+
+    # we don't fault the request here pstamp_parser_run.pl handles that if necessary
+
+    return $fault;
+}
Index: /branches/eam_branches/20090715/pstamp/src/ppstamp.c
===================================================================
--- /branches/eam_branches/20090715/pstamp/src/ppstamp.c	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/src/ppstamp.c	(revision 25406)
@@ -29,9 +29,5 @@
 
     // find the pixels that we need to copy, setup the output image
-    if (ppstampMakeStamp(config, options)) {
-        exitCode = 0;
-    } else {
-        exitCode = PS_EXIT_DATA_ERROR;
-    }
+    exitCode = ppstampMakeStamp(config, options);
 
     psLogMsg ("ppstamp", 3, "Complete ppstamp run: %f sec\n", psTimerMark(TIMERNAME));
Index: /branches/eam_branches/20090715/pstamp/src/ppstamp.h
===================================================================
--- /branches/eam_branches/20090715/pstamp/src/ppstamp.h	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/src/ppstamp.h	(revision 25406)
@@ -20,5 +20,5 @@
 bool ppstampParseCamera(pmConfig *config);
 
-bool ppstampMakeStamp(pmConfig *config, ppstampOptions *);
+int ppstampMakeStamp(pmConfig *config, ppstampOptions *);
 pmFPAfile * ppstampBuildMosaic(pmConfig *config, pmFPAfile *input, pmFPAview *view);
 
Index: /branches/eam_branches/20090715/pstamp/src/ppstampMakeStamp.c
===================================================================
--- /branches/eam_branches/20090715/pstamp/src/ppstampMakeStamp.c	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/src/ppstampMakeStamp.c	(revision 25406)
@@ -17,4 +17,5 @@
 
 static void skyToChip(pmAstromObj *pt, pmFPA *fpa, pmChip *chip);
+static bool setMaskedToNAN(pmConfig *config, psImage *image, psImage *mask, psImage *variance);
 
 // convert the input chip's transforms to the output
@@ -173,6 +174,6 @@
 static psImage *extractStamp(psImage *image, psRegion region, double value)
 {
-    int width  = region.x1 - region.x0;
-    int height = region.y1 - region.y0;
+    int width  = region.x1 - region.x0 + 0.5;
+    int height = region.y1 - region.y0 + 0.5;
 
     if (width < 0) {
@@ -251,5 +252,5 @@
 // Build the postage stamp output file
 
-static bool makeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input,
+static int makeStamp(pmConfig *config, ppstampOptions *options, pmFPAfile *input,
                 pmChip *inChip, pmFPAview *view)
 {
@@ -259,5 +260,5 @@
     if (!output) {
         psError(PS_ERR_UNKNOWN, false, "Can't find output data\n");
-        return false;
+        return PS_EXIT_DATA_ERROR;
     }
     char *fpaName = psMetadataLookupStr(NULL, input->fpa->concepts, "FPA.OBS"); // Name of FPA
@@ -283,5 +284,5 @@
         pmFPAfile *mosaic = ppstampBuildMosaic(config, input, view);
         if (mosaic == NULL) {
-            return false;
+            return PS_EXIT_UNKNOWN_ERROR;
         }
         srcFile = mosaic;
@@ -325,4 +326,12 @@
             break;
         }
+        if (readout->variance) {
+            outReadout->variance = extractStamp(readout->variance, extractRegion,  0);
+            if (!outReadout->variance) {
+                psError(PS_ERR_UNKNOWN, false, "failed to create postage stamp weight image\n");
+                status = false;
+                break;
+            }
+        }
         if (readout->mask) {
             outReadout->mask = extractStamp(readout->mask, extractRegion,  0);
@@ -332,11 +341,9 @@
                 break;
             }
-        }
-        if (readout->variance) {
-            outReadout->variance = extractStamp(readout->variance, extractRegion,  0);
-            if (!outReadout->variance) {
-                psError(PS_ERR_UNKNOWN, false, "failed to create postage stamp weight image\n");
-                status = false;
-                break;
+
+            if (!setMaskedToNAN(config, outReadout->image, outReadout->mask, outReadout->variance)) {
+                 psError(PS_ERR_UNKNOWN, false, "failed to create postage stamp mask image\n");
+                 status = false;
+                 break;
             }
         }
@@ -355,5 +362,5 @@
         status = copyMetadata(output, input, inChip, options);
     }
-    return status;
+    return status ? PS_EXIT_SUCCESS : PS_EXIT_UNKNOWN_ERROR;
 }
 
@@ -567,8 +574,8 @@
 }
 
-bool ppstampMakeStamp (pmConfig *config, ppstampOptions *options)
+int ppstampMakeStamp (pmConfig *config, ppstampOptions *options)
 {
     bool        status = false;
-    bool        returnval = false;;
+    int        returnval = PS_EXIT_SUCCESS;;
     bool        foundOverlap = false;
 
@@ -576,5 +583,5 @@
     if (!status) {
         psError(PS_ERR_UNKNOWN, true, "Can't find input file!\n");
-        return false;
+        return PS_EXIT_DATA_ERROR;
     }
 
@@ -584,5 +591,5 @@
     } else if (astrom->camera != input->camera) {
         psError(PS_ERR_UNKNOWN, true, "Input camera and astrometry camera do not match");
-        return false;
+        return PS_EXIT_CONFIG_ERROR;
     }
 
@@ -593,5 +600,5 @@
         psError(PS_ERR_UNKNOWN, false, "Failed to load input.");
         psFree (view);
-        return false;
+        return PS_EXIT_DATA_ERROR;
     }
     bool bilevelAstrometry  = false;
@@ -607,5 +614,5 @@
             psError(PS_ERR_UNKNOWN, false, "Unable to read bilevel mosaic astrometry for input FPA.");
             psFree(view);
-            return false;
+            return PS_EXIT_DATA_ERROR;
         }
     }
@@ -640,5 +647,5 @@
             break;
         case PSTAMP_ERROR:
-            returnval = false;
+            returnval = PS_EXIT_UNKNOWN_ERROR;
             allDone = true;
             break;
@@ -660,6 +667,7 @@
     psFree(view);
 
-    if (!foundOverlap) {
+    if (!foundOverlap && (returnval == PS_EXIT_SUCCESS)) {
         fprintf(stderr, "ROI not found in input\n");
+        returnval = PSTAMP_NO_OVERLAP;
     }
 
@@ -668,2 +676,48 @@
 
 
+static bool setMaskedToNAN(pmConfig *config, psImage *image, psImage *mask, psImage *variance)
+{
+    bool status;
+    psMetadata *masks = psMetadataLookupMetadata(&status, config->recipes, "MASKS");
+    if (!status) {
+        psError(PM_ERR_CONFIG, false, "failed to lookup MASKS in recipes\n");
+        return false;
+    }
+    // we set anything masked to NAN except if CONV.POOR is the only bit set
+    // First check the old value
+    psU32 convPoor = psMetadataLookupU32(&status, masks, "POOR.WARP");
+    if (!status) {
+        convPoor = psMetadataLookupU32(&status, masks, "CONV.POOR");
+        if (!status) {
+            psError(PM_ERR_CONFIG, false, "failed to lookup mask value for CONV.POOR in recipes\n");
+            return false;
+        }
+    }
+    psU32 maskMask = ~convPoor;
+
+    double exciseValue;
+    if (image->type.type == PS_TYPE_U16) {
+        exciseValue = 0xffff;
+    } else if (image->type.type == PS_TYPE_F32) {
+        exciseValue = NAN;
+    } else {
+         psError(PS_ERR_PROGRAMMING, true, "unexpected image type: %d\n", image->type.type);
+        return false;
+    }
+    long numExcised = 0;
+    for (int y=0; y<image->numRows; y++) {
+        for (int x=0; x<image->numCols; x++) {
+            psU16 maskVal = psImageGet(mask, x, y);
+            if (maskVal & maskMask) {
+                numExcised++;
+                psImageSet(image, x, y, exciseValue);
+                if (variance) {
+                    psImageSet(variance, x, y, exciseValue);
+                }
+            }
+        }
+    }
+    fprintf(stderr, "excised %ld masked pixels\n", numExcised);
+
+    return true;
+}
Index: /branches/eam_branches/20090715/pstamp/src/pstamp.h
===================================================================
--- /branches/eam_branches/20090715/pstamp/src/pstamp.h	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/src/pstamp.h	(revision 25406)
@@ -8,7 +8,4 @@
 #include "pslib.h"
 #include "psmodules.h"
-// #include "psphot.h"
-// #include "psastro.h"
-// #include "ppStats.h"
 #include "pstampErrorCodes.h"
 
@@ -31,4 +28,23 @@
 } pspMode;
 
+// error codes returned to users in results flie
+// These must match the values in  PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm
+typedef enum {
+        PSTAMP_SUCCESS          = 0,
+	PSTAMP_SYSTEM_ERROR     = 10,
+	PSTAMP_NOT_IMPLEMENTED  = 11,
+	PSTAMP_UNKNOWN_ERROR    = 12,
+	PSTAMP_DUP_REQUEST      = 20,
+	PSTAMP_INVALID_REQUEST  = 21,
+	PSTAMP_UNKNOWN_PRODUCT  = 22,
+	PSTAMP_NO_IMAGE_MATCH   = 23,
+	PSTAMP_NOT_DESTREAKED   = 24,
+	PSTAMP_NOT_AVAILABLE    = 25,
+	PSTAMP_GONE             = 26,
+	PSTAMP_NO_JOBS_QUEUED   = 27,
+        PSTAMP_NO_OVERLAP       = 28
+} pstampJobErrors;
+
+
 #define PSTAMP_SELECT_IMAGE  1
 #define PSTAMP_SELECT_MASK   2
@@ -44,3 +60,5 @@
 #define STAMP_RESULTS_VERSION "1"
 
+
+
 #endif
Index: /branches/eam_branches/20090715/pstamp/src/pstampdump.c
===================================================================
--- /branches/eam_branches/20090715/pstamp/src/pstampdump.c	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/src/pstampdump.c	(revision 25406)
@@ -1,7 +1,7 @@
-// pstampdump  - read a fits table describing a postage stamp request or response file and
+// pstampdump  - read a fits file  containing a postage stamp request or response table and
 //               print the contents to stdout
 //
-//              Actually should work for any kind of fits table, but I'm not sure what will
-//              happen for binary data.
+//              Actually this should work fine for dumping the rows of any of any kind of fits table
+//              The -header option is pstamp table specific
 
 #include <pslib.h>
@@ -9,22 +9,35 @@
 #include <string.h>
 
-static psArray *readRequestTable(psString fileName)
+static bool readFitsFile(psString fileName, psMetadata **pHeader, psArray **pTable)
 {
-    psFits *fitsFile = psFitsOpen(fileName, "r");
-    if (fitsFile == NULL) {
+    psFits *fits = psFitsOpen(fileName, "r");
+    if (fits == NULL) {
         psError(PS_ERR_IO, false, "failed to open %s for output", fileName);
-        return NULL;
+        return false;
+    }
+    if (!psFitsMoveExtNum(fits, 1, true)) {
+        psError(PS_ERR_IO, false, "failed to move to first extension from %s", fileName);
+        return false;
     }
 
-    psArray *array = psFitsReadTable(fitsFile);
+    if (pHeader) {
+        *pHeader = psFitsReadHeader(NULL, fits);
+        if (!*pHeader) {
+            psError(PS_ERR_IO, false, "failed to header from %s", fileName);
+            return false;
+        }
+    }
 
-    psFitsClose(fitsFile);
+    if (pTable) {
+        *pTable = psFitsReadTable(fits);
+        if (*pTable == NULL) {
+            psError(PS_ERR_IO, false, "psFitsReadTable failed for %s", fileName);
+            return false;
+        }
+    }
 
-    if (array == NULL) {
-        psError(PS_ERR_IO, false, "psFitsReadTable failed for %s", fileName);
-        return NULL;
-    } 
+    psFitsClose(fits);
 
-    return array;
+    return true;
 }
 
@@ -32,9 +45,28 @@
 usage(char *program_name)
 {
-    fprintf(stderr, "usage: %s filename\n", program_name);
+    fprintf(stderr, "usage: %s [-header] [-simple] filename\n", program_name);
     exit(1);
 }
+
 int main(int argc, char *argv[])
 {
+    bool dumpHeader = false;
+    bool simple = false;
+    bool dumpTable = true;
+    int argnum;
+    if ((argnum = psArgumentGet(argc, argv, "-header"))) {
+        dumpHeader = true;
+        psArgumentRemove(argnum, &argc, argv);
+    }
+    if ((argnum = psArgumentGet(argc, argv, "-simple"))) {
+        simple = true;
+        psArgumentRemove(argnum, &argc, argv);
+    }
+    if ((argnum = psArgumentGet(argc, argv, "-headeronly"))) {
+        dumpTable = false;
+        dumpHeader = true;
+        psArgumentRemove(argnum, &argc, argv);
+    }
+
     if (argc != 2) {
         usage(argv[0]);
@@ -43,29 +75,92 @@
     psString fileName = argv[1];
 
-    psArray *array = readRequestTable(fileName);
-    if (array == NULL) {
-        psErrorStackPrint(stderr, "failed to read fits table: %s\n", fileName);
+    psMetadata *header;
+    psArray *array;
+    if (!readFitsFile(fileName, dumpHeader ? &header : NULL, dumpTable ? &array : NULL)) {
+        psErrorStackPrint(stderr, "failed to process fits table from: %s\n", fileName);
+        return PS_EXIT_DATA_ERROR;
+    }
+    if (dumpHeader) {
+        psString extname = psMetadataLookupStr(NULL, header, "EXTNAME");
+        if (!extname) {
+            psErrorStackPrint(stderr, "failed to find EXTNAME in fits header of: %s\n", fileName);
+            return PS_EXIT_DATA_ERROR;
+        }
+        psString req_name = psMetadataLookupStr(NULL, header, "REQ_NAME");
+        if (!req_name) {
+            psErrorStackPrint(stderr, "failed to find REQ_NAME in fits header of: %s\n", fileName);
+            return PS_EXIT_DATA_ERROR;
+        }
+        if (!strcmp(extname, "PS1_PS_REQUEST")) {
+            psString extver = psMetadataLookupStr(NULL, header, "EXTVER");
+            if (!extver) {
+                // work around bug in MOPS request files
+                // Accept an integer for the version number
+                psS32 extver_num = psMetadataLookupS32(NULL, header, "EXTVER");
+                if (extver_num) {
+                    psStringAppend(&extver, "%d", extver_num);
+                } else {
+                    psErrorStackPrint(stderr, "failed to find EXTVER in fits header of: %s\n", fileName);
+                    return PS_EXIT_DATA_ERROR;
+                }
+            }
+            printf("%s %s %s\n", extname, extver, req_name);
+        } else if (!strcmp(extname, "PS1_PS_RESULTS")) {
+            psS64 req_id = psMetadataLookupS64(NULL, header, "REQ_ID");
+            printf("%s %s %" PRId64 "\n", extname, req_name, req_id);
+        } else {
+            psErrorStackPrint(stderr, "do not recognize extname: %s in %s\n", extname, fileName);
+            return PS_EXIT_DATA_ERROR;
+        }
+    }
+    if (!dumpTable) {
+        // done
+        return 0;
+    }
+
+    if (!psArrayLength(array)) {
+        fprintf(stderr, "%s contains an empty table\n", fileName);
         return 1;
     }
 
-    if (!psArrayLength(array)) {
-        fprintf(stderr, "%s is an empty table\n", fileName);
-        exit(1);
-    }
-
-//    printf("FITS_TABLE METADATA\n");
     for (int i=0; i<psArrayLength(array); i++) {
-        printf("ROW_%d METADATA\n", i);
-        // psMetadataPrint(stderr, array->data[i], 0);
-        // psMetadataConfigWrite(array->data[i], "-");
         psString str = psMetadataConfigFormat(array->data[i]);
         if (!str) {
-            psErrorStackPrint(stderr, "Can't write to STDOUT\n");
-            exit(PS_EXIT_SYS_ERROR);
+            psErrorStackPrint(stderr, "failed to format metadata item\n");
+            return (PS_EXIT_SYS_ERROR);
         }
-        printf("%s", str);
-        printf("END\n");
+        if (!simple) {
+            printf("ROW_%d METADATA\n", i);
+            printf("%s", str);
+            printf("END\n");
+        } else {
+            // simple output format space separated values one line per row
+            char *p = str;
+            char *pnl;
+            while ((pnl = strchr(p, '\n'))) {
+                // terminate the string for this line
+                *pnl = 0;
+                bool blank = (p == pnl);
+                if (blank) {
+                    p = pnl + 1;
+                    continue;
+                }
+                // split line into space separated tokens
+                char *name = strtok(p, " ");
+                char *type = strtok(NULL, " ");
+                char *val = strtok(NULL, " ");
+
+                // avoid unused variables warning/error
+                (void) name; (void) type;
+
+                if (val) {
+                    printf("%s ", val);
+                }
+                // next line
+                p = pnl + 1;
+            }
+            printf("\n");
+        }
     }
-//   printf("END\n");
 
     return 0;
Index: /branches/eam_branches/20090715/pstamp/test/asteroid.txt
===================================================================
--- /branches/eam_branches/20090715/pstamp/test/asteroid.txt	(revision 25406)
+++ /branches/eam_branches/20090715/pstamp/test/asteroid.txt	(revision 25406)
@@ -0,0 +1,30 @@
+# Sample Postage stamp request description file
+# This can be parsed by the program pstamp_req_create to build a 
+# PS1_PSTAMP_REQUEST binary table
+
+# First line of data is for the extension header
+# The order of keywords follows TABLE 6 of ICD
+#
+# Note that value for REQ_NAME may be overriden by a command line
+# argument to pstamp_req_create.
+# Blank and comment lines are ignored
+
+# REQ_NAME EXTVER
+CHANGEME     1
+
+# subsequent lines define the rows in the table
+#
+
+
+# These coordinates get stamps from warp and diff images that show a moving object that mops found.
+
+# ROWNUM PROJECT       JOB_TYPE OPTION_MASK REQ_TYPE IMG_TYPE    ID      TESS_ID COMPONENT COORD_MASK CENTER_X   CENTER_Y             WIDTH HEIGHT  REQFILT MJD_MIN MJD_MAX
+
+1        gpc1           stamp     3         bydiff   warp      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
+2        gpc1           stamp     3         bydiff   diff      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
+3        gpc1           stamp     1027      bydiff   warp      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
+4        gpc1           stamp     1027      bydiff   diff      362483    NULL      NULL      2       284.688522833822 -3.86916140936841 200  200     null   0         0
+
+
+
+
Index: /branches/eam_branches/20090715/pstamp/test/gpc1_sample.txt
===================================================================
--- /branches/eam_branches/20090715/pstamp/test/gpc1_sample.txt	(revision 25406)
+++ /branches/eam_branches/20090715/pstamp/test/gpc1_sample.txt	(revision 25406)
@@ -0,0 +1,24 @@
+# REQ_NAME EXTVER
+CHANGEME 1
+# ROWNUM PROJECT JOB_TYPE OPTION_MASK REQ_TYPE IMG_TYPE    ID      TESS_ID COMPONENT   COORD_MASK CENTER_X   CENTER_Y WIDTH HEIGHT REQFILT MJD_MIN MJD_MAX
+1    gpc1   stamp 1 byid warp     6245   MD08 skycell.077 2 242.400666 55.273513 200 200 null 0 0
+2    gpc1   stamp 1 byid warp     6254   MD08 skycell.077 2 242.400666 55.273513 200 200 null 0 0
+3    gpc1   stamp 1 byid warp     6264   MD08 skycell.077 2 242.400666 55.273513 200 200 null 0 0
+4    gpc1   stamp 1 byid warp     6317   MD08 skycell.077 2 242.400666 55.273513 200 200 null 0 0
+5    gpc1   stamp 1 byid warp     6324   MD08 skycell.077 2 242.400666 55.273513 200 200 null 0 0
+6    gpc1   stamp 1 byid warp     6465   MD08 skycell.077 2 242.400666 55.273513 200 200 null 0 0
+7    gpc1   stamp 1 byid warp     6466   MD08 skycell.077 2 242.400666 55.273513 200 200 null 0 0
+
+
+# get a specific warp
+10   gpc1   stamp 1 byid  warp     6316  null skycell.077 2 242.400666 55.273513 200 200 null 0 0
+# get stamps from all warps for exposure (only destreaked ones will succeed)
+11   gpc1   stamp 1 byexp warp    o4973g0123o null skycell.077 2 242.400666 55.273513 200 200 null 0 0
+
+# get stamps from all chipRuns for exposure (only destreaked ones will succeed)
+# add the mask and weight images as well
+12   gpc1   stamp 7 byexp chip    o4973g0123o null all         2 242.400666 55.273513 200 200 null 0 0
+
+# get the corresponding diff
+13   gpc1   stamp 1 byexp diff    o4973g0123o null null        2 242.400666 55.273513 200 200 null 0 0
+
Index: anches/eam_branches/20090715/pstamp/test/sample_query.txt
===================================================================
--- /branches/eam_branches/20090715/pstamp/test/sample_query.txt	(revision 25405)
+++ 	(revision )
@@ -1,57 +1,0 @@
-# Sample Detectability Query description file used by the program
-# detect_query_create
-
-# First line of data is for the extension header
-# The order of keywords follows TABLE 6 of ICD
-# Note that value for QUERY_ID may be overriden by a command line
-# argument to detect_query_create.
-# Blank and comment lines are ignored
-
-# QUERY_ID EXTVER FPA_ID       MJD-OBS FILTER OBSCODE
-QUERY42       1   o4608g0103o   54608     g     566
-
-# subsequent lines define the rows in the table
-
-# ROWNUM     RA1_DEG        DEC1_DEG    RA2_DEG     DEC2_DEG     MAG
-1            312.44049389 30.54022727  312.44051968 30.54024139  18.4228     
-2            313.03337881 31.01317194  313.03344194 31.01324268  18.3961     
-3            312.91159232 30.95195459  312.91153476 30.95190113  18.1110     
-4            312.26742527 30.95207284  312.26744769 30.95206300  17.0908     
-5            313.20263734 30.62317841  313.20266984 30.62310935  18.2890     
-6            312.85365023 30.45667552  312.85358645 30.45661659  16.9252     
-7            312.86257534 30.73005531  312.86264564 30.73012644  16.5870     
-8            312.62651492 30.28398046  312.62654595 30.28390213  16.6911     
-9            312.30703743 30.99927709  312.30708709 30.99927981  17.4722     
-10           312.95440987 30.21452885  312.95434880 30.21444691  18.5156     
-11           313.09947609 30.93800421  313.09940219 30.93795549  17.8855     
-12           312.97417836 31.11301952  312.97423473 31.11296140  16.9911     
-13           313.11781918 30.37359317  313.11784695 30.37360958  16.7468     
-14           312.76927925 30.53972354  312.76933224 30.53976126  16.8949     
-15           313.14717536 30.25958068  313.14710913 30.25951218  16.8300     
-16           312.30604633 30.88958513  312.30599425 30.88959415  18.2257     
-17           312.43565662 30.43038293  312.43560908 30.43037934  19.0005     
-18           312.55589195 30.81649562  312.55594584 30.81655133  18.6992     
-19           312.48925222 30.79092013  312.48924050 30.79087193  19.2099     
-20           312.94560207 31.15170816  312.94554641 31.15162988  17.2162     
-21           313.19589134 30.74674862  313.19594142 30.74682054  16.6793     
-22           312.70278940 30.52926292  312.70271911 30.52926109  19.0436     
-23           312.56015422 30.77354938  312.56021167 30.77360353  19.2750     
-24           312.87989916 30.78926857  312.87996776 30.78920032  18.2502     
-25           312.81101394 30.65212801  312.81096654 30.65215390  18.5487     
-26           312.55607541 30.23260894  312.55612602 30.23263745  17.2404     
-27           312.47366234 31.02186968  312.47372919 31.02192895  18.9959     
-28           312.90062087 31.13704835  312.90061590 31.13697785  17.5652     
-29           313.01177949 31.16629118  313.01181621 31.16626516  17.0270     
-30           312.40371494 30.98672316  312.40366292 30.98677392  19.1234     
-31           312.56662477 31.01082034  312.56665651 31.01078413  17.6238     
-32           312.61398923 30.64616956  312.61399907 30.64618259  18.5522     
-33           313.07268041 30.96857880  313.07272131 30.96859005  17.7002     
-34           312.36144521 30.43367984  312.36146205 30.43373589  16.6557     
-35           312.74549146 30.89623741  312.74554546 30.89630365  18.8037     
-36           312.49256362 30.78465056  312.49260740 30.78459825  16.7909     
-37           312.92641571 30.76107785  312.92634812 30.76111408  17.2734     
-38           312.84561663 30.38510072  312.84561100 30.38515538  18.3349     
-39           312.48297202 31.08290934  312.48297374 31.08290383  17.6822     
-40           312.27670734 30.89704117  312.27664961 30.89698871  17.4518     
-41           312.82856967 30.65880493  312.82859245 30.65878537  18.8543     
-42           313.05680974 30.97207965  313.05672748 30.97211785  16.6627     
Index: anches/eam_branches/20090715/pstamp/test/sample_simtest.txt
===================================================================
--- /branches/eam_branches/20090715/pstamp/test/sample_simtest.txt	(revision 25405)
+++ 	(revision )
@@ -1,31 +1,0 @@
-# Sample Postage stamp request description file
-# This can be parsed by the program pstamp_req_create to build a 
-# PS1_PSTAMP_REQUEST binary table
-
-# First line of data is for the extension header
-# The order of keywords follows TABLE 6 of ICD
-#
-# Note that value for REQ_NAME may be overriden by a command line
-# argument to pstamp_req_create allowing this file to be re-used.
-# Blank and comment lines are ignored
-
-# REQ_NAME EXTVER
-PSREQ00001     1
-
-# subsequent lines define the rows in the table
-
-# ROWNUM PROJECT       JOB_TYPE OPTION_MASK REQ_TYPE IMG_TYPE    ID            CLASS_ID COORD_MASK CENTER_X CENTER_Y WIDTH HEIGHT REQFILT MJD_MIN MJD_MAX
-# select by exposure name
-1        simtest        stamp      1           byexp    chip   simtest.004.000  null      3       500     500         100    100     null   0    0
-
-# select by database id this happens to select the  same image a row 1 using 'chip_id'
-2        simtest        stamp      1           byid     chip      2           null        3       600     500         100    100     null   0    0
-
-# stamp from a chip processed image that resulted in diff_id = 1 sky coords for center, pixels for range
-3        simtest        stamp      1           bydiff   chip      1           null        2      270.733 -23.7039     500    500     null   0    0
-
-# ... and the corespoding warp
-4        simtest        stamp      1           bydiff   warp      1           null        2      270.733 -23.7039     500    500     null   0    0
-
-# ... and the stack
-5        simtest        stamp      1           bydiff   stack     1           null        2      270.733 -23.7039     500    500     null   0    0
Index: /branches/eam_branches/20090715/pstamp/web/authenticate.php
===================================================================
--- /branches/eam_branches/20090715/pstamp/web/authenticate.php	(revision 25406)
+++ /branches/eam_branches/20090715/pstamp/web/authenticate.php	(revision 25406)
@@ -0,0 +1,33 @@
+<?php
+
+// function check_login()
+
+session_start();
+
+// XXX TODO use mysql
+$auth_user="setme";
+$auth_passwd="setmetoo";
+
+$user   = $_SERVER['PHP_AUTH_USER'];
+$passwd = $_SERVER['PHP_AUTH_PW'];
+$did_login = isset($_SESSION['did_login']);
+
+if ($did_login && isset($user) && isset($passwd) &&
+    ($auth_user == $user) && ($auth_passwd == $passwd)) {
+
+    echo "Welcome:  " . $user;
+    echo "&nbsp;&nbsp;&nbsp; <a href=\"./logout.php\">Logout</a>";
+    echo "<br />";
+    echo "<br />";
+} else {
+    $_SESSION['did_login'] = true;
+    header('WWW-Authenticate: Basic realm="Restricted Section"');
+    header('HTTP/1.0 401 Unauthorized');
+    // The following will be output if the user hits the cancel button
+    echo "please enter username and password";
+    echo "&nbsp;&nbsp;&nbsp;<a href=\"./upload.php\">Login</a>";
+    exit;
+}
+
+?>
+
Index: /branches/eam_branches/20090715/pstamp/web/logout.php
===================================================================
--- /branches/eam_branches/20090715/pstamp/web/logout.php	(revision 25406)
+++ /branches/eam_branches/20090715/pstamp/web/logout.php	(revision 25406)
@@ -0,0 +1,18 @@
+<?php
+
+// require_once "authenticate.php";
+
+// logout();
+session_start();
+$_SESSION = array();
+if (isset($_COOKIE[session_name()])) {
+    setcookie(session_name(), '', time()-42000, '/');
+}
+session_destroy();
+
+echo "You are now logged out<br /><br />";
+echo "<a href=\"./upload.php\">Upload</a>";
+
+// phpinfo(32);
+?>
+
Index: /branches/eam_branches/20090715/pstamp/web/pstamp.php
===================================================================
--- /branches/eam_branches/20090715/pstamp/web/pstamp.php	(revision 25406)
+++ /branches/eam_branches/20090715/pstamp/web/pstamp.php	(revision 25406)
@@ -0,0 +1,6 @@
+<?php
+
+require_once "pstampconfig.php";
+require_once "authenticate.php";
+
+?>
Index: /branches/eam_branches/20090715/pstamp/web/pstampconfig.php
===================================================================
--- /branches/eam_branches/20090715/pstamp/web/pstampconfig.php	(revision 25406)
+++ /branches/eam_branches/20090715/pstamp/web/pstampconfig.php	(revision 25406)
@@ -0,0 +1,19 @@
+<?php
+// BEGIN Local configuration
+
+$WORKDIR = "set to the location of pstamp working directory";
+$dsroot = "set to the root of the data store";
+$dbname = "set to the pstamp database name";
+$dbserver = "set to the pstamp database server";
+
+$PSCONFDIR = "";
+$PSCONFIG  = "";
+$PSBINDIR  = "$PSCONFDIR/$PSCONFIG.lin64/bin";
+
+// END Local configuration 
+
+# this script sets up the environment to run IPP commands with current directory
+# $WORKDIR
+$SCRIPT    = "$PSBINDIR/pstamp_runcommand.sh $PSCONFDIR $PSCONFIG $WORKDIR";
+
+?>
Index: /branches/eam_branches/20090715/pstamp/web/request.php
===================================================================
--- /branches/eam_branches/20090715/pstamp/web/request.php	(revision 25405)
+++ /branches/eam_branches/20090715/pstamp/web/request.php	(revision 25406)
@@ -17,12 +17,15 @@
 
 
+// XXX: change to include pstampconfig.php
+
 // BEGIN Local configuration
 
-$WORKDIR = "XXXX/pstamp-work/web";
-$dsroot = "XXXX/datastore/dsroot";
-$dbname = "XXXX";
-
-$PSCONFDIR = "XXXX";
-$PSCONFIG  = "XXXX";
+$WORKDIR = "/data/ipp049.0/pstamp/work";
+$dsroot = "/data/ipp049.0/datastore/dsroot";
+$dbname = "ippRequestServer";
+$dbserver = "ipp049";
+
+$PSCONFDIR = "/data/ipp053.0/home/bills/psconfig";
+$PSCONFIG  = "debug";
 $PSBINDIR  = "$PSCONFDIR/$PSCONFIG.lin64/bin";
 
@@ -32,4 +35,6 @@
 # $WORKDIR
 $SCRIPT    = "$PSBINDIR/pstamp_runcommand.sh $PSCONFDIR $PSCONFIG $WORKDIR";
+
+// END of moved to pstampconfig.php
 
 // Initialize variables
@@ -95,5 +100,5 @@
 import_request_variables("gp", "rvar_");
 
-if ($rvar_project == "gpc1_rel_200901") {
+if ($rvar_project == "gpc1") {
     $gpc1_selected = "selected";
     $require_class_id = 1;
@@ -255,4 +260,5 @@
     global $command_line;
     global $dbname;
+    global $dbserver;
     global $require_class_id;
     global $PSCONFDIR, $PSCONFIG, $WORKDIR;
@@ -271,5 +277,5 @@
 
     if ($dbname) {
-        $cmd .= " --dbname $dbname";
+        $cmd .= " --dbname $dbname --dbserver $dbserver";
     }
 
@@ -281,5 +287,5 @@
     if ($making_stamps) {
         // TODO: put options on the GUI for these
-        $cmd .= " -mask -weight";
+//        $cmd .= " -mask -weight";
     }
 
@@ -406,5 +412,6 @@
                 global $dsroot;
                 $dirName  = "$dsroot/$product/$req_name";
-                $filesetURL = "/ds/$product/$req_name";
+                // XXX: TODO: make this a configuration parameter
+                $filesetURL = "http://datastore.ipp.ifa.hawaii.edu/$product/$req_name";
                 $fullpath = "$dirName/$fileName";
 // echo "<pre>fullpath: $fullpath filesetURL: $filesetURL\n</pre>";
@@ -412,5 +419,5 @@
                     // this job is done, list the url as a link
                     // echo "<a href=\"http:$path\" target=\"_blank\" type=\"image/fits\">";
-                    echo "<a href=\"http:$filesetURL\">";
+                    echo "<a href=\"$filesetURL\" TARGET=\"form_results_fileset\">";
 #                    echo $fileName;
                     $filesetName = basename($dirName);
@@ -463,6 +470,7 @@
     $command_line = "$SCRIPT pstamp_listjobs.pl $request_id";
     global $dbname;
+    global $dbserver;
     if ($dbname) {
-        $command_line .= " --dbname $dbname";
+        $command_line .= " --dbname $dbname --dbserver $dbserver";
     }
 
@@ -495,9 +503,10 @@
     global $outFileset;
     global $dbname;
+    global $dbserver;
     global $SCRIPT;
 
     $command_line = "$SCRIPT pstamptool -listreq -req_id $request_id -simple";
     if ($dbname) {
-        $command_line .= " -dbname $dbname";
+        $command_line .= " -dbname $dbname -dbserver $dbserver";
     }
     // echo "Running $command_line\n";
@@ -566,7 +575,9 @@
     <tr><td><b>Project:</b>&nbsp;&nbsp;&nbsp;</td>
         <td><select name="project">
-           <option <?php echo $gpc1_selected;?> >gpc1_rel_200901
+           <option <?php echo $gpc1_selected;?> >gpc1
+<!--
            <option <?php echo $mops_selected;?> >megacam-mops
            <option <?php echo $simtest_selected;?> >simtest
+-->
         </td>
     </tr>
@@ -596,9 +607,9 @@
     <td>
         <select name="img_type">" >
-            <option <?php echo $raw_selected;?>   >raw
             <option <?php echo $chip_selected;?>  >chip
             <option <?php echo $warp_selected ;?> >warp
             <option <?php echo $stack_selected;?> >stack   
             <option <?php echo $diff_selected;?>  >diff
+            <option <?php echo $raw_selected;?>   >raw
         </select>
     </td>
@@ -611,5 +622,5 @@
 &nbsp;&nbsp;&nbsp;&nbsp;
 <b>
-<?php if (0 && $rvar_project == "gpc1_rel_200901") {
+<?php if (0 && $rvar_project == "gpc1") {
         echo "Chip ID:";
       } else {
Index: /branches/eam_branches/20090715/pstamp/web/upload.php
===================================================================
--- /branches/eam_branches/20090715/pstamp/web/upload.php	(revision 25406)
+++ /branches/eam_branches/20090715/pstamp/web/upload.php	(revision 25406)
@@ -0,0 +1,115 @@
+<?php // upload.php
+
+// get the locatl configuration variables
+include "pstamp.php";
+
+
+$user = $_SERVER['PHP_AUTH_USER'];
+$passwd = $_SERVER['PHP_AUTH_PW'];
+echo "<HTML>
+<head>
+    <title>
+        Upload Postage Stamp Request File
+    </title>
+<body>
+";
+
+// echo "Hello $user $passwd";
+
+echo <<<_END
+    <form method="post" enctype="multipart/form-data" action="">
+        <label>Postage Stamp Request File:
+        <input type="file" name='filename' accept='image/x-fits' /></label>
+    <br />
+    <br />
+    <input type="submit" value="Upload" />
+    &nbsp; &nbsp; &nbsp;
+    <input type="reset" name="cancel" value="Cancel"/>
+    <br />
+    </form>
+    <br />
+_END;
+
+$command = "";
+if ($_FILES) {
+    $name = $_FILES['filename']['name'];
+    $tmp_name = $_FILES['filename']['tmp_name'];
+    $type = $_FILES['filename']['type'];
+    $size = $_FILES['filename']['size'];
+
+    if ($name && ($size > 0)) {
+  //      echo "Uploaded $size bytes for '$type' file '$name' as '$tmp_name'<br />";
+        $command = "$SCRIPT pstamp_insert_request.pl --tmp_req_file $tmp_name --dbname $dbname --dbserver $dbserver --workdir $WORKDIR";
+    }
+}
+
+class Request
+{
+    public $id;
+    public $name;
+    function __construct($p1, $p2)
+    {
+        $this->id = $p1;
+        $this->name = $p2;
+    }
+}
+
+if (!isset($_SESSION['requests'])) {
+//    echo "initializing requests\n";
+//    echo "<br />";
+    $_SESSION['requests'] = array();
+}
+
+// echo "<br />SCRIPT is <br />$SCRIPT";
+$req_id = 0;
+$req_name = "";
+$new_request = 0;
+if ($command) {
+    $command = escapeshellcmd($command);
+   // echo "<br />command:<br />$command";
+    echo "<br />";
+    exec($command, $output, $command_status);
+    if ($command_status == 0) {
+        // it worked!
+        $req_id = $output[0];
+        // get rid of any whitespace in req_name
+        $req_name = trim($output[1]);
+        echo "Submitted Request ID:&nbsp; $req_id Request Name: &nbsp; $req_name<br \>";
+        $new_request = new Request($req_id, $req_name);
+        $num = count($_SESSION['requests']);
+//        echo "request array length: $num<br />";
+        $_SESSION['requests'][$num] = $new_request;
+        $num = count($_SESSION['requests']);
+//        echo "after request array length: $num<br />";
+    } else if ($command_status == 5) {
+        // PS_EXIT_DATA_ERROR
+        echo "Error:&nbsp;&nbsp;&nbsp;";
+        for ($i=0; $i < count($output); $i++) {
+            echo $output[$i];
+        }
+        echo "<br />\n";
+    } else {
+        echo "Unexpected Error.<br /> insert command returned $command_status<br \>";
+    }
+}
+echo "<br />";
+
+foreach ($_SESSION['requests'] as $req) {
+    echo "<br />";
+    echo $req->id;
+    echo "&nbsp;&nbsp";
+    $name = $req->name;
+    echo "&nbsp;&nbsp";
+    // XXX: get this data store product location a configuation
+    echo "<a href=\"http://datastore.ipp.ifa.hawaii.edu/pstampresults/$name\" TARGET=\"upload_results_fileset\">$name</a>\n";
+}
+echo "<br />";
+
+// print lots of information
+// phpinfo(-1);
+// print the most useful variables
+// phpinfo(32);
+
+echo "</body></html>";
+
+?>
Index: /branches/eam_branches/20090715/pswarp/src/pswarpLoop.c
===================================================================
--- /branches/eam_branches/20090715/pswarp/src/pswarpLoop.c	(revision 25405)
+++ /branches/eam_branches/20090715/pswarp/src/pswarpLoop.c	(revision 25406)
@@ -315,20 +315,4 @@
 
 
-    // Set variance factor
-    {
-        bool mdok;                      // Status of MD lookup
-        float varFactor = psMetadataLookupF32(&mdok, output->analysis, PSWARP_ANALYSIS_VARFACTOR);
-        long goodPix = psMetadataLookupS64(&mdok, output->analysis, PSWARP_ANALYSIS_GOODPIX);
-        varFactor /= goodPix;
-
-        psMetadataItem *vfItem = psMetadataLookup(outCell->concepts, "CELL.VARFACTOR"); ///< Item to update
-        psAssert(vfItem && vfItem->type == PS_TYPE_F32, "Concept should be as specified.");
-        if (!isfinite(vfItem->data.F32)) {
-            vfItem->data.F32 = varFactor;
-        } else {
-            vfItem->data.F32 *= varFactor;
-        }
-    }
-
     // Set covariance matrix for output
     {
@@ -406,11 +390,4 @@
         pmFPAview *view = pmFPAviewAlloc(0); ///< View into skycell
         view->chip = view->cell = view->readout = 0;
-
-        // Need to adjust the weight --- the main operation in psphotReadoutFindPSF is not determining the
-        // signficance of sources, but looking at the significance of individual pixels.
-        // We can adjust the weight directly since this is a deep copy
-        pmReadout *photRO = pmFPAviewThisReadout(view, photFile->fpa);
-        float vf = psMetadataLookupF32(NULL, photRO->parent->concepts, "CELL.VARFACTOR"); // Variance factor
-        psBinaryOp(photRO->variance, photRO->variance, "*", psScalarAlloc(vf, PS_TYPE_F32));
 
         // grab the sources of interest from the storage location (pmFPAfile PSPHOT.INPUT.CMF)
Index: /branches/eam_branches/20090715/pswarp/src/pswarpTransformReadout.c
===================================================================
--- /branches/eam_branches/20090715/pswarp/src/pswarpTransformReadout.c	(revision 25405)
+++ /branches/eam_branches/20090715/pswarp/src/pswarpTransformReadout.c	(revision 25406)
@@ -178,27 +178,4 @@
         psTrace("pswarp.transform", 1, "No overlap\n");
     }
-
-    // Store the variance factor and number of good pixels
-    if (goodPixels > 0) {
-        // Variance factor: large factor --> small scale
-        float varFactor = psImageInterpolateVarianceFactor(input->image->numCols / 2.0 + input->image->col0,
-                                                           input->image->numRows / 2.0 + input->image->row0,
-                                                           interp->mode);
-        psMetadataItem *vfItem = psMetadataLookup(output->analysis, PSWARP_ANALYSIS_VARFACTOR);
-        if (vfItem) {
-            psMetadataItem *goodpixItem = psMetadataLookup(output->analysis, PSWARP_ANALYSIS_GOODPIX);
-            psAssert(goodpixItem, "It should be where we left it!");
-            psAssert(vfItem->type == PS_TYPE_F32 && goodpixItem->type == PS_TYPE_S64,
-                     "Should be the type we said.");
-
-            vfItem->data.F32 += varFactor * goodPixels;
-            goodpixItem->data.S64 += goodPixels;
-        } else {
-            psMetadataAddF32(output->analysis, PS_LIST_TAIL, PSWARP_ANALYSIS_VARFACTOR, 0,
-                             "Variance factor weighted by the good pixels", varFactor * goodPixels);
-            psMetadataAddS64(output->analysis, PS_LIST_TAIL, PSWARP_ANALYSIS_GOODPIX, 0,
-                             "Number of good pixels", goodPixels);
-        }
-    }
     psFree(interp);
 
