[LEDE-DEV] [PATCH v2 4/5] mtd-utils: update to 2.0.2

Hauke Mehrtens hauke at hauke-m.de
Thu Apr 19 15:12:05 PDT 2018


From: Syrone Wong <wong.syrone at gmail.com>

010-fix-rpmatch.patch is upstream, removed from our patchset
The file structure is changed, modify patch accordingly
use CONFIGURE_ARGS to disable tests, xattr and lzo

Compile and run tested on mvebu and x86_64

Signed-off-by: Syrone Wong <wong.syrone at gmail.com>
---

changes since v1:
* Update to version 2.0.2
* use ftp to download the tar

 package/utils/mtd-utils/Makefile                   | 22 ++++----
 .../utils/mtd-utils/patches/010-fix-rpmatch.patch  | 19 -------
 .../utils/mtd-utils/patches/100-fix_includes.patch |  2 +-
 .../utils/mtd-utils/patches/130-lzma_jffs2.patch   | 66 ++++++++++++----------
 4 files changed, 47 insertions(+), 62 deletions(-)
 delete mode 100644 package/utils/mtd-utils/patches/010-fix-rpmatch.patch

diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile
index 1e3c281156..2ce7d671fe 100644
--- a/package/utils/mtd-utils/Makefile
+++ b/package/utils/mtd-utils/Makefile
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mtd-utils
-PKG_VERSION:=1.5.2
+PKG_VERSION:=2.0.2
 PKG_RELEASE:=1
 
-PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=aea36417067dade75192bafa03af70b6eb2677b1
-PKG_MIRROR_HASH:=e11b342b85a36b2e438a8412ec52f87621d3046aec1a93039f8c72de9990b2a7
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/mtd-utils/
+PKG_HASH:=fb3de61be8e932abb424e8ea3c30298f553d5f970ad158a737bb303bbf9660b8
 
 PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
 
 PKG_FLAGS:=nonshared
 
@@ -54,12 +54,12 @@ define Package/nand-utils/description
   Utilities for NAND devices.
 endef
 
-MAKE_FLAGS += \
-	DESTDIR="$(PKG_INSTALL_DIR)" \
-	BUILDDIR="$(PKG_BUILD_DIR)" \
-	LDLIBS+="$(LIBGCC_S)" \
-	WITHOUT_XATTR=1 \
-	WITHOUT_LZO=1
+MAKE_FLAGS += LDLIBS+="$(LIBGCC_S)"
+
+CONFIGURE_ARGS += \
+	--disable-tests \
+	--without-xattr \
+	--without-lzo
 
 define Package/ubi-utils/install
 	$(INSTALL_DIR) $(1)/usr/sbin
diff --git a/package/utils/mtd-utils/patches/010-fix-rpmatch.patch b/package/utils/mtd-utils/patches/010-fix-rpmatch.patch
deleted file mode 100644
index 8374a26e9b..0000000000
--- a/package/utils/mtd-utils/patches/010-fix-rpmatch.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- a/include/common.h
-+++ b/include/common.h
-@@ -152,10 +152,12 @@ static inline bool prompt(const char *ms
- 		}
- 
- 		if (strcmp("\n", line) != 0) {
--			switch (rpmatch(line)) {
--			case 0: ret = false; break;
--			case 1: ret = true; break;
--			case -1:
-+			switch (line[0]) {
-+			case 'N':
-+			case 'n': ret = false; break;
-+			case 'Y':
-+			case 'y': ret = true; break;
-+			default:
- 				puts("unknown response; please try again");
- 				continue;
- 			}
diff --git a/package/utils/mtd-utils/patches/100-fix_includes.patch b/package/utils/mtd-utils/patches/100-fix_includes.patch
index 7dad28b472..cc75052c5e 100644
--- a/package/utils/mtd-utils/patches/100-fix_includes.patch
+++ b/package/utils/mtd-utils/patches/100-fix_includes.patch
@@ -5,6 +5,6 @@
  #include <stdlib.h>
  #include <string.h>
 +#include <sys/types.h>
+ #include "libfec.h"
  
  /*
-  * stuff used for testing purposes only
diff --git a/package/utils/mtd-utils/patches/130-lzma_jffs2.patch b/package/utils/mtd-utils/patches/130-lzma_jffs2.patch
index c6454fed57..d9cbfeebec 100644
--- a/package/utils/mtd-utils/patches/130-lzma_jffs2.patch
+++ b/package/utils/mtd-utils/patches/130-lzma_jffs2.patch
@@ -1,25 +1,29 @@
---- a/Makefile
-+++ b/Makefile
-@@ -3,7 +3,7 @@
+--- a/jffsX-utils/Makemodule.am
++++ b/jffsX-utils/Makemodule.am
+@@ -4,11 +4,19 @@ mkfs_jffs2_SOURCES = \
+ 	jffsX-utils/compr_zlib.c \
+ 	jffsX-utils/compr.h \
+ 	jffsX-utils/rbtree.c \
+-	jffsX-utils/compr_lzo.c \
++	jffsX-utils/compr_lzma.c \
++	jffsX-utils/lzma/LzFind.c \
++	jffsX-utils/lzma/LzmaEnc.c \
++	jffsX-utils/lzma/LzmaDec.c \
+ 	jffsX-utils/compr.c \
+ 	jffsX-utils/compr_rtime.c
++
++if !WITHOUT_LZO
++mkfs_jffs2_SOURCES += jffsX-utils/compr_lzo.c
++endif
++
+ mkfs_jffs2_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS)
+-mkfs_jffs2_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS)
++mkfs_jffs2_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS) -I./include/linux/lzma
  
- VERSION = 1.5.2
- 
--CPPFLAGS += -D_GNU_SOURCE -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) $(UUIDCPPFLAGS)
-+CPPFLAGS += -D_GNU_SOURCE -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) $(UUIDCPPFLAGS) -I./include/linux/lzma
- 
- ifeq ($(WITHOUT_XATTR), 1)
-   CPPFLAGS += -DWITHOUT_XATTR
-@@ -84,7 +84,7 @@ $(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) $(LZOLDFLAGS)
- LDLIBS_mkfs.jffs2  = -lz $(LZOLDLIBS)
- 
---- a/compr.c
-+++ b/compr.c
+ jffs2reader_SOURCES = jffsX-utils/jffs2reader.c
+ jffs2reader_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS)
+--- a/jffsX-utils/compr.c
++++ b/jffsX-utils/compr.c
 @@ -520,6 +520,9 @@ int jffs2_compressors_init(void)
  #ifdef CONFIG_JFFS2_LZO
  	jffs2_lzo_init();
@@ -39,8 +43,8 @@
 +#endif
  	return 0;
  }
---- a/compr.h
-+++ b/compr.h
+--- a/jffsX-utils/compr.h
++++ b/jffsX-utils/compr.h
 @@ -18,13 +18,14 @@
  
  #define CONFIG_JFFS2_ZLIB
@@ -71,7 +75,7 @@
  
  #endif /* __JFFS2_COMPR_H__ */
 --- /dev/null
-+++ b/compr_lzma.c
++++ b/jffsX-utils/compr_lzma.c
 @@ -0,0 +1,128 @@
 +/*
 + * JFFS2 -- Journalling Flash File System, Version 2.
@@ -187,7 +191,7 @@
 +
 +	ret = lzma_alloc_workspace(&props);
 +	if (ret < 0)
-+	return ret;
++		return ret;
 +
 +	ret = jffs2_register_compressor(&jffs2_lzma_comp);
 +	if (ret)
@@ -899,7 +903,7 @@
 +
 +#endif
 --- /dev/null
-+++ b/lzma/LzFind.c
++++ b/jffsX-utils/lzma/LzFind.c
 @@ -0,0 +1,753 @@
 +/* LzFind.c  -- Match finder for LZ algorithms
 +2008-04-04
@@ -1655,7 +1659,7 @@
 +  }
 +}
 --- /dev/null
-+++ b/lzma/LzmaDec.c
++++ b/jffsX-utils/lzma/LzmaDec.c
 @@ -0,0 +1,1014 @@
 +/* LzmaDec.c -- LZMA Decoder
 +2008-04-29
@@ -2672,7 +2676,7 @@
 +  return res;
 +}
 --- /dev/null
-+++ b/lzma/LzmaEnc.c
++++ b/jffsX-utils/lzma/LzmaEnc.c
 @@ -0,0 +1,2335 @@
 +/* LzmaEnc.c -- LZMA Encoder
 +2008-04-28
@@ -5009,9 +5013,9 @@
 +  LzmaEnc_Destroy(p, alloc, allocBig);
 +  return res;
 +}
---- a/mkfs.jffs2.c
-+++ b/mkfs.jffs2.c
-@@ -1659,11 +1659,11 @@ int main(int argc, char **argv)
+--- a/jffsX-utils/mkfs.jffs2.c
++++ b/jffsX-utils/mkfs.jffs2.c
+@@ -1666,11 +1666,11 @@ int main(int argc, char **argv)
  						  }
  						  erase_block_size *= units;
  
-- 
2.11.0




More information about the Lede-dev mailing list