diff options
author | Roman Yeryomin <roman@advem.lv> | 2018-04-29 19:07:05 +0300 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-05-05 06:57:00 +0200 |
commit | 6409b159e8b84e172da7755088d587ccd99103ab (patch) | |
tree | b63ecbe74f57c42d40c852d3772c965bd465da6e /target/linux/gemini/base-files/lib | |
parent | 20d0dace40b74b098309cefb29a1ce5d57988e7e (diff) | |
download | upstream-6409b159e8b84e172da7755088d587ccd99103ab.tar.gz upstream-6409b159e8b84e172da7755088d587ccd99103ab.tar.bz2 upstream-6409b159e8b84e172da7755088d587ccd99103ab.zip |
gemini: switch to 4.14
This introduces Device/ infrastructure and images
for all boards available upstream.
Changes from Linus submitted version:
- fix Raidsonic image generation
- remove redundant (old) image generation
- remove redundant header tool for dns313 board
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Diffstat (limited to 'target/linux/gemini/base-files/lib')
-rw-r--r-- | target/linux/gemini/base-files/lib/preinit/05_set_ether_mac_gemini | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/target/linux/gemini/base-files/lib/preinit/05_set_ether_mac_gemini b/target/linux/gemini/base-files/lib/preinit/05_set_ether_mac_gemini index 499608120e..1ce5c8067e 100644 --- a/target/linux/gemini/base-files/lib/preinit/05_set_ether_mac_gemini +++ b/target/linux/gemini/base-files/lib/preinit/05_set_ether_mac_gemini @@ -1,13 +1,28 @@ #!/bin/sh set_ether_mac() { + # Most devices have a standard "VCTL" partition CONFIG_PARTITION="$(grep "VCTL" /proc/mtd | cut -d: -f1)" - MAC1="$(strings /dev/$CONFIG_PARTITION |grep MAC|cut -d: -f2|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')" - MAC2="$(strings /dev/$CONFIG_PARTITION |grep MAC|cut -d: -f8|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')" + if [ ! -z $CONFIG_PARTITION ] ; then + MAC1="$(strings /dev/$CONFIG_PARTITION |grep MAC|cut -d: -f2|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')" + MAC2="$(strings /dev/$CONFIG_PARTITION |grep MAC|cut -d: -f8|cut -c3-14|sed -e 's,\(..\),:\1,g' -e 's,^:,,')" - ifconfig eth0 hw ether $MAC1 2>/dev/null - ifconfig eth1 hw ether $MAC2 2>/dev/null + ifconfig eth0 hw ether $MAC1 2>/dev/null + ifconfig eth1 hw ether $MAC2 2>/dev/null + return 0 + fi + + # The DNS-313 has a special field in its RedBoot + # binary that we need to check + CONFIG_PARTITION="$(grep "RedBoot" /proc/mtd | cut -d: -f1)" + if [ ! -z $CONFIG_PARTITION ] ; then + DEVID="$(dd if=/dev/mtdblock0 bs=1 skip=119508 count=7 2>/dev/null)" + if [ "x$DEVID" = "xdns-313" ] ; then + MAC1="$(dd if=/dev/mtdblock0 bs=1 skip=119540 count=6 2>/dev/null | hexdump -n6 -e '/1 ":%02X"' | sed s/^://g)" + ifconfig eth0 hw ether $MAC1 2>/dev/null + return 0 + fi + fi } boot_hook_add preinit_main set_ether_mac - |