treewide: provide global default for SUPPORTED_DEVICES

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@adrianschmutzler.de>
Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
This commit is contained in:
Adrian Schmutzler 2021-01-19 20:05:35 +01:00 committed by CN_SZTL
parent 5a2cbf522c
commit 75697c9c12
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
15 changed files with 1 additions and 15 deletions

View File

@ -437,7 +437,7 @@ define Device/Init
BOARD_NAME :=
UIMAGE_NAME :=
SUPPORTED_DEVICES :=
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
IMAGE_METADATA :=
FILESYSTEMS := $(TARGET_FILESYSTEMS)

View File

@ -116,7 +116,6 @@ define Device/Default
KERNEL_ENTRY := 0x00000000
KERNEL_LOADADDR := 0x00000000
DEVICE_DTS_DIR := ../dts
SUPPORTED_DEVICES = $(subst _,$(comma),$(1))
endef
ifeq ($(SUBTARGET),nand)

View File

@ -62,7 +62,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

View File

@ -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

View File

@ -11,7 +11,6 @@ define Device/Default
KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
KERNEL_PREFIX := $$(IMAGE_PREFIX)
KERNEL_LOADADDR := 0x80208000
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
IMAGE/sysupgrade.bin/squashfs :=

View File

@ -16,7 +16,6 @@ define Device/Default
KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
KERNEL_PREFIX := $$(IMAGE_PREFIX)
KERNEL_LOADADDR = 0x42208000
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
IMAGE/sysupgrade.bin = sysupgrade-tar | append-metadata
IMAGE/sysupgrade.bin/squashfs :=
endef

View File

@ -24,7 +24,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/cisco_on100

View File

@ -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

View File

@ -38,7 +38,6 @@ define Device/Default
DEVICE_DTS_DIR := $(DTS_DIR)
IMAGES := sysupgrade.bin
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
ifeq ($(SUBTARGET),mt7623)
KERNEL_NAME := zImage
KERNEL := kernel-bin | append-dtb | uImage none

View File

@ -85,7 +85,6 @@ define Device/Default
IMAGES := sysupgrade.bin
IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE)
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
SUPPORTED_DEVICES = $(subst _,$(comma),$(1))
UBINIZE_OPTS := -E 5
UBOOT :=
BOOT_SCRIPT :=

View File

@ -38,7 +38,6 @@ define Device/Default
KERNEL := kernel-bin
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

View File

@ -11,7 +11,6 @@ define Device/Default
SUBPAGESIZE := 512
FILESYSTEMS := squashfs ubifs
PROFILES = Default $$(DTS)
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
DEVICE_DTS := ox820-$(subst _,-,$(1))
KERNEL := kernel-bin | append-dtb | uImage none
IMAGES := ubinized.bin sysupgrade.tar

View File

@ -27,7 +27,6 @@ define Device/Default
DEVICE_DTS_DIR := ../dts
DEVICE_DTS = $$(SOC)_$(1)
IMAGES := sysupgrade.bin
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

View File

@ -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

View File

@ -41,7 +41,6 @@ define Device/Default
KERNEL_NAME := zImage
KERNEL := kernel-bin
PROFILES := Default
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
endef
define Device/compulab_trimslice