From patchwork Tue Jan 19 19:49:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Schmutzler X-Patchwork-Id: 1428836 X-Patchwork-Delegate: freifunk@adrianschmutzler.de 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=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=KxKVvAUC; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4DKznR11gpz9sVR for ; Wed, 20 Jan 2021 06:51:55 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=fqBdPnMrn5S0IZO9NyulCgveHHReqjJIA+Oi4AXQWhs=; b=KxKVvAUCPb59rwKFBOYy3SUeVo 3Z0dfdwmBvqloS7r5SAHSGdV/C3kPandeWrpIThSiysiwkDaluWZapkWXpE/CmmD9VbTjsBU3mENg vaql0+hgsVVmkc/1iyQV60FWz7kg4t1N2v5+znNPhLjN12ygzxQ+JkzoZvglf55Um1mQnPtOnaGd5 Dcg90Af8ugVQATKsN/V/0VsGvOp1S3+t5OHR3p9eZ2gsUprIvPvqa8yD2t84F05MDeGWaWQkpmFXi 9Ra2zOMpCzP8tou6G8Np+aMg82mF76migWIOEc1iJ/UBAdVXOgXZM9LsG8h/2fdzzaQxYSST1LPHt XJkknYQg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1x0t-0005pE-Ed; Tue, 19 Jan 2021 19:50:03 +0000 Received: from mout.kundenserver.de ([212.227.126.135]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1x0q-0005oi-II for openwrt-devel@lists.openwrt.org; Tue, 19 Jan 2021 19:50:02 +0000 Received: from buildfff.adridolf.com ([178.26.242.49]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MpTpc-1lpXND1DMy-00px4V for ; Tue, 19 Jan 2021 20:49:59 +0100 From: Adrian Schmutzler To: openwrt-devel@lists.openwrt.org Subject: [PATCH] treewide: provide global default for SUPPORTED_DEVICES Date: Tue, 19 Jan 2021 20:49:12 +0100 Message-Id: <20210119194912.27463-1-freifunk@adrianschmutzler.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:bACYJcZ/36n5k8sy+pt8ohGpwwYPG9mDC0iVK+NsdKYi4NJcdsU jLrW+sE1+mG9eiy7CwtGwm9ym/+nppVMyuIxJPAuMrVLZrCe1T19T+cKpC/eqIFxq0tIY+l oPgQRgMOW+eWiruolZMLwVHFhCNQpuS2h0GFgd038UHquwQg2fVwlZQlqd+KpUaP5mF0NXp 16BT6z/QRHCjPSszMFJXg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:orhtyaoTb/A=:/AIlxGBavAH1MAefpFwZlQ O+ChgNUTvGf214Obmgo18qL9IWmNh4zBei5RezVAOMCiedoWxGpZiC5t80CVsoQw60H6i4F1f K04wHIIqCnC6vNnx0wpIYofqUlD6WPg+2BZWvzSrtK4grNoYm4elhi6sYS+9w+nVgrSx4RBXR zJFYIwMvP2PsLJ7jITFTgN81Cg4U9OrdWK50h6Cdi3jK8qP+BmksIwKlCt4cQJihTh2FIUydE 8aoKgVT9DsDQ3luceJ0nwBTvM4rRjtfurrtgLGDSuRMPuOhGgKu4MKwfNxsixLF7elYT5QayW +EwwEA4R0bnvBHP4inmF7+vPcC3szkf/kwK5ck/HUlwn7T6Uu1HSDpJ7Xdp+xOapgtyrerITe YvpyKDcAw9i8bKs25j1Cc/47i9i/HqROQX1L07buxaZ8OWT8k2/71MAnEj+LwdMWQzP3kd07z lInf85t5sQ== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210119_145000_805726_BFBD84A5 X-CRM114-Status: GOOD ( 14.64 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.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 [212.227.126.135 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.227.126.135 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List 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 The majority of our targets provide a default value for the variable SUPPORTED_DEVICES, which is used in images to check against the compatible on a running device: SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) At the moment, this is implemented in the Device/Default block of the individual targets or even subtargets. However, since we standardized device names and compatible in the recent past, almost all targets are following the same scheme now: device/image name: vendor_model compatible: vendor,model The equal redundant definitions are a symptom of this process. Consequently, this patch moves the definition to image.mk making it a global default. For the few targets not using the scheme above, SUPPORTED_DEVICES will be defined to a different value in Device/Default anyway, overwriting the default. In other words: This change is supposed to be cosmetic. This can be used as a global measure to get the current compatible with: $(firstword $(SUPPORTED_DEVICES)) (Though this is not precisely an achievement of this commit.) Signed-off-by: Adrian Schmutzler --- include/image.mk | 2 +- target/linux/apm821xx/image/Makefile | 1 - target/linux/at91/image/Makefile | 1 - target/linux/ath79/image/Makefile | 1 - target/linux/bcm63xx/image/bcm63xx_nand.mk | 1 - target/linux/gemini/image/Makefile | 1 - target/linux/ipq40xx/image/Makefile | 1 - target/linux/ipq806x/image/Makefile | 1 - target/linux/kirkwood/image/Makefile | 1 - target/linux/lantiq/image/Makefile | 1 - target/linux/layerscape/image/armv7.mk | 1 - target/linux/layerscape/image/armv8_64b.mk | 1 - target/linux/mediatek/image/Makefile | 1 - target/linux/mpc85xx/image/Makefile | 1 - target/linux/mvebu/image/Makefile | 1 - target/linux/omap/image/Makefile | 1 - target/linux/oxnas/image/ox810se.mk | 1 - target/linux/oxnas/image/ox820.mk | 1 - target/linux/ramips/image/Makefile | 1 - target/linux/realtek/image/Makefile | 1 - target/linux/rockchip/image/Makefile | 1 - target/linux/sunxi/image/Makefile | 1 - target/linux/tegra/image/Makefile | 1 - 23 files changed, 1 insertion(+), 23 deletions(-) diff --git a/include/image.mk b/include/image.mk index 8f46c75ffe..6843b935f7 100644 --- a/include/image.mk +++ b/include/image.mk @@ -404,7 +404,7 @@ define Device/Init UIMAGE_NAME := DEVICE_COMPAT_VERSION := 1.0 DEVICE_COMPAT_MESSAGE := - SUPPORTED_DEVICES := + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) IMAGE_METADATA := FILESYSTEMS := $(TARGET_FILESYSTEMS) diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 2331947e33..c1cb2bcfdd 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -88,7 +88,6 @@ define Device/Default KERNEL_LOADADDR := 0x00000000 DEVICE_DTS_DIR := ../dts DEVICE_DTS = $(subst _,-,$(1)) - SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) endef include $(SUBTARGET).mk diff --git a/target/linux/at91/image/Makefile b/target/linux/at91/image/Makefile index 05f0b58af7..25fc34eba0 100644 --- a/target/linux/at91/image/Makefile +++ b/target/linux/at91/image/Makefile @@ -25,7 +25,6 @@ define Device/Default PROFILES := Default FILESYSTEMS := squashfs ubifs ext4 DEVICE_DTS = $(lastword $(subst _, ,$(1))) - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) KERNEL_NAME := zImage KERNEL_SIZE := 4096k KERNEL := kernel-bin | append-dtb | lzma | uImage lzma diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile index 9bec159cf0..4a51cf1fbf 100644 --- a/target/linux/ath79/image/Makefile +++ b/target/linux/ath79/image/Makefile @@ -65,7 +65,6 @@ define Device/Default KERNEL := kernel-bin | append-dtb | lzma | uImage lzma KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma COMPILE := - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | append-metadata | check-size diff --git a/target/linux/bcm63xx/image/bcm63xx_nand.mk b/target/linux/bcm63xx/image/bcm63xx_nand.mk index 81c328b712..5903d03632 100644 --- a/target/linux/bcm63xx/image/bcm63xx_nand.mk +++ b/target/linux/bcm63xx/image/bcm63xx_nand.mk @@ -34,7 +34,6 @@ define Device/bcm63xx-nand CFE_WFI_FLAGS := UBINIZE_OPTS := -E 5 DEVICE_PACKAGES += nand-utils - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) endef define Device/sercomm-nand diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile index 83f3d222d9..0eae4c6bd8 100644 --- a/target/linux/gemini/image/Makefile +++ b/target/linux/gemini/image/Makefile @@ -130,7 +130,6 @@ define Device/Default KERNEL_NAME := zImage KERNEL := kernel-bin | append-dtb BLOCKSIZE := 128k - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) endef # A reasonable set of default packages handling the NAS type diff --git a/target/linux/ipq40xx/image/Makefile b/target/linux/ipq40xx/image/Makefile index a764cb60af..2be262936f 100644 --- a/target/linux/ipq40xx/image/Makefile +++ b/target/linux/ipq40xx/image/Makefile @@ -8,7 +8,6 @@ define Device/Default KERNEL_PREFIX := $$(IMAGE_PREFIX) KERNEL_LOADADDR := 0x80208000 DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1))) - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin/squashfs := diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index bc917d4fa4..bab1da0090 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -30,7 +30,6 @@ define Device/Default KERNEL_PREFIX := $$(IMAGE_PREFIX) KERNEL_LOADADDR = 0x42208000 DEVICE_DTS = $$(SOC)-$(lastword $(subst _, ,$(1))) - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata IMAGE/sysupgrade.bin/squashfs := diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index a9aad01f7f..9d2d60e55f 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -30,7 +30,6 @@ define Device/Default IMAGES := sysupgrade.bin factory.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/factory.bin := append-ubi - SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) endef define Device/checkpoint_l-50 diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile index b169d93859..a4ba22dfc4 100644 --- a/target/linux/lantiq/image/Makefile +++ b/target/linux/lantiq/image/Makefile @@ -65,7 +65,6 @@ define Device/Default FILESYSTEMS := squashfs SOC := $(DEFAULT_SOC) DEVICE_DTS = $$(SOC)_$(1) - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size endef diff --git a/target/linux/layerscape/image/armv7.mk b/target/linux/layerscape/image/armv7.mk index 08ef6cb9a1..62921a5ef9 100644 --- a/target/linux/layerscape/image/armv7.mk +++ b/target/linux/layerscape/image/armv7.mk @@ -15,7 +15,6 @@ define Device/Default KERNEL_LOADADDR := 0x80008000 KERNEL_ENTRY_POINT := 0x80008000 DEVICE_DTS = $(lastword $(subst _, ,$(1))) - SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) IMAGE_SIZE := 64m IMAGE/sysupgrade.bin = \ ls-append-dtb $$(DEVICE_DTS) | pad-to 1M | \ diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index 264f7dfd84..a3f4428299 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -14,7 +14,6 @@ define Device/Default KERNEL_LOADADDR := 0x80080000 KERNEL_ENTRY_POINT := 0x80080000 DEVICE_DTS = freescale/$(subst _,-,$(1)) - SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) IMAGE_SIZE := 64m IMAGE/sysupgrade.bin = \ ls-append-dtb $$(DEVICE_DTS) | pad-to 1M | \ diff --git a/target/linux/mediatek/image/Makefile b/target/linux/mediatek/image/Makefile index 724bf430ef..36ecdd5a9b 100644 --- a/target/linux/mediatek/image/Makefile +++ b/target/linux/mediatek/image/Makefile @@ -31,7 +31,6 @@ define Device/Default IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | pad-to 128k | append-rootfs | \ pad-rootfs | append-metadata - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) endef include $(SUBTARGET).mk diff --git a/target/linux/mpc85xx/image/Makefile b/target/linux/mpc85xx/image/Makefile index eb70db04db..618b8c7135 100644 --- a/target/linux/mpc85xx/image/Makefile +++ b/target/linux/mpc85xx/image/Makefile @@ -16,7 +16,6 @@ define Device/Default KERNEL_ENTRY := 0x00000000 KERNEL_LOADADDR := 0x00000000 KERNEL := kernel-bin - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) endef include $(SUBTARGET).mk diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index 502e081ec3..77548d683e 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -105,7 +105,6 @@ define Device/Default KERNEL := kernel-bin | append-dtb | uImage none IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata - SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) UBINIZE_OPTS := -E 5 UBOOT := BOOT_SCRIPT := diff --git a/target/linux/omap/image/Makefile b/target/linux/omap/image/Makefile index ce6377f29b..24c22165c2 100644 --- a/target/linux/omap/image/Makefile +++ b/target/linux/omap/image/Makefile @@ -38,7 +38,6 @@ define Device/Default DEVICE_DTS = $(lastword $(subst _, ,$(1))) IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := omap-sdcard | append-metadata | gzip - SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) endef #uboot-omap-am335x_evm uboot-omap-omap3_beagle uboot-omap-omap3_overo uboot-omap-omap4_panda diff --git a/target/linux/oxnas/image/ox810se.mk b/target/linux/oxnas/image/ox810se.mk index b9bb5e7117..77bdcc7716 100644 --- a/target/linux/oxnas/image/ox810se.mk +++ b/target/linux/oxnas/image/ox810se.mk @@ -6,7 +6,6 @@ define Device/Default KERNEL_INSTALL := 1 FILESYSTEMS := squashfs ext4 PROFILES := Default - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) DEVICE_DTS := ox810se-$(subst _,-,$(1)) IMAGES := sysupgrade.tar IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata diff --git a/target/linux/oxnas/image/ox820.mk b/target/linux/oxnas/image/ox820.mk index a52e09786b..8dea842503 100644 --- a/target/linux/oxnas/image/ox820.mk +++ b/target/linux/oxnas/image/ox820.mk @@ -10,7 +10,6 @@ define Device/Default SUBPAGESIZE := 512 FILESYSTEMS := squashfs ubifs PROFILES := Default - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) DEVICE_DTS := ox820-$(subst _,-,$(1)) KERNEL := kernel-bin | append-dtb | uImage none IMAGES := ubinized.bin sysupgrade.tar diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index 4274c24884..2fb13dcf08 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -187,7 +187,6 @@ define Device/Default DEVICE_DTS = $$(SOC)_$(1) IMAGES := sysupgrade.bin COMPILE := - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) sysupgrade_bin := append-kernel | append-rootfs | pad-rootfs IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size endef diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile index 1251b47c93..87c616c3f2 100644 --- a/target/linux/realtek/image/Makefile +++ b/target/linux/realtek/image/Makefile @@ -13,7 +13,6 @@ define Device/Default KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | uImage gzip DEVICE_DTS_DIR := ../dts DEVICE_DTS = $$(SOC)_$(1) - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | append-rootfs | pad-rootfs | \ append-metadata | check-size diff --git a/target/linux/rockchip/image/Makefile b/target/linux/rockchip/image/Makefile index 3c17e963be..022661623a 100644 --- a/target/linux/rockchip/image/Makefile +++ b/target/linux/rockchip/image/Makefile @@ -52,7 +52,6 @@ define Device/Default PROFILES := Default KERNEL := kernel-bin IMAGES := sysupgrade.img.gz - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) DEVICE_DTS = rockchip/$$(SOC)-$(lastword $(subst _, ,$(1))) endef diff --git a/target/linux/sunxi/image/Makefile b/target/linux/sunxi/image/Makefile index 01e9742b46..572c0597e8 100644 --- a/target/linux/sunxi/image/Makefile +++ b/target/linux/sunxi/image/Makefile @@ -37,7 +37,6 @@ define Device/Default KERNEL := kernel-bin | uImage none IMAGES := sdcard.img.gz IMAGE/sdcard.img.gz := sunxi-sdcard | append-metadata | gzip - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) SUNXI_DTS_DIR := SUNXI_DTS = $$(SUNXI_DTS_DIR)$$(SOC)-$(lastword $(subst _, ,$(1))) endef diff --git a/target/linux/tegra/image/Makefile b/target/linux/tegra/image/Makefile index 71a5fc581d..97f97e3cc2 100644 --- a/target/linux/tegra/image/Makefile +++ b/target/linux/tegra/image/Makefile @@ -38,7 +38,6 @@ define Device/Default KERNEL_NAME := zImage KERNEL := kernel-bin PROFILES := Default - SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) endef define Device/compulab_trimslice