diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-11-14 17:44:42 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2013-11-14 17:44:42 +0000 |
commit | 3e44099b61d1c1d0e420cd5e079f9092a03d3ec3 (patch) | |
tree | 660c3296656a54d334b05670774930e992c71ec0 /target/imagebuilder/Makefile | |
parent | 6bb46d75aaac5a9776011c3569527249fe06c386 (diff) | |
download | upstream-3e44099b61d1c1d0e420cd5e079f9092a03d3ec3.tar.gz upstream-3e44099b61d1c1d0e420cd5e079f9092a03d3ec3.tar.bz2 upstream-3e44099b61d1c1d0e420cd5e079f9092a03d3ec3.zip |
base-files: add macaddr_canonicalize helper function
In commit r38690, the MAC address canonicalization
has been converted to use 'tr' instead of 'printf'.
This only works if with MAC addresses which uses
the 'xx:xx:xx:xx:xx:xx' format.
However on some boards, the MAC addresses are stored
in different format in the mtd partition. Some vendors
are using hyphens or dots as separators instead of
colons. Also the leading zeroes may be missing from the
individual octets or those are replaced with spaces.
Add a new function which can be used to convert these
into the 'xx:xx:xx:xx:xx:xx' format. Also update the
'mtd_get_mac_ascii' function to use the new helper.
The helper function is based on this code:
http://isquared.nl/blog/2010/08/11/Bash-function-to-canonicalize-MAC-addresses/
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38803 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/imagebuilder/Makefile')
0 files changed, 0 insertions, 0 deletions