diff options
Diffstat (limited to 'target/linux/mediatek/base-files/etc')
11 files changed, 1290 insertions, 0 deletions
diff --git a/target/linux/mediatek/base-files/etc/config/fstab b/target/linux/mediatek/base-files/etc/config/fstab new file mode 100644 index 0000000..c984b93 --- /dev/null +++ b/target/linux/mediatek/base-files/etc/config/fstab @@ -0,0 +1,16 @@ +config 'global' + option anon_swap '0' + option anon_mount '1' + option auto_swap '1' + option auto_mount '1' + option delay_root '5' + option check_fs '0' + +config 'mount' + option target '/mnt/sd*' + option enabled '1' + +config 'mount' + option target '/mnt/mmcblk*' + option enabled '1' + diff --git a/target/linux/mediatek/base-files/etc/diag.sh b/target/linux/mediatek/base-files/etc/diag.sh new file mode 100755 index 0000000..74b8867 --- /dev/null +++ b/target/linux/mediatek/base-files/etc/diag.sh @@ -0,0 +1,213 @@ +#!/bin/sh +# Copyright (C) 2010-2013 OpenWrt.org + +. /lib/functions/leds.sh +. /lib/ramips.sh + +get_status_led() { + case $(ramips_board_name) in + 3g-6200n) + status_led="edimax:green:power" + ;; + 3g300m | w150m) + status_led="tenda:blue:ap" + ;; + ar725w) + status_led="ar725w:green:power" + ;; + awapn2403) + status_led="asiarf:green:wps" + ;; + argus-atp52b) + status_led="argus-atp52b:green:run" + ;; + asl26555) + status_led="asl26555:green:power" + ;; + br6524n) + status_led="edimax:blue:power" + ;; + br6425 | br-6475nd) + status_led="edimax:green:power" + ;; + cy-swr1100) + status_led="samsung:blue:wps" + ;; + d105) + status_led="d105:red:power" + ;; + dcs-930 | dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-610-a1 | dir-615-h1 | dir-615-d | dir-620-a1| dir-620-d1| dir-300-b7| dir-320-b1) + status_led="d-link:green:status" + ;; + dir-645) + status_led="d-link:green:wps" + ;; + dap-1350) + status_led="d-link:blue:power" + ;; + esr-9753) + status_led="esr-9753:orange:power" + ;; + f5d8235-v2) + status_led="f5d8235v2:blue:router" + ;; + fonera20n) + status_led="fonera20n:green:power" + ;; + ip2202) + status_led="ip2202:green:run" + ;; + rt-n13u) + status_led="rt-n13u:power" + ;; + hlk-rm04) + status_led="hlk-rm04:red:power" + ;; + all0239-3g|\ + hw550-3g) + status_led="hw550-3g:green:status" + ;; + m3) + status_led="m3:blue:status" + ;; + m4) + status_led="m4:blue:status" + ;; + mlw221|\ + mlwg2) + status_led="kingston:blue:system" + ;; + mofi3500-3gn) + status_led="mofi3500-3gn:green:status" + ;; + mpr-a1) + status_led="hame:red:power" + ;; + mpr-a2) + status_led="hame:red:power" + ;; + nbg-419n) + status_led="nbg-419n:green:power" + ;; + nw718) + status_led="nw718:amber:cpu" + ;; + omni-emb|\ + omni-emb-hpm) + status_led="emb:green:status" + ;; + psr-680w) + status_led="psr-680w:red:wan" + ;; + pwh2004) + status_led="pwh2004:green:power" + ;; + px4885) + status_led="7links:orange:wifi" + ;; + rt-n15) + status_led="rt-n15:blue:power" + ;; + rt-n10-plus) + status_led="asus:green:wps" + ;; + rt-n56u | wl-330n | wl-330n3g) + status_led="asus:blue:power" + ;; + rut5xx) + status_led="rut5xx:green:status" + ;; + sl-r7205) + status_led="sl-r7205:green:status" + ;; + tew-691gr|\ + tew-692gr) + status_led="trendnet:green:wps" + ;; + v11st-fe) + status_led="v11st-fe:green:status" + ;; + v22rw-2x2) + status_led="v22rw-2x2:green:security" + ;; + vocore) + status_led="vocore:green:status" + ;; + w306r-v20) + status_led="w306r-v20:green:sys" + ;; + w502u) + status_led="alfa:blue:wps" + ;; + wcr-150gn) + status_led="wcr150gn:amber:power" + ;; + whr-g300n) + status_led="whr-g300n:green:router" + ;; + wmr300 | \ + whr-300hp2 | \ + whr-600d) + status_led="buffalo:green:status" + ;; + wli-tx4-ag300n) + status_led="buffalo:blue:power" + ;; + wl-351) + status_led="wl-351:amber:power" + ;; + wr512-3gn) + status_led="wr512:green:wps" + ;; + wr8305rt) + status_led="wr8305rt:sys" + ;; + wnce2001) + status_led="netgear:green:power" + ;; + mzk-w300nh2) + status_led="mzkw300nh2:green:power" + ;; + ur-326n4g) + status_led="ur326:green:wps" + ;; + ur-336un) + status_led="ur336:green:wps" + ;; + x5) + status_led="x5:green:power" + ;; + x8) + status_led="x8:green:power" + ;; + xdxrn502j) + status_led="xdxrn502j:green:power" + ;; + f7c027) + status_led="belkin:orange:status" + ;; + na930) + status_led="na930:blue:power" + ;; + y1 | \ + y1s) + status_led="lenovo:blue:power" + ;; + esac +} + +set_state() { + get_status_led + + case "$1" in + preinit) + status_led_blink_preinit + ;; + failsafe) + status_led_blink_failsafe + ;; + done) + status_led_on + ;; + esac +} diff --git a/target/linux/mediatek/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/mediatek/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom new file mode 100755 index 0000000..2a5a80c --- /dev/null +++ b/target/linux/mediatek/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom @@ -0,0 +1,50 @@ +#!/bin/sh + +rt2x00_eeprom_die() { + echo "rt2x00 eeprom: " "$*" + exit 1 +} + +rt2x00_eeprom_extract() { + local part=$1 + local offset=$2 + local count=$3 + local mtd + + . /lib/functions.sh + + mtd=$(find_mtd_part $part) + [ -n "$mtd" ] || \ + rt2x00_eeprom_die "no mtd device found for partition $part" + + dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ + rt2x00_eeprom_die "failed to extract from $mtd" +} + +FW="/lib/firmware/$FIRMWARE" +[ -e "$FW" ] && exit 0 + +. /lib/ramips.sh + +board=$(ramips_board_name) + +case "$FIRMWARE" in +"soc_wmac.eeprom") + case $board in + *) + rt2x00_eeprom_die "Please define mtd-eeprom in $board DTS file!" + ;; + esac + ;; + +"rt2x00pci_1_0.eeprom") + case $board in + cy-swr1100) + rt2x00_eeprom_extract "factory" 8192 512 + ;; + rt-n56u | whr-600d | whr-1166d) + rt2x00_eeprom_extract "factory" 32768 512 + ;; + esac + ;; +esac diff --git a/target/linux/mediatek/base-files/etc/hotplug.d/usb/10-motion b/target/linux/mediatek/base-files/etc/hotplug.d/usb/10-motion new file mode 100755 index 0000000..557698b --- /dev/null +++ b/target/linux/mediatek/base-files/etc/hotplug.d/usb/10-motion @@ -0,0 +1 @@ +[ "$ACTION" == "motion" ] && logger webcam motion event diff --git a/target/linux/mediatek/base-files/etc/inittab b/target/linux/mediatek/base-files/etc/inittab new file mode 100755 index 0000000..7817185 --- /dev/null +++ b/target/linux/mediatek/base-files/etc/inittab @@ -0,0 +1,3 @@ +::sysinit:/etc/init.d/rcS S boot +::shutdown:/etc/init.d/rcS K shutdown +::askconsole:/bin/ash --login diff --git a/target/linux/mediatek/base-files/etc/uci-defaults/01_leds b/target/linux/mediatek/base-files/etc/uci-defaults/01_leds new file mode 100755 index 0000000..5d6ed2b --- /dev/null +++ b/target/linux/mediatek/base-files/etc/uci-defaults/01_leds @@ -0,0 +1,217 @@ +#!/bin/sh + +. /lib/functions/uci-defaults.sh +. /lib/ramips.sh + +set_usb_led() { + ucidef_set_led_usbdev "usb" "USB" "$1" "1-1" +} + +set_wifi_led() { + ucidef_set_led_netdev "wifi_led" "wifi" "$1" "wlan0" +} + +board=$(ramips_board_name) + +case $board in + 3g-6200n) + set_wifi_led "edimax:amber:wlan" + set_usb_led "edimax:blue:3g" + ;; + 3g-6200nl) + set_wifi_led "edimax:green:wlan" + ;; + 3g300m) + set_usb_led "tenda:blue:3g" + ;; + air3gii) + set_wifi_led "airlive:green:wlan" + set_usb_led "airlive:green:mobile" + ;; + all0256n) + ucidef_set_rssimon "wlan0" "40000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "all0256n:green:rssilow" "wlan0" "1" "40" "0" "6" + ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "all0256n:green:rssimed" "wlan0" "30" "80" "-29" "5" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "all0256n:green:rssihigh" "wlan0" "70" "100" "-69" "8" + set_wifi_led "rt2800pci-phy0::radio" + ;; + awapn2403) + set_wifi_led "rt2800soc-phy0::radio" + ;; + ar725w) + set_wifi_led "rt2800soc-phy0::radio" + ;; + asl26555) + ucidef_set_led_default "power" "POWER" "asl26555:green:power" "1" + ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0" + set_wifi_led "asl26555:green:wlan" + set_usb_led "asl26555:green:3g" + ;; + bc2) + set_usb_led "bc2:blue:usb" + ;; + br6425) + set_wifi_led "edimax:orange:wlan" + ;; + br-6475nd) + set_wifi_led "edimax:amber:wlan" + ;; + broadway) + set_usb_led "red:diskmounted" + set_wifi_led "red:wps_active" + ;; + br6524n) + set_wifi_led "edimax:blue:wlan" + ;; + cy-swr1100) + ucidef_set_led_default "wps" "WPS" "samsung:blue:wps" "0" + set_usb_led "samsung:blue:usb" + ;; + d105) + ucidef_set_led_default "power" "POWER" "d105:red:power" "1" + set_usb_led "d105:green:usb" + ;; + dir-300-b1|\ + dir-600-b1|\ + dir-600-b2|\ + dir-620-a1) + # ANDed with vlan switch port 4 led state + ucidef_set_led_default "wan" "WAN LED (amber)" "d-link:amber:wan" "1" + set_wifi_led "rt2800pci-phy0::radio" + ;; + dir-615-d|\ + dir-615-h1) + ucidef_set_led_default "status" "Status LED (amber)" "d-link:amber:status" "0" + set_wifi_led "rt2800pci-phy0::radio" + ;; + dir-620-d1) + set_wifi_led "d-link:green:wifi" + ;; + dir-810l) + ucidef_set_led_default "power" "POWER" "dlink:green:power" "1" + ;; + dir-610-a1 |\ + dir-300-b7 |\ + dir-320-b1 |\ + esr-9753) + set_wifi_led "rt2800pci-phy0::radio" + ;; + f5d8235-v1) + set_usb_led "f5d8235-v1:blue:storage" + ;; + f5d8235-v2) + set_usb_led "f5d8235v2:blue:storage" + ;; + fonera20n) + set_usb_led "fonera20n:orange:usb" + set_wifi_led "fonera20n:orange:wifi" + ;; + hlk-rm04) + set_wifi_led "rt2800pci-phy0::radio" + ;; + all0239-3g|\ + hw550-3g) + set_usb_led "hw550-3g:green:usb" + ;; + mlw221|\ + mlwg2) + set_wifi_led "kingston:blue:wifi" + ucidef_set_led_default "system" "system" "kingston:blue:system" "1" + ;; + mofi3500-3gn) + set_usb_led "mofi3500-3gn:green:usb" + ;; + mpr-a1) + set_wifi_led "hame:blue:system" + ;; + mpr-a2) + set_wifi_led "hame:blue:system" + ;; + mzk-w300nh2) + set_wifi_led "mzkw300nh2:amber:wlan" + ;; + na930) + set_usb_led "na930:blue:status" + ;; + nw718) + set_usb_led "nw718:amber:usb" + ;; + omni-emb-hpm) + ucidef_set_led_default "power" "POWER" "emb:orange:power" "1" + ucidef_set_led_netdev "eth" "ETH" "emb:green:eth" "eth0" + set_wifi_led "emb:green:wifi" + ;; + omni-plug) + set_wifi_led "miniplug:green:wlan" + set_usb_led "miniplug:green:mobile" + ;; + px4885) + set_wifi_led "7links:orange:wifi" + set_usb_led "7links:blue:storage" + ;; + sl-r7205) + set_wifi_led "rt2800pci-phy0::radio" + ;; + v11st-fe) + set_wifi_led "rt2800pci-phy0::radio" + ;; + vocore) + ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0" + set_wifi_led "vocore:green:status" + ;; + w306r-v20) + set_wifi_led "rt2800pci-phy0::radio" + ;; + w502u) + set_usb_led "alfa:blue:usb" + set_wifi_led "rt2800pci-phy0::radio" + ;; + wcr-150gn) + set_usb_led "wcr150gn:amber:user" + ;; + hg255d) + set_wifi_led "hg255d:wlan" + set_usb_led "hg255d:usb" + ucidef_set_led_netdev "eth" "Internet" "hg255d:internet" "eth0.2" + ;; + wnce2001) + set_wifi_led "netgear:green:wlan" + ;; + rt-n14u) + ucidef_set_led_default "power" "power" "asus:blue:power" "1" + ucidef_set_led_netdev "lan" "lan" "asus:blue:lan" "eth0.1" + ucidef_set_led_netdev "wan" "wan" "asus:blue:wan" "eth0.2" + set_wifi_led "asus:blue:air" + set_usb_led "asus:blue:usb" + ;; + rp-n53) + ucidef_set_led_netdev "eth" "Network" "asus:white:back" "eth0" + set_wifi_led "asus:blue:wifi" + ;; + whr-300hp2 |\ + whr-600d |\ + whr-1166d) + ucidef_set_led_default "power" "power" "buffalo:green:power" "1" + ucidef_set_led_default "router" "router" "buffalo:green:router" "1" + ;; + zbt-wa05) + ucidef_set_led_default "power" "power" "zbtlink:blue:power" "1" + set_wifi_led "zbtlink:blue:air" + set_usb_led "zbtlink:blue:usb" + ;; + wr8305rt) + ucidef_set_led_default "power" "power" "wr8305rt:sys" "1" + set_usb_led "wr8305rt:usb" + set_wifi_led "wr8305rt:wifi" + ;; + y1 |\ + y1s) + ucidef_set_led_default "power" "power" "lenovo:blue:power" "1" + set_usb_led "lenovo:blue:usb" + set_wifi_led "lenovo:blue:wifi" + ;; +esac + +ucidef_commit_leds + +exit 0 diff --git a/target/linux/mediatek/base-files/etc/uci-defaults/02_network b/target/linux/mediatek/base-files/etc/uci-defaults/02_network new file mode 100755 index 0000000..f3d6e87 --- /dev/null +++ b/target/linux/mediatek/base-files/etc/uci-defaults/02_network @@ -0,0 +1,322 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/ramips.sh +. /lib/functions/uci-defaults.sh +. /lib/functions/system.sh + +ramips_setup_rt3x5x_vlans() +{ + if [ ! -x /sbin/swconfig ]; then + # legacy default + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + return + fi + local wanports="" + local lanports="" + for port in 5 4 3 2 1 0; do + if [ `swconfig dev rt305x port $port get disable` = "1" ]; then + continue + fi + if [ `swconfig dev rt305x port $port get lan` = "0" ]; then + wanports="$port $wanports" + else + lanports="$port $lanports" + fi + done + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "rt305x" "1" "1" + ucidef_add_switch_vlan "rt305x" "1" "$lanports 6t" + ucidef_add_switch_vlan "rt305x" "2" "$wanports 6t" +} + +ramips_setup_interfaces() +{ + local board="$1" + + ucidef_set_interface_loopback + + case $board in + 3g300m | \ + w150m | \ + all0256n | \ + all5002 | \ + all5003 | \ + broadway | \ + dcs-930| \ + ncs601w | \ + wnce2001) + ucidef_add_switch "switch0" "1" "0" + ucidef_set_interface_lan "eth0" + ;; + + 3g-6200nl | \ + mlw221) + ucidef_set_interface_lan "eth0.2" + ;; + + mlwg2 | \ + wl-330n | \ + wmr300) + ucidef_set_interface_lan "eth0.1" + ;; + + b2c | \ + nw718 | \ + psr-680w | \ + sl-r7205 | \ + w502u | \ + wr6202) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ;; + + awapn2403) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0 6t" + ucidef_add_switch_vlan "switch0" "2" "1 6t" + ;; + + br-6475nd) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t" + ucidef_add_switch_vlan "switch0" "2" "0 9t" + ;; + + asl26555) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t" + ;; + + cy-swr1100) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 9t" + ucidef_add_switch_vlan "switch0" "2" "4 9t" + ;; + + 3g-6200n | \ + dir-610-a1 | \ + dir-300-b7 | \ + dir-320-b1 | \ + dir-615-h1 | \ + hlk-rm04 | \ + mzk-w300nh2 | \ + mzk-750dhp) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t" + ucidef_add_switch_vlan "switch0" "2" "4 6t" + ;; + + awm002-evb | \ + awm003-evb | \ + argus-atp52b | \ + dir-645 | \ + f5d8235-v1 | \ + f5d8235-v2 | \ + hg255d | \ + rt-n14u | \ + wrtnode | \ + ur-326n4g | \ + zbt-wa05) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t" + ucidef_add_switch_vlan "switch0" "2" "0 6t" + ;; + + ur-336un) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ;; + + br6524n | \ + v11st-fe) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5t" + ucidef_add_switch_vlan "switch0" "2" "0 5t" + ;; + + ar725w | \ + rt-n15 | \ + wl-351) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t" + ucidef_add_switch_vlan "switch0" "2" "4 5t" + ;; + + rt-n56u) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 8t" + ucidef_add_switch_vlan "switch0" "2" "4 8t" + ;; + + tew-691gr|\ + tew-692gr) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0t 1 2 3 4" + ucidef_add_switch_vlan "switch0" "2" "0t 5" + ;; + + vocore) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0 4 6t" + ;; + + wcr-150gn) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0 6t" + ucidef_add_switch_vlan "switch0" "2" "6t" + ;; + + wr8305rt) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 6t" + ucidef_add_switch_vlan "switch0" "2" "4 6t" + ;; + + y1 |\ + y1s) + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + ucidef_add_switch "switch0" "1" "1" + ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 5 6t" + ucidef_add_switch_vlan "switch0" "2" "0 6t" + ;; + d105 | \ + na930 | \ + omni-emb-hpm|\ + wli-tx4-ag300n) + ucidef_set_interface_lan "eth0" + ;; + + ralink-soc) + ucidef_set_interface_lan "eth0" + ucidef_set_interface_wan "eth1" + ;; + + *) + RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"` + if [ -n "${RT3X5X}" ]; then + ramips_setup_rt3x5x_vlans + else + ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" + fi + ;; + esac +} + +ramips_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + + case $board in + br-6475nd) + lan_mac=$(cat /sys/class/net/eth0/address) + wan_mac=$(mtd_get_mac_binary devdata 7) + ;; + + w306r-v20) + lan_mac=$(cat /sys/class/net/eth0/address) + wan_mac=$(macaddr_add "$lan_mac" 5) + ;; + + tew-691gr) + lan_mac=$(cat /sys/class/net/eth0/address) + wan_mac=$(macaddr_add "$lan_mac" 3) + ;; + + tew-692gr) + lan_mac=$(cat /sys/class/net/eth0/address) + wan_mac=$(macaddr_add "$lan_mac" 4) + ;; + + m3 |\ + m4 |\ + x5 |\ + x8) + lan_mac=$(cat /sys/class/net/eth0/address) + lan_mac=$(macaddr_add "$lan_mac" -2) + ;; + + bc2 |\ + broadway |\ + d105 |\ + dir-620-a1 |\ + esr-9753 |\ + freestation5 |\ + hlk-rm04 | \ + mpr-a1 | \ + mpr-a2 | \ + dir-300-b7 | \ + dir-320-b1 | \ + psr-680w |\ + sl-r7205 |\ + y1 |\ + y1s) + lan_mac=$(cat /sys/class/net/eth0/address) + lan_mac=$(macaddr_setbit_la "$lan_mac") + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + + cy-swr1100 | \ + dir-645) + lan_mac=$(mtd_get_mac_ascii nvram lanmac) + wan_mac=$(mtd_get_mac_ascii nvram wanmac) + ;; + + wcr-150gn) + wan_mac=$(mtd_get_mac_binary factory 40) + ;; + + rt-n56u) + lan_mac=$(cat /sys/class/net/eth0/address) + lan_mac=$(macaddr_setbit_la "$lan_mac") + wan_mac=$(mtd_get_mac_binary factory 32772) + ;; + + all0239-3g | \ + carambola | \ + freestation5 | \ + w502u | \ + wnce2001) + wan_mac=$(mtd_get_mac_binary factory 46) + ;; + ralink-soc) + lan_mac=$(eth_mac r lan) + wan_mac=$(eth_mac r wan) + ;; + + *) + lan_mac=$(cat /sys/class/net/eth0/address) + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan $lan_mac + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan $wan_mac +} + +[ -e /etc/config/network ] && exit 0 + +touch /etc/config/network + +board=$(ramips_board_name) + +ramips_setup_interfaces $board +ramips_setup_macs $board + +uci commit network + +exit 0 diff --git a/target/linux/mediatek/base-files/etc/uci-defaults/03_dat2uci b/target/linux/mediatek/base-files/etc/uci-defaults/03_dat2uci new file mode 100755 index 0000000..dec16f7 --- /dev/null +++ b/target/linux/mediatek/base-files/etc/uci-defaults/03_dat2uci @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common + + +echo "update uci config with dat file" > /tmp/dat2uci.log +#[ -e /etc/config/wireless ] && rm /etc/config/wireless +for dat in /etc/wireless/*/*.dat +do + echo $dat + #dat2uci $dat >> /tmp/dat2uci.log +done + diff --git a/target/linux/mediatek/base-files/etc/uci-defaults/09_fix-seama-header b/target/linux/mediatek/base-files/etc/uci-defaults/09_fix-seama-header new file mode 100755 index 0000000..a6c392c --- /dev/null +++ b/target/linux/mediatek/base-files/etc/uci-defaults/09_fix-seama-header @@ -0,0 +1,21 @@ +#!/bin/sh +# +# Copyright (C) 2012 OpenWrt.org +# + +. /lib/ramips.sh + +fix_seama_header() { + local part=$1 + + mtd fixseama $part +} + +board=$(ramips_board_name) + +case "$board" in +cy-swr1100 | \ +dir-645) + fix_seama_header kernel + ;; +esac diff --git a/target/linux/mediatek/base-files/etc/udhcpd.config b/target/linux/mediatek/base-files/etc/udhcpd.config new file mode 100755 index 0000000..7efc787 --- /dev/null +++ b/target/linux/mediatek/base-files/etc/udhcpd.config @@ -0,0 +1,9 @@ +start 192.168.1.100 +end 192.168.1.200 +interface br-lan +option subnet 255.255.255.0 +option dns 192.168.1.251 168.95.1.1 +option router 192.168.1.1 +option lease 86400 +lease_file /var/udhcpd.leases + diff --git a/target/linux/mediatek/base-files/etc/wireless/mt7615e2/mt7615e2.dat b/target/linux/mediatek/base-files/etc/wireless/mt7615e2/mt7615e2.dat new file mode 100755 index 0000000..77e6a4b --- /dev/null +++ b/target/linux/mediatek/base-files/etc/wireless/mt7615e2/mt7615e2.dat @@ -0,0 +1,427 @@ + +#The word of "Default" must not be removed +Default +CountryRegion=5 +CountryRegionABand=7 +CountryCode= +AutoChannelSkipList= +DBDC_MODE=0 +IcapMode=0 +BssidNum=1 +SSID= +SSID1=MT7623_AP +SSID2= +SSID3= +SSID4= +SSID5= +SSID6= +SSID7= +SSID8= +SSID9= +SSID10= +SSID11= +SSID12= +SSID13= +SSID14= +SSID15= +SSID16= +WirelessMode=9 +FixedTxMode= +EthConvertMode=dongle +TxRate=0 +Channel=6 +BasicRate=15 +BeaconPeriod=100 +DtimPeriod=1 +TxPower=100 +SKUenable=0 +PERCENTAGEenable=0 +BFBACKOFFenable=0 +CalCacheApply=0 +DisableOLBC=0 +BGProtection=0 +TxAntenna= +RxAntenna= +TxPreamble=0 +RTSThreshold=2347 +FragThreshold=2346 +TxBurst=1 +PktAggregate=1 +AutoProvisionEn=0 +FreqDelta=0 +TurboRate=0 +WmmCapable=1 +APAifsn=3;7;1;1 +APCwmin=4;4;3;2 +APCwmax=6;10;4;3 +APTxop=0;0;94;47 +APACM=0;0;0;0 +BSSAifsn=3;7;2;2 +BSSCwmin=4;4;3;2 +BSSCwmax=10;10;4;3 +BSSTxop=0;0;94;47 +BSSACM=0;0;0;0 +AckPolicy=0;0;0;0 +APSDCapable=0 +DLSCapable=0 +NoForwarding=0 +NoForwardingBTNBSSID=0 +HideSSID=0 +ShortSlot=1 +AutoChannelSelect=0 +IEEE8021X=0 +IEEE80211H=1 +CarrierDetect=0 +ITxBfEn=0 +PreAntSwitch= +PhyRateLimit=0 +DebugFlags=0 +ETxBfEnCond=0 +MUTxRxEnable=0 +ITxBfTimeout=0 +ETxBfTimeout=0 +ETxBfNoncompress=0 +ETxBfIncapable=0 +FineAGC=0 +StreamMode=0 +StreamModeMac0= +StreamModeMac1= +StreamModeMac2= +StreamModeMac3= +CSPeriod=6 +RDRegion= +StationKeepAlive=0 +DfsCalibration=0 +DfsEnable=0 +DfsZeroWait=0 +DfsZeroWaitCacTime=255 +DfsLowerLimit=0 +DfsUpperLimit=0 +DfsOutdoor=0 +SymRoundFromCfg=0 +BusyIdleFromCfg=0 +DfsRssiHighFromCfg=0 +DfsRssiLowFromCfg=0 +DFSParamFromConfig=0 +FCCParamCh0= +FCCParamCh1= +FCCParamCh2= +FCCParamCh3= +CEParamCh0= +CEParamCh1= +CEParamCh2= +CEParamCh3= +JAPParamCh0= +JAPParamCh1= +JAPParamCh2= +JAPParamCh3= +JAPW53ParamCh0= +JAPW53ParamCh1= +JAPW53ParamCh2= +JAPW53ParamCh3= +FixDfsLimit=0 +LongPulseRadarTh=0 +AvgRssiReq=0 +DFS_R66=0 +BlockCh= +GreenAP=0 +PreAuth=0 +AuthMode=OPEN +EncrypType=NONE +WapiPsk1= +WapiPsk2= +WapiPsk3= +WapiPsk4= +WapiPsk5= +WapiPsk6= +WapiPsk7= +WapiPsk8= +WapiPsk9= +WapiPsk10= +WapiPsk11= +WapiPsk12= +WapiPsk13= +WapiPsk14= +WapiPsk15= +WapiPsk16= +WapiPskType= +Wapiifname= +WapiAsCertPath= +WapiUserCertPath= +WapiAsIpAddr= +WapiAsPort= +BssidNum=1 +RekeyMethod=DISABLE +RekeyInterval=3600 +PMKCachePeriod=10 +MeshAutoLink=0 +MeshAuthMode= +MeshEncrypType= +MeshDefaultkey=0 +MeshWEPKEY= +MeshWPAKEY= +MeshId= +WPAPSK= +WPAPSK1=12345678 +WPAPSK2= +WPAPSK3= +WPAPSK4= +WPAPSK5= +WPAPSK6= +WPAPSK7= +WPAPSK8= +WPAPSK9= +WPAPSK10= +WPAPSK11= +WPAPSK12= +WPAPSK13= +WPAPSK14= +WPAPSK15= +WPAPSK16= +DefaultKeyID=1 +Key1Type=0 +Key1Str= +Key1Str1= +Key1Str2= +Key1Str3= +Key1Str4= +Key1Str5= +Key1Str6= +Key1Str7= +Key1Str8= +Key1Str9= +Key1Str10= +Key1Str11= +Key1Str12= +Key1Str13= +Key1Str14= +Key1Str15= +Key1Str16= +Key2Type=0 +Key2Str= +Key2Str1= +Key2Str2= +Key2Str3= +Key2Str4= +Key2Str5= +Key2Str6= +Key2Str7= +Key2Str8= +Key2Str9= +Key2Str10= +Key2Str11= +Key2Str12= +Key2Str13= +Key2Str14= +Key2Str15= +Key2Str16= +Key3Type=0 +Key3Str= +Key3Str1= +Key3Str2= +Key3Str3= +Key3Str4= +Key3Str5= +Key3Str6= +Key3Str7= +Key3Str8= +Key3Str9= +Key3Str10= +Key3Str11= +Key3Str12= +Key3Str13= +Key3Str14= +Key3Str15= +Key3Str16= +Key4Type=0 +Key4Str= +Key4Str1= +Key4Str2= +Key4Str3= +Key4Str4= +Key4Str5= +Key4Str6= +Key4Str7= +Key4Str8= +Key4Str9= +Key4Str10= +Key4Str11= +Key4Str12= +Key4Str13= +Key4Str14= +Key4Str15= +Key4Str16= +HSCounter=0 +HT_HTC=1 +HT_RDG=1 +HT_LinkAdapt=0 +HT_OpMode=0 +HT_MpduDensity=5 +HT_EXTCHA=1 +HT_BW=1 +HT_AutoBA=1 +HT_BADecline=0 +HT_AMSDU=0 +HT_BAWinSize=64 +HT_GI=1 +HT_STBC=1 +HT_MCS=33 +HT_TxStream=2 +HT_RxStream=2 +HT_PROTECT=1 +HT_DisallowTKIP=1 +HT_BSSCoexistence=0 +HT_LDPC=0 +GreenAP=0 +VHT_BW=1 +VHT_Sec80_Channel=0 +VHT_STBC=0 +VHT_SGI=0 +VHT_BW_SIGNAL=0 +VHT_LDPC=0 +G_BAND_256QAM=1 +WscConfMode=0 +WscConfStatus=2 +WCNTest=0 +AccessPolicy0=0 +AccessControlList0= +AccessPolicy1=0 +AccessControlList1= +AccessPolicy2=0 +AccessControlList2= +AccessPolicy3=0 +AccessControlList3= +AccessPolicy4=0 +AccessControlList4= +AccessPolicy5=0 +AccessControlList5= +AccessPolicy6=0 +AccessControlList6= +AccessPolicy7=0 +AccessControlList7= +AccessPolicy8=0 +AccessControlList8= +AccessPolicy9=0 +AccessControlList9= +AccessPolicy10=0 +AccessControlList10= +AccessPolicy11=0 +AccessControlList11= +AccessPolicy12=0 +AccessControlList12= +AccessPolicy13=0 +AccessControlList13= +AccessPolicy14=0 +AccessControlList14= +AccessPolicy15=0 +AccessControlList15= +WdsEnable=0 +WdsPhyMode= +WdsEncrypType=NONE +WdsList= +Wds0Key= +Wds1Key= +Wds2Key= +Wds3Key= +RADIUS_Server=0 +RADIUS_Port=1812 +RADIUS_Key1= +RADIUS_Key2= +RADIUS_Key3= +RADIUS_Key4= +RADIUS_Key5= +RADIUS_Key6= +RADIUS_Key7= +RADIUS_Key8= +RADIUS_Key9= +RADIUS_Key10= +RADIUS_Key11= +RADIUS_Key12= +RADIUS_Key13= +RADIUS_Key14= +RADIUS_Key15= +RADIUS_Key16= +RADIUS_Acct_Server= +RADIUS_Acct_Port=1813 +RADIUS_Acct_Key= +own_ip_addr=192.168.1.1 +Ethifname= +EAPifname=br-lan +PreAuthifname=br-lan +session_timeout_interval=0 +idle_timeout_interval=0 +WiFiTest=0 +TGnWifiTest=0 +ApCliEnable= +ApCliSsid= +ApCliBssid= +ApCliAuthMode= +ApCliEncrypType= +ApCliWPAPSK= +ApCliDefaultKeyID= +ApCliKey1Type= +ApCliKey1Str= +ApCliKey2Type= +ApCliKey2Str= +ApCliKey3Type= +ApCliKey3Str= +ApCliKey4Type= +ApCliKey4Str= +MACRepeaterEn= +MACRepeaterOuiMode=2 +ApCliWirelessMode= +ApCliWPAPSK1= +ApCliKey1Str1= +ApCliKey2Str1= +ApCliKey3Str1= +ApCliKey4Str1= +EfuseBufferMode=0 +E2pAccessMode=2 +PMFMFPC=1 +PMFMFPR=0 +PMFSHA256=0 +RadioOn=1 +BW_Enable=0 +BW_Root=0 +BW_Priority= +BW_Guarantee_Rate= +BW_Maximum_Rate= +VOW_BW_Ctrl= +VOW_Airtime_Fairness_En=1 +VOW_RX_En= +VOW_Refill_Period= +VOW_Sta_VO_DWRR_Quantum= +VOW_Sta_VI_DWRR_Quantum= +VOW_Sta_BE_DWRR_Quantum= +VOW_Sta_BK_DWRR_Quantum= +VOW_WMM_Search_Rule_Band0= +VOW_WMM_Search_Rule_Band1= +VOW_Sta_DWRR_Max_Wait_Time= +VOW_Group_DWRR_Max_Wait_Time= +VOW_Group_Min_Rate= +VOW_Group_Max_Rate= +VOW_Group_Min_Ratio= +VOW_Group_Max_Ratio= +VOW_Airtime_Ctrl_En= +VOW_Rate_Ctrl_En= +VOW_Group_Min_Rate_Bucket_Size= +VOW_Group_Max_Rate_Bucket_Size= +VOW_Group_Min_Airtime_Bucket_Size= +VOW_Group_Max_Airtime_Bucket_Size= +VOW_Group_Backlog= +VOW_Group_Max_Wait_Time= +VOW_Group_DWRR_Quantum= +VOW_WATF_Enable= +VOW_WATF_Q_LV0= +VOW_WATF_Q_LV1= +VOW_WATF_Q_LV2= +VOW_WATF_Q_LV3= +VOW_WATF_MAC_LV0= +VOW_WATF_MAC_LV1= +VOW_WATF_MAC_LV2= +VOW_WATF_MAC_LV3= +RED_Enable=1 +CP_SUPPORT=2 +BgndScanSkipCh= +EDCCAEnable= +BandSteering=0 |