From patchwork Wed Jun 5 06:32:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 1110328 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=phrozen.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RmzVas9E"; 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 45JfB05dKsz9s6w for ; Wed, 5 Jun 2019 16:33:12 +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: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=sw3NfypT/RAcdeVpTavKVlBebO4R5it4eQtqmxHs0IY=; b=RmzVas9EkOiqBp XUtuFl1LN15+IH3TLvDglpGHDUzw9cLt69GGY3sBKmixmBhmi+FDf9wtsDidmHuG61uPtjEjsuoPK WoraOdNLBp2L2YspVV5WuvXsKHqWhFVp8x07JMarTTfK4j8yZV2yf5d77bAWYqnDTLu7tbKICad9V vM1ZRsj3wxWvPjScsnTw4qvfIWtbMr7IkPgJXAWWdCtQlvCgAY+D+VC+/iZL0/s691rWaZ06herXv urz6d7POwgC3zEVzT7m8xCv9HoWgVGTnJxy72v8BQnSWAUtIfMkkCvKeFnct75x6vePX5qOtPUCbm 9V5KM4Mcx8uQvngmDt0w==; 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 1hYPTj-0004zE-2A; Wed, 05 Jun 2019 06:32:55 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYPTf-0004yH-Nc for openwrt-devel@lists.openwrt.org; Wed, 05 Jun 2019 06:32:53 +0000 Received: from p5dcfb869.dip0.t-ipconnect.de ([93.207.184.105] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1hYPTb-0007c8-LA; Wed, 05 Jun 2019 08:32:47 +0200 From: John Crispin To: openwrt-devel@lists.openwrt.org Date: Wed, 5 Jun 2019 08:32:38 +0200 Message-Id: <20190605063239.27540-1-john@phrozen.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190604_233251_936181_7E47C1A5 X-CRM114-Status: UNSURE ( 8.98 ) 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 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH V2 1/2] image: make the folder that gets included intot he RootFS configurable 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: John Crispin Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This allows managing several different folder for varying env profiles. Signed-off-by: John Crispin --- config/Config-images.in | 6 ++++++ package/Makefile | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/Config-images.in b/config/Config-images.in index 8548c7cd24..a618da1b6c 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -286,4 +286,10 @@ menu "Target Images" it will be mounted by PARTUUID which makes the kernel find the appropriate disk automatically. + config TARGET_ROOTFS_INCLUDE_FOLDER + string "RootFS include folder" + default "files" + help + Override the folder that is included into the RootFS by default. + endmenu diff --git a/package/Makefile b/package/Makefile index abbf5f91f2..9899d4b48a 100644 --- a/package/Makefile +++ b/package/Makefile @@ -32,6 +32,10 @@ ifneq ($(IGNORE_ERRORS),) $(curdir)/builddirs-ignore-host-compile := $(package-ignore-subdirs) endif +ifeq ($(CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER),"") +CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER:=files +endif + PACKAGE_INSTALL_FILES:= \ $(foreach pkg,$(sort $(package-y)), \ $(foreach variant, \ @@ -75,8 +79,7 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE done || true $(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG) - - $(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/files) + $(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/$(call qstrip, $(CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER))) $(curdir)/index: FORCE @echo Generating package index... From patchwork Wed Jun 5 06:32:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 1110329 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=phrozen.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NOV28Dg8"; 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 45JfB30l9Hz9s4Y for ; Wed, 5 Jun 2019 16:33: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: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=GDA7UQHGT5Z8203Mj2QvYFMQBDaavoUgr/ZMcesL0mQ=; b=NOV28Dg84ooh3W E5GhAidfQEU2AGPDjiL+n/xqW59uzB3TWMooOMk+SaQ76l4TuWENJ/kp4/wvdpKatHmxzTDoGwl3m TqHO7zokNf56Av3FhNxLUaQOOidmRaoD8X6Awb+eIggfylyyBDYfHwavMaYZ7LNhQwMorejuDCS5c Q1qzoP/3Ulz14ivAsdzfnF+VJAXnsKQL2jl2vbjZZYuAcmsA2/JL1rkPx5EIQZ3BFQkKHYVLJYNEl 6n16fx/nYW3qZx8L2jLqQiQZXkWJlsXzkm7lQ2XQJk8IkA126t+sQfrnj9em/qWeZIEoF2ousTAB3 yhXLc8jUMTHu1GvmZ7HA==; 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 1hYPTp-00056s-IK; Wed, 05 Jun 2019 06:33:01 +0000 Received: from nbd.name ([2a01:4f8:221:3d45::2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYPTf-0004yG-Nd for openwrt-devel@lists.openwrt.org; Wed, 05 Jun 2019 06:32:53 +0000 Received: from p5dcfb869.dip0.t-ipconnect.de ([93.207.184.105] helo=bertha.fritz.box) by ds12 with esmtpa (Exim 4.89) (envelope-from ) id 1hYPTb-0007c8-Ue; Wed, 05 Jun 2019 08:32:48 +0200 From: John Crispin To: openwrt-devel@lists.openwrt.org Date: Wed, 5 Jun 2019 08:32:39 +0200 Message-Id: <20190605063239.27540-2-john@phrozen.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190605063239.27540-1-john@phrozen.org> References: <20190605063239.27540-1-john@phrozen.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190604_233251_994065_A618FA74 X-CRM114-Status: UNSURE ( 9.65 ) 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 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record Subject: [OpenWrt-Devel] [PATCH V2 2/2] script/feeds: add a new command that allows generating a new feeds.conf 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: John Crispin Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This can be used inside build setups for easy feeds.conf generation. Signed-off-by: John Crispin --- scripts/feeds | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/scripts/feeds b/scripts/feeds index 304ef6cbaf..6f8c7be31d 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -7,6 +7,7 @@ use metadata; use warnings; use strict; use Cwd 'abs_path'; +use File::Copy chdir "$FindBin::Bin/.."; $ENV{TOPDIR} //= getcwd(); @@ -819,6 +820,37 @@ sub update { return $failed; } +sub setup { + my %opts; + + getopts('bh', \%opts); + + if ($opts{h}) { + usage(); + return 0; + } + + if ($opts{b}) { + copy("feeds.conf.default", "feeds.conf") or die "Copy failed: $!" + } else { + unlink "feeds.conf" + } + + open(my $fd, ">>feeds.conf"); + while (my $entry = shift @ARGV) { + my ($type, $name, $src) = split /,/, $entry; + + $update_method{$type} or do { + warn "Unknown type '$type' in parameter $entry\n"; + unlink "feeds.conf"; + return 1; + }; + printf $fd "%s %s %s\n", $type, $name, $src; + } + + return 0; +} + sub feed_config() { foreach my $feed (@feeds) { my $installed = (-f "feeds/$feed->[1].index"); @@ -870,6 +902,10 @@ Commands: -i : Recreate the index only. No feed update from repository is performed. -f : Force updating feeds even if there are changed, uncommitted files. + setup [options] ...: generate feeds.conf + Options: + -b : Use feeds.conf.default as base for new feeds.conf. + clean: Remove downloaded/generated files. EOF @@ -883,6 +919,7 @@ my %commands = ( 'search' => \&search, 'uninstall' => \&uninstall, 'feed_config' => \&feed_config, + 'setup' => \&setup, 'clean' => sub { system("rm -rf ./feeds ./package/feeds"); }