downloads.mk: introduce name-agnostic PROJECT_GIT variable
[openwrt/openwrt.git] / tools / mtd-utils / patches / 130-lzma_jffs2.patch
index d75ad313972a56ed17a1204db8bbde16a8b666de..b04f01992266386b979471629ceb2ef99d4df908 100644 (file)
@@ -1,28 +1,27 @@
---- a/Makefile 
+--- a/Makefile
 +++ b/Makefile
-@@ -1,7 +1,7 @@
+@@ -4,6 +4,7 @@
+ VERSION = 1.5.2
  
- # -*- sh -*-
--CPPFLAGS += -I./include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
-+CPPFLAGS += -I./include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) -I./include/linux/lzma
+ CPPFLAGS += -D_GNU_SOURCE -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) $(UUIDCPPFLAGS)
++CPPFLAGS += -I./include/linux/lzma
  
  ifeq ($(WITHOUT_XATTR), 1)
    CPPFLAGS += -DWITHOUT_XATTR
-@@ -51,7 +51,9 @@ $(SYMLINKS):
-       ln -sf ../fs/jffs2/$@ $@
- $(BUILDDIR)/mkfs.jffs2: $(addprefix $(BUILDDIR)/,\
--      compr_rtime.o mkfs.jffs2.o compr_zlib.o $(if $(NO_LZO),,compr_lzo.o) \
-+      compr_rtime.o mkfs.jffs2.o compr_zlib.o \
-+      $(if $(NO_LZO),,compr_lzo.o) \
+@@ -84,7 +85,9 @@ $(BUILDDIR)/include/version.h.tmp:
+ #
+ # Utils in top level
+ #
+-obj-mkfs.jffs2 = compr_rtime.o compr_zlib.o compr_lzo.o compr.o rbtree.o
++obj-mkfs.jffs2 = compr_rtime.o compr_zlib.o $(if $(WITHOUT_LZO),,compr_lzo.o)\
 +      compr_lzma.o lzma/LzFind.o lzma/LzmaEnc.o lzma/LzmaDec.o \
-       compr.o rbtree.o)
- LDFLAGS_mkfs.jffs2 := $(ZLIBLDFLAGS)
- LDLIBS_mkfs.jffs2  := -lz
---- a/compr.c  2009-06-05 16:59:08.000000000 +0200
-+++ b/compr.c  2010-03-20 23:16:14.556367000 +0100
-@@ -520,6 +520,9 @@
++      compr.o rbtree.o
+ LDFLAGS_mkfs.jffs2 = $(ZLIBLDFLAGS) $(LZOLDFLAGS)
+ LDLIBS_mkfs.jffs2  = -lz $(LZOLDLIBS)
+--- a/compr.c
++++ b/compr.c
+@@ -520,6 +520,9 @@ int jffs2_compressors_init(void)
  #ifdef CONFIG_JFFS2_LZO
        jffs2_lzo_init();
  #endif
@@ -32,7 +31,7 @@
        return 0;
  }
  
-@@ -534,5 +537,8 @@
+@@ -534,5 +537,8 @@ int jffs2_compressors_exit(void)
  #ifdef CONFIG_JFFS2_LZO
        jffs2_lzo_exit();
  #endif
@@ -41,8 +40,8 @@
 +#endif
        return 0;
  }
---- a/compr.h  2010-03-20 23:08:46.289595000 +0100
-+++ b/compr.h  2010-03-20 23:51:41.953345921 +0100
+--- a/compr.h
++++ b/compr.h
 @@ -18,13 +18,14 @@
  
  #define CONFIG_JFFS2_ZLIB
@@ -72,8 +71,8 @@
 +
  
  #endif /* __JFFS2_COMPR_H__ */
---- a/compr_lzma.c     1970-01-01 01:00:00.000000000 +0100
-+++ b/compr_lzma.c     2010-03-20 23:16:15.048654497 +0100
+--- /dev/null
++++ b/compr_lzma.c
 @@ -0,0 +1,128 @@
 +/*
 + * JFFS2 -- Journalling Flash File System, Version 2.
 +}
 +
 +STATIC int jffs2_lzma_compress(unsigned char *data_in, unsigned char *cpage_out,
-+                            uint32_t *sourcelen, uint32_t *dstlen, void *model)
++                            uint32_t *sourcelen, uint32_t *dstlen)
 +{
 +      SizeT compress_size = (SizeT)(*dstlen);
 +      int ret;
 +}
 +
 +STATIC int jffs2_lzma_decompress(unsigned char *data_in, unsigned char *cpage_out,
-+                               uint32_t srclen, uint32_t destlen, void *model)
++                               uint32_t srclen, uint32_t destlen)
 +{
 +      int ret;
 +      SizeT dl = (SizeT)destlen;
 +      jffs2_unregister_compressor(&jffs2_lzma_comp);
 +      lzma_free_workspace();
 +}
---- a/include/linux/jffs2.h    2009-06-05 16:59:08.000000000 +0200
-+++ b/include/linux/jffs2.h    2010-03-20 23:16:15.305246000 +0100
+--- a/include/linux/jffs2.h
++++ b/include/linux/jffs2.h
 @@ -47,6 +47,7 @@
  #define JFFS2_COMPR_DYNRUBIN  0x05
  #define JFFS2_COMPR_ZLIB      0x06
  /* Compatibility flags. */
  #define JFFS2_COMPAT_MASK 0xc000      /* What do to if an unknown nodetype is found */
  #define JFFS2_NODE_ACCURATE 0x2000
---- a/include/linux/lzma.h     1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma.h     2010-03-20 23:16:16.380508712 +0100
+--- /dev/null
++++ b/include/linux/lzma.h
 @@ -0,0 +1,61 @@
 +#ifndef __LZMA_H__
 +#define __LZMA_H__
 +static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free};
 +
 +#endif
---- a/include/linux/lzma/LzFind.h      1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma/LzFind.h      2010-03-20 23:19:44.189059515 +0100
+--- /dev/null
++++ b/include/linux/lzma/LzFind.h
 @@ -0,0 +1,116 @@
 +/* LzFind.h  -- Match finder for LZ algorithms
 +2008-04-04
 +void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
 +
 +#endif
---- a/include/linux/lzma/LzHash.h      1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma/LzHash.h      2010-03-20 23:19:44.588791287 +0100
+--- /dev/null
++++ b/include/linux/lzma/LzHash.h
 @@ -0,0 +1,56 @@
 +/* LzHash.h  -- HASH functions for LZ algorithms
 +2008-03-26
 +  hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
 +
 +#endif
---- a/include/linux/lzma/LzmaDec.h     1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma/LzmaDec.h     2010-03-20 23:19:43.766328000 +0100
+--- /dev/null
++++ b/include/linux/lzma/LzmaDec.h
 @@ -0,0 +1,232 @@
 +/* LzmaDec.h -- LZMA Decoder
 +2008-04-29
 +    ELzmaStatus *status, ISzAlloc *alloc);
 +
 +#endif
---- a/include/linux/lzma/LzmaEnc.h     1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma/LzmaEnc.h     2010-03-20 23:19:47.392642470 +0100
+--- /dev/null
++++ b/include/linux/lzma/LzmaEnc.h
 @@ -0,0 +1,74 @@
 +/*  LzmaEnc.h -- LZMA Encoder
 +2008-04-27
 +    ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
 +
 +#endif
---- a/include/linux/lzma/Types.h       1970-01-01 01:00:00.000000000 +0100
-+++ b/include/linux/lzma/Types.h       2010-03-20 23:19:44.013465852 +0100
+--- /dev/null
++++ b/include/linux/lzma/Types.h
 @@ -0,0 +1,130 @@
 +/* Types.h -- Basic types
 +2008-04-11
 +#define IAlloc_Free(p, a) (p)->Free((p), a)
 +
 +#endif
---- a/lzma/LzFind.c    1970-01-01 01:00:00.000000000 +0100
-+++ b/lzma/LzFind.c    2010-03-20 23:19:47.990406000 +0100
+--- /dev/null
++++ b/lzma/LzFind.c
 @@ -0,0 +1,753 @@
 +/* LzFind.c  -- Match finder for LZ algorithms
 +2008-04-04
 +    vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;
 +  }
 +}
---- a/lzma/LzmaDec.c   1970-01-01 01:00:00.000000000 +0100
-+++ b/lzma/LzmaDec.c   2010-03-20 23:19:44.413562000 +0100
+--- /dev/null
++++ b/lzma/LzmaDec.c
 @@ -0,0 +1,1014 @@
 +/* LzmaDec.c -- LZMA Decoder
 +2008-04-29
 +  LzmaDec_FreeProbs(&p, alloc);
 +  return res;
 +}
---- a/lzma/LzmaEnc.c   1970-01-01 01:00:00.000000000 +0100
-+++ b/lzma/LzmaEnc.c   2010-03-20 23:19:47.815156000 +0100
+--- /dev/null
++++ b/lzma/LzmaEnc.c
 @@ -0,0 +1,2335 @@
 +/* LzmaEnc.c -- LZMA Encoder
 +2008-04-28
 +  LzmaEnc_Destroy(p, alloc, allocBig);
 +  return res;
 +}
---- a/mkfs.jffs2.c     2009-06-05 16:59:08.000000000 +0200
-+++ b/mkfs.jffs2.c     2010-03-20 23:16:16.877026000 +0100
-@@ -1761,11 +1761,11 @@ int main(int argc, char **argv)
+--- a/mkfs.jffs2.c
++++ b/mkfs.jffs2.c
+@@ -1659,11 +1659,11 @@ int main(int argc, char **argv)
                                                  }
                                                  erase_block_size *= units;