Patchwork [16/26] yaffs2: Update patch and checksums

login
register
mail settings
Submitter Saul Wold
Date May 5, 2011, 7:57 a.m.
Message ID <89ad58928522adf83d5e25b5ed43eed7b2825984.1304581770.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/3229/
State New, archived
Headers show

Comments

Saul Wold - May 5, 2011, 7:57 a.m.
From: Saul Wold <sgw@linux.intel.com>

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 .../yaffs2/files/mkyaffs2image.patch               |  116 ++++++++++----------
 meta/recipes-devtools/yaffs2/yaffs2-utils.inc      |    2 +-
 2 files changed, 61 insertions(+), 57 deletions(-)

Patch

diff --git a/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch b/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch
index 521f1ba..e55d58b 100644
--- a/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch
+++ b/meta/recipes-devtools/yaffs2/files/mkyaffs2image.patch
@@ -18,10 +18,11 @@ 
  * And BTW, what was one supposed to do with that file that this horror
  * occasionally managed to generate?
  */
-diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
---- yaffs2.orig/utils/mkyaffs2image.c   2005-12-12 16:34:58.000000000 -0800
-+++ yaffs2/utils/mkyaffs2image.c    2006-02-10 16:56:13.000000000 -0800
-@@ -31,10 +47,10 @@
+Index: yaffs2/utils/mkyaffs2image.c
+===================================================================
+--- yaffs2.orig/utils/mkyaffs2image.c	2010-01-11 13:43:18.000000000 -0800
++++ yaffs2/utils/mkyaffs2image.c	2011-05-04 14:50:42.045984700 -0700
+@@ -29,10 +29,10 @@
  #include <dirent.h>
  #include <string.h>
  #include <unistd.h>
@@ -33,53 +34,55 @@  diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
  #include "yaffs_packedtags2.h"
  
  unsigned yaffs_traceMask=0;
-@@ -43,9 +59,45 @@
+@@ -41,9 +41,47 @@
  
  #define chunkSize 2048
  #define spareSize 64
 +#define PT2_BYTES 25
++
  
- const char * mkyaffsimage_c_version = "$Id: mkyaffs2image.c,v 1.4 2007-02-14 01:09:06 wookey Exp $";
+ const char * mkyaffsimage_c_version = "$Id: mkyaffs2image.c,v 1.5 2010-01-11 21:43:18 charles Exp $";
  
-+static int	layout_no;
++static int     layout_no;
 +
 +static struct nand_oobinfo oob_layout[] = {
-+        /* KSI:
-+         * Dummy "raw" layout - no ECC, all the bytes are free. Does NOT
-+         * really work, only used for compatibility with CVS YAFFS2 that
-+         * never ever worked with any stock MTD.
-+         */
-+        {
-+        	.useecc = MTD_NANDECC_AUTOPLACE,
-+        	.eccbytes = 0,
-+        	.eccpos = {},
-+        	.oobfree = { {0, 64} }
-+        },
-+        /* KSI:
-+         * Regular MTD AUTOPLACED ECC for large page NAND devices, the
-+         * only one existing in stock MTD so far. It corresponds to layout# 1
-+         * in command line arguments. Any other layouts could be added to
-+         * the list when they made their way in kernel's MTD. The structure
-+         * is simply copied from kernel's drivers/mtd/nand/nand_base.c as-is.
-+         */
-+        {
-+        	.useecc = MTD_NANDECC_AUTOPLACE,
-+        	.eccbytes = 24,
-+        	.eccpos = {
-+	        	40, 41, 42, 43, 44, 45, 46, 47,
-+	        	48, 49, 50, 51, 52, 53, 54, 55,
-+	        	56, 57, 58, 59, 60, 61, 62, 63},
-+        	.oobfree = { {2, 38} }
-+        },
-+        /* End-of-list marker */
-+        {
-+                .useecc = -1,
-+        }
++	/* KSI:
++	 * Dummy "raw" layout - no ECC, all the bytes are free. Does NOT
++	 * really work, only used for compatibility with CVS YAFFS2 that
++	 * never ever worked with any stock MTD.
++	 */
++	{
++		.useecc = MTD_NANDECC_AUTOPLACE,
++		.eccbytes = 0,
++		.eccpos = {},
++		.oobfree = { {0, 64} }
++	},
++	/* KSI:
++	 * Regular MTD AUTOPLACED ECC for large page NAND devices, the
++	 * only one existing in stock MTD so far. It corresponds to layout# 1
++	 * in command line arguments. Any other layouts could be added to
++	 * the list when they made their way in kernel's MTD. The structure
++	 * is simply copied from kernel's drivers/mtd/nand/nand_base.c as-is.
++	 */
++	{
++		.useecc = MTD_NANDECC_AUTOPLACE,
++		.eccbytes = 24,
++		.eccpos = {
++			40, 41, 42, 43, 44, 45, 46, 47,
++			48, 49, 50, 51, 52, 53, 54, 55,
++			56, 57, 58, 59, 60, 61, 62, 63},
++		.oobfree = { {2, 38} }
++	},
++	/* End-of-list marker */
++	{
++		.useecc = -1,
++	}
 +};
++
  
  typedef struct
  {
-@@ -59,7 +111,7 @@
+@@ -57,7 +95,7 @@
  static int n_obj = 0;
  static int obj_id = YAFFS_NOBJECT_BUCKETS + 1;
  
@@ -88,7 +91,7 @@  diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
  
  static int outFile;
  
-@@ -123,6 +175,11 @@
+@@ -121,6 +159,11 @@
  	return -1;
  }
  
@@ -100,7 +103,7 @@  diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
  /* This little function converts a little endian tag to a big endian tag.
   * NOTE: The tag is not usable after this other than calculating the CRC
   * with.
-@@ -155,11 +212,56 @@
+@@ -153,11 +196,56 @@
      tags->asBytes[7] = temp.asBytes[7];
  #endif
  }
@@ -157,7 +160,7 @@  diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
  
  	error = write(outFile,data,chunkSize);
  	if(error < 0) return error;
-@@ -177,18 +279,27 @@
+@@ -175,18 +263,28 @@
  // added NCB **CHECK**
  	t.chunkUsed = 1;
  
@@ -171,25 +174,26 @@  diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
  
  	nPages++;
  
- 	yaffs_PackTags2(&pt,&t);
+ 	yaffs_PackTags2(&pt,&t,1);
 -	
 -//	return write(outFile,&pt,sizeof(yaffs_PackedTags2));
 -	return write(outFile,&pt,spareSize);
 -	
 +
-+        memset(spare_buf, 0xff, sizeof(spare_buf));
-+        
-+        if (layout_no == 0) {
-+                memcpy(spare_buf, &pt, sizeof(yaffs_PackedTags2));
-+        } else {
-+                nandmtd2_pt2buf(spare_buf, &pt);
-+        }	
++	memset(spare_buf, 0xff, sizeof(spare_buf));
++
++	if (layout_no == 0) {
++		memcpy(spare_buf, &pt, sizeof(yaffs_PackedTags2));
++	} else {
++		nandmtd2_pt2buf(spare_buf, &pt);
++	}      
 +
 +	return write(outFile,spare_buf,spareSize);
++
  }
  
  #define SWAP32(x)   ((((x) & 0x000000FF) << 24) | \
-@@ -199,6 +310,8 @@
+@@ -197,6 +295,8 @@
  #define SWAP16(x)   ((((x) & 0x00FF) << 8) | \
                       (((x) & 0xFF00) >> 8))
          
@@ -198,7 +202,7 @@  diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
  // This one is easier, since the types are more standard. No funky shifts here.
  static void object_header_little_to_big_endian(yaffs_ObjectHeader* oh)
  {
-@@ -256,6 +369,7 @@
+@@ -254,6 +354,7 @@
      oh->roomToGrow[11] = SWAP32(oh->roomToGrow[11]);
  #endif
  }
@@ -206,7 +210,7 @@  diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
  
  static int write_object_header(int objId, yaffs_ObjectType t, struct stat *s, int parent, const char *name, int equivalentObj, const char * alias)
  {
-@@ -300,10 +414,13 @@
+@@ -298,10 +399,13 @@
  		strncpy(oh->alias,alias,YAFFS_MAX_ALIAS_LENGTH);
  	}
  
@@ -220,7 +224,7 @@  diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
  	
  	return write_chunk(bytes,objId,0,0xffff);
  	
-@@ -319,7 +436,7 @@
+@@ -317,7 +421,7 @@
  	nDirectories++;
  	
  	dir = opendir(path);
@@ -229,7 +233,7 @@  diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
  	if(dir)
  	{
  		while((entry = readdir(dir)) != NULL)
-@@ -403,12 +520,12 @@
+@@ -401,12 +505,12 @@
  									   error = nBytes;
  									   
  									printf("%d data chunks written\n",chunk);
@@ -243,7 +247,7 @@  diff -urN yaffs2.orig/utils/mkyaffs2image.c yaffs2/utils/mkyaffs2image.c
  								
  							}							
  														
-@@ -448,58 +565,82 @@
+@@ -446,58 +550,82 @@
  				}
  			}
  		}
diff --git a/meta/recipes-devtools/yaffs2/yaffs2-utils.inc b/meta/recipes-devtools/yaffs2/yaffs2-utils.inc
index 0863fee..23e202d 100644
--- a/meta/recipes-devtools/yaffs2/yaffs2-utils.inc
+++ b/meta/recipes-devtools/yaffs2/yaffs2-utils.inc
@@ -2,7 +2,7 @@  DESCRIPTION = "Tools for managing 'yaffs2' file systems."
 SECTION = "base"
 HOMEPAGE = "http://www.yaffs.net"
 LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://yaffs_fs.c;beginline=1;endline=19;md5=353dca22c3100881669871c4bd5cbf73"
+LIC_FILES_CHKSUM = "file://yaffs_fs.c;beginline=1;endline=19;md5=9e87e2e9244febcc0dffb752cb7679e1"
 PV = "0.0.0+cvs${SRCDATE}"
 PR = "r0"
 DEPENDS = "mtd-utils"