diff options
Diffstat (limited to 'target/linux/lantiq/base-files')
33 files changed, 1282 insertions, 0 deletions
diff --git a/target/linux/lantiq/base-files/.svn/entries b/target/linux/lantiq/base-files/.svn/entries new file mode 100644 index 0000000..1710b3c --- /dev/null +++ b/target/linux/lantiq/base-files/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/lantiq/base-files +svn://svn.openwrt.org/openwrt + + + +2013-03-12T13:52:54.702628Z +35990 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +lib +dir + +etc +dir + diff --git a/target/linux/lantiq/base-files/etc/.svn/entries b/target/linux/lantiq/base-files/etc/.svn/entries new file mode 100644 index 0000000..d1c01e4 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/.svn/entries @@ -0,0 +1,102 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/lantiq/base-files/etc +svn://svn.openwrt.org/openwrt + + + +2013-03-12T13:52:54.702628Z +35990 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +hotplug.d +dir + +uci-defaults +dir + +inittab +file + + + + +2013-03-17T12:12:42.000000Z +737988553f814c54044619d405216d5c +2012-12-15T02:01:00.513352Z +34698 +blogic + + + + + + + + + + + + + + + + + + + + + +102 + +diag.sh +file + + + + +2013-03-17T12:12:42.000000Z +a2f4747466c581f6e3f964ae4e773c37 +2012-12-15T02:01:00.513352Z +34698 +blogic + + + + + + + + + + + + + + + + + + + + + +914 + diff --git a/target/linux/lantiq/base-files/etc/.svn/text-base/diag.sh.svn-base b/target/linux/lantiq/base-files/etc/.svn/text-base/diag.sh.svn-base new file mode 100644 index 0000000..d0088f5 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/.svn/text-base/diag.sh.svn-base @@ -0,0 +1,42 @@ +#!/bin/sh +# Copyright (C) 2012 OpenWrt.org + +[ -d /sys/class/leds/power/ ] || return + +set_state() { + [ -d /sys/class/leds/power1/ ] && { + + case "$1" in + preinit) + echo heartbeat >/sys/class/leds/power/trigger + ;; + failsafe) + echo none >/sys/class/leds/power/trigger + echo timer >/sys/class/leds/power1/trigger + echo 100 >/sys/class/leds/power1/delay_on + echo 100 >/sys/class/leds/power1/delay_off + ;; + done) + echo none >/sys/class/leds/power/trigger + echo none >/sys/class/leds/power1/trigger + echo 1 >/sys/class/leds/power/brightness + ;; + esac + return + } + + case "$1" in + preinit) + echo heartbeat >/sys/class/leds/power/trigger + ;; + failsafe) + echo timer >/sys/class/leds/power/trigger + echo 100 >/sys/class/leds/power/delay_on + echo 100 >/sys/class/leds/power/delay_off + ;; + done) + echo none >/sys/class/leds/power/trigger + echo 1 >/sys/class/leds/power/brightness + ;; + esac +} diff --git a/target/linux/lantiq/base-files/etc/.svn/text-base/inittab.svn-base b/target/linux/lantiq/base-files/etc/.svn/text-base/inittab.svn-base new file mode 100644 index 0000000..46a1312 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/.svn/text-base/inittab.svn-base @@ -0,0 +1,3 @@ +::sysinit:/etc/init.d/rcS S boot +::shutdown:/etc/init.d/rcS K stop +ttyLTQ0::askfirst:/bin/ash --login diff --git a/target/linux/lantiq/base-files/etc/diag.sh b/target/linux/lantiq/base-files/etc/diag.sh new file mode 100644 index 0000000..d0088f5 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/diag.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# Copyright (C) 2012 OpenWrt.org + +[ -d /sys/class/leds/power/ ] || return + +set_state() { + [ -d /sys/class/leds/power1/ ] && { + + case "$1" in + preinit) + echo heartbeat >/sys/class/leds/power/trigger + ;; + failsafe) + echo none >/sys/class/leds/power/trigger + echo timer >/sys/class/leds/power1/trigger + echo 100 >/sys/class/leds/power1/delay_on + echo 100 >/sys/class/leds/power1/delay_off + ;; + done) + echo none >/sys/class/leds/power/trigger + echo none >/sys/class/leds/power1/trigger + echo 1 >/sys/class/leds/power/brightness + ;; + esac + return + } + + case "$1" in + preinit) + echo heartbeat >/sys/class/leds/power/trigger + ;; + failsafe) + echo timer >/sys/class/leds/power/trigger + echo 100 >/sys/class/leds/power/delay_on + echo 100 >/sys/class/leds/power/delay_off + ;; + done) + echo none >/sys/class/leds/power/trigger + echo 1 >/sys/class/leds/power/brightness + ;; + esac +} diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/.svn/entries b/target/linux/lantiq/base-files/etc/hotplug.d/.svn/entries new file mode 100644 index 0000000..4c1fb3c --- /dev/null +++ b/target/linux/lantiq/base-files/etc/hotplug.d/.svn/entries @@ -0,0 +1,34 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/lantiq/base-files/etc/hotplug.d +svn://svn.openwrt.org/openwrt + + + +2012-12-21T13:47:50.009114Z +34823 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +button +dir + +firmware +dir + diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/button/.svn/entries b/target/linux/lantiq/base-files/etc/hotplug.d/button/.svn/entries new file mode 100644 index 0000000..b48029e --- /dev/null +++ b/target/linux/lantiq/base-files/etc/hotplug.d/button/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/lantiq/base-files/etc/hotplug.d/button +svn://svn.openwrt.org/openwrt + + + +2012-12-21T13:47:50.009114Z +34823 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +10-generic.sh +file + + + + +2013-03-17T12:12:42.000000Z +05a99616d5a3f44d4fa92d2d2b19f414 +2012-12-21T13:47:50.009114Z +34823 +blogic + + + + + + + + + + + + + + + + + + + + + +864 + diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/button/.svn/text-base/10-generic.sh.svn-base b/target/linux/lantiq/base-files/etc/hotplug.d/button/.svn/text-base/10-generic.sh.svn-base new file mode 100644 index 0000000..4b305fb --- /dev/null +++ b/target/linux/lantiq/base-files/etc/hotplug.d/button/.svn/text-base/10-generic.sh.svn-base @@ -0,0 +1,53 @@ +#!/bin/sh + +[ "${ACTION}" = "released" ] || exit 0 + +. /lib/functions.sh + +logger "$BUTTON pressed for $SEEN seconds" + +local rfkill_state=0 + +wifi_rfkill_set() { + uci set wireless.$1.disabled=$rfkill_state +} + +wifi_rfkill_check() { + local disabled + config_get disabled $1 disabled + [ "$disabled" = "1" ] || rfkill_state=1 +} + +case "${BUTTON}" in + reset) + if [ "$SEEN" -lt 1 ] + then + echo "REBOOT" > /dev/console + sync + reboot + elif [ "$SEEN" -gt 5 ] + then + echo "FACTORY RESET" > /dev/console + firstboot && reboot & + fi + ;; + + wps) + for dir in /var/run/hostapd-*; do + [ -d "$dir" ] || continue + hostapd_cli -p "$dir" wps_pbc + done + ;; + + rfkill) + config_load wireless + config_foreach wifi_rfkill_check wifi-device + config_foreach wifi_rfkill_set wifi-device + uci commit wireless + wifi up + ;; + + *) + logger "unknown button ${BUTTON}" + ;; +esac diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh b/target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh new file mode 100644 index 0000000..4b305fb --- /dev/null +++ b/target/linux/lantiq/base-files/etc/hotplug.d/button/10-generic.sh @@ -0,0 +1,53 @@ +#!/bin/sh + +[ "${ACTION}" = "released" ] || exit 0 + +. /lib/functions.sh + +logger "$BUTTON pressed for $SEEN seconds" + +local rfkill_state=0 + +wifi_rfkill_set() { + uci set wireless.$1.disabled=$rfkill_state +} + +wifi_rfkill_check() { + local disabled + config_get disabled $1 disabled + [ "$disabled" = "1" ] || rfkill_state=1 +} + +case "${BUTTON}" in + reset) + if [ "$SEEN" -lt 1 ] + then + echo "REBOOT" > /dev/console + sync + reboot + elif [ "$SEEN" -gt 5 ] + then + echo "FACTORY RESET" > /dev/console + firstboot && reboot & + fi + ;; + + wps) + for dir in /var/run/hostapd-*; do + [ -d "$dir" ] || continue + hostapd_cli -p "$dir" wps_pbc + done + ;; + + rfkill) + config_load wireless + config_foreach wifi_rfkill_check wifi-device + config_foreach wifi_rfkill_set wifi-device + uci commit wireless + wifi up + ;; + + *) + logger "unknown button ${BUTTON}" + ;; +esac diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/.svn/entries b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/.svn/entries new file mode 100644 index 0000000..2990f48 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/lantiq/base-files/etc/hotplug.d/firmware +svn://svn.openwrt.org/openwrt + + + +2012-12-19T16:07:50.872491Z +34793 +mirko + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +10-rt2x00-eeprom +file + + + + +2013-03-17T12:12:42.000000Z +f10c4e86498aea8d1c674118bd7c79f0 +2012-12-19T16:07:50.872491Z +34793 +mirko + + + + + + + + + + + + + + + + + + + + + +776 + diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/.svn/text-base/10-rt2x00-eeprom.svn-base b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/.svn/text-base/10-rt2x00-eeprom.svn-base new file mode 100644 index 0000000..e3509bd --- /dev/null +++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/.svn/text-base/10-rt2x00-eeprom.svn-base @@ -0,0 +1,40 @@ +#!/bin/sh +# based on gabors ralink wisoc implementation + +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 || \ + rt2x00_eeprom_die "failed to extract from $mtd" +} + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 +. /lib/functions/lantiq.sh + +case "$FIRMWARE" in +"RT2860.eeprom" ) + local board=$(lantiq_board_id) + case $board in + ARV7525PW|ARV752DPW) + rt2x00_eeprom_extract "board_config" 1040 272 + ;; + *) + rt2x00_eeprom_die "board $board is not supported yet" + ;; + esac + ;; +esac diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom new file mode 100644 index 0000000..e3509bd --- /dev/null +++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom @@ -0,0 +1,40 @@ +#!/bin/sh +# based on gabors ralink wisoc implementation + +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 || \ + rt2x00_eeprom_die "failed to extract from $mtd" +} + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 +. /lib/functions/lantiq.sh + +case "$FIRMWARE" in +"RT2860.eeprom" ) + local board=$(lantiq_board_id) + case $board in + ARV7525PW|ARV752DPW) + rt2x00_eeprom_extract "board_config" 1040 272 + ;; + *) + rt2x00_eeprom_die "board $board is not supported yet" + ;; + esac + ;; +esac diff --git a/target/linux/lantiq/base-files/etc/inittab b/target/linux/lantiq/base-files/etc/inittab new file mode 100644 index 0000000..46a1312 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/inittab @@ -0,0 +1,3 @@ +::sysinit:/etc/init.d/rcS S boot +::shutdown:/etc/init.d/rcS K stop +ttyLTQ0::askfirst:/bin/ash --login diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/.svn/entries b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/entries new file mode 100644 index 0000000..dc41364 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/entries @@ -0,0 +1,130 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/lantiq/base-files/etc/uci-defaults +svn://svn.openwrt.org/openwrt + + + +2013-03-12T13:52:54.702628Z +35990 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +03_wireless-wps +file + + + + +2013-03-17T12:12:42.000000Z +b790232b1444625981b81f3302d3e8d8 +2013-01-18T12:42:53.029206Z +35217 +jow + + + + + + + + + + + + + + + + + + + + + +304 + +01_leds +file + + + + +2013-03-17T12:12:42.000000Z +ebf1017d3464bd772dcb357476cc30b5 +2013-01-18T12:42:53.029206Z +35217 +jow +has-props + + + + + + + + + + + + + + + + + + + + +630 + +02_network +file + + + + +2013-03-17T12:12:42.000000Z +81a60b0d6dad5f5ee1e7980be17e2804 +2013-03-12T13:52:54.702628Z +35990 +blogic +has-props + + + + + + + + + + + + + + + + + + + + +1397 + diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/.svn/prop-base/01_leds.svn-base b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/prop-base/01_leds.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/prop-base/01_leds.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/.svn/prop-base/02_network.svn-base b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/prop-base/02_network.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/prop-base/02_network.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/.svn/text-base/01_leds.svn-base b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/text-base/01_leds.svn-base new file mode 100644 index 0000000..3f87fe0 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/text-base/01_leds.svn-base @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Copyright (C) 2011 OpenWrt.org +# based on ar71xx +# + +. /lib/functions/uci-defaults.sh +. /lib/functions/lantiq.sh + +[ -e "/sys/class/leds/wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "wifi" "phy0tpt" +[ -e "/sys/class/leds/usb" ] && ucidef_set_led_usbdev "usb" "usb" "usb" "1-1" +[ -e "/sys/class/leds/dsl" ] && ucidef_set_led_netdev "dsl" "dsl" "dsl" "pppoe-wan" + +for a in `ls /sys/class/leds/`; do + grep -q "\[none\]" /sys/class/leds/$a/trigger + [ $? -eq 0 ] && ucidef_set_led_default $a $a $a `cat /sys/class/leds/$a/brightness` +done + +board=$(lantiq_board_id) + +case "$board" in +*) + ;; +esac + +ucidef_commit_leds + +exit 0 diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/.svn/text-base/02_network.svn-base b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/text-base/02_network.svn-base new file mode 100644 index 0000000..1eadb56 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/text-base/02_network.svn-base @@ -0,0 +1,75 @@ +#!/bin/sh +# +# Copyright (C) 2011-2012 OpenWrt.org +# + +[ -e /etc/config/network ] && exit 0 + +set_atm_wan() { + local vpi=$1 + local vci=$2 + local encaps=$3 + local payload=$4 + uci batch <<EOF +set network.atm='atm-bridge' +set network.atm.vpi='$vpi' +set network.atm.vci='$vci' +set network.atm.encaps='$encaps' +set network.atm.payload='$payload' +set network.wan='interface' +set network.wan.ifname='nas0' +set network.wan.proto='pppoe' +set network.wan.username='foo' +set network.wan.password='bar' +EOF +} + +. /lib/functions/uci-defaults.sh +. /lib/functions/lantiq.sh + +touch /etc/config/network + +ucidef_set_interface_loopback +ucidef_set_interface_lan 'eth0' + +vpi=1 +vci=32 +encaps="llc" +payload="bridged" + +board=$(lantiq_board_id) + +case "$board" in +# adm6996 +ARV4520PW) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "eth0" "1" "1" + ucidef_add_switch_vlan "eth0" "1" "3 2 1 0 5t" + ;; + +ACMP252|GIGASX76X) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "eth0" "1" "1" + ucidef_add_switch_vlan "eth0" "1" "4 3 2 1 5t" + ;; + +# ar8316 +ARV4519PW|ARV7518PW) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "eth0" "1" "1" + ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5" + ;; + +WBMR) + ucidef_add_switch "eth0" "1" "0" + ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5" + ;; + +esac + +[ -z "$(ls /lib/modules/`uname -r`/ltq_atm*)" ] || set_atm_wan "$vpi" "$vci" "$encaps" "$payload" + + +uci commit network + +exit 0 diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/.svn/text-base/03_wireless-wps.svn-base b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/text-base/03_wireless-wps.svn-base new file mode 100644 index 0000000..f2412d7 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/.svn/text-base/03_wireless-wps.svn-base @@ -0,0 +1,16 @@ +. /lib/functions.sh +. /lib/functions/lantiq.sh + +set_wps() { + uci set wireless.$1.wps_pushbutton=0 + uci set wireless.$1.wps_device_name="OpenWrt - $(lantiq_board_name)" +} + +board=$(lantiq_board_id) +case $board in +WBMR) + config_load wireless + config_foreach set_wps wifi-iface + uci commit wireless + ;; +esac diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/01_leds b/target/linux/lantiq/base-files/etc/uci-defaults/01_leds new file mode 100755 index 0000000..3f87fe0 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/01_leds @@ -0,0 +1,28 @@ +#!/bin/sh +# +# Copyright (C) 2011 OpenWrt.org +# based on ar71xx +# + +. /lib/functions/uci-defaults.sh +. /lib/functions/lantiq.sh + +[ -e "/sys/class/leds/wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "wifi" "phy0tpt" +[ -e "/sys/class/leds/usb" ] && ucidef_set_led_usbdev "usb" "usb" "usb" "1-1" +[ -e "/sys/class/leds/dsl" ] && ucidef_set_led_netdev "dsl" "dsl" "dsl" "pppoe-wan" + +for a in `ls /sys/class/leds/`; do + grep -q "\[none\]" /sys/class/leds/$a/trigger + [ $? -eq 0 ] && ucidef_set_led_default $a $a $a `cat /sys/class/leds/$a/brightness` +done + +board=$(lantiq_board_id) + +case "$board" in +*) + ;; +esac + +ucidef_commit_leds + +exit 0 diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/02_network b/target/linux/lantiq/base-files/etc/uci-defaults/02_network new file mode 100755 index 0000000..1eadb56 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/02_network @@ -0,0 +1,75 @@ +#!/bin/sh +# +# Copyright (C) 2011-2012 OpenWrt.org +# + +[ -e /etc/config/network ] && exit 0 + +set_atm_wan() { + local vpi=$1 + local vci=$2 + local encaps=$3 + local payload=$4 + uci batch <<EOF +set network.atm='atm-bridge' +set network.atm.vpi='$vpi' +set network.atm.vci='$vci' +set network.atm.encaps='$encaps' +set network.atm.payload='$payload' +set network.wan='interface' +set network.wan.ifname='nas0' +set network.wan.proto='pppoe' +set network.wan.username='foo' +set network.wan.password='bar' +EOF +} + +. /lib/functions/uci-defaults.sh +. /lib/functions/lantiq.sh + +touch /etc/config/network + +ucidef_set_interface_loopback +ucidef_set_interface_lan 'eth0' + +vpi=1 +vci=32 +encaps="llc" +payload="bridged" + +board=$(lantiq_board_id) + +case "$board" in +# adm6996 +ARV4520PW) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "eth0" "1" "1" + ucidef_add_switch_vlan "eth0" "1" "3 2 1 0 5t" + ;; + +ACMP252|GIGASX76X) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "eth0" "1" "1" + ucidef_add_switch_vlan "eth0" "1" "4 3 2 1 5t" + ;; + +# ar8316 +ARV4519PW|ARV7518PW) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "eth0" "1" "1" + ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5" + ;; + +WBMR) + ucidef_add_switch "eth0" "1" "0" + ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5" + ;; + +esac + +[ -z "$(ls /lib/modules/`uname -r`/ltq_atm*)" ] || set_atm_wan "$vpi" "$vci" "$encaps" "$payload" + + +uci commit network + +exit 0 diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/03_wireless-wps b/target/linux/lantiq/base-files/etc/uci-defaults/03_wireless-wps new file mode 100644 index 0000000..f2412d7 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/03_wireless-wps @@ -0,0 +1,16 @@ +. /lib/functions.sh +. /lib/functions/lantiq.sh + +set_wps() { + uci set wireless.$1.wps_pushbutton=0 + uci set wireless.$1.wps_device_name="OpenWrt - $(lantiq_board_name)" +} + +board=$(lantiq_board_id) +case $board in +WBMR) + config_load wireless + config_foreach set_wps wifi-iface + uci commit wireless + ;; +esac diff --git a/target/linux/lantiq/base-files/lib/.svn/entries b/target/linux/lantiq/base-files/lib/.svn/entries new file mode 100644 index 0000000..917963d --- /dev/null +++ b/target/linux/lantiq/base-files/lib/.svn/entries @@ -0,0 +1,37 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/lantiq/base-files/lib +svn://svn.openwrt.org/openwrt + + + +2012-12-15T02:01:00.513352Z +34698 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +upgrade +dir + +functions +dir + +preinit +dir + diff --git a/target/linux/lantiq/base-files/lib/functions/.svn/entries b/target/linux/lantiq/base-files/lib/functions/.svn/entries new file mode 100644 index 0000000..e01aeb4 --- /dev/null +++ b/target/linux/lantiq/base-files/lib/functions/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/lantiq/base-files/lib/functions +svn://svn.openwrt.org/openwrt + + + +2012-12-15T02:01:00.513352Z +34698 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +lantiq.sh +file + + + + +2013-03-17T12:12:42.000000Z +f66c7a4a5807aafb8d4f980293cbc3e0 +2012-12-15T02:01:00.513352Z +34698 +blogic + + + + + + + + + + + + + + + + + + + + + +261 + diff --git a/target/linux/lantiq/base-files/lib/functions/.svn/text-base/lantiq.sh.svn-base b/target/linux/lantiq/base-files/lib/functions/.svn/text-base/lantiq.sh.svn-base new file mode 100644 index 0000000..ca52d08 --- /dev/null +++ b/target/linux/lantiq/base-files/lib/functions/.svn/text-base/lantiq.sh.svn-base @@ -0,0 +1,9 @@ +#!/bin/sh + +lantiq_board_id() { + grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g" | sed "s/.* - \(.*\) - .*/\1/g" +} + +lantiq_board_name() { + grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g" +} diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq.sh b/target/linux/lantiq/base-files/lib/functions/lantiq.sh new file mode 100644 index 0000000..ca52d08 --- /dev/null +++ b/target/linux/lantiq/base-files/lib/functions/lantiq.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +lantiq_board_id() { + grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g" | sed "s/.* - \(.*\) - .*/\1/g" +} + +lantiq_board_name() { + grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g" +} diff --git a/target/linux/lantiq/base-files/lib/preinit/.svn/entries b/target/linux/lantiq/base-files/lib/preinit/.svn/entries new file mode 100644 index 0000000..3a0e72c --- /dev/null +++ b/target/linux/lantiq/base-files/lib/preinit/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/lantiq/base-files/lib/preinit +svn://svn.openwrt.org/openwrt + + + +2012-12-15T02:01:00.513352Z +34698 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +42_athfix +file + + + + +2013-03-17T12:12:42.000000Z +8beea68c08d58bb604099bc2f63ad1f3 +2012-12-15T02:01:00.513352Z +34698 +blogic + + + + + + + + + + + + + + + + + + + + + +379 + diff --git a/target/linux/lantiq/base-files/lib/preinit/.svn/text-base/42_athfix.svn-base b/target/linux/lantiq/base-files/lib/preinit/.svn/text-base/42_athfix.svn-base new file mode 100644 index 0000000..d182fbf --- /dev/null +++ b/target/linux/lantiq/base-files/lib/preinit/.svn/text-base/42_athfix.svn-base @@ -0,0 +1,19 @@ +#!/bin/sh + +. /lib/functions/lantiq.sh + +init_atheeprom() { + local board=$(lantiq_board_name) + case $board in + "Netgear DGN3500B") + echo "- loading eeprom -" + dd if=/dev/mtd2 of=/sys/firmware/ath_eeprom bs=1k skip=60 count=4 + echo 0 > /sys/bus/pci/slots/0000\:00\:0e.0/power + sleep 1 + echo 1 > /sys/bus/pci/rescan + ;; + esac +} + +boot_hook_add preinit_essential init_atheeprom + diff --git a/target/linux/lantiq/base-files/lib/preinit/42_athfix b/target/linux/lantiq/base-files/lib/preinit/42_athfix new file mode 100644 index 0000000..d182fbf --- /dev/null +++ b/target/linux/lantiq/base-files/lib/preinit/42_athfix @@ -0,0 +1,19 @@ +#!/bin/sh + +. /lib/functions/lantiq.sh + +init_atheeprom() { + local board=$(lantiq_board_name) + case $board in + "Netgear DGN3500B") + echo "- loading eeprom -" + dd if=/dev/mtd2 of=/sys/firmware/ath_eeprom bs=1k skip=60 count=4 + echo 0 > /sys/bus/pci/slots/0000\:00\:0e.0/power + sleep 1 + echo 1 > /sys/bus/pci/rescan + ;; + esac +} + +boot_hook_add preinit_essential init_atheeprom + diff --git a/target/linux/lantiq/base-files/lib/upgrade/.svn/entries b/target/linux/lantiq/base-files/lib/upgrade/.svn/entries new file mode 100644 index 0000000..eaa6df6 --- /dev/null +++ b/target/linux/lantiq/base-files/lib/upgrade/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/target/linux/lantiq/base-files/lib/upgrade +svn://svn.openwrt.org/openwrt + + + +2010-12-12T22:57:16.047709Z +24526 +blogic + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +platform.sh +file + + + + +2013-03-17T12:12:42.000000Z +1119d2547aae3c701a685b007304f0fb +2010-12-12T22:57:16.047709Z +24526 +blogic +has-props + + + + + + + + + + + + + + + + + + + + +434 + diff --git a/target/linux/lantiq/base-files/lib/upgrade/.svn/prop-base/platform.sh.svn-base b/target/linux/lantiq/base-files/lib/upgrade/.svn/prop-base/platform.sh.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/target/linux/lantiq/base-files/lib/upgrade/.svn/prop-base/platform.sh.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/target/linux/lantiq/base-files/lib/upgrade/.svn/text-base/platform.sh.svn-base b/target/linux/lantiq/base-files/lib/upgrade/.svn/text-base/platform.sh.svn-base new file mode 100644 index 0000000..247ba1a --- /dev/null +++ b/target/linux/lantiq/base-files/lib/upgrade/.svn/text-base/platform.sh.svn-base @@ -0,0 +1,25 @@ +PART_NAME=linux + +platform_check_image() { + [ "$ARGC" -gt 1 ] && return 1 + + case "$(get_magic_word "$1")" in + # .trx files + 2705) return 0;; + *) + echo "Invalid image type" + return 1 + ;; + esac +} + +# use default for platform_do_upgrade() + +disable_watchdog() { + killall watchdog + ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && { + echo 'Could not disable watchdog' + return 1 + } +} +append sysupgrade_pre_upgrade disable_watchdog diff --git a/target/linux/lantiq/base-files/lib/upgrade/platform.sh b/target/linux/lantiq/base-files/lib/upgrade/platform.sh new file mode 100755 index 0000000..247ba1a --- /dev/null +++ b/target/linux/lantiq/base-files/lib/upgrade/platform.sh @@ -0,0 +1,25 @@ +PART_NAME=linux + +platform_check_image() { + [ "$ARGC" -gt 1 ] && return 1 + + case "$(get_magic_word "$1")" in + # .trx files + 2705) return 0;; + *) + echo "Invalid image type" + return 1 + ;; + esac +} + +# use default for platform_do_upgrade() + +disable_watchdog() { + killall watchdog + ( ps | grep -v 'grep' | grep '/dev/watchdog' ) && { + echo 'Could not disable watchdog' + return 1 + } +} +append sysupgrade_pre_upgrade disable_watchdog |