summaryrefslogtreecommitdiffstats
path: root/patches/mtd-utils-1.5.0/0002-Make-liblzo-optional-for-ubifs-tools.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/mtd-utils-1.5.0/0002-Make-liblzo-optional-for-ubifs-tools.patch')
-rw-r--r--patches/mtd-utils-1.5.0/0002-Make-liblzo-optional-for-ubifs-tools.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/patches/mtd-utils-1.5.0/0002-Make-liblzo-optional-for-ubifs-tools.patch b/patches/mtd-utils-1.5.0/0002-Make-liblzo-optional-for-ubifs-tools.patch
new file mode 100644
index 000000000..01c36567a
--- /dev/null
+++ b/patches/mtd-utils-1.5.0/0002-Make-liblzo-optional-for-ubifs-tools.patch
@@ -0,0 +1,68 @@
+From: Bernhard Walle <bernhard@bwalle.de>
+Date: Sun, 11 Mar 2012 20:11:14 +0100
+Subject: [PATCH] Make liblzo optional for ubifs tools
+
+Based on patch from Marc Kleine-Budde <mkl@pengutronix.de>.
+
+Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
+---
+ Makefile | 2 +-
+ mkfs.ubifs/compr.c | 17 +++++++++++++++++
+ 2 files changed, 18 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index a682a8f..190db58 100644
+--- a/Makefile
++++ b/Makefile
+@@ -105,7 +105,7 @@ $(call _mkdep,lib/,libmtd.a)
+ #
+ obj-mkfs.ubifs = crc16.o lpt.o compr.o devtable.o \
+ hashtable/hashtable.o hashtable/hashtable_itr.o
+-LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid
++LDLIBS_mkfs.ubifs = -lz $(LZOLDLIBS) -lm -luuid
+ $(call mkdep,mkfs.ubifs/,mkfs.ubifs,,ubi-utils/libubi.a)
+
+ #
+diff --git a/mkfs.ubifs/compr.c b/mkfs.ubifs/compr.c
+index 4152b6a..244d450 100644
+--- a/mkfs.ubifs/compr.c
++++ b/mkfs.ubifs/compr.c
+@@ -24,7 +24,11 @@
+ #include <stdio.h>
+ #include <stdint.h>
+ #include <string.h>
++#ifndef WITHOUT_LZO
+ #include <lzo/lzo1x.h>
++#else
++#define LZO1X_999_MEM_COMPRESS 0
++#endif
+ #include <linux/types.h>
+
+ #define crc32 __zlib_crc32
+@@ -86,6 +90,8 @@ static int zlib_deflate(void *in_buf, size_t in_len, void *out_buf,
+ return 0;
+ }
+
++
++#ifndef WITHOUT_LZO
+ static int lzo_compress(void *in_buf, size_t in_len, void *out_buf,
+ size_t *out_len)
+ {
+@@ -103,6 +109,17 @@ static int lzo_compress(void *in_buf, size_t in_len, void *out_buf,
+
+ return 0;
+ }
++#else
++static inline int lzo_compress(void *in_buf, size_t in_len, void *out_buf,
++ size_t *out_len)
++{
++ (void)in_buf;
++ (void)in_len;
++ (void)out_buf;
++ (void)out_len;
++ return -1;
++}
++#endif
+
+ static int no_compress(void *in_buf, size_t in_len, void *out_buf,
+ size_t *out_len)