Changeset 17124


Ignore:
Timestamp:
2009-08-04T19:45:00+02:00 (7 years ago)
Author:
juhosg
Message:

[ar71xx] init mac address on the WRT160NL board (thanks to Gerry Rozema for testing)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/base-files/etc/preinit.arch

    r17100 r17124  
    55. /lib/ar71xx.sh 
    66 
    7 tew632brp_init_mac_address() { 
     7fetch_mac_from_mtd() { 
     8        local mtd_part=$1 
     9        local lan_env=$2 
     10        local wan_env=$3 
    811        local mtd mac 
    912 
    10         mtd=$(grep config /proc/mtd | cut -d: -f1) 
     13        mtd=$(grep $mtd_part /proc/mtd | cut -d: -f1) 
    1114        [ -z $mtd ] && return 
    1215 
    13         mac=$(grep lan_mac /dev/$mtd | cut -d= -f2) 
     16        mac=$(grep $lan_env /dev/$mtd | cut -d= -f2) 
    1417        [ ! -z $mac ] && ifconfig eth0 hw ether $mac 2>/dev/null 
    1518 
    16         mac=$(grep wan_mac /dev/$mtd | cut -d= -f2) 
     19        mac=$(grep $wan_env /dev/$mtd | cut -d= -f2) 
    1720        [ ! -z $mac ] && ifconfig eth1 hw ether $mac 2>/dev/null 
    1821} 
     
    2023case $(ar71xx_board_name) in 
    2124        tew-632brp) 
    22                 tew632brp_init_mac_address 
     25                fetch_mac_from_mtd config lan_mac wan_mac 
     26                ;; 
     27        wrt160nl) 
     28                fetch_mac_from_mtd nvram lan_hwaddr wan_hwaddr 
    2329                ;; 
    2430esac 
Note: See TracChangeset for help on using the changeset viewer.