From patchwork Fri Mar 29 14:07:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1069725 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n5U4+bY3"; 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 44W3VL27t8z9sQs for ; Sat, 30 Mar 2019 01:08:10 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version: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=RFloKw7YxlPKLvAB+wsgrbM7bfGl/oFppnkWCOkncLk=; b=n5U4+bY3LdZFJV aESyJeeQH1yjjyNQZsllMUSPMoU+Kzqb0X9FBVmn9Il7p82m50kjVHTWWzQFspnHtH1j6rQ2NKfeD +k/lPSrMwflnfO2+CVSnGQZZu12o056PebvDBR98rGDDJ6GX9gdXn0rAJQdYuPNMup6MU5NNdJibc FCoX6i1nsW44UZCcFPOAMPRVcTzJt9IaaJFW9Hg0L7Lzzl9WCVBzKNMA8TZq/ABw7BkNY3G1rLUyo zCCvf1Z4tViE+IZJQN49/vItHosoITuRVQ5yfI8EQgl4SkP+6M2uQGJGYj8MLJKMC0l+T1g62ywgA yf9gWgnvFTZtai6+DmEA==; 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 1h9sAq-0003JX-QI; Fri, 29 Mar 2019 14:08:00 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9sAO-0002gA-1O for openwrt-devel@lists.openwrt.org; Fri, 29 Mar 2019 14:07:36 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id E4ADB41DB; Fri, 29 Mar 2019 15:07:26 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id c38a0ee0; Fri, 29 Mar 2019 15:07:25 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Fri, 29 Mar 2019 15:07:17 +0100 Message-Id: <1553868440-26476-3-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1553868440-26476-1-git-send-email-ynezz@true.cz> References: <1553868440-26476-1-git-send-email-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190329_070732_636666_908E4F0E X-CRM114-Status: UNSURE ( 7.40 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH 2/5] build: image: Add pad-to and pad-rootfs-squashfs helpers X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org In order to share common functionality across platforms. Signed-off-by: Petr Štetiar --- include/image-commands.mk | 3 +-- include/image.mk | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index 8251a81..06c084c 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -230,8 +230,7 @@ define Build/append-uboot endef define Build/pad-to - dd if=$@ of=$@.new bs=$(1) conv=sync - mv $@.new $@ + $(call Image/pad-to,$@,$(1)) endef define Build/pad-extra diff --git a/include/image.mk b/include/image.mk index 6d9e347..8b84c8c 100644 --- a/include/image.mk +++ b/include/image.mk @@ -180,6 +180,15 @@ ifeq ($(strip $(call kernel_patchver_ge,4.17.0)),1) -Wno-unique_unit_address endif +define Image/pad-to + dd if=$(1) of=$(1).new bs=$(2) conv=sync + mv $(1).new $(1) +endef + +define Image/pad-root-squashfs + $(call Image/pad-to,$(KDIR)/root.squashfs,$(if $(1),$(1),$(CONFIG_TARGET_ROOTFS_PARTSIZE)M)) +endef + # $(1) source dts file # $(2) target dtb file # $(3) extra CPP flags