[PATCH] treewide: provide global default for SUPPORTED_DEVICES

Adrian Schmutzler freifunk at adrianschmutzler.de
Tue Jan 19 14:49:12 EST 2021


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 <freifunk at adrianschmutzler.de>
---
 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
-- 
2.20.1




More information about the openwrt-devel mailing list