From patchwork Sun Apr 15 22:53:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 898325 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hauke-m.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AG0c42gG"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40PRfL54prz9s06 for ; Mon, 16 Apr 2018 08:54:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id: Date:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=o3983p+r5ReW92+9yjsbc/GhdOT/m+XnSeASJmskdRA=; b=AG0c42gGJYAt6I OpvFNuH0kUDs/yDpKsyReHxmObpHHq2JjkC7u3YSThPz0aP7QkmEX18yXPWF872Qc+wuIJtrigULl 7Jtxh3/GA7Mnm2PnngQqy++DJf78neOfKZ73bTmhmMlKg1ZAMIM0oF0/bwlBhN818fKgyO6ZHE0Hr dTH9mtILLR73CRFKXx8tNPpnGR4hZGzOHifZapyyhUG1YcSXcgDDmG3LotxxMwRYg7ZY4qEk6g9Hx 42VE6V4Xgsl5yYOlh31ewBHrEtFIw1NGbaiE5ouY7cOD/vL7oa8cT4KWHoIHG2WTpkDVbWcVlHfhf jiAfZmaN9uSF6Uc61ufg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7qXU-0000tv-Sf; Sun, 15 Apr 2018 22:54:28 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7qWx-0000ge-Hn for lede-dev@lists.infradead.org; Sun, 15 Apr 2018 22:53:58 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 72A5440FBB; Mon, 16 Apr 2018 00:53:36 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id ngTKvOKzxVlZ; Mon, 16 Apr 2018 00:53:34 +0200 (CEST) From: Hauke Mehrtens To: lede-dev@lists.infradead.org Date: Mon, 16 Apr 2018 00:53:21 +0200 Message-Id: <20180415225325.15797-1-hauke@hauke-m.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180415_155355_912798_C8F6F2B0 X-CRM114-Status: GOOD ( 17.93 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [80.241.60.215 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record Subject: [LEDE-DEV] [PATCH 1/5] tools/zlib: move zlib build to tools X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hauke@hauke-m.de, wong.syrone@gmail.com, koen.vandeputte@ncentric.com MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This allows us to link the other tools against our libz and we do not need the system zlib any more. Only the static linked library is copied to the staging directory so we have a statically linked library on all systems and not only on Linux. This also adds the new dependencies of the packages which are depending on zlib. Signed-off-by: Hauke Mehrtens --- include/prereq-build.mk | 5 ---- package/libs/zlib/Makefile | 2 -- tools/Makefile | 14 +++++---- tools/lzma-old/Makefile | 2 ++ tools/lzma-old/patches/120-add-cflags.patch | 11 +++++++ tools/make-ext4fs/Makefile | 8 +---- tools/make-ext4fs/patches/100-add-ldflags.patch | 11 +++++++ tools/squashfs4/Makefile | 2 +- tools/zlib/Makefile | 40 +++++++++++++++++++++++++ 9 files changed, 75 insertions(+), 20 deletions(-) create mode 100644 tools/lzma-old/patches/120-add-cflags.patch create mode 100644 tools/make-ext4fs/patches/100-add-ldflags.patch create mode 100644 tools/zlib/Makefile diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 6917716342..5b9a7e049d 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -76,11 +76,6 @@ else zlib_link_flags := -lz endif -$(eval $(call TestHostCommand,zlib, \ - Please install a static zlib. (Missing libz.a or zlib.h), \ - echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \ - gcc -include zlib.h -x c -o $(TMP_DIR)/a.out - $(zlib_link_flags))) - $(eval $(call TestHostCommand,perl-thread-queue, \ Please install the Perl Thread::Queue module, \ perl -MThread::Queue -e 1)) diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile index a7c61f7dd0..4a2a0e53b0 100644 --- a/package/libs/zlib/Makefile +++ b/package/libs/zlib/Makefile @@ -21,7 +21,6 @@ PKG_CPE_ID:=cpe:/a:gnu:zlib PKG_CONFIG_DEPENDS:= CONFIG_ZLIB_OPTIMIZE_SPEED -include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -95,6 +94,5 @@ define Package/zlib-dev/install $(1)/usr/lib/pkgconfig/ endef -$(eval $(call HostBuild)) $(eval $(call BuildPackage,zlib)) $(eval $(call BuildPackage,zlib-dev)) diff --git a/tools/Makefile b/tools/Makefile index 50bd552d75..8dfab9892b 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -22,7 +22,7 @@ ifneq ($(CONFIG_SDK)$(CONFIG_PACKAGE_kmod-b43)$(CONFIG_PACKAGE_b43legacy-firmwar endif tools-$(BUILD_TOOLCHAIN) += gmp mpfr mpc libelf expat -tools-y += m4 libtool autoconf automake flex bison pkg-config mklibs +tools-y += m4 libtool autoconf automake flex bison pkg-config mklibs zlib tools-y += sstrip make-ext4fs e2fsprogs mtd-utils mkimage tools-y += firmware-utils patch-image quilt padjffs2 tools-y += mm-macros missing-macros cmake scons bc findutils gengetopt patchelf @@ -43,16 +43,16 @@ $(curdir)/bison/compile := $(curdir)/flex/compile $(curdir)/flex/compile := $(curdir)/libtool/compile $(curdir)/libtool/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/missing-macros/compile $(curdir)/squashfs/compile := $(curdir)/lzma-old/compile -$(curdir)/squashfs4/compile := $(curdir)/xz/compile +$(curdir)/squashfs4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile $(curdir)/autoconf/compile := $(curdir)/m4/compile $(curdir)/automake/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/pkg-config/compile $(curdir)/xz/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)/mtd-utils/compile := $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile $(curdir)/mklibs/compile := $(curdir)/libtool/compile -$(curdir)/qemu/compile := $(curdir)/e2fsprogs/compile +$(curdir)/qemu/compile := $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile $(curdir)/upslug2/compile := $(curdir)/libtool/compile $(curdir)/mm-macros/compile := $(curdir)/libtool/compile $(curdir)/missing-macros/compile := $(curdir)/autoconf/compile @@ -69,8 +69,12 @@ $(curdir)/patchelf/compile := $(curdir)/libtool/compile $(curdir)/dosfstools/compile := $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/libressl/compile := $(curdir)/pkg-config/compile $(curdir)/mkimage/compile += $(curdir)/libressl/compile -$(curdir)/firmware-utils/compile += $(curdir)/libressl/compile +$(curdir)/firmware-utils/compile += $(curdir)/libressl/compile $(curdir)/zlib/compile $(curdir)/cmake/compile += $(curdir)/libressl/compile +$(curdir)/zlib/compile := $(curdir)/cmake/compile +$(curdir)/wrt350nv2-builder/compile := $(curdir)/zlib/compile +$(curdir)/lzma-old/compile := $(curdir)/zlib/compile +$(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile ifneq ($(HOST_OS),Linux) tools-y += coreutils diff --git a/tools/lzma-old/Makefile b/tools/lzma-old/Makefile index 5982eab5db..5204127a80 100644 --- a/tools/lzma-old/Makefile +++ b/tools/lzma-old/Makefile @@ -21,7 +21,9 @@ LIB_DIR=$(HOST_BUILD_DIR)/C/7zip/Compress/LZMA_Lib ALONE_DIR=$(HOST_BUILD_DIR)/C/7zip/Compress/LZMA_Alone define Host/Compile + +$(HOST_MAKE_VARS) \ $(MAKE) -C $(LIB_DIR) + +$(HOST_MAKE_VARS) \ $(MAKE) -f makefile.gcc -C $(ALONE_DIR) endef diff --git a/tools/lzma-old/patches/120-add-cflags.patch b/tools/lzma-old/patches/120-add-cflags.patch new file mode 100644 index 0000000000..9022e7cd27 --- /dev/null +++ b/tools/lzma-old/patches/120-add-cflags.patch @@ -0,0 +1,11 @@ +--- a/C/7zip/Compress/LZMA_Lib/makefile ++++ b/C/7zip/Compress/LZMA_Lib/makefile +@@ -2,7 +2,7 @@ PROG = liblzma.a + CXX = g++ -O3 -Wall + AR = ar + RM = rm -f +-CFLAGS = -c -I ../../../ ++CFLAGS += -c -I ../../../ + + OBJS = \ + ZLib.o \ diff --git a/tools/make-ext4fs/Makefile b/tools/make-ext4fs/Makefile index f140101c8e..97f9e6369c 100644 --- a/tools/make-ext4fs/Makefile +++ b/tools/make-ext4fs/Makefile @@ -17,13 +17,7 @@ PKG_MIRROR_HASH:=d7ccd5e426b1d15331ff000a37dc15161f6eef594453e970fd584fcde5a2507 include $(INCLUDE_DIR)/host-build.mk -ifeq ($(HOST_OS),Linux) - MAKE_STATIC := STATIC=1 -endif - -define Host/Compile - $(MAKE) -C $(HOST_BUILD_DIR) make_ext4fs $(MAKE_STATIC) -endef +HOST_MAKE_FLAGS += STATIC=1 define Host/Install $(INSTALL_BIN) $(HOST_BUILD_DIR)/make_ext4fs $(STAGING_DIR_HOST)/bin/ diff --git a/tools/make-ext4fs/patches/100-add-ldflags.patch b/tools/make-ext4fs/patches/100-add-ldflags.patch new file mode 100644 index 0000000000..d9ce47bb80 --- /dev/null +++ b/tools/make-ext4fs/patches/100-add-ldflags.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -27,7 +27,7 @@ OBJ := \ + $(CC) $(CFLAGS) -c -o $@ $^ + + make_ext4fs: $(OBJ) libsparse/libsparse.a +- $(CC) -o $@ $^ $(ZLIB) ++ $(CC) $(LDFLAGS)-o $@ $^ $(ZLIB) + + libsparse/libsparse.a: + $(MAKE) -C libsparse/ libsparse.a diff --git a/tools/squashfs4/Makefile b/tools/squashfs4/Makefile index e9e2b7ca9a..409b1b5a23 100644 --- a/tools/squashfs4/Makefile +++ b/tools/squashfs4/Makefile @@ -20,8 +20,8 @@ HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/squashfs$(PKG_VERSION) include $(INCLUDE_DIR)/host-build.mk define Host/Compile + +$(HOST_MAKE_VARS) \ $(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \ - CC="$(HOSTCC)" \ XZ_SUPPORT=1 \ LZMA_XZ_SUPPORT=1 \ XATTR_SUPPORT= \ diff --git a/tools/zlib/Makefile b/tools/zlib/Makefile new file mode 100644 index 0000000000..2746d95b72 --- /dev/null +++ b/tools/zlib/Makefile @@ -0,0 +1,40 @@ +# +# Copyright (C) 2006-2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=zlib +PKG_VERSION:=1.2.11 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net +PKG_HASH:=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066 + +PKG_LICENSE:=Zlib +PKG_LICENSE_FILES:=README +PKG_CPE_ID:=cpe:/a:gnu:zlib + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/cmake.mk + + +define Host/Install + $(CP) $(HOST_BUILD_DIR)/libz.a $(STAGING_DIR_HOST)/lib/ + $(CP) $(HOST_BUILD_DIR)/zconf.h $(STAGING_DIR_HOST)/include/ + $(CP) $(HOST_BUILD_DIR)/zlib.h $(STAGING_DIR_HOST)/include/ + $(CP) $(HOST_BUILD_DIR)/zlib.pc $(STAGING_DIR_HOST)/lib/pkgconfig/ +endef + +define Host/Clean + rm -f $(STAGING_DIR_HOST)/lib/libz.a + rm -f $(STAGING_DIR_HOST)/include/zconf.h + rm -f $(STAGING_DIR_HOST)/include/zlib.h + rm -f $(STAGING_DIR_HOST)/lib/pkgconfig//zlib.pc +endef + +$(eval $(call HostBuild)) From patchwork Sun Apr 15 22:53:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 898329 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hauke-m.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sz6CNj6l"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40PRg76hRWz9s1R for ; Mon, 16 Apr 2018 08:55:15 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CHuLJZsEQEdmmP5MLvuJBknAFVwryU9+kowLP430ZOU=; b=sz6CNj6lTeg/mI 472AA5PLKAWp+1j8PFQAi2W69GOSIVjsmJ9m48ArLUwdGrerKhVzCr+10CPAhQsFvqLFqwBdpSXmM hS3dJRSIcGtPLSCcHr5WapU+49t3N6CiXwzMFlesy3nwBuoljyoh9Ia6dYmENl37NzarYgyTMojHd jkeOQGejVC7Te+V2YAEDKYeh5pZq5X8k3vigIaTJ774EFSfJshyA3q8rajI8uxdMHDLuYiZyeO3Eb mUDVGTn/0MUw3jiFOGnbDquuiNMC1ElPS0k8kI7LGYjMRTmD3DYWSKPgC2ms/buLxgFH87O9Uisre xCf84W3zQZjBOUzD/9qQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7qY9-00024c-HP; Sun, 15 Apr 2018 22:55:09 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7qWx-0000he-SI for lede-dev@lists.infradead.org; Sun, 15 Apr 2018 22:54:00 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 5048442C15; Mon, 16 Apr 2018 00:53:48 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id NftcKZpjsyUl; Mon, 16 Apr 2018 00:53:36 +0200 (CEST) From: Hauke Mehrtens To: lede-dev@lists.infradead.org Date: Mon, 16 Apr 2018 00:53:22 +0200 Message-Id: <20180415225325.15797-2-hauke@hauke-m.de> In-Reply-To: <20180415225325.15797-1-hauke@hauke-m.de> References: <20180415225325.15797-1-hauke@hauke-m.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180415_155356_396765_7E98F8A0 X-CRM114-Status: GOOD ( 20.16 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [80.241.60.212 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record Subject: [LEDE-DEV] [PATCH 2/5] tools/mtd-utils: Mark some lzma functions as static X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hauke@hauke-m.de, wong.syrone@gmail.com, koen.vandeputte@ncentric.com MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org These functions are not declared in any header file and only used in same compile unit, mark them as static to remove one gcc warning and make it easier for the compiler to optimize them out. This also fixes some style problems to make this patch match the version in the packages folder. This is copied from this commit to the mtd-utils we pack into the image: 56d0dd56e9c6efa79 ("mtd-utils: Mark some lzma functions as static") Signed-off-by: Hauke Mehrtens --- tools/mtd-utils/patches/130-lzma_jffs2.patch | 74 ++++++++++++++-------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/tools/mtd-utils/patches/130-lzma_jffs2.patch b/tools/mtd-utils/patches/130-lzma_jffs2.patch index b04f019922..05ced4f42c 100644 --- a/tools/mtd-utils/patches/130-lzma_jffs2.patch +++ b/tools/mtd-utils/patches/130-lzma_jffs2.patch @@ -26,7 +26,7 @@ jffs2_lzo_init(); #endif +#ifdef CONFIG_JFFS2_LZMA -+ jffs2_lzma_init(); ++ jffs2_lzma_init(); +#endif return 0; } @@ -36,7 +36,7 @@ jffs2_lzo_exit(); #endif +#ifdef CONFIG_JFFS2_LZMA -+ jffs2_lzma_exit(); ++ jffs2_lzma_exit(); +#endif return 0; } @@ -119,7 +119,7 @@ + return -1; + } + -+ return 0; ++ return 0; +} + +STATIC int jffs2_lzma_compress(unsigned char *data_in, unsigned char *cpage_out, @@ -175,26 +175,26 @@ + +int INIT jffs2_lzma_init(void) +{ -+ int ret; ++ int ret; + CLzmaEncProps props; + LzmaEncProps_Init(&props); + -+ props.dictSize = LZMA_BEST_DICT(0x2000); -+ props.level = LZMA_BEST_LEVEL; -+ props.lc = LZMA_BEST_LC; -+ props.lp = LZMA_BEST_LP; -+ props.pb = LZMA_BEST_PB; -+ props.fb = LZMA_BEST_FB; ++ props.dictSize = LZMA_BEST_DICT(0x2000); ++ props.level = LZMA_BEST_LEVEL; ++ props.lc = LZMA_BEST_LC; ++ props.lp = LZMA_BEST_LP; ++ props.pb = LZMA_BEST_PB; ++ props.fb = LZMA_BEST_FB; + + ret = lzma_alloc_workspace(&props); -+ if (ret < 0) -+ return ret; ++ if (ret < 0) ++ return ret; + + ret = jffs2_register_compressor(&jffs2_lzma_comp); + if (ret) + lzma_free_workspace(); + -+ return ret; ++ return ret; +} + +void jffs2_lzma_exit(void) @@ -245,7 +245,7 @@ + #define LZMA_FREE free + #define PRINT_ERROR(msg) fprintf(stderr, msg) + #define INIT -+ #define STATIC ++ #define STATIC static +#endif + +#include "lzma/LzmaDec.h" @@ -261,16 +261,16 @@ + +static void *p_lzma_malloc(void *p, size_t size) +{ -+ if (size == 0) -+ return NULL; ++ if (size == 0) ++ return NULL; + -+ return LZMA_MALLOC(size); ++ return LZMA_MALLOC(size); +} + +static void p_lzma_free(void *p, void *address) +{ -+ if (address != NULL) -+ LZMA_FREE(address); ++ if (address != NULL) ++ LZMA_FREE(address); +} + +static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free}; @@ -949,9 +949,9 @@ +} + +Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } -+Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } ++static Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } + -+UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } ++static UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } + +void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) +{ @@ -2357,7 +2357,7 @@ + p->needFlush = 0; +} + -+void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) ++static void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) +{ + p->needFlush = 1; + p->remainLen = 0; @@ -2777,7 +2777,7 @@ +#define kNumLogBits (9 + (int)sizeof(size_t) / 2) +#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) + -+void LzmaEnc_FastPosInit(Byte *g_FastPos) ++static void LzmaEnc_FastPosInit(Byte *g_FastPos) +{ + int c = 2, slotFast; + g_FastPos[0] = 0; @@ -3031,7 +3031,7 @@ + CSaveState saveState; +} CLzmaEnc; + -+void LzmaEnc_SaveState(CLzmaEncHandle pp) ++static void LzmaEnc_SaveState(CLzmaEncHandle pp) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + CSaveState *dest = &p->saveState; @@ -3057,7 +3057,7 @@ + memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); +} + -+void LzmaEnc_RestoreState(CLzmaEncHandle pp) ++static void LzmaEnc_RestoreState(CLzmaEncHandle pp) +{ + CLzmaEnc *dest = (CLzmaEnc *)pp; + const CSaveState *p = &dest->saveState; @@ -3300,7 +3300,7 @@ + while (symbol < 0x10000); +} + -+void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) ++static void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) +{ + UInt32 i; + for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) @@ -4426,7 +4426,7 @@ + p->matchPriceCount = 0; +} + -+void LzmaEnc_Construct(CLzmaEnc *p) ++static void LzmaEnc_Construct(CLzmaEnc *p) +{ + RangeEnc_Construct(&p->rc); + MatchFinder_Construct(&p->matchFinderBase); @@ -4459,7 +4459,7 @@ + return p; +} + -+void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) ++static void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->litProbs); + alloc->Free(alloc, p->saveState.litProbs); @@ -4467,7 +4467,7 @@ + p->saveState.litProbs = 0; +} + -+void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) ++static void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + #ifdef COMPRESS_MF_MT + MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); @@ -4698,7 +4698,7 @@ + return SZ_OK; +} + -+void LzmaEnc_Init(CLzmaEnc *p) ++static void LzmaEnc_Init(CLzmaEnc *p) +{ + UInt32 i; + p->state = 0; @@ -4757,7 +4757,7 @@ + p->lpMask = (1 << p->lp) - 1; +} + -+void LzmaEnc_InitPrices(CLzmaEnc *p) ++static void LzmaEnc_InitPrices(CLzmaEnc *p) +{ + if (!p->fastMode) + { @@ -4798,7 +4798,7 @@ + return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); +} + -+SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, ++static SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, + ISeqInStream *inStream, UInt32 keepWindowSize, + ISzAlloc *alloc, ISzAlloc *allocBig) +{ @@ -4814,7 +4814,7 @@ + p->seqBufInStream.rem = srcLen; +} + -+SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, ++static SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, + UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; @@ -4823,7 +4823,7 @@ + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +} + -+void LzmaEnc_Finish(CLzmaEncHandle pp) ++static void LzmaEnc_Finish(CLzmaEncHandle pp) +{ + #ifdef COMPRESS_MF_MT + CLzmaEnc *p = (CLzmaEnc *)pp; @@ -4855,19 +4855,19 @@ +} + + -+UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) ++static UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) +{ + const CLzmaEnc *p = (CLzmaEnc *)pp; + return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); +} + -+const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) ++static const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) +{ + const CLzmaEnc *p = (CLzmaEnc *)pp; + return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; +} + -+SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, ++static SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, + Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; From patchwork Sun Apr 15 22:53:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 898331 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hauke-m.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Qtuo2fp2"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40PRgY0fPtz9s1R for ; Mon, 16 Apr 2018 08:55:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=k8EE4uqHaqYcTvdeBZXAKaeYEI5Zwb3kDWU7R7vVYV0=; b=Qtuo2fp2kAA/h7 pGgJawQJY8jWWW4pM+DhyHEyjYj7gUc4jC3MDnffhlp0bVhjzXHNke6HbKzw0HHzhmWeSTU018McB PSaztJtU/LCBtJ/lU2zU4PdH8AoHmTZRMHGRgFiNkbXgPNsWuHOFmdpbO/tZ3hynFojTUc7NYNnCK UHtznPYtX/0y/wgcw3oss6trM1ZU1yJZpZA8BmWJjIKPk6fqFrsRZeOyBRvz7X8roRUN2i5EeELcj Pqodtvb1qB8fXPvBwKDdrEV6v5dQ0iugB1rtEBiH7VmonvuVvGuihp4nJZlnZ6xnsqh+pfDBrDNTa MX1BeI2+E1+ey/tZV4pg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7qYS-0002xT-OU; Sun, 15 Apr 2018 22:55:28 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7qWy-0000hh-BO for lede-dev@lists.infradead.org; Sun, 15 Apr 2018 22:54:01 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 60C4142C47; Mon, 16 Apr 2018 00:53:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id jE0cdzDQJ7pi; Mon, 16 Apr 2018 00:53:37 +0200 (CEST) From: Hauke Mehrtens To: lede-dev@lists.infradead.org Date: Mon, 16 Apr 2018 00:53:23 +0200 Message-Id: <20180415225325.15797-3-hauke@hauke-m.de> In-Reply-To: <20180415225325.15797-1-hauke@hauke-m.de> References: <20180415225325.15797-1-hauke@hauke-m.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180415_155356_723910_C24F8E21 X-CRM114-Status: GOOD ( 24.88 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [80.241.60.212 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record Subject: [LEDE-DEV] [PATCH 3/5] tools/mtd-utils: update to version 2.0.1 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hauke@hauke-m.de, wong.syrone@gmail.com, koen.vandeputte@ncentric.com MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This version now uses autotools to configure the build system. They are also using the newly added zlib package. Signed-off-by: Hauke Mehrtens --- tools/Makefile | 2 +- tools/mtd-utils/Makefile | 42 +++----- tools/mtd-utils/patches/100-sscanf_fix.patch | 6 +- tools/mtd-utils/patches/110-portability.patch | 45 ++++---- .../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, 95 insertions(+), 299 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..c94de3acf8 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.1 -PKG_SOURCE_VERSION:=aea36417067dade75192bafa03af70b6eb2677b1 +PKG_SOURCE_VERSION:=81049e599775bac4238361752f659a86f67328e6 PKG_SOURCE_URL:=git://git.infradead.org/mtd-utils.git PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=e11b342b85a36b2e438a8412ec52f87621d3046aec1a93039f8c72de9990b2a7 +PKG_MIRROR_HASH:=a79784eb52c77dbc73a08863ce6651b3d22931e7c670cd1782168f9bba13f5a8 +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..033c865830 100644 --- a/tools/mtd-utils/patches/110-portability.patch +++ b/tools/mtd-utils/patches/110-portability.patch @@ -1,5 +1,5 @@ ---- a/compr_lzo.c -+++ b/compr_lzo.c +--- a/jffsX-utils/compr_lzo.c ++++ b/jffsX-utils/compr_lzo.c @@ -26,7 +26,6 @@ #include @@ -8,8 +8,8 @@ #include #include #include "compr.h" ---- a/compr_zlib.c -+++ b/compr_zlib.c +--- a/jffsX-utils/compr_zlib.c ++++ b/jffsX-utils/compr_zlib.c @@ -39,7 +39,6 @@ #include #undef crc32 @@ -18,8 +18,8 @@ #include #include "common.h" #include "compr.h" ---- a/rbtree.h -+++ b/rbtree.h +--- a/jffsX-utils/rbtree.h ++++ b/jffsX-utils/rbtree.h @@ -94,8 +94,7 @@ static inline struct page * rb_insert_pa #ifndef _LINUX_RBTREE_H #define _LINUX_RBTREE_H @@ -48,8 +48,8 @@ /* The version of UBI images supported by this implementation */ #define UBI_VERSION 1 ---- a/mkfs.ubifs/mkfs.ubifs.h -+++ b/mkfs.ubifs/mkfs.ubifs.h +--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.h ++++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.h @@ -32,7 +32,17 @@ #include #include @@ -68,9 +68,9 @@ #include #include ---- a/mkfs.ubifs/mkfs.ubifs.c -+++ b/mkfs.ubifs/mkfs.ubifs.c -@@ -1010,6 +1010,7 @@ static int add_inode_with_data(struct st +--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c ++++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c +@@ -1219,6 +1219,7 @@ static int add_inode(struct stat *st, in if (c->default_compr != UBIFS_COMPR_NONE) use_flags |= UBIFS_COMPR_FL; @@ -78,7 +78,7 @@ if (flags & FS_COMPR_FL) use_flags |= UBIFS_COMPR_FL; if (flags & FS_SYNC_FL) -@@ -1020,6 +1021,7 @@ static int add_inode_with_data(struct st +@@ -1229,6 +1230,7 @@ static int add_inode(struct stat *st, in use_flags |= UBIFS_APPEND_FL; if (flags & FS_DIRSYNC_FL && S_ISDIR(st->st_mode)) use_flags |= UBIFS_DIRSYNC_FL; @@ -86,7 +86,7 @@ memset(ino, 0, UBIFS_INO_NODE_SZ); -@@ -1089,7 +1091,9 @@ static int add_dir_inode(DIR *dir, ino_t +@@ -1293,7 +1295,9 @@ static int add_dir_inode(const char *pat fd = dirfd(dir); if (fd == -1) return sys_err_msg("dirfd failed"); @@ -96,20 +96,23 @@ flags = 0; } -@@ -1274,10 +1278,12 @@ static int add_file(const char *path_nam +@@ -1476,6 +1480,7 @@ static int add_file(const char *path_nam key_write(&key, &dn->key); dn->size = cpu_to_le32(bytes_read); out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ; +#ifndef NO_NATIVE_SUPPORT if (c->default_compr == UBIFS_COMPR_NONE && (flags & FS_COMPR_FL)) + #ifdef WITHOUT_LZO +@@ -1484,6 +1489,7 @@ static int add_file(const char *path_nam use_compr = UBIFS_COMPR_LZO; + #endif else +#endif use_compr = c->default_compr; compr_type = compress_data(buf, bytes_read, &dn->data, &out_len, use_compr); -@@ -1319,7 +1325,9 @@ static int add_non_dir(const char *path_ +@@ -1527,7 +1533,9 @@ static int add_non_dir(const char *path_ if (fd == -1) return sys_err_msg("failed to open file '%s'", path_name); @@ -119,9 +122,9 @@ flags = 0; if (close(fd) == -1) return sys_err_msg("failed to close file '%s'", ---- a/mkfs.ubifs/devtable.c -+++ b/mkfs.ubifs/devtable.c -@@ -134,6 +134,7 @@ static int interpret_table_entry(const c +--- a/ubifs-utils/mkfs.ubifs/devtable.c ++++ b/ubifs-utils/mkfs.ubifs/devtable.c +@@ -135,6 +135,7 @@ static int interpret_table_entry(const c unsigned int mode = 0755, uid = 0, gid = 0, major = 0, minor = 0; unsigned int start = 0, increment = 0, count = 0; @@ -129,7 +132,7 @@ if (sscanf(line, "%1023s %c %o %u %u %u %u %u %u %u", buf, &type, &mode, &uid, &gid, &major, &minor, &start, &increment, &count) < 0) -@@ -144,8 +145,8 @@ static int interpret_table_entry(const c +@@ -145,8 +146,8 @@ static int interpret_table_entry(const c buf, type, mode, uid, gid, major, minor, start, increment, count); @@ -148,8 +151,8 @@ #include -#include #include - #include "version.h" - + #include + #include --- a/include/mtd/ubifs-media.h +++ b/include/mtd/ubifs-media.h @@ -33,7 +33,15 @@ diff --git a/tools/mtd-utils/patches/120-include_sysmacros.patch b/tools/mtd-utils/patches/120-include_sysmacros.patch deleted file mode 100644 index 81ba1cfb2b..0000000000 --- a/tools/mtd-utils/patches/120-include_sysmacros.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 9a06f45ec71116d76ee4b268ebe1b33d45b06fc0 Mon Sep 17 00:00:00 2001 -From: Mike Frysinger -Date: Sat, 16 Apr 2016 22:10:43 -0400 -Subject: [PATCH mtd-utils] include sys/sysmacros.h for major/minor/makedev - -These functions have always been defined in sys/sysmacros.h under -Linux C libraries. For some, including sys/types.h implicitly -includes that as well, but glibc wants to deprecate that, and some -others already have. Include the header explicitly for the funcs. - -Signed-off-by: Mike Frysinger ---- - include/common.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/include/common.h -+++ b/include/common.h -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - #include "version.h" - - #ifndef PROGRAM_NAME diff --git a/tools/mtd-utils/patches/130-lzma_jffs2.patch b/tools/mtd-utils/patches/130-lzma_jffs2.patch index 05ced4f42c..d9cbfeebec 100644 --- a/tools/mtd-utils/patches/130-lzma_jffs2.patch +++ b/tools/mtd-utils/patches/130-lzma_jffs2.patch @@ -1,26 +1,29 @@ ---- a/Makefile -+++ b/Makefile -@@ -4,6 +4,7 @@ - VERSION = 1.5.2 +--- 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 - CPPFLAGS += -D_GNU_SOURCE -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) $(UUIDCPPFLAGS) -+CPPFLAGS += -I./include/linux/lzma - - ifeq ($(WITHOUT_XATTR), 1) - CPPFLAGS += -DWITHOUT_XATTR -@@ -84,7 +85,9 @@ $(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(); @@ -40,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 @@ -72,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. @@ -900,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 @@ -1656,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 @@ -2673,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 @@ -5010,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; diff --git a/tools/mtd-utils/patches/135-mkubifs_optional_lzo.patch b/tools/mtd-utils/patches/135-mkubifs_optional_lzo.patch deleted file mode 100644 index 90d4ef4c36..0000000000 --- a/tools/mtd-utils/patches/135-mkubifs_optional_lzo.patch +++ /dev/null @@ -1,119 +0,0 @@ ---- a/mkfs.ubifs/compr.c -+++ b/mkfs.ubifs/compr.c -@@ -24,7 +24,6 @@ - #include - #include - #include --#include - #include - - #define crc32 __zlib_crc32 -@@ -34,7 +33,6 @@ - #include "compr.h" - #include "mkfs.ubifs.h" - --static void *lzo_mem; - static unsigned long long errcnt = 0; - static struct ubifs_info *c = &info_; - -@@ -85,6 +83,25 @@ static int zlib_deflate(void *in_buf, si - return 0; - } - -+#ifndef WITHOUT_LZO -+#include -+ -+static void *lzo_mem; -+ -+static int lzo_init(void) -+{ -+ lzo_mem = malloc(LZO1X_999_MEM_COMPRESS); -+ if (!lzo_mem) -+ return -1; -+ -+ return 0; -+} -+ -+static void lzo_fini(void) -+{ -+ free(lzo_mem); -+} -+ - static int lzo_compress(void *in_buf, size_t in_len, void *out_buf, - size_t *out_len) - { -@@ -102,6 +119,12 @@ static int lzo_compress(void *in_buf, si - - return 0; - } -+#else -+static inline int lzo_compress(void *in_buf, size_t in_len, void *out_buf, -+ size_t *out_len) { return -1; } -+static inline int lzo_init(void) { return 0; } -+static inline void lzo_fini(void) { } -+#endif - - static int no_compress(void *in_buf, size_t in_len, void *out_buf, - size_t *out_len) -@@ -122,7 +145,6 @@ static int favor_lzo_compress(void *in_b - lzo_len = zlib_len = *out_len; - lzo_ret = lzo_compress(in_buf, in_len, out_buf, &lzo_len); - zlib_ret = zlib_deflate(in_buf, in_len, zlib_buf, &zlib_len); -- - if (lzo_ret && zlib_ret) - /* Both compressors failed */ - return -1; -@@ -197,23 +219,28 @@ int compress_data(void *in_buf, size_t i - - int init_compression(void) - { -- lzo_mem = malloc(LZO1X_999_MEM_COMPRESS); -- if (!lzo_mem) -- return -1; -+ int ret; -+ -+ ret = lzo_init(); -+ if (ret) -+ goto err; - - zlib_buf = malloc(UBIFS_BLOCK_SIZE * WORST_COMPR_FACTOR); -- if (!zlib_buf) { -- free(lzo_mem); -- return -1; -- } -+ if (!zlib_buf) -+ goto err_lzo; - - return 0; -+ -+err_lzo: -+ lzo_fini(); -+err: -+ return ret; - } - - void destroy_compression(void) - { - free(zlib_buf); -- free(lzo_mem); -+ lzo_fini(); - if (errcnt) - fprintf(stderr, "%llu compression errors occurred\n", errcnt); - } ---- a/Makefile -+++ b/Makefile -@@ -108,7 +108,13 @@ $(call _mkdep,lib/,libmtd.a) - obj-mkfs.ubifs = crc16.o lpt.o compr.o devtable.o \ - hashtable/hashtable.o hashtable/hashtable_itr.o - LDFLAGS_mkfs.ubifs = $(ZLIBLDFLAGS) $(LZOLDFLAGS) $(UUIDLDFLAGS) --LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid -+ifeq ($(WITHOUT_LZO), 1) -+ CPPFLAGS += -DWITHOUT_LZO -+else -+ LZOLDLIBS = -llzo2 -+endif -+ -+LDLIBS_mkfs.ubifs = -lz $(LZOLDLIBS) -lm -luuid - $(call mkdep,mkfs.ubifs/,mkfs.ubifs,,ubi-utils/libubi.a) - - # diff --git a/tools/mtd-utils/patches/200-libubigen-add-ubigen_write_terminator-function.patch b/tools/mtd-utils/patches/200-libubigen-add-ubigen_write_terminator-function.patch index 95ce1e9137..d95ece184c 100644 --- a/tools/mtd-utils/patches/200-libubigen-add-ubigen_write_terminator-function.patch +++ b/tools/mtd-utils/patches/200-libubigen-add-ubigen_write_terminator-function.patch @@ -1,5 +1,5 @@ ---- a/ubi-utils/libubigen.c -+++ b/ubi-utils/libubigen.c +--- a/lib/libubigen.c ++++ b/lib/libubigen.c @@ -122,8 +122,9 @@ int ubigen_add_volume(const struct ubige return 0; } @@ -75,8 +75,8 @@ return 0; out_free: ---- a/ubi-utils/include/libubigen.h -+++ b/ubi-utils/include/libubigen.h +--- a/include/libubigen.h ++++ b/include/libubigen.h @@ -188,6 +188,9 @@ int ubigen_write_layout_vol(const struct long long ec1, long long ec2, struct ubi_vtbl_record *vtbl, int fd); diff --git a/tools/mtd-utils/patches/201-ubinize-add-terminator-support.patch b/tools/mtd-utils/patches/201-ubinize-add-terminator-support.patch index cbb2802c5a..0da28b71f2 100644 --- a/tools/mtd-utils/patches/201-ubinize-add-terminator-support.patch +++ b/tools/mtd-utils/patches/201-ubinize-add-terminator-support.patch @@ -1,6 +1,6 @@ --- a/ubi-utils/ubinize.c +++ b/ubi-utils/ubinize.c -@@ -70,6 +70,8 @@ static const char optionsstr[] = +@@ -60,6 +60,8 @@ static const char optionsstr[] = " (default is 1)\n" "-Q, --image-seq= 32-bit UBI image sequence number to use\n" " (by default a random number is picked)\n" @@ -8,17 +8,8 @@ +" output image\n" "-v, --verbose be verbose\n" "-h, --help print help message\n" - "-V, --version print program version"; -@@ -79,7 +81,7 @@ static const char usage[] = - "\t\t[-x ] [-Q ] [-v] [-h] [-V] [--output=] [--peb-size=]\n" - "\t\t[--min-io-size=] [--sub-page-size=] [--vid-hdr-offset=]\n" - "\t\t[--erase-counter=] [--ubi-ver=] [--image-seq=] [--verbose] [--help]\n" --"\t\t[--version] ini-file\n" -+"\t\t[--eof-markers=] [--version] ini-file\n" - "Example: " PROGRAM_NAME " -o ubi.img -p 16KiB -m 512 -s 256 cfg.ini - create UBI image\n" - " 'ubi.img' as described by configuration file 'cfg.ini'"; - -@@ -125,6 +127,7 @@ static const struct option long_options[ + "-V, --version print program version\n\n"; +@@ -79,6 +81,7 @@ static const struct option long_options[ { .name = "erase-counter", .has_arg = 1, .flag = NULL, .val = 'e' }, { .name = "ubi-ver", .has_arg = 1, .flag = NULL, .val = 'x' }, { .name = "image-seq", .has_arg = 1, .flag = NULL, .val = 'Q' }, @@ -26,7 +17,7 @@ { .name = "verbose", .has_arg = 0, .flag = NULL, .val = 'v' }, { .name = "help", .has_arg = 0, .flag = NULL, .val = 'h' }, { .name = "version", .has_arg = 0, .flag = NULL, .val = 'V' }, -@@ -144,6 +147,7 @@ struct args { +@@ -98,6 +101,7 @@ struct args { uint32_t image_seq; int verbose; dictionary *dict; @@ -34,7 +25,7 @@ }; static struct args args = { -@@ -162,7 +166,7 @@ static int parse_opt(int argc, char * co +@@ -116,7 +120,7 @@ static int parse_opt(int argc, char * co int key, error = 0; unsigned long int image_seq; @@ -43,7 +34,7 @@ if (key == -1) break; -@@ -222,6 +226,12 @@ static int parse_opt(int argc, char * co +@@ -176,6 +180,12 @@ static int parse_opt(int argc, char * co args.image_seq = image_seq; break; @@ -56,7 +47,7 @@ case 'v': args.verbose = 1; break; -@@ -599,6 +609,18 @@ int main(int argc, char * const argv[]) +@@ -559,6 +569,18 @@ int main(int argc, char * const argv[]) printf("\n"); } diff --git a/tools/mtd-utils/patches/310-add-static-linking-option.patch b/tools/mtd-utils/patches/310-add-static-linking-option.patch deleted file mode 100644 index 828d7751e5..0000000000 --- a/tools/mtd-utils/patches/310-add-static-linking-option.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- a/common.mk -+++ b/common.mk -@@ -2,6 +2,16 @@ CC := $(CROSS)gcc - AR := $(CROSS)ar - RANLIB := $(CROSS)ranlib - -+ifeq ($(STATIC),1) -+ define static_link -+ -Wl,-Bstatic $(1) -Wl,-Bdynamic -+ endef -+else -+ define static_link -+ $(1) -+ endef -+endif -+ - # Stolen from Linux build system - comma = , - try-run = $(shell set -e; ($(1)) >/dev/null 2>&1 && echo "$(2)" || echo "$(3)") ---- a/Makefile -+++ b/Makefile -@@ -89,10 +89,10 @@ obj-mkfs.jffs2 = compr_rtime.o compr_zli - 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) -+LDLIBS_mkfs.jffs2 = $(call static_link,-lz $(LZOLDLIBS)) - - LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS) --LDLIBS_jffs2reader = -lz $(LZOLDLIBS) -+LDLIBS_jffs2reader = $(call static_link,-lz $(LZOLDLIBS)) - - $(foreach v,$(MTD_BINS),$(eval $(call mkdep,,$(v)))) - -@@ -114,7 +114,7 @@ else - LZOLDLIBS = -llzo2 - endif - --LDLIBS_mkfs.ubifs = -lz $(LZOLDLIBS) -lm -luuid -+LDLIBS_mkfs.ubifs = $(call static_link,-lz $(LZOLDLIBS)) -lm $(call static_link,-luuid) - $(call mkdep,mkfs.ubifs/,mkfs.ubifs,,ubi-utils/libubi.a) - - # diff --git a/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch b/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch index 70e6a7e360..8e58059576 100644 --- a/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch +++ b/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch @@ -1,6 +1,6 @@ ---- a/mkfs.jffs2.c -+++ b/mkfs.jffs2.c -@@ -108,7 +108,7 @@ static char *rootdir = default_rootdir; +--- a/jffsX-utils/mkfs.jffs2.c ++++ b/jffsX-utils/mkfs.jffs2.c +@@ -109,7 +109,7 @@ static char *rootdir = default_rootdir; static int verbose = 0; static int squash_uids = 0; static int squash_perms = 0; @@ -8,8 +8,8 @@ +static time_t fixed_timestamp = -1; int target_endian = __BYTE_ORDER; - uint32_t find_hardlink(struct filesystem_entry *e) -@@ -249,8 +249,8 @@ static struct filesystem_entry *add_host + static uint32_t find_hardlink(struct filesystem_entry *e) +@@ -250,8 +250,8 @@ static struct filesystem_entry *add_host mode &= ~(S_ISUID | S_ISGID); } } @@ -20,7 +20,7 @@ } entry = xcalloc(1, sizeof(struct filesystem_entry)); -@@ -1554,6 +1554,20 @@ void parse_image(){ +@@ -1557,6 +1557,20 @@ static void parse_image(void){ close(in_fd); } @@ -41,7 +41,7 @@ int main(int argc, char **argv) { int c, opt; -@@ -1572,6 +1586,7 @@ int main(int argc, char **argv) +@@ -1575,6 +1589,7 @@ int main(int argc, char **argv) warn_page_size = 1; /* warn user if page size not 4096 */ jffs2_compressors_init(); @@ -49,7 +49,7 @@ while ((opt = getopt_long(argc, argv, "D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0) -@@ -1622,7 +1637,7 @@ int main(int argc, char **argv) +@@ -1625,7 +1640,7 @@ int main(int argc, char **argv) break; case 'f': From patchwork Sun Apr 15 22:53:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 898323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hauke-m.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ewi8wi/K"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40PRf61XZsz9s06 for ; Mon, 16 Apr 2018 08:54:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3YYzEulrzCIkfEy2XsD4zuAsXGEgtE1qyw0Y9xeVmx8=; b=ewi8wi/Kmo174z U3IYwj01KT7TE7w/eF2923bzqFjsNR2mEOEeVJAGglJixV3RgrnUX6+HCWmLH8Eh+IHHT+5xHOzsE 96zw9Iz65WQ3R0yPls5csOZX2aPF0F+G6Dt5yuD5g1EEvO4bFGhHq3qADLtVZQAQE1Hu3yhNje4Rv Xc7nz7fVSI1FTyzNR3RyRoE0yZ4Z/vs7TXf4OLaHzi7U94Xw9TvrBGs5Yd76V5RFF3/r6PsWWd1TV defSWB866x+Iri5PJrzdO5MxVZSWCpCdqnsuMSoiknn8Aen9zr/c/DJwhLJMyD1KhLE6V0elcsjik 1P0RE9a+VnPZLr+lLUaQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7qXF-0000jS-0V; Sun, 15 Apr 2018 22:54:13 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7qWx-0000gf-F0 for lede-dev@lists.infradead.org; Sun, 15 Apr 2018 22:53:57 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id CDEE84117E; Mon, 16 Apr 2018 00:53:38 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id Tj254Bk63Com; Mon, 16 Apr 2018 00:53:38 +0200 (CEST) From: Hauke Mehrtens To: lede-dev@lists.infradead.org Date: Mon, 16 Apr 2018 00:53:24 +0200 Message-Id: <20180415225325.15797-4-hauke@hauke-m.de> In-Reply-To: <20180415225325.15797-1-hauke@hauke-m.de> References: <20180415225325.15797-1-hauke@hauke-m.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180415_155355_814485_CC6BF832 X-CRM114-Status: GOOD ( 18.16 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [80.241.60.215 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record Subject: [LEDE-DEV] [PATCH 4/5] mtd-utils: update to 2.0.1 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hauke@hauke-m.de, wong.syrone@gmail.com, koen.vandeputte@ncentric.com MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Syrone Wong 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 --- package/utils/mtd-utils/Makefile | 19 ++++--- .../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, 46 insertions(+), 60 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..a9905e4207 100644 --- a/package/utils/mtd-utils/Makefile +++ b/package/utils/mtd-utils/Makefile @@ -8,15 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtd-utils -PKG_VERSION:=1.5.2 +PKG_VERSION:=2.0.1 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_VERSION:=81049e599775bac4238361752f659a86f67328e6 +PKG_MIRROR_HASH:=a79784eb52c77dbc73a08863ce6651b3d22931e7c670cd1782168f9bba13f5a8 PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf PKG_FLAGS:=nonshared @@ -54,12 +55,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 #include +#include + #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; From patchwork Sun Apr 15 22:53:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 898327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=hauke-m.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="g4+QSQxO"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40PRff1QYFz9s06 for ; Mon, 16 Apr 2018 08:54:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ki1gqG9iSKYSelSrK5CxY4Ng3GdiAf0HRpNVw3RdCFU=; b=g4+QSQxO+BnEpp a1zkWU+CWNJkhf9QHwtMQqwPXiM02RzcGUdKxoJkTRJoeGGYU9/akEhEa4l4c6sAfRRtBj+KEJRlM S1WvLI9HeYZQ6FNtGyDqLbH4xWGOxd3+Yggh8XcAydoxQMvr5zJdfv8AIrLR21SnZXZBF37/gOr9o Ilo4yLA4MAIrqg/4A4bxyYMgfPatRrkT6pOZuOork2IyTrAGuN6u2YGyx5vQeLTpfyml7c4X3y/K3 br/gEfNjvSwaaB7ghDT2kv1aLvvuKyAh0K/iNXcY/OJrsGL5PR+KRpaXxfkXu4xpBnBZKL8T+OFAl en4i5kbjKja4MFetv+tA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7qXm-000188-TK; Sun, 15 Apr 2018 22:54:46 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7qWy-0000gh-BG for lede-dev@lists.infradead.org; Sun, 15 Apr 2018 22:54:00 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 7014E42BF9; Mon, 16 Apr 2018 00:53:39 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id ddKUBzC05L0O; Mon, 16 Apr 2018 00:53:38 +0200 (CEST) From: Hauke Mehrtens To: lede-dev@lists.infradead.org Date: Mon, 16 Apr 2018 00:53:25 +0200 Message-Id: <20180415225325.15797-5-hauke@hauke-m.de> In-Reply-To: <20180415225325.15797-1-hauke@hauke-m.de> References: <20180415225325.15797-1-hauke@hauke-m.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180415_155356_554256_93E4D7DA X-CRM114-Status: GOOD ( 14.73 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [80.241.60.212 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record Subject: [LEDE-DEV] [PATCH 5/5] mtd-utils: activate --gc-sections X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hauke@hauke-m.de, wong.syrone@gmail.com, koen.vandeputte@ncentric.com MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This reduces the size of the binary a bit: old: 37556 bin/targets/lantiq/xrx200/packages/nand-utils_2.0.1-1_mips_24kc.ipk 81697 bin/targets/lantiq/xrx200/packages/ubi-utils_2.0.1-1_mips_24kc.ipk new: 27450 bin/targets/lantiq/xrx200/packages/nand-utils_2.0.1-1_mips_24kc.ipk 71796 bin/targets/lantiq/xrx200/packages/ubi-utils_2.0.1-1_mips_24kc.ipk Signed-off-by: Hauke Mehrtens --- package/utils/mtd-utils/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/utils/mtd-utils/Makefile b/package/utils/mtd-utils/Makefile index a9905e4207..b9c3c19568 100644 --- a/package/utils/mtd-utils/Makefile +++ b/package/utils/mtd-utils/Makefile @@ -62,6 +62,9 @@ CONFIGURE_ARGS += \ --without-xattr \ --without-lzo +TARGET_CFLAGS += -ffunction-sections -fdata-sections +TARGET_LDFLAGS += -Wl,--gc-sections + define Package/ubi-utils/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) \