summaryrefslogtreecommitdiff
path: root/tools/mtd-utils/patches/101-ubifs-optional_lzo.patch
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-09-13 18:50:41 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-09-13 18:50:41 +0000
commit97a286cb62475a3dce30c2c69d1248f0b98288c4 (patch)
tree7196b6bac83eeae36d8f439aa28ef62d629bc26c /tools/mtd-utils/patches/101-ubifs-optional_lzo.patch
parent7ec18378a75ed98f1a1cc389aca51446bb85eae6 (diff)
downloadmtk-20170518-97a286cb62475a3dce30c2c69d1248f0b98288c4.zip
mtk-20170518-97a286cb62475a3dce30c2c69d1248f0b98288c4.tar.gz
mtk-20170518-97a286cb62475a3dce30c2c69d1248f0b98288c4.tar.bz2
revert r23048 for now until Darwin compile issues have been sorted out (#7934)
SVN-Revision: 23057
Diffstat (limited to 'tools/mtd-utils/patches/101-ubifs-optional_lzo.patch')
-rw-r--r--tools/mtd-utils/patches/101-ubifs-optional_lzo.patch29
1 files changed, 15 insertions, 14 deletions
diff --git a/tools/mtd-utils/patches/101-ubifs-optional_lzo.patch b/tools/mtd-utils/patches/101-ubifs-optional_lzo.patch
index 9f797e0..d49c94b 100644
--- a/tools/mtd-utils/patches/101-ubifs-optional_lzo.patch
+++ b/tools/mtd-utils/patches/101-ubifs-optional_lzo.patch
@@ -2,47 +2,48 @@ diff --git a/mkfs.ubifs/Makefile b/mkfs.ubifs/Makefile
index a678b0a..919ce89 100644
--- a/mkfs.ubifs/Makefile
+++ b/mkfs.ubifs/Makefile
-@@ -6,7 +6,7 @@ ALL_SOURCES=*.[ch] hashtable/*.[ch]
+@@ -5,7 +5,7 @@ ALL_SOURCES=*.[ch] hashtable/*.[ch]
TARGETS = mkfs.ubifs
--LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid -L$(BUILDDIR)/../ubi-utils/ -lubi
-+LDLIBS_mkfs.ubifs = -lz $(if,$(NO_LZO),,-llzo2) -lm -luuid -L$(BUILDDIR)/../ubi-utils/ -lubi
- LDLIBS_mkfs.ubifs += -L$(BUILDDIR)/../lib -lmtd -lcrc32
- LDLIBS_mkfs.ubifs += $(ZLIBLDFLAGS) $(LZOLDFLAGS)
+-LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid -L../ubi-utils/ -lubi
++LDLIBS_mkfs.ubifs = -lz $(if,$(NO_LZO),,-llzo2) -lm -luuid -L../ubi-utils/ -lubi
+
+ include ../common.mk
diff --git a/mkfs.ubifs/compr.c b/mkfs.ubifs/compr.c
index e378c5d..0208f80 100644
--- a/mkfs.ubifs/compr.c
+++ b/mkfs.ubifs/compr.c
-@@ -24,7 +24,9 @@
- #include <stdio.h>
+@@ -25,7 +25,9 @@
#include <stdint.h>
#include <string.h>
+ #include <zlib.h>
+#if CONFIG_UBIFS_LZO
#include <lzo/lzo1x.h>
+#endif
#include <linux/types.h>
- #define crc32 __zlib_crc32
-@@ -85,6 +87,16 @@ static int zlib_deflate(void *in_buf, si
+ #include "compr.h"
+@@ -83,6 +85,17 @@ static int zlib_deflate(void *in_buf, size_t in_len, void *out_buf,
return 0;
}
+static int no_compress(void *in_buf, size_t in_len, void *out_buf,
-+ size_t *out_len)
++ size_t *out_len)
+{
+ memcpy(out_buf, in_buf, in_len);
+ *out_len = in_len;
+ return 0;
+}
+
++
+#if CONFIG_UBIFS_LZO
+
static int lzo_compress(void *in_buf, size_t in_len, void *out_buf,
size_t *out_len)
{
-@@ -103,14 +115,16 @@ static int lzo_compress(void *in_buf, si
+@@ -101,14 +114,16 @@ static int lzo_compress(void *in_buf, size_t in_len, void *out_buf,
return 0;
}
@@ -56,7 +57,7 @@ index e378c5d..0208f80 100644
- memcpy(out_buf, in_buf, in_len);
- *out_len = in_len;
- return 0;
-+ return 1;
++ return -1;
}
+#endif
@@ -64,7 +65,7 @@ index e378c5d..0208f80 100644
static char *zlib_buf;
static int favor_lzo_compress(void *in_buf, size_t in_len, void *out_buf,
-@@ -197,9 +211,11 @@ int compress_data(void *in_buf, size_t i
+@@ -195,9 +210,11 @@ int compress_data(void *in_buf, size_t in_len, void *out_buf, size_t *out_len,
int init_compression(void)
{
@@ -76,7 +77,7 @@ index e378c5d..0208f80 100644
zlib_buf = malloc(UBIFS_BLOCK_SIZE * WORST_COMPR_FACTOR);
if (!zlib_buf) {
-@@ -213,7 +229,9 @@ int init_compression(void)
+@@ -211,7 +228,9 @@ int init_compression(void)
void destroy_compression(void)
{
free(zlib_buf);