Initial commit
This commit is contained in:
53
target/linux/kirkwood/base-files/etc/board.d/01_leds
Executable file
53
target/linux/kirkwood/base-files/etc/board.d/01_leds
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2012-2015 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
"cloudengines,pogoe02")
|
||||
ucidef_set_led_default "health" "health" "pogo_e02:green:health" "1"
|
||||
ucidef_set_led_default "fault" "fault" "pogo_e02:orange:fault" "1"
|
||||
;;
|
||||
"linksys,audi")
|
||||
ucidef_set_led_default "power" "power" "audi:green:power" "1"
|
||||
;;
|
||||
"linksys,viper")
|
||||
ucidef_set_led_default "health" "health" "viper:white:health" "1"
|
||||
ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1"
|
||||
;;
|
||||
"raidsonic,ib-nas62x0")
|
||||
ucidef_set_led_default "health" "health" "ib62x0:green:os" "1"
|
||||
ucidef_set_led_default "fault" "fault" "ib62x0:red:os" "1"
|
||||
;;
|
||||
"seagate,dockstar")
|
||||
ucidef_set_led_default "health" "health" "status:green:health" "1"
|
||||
ucidef_set_led_default "fault" "fault" "status:orange:fault" "1"
|
||||
;;
|
||||
"seagate,goflexhome"|\
|
||||
"seagate,goflexnet")
|
||||
ucidef_set_led_default "health" "health" "status:green:health" "1"
|
||||
ucidef_set_led_default "fault" "fault" "status:orange:fault" "0"
|
||||
;;
|
||||
"zyxel,nsa310b")
|
||||
ucidef_set_led_default "health" "health" "nsa310:green:sys" "1"
|
||||
ucidef_set_led_usbhost "usb" "USB" "nsa310:green:usb"
|
||||
ucidef_set_led_ataport "hdd" "HDD" "nsa310:green:hdd" "1"
|
||||
ucidef_set_led_ataport "esata" "eSata" "nsa310:green:esata" "2"
|
||||
;;
|
||||
"zyxel,nsa325")
|
||||
ucidef_set_led_default "health" "health" "nsa325:green:sys" "1"
|
||||
ucidef_set_led_usbhost "usb" "USB" "nsa325:green:usb"
|
||||
ucidef_set_led_ataport "hdd1" "HDD1" "nsa325:green:hdd1" "1"
|
||||
ucidef_set_led_ataport "hdd2" "HDD2" "nsa325:green:hdd2" "2"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
43
target/linux/kirkwood/base-files/etc/board.d/02_network
Executable file
43
target/linux/kirkwood/base-files/etc/board.d/02_network
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2012-2015 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
"cisco,on100")
|
||||
ucidef_set_interface_lan "eth0 eth1"
|
||||
;;
|
||||
"cloudengines,pogoe02"|\
|
||||
"cloudengines,pogoplugv4"|\
|
||||
"iom,iconnect-1.1"|\
|
||||
"raidsonic,ib-nas62x0"|\
|
||||
"seagate,dockstar"|\
|
||||
"seagate,goflexhome"|\
|
||||
"seagate,goflexnet")
|
||||
ucidef_set_interface_lan "eth0" "dhcp"
|
||||
;;
|
||||
"linksys,audi"|\
|
||||
"linksys,viper")
|
||||
ucidef_add_switch "switch0" \
|
||||
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" "6@eth1"
|
||||
;;
|
||||
"zyxel,nsa310b"|\
|
||||
"zyxel,nsa325")
|
||||
ucidef_set_interface_lan "eth0" "dhcp"
|
||||
ucidef_set_interface_macaddr "lan" $( mtd_get_mac_ascii uboot_env ethaddr )
|
||||
;;
|
||||
*)
|
||||
ucidef_set_interface_lan "eth0"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
52
target/linux/kirkwood/base-files/etc/diag.sh
Executable file
52
target/linux/kirkwood/base-files/etc/diag.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2014 OpenWrt.org
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/leds.sh
|
||||
|
||||
get_status_led() {
|
||||
case $(board_name) in
|
||||
cisco,on100)
|
||||
status_led="on100:green:health"
|
||||
;;
|
||||
cloudengines,pogoe02)
|
||||
status_led="pogo_e02:orange:fault"
|
||||
;;
|
||||
cloudengines,pogoplugv4)
|
||||
status_led="pogoplugv4:green:health"
|
||||
;;
|
||||
linksys,audi)
|
||||
status_led="audi:green:power"
|
||||
;;
|
||||
linksys,viper)
|
||||
status_led="viper:white:health"
|
||||
;;
|
||||
seagate,dockstar|\
|
||||
seagate,goflexhome|\
|
||||
seagate,goflexnet)
|
||||
status_led="status:orange:fault"
|
||||
;;
|
||||
zyxel,nsa310b)
|
||||
status_led="nsa310:green:sys"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
set_state() {
|
||||
get_status_led
|
||||
|
||||
case "$1" in
|
||||
preinit)
|
||||
status_led_blink_preinit
|
||||
;;
|
||||
failsafe)
|
||||
status_led_blink_failsafe
|
||||
;;
|
||||
preinit_regular)
|
||||
status_led_blink_preinit_regular
|
||||
;;
|
||||
done)
|
||||
status_led_on
|
||||
;;
|
||||
esac
|
||||
}
|
||||
19
target/linux/kirkwood/base-files/etc/init.d/linksys_recovery
Executable file
19
target/linux/kirkwood/base-files/etc/init.d/linksys_recovery
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2015 OpenWrt.org
|
||||
|
||||
START=97
|
||||
boot() {
|
||||
. /lib/functions.sh
|
||||
|
||||
case $(board_name) in
|
||||
linksys,audi|linksys,viper)
|
||||
# make sure auto_recovery in uboot is always on
|
||||
AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
|
||||
if [ "$AUTO_RECOVERY_ENA" != "yes" ] ; then
|
||||
fw_setenv auto_recovery yes
|
||||
fi
|
||||
# reset the boot counter
|
||||
mtd resetbc s_env
|
||||
;;
|
||||
esac
|
||||
}
|
||||
20
target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol
Executable file
20
target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=98
|
||||
boot() {
|
||||
. /lib/functions.sh
|
||||
|
||||
#configuring lm85 onboard temp/fan controller to run the fan on its own
|
||||
#for more information, please read https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
|
||||
|
||||
path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0'
|
||||
|
||||
case $(board_name) in
|
||||
zyxel,nsa310b)
|
||||
echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1
|
||||
echo 1 > "$path_to_hwmon/pwm1_auto_channels" # temp1 is the only one that changes
|
||||
echo 23000 > "$path_to_hwmon/temp1_auto_temp_min"
|
||||
echo 43000 > "$path_to_hwmon/temp1_auto_temp_max" # next step is 49600 millicelsius, or 50 celsius, 43 celsius is better
|
||||
;;
|
||||
esac
|
||||
}
|
||||
Reference in New Issue
Block a user