Skip to content
Snippets Groups Projects
Unverified Commit fd3ecea9 authored by David Bauer's avatar David Bauer Committed by GitHub
Browse files

gluon-core: use OpenWrt label-mac as fallback (#2170)


This adds the OpenWrt label-mac device selection as the most preferred
fallback.

While this is only used on OpenWrt 19.07 for backports, we can also use
the label-mac device when backporting device support. This way, we have
to deal with less device-sepcific code downstream.

Signed-off-by: default avatarDavid Bauer <mail@david-bauer.net>
parent 7320603a
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
. /lib/functions/system.sh
get_mac_label
......@@ -54,6 +54,19 @@ local function interface(name)
end
end
local function label_mac()
return function()
local mac = util.exec('/lib/gluon/label_mac.sh')
if mac == nil then return nil end
mac = util.trim(mac)
if string.len(mac) ~= 17 then return nil end
return mac
end
end
-- Entries are matched in the order they are listed
local primary_addrs = {
......@@ -148,6 +161,10 @@ local primary_addrs = {
'dir-860l-b1',
}},
}},
-- label-mac-device default
{label_mac(), {
{}, -- matches everything
}},
-- phy0 default
{phy(0), {
{}, -- matches everything
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment