local MAC1
local MAC2
+ case "$(board_name)" in
+ dlink,dns-313)
+ # The DNS-313 has a special field in its RedBoot
+ # binary that we need to check
+ part="$(find_mtd_part RedBoot)"
+ if [ -n "$part" ]; then
+ DEVID="$(dd if=$part bs=1 skip=119508 count=7 2>/dev/null)"
+ if [ "$DEVID" = "dns-313" ]; then
+ MAC1="$(mtd_get_mac_binary RedBoot 119540)"
+ ip link set eth0 address "$MAC1" 2>/dev/null
+ return 0
+ fi
+ fi
+ ;;
+ esac
+
# Most devices have a standard "VCTL" partition
part="$(find_mtd_part VCTL)"
if [ -n "$part" ]; then
ip link set eth1 address "$MAC2" 2>/dev/null
return 0
fi
-
- # The DNS-313 has a special field in its RedBoot
- # binary that we need to check
- part="$(find_mtd_part RedBoot)"
- if [ -n "$part" ]; then
- DEVID="$(dd if=$part bs=1 skip=119508 count=7 2>/dev/null)"
- if [ "$DEVID" = "dns-313" ]; then
- MAC1="$(mtd_get_mac_binary RedBoot 119540)"
- ip link set eth0 address "$MAC1" 2>/dev/null
- return 0
- fi
- fi
}
boot_hook_add preinit_main set_ether_mac