Skip to content
Snippets Groups Projects
Commit d88cc5e7 authored by Markus Gothe's avatar Markus Gothe :ok_hand: Committed by Andreas Gnau
Browse files

Merge Zebra and Eagle

parent 094410d1
Branches
No related tags found
1 merge request!322Merge Zebra and Eagle
Showing
with 132 additions and 189 deletions
...@@ -3,7 +3,7 @@ CONFIG_BCM_KERNEL_PROFILE="96750GW_WL20D1D1" ...@@ -3,7 +3,7 @@ CONFIG_BCM_KERNEL_PROFILE="96750GW_WL20D1D1"
CONFIG_BCM_CHIP_ID="63178" CONFIG_BCM_CHIP_ID="63178"
CONFIG_BCM_FIRMWARE_TYPE_NAND_SQUASHFS=y CONFIG_BCM_FIRMWARE_TYPE_NAND_SQUASHFS=y
# CONFIG_BCM_VOICE is not set CONFIG_BCM_VOICE=y
# CONFIG_BCM_DSL is not set # CONFIG_BCM_DSL is not set
# CONFIG_PACKAGE_libdsl is not set # CONFIG_PACKAGE_libdsl is not set
# CONFIG_PACKAGE_dslmngr is not set # CONFIG_PACKAGE_dslmngr is not set
......
CONFIG_TARGET_FAMILY="ZEBRA"
CONFIG_BCM_KERNEL_PROFILE="96750GW_WL20D1D1"
CONFIG_BCM_CHIP_ID="63178"
CONFIG_BCM_FIRMWARE_TYPE_NAND_SQUASHFS=y
CONFIG_BCM_VOICE=y
# CONFIG_BCM_DSL is not set
# CONFIG_PACKAGE_libdsl is not set
# CONFIG_PACKAGE_dslmngr is not set
# CONFIG_PACKAGE_mwan3 is not set
CONFIG_BCM_FLASH_LAYOUT_OPTIONS="options_63178_nand"
CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
...@@ -7,6 +7,9 @@ USE_PROCD=1 ...@@ -7,6 +7,9 @@ USE_PROCD=1
ETHERNET_WAN=$(which ethernet_wan) ETHERNET_WAN=$(which ethernet_wan)
start_service() { start_service() {
# Only run for E600 board
[ "$(fw_printenv -n boardid)" != "E600" ] && exit 0
[ -n "$ETHERNET_WAN" ] && { [ -n "$ETHERNET_WAN" ] && {
procd_open_instance procd_open_instance
procd_set_param command "$ETHERNET_WAN" procd_set_param command "$ETHERNET_WAN"
......
...@@ -7,6 +7,8 @@ USE_PROCD=1 ...@@ -7,6 +7,8 @@ USE_PROCD=1
VOICE_MONITOR=$(which voice_monitor) VOICE_MONITOR=$(which voice_monitor)
start_service() { start_service() {
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
[ -n "$VOICE_MONITOR" ] && { [ -n "$VOICE_MONITOR" ] && {
procd_open_instance procd_open_instance
procd_set_param command "$VOICE_MONITOR" procd_set_param command "$VOICE_MONITOR"
......
#!/bin/sh
# Only run for E600 board
[ "$(fw_printenv -n boardid)" != "E600" ] && exit 0
if [ "$(fw_printenv -n Variant)" = "1" ]; then
fw_setenv Variant 2
setup_device.sh
fi
#!/bin/sh #!/bin/sh
. /lib/voice/utils.sh . /lib/voice/utils.sh
. /usr/share/libubox/jshn.sh
ubus call led.voice set '{"state":"off"}' ubus call led.voice set '{"state":"off"}'
check_voice() { check_voice() {
local account_enabled=0 local account_enabled=0
local registered=0 local registered=0
local global_led_state=""
while true; do while true; do
account_enabled=0 account_enabled=0
registered=0 registered=0
global_led_state=""
json_load "$(ubus -S call leds status 2> /dev/null)"
json_get_var global_led_state state
if [ "$global_led_state" = "test" ]; then
sleep 5
continue
fi
for peer in $(uci show $VOICE_UCI_CONFIG | grep sip_service_provider | awk -F[.,=] '{print$2}'); do for peer in $(uci show $VOICE_UCI_CONFIG | grep sip_service_provider | awk -F[.,=] '{print$2}'); do
[ "$(uci -q get $VOICE_UCI_CONFIG.$peer.enabled)" = "1" ] && account_enabled=1 [ "$(uci -q get $VOICE_UCI_CONFIG.$peer.enable)" = "1" ] && account_enabled=1
done done
if [ "$account_enabled" = "0" ]; then if [ "$account_enabled" = "0" ]; then
......
...@@ -7,6 +7,8 @@ USE_PROCD=1 ...@@ -7,6 +7,8 @@ USE_PROCD=1
VOICE_MONITOR=$(which voice_monitor) VOICE_MONITOR=$(which voice_monitor)
start_service() { start_service() {
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
[ -n "$VOICE_MONITOR" ] && { [ -n "$VOICE_MONITOR" ] && {
procd_open_instance procd_open_instance
procd_set_param command "$VOICE_MONITOR" procd_set_param command "$VOICE_MONITOR"
......
#!/bin/sh #!/bin/sh
. /lib/voice/utils.sh . /lib/voice/utils.sh
. /usr/share/libubox/jshn.sh
ubus call led.voice set '{"state":"off"}' ubus call led.voice set '{"state":"off"}'
check_voice() { check_voice() {
local account_enabled=0 local account_enabled=0
local registered=0 local registered=0
local global_led_state=""
while true; do while true; do
account_enabled=0 account_enabled=0
registered=0 registered=0
global_led_state=""
json_load "$(ubus -S call leds status 2> /dev/null)"
json_get_var global_led_state state
if [ "$global_led_state" = "test" ]; then
sleep 5
continue
fi
for peer in $(uci show $VOICE_UCI_CONFIG | grep sip_service_provider | awk -F[.,=] '{print$2}'); do for peer in $(uci show $VOICE_UCI_CONFIG | grep sip_service_provider | awk -F[.,=] '{print$2}'); do
[ "$(uci -q get $VOICE_UCI_CONFIG.$peer.enabled)" = "1" ] && account_enabled=1 [ "$(uci -q get $VOICE_UCI_CONFIG.$peer.enable)" = "1" ] && account_enabled=1
done done
if [ "$account_enabled" = "0" ]; then if [ "$account_enabled" = "0" ]; then
......
...@@ -7,6 +7,8 @@ USE_PROCD=1 ...@@ -7,6 +7,8 @@ USE_PROCD=1
VOICE_MONITOR=$(which voice_monitor) VOICE_MONITOR=$(which voice_monitor)
start_service() { start_service() {
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
[ -n "$VOICE_MONITOR" ] && { [ -n "$VOICE_MONITOR" ] && {
procd_open_instance procd_open_instance
procd_set_param command "$VOICE_MONITOR" procd_set_param command "$VOICE_MONITOR"
......
#!/bin/sh #!/bin/sh
. /lib/voice/utils.sh . /lib/voice/utils.sh
. /usr/share/libubox/jshn.sh
ubus call led.voice set '{"state":"off"}' ubus call led.voice set '{"state":"off"}'
check_voice() { check_voice() {
local account_enabled=0 local account_enabled=0
local registered=0 local registered=0
local global_led_state=""
while true; do while true; do
account_enabled=0 account_enabled=0
registered=0 registered=0
global_led_state=""
json_load "$(ubus -S call leds status 2> /dev/null)"
json_get_var global_led_state state
if [ "$global_led_state" = "test" ]; then
sleep 5
continue
fi
for peer in $(uci show $VOICE_UCI_CONFIG | grep sip_service_provider | awk -F[.,=] '{print$2}'); do for peer in $(uci show $VOICE_UCI_CONFIG | grep sip_service_provider | awk -F[.,=] '{print$2}'); do
[ "$(uci -q get $VOICE_UCI_CONFIG.$peer.enabled)" = "1" ] && account_enabled=1 [ "$(uci -q get $VOICE_UCI_CONFIG.$peer.enable)" = "1" ] && account_enabled=1
done done
if [ "$account_enabled" = "0" ]; then if [ "$account_enabled" = "0" ]; then
......
#!/bin/sh /etc/rc.common
START=21
STOP=90
USE_PROCD=1
. /lib/functions.sh
. /lib/functions/iopsys-environment.sh
VOICE_MONITOR=$(which voice_monitor)
start_service() {
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
[ -n "$VOICE_MONITOR" ] && {
procd_open_instance
procd_set_param command "$VOICE_MONITOR"
procd_set_param respawn
procd_close_instance
}
}
stop_service() {
[ -n "$VOICE_MONITOR" ] && service_stop "$VOICE_MONITOR"
}
boot() {
start
}
reload_service() {
stop
start
}
#!/bin/sh
. /lib/voice/utils.sh
. /usr/share/libubox/jshn.sh
ubus call led.voice set '{"state":"off"}'
check_voice() {
local account_enabled=0
local registered=0
local global_led_state=""
while true; do
account_enabled=0
registered=0
global_led_state=""
json_load "$(ubus -S call leds status 2> /dev/null)"
json_get_var global_led_state state
if [ "$global_led_state" = "test" ]; then
sleep 5
continue
fi
for peer in $(uci show $VOICE_UCI_CONFIG | grep sip_service_provider | awk -F[.,=] '{print$2}'); do
[ "$(uci -q get $VOICE_UCI_CONFIG.$peer.enable)" = "1" ] && account_enabled=1
done
if [ "$account_enabled" = "0" ]; then
ubus call led.voice set '{"state":"off"}'
else
asterisk -x 'pjsip show registrations' | grep -q "Registered" && registered=1
if [ "$registered" = "0" ]; then
ubus call led.voice set '{"state":"error"}'
else
ubus call led.voice set '{"state":"ok"}'
fi
fi
sleep 5
done
}
check_voice
...@@ -90,7 +90,7 @@ $(eval $(call Profile,koala)) ...@@ -90,7 +90,7 @@ $(eval $(call Profile,koala))
#################### EAGLE #################### EAGLE
define Profile/eagle define Profile/eagle
NAME:=eagle NAME:=eagle
PACKAGES:=i2c-tools PACKAGES:=i2c-tools $(VOICE_SUPPORT)
endef endef
define Profile/eagle/Description define Profile/eagle/Description
...@@ -99,18 +99,6 @@ endef ...@@ -99,18 +99,6 @@ endef
$(eval $(call Profile,eagle)) $(eval $(call Profile,eagle))
#################### ZEBRA
define Profile/zebra
NAME:=zebra
PACKAGES:=i2c-tools $(VOICE_SUPPORT)
endef
define Profile/zebra/Description
zebra profile
endef
$(eval $(call Profile,zebra))
#################### Xavi xug534 #################### Xavi xug534
define Profile/xug534 define Profile/xug534
NAME:=xug534 NAME:=xug534
......
#!/bin/sh
case "$ACTION" in
add|register)
[ "softresetbutton" == "$INTERFACE" ] && {
printf "\n\nSoft reset button is pressed\n\n" > /dev/console
reboot
}
;;
remove|unregister)
;;
esac
#!/bin/sh /etc/rc.common
START=8
boot() {
# Cold plug trigger - USB LED etc..
udevtrigger
}
net.ipv6.conf.archer.disable_ipv6=1
{
"events" : [
{
"type": "wifi-event",
"name": "broadcom",
"ifname" : "wl0*",
"family": "bcmwl",
"group": [
"notify"
]
},
{
"type": "wifi-event",
"name": "broadcom",
"ifname" : "wl1*",
"family": "bcmwl",
"group": [
"notify"
]
},
{
"type": "wifi-event",
"name": "cfg",
"ifname": "wl0",
"family": "nl80211",
"group": [
"scan"
]
},
{
"type": "wifi-event",
"name": "cfg",
"ifname": "wl1",
"family": "nl80211",
"group": [
"scan"
]
}
]
}
get_base_macaddr() {
local basemac="$(/usr/bin/kv_read BaseMacAddr)"
echo "$basemac"
}
get_macaddr_maxsize() {
local maxsize="$(/usr/bin/kv_read NumMacAddrs)"
echo "$maxsize"
}
get_board_id() {
local board_id="$(fw_printenv -n boardid | tr '_' '-')"
echo "$board_id"
}
get_product_name() {
local prodname="$(/usr/bin/kv_read ProdName)"
echo "$prodname"
}
get_serial_number() {
local serial_number="$(/usr/bin/kv_read SerialNumber)"
case $serial_number in
*[a-z]*|*[A-Z]*|*[0-9]*) ;;
*) serial_number="0000000000" ;;
esac
echo "$serial_number"
}
get_psn() {
local psn="$(/usr/bin/kv_read PSN)"
case $psn in
*[a-z]*|*[A-Z]*|*[0-9]*) ;;
*) psn="0000000000" ;;
esac
echo "$psn"
}
get_variant() {
local variant="$(/usr/bin/kv_read Variant)"
case $variant in
*[0-9]*) ;;
*) variant="0" ;;
esac
echo "$variant"
}
get_hardware_version() {
local hardware_version="$(/usr/bin/kv_read HV)"
case $hardware_version in
.[0-9]*) hardware_version="1$hardware_version" ;;
[0-9]*) ;;
*) hardware_version="0" ;;
esac
echo "$hardware_version"
}
get_wpa_key() {
local wpa_key="$(/usr/bin/kv_read WpaKey)"
case $wpa_key in
*[a-z]*|*[A-Z]*|*[0-9]*) wpa_key=$(echo $wpa_key | sed 's/[ \t]*$//') ;;
*) wpa_key="00000000" ;;
esac
echo "$wpa_key"
}
get_des_key() {
local des_key="$(/usr/bin/kv_read DesKey)"
echo "$des_key"
}
get_auth_key() {
local auth_key="$(/usr/bin/kv_read AuthKey)"
echo "$auth_key"
}
get_user_password() {
local user_pass="$(/usr/bin/kv_read UserPassword)"
echo "$user_pass"
}
get_acs_password() {
local acs_pass="$(/usr/bin/kv_read AcsPassword)"
echo "$acs_pass"
}
get_production_mode() {
local production="$(fw_printenv -n Production)"
echo "$production"
}
get_board_specific_encryption_key() {
[ -f /proc/device-tree/key_dev_specific_512 ] && cat /proc/device-tree/key_dev_specific_512 2> /dev/null
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment