diff options
Diffstat (limited to 'meta/packages/mtd')
-rw-r--r-- | meta/packages/mtd/mtd-utils/add_lzo.patch | 6 | ||||
-rw-r--r-- | meta/packages/mtd/mtd-utils/favour_lzo.patch | 38 |
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 @@ | |||
1 | Subject: [mtd-utils patch 1/2] Add lzo support to mtd-utils | ||
2 | |||
1 | Add LZO support to mtd-utils to generate LZO compressed jffs2 images | 3 | Add LZO support to mtd-utils to generate LZO compressed jffs2 images |
2 | 4 | ||
3 | Unlike the kernel version, the standard lzo userspace library is used | 5 | Unlike 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 @@ | |||
1 | Subject: [mtd-utils patch 2/2] Add favourlzo compression mode | ||
2 | |||
1 | Add a favourlzo compression mode to mtd-utils | 3 | Add a favourlzo compression mode to mtd-utils |
2 | 4 | ||
3 | This allows lzo compression to be used in the cases where the | 5 | This 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 | |||