diff options
Diffstat (limited to 'meta/packages')
-rw-r--r-- | meta/packages/mtd/mtd-utils-native_0.0.0+cvs20060223.bb | 2 | ||||
-rw-r--r-- | meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-20060131.patch | 100 | ||||
-rw-r--r-- | meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2.patch | 103 | ||||
-rw-r--r-- | meta/packages/mtd/mtd-utils/add_lzo.patch | 222 | ||||
-rw-r--r-- | meta/packages/mtd/mtd-utils/favour_lzo.patch | 140 | ||||
-rw-r--r-- | meta/packages/mtd/mtd-utils/fix-ignoreerrors-20060131.patch | 20 | ||||
-rw-r--r-- | meta/packages/mtd/mtd-utils/fix-ignoreerrors.patch | 20 | ||||
-rw-r--r-- | meta/packages/mtd/mtd-utils/more-verbosity.patch | 17 | ||||
-rw-r--r-- | meta/packages/mtd/mtd-utils_0.0.0+cvs20060223.bb | 39 |
9 files changed, 0 insertions, 663 deletions
diff --git a/meta/packages/mtd/mtd-utils-native_0.0.0+cvs20060223.bb b/meta/packages/mtd/mtd-utils-native_0.0.0+cvs20060223.bb deleted file mode 100644 index 6f9d71e10c..0000000000 --- a/meta/packages/mtd/mtd-utils-native_0.0.0+cvs20060223.bb +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | require mtd-utils_${PV}.bb | ||
2 | require mtd-utils-native.inc | ||
diff --git a/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-20060131.patch b/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-20060131.patch deleted file mode 100644 index e24f395890..0000000000 --- a/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-20060131.patch +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | --- mtd/util/mkfs.jffs2.c~add-exclusion-to-mkfs-jffs2.patch | ||
2 | +++ mtd/util/mkfs.jffs2.c | ||
3 | @@ -92,7 +92,12 @@ | ||
4 | struct filesystem_entry *files; /* Only relevant to directories */ | ||
5 | }; | ||
6 | |||
7 | - | ||
8 | +struct ignorepath_entry { | ||
9 | + struct ignorepath_entry* next; /* Points to the next ignorepath element */ | ||
10 | + char name[PATH_MAX]; /* Name of the entry */ | ||
11 | +}; | ||
12 | + | ||
13 | +static struct ignorepath_entry* ignorepath = 0; | ||
14 | static int out_fd = -1; | ||
15 | static int in_fd = -1; | ||
16 | static char default_rootdir[] = "."; | ||
17 | @@ -367,7 +372,7 @@ | ||
18 | char *hpath, *tpath; | ||
19 | struct dirent *dp, **namelist; | ||
20 | struct filesystem_entry *entry; | ||
21 | - | ||
22 | + struct ignorepath_entry* element = ignorepath; | ||
23 | |||
24 | if (lstat(hostpath, &sb)) { | ||
25 | perror_msg_and_die("%s", hostpath); | ||
26 | @@ -376,6 +381,15 @@ | ||
27 | entry = add_host_filesystem_entry(targetpath, hostpath, | ||
28 | sb.st_uid, sb.st_gid, sb.st_mode, 0, parent); | ||
29 | |||
30 | + while ( element ) { | ||
31 | + if ( strcmp( element->name, targetpath ) == 0 ) { | ||
32 | + printf( "Note: ignoring directories below '%s'\n", targetpath ); | ||
33 | + return entry; | ||
34 | + break; | ||
35 | + } | ||
36 | + element = element->next; | ||
37 | + } | ||
38 | + | ||
39 | n = scandir(hostpath, &namelist, 0, alphasort); | ||
40 | if (n < 0) { | ||
41 | perror_msg_and_die("opening directory %s", hostpath); | ||
42 | @@ -1157,6 +1171,7 @@ | ||
43 | {"root", 1, NULL, 'r'}, | ||
44 | {"pagesize", 1, NULL, 's'}, | ||
45 | {"eraseblock", 1, NULL, 'e'}, | ||
46 | + {"ignore", 1, NULL, 'I'}, | ||
47 | {"output", 1, NULL, 'o'}, | ||
48 | {"help", 0, NULL, 'h'}, | ||
49 | {"verbose", 0, NULL, 'v'}, | ||
50 | @@ -1199,6 +1214,7 @@ | ||
51 | " -L, --list-compressors Show the list of the avaiable compressors\n" | ||
52 | " -t, --test-compression Call decompress and compare with the original (for test)\n" | ||
53 | " -n, --no-eraseblock-headers Don't add a eraseblock header to every eraseblock\n" | ||
54 | + " -I, --ignore=PATH Ignore sub directory and file tree below PATH when recursing over the file system\n" | ||
55 | " -o, --output=FILE Output to FILE (default: stdout)\n" | ||
56 | " -l, --little-endian Create a little-endian filesystem\n" | ||
57 | " -b, --big-endian Create a big-endian filesystem\n" | ||
58 | @@ -1368,11 +1384,12 @@ | ||
59 | struct filesystem_entry *root; | ||
60 | char *compr_name = NULL; | ||
61 | int compr_prior = -1; | ||
62 | + struct ignorepath_entry* element = ignorepath; | ||
63 | |||
64 | jffs2_compressors_init(); | ||
65 | |||
66 | while ((opt = getopt_long(argc, argv, | ||
67 | - "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) | ||
68 | + "D:d:r:s:I:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) | ||
69 | { | ||
70 | switch (opt) { | ||
71 | case 'D': | ||
72 | @@ -1395,6 +1412,28 @@ | ||
73 | page_size = strtol(optarg, NULL, 0); | ||
74 | break; | ||
75 | |||
76 | + case 'I': | ||
77 | + printf( "Note: Adding '%s' to ignore Path\n", optarg ); | ||
78 | + element = ignorepath; | ||
79 | + if ( !ignorepath ) { | ||
80 | + ignorepath = xmalloc( sizeof( struct ignorepath_entry ) ); | ||
81 | + ignorepath->next = 0; | ||
82 | + strcpy( &ignorepath->name[0], optarg ); | ||
83 | + } else { | ||
84 | + while ( element->next ) element = element->next; | ||
85 | + element->next = xmalloc( sizeof( struct ignorepath_entry ) ); | ||
86 | + element->next->next = 0; | ||
87 | + strcpy( &element->next->name[0], optarg ); | ||
88 | + } | ||
89 | + printf( "--------- Dumping ignore path list ----------------\n" ); | ||
90 | + element = ignorepath; | ||
91 | + while ( element ) { | ||
92 | + printf( " * '%s'\n", &element->name[0] ); | ||
93 | + element = element->next; | ||
94 | + } | ||
95 | + printf( "---------------------------------------------------\n" ); | ||
96 | + break; | ||
97 | + | ||
98 | case 'o': | ||
99 | if (out_fd != -1) { | ||
100 | error_msg_and_die("output filename specified more than once"); | ||
diff --git a/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2.patch b/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2.patch deleted file mode 100644 index 3ac41280bb..0000000000 --- a/meta/packages/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2.patch +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | |||
2 | # | ||
3 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
4 | # | ||
5 | |||
6 | --- mtd/util/mkfs.jffs2.c~add-exclusion-to-mkfs-jffs2.patch | ||
7 | +++ mtd/util/mkfs.jffs2.c | ||
8 | @@ -92,7 +92,12 @@ | ||
9 | struct filesystem_entry *files; /* Only relevant to directories */ | ||
10 | }; | ||
11 | |||
12 | +struct ignorepath_entry { | ||
13 | + struct ignorepath_entry* next; /* Points to the next ignorepath element */ | ||
14 | + char name[PATH_MAX]; /* Name of the entry */ | ||
15 | +}; | ||
16 | |||
17 | +static struct ignorepath_entry* ignorepath = 0; | ||
18 | static int out_fd = -1; | ||
19 | static int in_fd = -1; | ||
20 | static char default_rootdir[] = "."; | ||
21 | @@ -367,6 +372,7 @@ | ||
22 | char *hpath, *tpath; | ||
23 | struct dirent *dp, **namelist; | ||
24 | struct filesystem_entry *entry; | ||
25 | + struct ignorepath_entry* element = ignorepath; | ||
26 | |||
27 | |||
28 | if (lstat(hostpath, &sb)) { | ||
29 | @@ -376,6 +382,15 @@ | ||
30 | entry = add_host_filesystem_entry(targetpath, hostpath, | ||
31 | sb.st_uid, sb.st_gid, sb.st_mode, 0, parent); | ||
32 | |||
33 | + while ( element ) { | ||
34 | + if ( strcmp( element->name, targetpath ) == 0 ) { | ||
35 | + printf( "Note: ignoring directories below '%s'\n", targetpath ); | ||
36 | + return entry; | ||
37 | + break; | ||
38 | + } | ||
39 | + element = element->next; | ||
40 | + } | ||
41 | + | ||
42 | n = scandir(hostpath, &namelist, 0, alphasort); | ||
43 | if (n < 0) { | ||
44 | perror_msg_and_die("opening directory %s", hostpath); | ||
45 | @@ -1147,6 +1162,7 @@ | ||
46 | {"root", 1, NULL, 'r'}, | ||
47 | {"pagesize", 1, NULL, 's'}, | ||
48 | {"eraseblock", 1, NULL, 'e'}, | ||
49 | + {"ignore", 1, NULL, 'I'}, | ||
50 | {"output", 1, NULL, 'o'}, | ||
51 | {"help", 0, NULL, 'h'}, | ||
52 | {"verbose", 0, NULL, 'v'}, | ||
53 | @@ -1189,6 +1205,7 @@ | ||
54 | " -L, --list-compressors Show the list of the avaiable compressors\n" | ||
55 | " -t, --test-compression Call decompress and compare with the original (for test)\n" | ||
56 | " -n, --no-cleanmarkers Don't add a cleanmarker to every eraseblock\n" | ||
57 | + " -I, --ignore=PATH Ignore sub directory and file tree below PATH when recursing over the file system\n" | ||
58 | " -o, --output=FILE Output to FILE (default: stdout)\n" | ||
59 | " -l, --little-endian Create a little-endian filesystem\n" | ||
60 | " -b, --big-endian Create a big-endian filesystem\n" | ||
61 | @@ -1349,11 +1366,12 @@ | ||
62 | struct filesystem_entry *root; | ||
63 | char *compr_name = NULL; | ||
64 | int compr_prior = -1; | ||
65 | + struct ignorepath_entry* element = ignorepath; | ||
66 | |||
67 | jffs2_compressors_init(); | ||
68 | |||
69 | while ((opt = getopt_long(argc, argv, | ||
70 | - "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) | ||
71 | + "D:d:r:s:I:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) | ||
72 | { | ||
73 | switch (opt) { | ||
74 | case 'D': | ||
75 | @@ -1376,6 +1394,28 @@ | ||
76 | page_size = strtol(optarg, NULL, 0); | ||
77 | break; | ||
78 | |||
79 | + case 'I': | ||
80 | + printf( "Note: Adding '%s' to ignore Path\n", optarg ); | ||
81 | + element = ignorepath; | ||
82 | + if ( !ignorepath ) { | ||
83 | + ignorepath = xmalloc( sizeof( struct ignorepath_entry ) ); | ||
84 | + ignorepath->next = 0; | ||
85 | + strcpy( &ignorepath->name[0], optarg ); | ||
86 | + } else { | ||
87 | + while ( element->next ) element = element->next; | ||
88 | + element->next = xmalloc( sizeof( struct ignorepath_entry ) ); | ||
89 | + element->next->next = 0; | ||
90 | + strcpy( &element->next->name[0], optarg ); | ||
91 | + } | ||
92 | + printf( "--------- Dumping ignore path list ----------------\n" ); | ||
93 | + element = ignorepath; | ||
94 | + while ( element ) { | ||
95 | + printf( " * '%s'\n", &element->name[0] ); | ||
96 | + element = element->next; | ||
97 | + } | ||
98 | + printf( "---------------------------------------------------\n" ); | ||
99 | + break; | ||
100 | + | ||
101 | case 'o': | ||
102 | if (out_fd != -1) { | ||
103 | error_msg_and_die("output filename specified more than once"); | ||
diff --git a/meta/packages/mtd/mtd-utils/add_lzo.patch b/meta/packages/mtd/mtd-utils/add_lzo.patch deleted file mode 100644 index 3421571372..0000000000 --- a/meta/packages/mtd/mtd-utils/add_lzo.patch +++ /dev/null | |||
@@ -1,222 +0,0 @@ | |||
1 | Subject: [mtd-utils patch 1/2] Add lzo support to mtd-utils | ||
2 | |||
3 | Add LZO support to mtd-utils to generate LZO compressed jffs2 images | ||
4 | |||
5 | Unlike the kernel version, the standard lzo userspace library is used | ||
6 | along with lzo1x_999_compress rather than the lzo1x_1_compress version | ||
7 | since better compression ratios can be obtained (at no significant cost | ||
8 | to decompression time). | ||
9 | |||
10 | Signed-off-by: Richard Purdie <rpurdie@openedhand.com> | ||
11 | |||
12 | --- | ||
13 | Makefile | 3 - | ||
14 | compr.c | 6 ++ | ||
15 | compr.h | 6 ++ | ||
16 | compr_lzo.c | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
17 | include/linux/jffs2.h | 1 | ||
18 | 5 files changed, 135 insertions(+), 1 deletion(-) | ||
19 | |||
20 | Index: git/Makefile | ||
21 | =================================================================== | ||
22 | --- git.orig/Makefile 2007-03-01 11:57:58.000000000 +0000 | ||
23 | +++ git/Makefile 2007-03-01 11:58:01.000000000 +0000 | ||
24 | @@ -58,8 +58,9 @@ $(BUILDDIR)/mkfs.jffs2: $(BUILDDIR)/crc3 | ||
25 | $(BUILDDIR)/compr_rtime.o \ | ||
26 | $(BUILDDIR)/mkfs.jffs2.o \ | ||
27 | $(BUILDDIR)/compr_zlib.o \ | ||
28 | + $(BUILDDIR)/compr_lzo.o \ | ||
29 | $(BUILDDIR)/compr.o | ||
30 | - $(CC) $(LDFLAGS) -o $@ $^ -lz | ||
31 | + $(CC) $(LDFLAGS) -o $@ $^ -lz -llzo | ||
32 | |||
33 | $(BUILDDIR)/flash_eraseall: $(BUILDDIR)/crc32.o $(BUILDDIR)/flash_eraseall.o | ||
34 | $(CC) $(LDFLAGS) -o $@ $^ | ||
35 | Index: git/compr.c | ||
36 | =================================================================== | ||
37 | --- git.orig/compr.c 2007-03-01 11:57:58.000000000 +0000 | ||
38 | +++ git/compr.c 2007-03-01 11:58:01.000000000 +0000 | ||
39 | @@ -474,6 +474,9 @@ int jffs2_compressors_init(void) | ||
40 | #ifdef CONFIG_JFFS2_RTIME | ||
41 | jffs2_rtime_init(); | ||
42 | #endif | ||
43 | +#ifdef CONFIG_JFFS2_LZO | ||
44 | + jffs2_lzo_init(); | ||
45 | +#endif | ||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | @@ -485,5 +488,8 @@ int jffs2_compressors_exit(void) | ||
50 | #ifdef CONFIG_JFFS2_ZLIB | ||
51 | jffs2_zlib_exit(); | ||
52 | #endif | ||
53 | +#ifdef CONFIG_JFFS2_LZO | ||
54 | + jffs2_lzo_exit(); | ||
55 | +#endif | ||
56 | return 0; | ||
57 | } | ||
58 | Index: git/compr.h | ||
59 | =================================================================== | ||
60 | --- git.orig/compr.h 2007-03-01 11:57:58.000000000 +0000 | ||
61 | +++ git/compr.h 2007-03-01 11:58:01.000000000 +0000 | ||
62 | @@ -21,11 +21,13 @@ | ||
63 | |||
64 | #define CONFIG_JFFS2_ZLIB | ||
65 | #define CONFIG_JFFS2_RTIME | ||
66 | +#define CONFIG_JFFS2_LZO | ||
67 | |||
68 | #define JFFS2_RUBINMIPS_PRIORITY 10 | ||
69 | #define JFFS2_DYNRUBIN_PRIORITY 20 | ||
70 | #define JFFS2_RTIME_PRIORITY 50 | ||
71 | #define JFFS2_ZLIB_PRIORITY 60 | ||
72 | +#define JFFS2_LZO_PRIORITY 80 | ||
73 | |||
74 | #define JFFS2_COMPR_MODE_NONE 0 | ||
75 | #define JFFS2_COMPR_MODE_PRIORITY 1 | ||
76 | @@ -111,5 +113,9 @@ void jffs2_zlib_exit(void); | ||
77 | int jffs2_rtime_init(void); | ||
78 | void jffs2_rtime_exit(void); | ||
79 | #endif | ||
80 | +#ifdef CONFIG_JFFS2_LZO | ||
81 | +int jffs2_lzo_init(void); | ||
82 | +void jffs2_lzo_exit(void); | ||
83 | +#endif | ||
84 | |||
85 | #endif /* __JFFS2_COMPR_H__ */ | ||
86 | Index: git/compr_lzo.c | ||
87 | =================================================================== | ||
88 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
89 | +++ git/compr_lzo.c 2007-03-01 11:58:01.000000000 +0000 | ||
90 | @@ -0,0 +1,120 @@ | ||
91 | +/* | ||
92 | + * JFFS2 LZO Compression Interface. | ||
93 | + * | ||
94 | + * Copyright (C) 2007 Nokia Corporation. All rights reserved. | ||
95 | + * | ||
96 | + * Author: Richard Purdie <rpurdie@openedhand.com> | ||
97 | + * | ||
98 | + * This program is free software; you can redistribute it and/or | ||
99 | + * modify it under the terms of the GNU General Public License | ||
100 | + * version 2 as published by the Free Software Foundation. | ||
101 | + * | ||
102 | + * This program is distributed in the hope that it will be useful, but | ||
103 | + * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
104 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
105 | + * General Public License for more details. | ||
106 | + * | ||
107 | + * You should have received a copy of the GNU General Public License | ||
108 | + * along with this program; if not, write to the Free Software | ||
109 | + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
110 | + * 02110-1301 USA | ||
111 | + * | ||
112 | + */ | ||
113 | + | ||
114 | +#include <stdint.h> | ||
115 | +#include <stdio.h> | ||
116 | +#include <string.h> | ||
117 | +#include <asm/types.h> | ||
118 | +#include <linux/jffs2.h> | ||
119 | +#include <lzo1x.h> | ||
120 | +#include "compr.h" | ||
121 | + | ||
122 | +extern int page_size; | ||
123 | + | ||
124 | +static void *lzo_mem; | ||
125 | +static void *lzo_compress_buf; | ||
126 | + | ||
127 | +/* | ||
128 | + * Note about LZO compression. | ||
129 | + * | ||
130 | + * We want to use the _999_ compression routine which gives better compression | ||
131 | + * rates at the expense of time. Decompression time is unaffected. We might as | ||
132 | + * well use the standard lzo library routines for this but they will overflow | ||
133 | + * the destination buffer since they don't check the destination size. | ||
134 | + * | ||
135 | + * We therefore compress to a temporary buffer and copy if it will fit. | ||
136 | + * | ||
137 | + */ | ||
138 | +static int jffs2_lzo_cmpr(unsigned char *data_in, unsigned char *cpage_out, | ||
139 | + uint32_t *sourcelen, uint32_t *dstlen, void *model) | ||
140 | +{ | ||
141 | + uint32_t compress_size; | ||
142 | + int ret; | ||
143 | + | ||
144 | + ret = lzo1x_999_compress(data_in, *sourcelen, lzo_compress_buf, &compress_size, lzo_mem); | ||
145 | + | ||
146 | + if (ret != LZO_E_OK) | ||
147 | + return -1; | ||
148 | + | ||
149 | + if (compress_size > *dstlen) | ||
150 | + return -1; | ||
151 | + | ||
152 | + memcpy(cpage_out, lzo_compress_buf, compress_size); | ||
153 | + *dstlen = compress_size; | ||
154 | + | ||
155 | + return 0; | ||
156 | +} | ||
157 | + | ||
158 | +static int jffs2_lzo_decompress(unsigned char *data_in, unsigned char *cpage_out, | ||
159 | + uint32_t srclen, uint32_t destlen, void *model) | ||
160 | +{ | ||
161 | + int ret; | ||
162 | + uint32_t dl; | ||
163 | + | ||
164 | + ret = lzo1x_decompress_safe(data_in,srclen,cpage_out,&dl,NULL); | ||
165 | + | ||
166 | + if (ret != LZO_E_OK || dl != destlen) | ||
167 | + return -1; | ||
168 | + | ||
169 | + return 0; | ||
170 | +} | ||
171 | + | ||
172 | +static struct jffs2_compressor jffs2_lzo_comp = { | ||
173 | + .priority = JFFS2_LZO_PRIORITY, | ||
174 | + .name = "lzo", | ||
175 | + .compr = JFFS2_COMPR_LZO, | ||
176 | + .compress = &jffs2_lzo_cmpr, | ||
177 | + .decompress = &jffs2_lzo_decompress, | ||
178 | + .disabled = 0, | ||
179 | +}; | ||
180 | + | ||
181 | +int jffs2_lzo_init(void) | ||
182 | +{ | ||
183 | + int ret; | ||
184 | + | ||
185 | + lzo_mem = malloc(LZO1X_999_MEM_COMPRESS); | ||
186 | + if (!lzo_mem) | ||
187 | + return -1; | ||
188 | + | ||
189 | + /* Worse case LZO compression size from their FAQ */ | ||
190 | + lzo_compress_buf = malloc(page_size + (page_size / 64) + 16 + 3); | ||
191 | + if (!lzo_compress_buf) { | ||
192 | + free(lzo_mem); | ||
193 | + return -1; | ||
194 | + } | ||
195 | + | ||
196 | + ret = jffs2_register_compressor(&jffs2_lzo_comp); | ||
197 | + if (ret < 0) { | ||
198 | + free(lzo_compress_buf); | ||
199 | + free(lzo_mem); | ||
200 | + } | ||
201 | + | ||
202 | + return ret; | ||
203 | +} | ||
204 | + | ||
205 | +void jffs2_lzo_exit(void) | ||
206 | +{ | ||
207 | + jffs2_unregister_compressor(&jffs2_lzo_comp); | ||
208 | + free(lzo_compress_buf); | ||
209 | + free(lzo_mem); | ||
210 | +} | ||
211 | Index: git/include/linux/jffs2.h | ||
212 | =================================================================== | ||
213 | --- git.orig/include/linux/jffs2.h 2007-03-01 11:57:58.000000000 +0000 | ||
214 | +++ git/include/linux/jffs2.h 2007-03-01 11:58:01.000000000 +0000 | ||
215 | @@ -46,6 +46,7 @@ | ||
216 | #define JFFS2_COMPR_COPY 0x04 | ||
217 | #define JFFS2_COMPR_DYNRUBIN 0x05 | ||
218 | #define JFFS2_COMPR_ZLIB 0x06 | ||
219 | +#define JFFS2_COMPR_LZO 0x07 | ||
220 | /* Compatibility flags. */ | ||
221 | #define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ | ||
222 | #define JFFS2_NODE_ACCURATE 0x2000 | ||
diff --git a/meta/packages/mtd/mtd-utils/favour_lzo.patch b/meta/packages/mtd/mtd-utils/favour_lzo.patch deleted file mode 100644 index 8b1581c467..0000000000 --- a/meta/packages/mtd/mtd-utils/favour_lzo.patch +++ /dev/null | |||
@@ -1,140 +0,0 @@ | |||
1 | Subject: [mtd-utils patch 2/2] Add favourlzo compression mode | ||
2 | |||
3 | Add a favourlzo compression mode to mtd-utils | ||
4 | |||
5 | This allows lzo compression to be used in the cases where the | ||
6 | compression ratio isn't quite as good zlib. This can make sense in | ||
7 | certain use cases because LZO decompression is much faster than zlib. | ||
8 | |||
9 | Signed-off-by: Richard Purdie <rpurdie@openedhand.com> | ||
10 | |||
11 | --- | ||
12 | compr.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++--- | ||
13 | compr.h | 1 + | ||
14 | 2 files changed, 50 insertions(+), 3 deletions(-) | ||
15 | |||
16 | Index: git/compr.c | ||
17 | =================================================================== | ||
18 | --- git.orig/compr.c 2007-03-01 11:58:01.000000000 +0000 | ||
19 | +++ git/compr.c 2007-03-01 11:58:09.000000000 +0000 | ||
20 | @@ -16,6 +16,8 @@ | ||
21 | #include <stdlib.h> | ||
22 | #include <linux/jffs2.h> | ||
23 | |||
24 | +#define FAVOUR_LZO_PERCENT 80 | ||
25 | + | ||
26 | extern int page_size; | ||
27 | |||
28 | /* LIST IMPLEMENTATION (from linux/list.h) */ | ||
29 | @@ -166,6 +168,33 @@ static void jffs2_decompression_test(str | ||
30 | } | ||
31 | } | ||
32 | |||
33 | +/* | ||
34 | + * Return 1 to use this compression | ||
35 | + */ | ||
36 | +static int jffs2_is_best_compression(struct jffs2_compressor *this, | ||
37 | + struct jffs2_compressor *best, uint32_t size, uint32_t bestsize) | ||
38 | +{ | ||
39 | + switch (jffs2_compression_mode) { | ||
40 | + case JFFS2_COMPR_MODE_SIZE: | ||
41 | + if (bestsize > size) | ||
42 | + return 1; | ||
43 | + return 0; | ||
44 | + case JFFS2_COMPR_MODE_FAVOURLZO: | ||
45 | + if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > size)) | ||
46 | + return 1; | ||
47 | + if ((best->compr != JFFS2_COMPR_LZO) && (bestsize > size)) | ||
48 | + return 1; | ||
49 | + if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > (size * FAVOUR_LZO_PERCENT / 100))) | ||
50 | + return 1; | ||
51 | + if ((bestsize * FAVOUR_LZO_PERCENT / 100) > size) | ||
52 | + return 1; | ||
53 | + | ||
54 | + return 0; | ||
55 | + } | ||
56 | + /* Shouldn't happen */ | ||
57 | + return 0; | ||
58 | +} | ||
59 | + | ||
60 | /* jffs2_compress: | ||
61 | * @data: Pointer to uncompressed data | ||
62 | * @cdata: Pointer to returned pointer to buffer for compressed data | ||
63 | @@ -231,21 +260,29 @@ uint16_t jffs2_compress( unsigned char * | ||
64 | } | ||
65 | if (ret == JFFS2_COMPR_NONE) free(output_buf); | ||
66 | break; | ||
67 | + case JFFS2_COMPR_MODE_FAVOURLZO: | ||
68 | case JFFS2_COMPR_MODE_SIZE: | ||
69 | orig_slen = *datalen; | ||
70 | orig_dlen = *cdatalen; | ||
71 | list_for_each_entry(this, &jffs2_compressor_list, list) { | ||
72 | + uint32_t needed_buf_size; | ||
73 | + | ||
74 | + if (jffs2_compression_mode == JFFS2_COMPR_MODE_FAVOURLZO) | ||
75 | + needed_buf_size = orig_slen + jffs2_compression_check; | ||
76 | + else | ||
77 | + needed_buf_size = orig_dlen + jffs2_compression_check; | ||
78 | + | ||
79 | /* Skip decompress-only backwards-compatibility and disabled modules */ | ||
80 | if ((!this->compress)||(this->disabled)) | ||
81 | continue; | ||
82 | /* Allocating memory for output buffer if necessary */ | ||
83 | - if ((this->compr_buf_size<orig_dlen+jffs2_compression_check)&&(this->compr_buf)) { | ||
84 | + if ((this->compr_buf_size < needed_buf_size) && (this->compr_buf)) { | ||
85 | free(this->compr_buf); | ||
86 | this->compr_buf_size=0; | ||
87 | this->compr_buf=NULL; | ||
88 | } | ||
89 | if (!this->compr_buf) { | ||
90 | - tmp_buf = malloc(orig_dlen+jffs2_compression_check); | ||
91 | + tmp_buf = malloc(needed_buf_size); | ||
92 | if (!tmp_buf) { | ||
93 | fprintf(stderr,"mkfs.jffs2: No memory for compressor allocation. (%d bytes)\n",orig_dlen); | ||
94 | continue; | ||
95 | @@ -265,7 +302,8 @@ uint16_t jffs2_compress( unsigned char * | ||
96 | if (!compr_ret) { | ||
97 | if (jffs2_compression_check) | ||
98 | jffs2_decompression_test(this, data_in, this->compr_buf, *cdatalen, *datalen, this->compr_buf_size); | ||
99 | - if ((!best_dlen)||(best_dlen>*cdatalen)) { | ||
100 | + if (((!best_dlen) || jffs2_is_best_compression(this, best, *cdatalen, best_dlen)) | ||
101 | + && (*cdatalen < *datalen)) { | ||
102 | best_dlen = *cdatalen; | ||
103 | best_slen = *datalen; | ||
104 | best = this; | ||
105 | @@ -377,6 +415,9 @@ char *jffs2_stats(void) | ||
106 | case JFFS2_COMPR_MODE_SIZE: | ||
107 | act_buf += sprintf(act_buf,"size"); | ||
108 | break; | ||
109 | + case JFFS2_COMPR_MODE_FAVOURLZO: | ||
110 | + act_buf += sprintf(act_buf, "favourlzo"); | ||
111 | + break; | ||
112 | default: | ||
113 | act_buf += sprintf(act_buf,"unkown"); | ||
114 | break; | ||
115 | @@ -413,6 +454,11 @@ int jffs2_set_compression_mode_name(cons | ||
116 | jffs2_compression_mode = JFFS2_COMPR_MODE_SIZE; | ||
117 | return 0; | ||
118 | } | ||
119 | + if (!strcmp("favourlzo", name)) { | ||
120 | + jffs2_compression_mode = JFFS2_COMPR_MODE_FAVOURLZO; | ||
121 | + return 0; | ||
122 | + } | ||
123 | + | ||
124 | return 1; | ||
125 | } | ||
126 | |||
127 | Index: git/compr.h | ||
128 | =================================================================== | ||
129 | --- git.orig/compr.h 2007-03-01 11:58:01.000000000 +0000 | ||
130 | +++ git/compr.h 2007-03-01 11:58:09.000000000 +0000 | ||
131 | @@ -32,6 +32,7 @@ | ||
132 | #define JFFS2_COMPR_MODE_NONE 0 | ||
133 | #define JFFS2_COMPR_MODE_PRIORITY 1 | ||
134 | #define JFFS2_COMPR_MODE_SIZE 2 | ||
135 | +#define JFFS2_COMPR_MODE_FAVOURLZO 3 | ||
136 | |||
137 | #define kmalloc(a,b) malloc(a) | ||
138 | #define kfree(a) free(a) | ||
139 | |||
140 | |||
diff --git a/meta/packages/mtd/mtd-utils/fix-ignoreerrors-20060131.patch b/meta/packages/mtd/mtd-utils/fix-ignoreerrors-20060131.patch deleted file mode 100644 index 8266a37c46..0000000000 --- a/meta/packages/mtd/mtd-utils/fix-ignoreerrors-20060131.patch +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | --- mtd/util/nanddump.c.orig 2006-01-30 21:19:22.000000000 +0100 | ||
2 | +++ mtd/util/nanddump.c 2006-01-30 21:19:24.000000000 +0100 | ||
3 | @@ -224,7 +224,7 @@ | ||
4 | } | ||
5 | } | ||
6 | |||
7 | - if (badblock) { | ||
8 | + if (badblock && !ignoreerrors) { | ||
9 | if (omitbad) | ||
10 | continue; | ||
11 | memset (readbuf, 0xff, bs); | ||
12 | @@ -259,7 +259,7 @@ | ||
13 | if (omitoob) | ||
14 | continue; | ||
15 | |||
16 | - if (badblock) { | ||
17 | + if (badblock && !ignoreerrors) { | ||
18 | memset (readbuf, 0xff, meminfo.oobsize); | ||
19 | } else { | ||
20 | /* Read OOB data and exit on failure */ | ||
diff --git a/meta/packages/mtd/mtd-utils/fix-ignoreerrors.patch b/meta/packages/mtd/mtd-utils/fix-ignoreerrors.patch deleted file mode 100644 index b1f702a316..0000000000 --- a/meta/packages/mtd/mtd-utils/fix-ignoreerrors.patch +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | --- mtd/util/nanddump.c.orig 2005-12-30 19:07:39.000000000 +0100 | ||
2 | +++ mtd/util/nanddump.c 2005-12-30 19:08:53.000000000 +0100 | ||
3 | @@ -224,7 +224,7 @@ | ||
4 | } | ||
5 | } | ||
6 | |||
7 | - if (badblock) { | ||
8 | + if (badblock && !ignoreerrors) { | ||
9 | if (omitbad) | ||
10 | continue; | ||
11 | memset (readbuf, 0xff, bs); | ||
12 | @@ -259,7 +259,7 @@ | ||
13 | if (omitoob) | ||
14 | continue; | ||
15 | |||
16 | - if (badblock) { | ||
17 | + if (badblock && !ignoreerrors) { | ||
18 | memset (readbuf, 0xff, meminfo.oobsize); | ||
19 | } else { | ||
20 | /* Read OOB data and exit on failure */ | ||
diff --git a/meta/packages/mtd/mtd-utils/more-verbosity.patch b/meta/packages/mtd/mtd-utils/more-verbosity.patch deleted file mode 100644 index cdc842a8f9..0000000000 --- a/meta/packages/mtd/mtd-utils/more-verbosity.patch +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | |||
2 | # | ||
3 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
4 | # | ||
5 | |||
6 | --- mtd/util/mkfs.jffs2.c~more-verbosity.patch | ||
7 | +++ mtd/util/mkfs.jffs2.c | ||
8 | @@ -374,6 +374,9 @@ | ||
9 | struct filesystem_entry *entry; | ||
10 | struct ignorepath_entry* element = ignorepath; | ||
11 | |||
12 | + if (verbose) { | ||
13 | + printf( "mkfs.jffs2: scanning '%s'...\n", targetpath ); | ||
14 | + } | ||
15 | |||
16 | if (lstat(hostpath, &sb)) { | ||
17 | perror_msg_and_die("%s", hostpath); | ||
diff --git a/meta/packages/mtd/mtd-utils_0.0.0+cvs20060223.bb b/meta/packages/mtd/mtd-utils_0.0.0+cvs20060223.bb deleted file mode 100644 index 96199f1602..0000000000 --- a/meta/packages/mtd/mtd-utils_0.0.0+cvs20060223.bb +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | DESCRIPTION = "Tools for managing memory technology devices." | ||
2 | SECTION = "base" | ||
3 | DEPENDS = "zlib" | ||
4 | HOMEPAGE = "http://www.linux-mtd.infradead.org/" | ||
5 | LICENSE = "GPLv2" | ||
6 | PR = "r0" | ||
7 | SRCDATE = "20060223" | ||
8 | |||
9 | SRC_URI = "cvs://anoncvs:anoncvs@cvs.infradead.org/home/cvs;module=mtd \ | ||
10 | file://add-exclusion-to-mkfs-jffs2-20060131.patch;patch=1 \ | ||
11 | file://fix-ignoreerrors-20060131.patch;patch=1" | ||
12 | S = "${WORKDIR}/mtd/" | ||
13 | |||
14 | CFLAGS_prepend = "-I${S}/include " | ||
15 | |||
16 | do_compile () { | ||
17 | oe_runmake -C util ${mtd_utils} | ||
18 | } | ||
19 | |||
20 | do_stage () { | ||
21 | install -d ${STAGING_INCDIR}/mtd | ||
22 | for f in ${S}/include/mtd/*.h; do | ||
23 | install -m 0644 $f ${STAGING_INCDIR}/mtd/ | ||
24 | done | ||
25 | for binary in ${mtd_utils}; do | ||
26 | install -m 0755 util/$binary ${STAGING_BINDIR} | ||
27 | done | ||
28 | } | ||
29 | |||
30 | mtd_utils = "ftl_format flash_erase flash_eraseall nanddump doc_loadbios \ | ||
31 | mkfs.jffs ftl_check mkfs.jffs2 flash_lock flash_unlock flash_info mtd_debug \ | ||
32 | flashcp nandwrite jffs2dump sumtool" | ||
33 | |||
34 | do_install () { | ||
35 | install -d ${D}${bindir} | ||
36 | for binary in ${mtd_utils}; do | ||
37 | install -m 0755 util/$binary ${D}${bindir} | ||
38 | done | ||
39 | } | ||