--- mkyaffs2image.c    2010-11-12 19:03:49.515625000 +0800
+++ mkyaffs2image_inband.c    2010-11-25 12:04:01.296875000 +0800
@@ -42,10 +42,21 @@
 #define MAX_OBJECTS 10000
 
 // Adjust these to match your NAND LAYOUT:
-#define chunkSize 2048
+//#define chunkSize 2048
 #define spareSize 64
 #define pagesPerBlock 64
 
+#define inbandSize 16
+
+
+#define inbandtag     
+
+#ifdef inbandtag
+//chunksize=pagesize-inbandsize;
+#define chunkSize 2032
+#else
+#define chunkSize 2048
+#endif
 
 
 typedef struct
@@ -207,6 +218,7 @@
     }
 
     nPages++;
+#ifndef inbandtag
 
     memset(&pt, 0, sizeof(pt));
     yaffs_pack_tags2(&pt,&t,1);
@@ -217,6 +229,13 @@
     if (write(outFile,spareData,sizeof(spareData)) != sizeof(spareData))
         fatal("write");
     return 0;
+#else
+    yaffs_packed_tags2_tags_only pt2tp;
+    yaffs_pack_tags2_tags_only(&pt2tp,&t);
+    if(write(outFile,&pt2tp,inbandSize)!=inbandSize)
+        fatal("write");
+    return 0;
+#endif
 }
 
 #define SWAP32(x)   ((((x) & 0x000000FF) << 24) | \