[PATCH] build: put DT "compatible" value as "board_name" in profiles.json

Rafał Miłecki zajec5 at gmail.com
Wed Jul 8 17:32:43 EDT 2020

On 08.07.2020 21:34, Paul Spooren wrote:
> I think there is a policy for new DT devices to use the compatible string as profile.
> Multiple targets contain the following line in the target Makefile, which automatically adds the profile name as supported device:
> SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
> So ideally for all devices using DT, the profile and compatible string are the same except for '_' replaced by ','.
> For instance, the "Linksys WRT3200ACM" has the profile ID `linksys_wrt3200acm` and the automatically added compatible string `linksys,wrt3200acm`. So if that device wanted to search the `mvebu/cortexa9/profiles.json` for available sysupgrades, it takes the first entry from /proc/device-tree/compatible, replaces ',' with '_' find images in profiles.json['profiles']['linksys_wrt3200acm']['images'].
> For cases where DT compatible and OpenWrt profile ID/name where different either one was patched[0].

There are still few exceptions like:
linksys-ea9500 vs. compatible = "linksys,panamera"
luxul-xwr-3150 vs. compatible = "luxul,xwr-3150-v1"
luxul-xbr-4500 vs. compatible = "luxul,xbr-4500-v1"

This is a bit of problem because:
1. I can't change "panamera" to "ea9500" as I was explicitly asked to
    stick to "panamera" by Imre when upstreaming that DTS
2. I don't want to rename "ea9500" to "panamera" to avoid:
    a. Confusing users
    b. Having meaningless filename

So this is mostly what my patch is about. Providing reliable matching
method that doesn't depend on profiles naming schema. I think adding
20 new lines of code for that purpose is reasonable.

> I think the question is therefore more on how to deal with devices that do not use DT? If we use a per device rootfs a line could be added to /etc/os-release containing something like OPENWRT_PROFILE="SpEcIaL-CaSEv100", which is then shown via `ubus call system borad`.
> Another hack could be to add it to /proc/cmdline?

I'd prefer to avoid forcing per device rootfs unless it's really
required. We already have $(board_name) that results in unique device
identifier on all (most?) targets. Let's stick to that and add matching
entry in image/Makefile.

My suggestion it to take existing Makefile entry like:

define Device/linksys-e900-v1
   DEVICE_ID := E900
   VERSION := 1.0.4

and simpliy add
   BOARD_NAME := Linksys E900 V1

to it (it matches cat /proc/cpuinfo | grep Machine).

More information about the openwrt-devel mailing list