Changeset 21647


Ignore:
Timestamp:
2010-06-01T16:41:37+02:00 (7 years ago)
Author:
nbd
Message:

orion: fix lan and wan mac address for wrt530n v2 (patch by maddes from #7113)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/orion/base-files/etc/uci-defaults/hardware

    r20185 r21647  
    2929commit system 
    3030__EOF 
     31 
     32# add mac address from U-Boot partition to lan and wan devices 
     33        MTD=`grep -e 'u-boot' /proc/mtd` 
     34        MTD=`echo ${MTD} | sed 's/[a-z]*\([0-9]*\):.*/\1/'` 
     35        [ -n "${MTD}" ] && { 
     36                MACADDR=`dd if=/dev/mtdblock${MTD} bs=1 skip=262048 count=6 2>/dev/null | hexdump -e '1/1 "%02x"'` 
     37                MACADDR2=$(( 0x${MACADDR} + 1)) 
     38                MACADDR2=`printf "%012x" ${MACADDR2}` 
     39 
     40                MACADDR=`echo ${MACADDR} | sed 's/\(..\)/\1:/g' | sed 's/:$//'` 
     41                MACADDR2=`echo ${MACADDR2} | sed 's/\(..\)/\1:/g' | sed 's/:$//'` 
     42 
     43                uci set network.eth0.macaddr=${MACADDR} 
     44                uci set network.lan.macaddr=${MACADDR} 
     45                uci set network.wan.macaddr=${MACADDR2} 
     46                uci commit network 
     47        } 
    3148} 
    3249 
Note: See TracChangeset for help on using the changeset viewer.