From patchwork Wed Apr 1 06:17:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Spooren X-Patchwork-Id: 1265016 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=aparcar.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=FFebIuJ/; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48sbc82SsNz9sRf for ; Wed, 1 Apr 2020 17:18:32 +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: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:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=k5PUEt3CfdoGs3ELg7Rz7i/Txbc7Ysn2fc6UUIGA5OQ=; b=FFebIuJ/LcnKC+hTsnzrP9Gfih UZPM21aXpBGAKoSGR6U+7cF94HYgnABziCp9NWv7n8ImT0/t3PWO1PYhJADt6a1z3w5KCG8Q7USGD OVrJyeMm0+YUWEBxRLwWt8qFc1Tk2aF0atp4idvcsomUW6QFlL80c5I67KrXWZjtsUG9zFSIcwVYA ciKumwYIA+yNayoMENosWS7obMfVoQg9s0I2dMoxIi7MTMUykbK/RtpsPr0WD0nbL8LbL+7KS1zNM LADQD4Nj7/wdlO0Lf2cVwjBQV/NYElS5pyTTAUIyz77emFCKpb5sHOn/w28a0jAabUxGYyoG0Sp9x hkBqMqzQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJWhp-0007eD-UZ; Wed, 01 Apr 2020 06:18:29 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJWhg-0007VX-Rz for openwrt-devel@lists.openwrt.org; Wed, 01 Apr 2020 06:18:22 +0000 X-Originating-IP: 72.234.141.215 Received: from tb.lan (udp224251uds.hawaiiantel.net [72.234.141.215]) (Authenticated sender: mail@aparcar.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 29088FF80B; Wed, 1 Apr 2020 06:18:17 +0000 (UTC) From: Paul Spooren To: openwrt-devel@lists.openwrt.org Date: Tue, 31 Mar 2020 20:17:47 -1000 Message-Id: <20200401061748.2022142-2-mail@aparcar.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401061748.2022142-1-mail@aparcar.org> References: <20200401061748.2022142-1-mail@aparcar.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200331_231821_034163_1488B747 X-CRM114-Status: UNSURE ( 8.51 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.199 listed in list.dnswl.org] -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 1/3] scripts: target-metadata don't add PROFILES twice X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Since 4ee3cf2b5a profiles with alternative vendor names may appear multiple times in `tmp/.targetinfo` or `.targetinfo` (for ImageBuilders). The `target-metadata.pl` script adds these profiles then twice to `PROFILE_NAMES` and the ImageBuilder show the profile twices when running `make info`. This patch uses Perls `uniq` function to add the profiles only once to `.profiles.mk`. Signed-off-by: Paul Spooren --- scripts/target-metadata.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index ee0ab5a718..fd8f4096a7 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -4,6 +4,7 @@ use lib "$FindBin::Bin"; use strict; use metadata; use Getopt::Long; +use List::MoreUtils qw(uniq); sub target_config_features(@) { my $ret; @@ -426,7 +427,7 @@ sub gen_profile_mk() { my @targets = parse_target_metadata($file); foreach my $cur (@targets) { next unless $cur->{id} eq $target; - print "PROFILE_NAMES = ".join(" ", map { $_->{id} } @{$cur->{profiles}})."\n"; + print "PROFILE_NAMES = ".join(" ", uniq map { $_->{id} } @{$cur->{profiles}})."\n"; foreach my $profile (@{$cur->{profiles}}) { print $profile->{id}.'_NAME:='.$profile->{name}."\n"; print $profile->{id}.'_HAS_IMAGE_METADATA:='.$profile->{has_image_metadata}."\n"; From patchwork Wed Apr 1 06:17:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Spooren X-Patchwork-Id: 1265018 X-Patchwork-Delegate: mail@aparcar.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=aparcar.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=Sk9opIwQ; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48sbcQ5vblz9sPF for ; Wed, 1 Apr 2020 17:18:46 +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: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:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=1mVSiFAcfY747oGMklAvwvmMEhDWc63/NN5oZ7f4cxc=; b=Sk9opIwQ3bbwJym/dIyHQ3Kbz5 XHuWGsttE6a/O9J/4w7sZRRfL3O7sBogkb5D5Fj0ybjCJokc9mGE6YwM0mxWZXy55abZk6kCHqH/m Vjh8BQdGa4Q1ezg1sn8kD+1pfaRBnhIzRyoRgc8Q8+SXO/th0HL5zMEDkCaHzXqHaXIGOiMxJG/Ld ZolfIHc0khqVTBp4PSVuXv/RI2F9iNKnOFHxdR1Rh0cp7HhQMv7yyhBnwtOayLzmPN/Ms/byNwBuL ldiDgXbcBMwuXjZQPVns7fw2gicBcS/C6Rvl7CT577HSldNJqA2wXDBsrsJ5baJJ3EZYAL6H1Xo6u 1A+YBAEQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJWi2-0007vJ-9D; Wed, 01 Apr 2020 06:18:42 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJWhj-0007Vw-4w for openwrt-devel@lists.openwrt.org; Wed, 01 Apr 2020 06:18:24 +0000 X-Originating-IP: 72.234.141.215 Received: from tb.lan (udp224251uds.hawaiiantel.net [72.234.141.215]) (Authenticated sender: mail@aparcar.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 6202AFF803; Wed, 1 Apr 2020 06:18:19 +0000 (UTC) From: Paul Spooren To: openwrt-devel@lists.openwrt.org Date: Tue, 31 Mar 2020 20:17:48 -1000 Message-Id: <20200401061748.2022142-3-mail@aparcar.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401061748.2022142-1-mail@aparcar.org> References: <20200401061748.2022142-1-mail@aparcar.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200331_231823_323226_6111B795 X-CRM114-Status: UNSURE ( 8.47 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.199 listed in list.dnswl.org] -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 2/3] build: Introduce Target-Profile-AltNames X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Currently the alternative consumer names for devices are stored in the description only or as a joint string in `Target-Profile-Name`. This adds a new variable called `Target-Profile-AltNames` to store the alternateive names as a quoted list: "" "" "" Signed-off-by: Paul Spooren --- include/image.mk | 1 + scripts/metadata.pm | 2 ++ scripts/target-metadata.pl | 3 +++ 3 files changed, 6 insertions(+) diff --git a/include/image.mk b/include/image.mk index 6204e8ab61..c4015da809 100644 --- a/include/image.mk +++ b/include/image.mk @@ -632,6 +632,7 @@ endef define Device/DumpInfo Target-Profile: DEVICE_$(1) Target-Profile-Name: $(DEVICE_DISPLAY) +Target-Profile-AltNames: $(if $(strip $(DEVICE_ALT0_TITLE)),"$(DEVICE_ALT0_TITLE)")$(if $(strip $(DEVICE_ALT1_TITLE)), "$(DEVICE_ALT1_TITLE)")$(if $(strip $(DEVICE_ALT2_TITLE)), "$(DEVICE_ALT2_TITLE)") Target-Profile-Packages: $(DEVICE_PACKAGES) Target-Profile-hasImageMetadata: $(if $(foreach image,$(IMAGES),$(findstring append-metadata,$(IMAGE/$(image)))),1,0) Target-Profile-SupportedDevices: $(SUPPORTED_DEVICES) diff --git a/scripts/metadata.pm b/scripts/metadata.pm index 1826a040a1..1967adf8d6 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -140,6 +140,7 @@ sub parse_target_metadata($) { $profile = { id => $1, name => $1, + altnames => [], has_image_metadata => 0, supported_devices => [], priority => 999, @@ -150,6 +151,7 @@ sub parse_target_metadata($) { push @{$target->{profiles}}, $profile; }; /^Target-Profile-Name:\s*(.+)\s*$/ and $profile->{name} = $1; + /^Target-Profile-AltNames:\s*(.+)\s*$/ and $profile->{altnames} = [ split(/\s+/, $1) ]; /^Target-Profile-hasImageMetadata:\s*(\d+)\s*$/ and $profile->{has_image_metadata} = $1; /^Target-Profile-SupportedDevices:\s*(.+)\s*$/ and $profile->{supported_devices} = [ split(/\s+/, $1) ]; /^Target-Profile-Priority:\s*(\d+)\s*$/ and do { diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index fd8f4096a7..38a1f25e1a 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -435,6 +435,9 @@ sub gen_profile_mk() { print $profile->{id}.'_SUPPORTED_DEVICES:='.join(' ', @{$profile->{supported_devices}})."\n"; } print $profile->{id}.'_PACKAGES:='.join(' ', @{$profile->{packages}})."\n"; + if (defined($profile->{altnames}) and @{$profile->{altnames}} > 0) { + print $profile->{id}.'_ALT_NAMES:='.join(' ', @{$profile->{altnames}})."\n"; + } } } } From patchwork Wed Apr 1 06:17:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Spooren X-Patchwork-Id: 1265020 X-Patchwork-Delegate: mail@aparcar.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=aparcar.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=I/9lH0/G; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48sbcg6p5Cz9sPF for ; Wed, 1 Apr 2020 17:18:59 +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: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:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=rputEsxhYUekkzA48UBJKIEmTiqYFJQ7UCPHv9o75xM=; b=I/9lH0/GBEPyHS026Xy8poLJTM qg2sBTRRNteWTzHK+bve2Cex38F3la2aNWfgsMOb6EVJ2sBQ7t1fcIgmR84eMUpjrdDfqAnA66NJU RYVJ9t8lgfQgHzAhmjiwKQ3HfiTsDr9rD26Wz7zjGdgDAROa2jW0RwPe72WNcmIOnZ9fjIprHaVGU V/eInTl+PEO1KZ0Ly+RNPpqcaG+N22EQ1AxES47FVXjhGmAzUiL/zW4CamrJkedfhf3A30QRkbrj0 xAANzlbyV7/DEpY4++dF/lA6uFKAEHI7/ue8CZMthM2SU2KJD/yIzhQxejezASmlsj21eFlol9hC0 P0kH38Pw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJWiE-0008C2-90; Wed, 01 Apr 2020 06:18:54 +0000 Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJWhl-0007XB-GH for openwrt-devel@lists.openwrt.org; Wed, 01 Apr 2020 06:18:26 +0000 X-Originating-IP: 72.234.141.215 Received: from tb.lan (udp224251uds.hawaiiantel.net [72.234.141.215]) (Authenticated sender: mail@aparcar.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 8E802FF802; Wed, 1 Apr 2020 06:18:22 +0000 (UTC) From: Paul Spooren To: openwrt-devel@lists.openwrt.org Date: Tue, 31 Mar 2020 20:17:49 -1000 Message-Id: <20200401061748.2022142-4-mail@aparcar.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401061748.2022142-1-mail@aparcar.org> References: <20200401061748.2022142-1-mail@aparcar.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200331_231825_673481_39AA997E X-CRM114-Status: UNSURE ( 7.47 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.199 listed in list.dnswl.org] -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 3/3] ImageBuilder: Show alternative device names X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org With the introduction of `Target-Profile-AltNames` the ImageBuilder should show these names to allow users to find their devices without knowing the name used in the OpenWrt build system. Signed-off-by: Paul Spooren --- target/imagebuilder/files/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index 15b3d5c35c..d92cd253c8 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -75,6 +75,7 @@ include $(INCLUDE_DIR)/target.mk USER_PROFILE ?= $(firstword $(PROFILE_NAMES)) PROFILE_LIST = $(foreach p,$(PROFILE_NAMES), \ echo '$(patsubst DEVICE_%,%,$(p)):'; $(if $($(p)_NAME),echo ' $(subst ','"'"',$($(p)_NAME))'; ) \ + $(if $($(p)_ALT_NAMES),echo ' AlternativeNames: $(subst ','"'"',$($(p)_ALT_NAMES))'; ) \ echo ' Packages: $($(p)_PACKAGES)'; echo ' hasImageMetadata: $($(p)_HAS_IMAGE_METADATA)'; \ $(if $($(p)_SUPPORTED_DEVICES),echo ' SupportedDevices: $($(p)_SUPPORTED_DEVICES)';) )