diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile index 45bceaf837..e298e42d75 100644 --- a/tools/mtd-utils/Makefile +++ b/tools/mtd-utils/Makefile @@ -7,14 +7,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd -PKG_VERSION:=20090505 +PKG_VERSION:=20100912 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=d021e049efaff50de33819b8cd2835d4b79bcfa8 +PKG_SOURCE_VERSION:=e5a8bd7061921a9a787ffbb2c47a5af8f439d342 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_MD5SUM:=1f42c2cae08eb9e7b52d0c188f8d6338 +PKG_MD5SUM:=1ad3e00b0f59d796ad76f18f15240b39 PKG_CAT:=zcat HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION) @@ -36,6 +36,10 @@ define Host/Compile $(MAKE) -C $(HOST_BUILD_DIR) \ $(MTD_MAKEOPTS) \ TARGETS=mkfs.jffs2 + $(MAKE) -C $(HOST_BUILD_DIR)/lib \ + $(MTD_MAKEOPTS) \ + TARGETS="libmtd.a libcrc32.a" \ + LIBS="libmtd libcrc32" $(MAKE) -C $(HOST_BUILD_DIR)/ubi-utils \ $(MTD_MAKEOPTS) \ TARGETS=ubinize diff --git a/tools/mtd-utils/patches/100-optional_lzo.patch b/tools/mtd-utils/patches/100-optional_lzo.patch index d9ebc3e9b4..5af0ae23e1 100644 --- a/tools/mtd-utils/patches/100-optional_lzo.patch +++ b/tools/mtd-utils/patches/100-optional_lzo.patch @@ -1,15 +1,14 @@ --- a/Makefile +++ b/Makefile -@@ -36,10 +36,16 @@ $(SYMLINKS): +@@ -42,10 +42,15 @@ $(SYMLINKS): ln -sf ../fs/jffs2/$@ $@ $(BUILDDIR)/mkfs.jffs2: $(addprefix $(BUILDDIR)/,\ -- crc32.o compr_rtime.o mkfs.jffs2.o compr_zlib.o compr_lzo.o \ -+ crc32.o compr_rtime.o mkfs.jffs2.o compr_zlib.o $(if $(NO_LZO),,compr_lzo.o) \ +- compr_rtime.o mkfs.jffs2.o compr_zlib.o compr_lzo.o \ ++ compr_rtime.o mkfs.jffs2.o compr_zlib.o $(if $(NO_LZO),,compr_lzo.o) \ compr.o rbtree.o) -LDFLAGS_mkfs.jffs2 = $(ZLIBLDFLAGS) $(LZOLDFLAGS) -LDLIBS_mkfs.jffs2 = -lz -llzo2 -+ +LDFLAGS_mkfs.jffs2 := $(ZLIBLDFLAGS) +LDLIBS_mkfs.jffs2 := -lz +ifndef NO_LZO @@ -18,15 +17,5 @@ +CPPFLAGS += -DCONFIG_JFFS2_LZO +endif - $(BUILDDIR)/flash_eraseall: $(BUILDDIR)/crc32.o $(BUILDDIR)/flash_eraseall.o - ---- a/compr.h -+++ b/compr.h -@@ -18,7 +18,6 @@ - - #define CONFIG_JFFS2_ZLIB - #define CONFIG_JFFS2_RTIME --#define CONFIG_JFFS2_LZO - - #define JFFS2_RUBINMIPS_PRIORITY 10 - #define JFFS2_DYNRUBIN_PRIORITY 20 + $(BUILDDIR)/jffs2reader: $(BUILDDIR)/jffs2reader.o + LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS) diff --git a/tools/mtd-utils/patches/101-ubifs-optional_lzo.patch b/tools/mtd-utils/patches/101-ubifs-optional_lzo.patch index d49c94bb28..9f797e01b7 100644 --- a/tools/mtd-utils/patches/101-ubifs-optional_lzo.patch +++ b/tools/mtd-utils/patches/101-ubifs-optional_lzo.patch @@ -2,48 +2,47 @@ diff --git a/mkfs.ubifs/Makefile b/mkfs.ubifs/Makefile index a678b0a..919ce89 100644 --- a/mkfs.ubifs/Makefile +++ b/mkfs.ubifs/Makefile -@@ -5,7 +5,7 @@ ALL_SOURCES=*.[ch] hashtable/*.[ch] +@@ -6,7 +6,7 @@ ALL_SOURCES=*.[ch] hashtable/*.[ch] TARGETS = mkfs.ubifs --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 +-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) 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 -@@ -25,7 +25,9 @@ +@@ -24,7 +24,9 @@ + #include #include #include - #include +#if CONFIG_UBIFS_LZO #include +#endif #include - #include "compr.h" -@@ -83,6 +85,17 @@ static int zlib_deflate(void *in_buf, size_t in_len, void *out_buf, + #define crc32 __zlib_crc32 +@@ -85,6 +87,16 @@ static int zlib_deflate(void *in_buf, si 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) { -@@ -101,14 +114,16 @@ static int lzo_compress(void *in_buf, size_t in_len, void *out_buf, +@@ -103,14 +115,16 @@ static int lzo_compress(void *in_buf, si return 0; } @@ -57,7 +56,7 @@ index e378c5d..0208f80 100644 - memcpy(out_buf, in_buf, in_len); - *out_len = in_len; - return 0; -+ return -1; ++ return 1; } +#endif @@ -65,7 +64,7 @@ index e378c5d..0208f80 100644 static char *zlib_buf; static int favor_lzo_compress(void *in_buf, size_t in_len, void *out_buf, -@@ -195,9 +210,11 @@ int compress_data(void *in_buf, size_t in_len, void *out_buf, size_t *out_len, +@@ -197,9 +211,11 @@ int compress_data(void *in_buf, size_t i int init_compression(void) { @@ -77,7 +76,7 @@ index e378c5d..0208f80 100644 zlib_buf = malloc(UBIFS_BLOCK_SIZE * WORST_COMPR_FACTOR); if (!zlib_buf) { -@@ -211,7 +228,9 @@ int init_compression(void) +@@ -213,7 +229,9 @@ int init_compression(void) void destroy_compression(void) { free(zlib_buf); diff --git a/tools/mtd-utils/patches/120-cygwin_fixes.patch b/tools/mtd-utils/patches/120-cygwin_fixes.patch index 61a6d5ef2d..116660acbf 100644 --- a/tools/mtd-utils/patches/120-cygwin_fixes.patch +++ b/tools/mtd-utils/patches/120-cygwin_fixes.patch @@ -9,7 +9,7 @@ +endif + +ifneq ($(shell uname -o),Cygwin) - SUBDIRS = ubi-utils mkfs.ubifs + SUBDIRS = lib ubi-utils mkfs.ubifs TARGETS = ftl_format flash_erase flash_eraseall nanddump doc_loadbios \ @@ -17,6 +22,10 @@ TARGETS = ftl_format flash_erase flash_e diff --git a/tools/mtd-utils/patches/130-lzma_jffs2.patch b/tools/mtd-utils/patches/130-lzma_jffs2.patch index 0f2b8af561..d75ad31397 100644 --- a/tools/mtd-utils/patches/130-lzma_jffs2.patch +++ b/tools/mtd-utils/patches/130-lzma_jffs2.patch @@ -1,5 +1,5 @@ --- a/Makefile -+++ b/Makefile ++++ b/Makefile @@ -1,7 +1,7 @@ # -*- sh -*- @@ -9,17 +9,17 @@ ifeq ($(WITHOUT_XATTR), 1) CPPFLAGS += -DWITHOUT_XATTR -@@ -45,7 +45,9 @@ +@@ -51,7 +51,9 @@ $(SYMLINKS): ln -sf ../fs/jffs2/$@ $@ $(BUILDDIR)/mkfs.jffs2: $(addprefix $(BUILDDIR)/,\ -- crc32.o compr_rtime.o mkfs.jffs2.o compr_zlib.o $(if $(NO_LZO),,compr_lzo.o) \ -+ crc32.o compr_rtime.o mkfs.jffs2.o compr_zlib.o \ +- 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) \ -+ compr_lzma.o lzma/LzFind.o lzma/LzmaEnc.o lzma/LzmaDec.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 @@ @@ -43,10 +43,11 @@ } --- a/compr.h 2010-03-20 23:08:46.289595000 +0100 +++ b/compr.h 2010-03-20 23:51:41.953345921 +0100 -@@ -18,12 +18,14 @@ +@@ -18,13 +18,14 @@ #define CONFIG_JFFS2_ZLIB #define CONFIG_JFFS2_RTIME +-#define CONFIG_JFFS2_LZO +#define CONFIG_JFFS2_LZMA #define JFFS2_RUBINMIPS_PRIORITY 10 @@ -60,7 +61,7 @@ #define JFFS2_COMPR_MODE_NONE 0 #define JFFS2_COMPR_MODE_PRIORITY 1 -@@ -114,5 +116,10 @@ +@@ -115,5 +116,10 @@ void jffs2_rtime_exit(void); int jffs2_lzo_init(void); void jffs2_lzo_exit(void); #endif diff --git a/tools/mtd-utils/patches/131-fix_lib_compile.patch b/tools/mtd-utils/patches/131-fix_lib_compile.patch new file mode 100644 index 0000000000..288e0d45e0 --- /dev/null +++ b/tools/mtd-utils/patches/131-fix_lib_compile.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -67,8 +67,6 @@ $(BUILDDIR)/jffs2reader: $(BUILDDIR)/jff + LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS) + LDLIBS_jffs2reader = -lz -llzo2 + +-$(BUILDDIR)/lib/libmtd.a: subdirs_lib_all ; +- + install:: ${TARGETS} + mkdir -p ${DESTDIR}/${SBINDIR} + install -m 0755 ${TARGETS} ${DESTDIR}/${SBINDIR}/