From patchwork Fri Nov 23 09:53:37 2018 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: 1002231 X-Patchwork-Delegate: blogic@openwrt.org 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="T/989Zwf"; 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 431WqH6sMwz9s29 for ; Fri, 23 Nov 2018 20:54:03 +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: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=iNTJdDMn6LbIprxrNOBdz8PQaqVo3RWgp5whjYtNyJE=; b=T/989ZwfaSz48Z gNulT8m6FoX0ShPW7slvBF/i2xorDoMvVBa9mLGpIlcnyWx/yWrYtMQxLnPbx5AbYDbYmN4LaKp2X avPRRBH7HWCIbabi0JHqBGQYz8JEkiuBqgp15sZSKoXcxJEPNX02jdXAJtI4AtubGfX0fbu4x/GQO EOj645CUgk+K6Bki6pSkfFRXOSjD+2022lyb6jEBfhsyMQWvtW1dwKR3yLkJy6+/AT81JsrOKiubJ +krLULRNqZdf1FUSUe9xA/Mp1yDbb/h3MJjq7vZmmI1xuERgDj/bS/Bh/bQ44qDYXvuP5bJ8wmO1k 6gaEsUKnjFxSjLIgR0mg==; 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 1gQ89t-0006SR-QU; Fri, 23 Nov 2018 09:53:57 +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 1gQ89q-0006Qc-5x for openwrt-devel@lists.openwrt.org; Fri, 23 Nov 2018 09:53:55 +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 B69B94EE2; Fri, 23 Nov 2018 10:53:42 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by meh.true.cz (OpenSMTPD) with ESMTP id 4898f372; Fri, 23 Nov 2018 10:53:40 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Fri, 23 Nov 2018 10:53:37 +0100 Message-Id: <1542966817-1311-1-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181123_015354_372949_410283DC X-CRM114-Status: UNSURE ( 7.50 ) 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 http://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH] build: Introduce building of artifacts 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 We currently could (ab)use IMAGES for this task, but the downside is, that the filenames has filesystem tied to the filename, which might be confusing as the artifact itself don't has to be used with that specific filesystem. Another downside is, that the artifacts built with IMAGES target are build for every FILESYSTEMS filesystem. Consider following use case: define Device/apalis ... FILESYSTEMS := ext4 squashfs IMAGES := spl-uboot.bin recovery.scr IMAGE/spl-uboot.bin := append-uboot-spl | pad-to 68k | append-uboot IMAGE/recovery.scr := recovery-scr endef Where we would get target binaries with following filenames: openwrt-imx6-apalis-squashfs.recovery.scr openwrt-imx6-apalis-squashfs.spl-uboot.bin openwrt-imx6-apalis-ext4.recovery.scr openwrt-imx6-apalis-ext4.spl-uboot.bin With proposed patch, we could now just do: define Device/apalis ... ARTIFACTS := spl-uboot.bin recovery.scr ARTIFACT/spl-uboot.bin := append-uboot-spl | pad-to 68k | append-uboot ARTIFACT/recovery.scr := recovery-scr endef Which would produce target binaries with following filenames: openwrt-imx6-apalis-recovery.scr openwrt-imx6-apalis-spl-uboot.bin Signed-off-by: Petr Štetiar Acked-by: Hauke Mehrtens --- include/image.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/image.mk b/include/image.mk index f2a85f6..a2b106d 100644 --- a/include/image.mk +++ b/include/image.mk @@ -321,6 +321,7 @@ define Device/Init CMDLINE:= IMAGES := + ARTIFACTS := IMAGE_PREFIX := $(IMG_PREFIX)-$(1) IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2) KERNEL_PREFIX = $$(IMAGE_PREFIX) @@ -498,6 +499,19 @@ define Device/Build/image endef +define Device/Build/artifact + $$(_TARGET): $(BIN_DIR)/$(IMAGE_PREFIX)-$(1) + $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE) + @rm -f $$@ + $$(call concat_cmd,$(ARTIFACT/$(1))) + + .IGNORE: $(BIN_DIR)/$(IMAGE_PREFIX)-$(1) + + $(BIN_DIR)/$(IMAGE_PREFIX)-$(1): $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1) + cp $$^ $$@ + +endef + define Device/Build $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1))) $(call Device/Build/kernel,$(1)) @@ -508,6 +522,10 @@ define Device/Build $$(eval $$(foreach image,$$(IMAGES), \ $$(foreach fs,$$(filter $(TARGET_FILESYSTEMS),$$(FILESYSTEMS)), \ $$(call Device/Build/image,$$(fs),$$(image),$(1))))) + + $$(eval $$(foreach artifact,$$(ARTIFACTS), \ + $$(call Device/Build/artifact,$$(artifact)))) + endef define Device/DumpInfo