[OpenWrt-Devel] [PATCH 2/2] base-files: rename SSID with EUI of mac address

mail at adrianschmutzler.de mail at adrianschmutzler.de
Sun Nov 10 16:01:11 EST 2019


Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of Jonas Gorski
> Sent: Samstag, 9. November 2019 13:57
> To: mail at adrianschmutzler.de
> Cc: OpenWrt Development List <openwrt-devel at lists.openwrt.org>; Rosy
> Song <rosysong at rosinson.com>
> Subject: Re: [OpenWrt-Devel] [PATCH 2/2] base-files: rename SSID with EUI
> of mac address
> 
> On Sat, 9 Nov 2019 at 12:04, <mail at adrianschmutzler.de> wrote:
> >
> > Hi,
> >
> > > -----Original Message-----
> > > From: Jonas Gorski [mailto:jonas.gorski at gmail.com]
> > > Sent: Samstag, 9. November 2019 10:37
> > > To: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> > > Cc: OpenWrt Development List <openwrt-devel at lists.openwrt.org>;
> Rosy
> > > Song <rosysong at rosinson.com>
> > > Subject: Re: [OpenWrt-Devel] [PATCH 2/2] base-files: rename SSID
> > > with EUI of mac address
> > >
> > > On Fri, 8 Nov 2019 at 12:49, Adrian Schmutzler
> > > <freifunk at adrianschmutzler.de> wrote:
> > > >
> > > > If the label MAC address is provided for a device, the default
> > > > SSID will be set to contain the EUI of this address, e.g. OpenWrt-ddeeff.
> > > >
> > > > With multiple routers, this will help the user to identify his
> > > > device based on the MAC address printed on the device.
> > > >
> > > > If no label MAC address is specified, this will use "OpenWrt" as
> > > > done before.
> > > >
> > > > Using a uci-defaults script for this is necessary as mac80211.sh
> > > > is executed before /etc/board.json is created, so label MAC
> > > > addresses set in 02_network would not be available there.
> > >
> > > Unfortunately since we detect wifi async these days this is quite
> > > racy, and there is no guarantee /etc/config/wireless is fully
> > > populated by the time the uci defaults are run. E.g. mwl8k takes
> > > quite a while since it uses different firmwares for STA and AP
> > > modes, and it needs to re-initialize to switch between them
> > > (triggered by by mac80211.sh trying to detect the supporte features).
> >
> > So, in the end, it might be like Manuel Giganto suggested in GitHub
> > and one might either have to wait in mac80211.sh until /etc/board.json
> > is available (ugly) or just put the same code (the few lines of SSID change)
> in both locations (uci_defaults AND mac80211.sh).
> 
> How about just generating the board.json at an earlier time before loading
> the wifi drivers, so it's always there once mac80211.sh runs?

in principle, yes. Thanks for this idea.

However, we have to be careful to not break anything in 02_network, e.g.
using $(cat /sys/class/net/eth0/address) or similar when we become too early.

I do not really have an overview of _all_ targets and what they do in 02_network or similar board.d files.

Despite, I introduced $(cat /sys/class/ieee80211/phy0/macaddress) retrieval into 02_network as workaround for the MAC address. However, I will try to change those lines to point to the proper original sources of the addresses.

> 
> We already generate it in preinit (unless failsafe is disabled) to configure the
> switch and find the proper lan if, we might as well make it unconditional and
> then rely on it for mac80211.sh.

Where would you put it?

Best

Adrian

> 
> 
> Regards
> Jonas
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
-------------- 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.infradead.org/pipermail/openwrt-devel/attachments/20191110/194c1dd3/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list