Re: [LEDE-DEV] [PATCH v2 3/5] tools/mtd-utils: update to version 2.0.2

2018-04-30 Thread Felix Fietkau
On 2018-04-20 00:12, Hauke Mehrtens wrote:
> This version now uses autotools to configure the build system. They are
> also using the newly added zlib package.
> 
> Signed-off-by: Hauke Mehrtens 
> ---
> 
> changes since v1:
> * Update to version 2.0.2
> * use ftp to download the tar
> 
>  tools/Makefile |   2 +-
>  tools/mtd-utils/Makefile   |  46 +++-
>  tools/mtd-utils/patches/100-sscanf_fix.patch   |   6 +-
>  tools/mtd-utils/patches/110-portability.patch  |  51 +
>  .../mtd-utils/patches/120-include_sysmacros.patch  |  25 -
>  tools/mtd-utils/patches/130-lzma_jffs2.patch   |  65 +--
>  .../patches/135-mkubifs_optional_lzo.patch | 119 
> -
>  ...igen-add-ubigen_write_terminator-function.patch |   8 +-
>  .../201-ubinize-add-terminator-support.patch   |  23 ++--
>  .../patches/310-add-static-linking-option.patch|  43 
>  .../patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch |  16 +--
>  11 files changed, 101 insertions(+), 303 deletions(-)
>  delete mode 100644 tools/mtd-utils/patches/120-include_sysmacros.patch
>  delete mode 100644 tools/mtd-utils/patches/135-mkubifs_optional_lzo.patch
>  delete mode 100644 
> tools/mtd-utils/patches/310-add-static-linking-option.patch
> 
> diff --git a/tools/Makefile b/tools/Makefile
> index 8dfab9892b..d2b5daf18c 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -50,7 +50,7 @@ $(curdir)/automake/compile := $(curdir)/m4/compile 
> $(curdir)/autoconf/compile $(
>  $(curdir)/gmp/compile := $(curdir)/libtool/compile
>  $(curdir)/mpc/compile := $(curdir)/mpfr/compile $(curdir)/gmp/compile
>  $(curdir)/mpfr/compile := $(curdir)/gmp/compile
> -$(curdir)/mtd-utils/compile := $(curdir)/e2fsprogs/compile 
> $(curdir)/zlib/compile
> +$(curdir)/mtd-utils/compile := $(curdir)/libtool/compile 
> $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile
>  $(curdir)/mklibs/compile := $(curdir)/libtool/compile
>  $(curdir)/qemu/compile := $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile
>  $(curdir)/upslug2/compile := $(curdir)/libtool/compile
> diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile
> index 7b4a91a73d..1527d10579 100644
> --- a/tools/mtd-utils/Makefile
> +++ b/tools/mtd-utils/Makefile
> @@ -7,44 +7,30 @@
>  include $(TOPDIR)/rules.mk
>  
>  PKG_NAME:=mtd-utils
> -PKG_VERSION:=1.5.2
> +PKG_VERSION:=2.0.2
>  
> -PKG_SOURCE_VERSION:=aea36417067dade75192bafa03af70b6eb2677b1
> -PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git
> -PKG_SOURCE_PROTO:=git
> -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_FIXUP:=autoreconf
>  
>  include $(INCLUDE_DIR)/host-build.mk
>  
> -HOST_CFLAGS += -I$(STAGING_DIR_HOST)/include/e2fsprogs
> -CFLAGS := $(HOST_CFLAGS) -I$(HOST_BUILD_DIR)/include -L$(HOST_BUILD_DIR) 
> -L$(STAGING_DIR_HOST)/lib -DNO_NATIVE_SUPPORT
> -ifneq ($(HOST_OS),Linux)
> -CFLAGS += -Dloff_t=off_t -D__BYTE_ORDER=BYTE_ORDER -include endian.h 
> -I$(CURDIR)/include -include fls.h
This patch was dropping a lot of important compat stuff for non-linux
systems. I've added back the important bits in r6796-56ae9f9b0b so that
it builds on macOS again.

- Felix

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH v2 3/5] tools/mtd-utils: update to version 2.0.2

2018-04-21 Thread Koen Vandeputte

Tested-by: Koen Vandeputte 


Tested on imx6, also using the imagebuilder afterwards.



___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2 3/5] tools/mtd-utils: update to version 2.0.2

2018-04-19 Thread Hauke Mehrtens
This version now uses autotools to configure the build system. They are
also using the newly added zlib package.

Signed-off-by: Hauke Mehrtens 
---

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

 tools/Makefile |   2 +-
 tools/mtd-utils/Makefile   |  46 +++-
 tools/mtd-utils/patches/100-sscanf_fix.patch   |   6 +-
 tools/mtd-utils/patches/110-portability.patch  |  51 +
 .../mtd-utils/patches/120-include_sysmacros.patch  |  25 -
 tools/mtd-utils/patches/130-lzma_jffs2.patch   |  65 +--
 .../patches/135-mkubifs_optional_lzo.patch | 119 -
 ...igen-add-ubigen_write_terminator-function.patch |   8 +-
 .../201-ubinize-add-terminator-support.patch   |  23 ++--
 .../patches/310-add-static-linking-option.patch|  43 
 .../patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch |  16 +--
 11 files changed, 101 insertions(+), 303 deletions(-)
 delete mode 100644 tools/mtd-utils/patches/120-include_sysmacros.patch
 delete mode 100644 tools/mtd-utils/patches/135-mkubifs_optional_lzo.patch
 delete mode 100644 tools/mtd-utils/patches/310-add-static-linking-option.patch

diff --git a/tools/Makefile b/tools/Makefile
index 8dfab9892b..d2b5daf18c 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -50,7 +50,7 @@ $(curdir)/automake/compile := $(curdir)/m4/compile 
$(curdir)/autoconf/compile $(
 $(curdir)/gmp/compile := $(curdir)/libtool/compile
 $(curdir)/mpc/compile := $(curdir)/mpfr/compile $(curdir)/gmp/compile
 $(curdir)/mpfr/compile := $(curdir)/gmp/compile
-$(curdir)/mtd-utils/compile := $(curdir)/e2fsprogs/compile 
$(curdir)/zlib/compile
+$(curdir)/mtd-utils/compile := $(curdir)/libtool/compile 
$(curdir)/e2fsprogs/compile $(curdir)/zlib/compile
 $(curdir)/mklibs/compile := $(curdir)/libtool/compile
 $(curdir)/qemu/compile := $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile
 $(curdir)/upslug2/compile := $(curdir)/libtool/compile
diff --git a/tools/mtd-utils/Makefile b/tools/mtd-utils/Makefile
index 7b4a91a73d..1527d10579 100644
--- a/tools/mtd-utils/Makefile
+++ b/tools/mtd-utils/Makefile
@@ -7,44 +7,30 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mtd-utils
-PKG_VERSION:=1.5.2
+PKG_VERSION:=2.0.2
 
-PKG_SOURCE_VERSION:=aea36417067dade75192bafa03af70b6eb2677b1
-PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git
-PKG_SOURCE_PROTO:=git
-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_FIXUP:=autoreconf
 
 include $(INCLUDE_DIR)/host-build.mk
 
-HOST_CFLAGS += -I$(STAGING_DIR_HOST)/include/e2fsprogs
-CFLAGS := $(HOST_CFLAGS) -I$(HOST_BUILD_DIR)/include -L$(HOST_BUILD_DIR) 
-L$(STAGING_DIR_HOST)/lib -DNO_NATIVE_SUPPORT
-ifneq ($(HOST_OS),Linux)
-CFLAGS += -Dloff_t=off_t -D__BYTE_ORDER=BYTE_ORDER -include endian.h 
-I$(CURDIR)/include -include fls.h
-MTD_STATIC := 0
-else
-MTD_STATIC := 1
-endif
-
-MTD_MAKEOPTS = \
-   CFLAGS="$(CFLAGS)" \
-   LDFLAGS="$(HOST_LDFLAGS)" \
-   WITHOUT_LZO=1 WITHOUT_XATTR=1 \
-   SUBDIRS="" \
-   BUILDDIR="$(HOST_BUILD_DIR)" \
-   STATIC=$(MTD_STATIC) \
-   V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1)
-
-define Host/Compile
-   $(MAKE) -C $(HOST_BUILD_DIR) \
-   $(MTD_MAKEOPTS) \
-   TARGETS="mkfs.jffs2 ubi-utils/ubinize mkfs.ubifs/mkfs.ubifs"
-endef
+
+HOST_CONFIGURE_VARS+= \
+   UUID_CFLAGS="-I$(STAGING_DIR_HOST)/include/e2fsprogs/uuid"
+
+HOST_CONFIGURE_ARGS+= \
+   --disable-tests \
+   --without-xattr \
+   --without-lzo
 
 define Host/Install
$(CP) \
$(HOST_BUILD_DIR)/mkfs.jffs2 \
-   $(HOST_BUILD_DIR)/mkfs.ubifs/mkfs.ubifs \
-   $(HOST_BUILD_DIR)/ubi-utils/ubinize \
+   $(HOST_BUILD_DIR)/mkfs.ubifs \
+   $(HOST_BUILD_DIR)/ubinize \
$(STAGING_DIR_HOST)/bin/
 endef
 
diff --git a/tools/mtd-utils/patches/100-sscanf_fix.patch 
b/tools/mtd-utils/patches/100-sscanf_fix.patch
index 0af583f4cb..ae6f86722b 100644
--- a/tools/mtd-utils/patches/100-sscanf_fix.patch
+++ b/tools/mtd-utils/patches/100-sscanf_fix.patch
@@ -1,6 +1,6 @@
 a/mkfs.jffs2.c
-+++ b/mkfs.jffs2.c
-@@ -422,7 +422,7 @@ static int interpret_table_entry(struct
+--- a/jffsX-utils/mkfs.jffs2.c
 b/jffsX-utils/mkfs.jffs2.c
+@@ -427,7 +427,7 @@ static int interpret_table_entry(struct
  
if (sscanf (line, "%" SCANF_PREFIX "s %c %lo %lu %lu %lu %lu %lu %lu 
%lu",
SCANF_STRING(name), &type, &mode, &uid, &gid, 
&major, &minor,
diff --git a/tools/mtd-utils/patches/110-portability.patch 
b/tools/mtd-utils/patches/110-portability.patch
index c4cdab928a..a2942270d7 100644
--- a/tools/mtd-utils/patches/110-portability.patch
+++ b/tools/mtd-utils/patches/110-portabil