summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-07-10 14:52:07 +0000
committerRichard Purdie <richard@openedhand.com>2007-07-10 14:52:07 +0000
commitdf6134d575f7772181353cb9aad7d2244e3452d5 (patch)
tree9753ea6b3909d0f8f8cb1a7d8f6c36e178e4bf43
parentb15ec7a7ffdf8ce5d21b825e2ac67433b0911649 (diff)
downloadpoky-df6134d575f7772181353cb9aad7d2244e3452d5.tar.gz
mtd-utils: Tweak LZO patches
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2145 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rw-r--r--meta/packages/mtd/mtd-utils/add_lzo.patch6
-rw-r--r--meta/packages/mtd/mtd-utils/favour_lzo.patch38
2 files changed, 25 insertions, 19 deletions
diff --git a/meta/packages/mtd/mtd-utils/add_lzo.patch b/meta/packages/mtd/mtd-utils/add_lzo.patch
index 9afd1ca46b..3421571372 100644
--- a/meta/packages/mtd/mtd-utils/add_lzo.patch
+++ b/meta/packages/mtd/mtd-utils/add_lzo.patch
@@ -1,3 +1,5 @@
1Subject: [mtd-utils patch 1/2] Add lzo support to mtd-utils
2
1Add LZO support to mtd-utils to generate LZO compressed jffs2 images 3Add LZO support to mtd-utils to generate LZO compressed jffs2 images
2 4
3Unlike the kernel version, the standard lzo userspace library is used 5Unlike the kernel version, the standard lzo userspace library is used
@@ -39,7 +41,7 @@ Index: git/compr.c
39 jffs2_rtime_init(); 41 jffs2_rtime_init();
40 #endif 42 #endif
41+#ifdef CONFIG_JFFS2_LZO 43+#ifdef CONFIG_JFFS2_LZO
42+ jffs2_lzo_init(); 44+ jffs2_lzo_init();
43+#endif 45+#endif
44 return 0; 46 return 0;
45 } 47 }
@@ -49,7 +51,7 @@ Index: git/compr.c
49 jffs2_zlib_exit(); 51 jffs2_zlib_exit();
50 #endif 52 #endif
51+#ifdef CONFIG_JFFS2_LZO 53+#ifdef CONFIG_JFFS2_LZO
52+ jffs2_lzo_exit(); 54+ jffs2_lzo_exit();
53+#endif 55+#endif
54 return 0; 56 return 0;
55 } 57 }
diff --git a/meta/packages/mtd/mtd-utils/favour_lzo.patch b/meta/packages/mtd/mtd-utils/favour_lzo.patch
index 9e55d5f4b3..8b1581c467 100644
--- a/meta/packages/mtd/mtd-utils/favour_lzo.patch
+++ b/meta/packages/mtd/mtd-utils/favour_lzo.patch
@@ -1,3 +1,5 @@
1Subject: [mtd-utils patch 2/2] Add favourlzo compression mode
2
1Add a favourlzo compression mode to mtd-utils 3Add a favourlzo compression mode to mtd-utils
2 4
3This allows lzo compression to be used in the cases where the 5This allows lzo compression to be used in the cases where the
@@ -35,21 +37,21 @@ Index: git/compr.c
35+ struct jffs2_compressor *best, uint32_t size, uint32_t bestsize) 37+ struct jffs2_compressor *best, uint32_t size, uint32_t bestsize)
36+{ 38+{
37+ switch (jffs2_compression_mode) { 39+ switch (jffs2_compression_mode) {
38+ case JFFS2_COMPR_MODE_SIZE: 40+ case JFFS2_COMPR_MODE_SIZE:
39+ if (bestsize > size) 41+ if (bestsize > size)
40+ return 1; 42+ return 1;
41+ return 0; 43+ return 0;
42+ case JFFS2_COMPR_MODE_FAVOURLZO: 44+ case JFFS2_COMPR_MODE_FAVOURLZO:
43+ if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > size)) 45+ if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > size))
44+ return 1; 46+ return 1;
45+ if ((best->compr != JFFS2_COMPR_LZO) && (bestsize > size)) 47+ if ((best->compr != JFFS2_COMPR_LZO) && (bestsize > size))
46+ return 1; 48+ return 1;
47+ if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > (size * FAVOUR_LZO_PERCENT / 100))) 49+ if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > (size * FAVOUR_LZO_PERCENT / 100)))
48+ return 1; 50+ return 1;
49+ if ((bestsize * FAVOUR_LZO_PERCENT / 100) > size) 51+ if ((bestsize * FAVOUR_LZO_PERCENT / 100) > size)
50+ return 1; 52+ return 1;
51+ 53+
52+ return 0; 54+ return 0;
53+ } 55+ }
54+ /* Shouldn't happen */ 56+ /* Shouldn't happen */
55+ return 0; 57+ return 0;
@@ -70,9 +72,9 @@ Index: git/compr.c
70+ uint32_t needed_buf_size; 72+ uint32_t needed_buf_size;
71+ 73+
72+ if (jffs2_compression_mode == JFFS2_COMPR_MODE_FAVOURLZO) 74+ if (jffs2_compression_mode == JFFS2_COMPR_MODE_FAVOURLZO)
73+ needed_buf_size = orig_slen+jffs2_compression_check; 75+ needed_buf_size = orig_slen + jffs2_compression_check;
74+ else 76+ else
75+ needed_buf_size = orig_dlen+jffs2_compression_check; 77+ needed_buf_size = orig_dlen + jffs2_compression_check;
76+ 78+
77 /* Skip decompress-only backwards-compatibility and disabled modules */ 79 /* Skip decompress-only backwards-compatibility and disabled modules */
78 if ((!this->compress)||(this->disabled)) 80 if ((!this->compress)||(this->disabled))
@@ -105,7 +107,7 @@ Index: git/compr.c
105 act_buf += sprintf(act_buf,"size"); 107 act_buf += sprintf(act_buf,"size");
106 break; 108 break;
107+ case JFFS2_COMPR_MODE_FAVOURLZO: 109+ case JFFS2_COMPR_MODE_FAVOURLZO:
108+ act_buf += sprintf(act_buf,"favourlzo"); 110+ act_buf += sprintf(act_buf, "favourlzo");
109+ break; 111+ break;
110 default: 112 default:
111 act_buf += sprintf(act_buf,"unkown"); 113 act_buf += sprintf(act_buf,"unkown");
@@ -134,3 +136,5 @@ Index: git/compr.h
134 136
135 #define kmalloc(a,b) malloc(a) 137 #define kmalloc(a,b) malloc(a)
136 #define kfree(a) free(a) 138 #define kfree(a) free(a)
139
140