[x86] add required symbols to allow building of 2.6.35.7
[openwrt.git] / target / linux / orion / base-files / etc / uci-defaults / hardware
1 #!/bin/sh
2 #
3 # Copyright (C) 2010 OpenWrt.org
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 #
10 # This script sets system defaults for the hardware on firstboot
11 #
12
13 local hardware=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
14
15 wrt350nv2_default() {
16 # leds
17 uci batch <<__EOF
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'
29 commit system
30 __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 }
48 }
49
50 case "${hardware}" in
51 'Linksys WRT350N v2')
52 wrt350nv2_default
53 ;;
54 esac
This page took 0.051162 seconds and 5 git commands to generate.