summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/mtd
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/mtd')
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils-1.3.1/add-exclusion-to-mkfs-jffs2-git-2.patch101
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils-1.3.1/add-oobsize-64-and-writesize-4096-as-normal-nand.patch24
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git.patch134
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/fix-ignoreerrors-git.patch26
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils/remove-ubi.patch33
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils_1.1.0+git.bb29
-rw-r--r--meta/recipes-devtools/mtd/mtd-utils_1.3.1.bb26
7 files changed, 373 insertions, 0 deletions
diff --git a/meta/recipes-devtools/mtd/mtd-utils-1.3.1/add-exclusion-to-mkfs-jffs2-git-2.patch b/meta/recipes-devtools/mtd/mtd-utils-1.3.1/add-exclusion-to-mkfs-jffs2-git-2.patch
new file mode 100644
index 0000000000..fb776fddce
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils-1.3.1/add-exclusion-to-mkfs-jffs2-git-2.patch
@@ -0,0 +1,101 @@
1--- /tmp/mkfs.jffs2.c 2009-01-11 15:28:41.000000000 +0100
2+++ git/mkfs.jffs2.c 2009-01-11 15:59:29.000000000 +0100
3@@ -100,6 +100,11 @@
4 struct rb_node hardlink_rb;
5 };
6
7+struct ignorepath_entry {
8+ struct ignorepath_entry* next; /* Points to the next ignorepath element */
9+ char name[PATH_MAX]; /* Name of the entry */
10+};
11+static struct ignorepath_entry* ignorepath = 0;
12 struct rb_root hardlinks;
13 static int out_fd = -1;
14 static int in_fd = -1;
15@@ -408,7 +413,7 @@
16 char *hpath, *tpath;
17 struct dirent *dp, **namelist;
18 struct filesystem_entry *entry;
19-
20+ struct ignorepath_entry* element = ignorepath;
21
22 if (lstat(hostpath, &sb)) {
23 perror_msg_and_die("%s", hostpath);
24@@ -417,6 +422,15 @@
25 entry = add_host_filesystem_entry(targetpath, hostpath,
26 sb.st_uid, sb.st_gid, sb.st_mode, 0, parent);
27
28+ while ( element ) {
29+ if ( strcmp( element->name, targetpath ) == 0 ) {
30+ printf( "Note: ignoring directories below '%s'\n", targetpath );
31+ return entry;
32+ break;
33+ }
34+ element = element->next;
35+ }
36+
37 n = scandir(hostpath, &namelist, 0, alphasort);
38 if (n < 0) {
39 perror_msg_and_die("opening directory %s", hostpath);
40@@ -1453,6 +1467,7 @@
41 {"root", 1, NULL, 'r'},
42 {"pagesize", 1, NULL, 's'},
43 {"eraseblock", 1, NULL, 'e'},
44+ {"ignore", 1, NULL, 'I'},
45 {"output", 1, NULL, 'o'},
46 {"help", 0, NULL, 'h'},
47 {"verbose", 0, NULL, 'v'},
48@@ -1500,6 +1515,7 @@
49 " -L, --list-compressors Show the list of the avaiable compressors\n"
50 " -t, --test-compression Call decompress and compare with the original (for test)\n"
51 " -n, --no-cleanmarkers Don't add a cleanmarker to every eraseblock\n"
52+" -I, --ignore=PATH Ignore sub directory and file tree below PATH when recursing over the file system\n"
53 " -o, --output=FILE Output to FILE (default: stdout)\n"
54 " -l, --little-endian Create a little-endian filesystem\n"
55 " -b, --big-endian Create a big-endian filesystem\n"
56@@ -1666,6 +1682,7 @@
57 char *compr_name = NULL;
58 int compr_prior = -1;
59 int warn_page_size = 0;
60+ struct ignorepath_entry* element = ignorepath;
61
62 page_size = sysconf(_SC_PAGESIZE);
63 if (page_size < 0) /* System doesn't know so ... */
64@@ -1676,7 +1693,7 @@
65 jffs2_compressors_init();
66
67 while ((opt = getopt_long(argc, argv,
68- "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
69+ "D:d:r:s:I:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
70 {
71 switch (opt) {
72 case 'D':
73@@ -1700,6 +1717,28 @@
74 warn_page_size = 0; /* set by user, so don't need to warn */
75 break;
76
77+ case 'I':
78+ printf( "Note: Adding '%s' to ignore Path\n", optarg );
79+ element = ignorepath;
80+ if ( !ignorepath ) {
81+ ignorepath = xmalloc( sizeof( struct ignorepath_entry ) );
82+ ignorepath->next = 0;
83+ strcpy( &ignorepath->name[0], optarg );
84+ } else {
85+ while ( element->next ) element = element->next;
86+ element->next = xmalloc( sizeof( struct ignorepath_entry ) );
87+ element->next->next = 0;
88+ strcpy( &element->next->name[0], optarg );
89+ }
90+ printf( "--------- Dumping ignore path list ----------------\n" );
91+ element = ignorepath;
92+ while ( element ) {
93+ printf( " * '%s'\n", &element->name[0] );
94+ element = element->next;
95+ }
96+ printf( "---------------------------------------------------\n" );
97+ break;
98+
99 case 'o':
100 if (out_fd != -1) {
101 error_msg_and_die("output filename specified more than once");
diff --git a/meta/recipes-devtools/mtd/mtd-utils-1.3.1/add-oobsize-64-and-writesize-4096-as-normal-nand.patch b/meta/recipes-devtools/mtd/mtd-utils-1.3.1/add-oobsize-64-and-writesize-4096-as-normal-nand.patch
new file mode 100644
index 0000000000..64f25f79e1
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils-1.3.1/add-oobsize-64-and-writesize-4096-as-normal-nand.patch
@@ -0,0 +1,24 @@
1Index: git/nanddump.c
2===================================================================
3--- git.orig/nanddump.c 2010-04-29 10:24:15.000000000 +0200
4+++ git/nanddump.c 2010-04-29 10:28:45.000000000 +0200
5@@ -210,6 +210,7 @@
6
7 /* Make sure device page sizes are valid */
8 if (!(meminfo.oobsize == 128 && meminfo.writesize == 4096) &&
9+ !(meminfo.oobsize == 64 && meminfo.writesize == 4096) &&
10 !(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
11 !(meminfo.oobsize == 32 && meminfo.writesize == 1024) &&
12 !(meminfo.oobsize == 16 && meminfo.writesize == 512) &&
13Index: git/nandwrite.c
14===================================================================
15--- git.orig/nandwrite.c 2010-04-29 09:59:30.000000000 +0200
16+++ git/nandwrite.c 2010-04-29 10:27:51.000000000 +0200
17@@ -294,6 +294,7 @@
18 if (!(meminfo.oobsize == 16 && meminfo.writesize == 512) &&
19 !(meminfo.oobsize == 8 && meminfo.writesize == 256) &&
20 !(meminfo.oobsize == 64 && meminfo.writesize == 2048) &&
21+ !(meminfo.oobsize == 64 && meminfo.writesize == 4096) &&
22 !(meminfo.oobsize == 128 && meminfo.writesize == 4096)) {
23 fprintf(stderr, "Unknown flash (not normal NAND)\n");
24 close(fd);
diff --git a/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git.patch b/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git.patch
new file mode 100644
index 0000000000..5555654490
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git.patch
@@ -0,0 +1,134 @@
1---
2 mkfs.jffs2.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
3 1 file changed, 42 insertions(+), 2 deletions(-)
4
5--- git.orig/mkfs.jffs2.c
6+++ git/mkfs.jffs2.c
7@@ -98,10 +98,16 @@ struct filesystem_entry {
8 struct filesystem_entry *next; /* Only relevant to non-directories */
9 struct filesystem_entry *files; /* Only relevant to directories */
10 struct rb_node hardlink_rb;
11 };
12
13+struct ignorepath_entry {
14+ struct ignorepath_entry* next; /* Points to the next ignorepath element */
15+ char name[PATH_MAX]; /* Name of the entry */
16+};
17+
18+static struct ignorepath_entry* ignorepath = 0;
19 struct rb_root hardlinks;
20 static int out_fd = -1;
21 static int in_fd = -1;
22 static char default_rootdir[] = ".";
23 static char *rootdir = default_rootdir;
24@@ -404,19 +410,28 @@ static struct filesystem_entry *recursiv
25 int i, n;
26 struct stat sb;
27 char *hpath, *tpath;
28 struct dirent *dp, **namelist;
29 struct filesystem_entry *entry;
30-
31+ struct ignorepath_entry* element = ignorepath;
32
33 if (lstat(hostpath, &sb)) {
34 perror_msg_and_die("%s", hostpath);
35 }
36
37 entry = add_host_filesystem_entry(targetpath, hostpath,
38 sb.st_uid, sb.st_gid, sb.st_mode, 0, parent);
39
40+ while ( element ) {
41+ if ( strcmp( element->name, targetpath ) == 0 ) {
42+ printf( "Note: ignoring directories below '%s'\n", targetpath );
43+ return entry;
44+ break;
45+ }
46+ element = element->next;
47+ }
48+
49 n = scandir(hostpath, &namelist, 0, alphasort);
50 if (n < 0) {
51 perror_msg_and_die("opening directory %s", hostpath);
52 }
53
54@@ -1446,10 +1461,11 @@ static void create_target_filesystem(str
55 static struct option long_options[] = {
56 {"pad", 2, NULL, 'p'},
57 {"root", 1, NULL, 'r'},
58 {"pagesize", 1, NULL, 's'},
59 {"eraseblock", 1, NULL, 'e'},
60+ {"ignore", 1, NULL, 'I'},
61 {"output", 1, NULL, 'o'},
62 {"help", 0, NULL, 'h'},
63 {"verbose", 0, NULL, 'v'},
64 {"version", 0, NULL, 'V'},
65 {"big-endian", 0, NULL, 'b'},
66@@ -1493,10 +1509,11 @@ static char *helptext =
67 " -y, --compressor-priority=PRIORITY:COMPRESSOR_NAME\n"
68 " Set the priority of a compressor\n"
69 " -L, --list-compressors Show the list of the avaiable compressors\n"
70 " -t, --test-compression Call decompress and compare with the original (for test)\n"
71 " -n, --no-cleanmarkers Don't add a cleanmarker to every eraseblock\n"
72+" -I, --ignore=PATH Ignore sub directory and file tree below PATH when recursing over the file system\n"
73 " -o, --output=FILE Output to FILE (default: stdout)\n"
74 " -l, --little-endian Create a little-endian filesystem\n"
75 " -b, --big-endian Create a big-endian filesystem\n"
76 " -D, --devtable=FILE Use the named FILE as a device table file\n"
77 " -f, --faketime Change all file times to '0' for regression testing\n"
78@@ -1659,21 +1676,22 @@ int main(int argc, char **argv)
79 FILE *devtable = NULL;
80 struct filesystem_entry *root;
81 char *compr_name = NULL;
82 int compr_prior = -1;
83 int warn_page_size = 0;
84+ struct ignorepath_entry* element = ignorepath;
85
86 page_size = sysconf(_SC_PAGESIZE);
87 if (page_size < 0) /* System doesn't know so ... */
88 page_size = 4096; /* ... we make an educated guess */
89 if (page_size != 4096)
90 warn_page_size = 1; /* warn user if page size not 4096 */
91
92 jffs2_compressors_init();
93
94 while ((opt = getopt_long(argc, argv,
95- "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
96+ "D:d:r:s:I:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
97 {
98 switch (opt) {
99 case 'D':
100 devtable = xfopen(optarg, "r");
101 if (fstat(fileno(devtable), &sb) < 0)
102@@ -1693,10 +1711,32 @@ int main(int argc, char **argv)
103 case 's':
104 page_size = strtol(optarg, NULL, 0);
105 warn_page_size = 0; /* set by user, so don't need to warn */
106 break;
107
108+ case 'I':
109+ printf( "Note: Adding '%s' to ignore Path\n", optarg );
110+ element = ignorepath;
111+ if ( !ignorepath ) {
112+ ignorepath = xmalloc( sizeof( struct ignorepath_entry ) );
113+ ignorepath->next = 0;
114+ strcpy( &ignorepath->name[0], optarg );
115+ } else {
116+ while ( element->next ) element = element->next;
117+ element->next = xmalloc( sizeof( struct ignorepath_entry ) );
118+ element->next->next = 0;
119+ strcpy( &element->next->name[0], optarg );
120+ }
121+ printf( "--------- Dumping ignore path list ----------------\n" );
122+ element = ignorepath;
123+ while ( element ) {
124+ printf( " * '%s'\n", &element->name[0] );
125+ element = element->next;
126+ }
127+ printf( "---------------------------------------------------\n" );
128+ break;
129+
130 case 'o':
131 if (out_fd != -1) {
132 error_msg_and_die("output filename specified more than once");
133 }
134 out_fd = open(optarg, O_CREAT | O_TRUNC | O_RDWR, 0644);
diff --git a/meta/recipes-devtools/mtd/mtd-utils/fix-ignoreerrors-git.patch b/meta/recipes-devtools/mtd/mtd-utils/fix-ignoreerrors-git.patch
new file mode 100644
index 0000000000..bec60a18c1
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/fix-ignoreerrors-git.patch
@@ -0,0 +1,26 @@
1---
2 nanddump.c | 4 ++--
3 1 file changed, 2 insertions(+), 2 deletions(-)
4
5Index: git/nanddump.c
6===================================================================
7--- git.orig/nanddump.c 2007-01-23 15:42:34.000000000 +0000
8+++ git/nanddump.c 2007-01-23 15:47:57.000000000 +0000
9@@ -281,7 +281,7 @@ int main(int argc, char **argv)
10 }
11 }
12
13- if (badblock) {
14+ if (badblock && !ignoreerrors) {
15 if (omitbad)
16 continue;
17 memset (readbuf, 0xff, bs);
18@@ -335,7 +335,7 @@ int main(int argc, char **argv)
19 if (omitoob)
20 continue;
21
22- if (badblock) {
23+ if (badblock && !ignoreerrors) {
24 memset (readbuf, 0xff, meminfo.oobsize);
25 } else {
26 /* Read OOB data and exit on failure */
diff --git a/meta/recipes-devtools/mtd/mtd-utils/remove-ubi.patch b/meta/recipes-devtools/mtd/mtd-utils/remove-ubi.patch
new file mode 100644
index 0000000000..4928db00be
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/remove-ubi.patch
@@ -0,0 +1,33 @@
1---
2 Makefile | 3 ---
3 1 file changed, 3 deletions(-)
4
5--- git.orig/Makefile
6+++ git/Makefile
7@@ -41,19 +41,17 @@ $(BUILDDIR)/%.o: %.c
8 $(CC) $(CFLAGS) -g -c -o $@ $< -g -Wp,-MD,$(BUILDDIR)/.$(<F).dep
9
10 .SUFFIXES:
11
12 all: $(TARGETS)
13- make -C $(BUILDDIR)/ubi-utils
14
15 IGNORE=${wildcard $(BUILDDIR)/.*.c.dep}
16 -include ${IGNORE}
17
18 clean:
19 rm -f $(BUILDDIR)/*.o $(TARGETS) $(BUILDDIR)/.*.c.dep $(SYMLINKS)
20 if [ "$(BUILDDIR)x" != ".x" ]; then rm -rf $(BUILDDIR); fi
21- make -C $(BUILDDIR)/ubi-utils clean
22
23 $(SYMLINKS):
24 ln -sf ../fs/jffs2/$@ $@
25
26 $(BUILDDIR)/mkfs.jffs2: $(BUILDDIR)/crc32.o \
27@@ -91,6 +89,5 @@ $(BUILDDIR)/fectest: $(BUILDDIR)/fectest
28 install: ${TARGETS}
29 mkdir -p ${DESTDIR}/${SBINDIR}
30 install -m0755 ${TARGETS} ${DESTDIR}/${SBINDIR}/
31 mkdir -p ${DESTDIR}/${MANDIR}/man1
32 gzip -9c mkfs.jffs2.1 > ${DESTDIR}/${MANDIR}/man1/mkfs.jffs2.1.gz
33- make -C $(BUILDDIR)/ubi-utils install
diff --git a/meta/recipes-devtools/mtd/mtd-utils_1.1.0+git.bb b/meta/recipes-devtools/mtd/mtd-utils_1.1.0+git.bb
new file mode 100644
index 0000000000..12e1c75e31
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils_1.1.0+git.bb
@@ -0,0 +1,29 @@
1DESCRIPTION = "Tools for managing memory technology devices."
2SECTION = "base"
3DEPENDS = "zlib lzo"
4HOMEPAGE = "http://www.linux-mtd.infradead.org/"
5LICENSE = "GPLv2"
6PR = "r2"
7
8SRC_URI = "git://git.infradead.org/mtd-utils.git;protocol=git;tag=b995f89a81589be8d8a41c374a6df109d0ee12b3 \
9 file://add-exclusion-to-mkfs-jffs2-git.patch;patch=1 \
10 file://remove-ubi.patch;patch=1 \
11 file://fix-ignoreerrors-git.patch;patch=1"
12
13S = "${WORKDIR}/git/"
14
15EXTRA_OEMAKE = "'CC=${CC}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR'"
16
17do_install () {
18 oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
19 install -d ${D}${includedir}/mtd/
20 for f in ${S}/include/mtd/*.h; do
21 install -m 0644 $f ${D}${includedir}/mtd/
22 done
23
24}
25
26PARALLEL_MAKE = ""
27
28BBCLASSEXTEND = "native"
29NATIVE_INSTALL_WORKS = "1"
diff --git a/meta/recipes-devtools/mtd/mtd-utils_1.3.1.bb b/meta/recipes-devtools/mtd/mtd-utils_1.3.1.bb
new file mode 100644
index 0000000000..faa2332a25
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils_1.3.1.bb
@@ -0,0 +1,26 @@
1DESCRIPTION = "Tools for managing memory technology devices."
2SECTION = "base"
3DEPENDS = "zlib lzo e2fsprogs util-linux"
4HOMEPAGE = "http://www.linux-mtd.infradead.org/"
5LICENSE = "GPLv2"
6
7SRC_URI = "git://git.infradead.org/mtd-utils.git;protocol=git;tag=v${PV} \
8 file://add-exclusion-to-mkfs-jffs2-git-2.patch;patch=1 \
9 file://fix-ignoreerrors-git.patch;patch=1 \
10 file://add-oobsize-64-and-writesize-4096-as-normal-nand.patch;patch=1"
11
12S = "${WORKDIR}/git/"
13
14EXTRA_OEMAKE = "'CC=${CC}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
15
16do_install () {
17 oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
18 install -d ${D}${includedir}/mtd/
19 for f in ${S}/include/mtd/*.h; do
20 install -m 0644 $f ${D}${includedir}/mtd/
21 done
22}
23
24PARALLEL_MAKE = ""
25
26BBCLASSEXTEND = "native"