diff options
author | John Crispin <blogic@openwrt.org> | 2014-12-11 18:28:44 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-12-11 18:28:44 +0000 |
commit | 154f8ef0d814635d48950de09bc169106c00e8a1 (patch) | |
tree | 1651a0e95250e1e5f8a432cc2d8e280614b100da /target/linux/au1000/base-files/etc | |
parent | 6d4c68d262595377511bd91c4b543087245af5e8 (diff) | |
download | upstream-154f8ef0d814635d48950de09bc169106c00e8a1.tar.gz upstream-154f8ef0d814635d48950de09bc169106c00e8a1.tar.bz2 upstream-154f8ef0d814635d48950de09bc169106c00e8a1.zip |
au1000: distinguish different models and set correct MAC-address
The target au1000 has at least 2 different models, the
'InternetBox' and the 'MeshCube' which look very similar
from the kernel point of view but are totally different
devices which base on the same design. Populating /tmp/sysinfo
now. The 1st one has an issue which leads to a random
mac-address after each boot which is corrected now via
reading the bootloader-env. The real fix would be
converting to DTS, this is only a workaround now.
Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43626 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/au1000/base-files/etc')
-rwxr-xr-x | target/linux/au1000/base-files/etc/uci-defaults/02_network | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/target/linux/au1000/base-files/etc/uci-defaults/02_network b/target/linux/au1000/base-files/etc/uci-defaults/02_network new file mode 100755 index 0000000000..80bfb732d2 --- /dev/null +++ b/target/linux/au1000/base-files/etc/uci-defaults/02_network @@ -0,0 +1,17 @@ +#!/bin/sh + +. /lib/au1000.sh +. /lib/functions/system.sh +. /lib/functions/uci-defaults.sh +MAC= + +case "$(au1000_board_name)" in + 'internetbox') + MAC="$( au1000_yamonenv_getvar 'ethaddr' )" + MAC="$( macaddr_canonicalize "$MAC" )" + + [ -n "$MAC ] && ucidef_set_interface_macaddr lan "$MAC" + ;; +esac + +[ -z "$MAC" ] || uci commit network |