From patchwork Sat Sep 3 08:52:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Kresin X-Patchwork-Id: 665409 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sR8vb5rcnz9s4x for ; Sat, 3 Sep 2016 18:55:07 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kresin-me.20150623.gappssmtp.com header.i=@kresin-me.20150623.gappssmtp.com header.b=oSYSNCPM; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bg6hW-0003A1-0E; Sat, 03 Sep 2016 08:53:22 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bg6hR-00036E-VB for lede-dev@lists.infradead.org; Sat, 03 Sep 2016 08:53:19 +0000 Received: by mail-wm0-x242.google.com with SMTP id v143so5776198wmv.1 for ; Sat, 03 Sep 2016 01:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kresin-me.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=b1Piub8nbkrAt9XLhGxzWe8eoHbGvXeManHdj8uB+Uk=; b=oSYSNCPMGV5YJgy8E7TeqR4ksXFX6aAvh0oicX9HPEABlf/rR5ANAV5Lmcqra7EhnY zOVGBAjZvn9I+AJS2j+BgoIwPXGhTlXG7os70ViDP8up4yhUuQBbK7ZEHRpTPWGd/68x JkLRgqQsDORYkN4K/pujz36XXAKqHSgCFpO8vIKzwtUZS6UyjQs2FtbiXVtU27bdo1w+ d7joMYmYJBhWlO/pqN7MgdizjoAgDRB85UNy71gOGsr710CvoqMuk7yPSM0PHFHXWLC+ nhUyn7jmtZ64MyuAAtr8G+Xv8YHj8lEZ42Ac8dj0RrGpBCGgtO6Vzj+mTDDBTJNSsKev 0F/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=b1Piub8nbkrAt9XLhGxzWe8eoHbGvXeManHdj8uB+Uk=; b=IVw/FD7YVv8JSAyFbP2eWaHX+YHVEOddfI0A9xucVnbq0oOMGRPpTLGJ5jbNe/BOlb H9PMjTVbXOFxmpTlLnoRXfCWuIr+/p8vjnBxok8gyfhkHptRFAEf0uRZ1Y2iLfSbQOEY m0z8zYrWxUIvprIm0oDnYFcQ7/1l1vw6/OFhruAZicPwhM5WOAxfo+pFTU4/vaRGDBBp C5feSFJUWoDaSvjiDG9CaZH1iuGRr/v0Hro+e683uA/gTwsOCD5atmJcRkloII227dcD AmDNvXECgXKnNHbWrPSKnrFW6kG1jwLpFPR22+XSctb933CVY7CXC3Givk5dgZDmSv/g jPjg== X-Gm-Message-State: AE9vXwPYcN98iUodyQK02aL/78WXEH+dHFR1lsW+Vvl4ZDyAN0GbNWfTr36YLh0HHMrCTw== X-Received: by 10.194.235.229 with SMTP id up5mr22728300wjc.69.1472892777374; Sat, 03 Sep 2016 01:52:57 -0700 (PDT) Received: from desktop.wvd.kresin.me (p200300454B7EFA00E07F45DF541F4735.dip0.t-ipconnect.de. [2003:45:4b7e:fa00:e07f:45df:541f:4735]) by smtp.gmail.com with ESMTPSA id ce6sm14407943wjc.27.2016.09.03.01.52.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Sep 2016 01:52:56 -0700 (PDT) From: Mathias Kresin To: lede-dev@lists.infradead.org Date: Sat, 3 Sep 2016 10:52:38 +0200 Message-Id: <1472892762-20216-3-git-send-email-dev@kresin.me> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472892762-20216-1-git-send-email-dev@kresin.me> References: <1472892762-20216-1-git-send-email-dev@kresin.me> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160903_015318_294000_B397D84E X-CRM114-Status: UNSURE ( 8.63 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:242 listed in] [list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [LEDE-DEV] [RFC 3/7] image: pass device blocksize to padjffs2 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org At the moment the padding steps are hardcoded. Especially images for devices with a 4K sector size can be unnecessarily bloated using the hardcoded padding steps. It has been observed that 192Kb of padding was added to the image of a 4MB device, albeit due to the 4K sector size the minimum required extra padding for the jffs2 rootfs_data is 20Kb. In worst case it means that the image-size check could fail albeit there is enough space for all selected packages For device build code not exposing the blocksize, use the hardcoded padding further on. Signed-off-by: Mathias Kresin --- include/image-commands.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index 3b9ea3c..76e42ab 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -131,7 +131,8 @@ define Build/pad-to endef define Build/pad-rootfs - $(STAGING_DIR_HOST)/bin/padjffs2 $@ $(1) 4 8 16 64 128 256 + $(STAGING_DIR_HOST)/bin/padjffs2 $@ $(1) \ + $(if $(BLOCKSIZE),$(BLOCKSIZE:%k=%),4 8 16 64 128 256) endef define Build/pad-offset