Index: branches/pap/ippTools/src/disttool.c
===================================================================
--- branches/pap/ippTools/src/disttool.c	(revision 28498)
+++ branches/pap/ippTools/src/disttool.c	(revision 28503)
@@ -210,4 +210,20 @@
             psStringAppend(&query, " AND (chipRun.dist_group = '%s')", dist_group);
         }
+    } else if (!strcmp(stage, "chip_bg")) {
+        magicRunType = "chipBackgroundRun";
+        runJoinStr = "chipBackgroundRun.chip_bg_id";
+        query = pxDataGet("disttool_definebyquery_chip_bg.sql");
+        if (!query) {
+            psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
+            psFree(where);
+            return false;
+        }
+
+        if (label) {
+            psStringAppend(&query, " AND (chipBackgroundRun.label = '%s')", label);
+        }
+        if (dist_group) {
+            psStringAppend(&query, " AND (chipBackgroundRun.dist_group = '%s')", dist_group);
+        }
     } else if (!strcmp(stage, "camera")) {
         magicRunType = "camRun";    // This is used below to set the magicked business
@@ -258,4 +274,21 @@
         if (dist_group) {
             psStringAppend(&query, " AND (warpRun.dist_group = '%s')", dist_group);
+        }
+
+    } else if (!strcmp(stage, "warp_bg")) {
+        magicRunType = "warpBackgroundRun";
+        runJoinStr = "warpBackgroundRun.warp_bg_id";
+        query = pxDataGet("disttool_definebyquery_warp_bg.sql");
+        if (!query) {
+            psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
+            psFree(where);
+            return false;
+        }
+
+        if (label) {
+            psStringAppend(&query, " AND (warpBackgroundRun.label = '%s')", label);
+        }
+        if (dist_group) {
+            psStringAppend(&query, " AND (warpBackgroundRun.dist_group = '%s')", dist_group);
         }
 
