]> code.ossystems Code Review - openembedded-core.git/commitdiff
mtd-utils: Tweak LZO patches
authorRichard Purdie <richard@openedhand.com>
Tue, 10 Jul 2007 14:52:07 +0000 (14:52 +0000)
committerRichard Purdie <richard@openedhand.com>
Tue, 10 Jul 2007 14:52:07 +0000 (14:52 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2145 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/packages/mtd/mtd-utils/add_lzo.patch
meta/packages/mtd/mtd-utils/favour_lzo.patch

index 9afd1ca46b95925a3eb6b81a07e4076bbb60330c..34215713724be83fdf7d3c19c6ba816f6eba96b2 100644 (file)
@@ -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;
  }
index 9e55d5f4b3bba3836ce3330ba1b6ef30ebf46d43..8b1581c467e866f3a586e70e4cce6901ecfe9ecc 100644 (file)
@@ -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)
+
+