mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-23 22:24:39 +02:00
[lantiq] cleanup basefiles
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34698 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
ff7205d7e1
commit
5d8e0585ac
42
target/linux/lantiq/base-files/etc/diag.sh
Normal file
42
target/linux/lantiq/base-files/etc/diag.sh
Normal file
@ -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
|
||||||
|
}
|
@ -7,11 +7,14 @@
|
|||||||
case "${BUTTON}" in
|
case "${BUTTON}" in
|
||||||
BTN_0)
|
BTN_0)
|
||||||
logger "reset pressed"
|
logger "reset pressed"
|
||||||
|
echo "REBOOT" > /dev/console
|
||||||
|
sleep 3
|
||||||
sync
|
sync
|
||||||
reboot
|
reboot
|
||||||
;;
|
;;
|
||||||
BTN_1)
|
BTN_1)
|
||||||
logger "factory pressed"
|
logger "factory pressed"
|
||||||
|
echo "FACTORY RESET" > /dev/console
|
||||||
jffs2_mark_erase "rootfs_data"
|
jffs2_mark_erase "rootfs_data"
|
||||||
sync
|
sync
|
||||||
reboot
|
reboot
|
||||||
|
@ -23,12 +23,11 @@ rt2x00_eeprom_extract() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
||||||
|
. /lib/functions/lantiq.sh
|
||||||
. /lib/lantiq.sh
|
|
||||||
|
|
||||||
case "$FIRMWARE" in
|
case "$FIRMWARE" in
|
||||||
"RT2860.eeprom" )
|
"RT2860.eeprom" )
|
||||||
local board=$(lantiq_board_name)
|
local board=$(lantiq_board_id)
|
||||||
case $board in
|
case $board in
|
||||||
ARV7525PW|ARV752DPW)
|
ARV7525PW|ARV752DPW)
|
||||||
rt2x00_eeprom_extract "board_config" 1040 272
|
rt2x00_eeprom_extract "board_config" 1040 272
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
::sysinit:/etc/init.d/rcS S boot
|
::sysinit:/etc/init.d/rcS S boot
|
||||||
::shutdown:/etc/init.d/rcS K stop
|
::shutdown:/etc/init.d/rcS K stop
|
||||||
ttyLTQ0::askfirst:/bin/ash --login
|
ttyLTQ0::askfirst:/bin/ash --login
|
||||||
ttyLTQ1::askfirst:/bin/ash --login
|
|
||||||
|
@ -5,51 +5,21 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
. /lib/functions/uci-defaults.sh
|
. /lib/functions/uci-defaults.sh
|
||||||
. /lib/lantiq.sh
|
. /lib/functions/lantiq.sh
|
||||||
|
|
||||||
board=$(lantiq_board_name)
|
[ -e "/sys/class/leds/wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "wifi" "phy0tx"
|
||||||
|
[ -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
|
case "$board" in
|
||||||
ARV4520PW|ARV452CPW)
|
*)
|
||||||
ucidef_set_led_netdev "wifi" "wifi" "soc:blue:wifi" "wlan0"
|
|
||||||
ucidef_set_led_usbdev "usb" "USB" "soc:blue:usb" "1-1"
|
|
||||||
ucidef_set_led_default "fxs1" "fxs1" "soc:blue:fxs1" "1"
|
|
||||||
ucidef_set_led_default "fxs2" "fxs2" "soc:blue:fxs2" "1"
|
|
||||||
ucidef_set_led_default "online" "online" "soc:blue:internet" "1"
|
|
||||||
;;
|
|
||||||
|
|
||||||
ARV7525PW)
|
|
||||||
ucidef_set_led_netdev "wifi" "wifi" "soc:green:wifi" "wlan0"
|
|
||||||
ucidef_set_led_default "fxs1" "fxs1" "soc:green:fxs1" "1"
|
|
||||||
ucidef_set_led_default "fxs2" "fxs2" "soc:green:fxs2" "1"
|
|
||||||
ucidef_set_led_default "dsl" "dsl" "soc:red:dsl" "1"
|
|
||||||
ucidef_set_led_default "online" "online" "soc:green:online" "1"
|
|
||||||
;;
|
|
||||||
|
|
||||||
ARV4525PW)
|
|
||||||
ucidef_set_led_netdev "wifi" "wifi" "soc:green:wifi" "wlan0"
|
|
||||||
ucidef_set_led_default "fxs1" "fxs1" "soc:green:fxs1" "1"
|
|
||||||
ucidef_set_led_default "fxs2" "fxs2" "soc:green:fxs2" "1"
|
|
||||||
ucidef_set_led_default "dsl" "dsl" "soc:green:dsl" "1"
|
|
||||||
ucidef_set_led_default "online" "online" "soc:green:online" "1"
|
|
||||||
;;
|
|
||||||
|
|
||||||
GIGASX76X)
|
|
||||||
ucidef_set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
|
|
||||||
ucidef_set_led_netdev "online" "online" "soc:green:online" "pppoe-wan"
|
|
||||||
ucidef_set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
|
|
||||||
;;
|
|
||||||
|
|
||||||
ARV4519PW)
|
|
||||||
ucidef_set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
|
|
||||||
ucidef_set_led_netdev "internet" "internet" "soc:green:internet" "pppoe-wan"
|
|
||||||
ucidef_set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
|
|
||||||
;;
|
|
||||||
|
|
||||||
ARV7518PW)
|
|
||||||
ucidef_set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
|
|
||||||
ucidef_set_led_netdev "internet" "internet" "soc:green:internet" "pppoe-wan"
|
|
||||||
ucidef_set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ set_atm_wan() {
|
|||||||
local payload=$4
|
local payload=$4
|
||||||
uci batch <<EOF
|
uci batch <<EOF
|
||||||
set network.atm='atm-bridge'
|
set network.atm='atm-bridge'
|
||||||
set network.atm.unit='0'
|
|
||||||
set network.atm.vpi='$vpi'
|
set network.atm.vpi='$vpi'
|
||||||
set network.atm.vci='$vci'
|
set network.atm.vci='$vci'
|
||||||
set network.atm.encaps='$encaps'
|
set network.atm.encaps='$encaps'
|
||||||
@ -25,18 +24,8 @@ set network.wan.password='bar'
|
|||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
set_adsl() {
|
|
||||||
local fwannex=$1
|
|
||||||
local annex=$2
|
|
||||||
uci batch <<EOF
|
|
||||||
set network.adsl='adsl-device'
|
|
||||||
set network.adsl.fwannex='$fwannex'
|
|
||||||
set network.adsl.annex='$annex'
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
. /lib/functions/uci-defaults.sh
|
. /lib/functions/uci-defaults.sh
|
||||||
. /lib/lantiq.sh
|
. /lib/functions/lantiq.sh
|
||||||
|
|
||||||
touch /etc/config/network
|
touch /etc/config/network
|
||||||
|
|
||||||
@ -47,40 +36,33 @@ vpi=1
|
|||||||
vci=32
|
vci=32
|
||||||
encaps="llc"
|
encaps="llc"
|
||||||
payload="bridged"
|
payload="bridged"
|
||||||
fwannex=$(lantiq_dsl_fwannex)
|
|
||||||
board=$(lantiq_board_name)
|
board=$(lantiq_board_id)
|
||||||
dsl=$(lantiq_soc_has_adsl)
|
|
||||||
|
|
||||||
case "$board" in
|
case "$board" in
|
||||||
# annex B with adm6996
|
# adm6996
|
||||||
ARV4520PW)
|
ARV4520PW)
|
||||||
ucidef_set_interface_lan "eth0.1"
|
ucidef_set_interface_lan "eth0.1"
|
||||||
ucidef_add_switch "eth0" "1" "1"
|
ucidef_add_switch "eth0" "1" "1"
|
||||||
ucidef_add_switch_vlan "eth0" "1" "3 2 1 0 5t"
|
ucidef_add_switch_vlan "eth0" "1" "3 2 1 0 5t"
|
||||||
set_adsl "b" "b2p"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
GIGASX76X)
|
GIGASX76X)
|
||||||
ucidef_set_interface_lan "eth0.1"
|
ucidef_set_interface_lan "eth0.1"
|
||||||
ucidef_add_switch "eth0" "1" "1"
|
ucidef_add_switch "eth0" "1" "1"
|
||||||
ucidef_add_switch_vlan "eth0" "1" "4 3 2 1 5t"
|
ucidef_add_switch_vlan "eth0" "1" "4 3 2 1 5t"
|
||||||
set_adsl "b" "b2p"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
# annex A with ar8316
|
# ar8316
|
||||||
ARV4519PW|ARV7518PW)
|
ARV4519PW|ARV7518PW)
|
||||||
ucidef_set_interface_lan "eth0.1"
|
ucidef_set_interface_lan "eth0.1"
|
||||||
ucidef_add_switch "eth0" "1" "1"
|
ucidef_add_switch "eth0" "1" "1"
|
||||||
ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
|
ucidef_add_switch_vlan "eth0" "1" "0t 2 3 4 5"
|
||||||
set_adsl "a" "a2p"
|
|
||||||
;;
|
|
||||||
|
|
||||||
ARV7525PW|ARV4525PW|*)
|
|
||||||
set_adsl "$fwannex" "${fwannex}2p"
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ -z "$dsl" ] || set_atm_wan "$vpi" "$vci" "$encaps" "$payload"
|
[ -z "$(ls /lib/modules/`uname -r`/ltq_atm*)" ] || set_atm_wan "$vpi" "$vci" "$encaps" "$payload"
|
||||||
|
|
||||||
|
|
||||||
uci commit network
|
uci commit network
|
||||||
|
|
||||||
|
9
target/linux/lantiq/base-files/lib/functions/lantiq.sh
Normal file
9
target/linux/lantiq/base-files/lib/functions/lantiq.sh
Normal file
@ -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"
|
||||||
|
}
|
@ -1,17 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
lantiq_soc_has_adsl() {
|
|
||||||
ls /lib/modules/*/drv_dsl_cpe_api.ko
|
|
||||||
}
|
|
||||||
|
|
||||||
lantiq_soc_name() {
|
|
||||||
grep ^system /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g"
|
|
||||||
}
|
|
||||||
|
|
||||||
lantiq_board_name() {
|
|
||||||
grep ^machine /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"
|
|
||||||
}
|
|
||||||
|
|
||||||
lantiq_dsl_fwannex() {
|
|
||||||
ls /lib/firmware/dsl-fw-*.bin 2> /dev/null | sed "s/.*\([ab]\)\.bin/\1/g"
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
. /lib/lantiq.sh
|
. /lib/functions/lantiq.sh
|
||||||
|
|
||||||
init_atheeprom() {
|
init_atheeprom() {
|
||||||
local board=$(lantiq_board_name)
|
local board=$(lantiq_board_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user