From patchwork Sun May 5 20:14:19 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: 1095551 X-Patchwork-Delegate: ynezz@true.cz 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="A0cI+dEL"; 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 44xxtX6TX7z9s9N for ; Mon, 6 May 2019 06:15:00 +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: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=rMoi5eVbC4i7cDIXbJL8xl297+ny32tFlelzt+ikQLw=; b=A0cI+dELko/pYy J8zU6mHyKLvWDNmWvwCNEQv0DYGB3sC0c+W9MvuY6i4j0IrtAY64N6kSS2rxfpc7lqWcwdJRMuWXS rSPRwLuHmj260T81zAiSFfiRQRSH8C1c4c957GcbH0h5xkZiSGpqg8bwPjeoY77VexbuaaiavCnlZ qt2X6hWujo0flVUwyR4ken30vkDxau8BSSRZz21KyF0uE5EaMKAFUn16SjuFn0bYakU0/sk8tM7pp r/93W/xjN3+Pv1C7pPj01o+u/aUcgEcL6/LNANAsk04eN9rItdhT2szaNU7jqIOgXNTDKjOx/95un l9bU9056hnrXKk7UxpmA==; 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 1hNNX7-0003NC-Pz; Sun, 05 May 2019 20:14:49 +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 1hNNWo-0002yN-2F for openwrt-devel@lists.openwrt.org; Sun, 05 May 2019 20:14:32 +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 B8FD23EE7; Sun, 5 May 2019 22:14:26 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id de8a904e; Sun, 5 May 2019 22:14:25 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Sun, 5 May 2019 22:14:19 +0200 Message-Id: <1557087260-32680-2-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1557087260-32680-1-git-send-email-ynezz@true.cz> References: <1557087260-32680-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-20190505_131430_353757_23CC757B X-CRM114-Status: GOOD ( 10.10 ) 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 1/2] build: allow selective per device building of initramfs 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 Currently it's not possible to enable building of initramfs images for the devices which need them, leading to production of initramfs images for every device under target which has FEATURES += ramdisk. So this patch adds a possibility to enable FEATURES += selective-ramdisk and then the device which needs ramdisk can just define NEEDS_INITRAMFS=1. Signed-off-by: Petr Štetiar --- config/Config-images.in | 2 +- include/image.mk | 11 ++++++++++- scripts/target-metadata.pl | 1 + target/Config.in | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/config/Config-images.in b/config/Config-images.in index 8548c7c..befed24 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -8,7 +8,7 @@ menu "Target Images" menuconfig TARGET_ROOTFS_INITRAMFS bool "ramdisk" - default y if USES_INITRAMFS + default y if (USES_INITRAMFS || USES_SELECTIVE_INITRAMFS) help Embed the root filesystem into the kernel (initramfs). diff --git a/include/image.mk b/include/image.mk index 5b02219..4f29002 100644 --- a/include/image.mk +++ b/include/image.mk @@ -382,6 +382,7 @@ define Device/Init SUPPORTED_DEVICES := IMAGE_METADATA := + NEEDS_INITRAMFS := FILESYSTEMS := $(TARGET_FILESYSTEMS) endef @@ -538,7 +539,15 @@ define Device/Build/artifact endef define Device/Build - $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1))) +ifdef CONFIG_TARGET_ROOTFS_INITRAMFS +ifneq ($(CONFIG_USES_SELECTIVE_INITRAMFS),y) + $(call Device/Build/initramfs,$(1)) +else + ifdef NEEDS_INITRAMFS + $(call Device/Build/initramfs,$(1)) + endif +endif +endif $(call Device/Build/kernel,$(1)) $$(eval $$(foreach compile,$$(COMPILE), \ diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index 1239587..d6f2dd4 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -32,6 +32,7 @@ sub target_config_features(@) { /^fpu$/ and $ret .= "\tselect HAS_FPU\n"; /^spe_fpu$/ and $ret .= "\tselect HAS_SPE_FPU\n"; /^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n"; + /^selective-ramdisk$/ and $ret .= "\tselect USES_SELECTIVE_INITRAMFS\n"; /^powerpc64$/ and $ret .= "\tselect powerpc64\n"; /^nommu$/ and $ret .= "\tselect NOMMU\n"; /^mips16$/ and $ret .= "\tselect HAS_MIPS16\n"; diff --git a/target/Config.in b/target/Config.in index 3cf4231..3533cf9 100644 --- a/target/Config.in +++ b/target/Config.in @@ -46,6 +46,9 @@ config USES_DEVICETREE config USES_INITRAMFS bool +config USES_SELECTIVE_INITRAMFS + bool + config USES_SQUASHFS bool