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

mail at adrianschmutzler.de mail at adrianschmutzler.de
Fri Jul 10 09:32:50 EDT 2020


> -----Original Message-----
> From: Rafał Miłecki [mailto:zajec5 at gmail.com]
> Sent: Mittwoch, 8. Juli 2020 23:40
> To: mail at adrianschmutzler.de; 'Paul Spooren' <mail at aparcar.org>; openwrt-
> devel at lists.openwrt.org
> Cc: 'Rafał Miłecki' <rafal at milecki.pl>; 'Adrian Schmutzler'
> <freifunk at adrianschmutzler.de>; 'Petr Štetiar' <ynezz at true.cz>; 'Moritz
> Warning' <moritzwarning at web.de>; 'Daniel Golle' <daniel at makrotopia.org>
> Subject: Re: [PATCH] build: put DT "compatible" value as "board_name" in
> profiles.json
> 
> On 08.07.2020 21:41, mail at adrianschmutzler.de wrote:
> >> -----Original Message-----
> >> From: Paul Spooren [mailto:mail at aparcar.org]
> >> Sent: Mittwoch, 8. Juli 2020 21:34
> >> To: Rafał Miłecki <zajec5 at gmail.com>; openwrt-devel at lists.openwrt.org
> >> Cc: Rafał Miłecki <rafal at milecki.pl>; Adrian Schmutzler
> >> <freifunk at adrianschmutzler.de>; Petr Štetiar <ynezz at true.cz>; Moritz
> >> Warning <moritzwarning at web.de>; Daniel Golle
> <daniel at makrotopia.org>
> >> Subject: Re: [PATCH] build: put DT "compatible" value as "board_name"
> >> in profiles.json
> >>
> >> 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`.
> >
> > Well, one could just use something like this, which we had before the
> compatible was used:
> >
> > https://github.com/openwrt/openwrt/blob/openwrt-
> 19.07/target/linux/ram
> > ips/base-files/lib/ramips.sh
> 
> That's exactly what I was thinking about. That file does:
> echo "$name" > /tmp/sysinfo/board_name
> which means device-specific identifier will appear as $(board_name)
> 
> 
> > There, one could just use the "profile names" instead, with "_" replaced by
> "," for the few non-DT targets.
> > However, this assumes a 1-to-1 relation between boards and profiles, and
> I'm not sure whether that always exists.
> > And somebody would have to create that by hand.
> 
> Right. That list should be easy to verify by looking at Makefile and platform.sh
> / ramips.sh.
> 
> 
> > But I somehow lost track what's the ultimate goal of the proposed changes
> here, so maybe I'm not going into the right direction with this.
> 
> I described it shortly in commit message as:
> 
>  > The purpose of "board_name" in JSON is matchine OpenWrt running
> device  > with JSON profile entry.
> 
> More details: we are working on firmware updating apps that find device
> appropriate firmware automatically. See luci-app-attendedsysupgrade for
> example.
> 
> We need a way for such apps to:
> 1. Get device identifier (like $(board_name)) 2. Easily find matching firmware
> in profiles.json using above identifier

I just had a look into bcm47xx.

Is my observation correct that, at least for mips74k subtarget, there also are multiple profiles for the same board, e.g.

define Device/netgear-wnr3500l-v2
  DEVICE_MODEL := WNR3500L
  DEVICE_VARIANT := v2
  DEVICE_PACKAGES := $(USB2_PACKAGES)
  $(Device/netgear)
  NETGEAR_BOARD_ID := U12H172T00_NETGEAR
  NETGEAR_REGION := 1
endef
TARGET_DEVICES += netgear-wnr3500l-v2

define Device/netgear-wnr3500-v2
  DEVICE_MODEL := WNR3500
  DEVICE_VARIANT := v2
  DEVICE_PACKAGES := kmod-b43
  $(Device/netgear)
  NETGEAR_BOARD_ID := U12H127T00_NETGEAR
  NETGEAR_REGION := 2
endef
TARGET_DEVICES += netgear-wnr3500-v2

Do these really only differ in packages and region, or is there a parameter to determine which is used from the running device?

Best

Adrian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.openwrt.org/pipermail/openwrt-devel/attachments/20200710/d342d5a8/attachment.sig>


More information about the openwrt-devel mailing list