3 # Copyright (C) 2010 OpenWrt.org
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
10 # This script sets system defaults for the hardware on firstboot
13 local hardware
=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
18 set system.power_led=led
19 set system.power_led.name='Power LED (green)'
20 set system.power_led.sysfs='wrt350nv2:green:power'
21 set system.power_led.default='1'
22 set system.wifi_led=led
23 set system.wifi_led.name='Wireless LED (green)'
24 set system.wifi_led.sysfs='wrt350nv2:green:wireless'
25 set system.wifi_led.trigger='netdev'
26 set system.wifi_led.dev='wlan0'
27 set system.wifi_led.mode='link tx rx'
28 set system.wifi_led.default='0'
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/'`
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}`
40 MACADDR
=`echo ${MACADDR} | sed 's/\(..\)/\1:/g' | sed 's/:$//'`
41 MACADDR2
=`echo ${MACADDR2} | sed 's/\(..\)/\1:/g' | sed 's/:$//'`
43 uci
set network.eth0.macaddr
=${MACADDR}
44 uci
set network.lan.macaddr
=${MACADDR}
45 uci
set network.wan.macaddr
=${MACADDR2}
This page took 0.051162 seconds and 5 git commands to generate.