diff options
author | Richard Purdie <richard@openedhand.com> | 2007-07-10 14:52:07 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2007-07-10 14:52:07 +0000 |
commit | df6134d575f7772181353cb9aad7d2244e3452d5 (patch) | |
tree | 9753ea6b3909d0f8f8cb1a7d8f6c36e178e4bf43 /meta/packages/mtd | |
parent | b15ec7a7ffdf8ce5d21b825e2ac67433b0911649 (diff) | |
download | openembedded-core-df6134d575f7772181353cb9aad7d2244e3452d5.tar.gz openembedded-core-df6134d575f7772181353cb9aad7d2244e3452d5.tar.bz2 openembedded-core-df6134d575f7772181353cb9aad7d2244e3452d5.zip |
mtd-utils: Tweak LZO patches
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2145 311d38ba-8fff-0310-9ca6-ca027cbcb966
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 @@ +Subject: [mtd-utils patch 1/2] Add lzo support to mtd-utils + Add LZO support to mtd-utils to generate LZO compressed jffs2 images Unlike the kernel version, the standard lzo userspace library is used @@ -39,7 +41,7 @@ Index: git/compr.c jffs2_rtime_init(); #endif +#ifdef CONFIG_JFFS2_LZO -+ jffs2_lzo_init(); ++ jffs2_lzo_init(); +#endif return 0; } @@ -49,7 +51,7 @@ Index: git/compr.c jffs2_zlib_exit(); #endif +#ifdef CONFIG_JFFS2_LZO -+ jffs2_lzo_exit(); ++ jffs2_lzo_exit(); +#endif return 0; } 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 @@ +Subject: [mtd-utils patch 2/2] Add favourlzo compression mode + Add a favourlzo compression mode to mtd-utils This allows lzo compression to be used in the cases where the @@ -35,21 +37,21 @@ Index: git/compr.c + struct jffs2_compressor *best, uint32_t size, uint32_t bestsize) +{ + switch (jffs2_compression_mode) { -+ case JFFS2_COMPR_MODE_SIZE: -+ if (bestsize > size) -+ return 1; -+ return 0; -+ case JFFS2_COMPR_MODE_FAVOURLZO: -+ if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > size)) -+ return 1; -+ if ((best->compr != JFFS2_COMPR_LZO) && (bestsize > size)) -+ return 1; -+ if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > (size * FAVOUR_LZO_PERCENT / 100))) -+ return 1; -+ if ((bestsize * FAVOUR_LZO_PERCENT / 100) > size) -+ return 1; ++ case JFFS2_COMPR_MODE_SIZE: ++ if (bestsize > size) ++ return 1; ++ return 0; ++ case JFFS2_COMPR_MODE_FAVOURLZO: ++ if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > size)) ++ return 1; ++ if ((best->compr != JFFS2_COMPR_LZO) && (bestsize > size)) ++ return 1; ++ if ((this->compr == JFFS2_COMPR_LZO) && (bestsize > (size * FAVOUR_LZO_PERCENT / 100))) ++ return 1; ++ if ((bestsize * FAVOUR_LZO_PERCENT / 100) > size) ++ return 1; + -+ return 0; ++ return 0; + } + /* Shouldn't happen */ + return 0; @@ -70,9 +72,9 @@ Index: git/compr.c + uint32_t needed_buf_size; + + if (jffs2_compression_mode == JFFS2_COMPR_MODE_FAVOURLZO) -+ needed_buf_size = orig_slen+jffs2_compression_check; ++ needed_buf_size = orig_slen + jffs2_compression_check; + else -+ needed_buf_size = orig_dlen+jffs2_compression_check; ++ needed_buf_size = orig_dlen + jffs2_compression_check; + /* Skip decompress-only backwards-compatibility and disabled modules */ if ((!this->compress)||(this->disabled)) @@ -105,7 +107,7 @@ Index: git/compr.c act_buf += sprintf(act_buf,"size"); break; + case JFFS2_COMPR_MODE_FAVOURLZO: -+ act_buf += sprintf(act_buf,"favourlzo"); ++ act_buf += sprintf(act_buf, "favourlzo"); + break; default: act_buf += sprintf(act_buf,"unkown"); @@ -134,3 +136,5 @@ Index: git/compr.h #define kmalloc(a,b) malloc(a) #define kfree(a) free(a) + + |