mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 19:44:30 +08:00
Compare commits
74 Commits
release-4.
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b9f020d20 | ||
|
|
7a5da766a2 | ||
|
|
ff98b7dc3a | ||
|
|
b52f24d6df | ||
|
|
582ec662bb | ||
|
|
525d55177a | ||
|
|
5b69874139 | ||
|
|
92c7c24a43 | ||
|
|
906f7881c7 | ||
|
|
ec37110043 | ||
|
|
1cec925bbb | ||
|
|
bd6aa7ed3d | ||
|
|
4e3fbdb5b3 | ||
|
|
02363930c1 | ||
|
|
c35f3b1ca1 | ||
|
|
da88558c98 | ||
|
|
3fa918aacc | ||
|
|
406002c5b0 | ||
|
|
e4df6d3814 | ||
|
|
52a8c3b217 | ||
|
|
9c4252e918 | ||
|
|
39d7ee1f1a | ||
|
|
e446abffd3 | ||
|
|
a35497685b | ||
|
|
c364bb7f82 | ||
|
|
0440496d16 | ||
|
|
981d4b0b7d | ||
|
|
7513d32e91 | ||
|
|
45c4d8dc39 | ||
|
|
1fa45afa52 | ||
|
|
8c272d3613 | ||
|
|
8de301e38b | ||
|
|
f91e7063ca | ||
|
|
bcba464917 | ||
|
|
b1d03ebb60 | ||
|
|
833e1b90c5 | ||
|
|
206370c994 | ||
|
|
ad4d329dc1 | ||
|
|
f8857b208d | ||
|
|
f072c81d04 | ||
|
|
7799804f1d | ||
|
|
6d5130e982 | ||
|
|
b08f86d209 | ||
|
|
a9976f626b | ||
|
|
223f025b72 | ||
|
|
c8ba536d59 | ||
|
|
6781aad52e | ||
|
|
133ab71018 | ||
|
|
e3c43d892f | ||
|
|
d9380968a1 | ||
|
|
8784439985 | ||
|
|
d1ad9dc34f | ||
|
|
c430a0f15e | ||
|
|
800728c7aa | ||
|
|
38668ee8d9 | ||
|
|
e9d00040a7 | ||
|
|
bc5fad2c76 | ||
|
|
52ea555ffb | ||
|
|
eeecaa27de | ||
|
|
e8cf33b544 | ||
|
|
fb983f5dbc | ||
|
|
676e40a0cc | ||
|
|
215274ef98 | ||
|
|
02ca863b23 | ||
|
|
6f86f000b1 | ||
|
|
8506eed1e4 | ||
|
|
53b3f486bd | ||
|
|
e31e5f32da | ||
|
|
26c2dae0c9 | ||
|
|
2f2d88f770 | ||
|
|
540b09e26b | ||
|
|
001c25ee12 | ||
|
|
1193886cef | ||
|
|
cebc3f53e5 |
@@ -1,4 +1,4 @@
|
||||
|
||||
config service 'catv'
|
||||
option enable 'no'
|
||||
option enable '0'
|
||||
option filter '3'
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.3.0
|
||||
PKG_VERSION:=1.2.0
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=5a5c94b289c79bc3a635b8d742dd9b73dcc0615f
|
||||
PKG_SOURCE_VERSION:=0c029ed2486342e7e7687631b702d5c743f3c41a
|
||||
PKG_NAME:=dectmngr2
|
||||
|
||||
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7522faab4142fe2c0ac8cbf71bb0cc5bd49f0750
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
TARGET_PLATFORM=MARVELL
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
TARGET_PLATFORM=INTEL
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET)
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
|
||||
define Package/dslmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=XDSL status and configration utility
|
||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +easy-soc-libs
|
||||
endef
|
||||
|
||||
define Package/dslmngr/description
|
||||
This package can be used to configure and provide status about
|
||||
the XDSL subsystem through UBUS.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
FPIC="$(FPIC)"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/dslmngr/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
define Package/dslmngr/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dslmngr $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dslmngr))
|
||||
@@ -1,37 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-qos
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/easy-qos
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Easy QoS
|
||||
endef
|
||||
|
||||
define Package/easy-qos/description
|
||||
This package contains Easy QoS utitie
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/easy-qos/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
|
||||
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
|
||||
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,easy-qos))
|
||||
@@ -1 +0,0 @@
|
||||
/etc/init.d/easy_qos reload
|
||||
@@ -1,140 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos.ebtable -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
"low")
|
||||
echo 1;;
|
||||
"besteffort")
|
||||
echo 2;;
|
||||
"normal")
|
||||
echo 3;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 5;;
|
||||
"high")
|
||||
echo 6;;
|
||||
"highest")
|
||||
echo 7;;
|
||||
esac
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log ebtables -t broute -D BROUTING ${rule}
|
||||
rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
|
||||
done
|
||||
}
|
||||
|
||||
create_rule() {
|
||||
local protocol=$1; shift
|
||||
local mac=$1; shift
|
||||
local mark="0x$1"; shift
|
||||
local forward_port=$1;
|
||||
local cmd="";
|
||||
local protocol_number
|
||||
|
||||
cmd="-j mark --mark-or ${mark}";
|
||||
if [ -n "${forward_port}" ]; then
|
||||
cmd="--ip-destination-port ${forward_port} ${cmd}";
|
||||
fi
|
||||
|
||||
case "${protocol}" in
|
||||
"tcp")
|
||||
protocol_number=6;;
|
||||
"udp")
|
||||
protocol_number=17;;
|
||||
"dccp")
|
||||
protocol_number=33;;
|
||||
"sctp")
|
||||
protocol_number=132;;
|
||||
*)
|
||||
log "Protocol ${protocol} not supported in ebtables"
|
||||
return;;
|
||||
esac
|
||||
|
||||
cmd="--ip-proto ${protocol_number} $cmd"
|
||||
cmd="-p ip $cmd"
|
||||
|
||||
cmd="-s ${mac} $cmd"
|
||||
exec_log ebtables -t broute -A BROUTING ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num protocol
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
protocol=$(echo ${proto}|tr [A-Z] [a-z])
|
||||
prio_num=$(get_priority ${priority})
|
||||
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
|
||||
for p in ${port}; do
|
||||
if [ "${protocol}" == "none" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num} ${p}
|
||||
create_rule udp ${macaddr} ${prio_num} ${p}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num} ${p}
|
||||
fi
|
||||
done
|
||||
# Create rule for all ports if port is not mentioned in uci
|
||||
if [ -z "${port}" ]; then
|
||||
if [ "${protocol}" == "none" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num}
|
||||
create_rule udp ${macaddr} ${prio_num}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# Do not apply rules if ebtables is not present in system
|
||||
[ -x /usr/sbin/ebtables ] || return;
|
||||
|
||||
clear_existing_rules
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
}
|
||||
|
||||
start_service() {
|
||||
reload_service
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos"
|
||||
}
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
CLIENT_LIST="/tmp/easy_qos_client.list"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
"low")
|
||||
echo 1;;
|
||||
"besteffort")
|
||||
echo 2;;
|
||||
"normal")
|
||||
echo 3;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 5;;
|
||||
"high")
|
||||
echo 6;;
|
||||
"highest")
|
||||
echo 7;;
|
||||
esac
|
||||
}
|
||||
|
||||
clean_client_entries() {
|
||||
[ -f ${CLIENT_LIST} ] && rm ${CLIENT_LIST}
|
||||
}
|
||||
|
||||
map_client_entries() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(ubus call router.network 'clients')"
|
||||
json_get_keys keys
|
||||
|
||||
for key in ${keys};
|
||||
do
|
||||
json_select ${key}
|
||||
json_get_vars ipaddr macaddr hostname
|
||||
clients="${macaddr} ${ipaddr} ${hostname};${clients}"
|
||||
json_select ..
|
||||
done
|
||||
|
||||
json_init
|
||||
|
||||
# json_add_array "clients"
|
||||
IFS=";"
|
||||
for client in ${clients};
|
||||
do
|
||||
macaddr=$(echo ${client} | cut -d" " -f1)
|
||||
json_add_object "${macaddr//:/_}"
|
||||
json_add_string "ip" "$(echo ${client} | cut -d" " -f2)"
|
||||
json_add_string "macaddr" "$(echo ${client} | cut -d" " -f1)"
|
||||
json_add_string "host" "$(echo ${client} | cut -d" " -f3)"
|
||||
json_close_object
|
||||
done
|
||||
|
||||
IFS=' '
|
||||
echo `json_dump` > ${CLIENT_LIST}
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# Find the IP of a corresponding mac from arp table
|
||||
get_ipaddress() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(cat ${CLIENT_LIST})"
|
||||
json_get_keys keys
|
||||
|
||||
# jshn seems a bit iffy on having : in key, replace by _
|
||||
json_select "${1//:/_}" 2 > /dev/null
|
||||
json_get_var ip ip
|
||||
|
||||
echo "$ip"
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log iptables -t mangle ${rule}
|
||||
rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
done
|
||||
}
|
||||
|
||||
check_and_create() {
|
||||
iptables -t mangle -C PREROUTING ${@} 2>/dev/null
|
||||
# Create rule if not exists
|
||||
if [ ${?} -ne 0 ]; then
|
||||
exec_log iptables -t mangle -A PREROUTING ${@}
|
||||
else
|
||||
log "Rule exists for ${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
create_rule() {
|
||||
local proto=$1; shift
|
||||
local src_ip=$1; shift
|
||||
local mark="0x$1/0x$1"; shift
|
||||
local ports=$1;
|
||||
local cmd="";
|
||||
|
||||
cmd="-j MARK --set-xmark ${mark}";
|
||||
if [ -n "${ports}" ]; then
|
||||
cmd="--match multiport --dports ${ports} ${cmd}";
|
||||
fi
|
||||
|
||||
if [ "${proto}" == "icmp" ]; then
|
||||
cmd="-p icmp -m icmp --icmp-type 8 $cmd"
|
||||
elif [ "${proto}" == "all" ]; then
|
||||
cmd="-p all $cmd"
|
||||
else
|
||||
cmd="-p ${proto} -m ${proto} $cmd"
|
||||
fi
|
||||
cmd="-s ${src_ip} $cmd"
|
||||
|
||||
check_and_create ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num ip port_list
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
prio_num=$(get_priority ${priority})
|
||||
ip=$(get_ipaddress ${macaddr})
|
||||
port_list=$(echo ${port}|sed 's/ /,/g')
|
||||
|
||||
if [ -n "${ip}" -a -n "${prio_num}" ]; then
|
||||
if [ "${proto}" == "none" ]; then
|
||||
create_rule tcp ${ip} ${prio_num} ${port_list}
|
||||
create_rule udp ${ip} ${prio_num} ${port_list}
|
||||
else
|
||||
create_rule ${proto} ${ip} ${prio_num} ${port_list}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
clear_existing_rules
|
||||
map_client_entries
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
clean_client_entries
|
||||
}
|
||||
|
||||
start_service() {
|
||||
reload_service
|
||||
echo "Easy QoS installed">/dev/console;
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos"
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# Add firewall include
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.easyqos
|
||||
set firewall.easyqos=include
|
||||
set firewall.easyqos.path=/etc/firewall.easyqos
|
||||
set firewall.easyqos.reload=1
|
||||
uci del_list firewall.easyqos._access_w="root"
|
||||
uci add_list firewall.easyqos._access_w="root"
|
||||
commit firewall
|
||||
EOT
|
||||
@@ -15,9 +15,5 @@ config LIBDSL_DEBUG
|
||||
bool "Enable xdsl debugging"
|
||||
default n
|
||||
|
||||
config LIBDSL_TEST
|
||||
depends on PACKAGE_libdsl
|
||||
bool "Libdsl test program"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,18 +5,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=1.0.14
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=76a0b60abe97499e4fe83bffd5fd698ba8b336bc
|
||||
PKG_SOURCE_VERSION:=6a311af7cd17fc410c27de3cfae33b658195fd0b
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@inteno.se>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
endif
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@@ -37,24 +34,26 @@ endef
|
||||
define Package/libwifi
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= WiFi library (libwifi)
|
||||
DEPENDS+=+TARGET_intel_mips:libnl +TARGET_intel_mips:libnl-route
|
||||
endef
|
||||
|
||||
define Package/libdsl
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= XDSL library (libdsl)
|
||||
endef
|
||||
|
||||
define Package/libethernet
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= Ethernet library (libethernet)
|
||||
DEPENDS+=+TARGET_iopsys_ramips:swconfig
|
||||
DEPENDS:=+TARGET_iopsys_ramips:swconfig
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138 \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138
|
||||
KERNEL_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138 \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
|
||||
@@ -65,21 +64,13 @@ else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
TARGET_PLATFORM=INTEL
|
||||
TARGET_CFLAGS +=-DIOPSYS_INTEL
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET)
|
||||
$(info (UNEXPECTED CONFIG TARGET))
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
|
||||
ifdef CONFIG_IOP_LLA_LIBS_DEBUG
|
||||
TARGET_CFLAGS += -DIOP_LLA_LIBS_DEBUG
|
||||
endif
|
||||
|
||||
define Package/libdsl
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= XDSL library (libdsl)
|
||||
DEPENDS+=+TARGET_intel_mips:dsl-cpe-api-vrx +TARGET_intel_mips:dsl-cpe-fapi
|
||||
endef
|
||||
|
||||
subdirs := \
|
||||
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
|
||||
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
|
||||
@@ -87,22 +78,15 @@ subdirs := \
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
FPIC="$(FPIC)" \
|
||||
PLATFORM="$(TARGET_PLATFORM)" \
|
||||
subdirs="$(subdirs)"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/easy-soc-libs/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/InstallDev/libwifi
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
@@ -124,12 +108,6 @@ define Build/InstallDev/libethernet
|
||||
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default)
|
||||
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
||||
$(MAKE) -C "$(PKG_BUILD_DIR)/libdsl/test" $(MAKE_FLAGS)
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));)
|
||||
@@ -147,11 +125,7 @@ endef
|
||||
|
||||
define Package/libdsl/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
||||
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/test/libdsl_test $(1)/usr/bin/
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libwifi))
|
||||
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.2
|
||||
PKG_SOURCE_VERSION:=ef49d57c3824df4dfb4921d39461e2bd14f918a7
|
||||
PKG_SOURCE_VERSION:=a78fe95d5c5a0a320f3b62b9d2faafd07b56e3a7
|
||||
|
||||
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
@@ -17,9 +17,8 @@ BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
|
||||
PKG_SOURCE:=endptmngr-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
|
||||
PKG_NAME:=endptmngr-open
|
||||
PATCH_DIR:=
|
||||
else
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/endptmngr
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_NAME:=endptmngr
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
# Copyright (c) 2017 Genexis B.V.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# version 2 as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=gryphon-led-kernel-module
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/$(PKG_NAME)
|
||||
SUBMENU:=LED modules
|
||||
TITLE:=LED driver for Gryphon
|
||||
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
|
||||
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
|
||||
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
|
||||
PKG_LICENSE:=Genexis
|
||||
PKG_LICENSE_URL:=
|
||||
endef
|
||||
|
||||
define KernelPackage/$(PKG_NAME)/description
|
||||
This package contains the LED driver for Gryphon devices.
|
||||
endef
|
||||
|
||||
EXTRA_KCONFIG:= CONFIG_RGB_LED=m
|
||||
|
||||
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
|
||||
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/
|
||||
$(CP) src/* $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
SUBDIRS="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="-DKERNEL_MODULE $(BUILDFLAGS) -I$(LINUX_DIR)/include -include generated/autoconf.h $(MODULE_INCLUDE)" \
|
||||
modules
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,$(PKG_NAME)))
|
||||
@@ -1,26 +0,0 @@
|
||||
# Copyright (c) 2017 Genexis B.V.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# version 2 as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
MODULE_NAME = gryphon-led-kernel-module
|
||||
|
||||
obj-m := $(MODULE_NAME).o
|
||||
|
||||
GENEXIS_FILES= \
|
||||
main.o \
|
||||
sk9822.o \
|
||||
sk9822_bitbang.o
|
||||
|
||||
$(MODULE_NAME)-objs := $(GENEXIS_FILES)
|
||||
@@ -1,253 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define DEBUG 1
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/printk.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
|
||||
#define DRIVER_NAME "canyon_led"
|
||||
#define DRIVER_AUTHOR "Genexis B.V."
|
||||
#define DRIVER_DESC "Canyon LED driver for SK9822"
|
||||
#define DRIVER_VERSION "1"
|
||||
|
||||
/**
|
||||
* sysfs interfaces
|
||||
*/
|
||||
|
||||
static ssize_t get_led_color(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
/* [ln] todo: dummy implementation */
|
||||
int len;
|
||||
|
||||
len = sprintf(buf, "%d\n", 123);
|
||||
if (len <= 0) {
|
||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set complete LED strip to a specific color
|
||||
* @retval count number of bytes written
|
||||
* @retval -EMSGSIZE if the message is too big
|
||||
* @retval -EIO for all other errors (e.g. leds cannot be configured)
|
||||
*/
|
||||
static ssize_t set_led_color(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
int ret = 0;
|
||||
size_t buflen = count;
|
||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
||||
|
||||
if (IS_ERR(sk9822)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* strip newline */
|
||||
if ((count > 0) && (buf[count-1] == '\n')) {
|
||||
buflen--;
|
||||
}
|
||||
|
||||
if (buflen != 6) { // RRGGBB\0
|
||||
return -EMSGSIZE;
|
||||
}
|
||||
|
||||
// Update the LED array here
|
||||
ret = sk9822_set_color_str(sk9822, buf);
|
||||
if (ret != 0) {
|
||||
printk(KERN_ERR "Failed to set led color\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
// Now push to the HW
|
||||
ret = sk9822_update(sk9822);
|
||||
if (ret != 0) {
|
||||
printk(KERN_ERR "Failed to update led\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR(led_color, S_IRUGO | S_IWUSR, get_led_color, set_led_color);
|
||||
|
||||
static struct attribute *sk9822_dev_attrs[] = {
|
||||
&dev_attr_led_color.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
static struct attribute_group sk9822_dev_attr_group = {
|
||||
.name = "sk9822",
|
||||
.attrs = sk9822_dev_attrs,
|
||||
};
|
||||
|
||||
/**
|
||||
* device prope and removal
|
||||
*/
|
||||
|
||||
static int canyon_led_probe(struct platform_device *pdev)
|
||||
{
|
||||
int ret;
|
||||
struct sk9822_leds *leds;
|
||||
|
||||
leds = devm_kzalloc(&pdev->dev, sizeof(*leds), GFP_KERNEL);
|
||||
if (!leds) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
leds->dev = &pdev->dev;
|
||||
leds->led_brightness = SK9822_DEFAULT_BRIGHTNESS;
|
||||
|
||||
ret = of_property_read_u16(pdev->dev.of_node, "led-count", &leds->led_count);
|
||||
if (ret < 0) {
|
||||
dev_warn(&pdev->dev, "Could not read led-count property\n");
|
||||
leds->led_count = SK9822_DEFAULT_NUM_LEDS;
|
||||
}
|
||||
|
||||
leds->led_colors = devm_kzalloc(&pdev->dev,
|
||||
(sizeof(cRGB) * leds->led_count), GFP_KERNEL);
|
||||
if (!leds->led_colors) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
platform_set_drvdata(pdev, leds);
|
||||
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 16, 0)
|
||||
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
||||
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0, GPIOD_OUT_HIGH);
|
||||
#else
|
||||
dev_warn(&pdev->dev, "Kernel version Not supported\n");
|
||||
exit(1);
|
||||
#endif
|
||||
|
||||
gpiod_direction_output(leds->clock_gpio, 1);
|
||||
if (IS_ERR(leds->clock_gpio)) {
|
||||
dev_err(&pdev->dev, "Failed to acquire clock GPIO %ld\n",
|
||||
PTR_ERR(leds->clock_gpio));
|
||||
leds->clock_gpio = NULL;
|
||||
return PTR_ERR(leds->clock_gpio);
|
||||
} else {
|
||||
printk(KERN_INFO "Got clock gpio\n");
|
||||
gpiod_set_value(leds->clock_gpio, 0);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 16, 0)
|
||||
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
||||
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1, GPIOD_OUT_HIGH);
|
||||
#else
|
||||
dev_warn(&pdev->dev, "Kernel version Not supported\n");
|
||||
exit(1);
|
||||
#endif
|
||||
|
||||
gpiod_direction_output(leds->data_gpio, 1);
|
||||
if (IS_ERR(leds->data_gpio)) {
|
||||
dev_err(&pdev->dev, "Failed to acquire data GPIO %ld\n",
|
||||
PTR_ERR(leds->data_gpio));
|
||||
leds->data_gpio = NULL;
|
||||
return PTR_ERR(leds->data_gpio);
|
||||
} else {
|
||||
printk(KERN_INFO "Got data gpio\n");
|
||||
gpiod_set_value(leds->data_gpio, 0);
|
||||
}
|
||||
|
||||
printk(KERN_INFO "Attempt to set filefs stuff\n");
|
||||
ret = sysfs_create_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "sysfs creation failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if 0
|
||||
printk(KERN_INFO "Flash LEDs to verify they work\n");
|
||||
sk9822_set_color_str(leds, "00FF00");
|
||||
sk9822_update(leds);
|
||||
msleep(200);
|
||||
sk9822_set_color_str(leds, "000000");
|
||||
sk9822_update(leds);
|
||||
#endif
|
||||
|
||||
printk(KERN_INFO "canyon led successfully probed\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int canyon_led_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sk9822_leds *leds;
|
||||
|
||||
sysfs_remove_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
|
||||
|
||||
leds = platform_get_drvdata(pdev);
|
||||
if (IS_ERR(leds)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (leds->clock_gpio) {
|
||||
gpiod_put(leds->clock_gpio);
|
||||
}
|
||||
|
||||
if (leds->data_gpio) {
|
||||
gpiod_put(leds->data_gpio);
|
||||
}
|
||||
|
||||
printk(KERN_NOTICE "Bye, bye\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* platform driver metadata
|
||||
*/
|
||||
|
||||
static const struct of_device_id canyon_led_of_ids[] = {
|
||||
{ .compatible = "canyon,led" },
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct platform_driver canyon_led = {
|
||||
.probe = &canyon_led_probe,
|
||||
.remove = &canyon_led_remove,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = canyon_led_of_ids,
|
||||
},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, canyon_led_of_ids);
|
||||
module_platform_driver(canyon_led);
|
||||
MODULE_AUTHOR(DRIVER_AUTHOR);
|
||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||
MODULE_VERSION(DRIVER_VERSION);
|
||||
MODULE_LICENSE("GPL");
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
#include "sk9822_bitbang.h"
|
||||
|
||||
cRGB __hexs_to_rgb(const char *hex)
|
||||
{
|
||||
cRGB rgb;
|
||||
int r, g, b;
|
||||
|
||||
sscanf(hex, "%02x%02x%02x", &r, &g, &b);
|
||||
// This needs sanity checking
|
||||
rgb.r = r;
|
||||
rgb.g = g;
|
||||
rgb.b = b;
|
||||
return rgb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief update the color over the given device struct to the provided HEX color
|
||||
*/
|
||||
int sk9822_set_color_str(struct sk9822_leds *sk9822, const char *hex)
|
||||
{
|
||||
int i;
|
||||
cRGB color = __hexs_to_rgb(hex);
|
||||
|
||||
for (i = 0; i < sk9822->led_count; i++) {
|
||||
sk9822->led_colors[i] = color;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief write device struct to the device
|
||||
*/
|
||||
int sk9822_update(struct sk9822_leds *sk9822)
|
||||
{
|
||||
uint16_t i;
|
||||
uint16_t led_count = sk9822->led_count;
|
||||
|
||||
// Start Frame
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
|
||||
for (i = 0; i < led_count; i++) {
|
||||
cRGB *p = &sk9822->led_colors[i];
|
||||
sk9822_bb_write(sk9822, 0xe0+sk9822->led_brightness); // Maximum global brightness
|
||||
sk9822_bb_write(sk9822, p->b);
|
||||
sk9822_bb_write(sk9822, p->g);
|
||||
sk9822_bb_write(sk9822, p->r);
|
||||
}
|
||||
|
||||
// End frame
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef SK9822_H_
|
||||
#define SK9822_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define SK9822_DEFAULT_NUM_LEDS 32 // U16, used if DT param fails
|
||||
#define SK9822_DEFAULT_BRIGHTNESS 15 // 5-bit brightness, 0-31
|
||||
|
||||
typedef struct {
|
||||
uint8_t b;
|
||||
uint8_t g;
|
||||
uint8_t r;
|
||||
} cRGB; // BGR (SK9822 Standard)
|
||||
|
||||
struct sk9822_leds {
|
||||
struct device *dev;
|
||||
struct gpio_desc *clock_gpio;
|
||||
struct gpio_desc *data_gpio;
|
||||
|
||||
cRGB *led_colors;
|
||||
uint8_t led_brightness;
|
||||
uint16_t led_count;
|
||||
};
|
||||
|
||||
int sk9822_set_color_str(struct sk9822_leds *sk9822, const char *hex);
|
||||
int sk9822_update(struct sk9822_leds *sk9822);
|
||||
|
||||
#endif /* SK9822_H_ */
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
|
||||
/**
|
||||
* @brief Bitbang write operation CLOCK+DATA
|
||||
*
|
||||
* Assumed state before call: CLOCK- Low, DATA- High
|
||||
*/
|
||||
void sk9822_bb_write(struct sk9822_leds *sk9822, uint8_t c)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < 8 ; i++) {
|
||||
if (!(c&0x80)) {
|
||||
gpiod_set_value(sk9822->data_gpio, 0); // set data low
|
||||
} else {
|
||||
gpiod_set_value(sk9822->data_gpio, 1); // set data high
|
||||
}
|
||||
|
||||
gpiod_set_value(sk9822->clock_gpio, 1); // set clock high, data sampled here
|
||||
c <<= 1;
|
||||
udelay(1); // stretch clock
|
||||
gpiod_set_value(sk9822->clock_gpio, 0); // set clock low
|
||||
}
|
||||
|
||||
// State after call: SCK Low, Data high
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _SK9822_BB_H_
|
||||
#define _SK9822_BB_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
|
||||
void sk9822_bb_write(struct sk9822_leds *sk9822, uint8_t c);
|
||||
|
||||
#endif /* _SK9822_BB_H_ */
|
||||
4
ice-client/Config.in
Normal file
4
ice-client/Config.in
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
config ICE_OPEN
|
||||
bool "Use pre-compiled version for Open SDK"
|
||||
default n
|
||||
1046
ice-client/Makefile
Normal file
1046
ice-client/Makefile
Normal file
File diff suppressed because it is too large
Load Diff
74
ice-client/files/ice-client.uci_default
Normal file
74
ice-client/files/ice-client.uci_default
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/bin/sh
|
||||
|
||||
grep -rq "^ice:" /etc/passwd || {
|
||||
adduser -D -H -s /bin/false ice
|
||||
}
|
||||
|
||||
uci -q delete passwords.ice
|
||||
uci -q set passwords.ice=usertype
|
||||
uci -q set passwords.ice.password="\$WPAKEY"
|
||||
uci -q del_list passwords.ice._access_w=root
|
||||
uci -q add_list passwords.ice._access_w=root
|
||||
uci -q del_list passwords.ice._access_r=root
|
||||
uci -q add_list passwords.ice._access_r=root
|
||||
uci -q commit passwords
|
||||
|
||||
uci show rpcd | grep username=.*ice.* >/dev/null || {
|
||||
cat >> /etc/config/rpcd << EOF
|
||||
|
||||
config login
|
||||
option username 'ice'
|
||||
option password '\$p\$ice'
|
||||
list _access_w 'none'
|
||||
list write 'user-user'
|
||||
list write 'juci-broadcom-dsl'
|
||||
list write 'juci-broadcom-dsl-admin'
|
||||
list write 'juci-broadcom-ethernet'
|
||||
list write 'juci-broadcom-iptv'
|
||||
list write 'juci-broadcom-vlan'
|
||||
list write 'juci-broadcom-vlan-admin'
|
||||
list write 'juci-wireless'
|
||||
list write 'juci-wireless-admin'
|
||||
list write 'juci-catv'
|
||||
list write 'juci-ddns'
|
||||
list write 'juci-diagnostics'
|
||||
list write 'juci-dnsmasq-dhcp'
|
||||
list write 'juci-dropbear'
|
||||
list write 'juci-ethernet'
|
||||
list write 'juci-event'
|
||||
list write 'juci-firewall-fw3'
|
||||
list write 'juci-iconnect'
|
||||
list write 'juci-igmpinfo'
|
||||
list write 'juci-inteno-backup'
|
||||
list write 'juci-inteno-multiwan'
|
||||
list write 'juci-inteno-provisioning'
|
||||
list write 'juci-inteno-qos'
|
||||
list write 'juci-inteno-voice-client'
|
||||
list write 'juci-minidlna'
|
||||
list write 'juci-mod-status'
|
||||
list write 'juci-mod-system'
|
||||
list write 'juci-natalie-dect'
|
||||
list write 'juci-netmode'
|
||||
list write 'juci-network-netifd'
|
||||
list write 'juci-owsd'
|
||||
list write 'juci-printer'
|
||||
list write 'juci-realtime-graphs'
|
||||
list write 'juci-samba'
|
||||
list write 'juci-sfp'
|
||||
list write 'juci-snmpd'
|
||||
list write 'juci-sysupgrade'
|
||||
list write 'juci-uhttpd'
|
||||
list write 'juci-upnp'
|
||||
list write 'juci-usb'
|
||||
list write 'core'
|
||||
list write 'unauthenticated'
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
uci -q del_list dhcp.@domain[0].name="inteno.lan"
|
||||
uci -q add_list dhcp.@domain[0].name="inteno.lan"
|
||||
uci -q commit dhcp
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=4.0-2019-11-19
|
||||
PKG_VERSION:=4.0-2019-04-25
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7491e611712afb6ebf88098a099b25ef8c2f0a8b
|
||||
PKG_SOURCE_VERSION:=cd777bbd2dbe7477ec7665f12d3d20e6b2e9e052
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -51,20 +51,6 @@ define Package/icwmp_xmpp
|
||||
DEPENDS:=+libuci +libubox +libexpat +libstrophe
|
||||
endef
|
||||
|
||||
define Package/icwmp_twamp
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 twamp feature
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/icwmp_udpechoserver
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 udpechoserver feature
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/icwmp/Default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
@@ -215,25 +201,6 @@ define Package/icwmp_xmpp/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_xmppd $(1)/etc/init.d/icwmp_xmppd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_xmpp $(1)/etc/config
|
||||
$(CP) ./xmpp-files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/icwmp_udpechoserver/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_udpechoserverd $(1)/usr/sbin/icwmp_udpechoserverd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_udpechoserverd $(1)/etc/init.d/icwmp_udpechoserverd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_udpechoserver $(1)/etc/config
|
||||
endef
|
||||
|
||||
define Package/icwmp_twamp/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_twampd $(1)/usr/sbin/icwmp_twampd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_twampd $(1)/etc/init.d/icwmp_twampd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_twamp $(1)/etc/config
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
@@ -271,6 +238,4 @@ $(eval $(call BuildPackage,icwmp-curl))
|
||||
$(eval $(call BuildPackage,libdatamodel))
|
||||
$(eval $(call BuildPackage,icwmp_stun))
|
||||
$(eval $(call BuildPackage,icwmp_xmpp))
|
||||
$(eval $(call BuildPackage,icwmp_udpechoserver))
|
||||
$(eval $(call BuildPackage,icwmp_twamp))
|
||||
$(eval $(call BuildPackage,icwmp-zstream))
|
||||
|
||||
@@ -41,14 +41,4 @@ set_cwmp_reqopts() {
|
||||
fi
|
||||
}
|
||||
|
||||
regenerate_ssl_link(){
|
||||
local cert_dir="/etc/ssl/certs"
|
||||
local all_file=$(ls $cert_dir/*.pem)
|
||||
for cfile in $all_file
|
||||
do
|
||||
ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0
|
||||
done
|
||||
}
|
||||
|
||||
set_cwmp_reqopts
|
||||
regenerate_ssl_link
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -f /etc/config/cwmp_xmpp ] || exit 0
|
||||
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
[ "$INTERFACE" == "loopback" ] && exit 0
|
||||
|
||||
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
[ -n "$defwan" -a "$(uci -q get network.$defwan)" == "interface" -a "$defwan" != "$INTERFACE" ] && exit 0
|
||||
|
||||
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||
[ "$islan" == "1" ] && exit 0
|
||||
|
||||
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||
[ "$proto" == "none" ] && exit 0
|
||||
|
||||
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||
|
||||
/etc/init.d/icwmp_xmppd reload &
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=ifbt
|
||||
PKG_VERSION:=0.1
|
||||
|
||||
PKG_SOURCE_VERSION:=295262590c00e0e6683a51d28f6107b4678ebb8c
|
||||
PKG_SOURCE_VERSION:=0286812ed8036dea758f904694dc416481fba64d
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ifbt.git
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys
|
||||
# Copyright (C) 2018 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
@@ -15,6 +15,7 @@ PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/imonitor.git
|
||||
PKG_SOURCE_VERSION:=532f4900862bcb45d8cd4bf37555fabda81750b6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_MAINTAINER:=Sartura Support for Inteno <support-inteno@sartura.hr>
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@@ -23,7 +24,7 @@ include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/imonitor
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=iopsysWrt process supervisor
|
||||
TITLE:=Inteno process supervisor
|
||||
DEPENDS:=+ubox +uci +ubus +rpcd +rpcd-mod-file
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2016 iopsys
|
||||
# Copyright (C) 2016 Inteno
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -12,7 +12,7 @@ PKG_NAME:=inbd
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=53ca7f58edb87976b5897ccaf487bb0cbbf39d07
|
||||
PKG_SOURCE_VERSION:=12755fccb8ef87965ac684d62d56e19e73a255bd
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/inbd
|
||||
|
||||
@@ -34,7 +34,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/inbd
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=iopsys Netlink Bridge Daemon
|
||||
TITLE:=Inteno Netlink Bridge Daemon
|
||||
URL:=
|
||||
DEPENDS:=+libuci +libubus +libblobmsg-json +libnl-genl
|
||||
endef
|
||||
|
||||
@@ -20,7 +20,7 @@ define Package/iop
|
||||
endef
|
||||
|
||||
define Package/iop/description
|
||||
This package contains iopsysWrt SDK utilities
|
||||
This package contains Intenos Iop utilities
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
60
iop/config
60
iop/config
@@ -3,9 +3,11 @@ CONFIG_BUSYBOX_CUSTOM=y
|
||||
CONFIG_CCACHE=y
|
||||
CONFIG_DEBUG=y
|
||||
CONFIG_DEVEL=y
|
||||
# CONFIG_LOCALMIRROR is not set
|
||||
CONFIG_PACKAGE_6in4=y
|
||||
CONFIG_PACKAGE_6rd=y
|
||||
CONFIG_PACKAGE_6to4=y
|
||||
CONFIG_PACKAGE_6tunnel=y
|
||||
CONFIG_PACKAGE_alsa-lib=y
|
||||
CONFIG_PACKAGE_chat=y
|
||||
CONFIG_PACKAGE_comgt=y
|
||||
@@ -15,35 +17,57 @@ CONFIG_PACKAGE_crashlog=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_ds-lite=y
|
||||
CONFIG_PACKAGE_gdb=m
|
||||
CONFIG_PACKAGE_gdbserver=m
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_glib2=y
|
||||
CONFIG_PACKAGE_ice-client=y
|
||||
CONFIG_PACKAGE_ice-client-camerawatch=m
|
||||
CONFIG_PACKAGE_ice-client-fileme=m
|
||||
CONFIG_PACKAGE_ice-client-gigaset=m
|
||||
CONFIG_PACKAGE_ice-client-guest=m
|
||||
CONFIG_PACKAGE_ice-client-iperf=m
|
||||
CONFIG_PACKAGE_ice-client-logreader=m
|
||||
CONFIG_PACKAGE_ice-client-monitor=m
|
||||
CONFIG_PACKAGE_ice-client-netrounds=m
|
||||
CONFIG_PACKAGE_ice-client-rshell=m
|
||||
CONFIG_PACKAGE_ice-client-texec=m
|
||||
CONFIG_PACKAGE_icwmp-curl=y
|
||||
CONFIG_PACKAGE_ifbt=y
|
||||
CONFIG_PACKAGE_imonitor=y
|
||||
CONFIG_PACKAGE_inbd=y
|
||||
CONFIG_PACKAGE_iopupgrade=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
CONFIG_PACKAGE_iperf3=y
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_iperf-mt=y
|
||||
CONFIG_PACKAGE_ipset=y
|
||||
CONFIG_PACKAGE_iptables=y
|
||||
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
CONFIG_PACKAGE_iup=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_juci=y
|
||||
CONFIG_PACKAGE_juci-config-backup=y
|
||||
CONFIG_PACKAGE_juci-broadcom-iptv=y
|
||||
CONFIG_PACKAGE_juci-broadcom-pwrmgmt=y
|
||||
CONFIG_PACKAGE_juci-wifilife=y
|
||||
CONFIG_PACKAGE_juci-wireless=y
|
||||
CONFIG_PACKAGE_juci-ddns=y
|
||||
CONFIG_PACKAGE_juci-diagnostics=y
|
||||
CONFIG_PACKAGE_juci-dnsmasq-dhcp=y
|
||||
CONFIG_PACKAGE_juci-dropbear=y
|
||||
CONFIG_PACKAGE_juci-event=y
|
||||
CONFIG_PACKAGE_juci-firewall-fw3=y
|
||||
CONFIG_PACKAGE_juci-ice-client=y
|
||||
CONFIG_PACKAGE_juci-icwmp=y
|
||||
CONFIG_PACKAGE_juci-igmpinfo=y
|
||||
CONFIG_PACKAGE_juci-config-backup=y
|
||||
CONFIG_PACKAGE_juci-mwan3=y
|
||||
CONFIG_PACKAGE_juci-iup=y
|
||||
# CONFIG_PACKAGE_juci-qos is not set
|
||||
CONFIG_PACKAGE_juci-voice-client=y
|
||||
CONFIG_PACKAGE_juci-macdb=y
|
||||
CONFIG_PACKAGE_juci-minidlna=y
|
||||
CONFIG_PACKAGE_juci-mod-status=y
|
||||
CONFIG_PACKAGE_juci-mod-system=y
|
||||
CONFIG_PACKAGE_juci-mwan3=y
|
||||
CONFIG_PACKAGE_juci-natalie-dect=y
|
||||
CONFIG_PACKAGE_juci-netmode=y
|
||||
CONFIG_PACKAGE_juci-network-device=y
|
||||
CONFIG_PACKAGE_juci-network-dsl=y
|
||||
@@ -51,20 +75,24 @@ CONFIG_PACKAGE_juci-network-netifd=y
|
||||
CONFIG_PACKAGE_juci-network-port=y
|
||||
CONFIG_PACKAGE_juci-openvpn=y
|
||||
CONFIG_PACKAGE_juci-owsd=y
|
||||
CONFIG_PACKAGE_juci-printer=y
|
||||
CONFIG_PACKAGE_juci-realtime-graphs=y
|
||||
CONFIG_PACKAGE_juci-samba=y
|
||||
CONFIG_PACKAGE_juci-simple-gui=y
|
||||
CONFIG_PACKAGE_juci-snmpd=y
|
||||
CONFIG_PACKAGE_juci-sysupgrade=y
|
||||
CONFIG_PACKAGE_juci-theme-iopsys=y
|
||||
CONFIG_PACKAGE_juci-ubus-core=y
|
||||
CONFIG_PACKAGE_juci-upnp=y
|
||||
CONFIG_PACKAGE_juci-usb=y
|
||||
CONFIG_PACKAGE_juci-voice-client=y
|
||||
CONFIG_PACKAGE_juci-wifilife=y
|
||||
CONFIG_PACKAGE_juci-wireless=y
|
||||
CONFIG_PACKAGE_juci-theme-iopsys=y
|
||||
CONFIG_PACKAGE_juci-utils=y
|
||||
# CONFIG_PACKAGE_kmod-ipt-nathelper is not set
|
||||
CONFIG_PACKAGE_kmod-nls-base=y
|
||||
CONFIG_PACKAGE_kmod-siit=y
|
||||
CONFIG_PACKAGE_libcgroup-daemon=y
|
||||
CONFIG_PACKAGE_libcgroup=y
|
||||
# CONFIG_PACKAGE_libcgroup-utils is not set
|
||||
CONFIG_PACKAGE_ldd=y
|
||||
CONFIG_PACKAGE_libdaemon=y
|
||||
CONFIG_PACKAGE_libffmpeg-mini=y
|
||||
CONFIG_PACKAGE_libgmp=y
|
||||
@@ -72,10 +100,14 @@ CONFIG_PACKAGE_libreadline=y
|
||||
CONFIG_PACKAGE_loop-detector=m
|
||||
CONFIG_PACKAGE_minidlna=y
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_mtd-utils=y
|
||||
CONFIG_PACKAGE_mtd-utils-deubinize=y
|
||||
CONFIG_PACKAGE_mtd-utils-imagewrite=y
|
||||
CONFIG_PACKAGE_mtd-utils-mkfs.jffs2=y
|
||||
CONFIG_PACKAGE_mtd-utils-nanddump=y
|
||||
CONFIG_PACKAGE_mwan3=y
|
||||
CONFIG_PACKAGE_nand-utils=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_ntfs-3g=y
|
||||
CONFIG_PACKAGE_ntpd=y
|
||||
CONFIG_PACKAGE_odhcp6c=y
|
||||
@@ -84,6 +116,7 @@ CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
# CONFIG_PACKAGE_p910nd is not set
|
||||
CONFIG_PACKAGE_peripheral_manager=y
|
||||
CONFIG_PACKAGE_port-management=y
|
||||
CONFIG_PACKAGE_power-management=y
|
||||
@@ -154,6 +187,7 @@ CONFIG_BUSYBOX_CONFIG_MICROCOM=y
|
||||
# CONFIG_BUSYBOX_CONFIG_RMMOD is not set
|
||||
CONFIG_BUSYBOX_CONFIG_STTY=y
|
||||
CONFIG_BUSYBOX_CONFIG_TFTP=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_2_4_MODULES is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
|
||||
@@ -167,9 +201,11 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_SETUID=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_USE_SENDFILE=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_NOLOGIN is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_SECURETTY=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_TASKSET_FANCY is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_GET=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_PUT=y
|
||||
@@ -179,6 +215,7 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_PUT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_PAM is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_TFTP_DEBUG is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_NTPD is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER is not set
|
||||
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
# CONFIG_LIBCURL_MBEDTLS is not set
|
||||
CONFIG_LIBCURL_OPENSSL=y
|
||||
@@ -187,6 +224,7 @@ CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_SIGNED_PACKAGES is not set
|
||||
CONFIG_KERNEL_DEVTMPFS=y
|
||||
CONFIG_KERNEL_DEVTMPFS_MOUNT=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
||||
CONFIG_LOCALMIRROR="http://download.iopsys.eu/iopsys/mirror/"
|
||||
CONFIG_PACKAGE_iopupgrade=y
|
||||
|
||||
|
||||
@@ -32,15 +32,13 @@ function feeds_update {
|
||||
fi
|
||||
|
||||
# targets need to be installed explicitly
|
||||
targets="iopsys-brcm63xx-mips iopsys-brcm63xx-arm iopsys-ramips intel_mips"
|
||||
for target in $targets
|
||||
do
|
||||
rm -f target/linux/$target
|
||||
./scripts/feeds install -p targets $target
|
||||
done
|
||||
./scripts/feeds install -p targets iopsys-brcm63xx-mips
|
||||
./scripts/feeds install -p targets iopsys-brcm63xx-arm
|
||||
./scripts/feeds install -p targets iopsys-ramips
|
||||
./scripts/feeds install -p intel_targets intel_mips
|
||||
|
||||
# install all packages
|
||||
./scripts/feeds install -a
|
||||
./scripts/feeds install -a
|
||||
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete
|
||||
@@ -49,7 +47,7 @@ function feeds_update {
|
||||
make defconfig
|
||||
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap
|
||||
touch tmp/.iop_bootstrap
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig {
|
||||
export OPENSDK=0
|
||||
export CLEAN=0
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
@@ -12,110 +11,40 @@ function genconfig {
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
#always use the mirror
|
||||
export DEVELOPER=0
|
||||
LOCAL_MIRROR="http://mirror.inteno.se/mirror"
|
||||
|
||||
target="bogus"
|
||||
config_path=""
|
||||
brcm63xx_mips="target/linux/iopsys-brcm63xx-mips"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
|
||||
bcmAllowed=0
|
||||
iceAllowed=0
|
||||
endptAllowed=0
|
||||
natalieAllowed=0
|
||||
mediatekAllowed=0
|
||||
wifilifeAllowed=0
|
||||
defaultConsumerAllowed=0
|
||||
baseURL=""
|
||||
|
||||
|
||||
function find_last {
|
||||
egrep "^[ #]*${1}[ =]" $2 | tail -n1
|
||||
}
|
||||
|
||||
function is_new {
|
||||
for opt in $conf_warned
|
||||
do
|
||||
if [ "$opt" == "$1" ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
# option not found return true
|
||||
return 0
|
||||
}
|
||||
|
||||
function verify_config {
|
||||
IFS=$'\n'
|
||||
org=$(<.genconfig.config)
|
||||
unset IFS
|
||||
local num
|
||||
local conf_opt
|
||||
local conf_org
|
||||
local conf_new
|
||||
|
||||
#echo "lines to check $tot_lines"
|
||||
num=0
|
||||
for line in $org
|
||||
do
|
||||
conf_opt=$(echo $line | grep CONFIG_ | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
|
||||
if [ -n "${conf_opt}" ]
|
||||
then
|
||||
conf_org=$(find_last ${conf_opt} .genconfig.config)
|
||||
conf_new=$(find_last ${conf_opt} .config)
|
||||
if [ "$conf_org" != "$conf_new" ]
|
||||
then
|
||||
if is_new $conf_opt
|
||||
then
|
||||
echo -e "config option [${Red}$conf_opt${Color_Off}] is not set correctly in .config"
|
||||
echo -e "got value [${Yellow}$conf_new${Color_Off}] but wanted [${Yellow}$conf_org${Color_Off}]"
|
||||
echo "This is a real problem somebody needs to investigate"
|
||||
echo ""
|
||||
conf_warned="$conf_warned $conf_opt"
|
||||
fi
|
||||
else
|
||||
true
|
||||
# for debug to see all options
|
||||
#echo -e "wanted [$conf_org] got [$conf_new]"
|
||||
fi
|
||||
fi
|
||||
num=$((num+1))
|
||||
done
|
||||
}
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
|
||||
[ -e $brcm63xx_mips/genconfig ] &&
|
||||
iopsys_brcm63xx_mips=$(cd $brcm63xx_mips; ./genconfig)
|
||||
[ -e $brcm63xx_arm/genconfig ] &&
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
local iopsys_brcm63xx_mips=$(cd target/linux/iopsys-brcm63xx-mips; ./genconfig)
|
||||
local iopsys_brcm63xx_arm=$(cd target/linux/iopsys-brcm63xx-arm; ./genconfig)
|
||||
local iopsys_ramips=$(cd target/linux/iopsys-ramips; ./genconfig)
|
||||
local intel_mips=$(cd target/linux/intel_mips; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
done
|
||||
done
|
||||
return
|
||||
if [ "$profile" == "LIST" ]
|
||||
then
|
||||
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips intel_mips
|
||||
do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}
|
||||
do
|
||||
echo -e "\t$b"
|
||||
done
|
||||
done
|
||||
return
|
||||
fi
|
||||
|
||||
local targets
|
||||
|
||||
for p in $iopsys_brcm63xx_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_mips"
|
||||
config_path="$brcm63xx_mips/config"
|
||||
config_path="target/linux/iopsys-brcm63xx-mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -123,7 +52,7 @@ function genconfig {
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
config_path="$brcm63xx_arm/config"
|
||||
config_path="target/linux/iopsys-brcm63xx-arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -131,21 +60,44 @@ function genconfig {
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
config_path="$ramips/config"
|
||||
config_path="target/linux/iopsys-ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_intel_mips; do
|
||||
for p in $intel_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
config_path="$intel_mips/config"
|
||||
config_path="target/linux/intel_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
git remote -v | grep -q http || {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
iceAllowed=0
|
||||
endptAllowed=0
|
||||
natalieAllowed=0
|
||||
mediatekAllowed=0
|
||||
wifilifeAllowed=0
|
||||
|
||||
allowedRepos="$(ssh -o ConnectTimeout=5 git@private.inteno.se 2>/dev/null | grep -w 'R\|W' | awk '{print$NF}')"
|
||||
for repo in $allowedRepos; do
|
||||
case $repo in
|
||||
bcmkernel) bcmAllowed=1 ;;
|
||||
ice-client) iceAllowed=1 ;;
|
||||
endptcfg) endptAllowed=1 ;;
|
||||
natalie-dect*) natalieAllowed=1 ;;
|
||||
linux) mediatekAllowed=1 ;;
|
||||
wifilife) wifilifeAllowed=1 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
@@ -154,19 +106,17 @@ function genconfig {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -c|--clean\tRemove all files under ./files and import from config "
|
||||
echo -e " -v|--verbose\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -s|--override\t\tEnable 'Package source tree override'"
|
||||
echo -e " -S|--brcmsingle\tForce build of bcmkernel to use only one thread"
|
||||
echo -e " -h|--help\t\tShow this message"
|
||||
echo -e " -s|--override\tEnable 'Package source tree override'"
|
||||
echo -e " -h|--help\tShow this message"
|
||||
echo -e " -l|--list [customer]\tList all Customers or all boards for one customer"
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo -e " -O|--opensdk\t\tUse the iopsysWRT opensdk"
|
||||
echo -e " -a|--list-all\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig dg200 TELIA"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo "Example ./iop genconfig vg50 TELIA"
|
||||
echo "(if no customerconfig is chosen the Inteno Config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
@@ -226,18 +176,17 @@ function genconfig {
|
||||
|
||||
setup_dirs()
|
||||
{
|
||||
|
||||
if [[ ! -z $CUSTREPO ]]; then
|
||||
if git ls-remote $CUSTREPO -q 2>/dev/null; then
|
||||
if [ ! -d "$CUSTPATH" ]; then
|
||||
git clone "$CUSTREPO" "$CUSTPATH"
|
||||
elif [ $IMPORT -eq 1 ]; then
|
||||
cd $CUSTPATH
|
||||
v "git pull"
|
||||
git pull
|
||||
cd - >/dev/null #go back
|
||||
fi
|
||||
if ssh -o ConnectTimeout=5 git@private.inteno.se 2>/dev/null | grep -qw ${CUSTREPO:22}; then
|
||||
if [ ! -d "$CUSTPATH" ]; then
|
||||
git clone "$CUSTREPO" "$CUSTPATH"
|
||||
elif [ $IMPORT -eq 1 ]; then
|
||||
cd $CUSTPATH
|
||||
v "git pull"
|
||||
git pull
|
||||
cd - >/dev/null #go back
|
||||
fi
|
||||
else
|
||||
echo "You do not have access to $CUSTREPO"
|
||||
fi
|
||||
|
||||
if [ ! -d "$FILEDIR" ]; then
|
||||
@@ -357,7 +306,7 @@ function genconfig {
|
||||
[ $mediatekAllowed -eq 0 ] && echo "CONFIG_MEDIATEK_OPEN=y" >> .config
|
||||
[ $wifilifeAllowed -eq 0 ] && echo "CONFIG_WIFILIFE_OPEN=y" >> .config
|
||||
else
|
||||
echo "# CONFIG_GITMIRROR_REWRITE is not set" >>.config
|
||||
echo "CONFIG_GITMIRROR_REWRITE=n" >>.config
|
||||
echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
echo "CONFIG_ICE_OPEN=y" >> .config
|
||||
echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
@@ -366,11 +315,6 @@ function genconfig {
|
||||
echo "CONFIG_WIFILIFE_OPEN=y" >> .config
|
||||
fi
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
then
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# Force regeneration of themes
|
||||
touch package/feeds/juci/juci/Makefile
|
||||
|
||||
@@ -383,9 +327,6 @@ function genconfig {
|
||||
# so just touch that file.
|
||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||
|
||||
# Store generated config
|
||||
cp .config .genconfig.config
|
||||
|
||||
# Set default values based on selected parameters
|
||||
v "$(make defconfig 2>&1)"
|
||||
|
||||
@@ -393,8 +334,6 @@ function genconfig {
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
v "$(make package/base-files/clean 2>&1)"
|
||||
|
||||
verify_config
|
||||
}
|
||||
|
||||
####### main #####
|
||||
@@ -413,14 +352,12 @@ function genconfig {
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
|
||||
-O|--opensdk) export OPENSDK=1;;
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-p|--profile) export PROFILE="$2"; shift;;
|
||||
-r|--repo) export CUSTREPO="$2"; shift;;
|
||||
-s|--override) export SRCTREEOVERR=1;;
|
||||
-S|--brcmsingel) export BRCM_MAX_JOBS=1;;
|
||||
-h|--help) usage;;
|
||||
-l|--list) list_customers 0 $2;;
|
||||
-a|--list-all)list_customers 1;;
|
||||
@@ -435,37 +372,7 @@ function genconfig {
|
||||
shift;
|
||||
done
|
||||
|
||||
#Check if you should have public or private access
|
||||
DEVELOPER=1
|
||||
|
||||
if git remote -v | grep -q http; then
|
||||
baseURL="https://dev.iopsys.eu/"
|
||||
DEVELOPER=0
|
||||
else
|
||||
baseURL="git@dev.iopsys.eu:"
|
||||
fi
|
||||
|
||||
if [[ $OPENSDK -eq 0 ]] ; then
|
||||
git ls-remote $"${baseURL}consumer/iopsys.git" -q 2>/dev/null && defaultConsumerAllowed=1
|
||||
|
||||
git ls-remote $"${baseURL}broadcom/bcmcreator.git" -q 2>/dev/null && bcmAllowed=1
|
||||
git ls-remote $"${baseURL}mediatek/linux.git" -q 2>/dev/null && mediatekAllowed=1
|
||||
git ls-remote $"${baseURL}dialog/natalie-dect-12.26.git" -q 2>/dev/null && natalieAllowed=1
|
||||
git ls-remote $"${baseURL}iopsys/endptmngr.git" -q 2>/dev/null && endptAllowed=1
|
||||
git ls-remote $"${baseURL}iopsys/wifilife.git" -q 2>/dev/null && wifilifeAllowed=1
|
||||
git ls-remote git@private.inteno.se:ice-client.git -q -q 2>/dev/null && iceAllowed=1
|
||||
|
||||
if [[ $defaultConsumerAllowed -eq 1 ]] && [[ $baseURL == *"git@"* ]]
|
||||
then
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
elif [[ $defaultConsumerAllowed -eq 1 ]] && [[ $baseURL == *"https"* ]]
|
||||
then
|
||||
CUSTREPO="${CUSTREPO:-https://dev.iopsys.eu/consumer/iopsys.git}"
|
||||
else
|
||||
CUSTREPO="${CUSTREPO:-}"
|
||||
fi
|
||||
fi
|
||||
echo "custrepo: $CUSTREPO"
|
||||
CUSTREPO="${CUSTREPO:-git@private.inteno.se:customerconfigs}"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
|
||||
@@ -1,378 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig_min {
|
||||
export CLEAN=0
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
#always use the mirror
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
config_path=""
|
||||
brcm63xx_mips="target/linux/iopsys-brcm63xx-mips"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
|
||||
function find_last {
|
||||
egrep "^[ #]*${1}[ =]" $2 | tail -n1
|
||||
}
|
||||
|
||||
function is_new {
|
||||
for opt in $conf_warned
|
||||
do
|
||||
if [ "$opt" == "$1" ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
# option not found return true
|
||||
return 0
|
||||
}
|
||||
|
||||
function verify_config {
|
||||
IFS=$'\n'
|
||||
org=$(<.genconfig.config)
|
||||
unset IFS
|
||||
local num
|
||||
local conf_opt
|
||||
local conf_org
|
||||
local conf_new
|
||||
|
||||
#echo "lines to check $tot_lines"
|
||||
num=0
|
||||
for line in $org
|
||||
do
|
||||
conf_opt=$(echo $line | grep CONFIG_ | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
|
||||
if [ -n "${conf_opt}" ]
|
||||
then
|
||||
conf_org=$(find_last ${conf_opt} .genconfig.config)
|
||||
conf_new=$(find_last ${conf_opt} .config)
|
||||
if [ "$conf_org" != "$conf_new" ]
|
||||
then
|
||||
if is_new $conf_opt
|
||||
then
|
||||
echo -e "config option [${Red}$conf_opt${Color_Off}] is not set correctly in .config"
|
||||
echo -e "got value [${Yellow}$conf_new${Color_Off}] but wanted [${Yellow}$conf_org${Color_Off}]"
|
||||
echo "This is a real problem somebody needs to investigate"
|
||||
echo ""
|
||||
conf_warned="$conf_warned $conf_opt"
|
||||
fi
|
||||
else
|
||||
true
|
||||
# for debug to see all options
|
||||
#echo -e "wanted [$conf_org] got [$conf_new]"
|
||||
fi
|
||||
fi
|
||||
num=$((num+1))
|
||||
done
|
||||
}
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
|
||||
[ -e $brcm63xx_mips/genconfig ] &&
|
||||
iopsys_brcm63xx_mips=$(cd $brcm63xx_mips; ./genconfig)
|
||||
[ -e $brcm63xx_arm/genconfig ] &&
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
done
|
||||
done
|
||||
return
|
||||
fi
|
||||
|
||||
for p in $iopsys_brcm63xx_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_mips"
|
||||
config_path="$brcm63xx_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
config_path="$brcm63xx_arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_intel_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
config_path="$intel_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -s|--override\t\tEnable 'Package source tree override'"
|
||||
echo -e " -S|--brcmsingle\tForce build of bcmkernel to use only one thread"
|
||||
echo -e " -h|--help\t\tShow this message"
|
||||
echo -e " -l|--list [customer]\tList all Customers or all boards for one customer"
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig dg400prime IOPSYS"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
|
||||
list_customers()
|
||||
{
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common )"
|
||||
if [ "$boards" ]; then
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "No boards found for $CUSTOMER"
|
||||
fi
|
||||
elif [ "$CUSTOMER" ]; then
|
||||
echo "No customer called $CUSTOMER"
|
||||
exit 1
|
||||
elif [ -d $CUSTCONF ]; then
|
||||
local customers="$(ls -1 $CUSTCONF)"
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common )"
|
||||
if [ "$boards" ]; then
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "has no boards"
|
||||
fi
|
||||
done
|
||||
elif [ "$customers" ]; then
|
||||
echo -e "$customers"
|
||||
else
|
||||
echo "no customers found"
|
||||
fi
|
||||
else
|
||||
echo "No $CUSTCONF folder found"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
{
|
||||
|
||||
if [ ! -d "$FILEDIR" ]; then
|
||||
mkdir -p $FILEDIR
|
||||
elif [ -d "$FILEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
}
|
||||
|
||||
create_and_copy_files()
|
||||
{
|
||||
local BOARDTYPE=$1
|
||||
shift
|
||||
local CUSTOMERS=$@
|
||||
|
||||
# Validate seleced board and customers
|
||||
set_target $BOARDTYPE
|
||||
if [ $target == "bogus" ]; then
|
||||
echo "Hardware profile does not exist"
|
||||
exit 1
|
||||
elif [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ ! -d "$CUSTCONF/$CUSTOMER/" ]; then
|
||||
echo "Customer profile for '$CUSTOMER' does not exist"
|
||||
exit 1
|
||||
elif [ ! -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/" ]; then
|
||||
echo "'$BOARDTYPE' board profile does not exist for customer '$CUSTOMER'"
|
||||
if [ -f "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
echo "Common profile configuration will be used"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Generate base config
|
||||
rm -f .config
|
||||
v "Config $BOARDTYPE selected"
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $config_path/config ]; then
|
||||
cat $config_path/config >> .config
|
||||
fi
|
||||
if [ -f $config_path/$BOARDTYPE/config ]; then
|
||||
cat $config_path/$BOARDTYPE/config >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips which use TARGET_DEVICES
|
||||
if [ "$target" = "intel_mips" ]; then
|
||||
subtarget="xrx500"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
fi
|
||||
|
||||
echo "$CUSTOMERS $BOARDTYPE" > $CURRENT_CONFIG_FILE
|
||||
|
||||
# Add customerconfig diff if a customer is selected
|
||||
if [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/common/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR" CUSTREPO="${CUSTREPO:-}"
|
||||
|
||||
cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
# developer mode selected ?
|
||||
echo "CONFIG_DEVEL=y" >>.config
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
then
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# Force regeneration of kernel Makefile
|
||||
# Needed to disable kmods for iopsys-brcm targets
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
# we need to signal to bradcom SDK that we have changed the board id
|
||||
# currently boardparms.c and boardparms_voice.c is the only place that is depending on inteno boardid name
|
||||
# so just touch that file.
|
||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||
|
||||
# Store generated config
|
||||
cp .config .genconfig.config
|
||||
|
||||
# Set default values based on selected parameters
|
||||
v "$(make defconfig 2>&1)"
|
||||
|
||||
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
v "$(make package/base-files/clean 2>&1)"
|
||||
|
||||
verify_config
|
||||
}
|
||||
|
||||
####### main #####
|
||||
if [ ! -e tmp/.iop_bootstrap ]; then
|
||||
echo "You have not installed feeds. Running genconfig in this state would create a non functional configuration."
|
||||
echo "Run: iop feeds_update"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo Current profile:
|
||||
cat $CURRENT_CONFIG_FILE
|
||||
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
else
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-p|--profile) export PROFILE="$2"; shift;;
|
||||
-r|--repo) export CUSTREPO="$2"; shift;;
|
||||
-s|--override) export SRCTREEOVERR=1;;
|
||||
-S|--brcmsingel) export BRCM_MAX_JOBS=1;;
|
||||
-h|--help) usage;;
|
||||
-l|--list) list_customers 0 $2;;
|
||||
-a|--list-all)list_customers 1;;
|
||||
-b|--boards)set_target LIST;exit 0;;
|
||||
-*)
|
||||
echo "Invalid option: $1 "
|
||||
echo "Try -h or --help for more information."
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig_min" "Generate configuration for customer with manual board configuration"
|
||||
@@ -59,24 +59,30 @@ build_endptmngr_consumer() {
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_ice_consumer() {
|
||||
# create ice-client open version tar file
|
||||
local iceversion icebasever icerelease icecommith
|
||||
icecommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/ice-client/Makefile | head -1 | cut -d'=' -f2)
|
||||
icebasever=$(grep -w "BASE_PKG_VERSION:" ./feeds/iopsys/ice-client/Makefile | cut -d'=' -f2)
|
||||
icerelease=$(grep -w "PKG_RELEASE:" ./feeds/iopsys/ice-client/Makefile | cut -d'=' -f2)
|
||||
iceversion=$icebasever$icerelease
|
||||
[ -n "$target" -a -n "$iceversion" -a -n "$icecommith" ] || return
|
||||
ssh $SERVER "test -f $FPATH/ice-client-$target-$iceversion-$icecommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/ice-client-$icebasever/ipkg-* || cd ./build_dir/target-mips*musl-*/ice-client-$icebasever/ipkg-*
|
||||
tar -czv ice-client -f ice-client-$target-$iceversion-$icecommith.tar.gz
|
||||
scp -pv ice-client-$target-$iceversion-$icecommith.tar.gz $SERVER:$FPATH/
|
||||
cp ice-client-$target-$iceversion-$icecommith.tar.gz $curdir/
|
||||
rm -f ice-client-$target-$iceversion-$icecommith.tar.gz
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_wifilife_consumer() {
|
||||
local target="$1"
|
||||
local ver commit
|
||||
ver=$(grep -w "PKG_VERSION:" ./feeds/iopsys/wifilife/Makefile | cut -d'=' -f2)
|
||||
commit=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/wifilife/Makefile | cut -d'=' -f2)
|
||||
[ -n "$ver" -a -n "$commit" ] || return
|
||||
ssh $SERVER "test -f $FPATH/wifilife-$target-${ver}_${commit}.tar.xz" && return
|
||||
if [ "$target" == "iopsys-ramips" ]; then
|
||||
cd ./build_dir/target-mipsel_1004kc_musl/wifilife-$ver/ipkg-*
|
||||
elif [ "$target" == "intel_mips" ]; then
|
||||
cd ./build_dir/target-mips_24kc+nomips16_musl/wifilife-$ver/ipkg-*
|
||||
elif [ "$target" == "iopsys-brcm63xx-arm" ]; then
|
||||
cd ./build_dir/target-arm_xscale_musl_eabi/wifilife-$ver/ipkg-*
|
||||
elif [ "$target" == "iopsys-brcm63xx-mips" ]; then
|
||||
cd ./build_dir/target-mips*/wifilife-$ver/ipkg-*
|
||||
else
|
||||
return
|
||||
fi
|
||||
cd ./build_dir/target-*/wifilife-$ver/ipkg-* || cd ./build_dir/target-mips*musl-*/wifilife-$ver/ipkg-*
|
||||
mkdir -p wifilife-$ver/src
|
||||
cp -rf wifilife/usr/sbin/* wifilife-$ver/src/
|
||||
tar Jcf wifilife-${target}-${ver}_${commit}.tar.xz wifilife-$ver
|
||||
@@ -141,7 +147,7 @@ function generate_tarballs {
|
||||
while getopts "t:h" opt; do
|
||||
case $opt in
|
||||
t)
|
||||
sdk_target=${OPTARG}
|
||||
stk_target=${OPTARG}
|
||||
;;
|
||||
h)
|
||||
print_usage
|
||||
@@ -154,23 +160,23 @@ function generate_tarballs {
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -n "$sdk_target" ]; then
|
||||
if [ ! -n "$stk_target" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$sdk_target" == "broadcom" ]; then
|
||||
if [ "$stk_target" == "broadcom" ]; then
|
||||
build_bcmkernel_consumer
|
||||
build_natalie_consumer
|
||||
build_endptmngr_consumer
|
||||
build_wifilife_consumer "$target"
|
||||
elif [ "$sdk_target" == "mediatek" ]; then
|
||||
build_ice_consumer
|
||||
build_wifilife_consumer
|
||||
elif [ "$stk_target" == "mediatek" ]; then
|
||||
build_mediatek_kernel
|
||||
build_wifilife_consumer "$target"
|
||||
elif [ "$sdk_target" == "intel" ]; then
|
||||
build_wifilife_consumer "$target"
|
||||
build_ice_consumer
|
||||
build_wifilife_consumer
|
||||
else
|
||||
echo "Invalid target: $sdk_target"
|
||||
echo "Invalid target: $stk_target"
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -10,7 +10,7 @@ function install_key {
|
||||
echo "::sysinit:/etc/init.d/rcS S boot" >files/etc/inittab
|
||||
echo "::shutdown:/etc/init.d/rcS K shutdown" >>files/etc/inittab
|
||||
echo "tty/0::askfirst:/bin/ash --login" >>files/etc/inittab
|
||||
echo "console::askfirst:/bin/cttyhack /bin/ash --login" >>files/etc/inittab
|
||||
echo "ttyS0::askfirst:/bin/ash --login" >>files/etc/inittab
|
||||
|
||||
echo Done
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ function update_feed_branches {
|
||||
git checkout $commith
|
||||
git push origin :$release
|
||||
git checkout -b $release
|
||||
git push --set-upstream origin $release
|
||||
git push origin $release
|
||||
cd $ipath
|
||||
done
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_NAME:=iopupgrade
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=01f2afd6c831d6f9eb2940c7e7af16f7e4d439c2
|
||||
PKG_SOURCE_VERSION:=9b5ed4bc9f7ac5064414cf5feb510ffd95df6ec4
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopupgrade
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ cur_vol="" # num,[0/1] Number used for ubifs root filesystem volume name.
|
||||
upd_vol="" # num,[0/1] Number used for ubifs root filesystem volume name.
|
||||
# eg: rootfs_0 or rootfs_1, the one we want to update
|
||||
cmdline="" # command line settings.
|
||||
cmdline_match="" # Headers to match to the image
|
||||
|
||||
###############################################################################
|
||||
# file local variables. should not be used in imported functions. Can be used
|
||||
@@ -21,6 +20,7 @@ upd_ubi_id="" # num, UBI volume number for the volume name
|
||||
run_cleanup=0 # if set the cleanup should be run otherwise we skip it.
|
||||
run_mount_cleanup=0 # set if we should run umount in cleanup
|
||||
upd_kernel=0 # set to 1 if system has the kernel in own mtd partition
|
||||
upd_cfe=0 # set to 1 if system is using cfe as bootloader.
|
||||
log_stdout=1 # set to 0 to prevent the log to also print to stdout
|
||||
upd_noreboot=0 # set to 1 if we should not reboot after programming
|
||||
upd_forceimage=0 # set this to force upgrade even if image is for wrong board.
|
||||
@@ -204,7 +204,9 @@ log "Firmware upgrade started"
|
||||
if [ $upd_forceimage -eq 0 ]
|
||||
then
|
||||
board=$(db get hw.board.iopVerBoard)
|
||||
cmdline_match="board=$board"
|
||||
cmdline="$cmdline -b $board"
|
||||
else
|
||||
cmdline="$cmdline -q"
|
||||
fi
|
||||
|
||||
# find out what rootfs volume is active.
|
||||
@@ -215,19 +217,16 @@ upd_vol=$(get_flashbank_next)
|
||||
upd_ubi_id=$(ubinfo -d 0 -N rootfs_$upd_vol | awk "/Volume ID:/ {print \$3}")
|
||||
log "installing Root Fileystem into UBI volume rootfs_$upd_vol"
|
||||
|
||||
# prepare to match dsl.
|
||||
function_call upd_conf_dsl
|
||||
|
||||
# prepare to update CFE if it exists
|
||||
function_call upd_conf_cfe
|
||||
|
||||
# prepare to update kernel if it is stored in MTD/JFFS2
|
||||
function_call upd_conf_kernel
|
||||
|
||||
log "now starting writing data to flash with [ iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id ]"
|
||||
log "now starting writing data to flash with [ iopupgrade $cmdline -u ubi0_$upd_ubi_id ]"
|
||||
run_cleanup=1 # When we start to actually write data there might be some
|
||||
# things that need cleanup if we get an error/crash
|
||||
iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id
|
||||
iopupgrade $cmdline -u ubi0_$upd_ubi_id
|
||||
|
||||
# in case of any error we abort
|
||||
if [ $? -ne 0 ]; then
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2008-2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ltq-nand
|
||||
PKG_VERSION:=1.0
|
||||
|
||||
PKG_SOURCE:=v$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/merbanan/ltq-nand/archive/
|
||||
#PKG_SOURCE_PROTO:=git
|
||||
#PKG_SOURCE_URL:=https://github.com/merbanan/ltq-nand/releases/download/v$(PKG_VERSION)/
|
||||
#PKG_SOURCE_URL:=https://github.com/merbanan/ltq-nand.git
|
||||
#PKG_SOURCE_VERSION:=07b5b0331af6de4174dab2c02bf260ee9625452a
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
|
||||
|
||||
define Host/Compile
|
||||
$(MAKE) -C $(HOST_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Host/Install
|
||||
$(CP) \
|
||||
$(HOST_BUILD_DIR)/ltq-nand \
|
||||
$(STAGING_DIR_HOST)/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
|
||||
@@ -18,7 +18,7 @@ PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
|
||||
PKG_NAME:=natalie-dect-open
|
||||
else
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/dialog/natalie-dect-12.26.git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:dialog/natalie-dect-12.26
|
||||
PKG_SOURCE_PROTO:=git
|
||||
endif
|
||||
|
||||
|
||||
33
ndt/Makefile
33
ndt/Makefile
@@ -1,33 +0,0 @@
|
||||
#
|
||||
# This is free software, See /COPYRIGHT for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ndt
|
||||
PKG_VERSION:=3.6.4
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_BUILD_DIR:=${BUILD_DIR}/ndt-$(PKG_VERSION)
|
||||
PKG_SOURCE:=ndt-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://software.internet2.edu/sources/ndt
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ndt
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libpthread +zlib
|
||||
TITLE:=Network Testing Tool
|
||||
endef
|
||||
|
||||
define Build/Compile/Default
|
||||
$(MAKE) -C $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Package/ndt/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/src/web100clt $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ndt))
|
||||
|
||||
@@ -3,7 +3,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=netmode
|
||||
PKG_VERSION:=0.2.0
|
||||
|
||||
PKG_SOURCE_VERSION:=6406325e72d7ddd0ff7aaa3a87669519021bdb11
|
||||
PKG_SOURCE_VERSION:=9fa23664b3bdd963e4556f5921c9f9be1c9c578f
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/netmoded
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@ config mode 'setup'
|
||||
option curmode 'routed'
|
||||
|
||||
config tools 'tools'
|
||||
option wificontrol 0
|
||||
option wificontrol 1
|
||||
option arp_discovery 1
|
||||
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
[ "$INTERFACE" != "wan" ] && exit
|
||||
|
||||
automode="$(uci -q get netmode.setup.automode)"
|
||||
[ "$automode" == "0" ] && exit
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
. /lib/functions/netmode.sh
|
||||
|
||||
@@ -12,7 +12,7 @@ start_netmoded() {
|
||||
procd_open_instance
|
||||
procd_set_param command $NETMODED
|
||||
|
||||
procd_append_param command --verbose warning -i macaddr
|
||||
procd_append_param command --verbose warning
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
"CG300",
|
||||
"CG301",
|
||||
"EX400",
|
||||
"SDX810-AP",
|
||||
"NORRLAND"
|
||||
"SDX810-AP"
|
||||
],
|
||||
"acl" : [
|
||||
"admin",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -7,6 +8,9 @@ config bandsteering 'bandsteering'
|
||||
option enabled '0'
|
||||
option policy '0'
|
||||
|
||||
config apsteering 'apsteering'
|
||||
option enabled '0'
|
||||
|
||||
config wifi-device 'wl0'
|
||||
option type 'broadcom'
|
||||
option country 'EU/13'
|
||||
@@ -43,10 +47,10 @@ config wifi-iface
|
||||
option cipher 'auto'
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option macfilter '0'
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option maxassoc '32'
|
||||
option bss_max '32'
|
||||
option ifname 'wl0'
|
||||
|
||||
config wifi-device 'wl1'
|
||||
@@ -83,9 +87,9 @@ config wifi-iface
|
||||
option cipher 'auto'
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option macfilter '0'
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option maxassoc '32'
|
||||
option bss_max '32'
|
||||
option ifname 'wl1'
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"*G*",
|
||||
"F*",
|
||||
"NORRLAND"
|
||||
"F*"
|
||||
],
|
||||
"uplink_band" : 'a',
|
||||
"downlink_band" : 'a b',
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
uci -q set owsd.ubusproxy.enable="0"
|
||||
uci -q commit owsd
|
||||
@@ -1,5 +1,6 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -7,6 +8,9 @@ config bandsteering 'bandsteering'
|
||||
option enabled '0'
|
||||
option policy '0'
|
||||
|
||||
config apsteering 'apsteering'
|
||||
option enabled '0'
|
||||
|
||||
config wifi-device ra0
|
||||
option band b
|
||||
option channel auto
|
||||
@@ -23,7 +27,7 @@ config wifi-iface
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option ifname ra0
|
||||
option wps 1
|
||||
option wps_pbc 1
|
||||
|
||||
config wifi-device rai0
|
||||
option band a
|
||||
@@ -42,7 +46,7 @@ config wifi-iface
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option ifname rai0
|
||||
option wps 1
|
||||
option wps_pbc 1
|
||||
|
||||
config wifi-iface
|
||||
option device rai0
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"EX4*",
|
||||
"SDX810-AP",
|
||||
"NORRLAND"
|
||||
"SDX810-AP"
|
||||
],
|
||||
"credentials" : 0
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -7,6 +8,9 @@ config bandsteering 'bandsteering'
|
||||
option enabled '0'
|
||||
option policy '0'
|
||||
|
||||
config apsteering 'apsteering'
|
||||
option enabled '0'
|
||||
|
||||
config wifi-device 'wl0'
|
||||
option type 'broadcom'
|
||||
option country 'EU/13'
|
||||
@@ -43,10 +47,10 @@ config wifi-iface
|
||||
option cipher 'auto'
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option macfilter '0'
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option maxassoc '32'
|
||||
option bss_max '32'
|
||||
option ifname 'wl0'
|
||||
|
||||
config wifi-device 'wl1'
|
||||
@@ -83,9 +87,9 @@ config wifi-iface
|
||||
option cipher 'auto'
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option macfilter '0'
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option maxassoc '32'
|
||||
option bss_max '32'
|
||||
option ifname 'wl1'
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"*G*",
|
||||
"F*",
|
||||
"NORRLAND"
|
||||
"F*"
|
||||
],
|
||||
"reboot" : 0,
|
||||
"credentials" : 0
|
||||
|
||||
10
netmode/files/etc/netmodes/routed_mtk/omcproxy
Normal file
10
netmode/files/etc/netmodes/routed_mtk/omcproxy
Normal file
@@ -0,0 +1,10 @@
|
||||
config proxy
|
||||
option scope global
|
||||
option uplink wan
|
||||
list downlink lan
|
||||
|
||||
config proxy
|
||||
option scope global
|
||||
option uplink wan6
|
||||
list downlink lan
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option wps '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
@@ -7,6 +8,9 @@ config bandsteering 'bandsteering'
|
||||
option enabled '0'
|
||||
option policy '0'
|
||||
|
||||
config apsteering 'apsteering'
|
||||
option enabled '0'
|
||||
|
||||
config wifi-device ra0
|
||||
option band b
|
||||
option channel auto
|
||||
@@ -23,7 +27,7 @@ config wifi-iface
|
||||
option ssid iopsys-$BSSID4
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option wps 1
|
||||
option wps_pbc 1
|
||||
option ifname ra0
|
||||
|
||||
config wifi-device rai0
|
||||
@@ -43,6 +47,6 @@ config wifi-iface
|
||||
option ssid iopsys-$BSSID4
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option wps 1
|
||||
option wps_pbc 1
|
||||
option ifname rai0
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
NMTMPDIR=/var/netmodes
|
||||
OLD_MODE_FILE=/var/netmodes/old_mode
|
||||
CONF_BACKUP_DIR=/var/netmodes/backup/
|
||||
SWITCHMODELOCK="/tmp/switching_mode"
|
||||
MODEDIR=$(uci -q get netmode.setup.dir)
|
||||
MTK=0
|
||||
@@ -121,13 +120,8 @@ run_netmode_scripts() {
|
||||
local mode=$1
|
||||
local when=$2
|
||||
local script
|
||||
local path
|
||||
|
||||
path=$(readlink -f /etc/netmodes/$mode/)
|
||||
[ "${path:0:14}" == "/etc/netmodes/" ] || exit
|
||||
|
||||
if [ -d /etc/netmodes/$mode/scripts/$when ]; then
|
||||
logger -s -p user.info -t "netmode" "Executing $when netmode scripts" >/dev/console
|
||||
logger -s -p user.info -t $0 "[netmode] Executing $when netmode scripts" >/dev/console
|
||||
for script in $(ls /etc/netmodes/$mode/scripts/$when/); do
|
||||
sh /etc/netmodes/$mode/scripts/$when/$script
|
||||
done
|
||||
@@ -185,12 +179,7 @@ switch_netmode() {
|
||||
|
||||
run_netmode_scripts $curmode "pre"
|
||||
|
||||
# make backup of current config before switching
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
mkdir -p $CONF_BACKUP_DIR
|
||||
cp -af /etc/config/* $CONF_BACKUP_DIR
|
||||
|
||||
logger -s -p user.info -t "netmode" "Copying /etc/netmodes/$curmode in /etc/config" >/dev/console
|
||||
logger -s -p user.info -t $0 "[netmode] Copying /etc/netmodes/$curmode in /etc/config" >/dev/console
|
||||
|
||||
for file in $(ls /etc/netmodes/$curmode/); do
|
||||
case "$file" in
|
||||
@@ -215,10 +204,11 @@ switch_netmode() {
|
||||
case "$curmode" in
|
||||
repeater*)
|
||||
touch $SWITCHMODELOCK
|
||||
logger -s -p user.info -t "netmode" "Switching to $curmode mode" > /dev/console
|
||||
logger -s -p user.info -t $0 "Switching to $curmode mode" > /dev/console
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
[ -f /etc/init.d/omcproxy ] && /etc/init.d/omcproxy stop
|
||||
[ -f /etc/init.d/igmpproxy ] && /etc/init.d/igmpproxy stop
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
[ -f /etc/init.d/macoffset ] && /etc/init.d/macoffset reload
|
||||
ubus call network reload
|
||||
wifi reload nodat
|
||||
ubus call router.network reload
|
||||
@@ -229,7 +219,6 @@ switch_netmode() {
|
||||
;;
|
||||
*)
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
[ -f /etc/init.d/macoffset ] && /etc/init.d/macoffset reload
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
;;
|
||||
esac
|
||||
@@ -237,27 +226,6 @@ switch_netmode() {
|
||||
run_netmode_scripts $curmode "post"
|
||||
}
|
||||
|
||||
revert_netmode() {
|
||||
local from="$1"
|
||||
local to="$2"
|
||||
local rready="$3"
|
||||
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
logger -s -p user.info -t "netmode" "Could not switch to '$from' mode; going back to '$to' mode" > /dev/console
|
||||
cp -af $CONF_BACKUP_DIR/* /etc/config/
|
||||
sync
|
||||
uci -q set netmode.setup.curmode="$to"
|
||||
uci -q set netmode.setup.repeaterready="$rready"
|
||||
uci commit netmode
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
rm -rf $OLD_MODE_FILE
|
||||
|
||||
logger -s -p user.info -t "netmode" "Restarting network services" > /dev/console
|
||||
/etc/init.d/network restart
|
||||
ubus call router.network reload
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
}
|
||||
|
||||
wificontrol_takes_over() {
|
||||
local ret
|
||||
[ -f /sbin/wificontrol ] || return
|
||||
@@ -292,10 +260,10 @@ wait_for_netmode_handler() {
|
||||
|
||||
netmode_get_ip_type() {
|
||||
[ -n "$(echo $1 | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)')" ] && {
|
||||
logger -t $0 "netmode_get_ip_type: ip $1 is private"
|
||||
logger -t "[netmode]" "netmode_get_ip_type: ip $1 is private"
|
||||
echo "private"
|
||||
} || {
|
||||
logger -t $0 "netmode_get_ip_type: ip $1 is public"
|
||||
logger -t "[netmode]" "netmode_get_ip_type: ip $1 is public"
|
||||
echo "public"
|
||||
}
|
||||
}
|
||||
@@ -383,7 +351,7 @@ populate_netmodes() {
|
||||
done
|
||||
|
||||
local hardware=$(db get hw.board.hardware)
|
||||
local keys lang desc exp exclude support
|
||||
local keys lang desc exp exclude
|
||||
for mode in $(ls $MODEDIR); do
|
||||
|
||||
case "$mode" in
|
||||
@@ -413,23 +381,6 @@ populate_netmodes() {
|
||||
done
|
||||
json_select ..
|
||||
[ $exclude -eq 1 ] && continue
|
||||
elif json_select supported_boards; then
|
||||
support=0
|
||||
_i=1
|
||||
while json_get_var board $_i; do
|
||||
case "$hardware" in
|
||||
$board)
|
||||
support=1
|
||||
break
|
||||
;;
|
||||
esac
|
||||
_i=$((_i+1))
|
||||
done
|
||||
json_select ..
|
||||
[ $support -eq 1 ] || {
|
||||
uci -q delete netmode.$mode
|
||||
continue
|
||||
}
|
||||
fi
|
||||
|
||||
if json_select acl; then
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
WIFISTA=0
|
||||
STACONF="/etc/Wireless/iNIC/iNIC_ap.dat"
|
||||
[ -f $STACONF ] && WIFISTA=1
|
||||
|
||||
get_if_creds() {
|
||||
local section=$1
|
||||
local network=$2
|
||||
@@ -88,22 +84,9 @@ duplicate_if_single_radio() {
|
||||
done
|
||||
}
|
||||
|
||||
get_wifi_iface_cfgstr() {
|
||||
get_cfgno() {
|
||||
config_get ifname "$1" ifname
|
||||
[ "$ifname" == "$2" ] && echo "wireless.$1"
|
||||
}
|
||||
config_load wireless
|
||||
config_foreach get_cfgno wifi-iface $1
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
if [ $WIFISTA -eq 1 ]; then
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" }, "connect": { "ssid": "str", "key": "str" }, "forget_network": {}, "wps_enroll": {}, "wps_stop": {} }'
|
||||
else
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" } }'
|
||||
fi
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" } }'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
@@ -153,88 +136,6 @@ case "$1" in
|
||||
json_dump
|
||||
|
||||
;;
|
||||
connect)
|
||||
local ssid key enc auth wetif wetcfg wetssid wetkey code
|
||||
read input
|
||||
json_load "$input"
|
||||
json_get_var ssid ssid
|
||||
json_get_var key key
|
||||
code=1
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -s /sys/class/net/$wetif/operstate ]; then
|
||||
wetcfg="$(get_wifi_iface_cfgstr $wetif)"
|
||||
wetssid="$(uci -q get $wetcfg.ssid)"
|
||||
wetkey="$(uci -q get $wetcfg.key)"
|
||||
ssid="${ssid:-$wetssid}"
|
||||
key="${key:-$wetkey}"
|
||||
if [ -n "$key" ]; then
|
||||
auth="WPA2PSK"
|
||||
enc="AES"
|
||||
else
|
||||
auth="OPEN"
|
||||
enc="NONE"
|
||||
fi
|
||||
iwpriv $wetif set ApCliEnable=0
|
||||
iwpriv $wetif set ApCliSsid="$ssid"
|
||||
iwpriv $wetif set ApCliAuthMode="$auth"
|
||||
iwpriv $wetif set ApCliEncrypType="$enc"
|
||||
iwpriv $wetif set ApCliWPAPSK="$key"
|
||||
iwpriv $wetif set ApCliEnable=1
|
||||
iwpriv $wetif set ApCliAutoConnect=1
|
||||
code=0
|
||||
fi
|
||||
json_init
|
||||
json_add_int "code" $code
|
||||
json_dump
|
||||
;;
|
||||
forget_network)
|
||||
local wetif wetcfg code
|
||||
code=1
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -s /sys/class/net/$wetif/operstate ]; then
|
||||
wetcfg="$(get_wifi_iface_cfgstr $wetif)"
|
||||
uci -q set $wetcfg.ssid=""
|
||||
uci -q set $wetcfg.key=""
|
||||
uci -q commit wireless
|
||||
|
||||
sed -i "s/ApCliSsid=.*/ApCliSsid=/g" $STACONF
|
||||
sed -i "s/ApCliAuthMode=.*/ApCliAuthMode=/g" $STACONF
|
||||
sed -i "s/ApCliEncrypType=.*/ApCliEncrypType=/g" $STACONF
|
||||
sed -i "s/ApCliWPAPSK=.*/ApCliWPAPSK=/g" $STACONF
|
||||
|
||||
ifconfig $wetif down
|
||||
ifconfig $wetif up
|
||||
|
||||
code=0
|
||||
fi
|
||||
json_init
|
||||
json_add_int "code" $code
|
||||
json_dump
|
||||
;;
|
||||
wps_enroll)
|
||||
local wetif
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -n "$wetif" ]; then
|
||||
iwpriv $wetif set ApCliEnable=0
|
||||
iwpriv $wetif set WscConfMode=1
|
||||
iwpriv $wetif set WscMode=2
|
||||
iwpriv $wetif set ApCliEnable=1
|
||||
iwpriv $wetif set WscGetConf=1
|
||||
fi
|
||||
json_init
|
||||
json_add_string "ifname" $wetif
|
||||
json_dump
|
||||
;;
|
||||
wps_stop)
|
||||
local wetif
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -n "$wetif" ]; then
|
||||
iwpriv $wetif set WscStop=1
|
||||
fi
|
||||
json_init
|
||||
json_add_string "ifname" $wetif
|
||||
json_dump
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=014d7ec63331b3b745e8af53a4be1b52693e2a6f
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/obuspa
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=USP agent
|
||||
DEPENDS:=+libcoap +libopenssl +libcurl +libsqlite3 +libcares +libubox +libubus +libblobmsg-json +uspd
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
OB-USP-AGENT is a system daemon providing a User Services Platform (USP) Agent.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifneq ($(CONFIG_USE_MUSL),)
|
||||
TARGET_CFLAGS += -DUSE_MUSL
|
||||
endif
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./obuspa/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
@@ -1,14 +0,0 @@
|
||||
config controller
|
||||
option endpointid 'self::usp-controller.com'
|
||||
|
||||
config mtp
|
||||
option enable 'true'
|
||||
option protocol 'STOMP'
|
||||
option destination 'uspq'
|
||||
|
||||
config connection
|
||||
option host 'usp-controller.com'
|
||||
option username 'username'
|
||||
option password 'password'
|
||||
option encryption 'false'
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
PROG=/usr/sbin/obuspa
|
||||
|
||||
CTRL_PATH="Device.LocalAgent.Controller.1."
|
||||
MTP_PATH="Device.LocalAgent.MTP.1."
|
||||
CONN_PATH="Device.STOMP.Connection.1."
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t obuspa -p debug
|
||||
}
|
||||
|
||||
db_set() {
|
||||
log "DBSET param|${1}| value|${2}|"
|
||||
${PROG} -c dbset ${1} ${2}
|
||||
}
|
||||
|
||||
validate_controller_section()
|
||||
{
|
||||
uci_validate_section obuspa controller "${1}" \
|
||||
'endpointid:string:"self:usp-controller.com"'
|
||||
}
|
||||
|
||||
validate_mtp_section()
|
||||
{
|
||||
uci_validate_section obuspa mtp "${1}" \
|
||||
'enable:bool:true' \
|
||||
'protocol:string:"STOMP"' \
|
||||
'destination:string:'
|
||||
}
|
||||
|
||||
validate_connection_section()
|
||||
{
|
||||
uci_validate_section obuspa connection "${1}" \
|
||||
'host:string:"usp-controller.com"' \
|
||||
'username:string:username' \
|
||||
'password:string:password' \
|
||||
'encryption:bool:true'
|
||||
}
|
||||
|
||||
configure_controller() {
|
||||
local endpointid
|
||||
|
||||
validate_controller_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
db_set "${CTRL_PATH}EndpointID" ${endpointid}
|
||||
}
|
||||
|
||||
configure_mtp() {
|
||||
local protocol enable destination
|
||||
|
||||
validate_mtp_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
db_set "${MTP_PATH}Enable" ${enable}
|
||||
db_set "${MTP_PATH}Protocol" ${protocol}
|
||||
db_set "${MTP_PATH}STOMP.Destination" ${destination}
|
||||
}
|
||||
|
||||
configure_connection() {
|
||||
local host username password encryption
|
||||
|
||||
validate_connection_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
db_set "${CONN_PATH}Host" ${host}
|
||||
db_set "${CONN_PATH}Username" ${username}
|
||||
db_set "${CONN_PATH}Password" ${password}
|
||||
db_set "${CONN_PATH}X_ARRIS-COM_EnableEncryption" ${encryption}
|
||||
}
|
||||
|
||||
db_init() {
|
||||
[ -f /tmp/usp.db ] && rm -f /tmp/usp.db
|
||||
|
||||
config_load obuspa
|
||||
config_foreach configure_controller controller
|
||||
config_foreach configure_mtp mtp
|
||||
config_foreach configure_connection connection
|
||||
}
|
||||
start_service() {
|
||||
db_init
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command -p -v 4
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_config_trigger "config.change" "obuspa" /etc/init.d/obuspa restart
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
choice
|
||||
prompt "Select IPC Bus"
|
||||
prompt "Select Bus"
|
||||
default OWSD_USE_UBUS
|
||||
depends on PACKAGE_owsd
|
||||
help
|
||||
Select which IPC bus to compile owsd for
|
||||
Select which bus to compile owsd for
|
||||
|
||||
config OWSD_USE_DBUS
|
||||
bool "Use DBUS"
|
||||
@@ -15,11 +15,3 @@ config OWSD_USE_DBUS_UBUS
|
||||
bool "Use UBUS and DBUS"
|
||||
|
||||
endchoice
|
||||
|
||||
config OWSD_UPROXYD
|
||||
bool "Enable UBUS Proxy Daemon"
|
||||
default y if OWSD_USE_UBUS || OWSD_USE_DBUS_UBUS
|
||||
help
|
||||
Enabling uproxyd automates detection of other
|
||||
UBUS-X enabled devices in the network
|
||||
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys
|
||||
# Copyright (C) 2018 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=owsd
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_VERSION:=1.1.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/owsd.git
|
||||
PKG_SOURCE_VERSION:=0417231666ea7da12205c9a9798ecce7da85f881
|
||||
PKG_SOURCE_VERSION:=f0eedeb6fd061edf3784d6bf86fa60b176bf3fe7
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_MAINTAINER:=Sartura Support for Inteno <support-inteno@sartura.hr>
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_OWSD_USE_DBUS CONFIG_OWSD_USE_UBUS CONFIG_OWSD_USE_DBUS_UBUS CONFIG_OWSD_UPROXYD
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_OWSD_USE_DBUS CONFIG_OWSD_USE_UBUS CONFIG_OWSD_USE_DBUS_UBUS
|
||||
|
||||
USE_UBUS-y:=-DWSD_HAVE_UBUS=ON
|
||||
USE_DBUS-y:=-DWSD_HAVE_DBUS=ON
|
||||
USE_BOTH-y:=${USE_UBUS-y} ${USE_DBUS-y}
|
||||
USE_UPROXYD-y:=-DOWSD_UPROXYD=ON
|
||||
|
||||
CMAKE_OPTIONS:=${USE_UBUS-${CONFIG_OWSD_USE_UBUS}} \
|
||||
${USE_DBUS-${CONFIG_OWSD_USE_DBUS}} \
|
||||
${USE_BOTH-${CONFIG_OWSD_USE_DBUS_UBUS}} \
|
||||
${USE_UPROXYD-${CONFIG_OWSD_UPROXYD}}
|
||||
${USE_BOTH-${CONFIG_OWSD_USE_DBUS_UBUS}}
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
@@ -53,17 +52,14 @@ endef
|
||||
define Package/owsd/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owsd $(1)/usr/bin/owsd
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uproxyd $(1)/sbin/uproxyd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/owsd.init $(1)/etc/init.d/owsd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/owsd.config $(1)/etc/config/owsd
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/owsd.hotplug $(1)/etc/hotplug.d/iface/55-owsd
|
||||
ifeq ($(CONFIG_OWSD_UPROXYD),y)
|
||||
$(CP) ./uproxy-files/* $(1)/
|
||||
endif
|
||||
# $(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
# $(INSTALL_BIN) ./files/owsd.uci_default $(1)/etc/uci-defaults/55-owsd-interfaces
|
||||
endef
|
||||
|
||||
define Package/owsd-testdata
|
||||
|
||||
@@ -5,8 +5,8 @@ config owsd 'global'
|
||||
# option www_maxage '3600'
|
||||
|
||||
# ubusproxy is enbaled if: enable = 1 or peer exists or path exists
|
||||
#config ubusproxy 'ubusproxy'
|
||||
# option enable '0'
|
||||
config ubusproxy 'ubusproxy'
|
||||
option enable '0'
|
||||
# list peer 'wss://repeater_hostname/'
|
||||
# list peer 'wss://192.168.1.101/'
|
||||
# list object 'router.*'
|
||||
@@ -30,12 +30,12 @@ config owsd-listen 'lan'
|
||||
option whitelist_interface_as_origin '1'
|
||||
option whitelist_dhcp_domains '1'
|
||||
|
||||
#config owsd-listen 'lan_8080'
|
||||
# option port '8080'
|
||||
# option interface 'lan'
|
||||
# option ipv6 'on'
|
||||
# option whitelist_interface_as_origin '1'
|
||||
# option whitelist_dhcp_domains '1'
|
||||
config owsd-listen 'lan_8080'
|
||||
option port '8080'
|
||||
option interface 'lan'
|
||||
option ipv6 'on'
|
||||
option whitelist_interface_as_origin '1'
|
||||
option whitelist_dhcp_domains '1'
|
||||
|
||||
#config owsd-listen 'lan_https'
|
||||
# option port '443'
|
||||
|
||||
@@ -111,9 +111,6 @@ validate_owsd_ubusproxy() {
|
||||
'peer:list(string)' \
|
||||
'object:list(string)' \
|
||||
'prefix:string' \
|
||||
'max_reconnect_time:string' \
|
||||
'client_backoff_timeout:string' \
|
||||
'reconnect_timeout:string' \
|
||||
'peer_key:file' \
|
||||
'peer_cert:file' \
|
||||
'peer_ca:file' \
|
||||
@@ -248,35 +245,6 @@ parse_owsd_iface() {
|
||||
fi
|
||||
}
|
||||
|
||||
parser_timeout()
|
||||
{
|
||||
local flag data
|
||||
local ret=0
|
||||
#data format is digital with time unit
|
||||
#10s-10 seconds 10m-10 minutes 10h-10 hours 10d-10 days
|
||||
if [ -n "$1" ]; then
|
||||
flag=$(echo "$1"| tr -d [0-9] | tr '[A-Z]' '[a-z]')
|
||||
data=$(echo "$1"| tr -cd [0-9])
|
||||
case $flag in
|
||||
s)
|
||||
ret=$((data*1000))
|
||||
;;
|
||||
m)
|
||||
ret=$((data*1000*60))
|
||||
;;
|
||||
h)
|
||||
ret=$((data*1000*60*60))
|
||||
;;
|
||||
d)
|
||||
ret=$((data*1000*60*60*24))
|
||||
;;
|
||||
esac
|
||||
echo "$ret"
|
||||
else
|
||||
echo "0"
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
# update rpcd config according to owsd acl
|
||||
handle_owsd_acl
|
||||
@@ -296,62 +264,48 @@ start_service() {
|
||||
return 1
|
||||
}
|
||||
|
||||
config_get reconn ubusproxy max_reconnect_time
|
||||
config_get ctimeout ubusproxy client_backoff_timeout
|
||||
config_get rtimeout ubusproxy reconnect_timeout
|
||||
[ -n "${ctimeout}" ] && ctimeout=$(parser_timeout $ctimeout)
|
||||
[ -n "${rtimeout}" ] && rtimeout=$(parser_timeout $rtimeout)
|
||||
|
||||
[ -n "${sock}" ] && procd_append_param command -s"${sock}"
|
||||
[ -n "${www}" ] && procd_append_param command -w"${www}"
|
||||
[ -n "${redirect}" ] && procd_append_param command -r"${redirect}"
|
||||
[ -n "${www_maxage}" ] && procd_append_param command -t"${www_maxage}"
|
||||
[ -n "${rtimeout}" ] && procd_append_param command -T"${rtimeout}"
|
||||
#validate_owsd_ubusproxy || {
|
||||
# echo "Ubusproxy validation failed"
|
||||
# return 1
|
||||
#}
|
||||
|
||||
validate_owsd_ubusproxy && {
|
||||
if [ "${enable}" -eq 1 ]; then
|
||||
procd_append_param command -U
|
||||
|
||||
[ -n "${peer_cert}" ] && procd_append_param command -C"${peer_cert}"
|
||||
[ -n "${peer_key}" ] && procd_append_param command -K"${peer_key}"
|
||||
[ -n "${peer_ca}" ] && procd_append_param command -A"${peer_ca}"
|
||||
|
||||
append_peer () {
|
||||
[ -n "$1" ] && procd_append_param command -P"$1"
|
||||
}
|
||||
|
||||
append_object () {
|
||||
[ -n "$1" ] && procd_append_param command -U"$1"
|
||||
}
|
||||
|
||||
config_list_foreach "ubusproxy" "peer" append_peer
|
||||
config_list_foreach "ubusproxy" "object" append_object
|
||||
|
||||
[ "${prefix}" == "mac" ] && procd_append_param command -F"mac"
|
||||
fi
|
||||
validate_owsd_ubusproxy || {
|
||||
echo "Ubusproxy validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
if [ "${enable}" -eq 1 ]; then
|
||||
procd_append_param command -U
|
||||
|
||||
[ -n "${peer_cert}" ] && procd_append_param command -C"${peer_cert}"
|
||||
[ -n "${peer_key}" ] && procd_append_param command -K"${peer_key}"
|
||||
[ -n "${peer_ca}" ] && procd_append_param command -A"${peer_ca}"
|
||||
|
||||
append_peer () {
|
||||
[ -n "$1" ] && procd_append_param command -P"$1"
|
||||
}
|
||||
|
||||
append_object () {
|
||||
[ -n "$1" ] && procd_append_param command -U"$1"
|
||||
}
|
||||
|
||||
config_list_foreach "ubusproxy" "peer" append_peer
|
||||
config_list_foreach "ubusproxy" "object" append_object
|
||||
|
||||
[ "${prefix}" == "mac" ] && procd_append_param command -F"mac"
|
||||
fi
|
||||
|
||||
config_foreach parse_owsd_iface "owsd-listen"
|
||||
|
||||
# procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
|
||||
procd_close_instance
|
||||
|
||||
if [ "${enable}" -eq 1 ]; then
|
||||
# Start uproxyd
|
||||
procd_open_instance
|
||||
procd_set_param command $UPROXYD
|
||||
[ -n "${reconn}" ] && procd_append_param command -r "${reconn}"
|
||||
[ -n "${ctimeout}" ] && procd_append_param command -t "${ctimeout}"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
|
||||
# Start uproxyd
|
||||
procd_open_instance
|
||||
procd_set_param command $UPROXYD
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
#stop_service()
|
||||
|
||||
87
owsd/files/owsd.uci_default
Normal file
87
owsd/files/owsd.uci_default
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
MGMT_INTERFACES=""
|
||||
OWSD_INTERFACES=""
|
||||
NOT_DEFAULT=0
|
||||
|
||||
mgmt_interfaces() {
|
||||
local interface=$1
|
||||
[ "$interface" == "loopback" ] && return
|
||||
[ "$interface" == "lan" ] && return
|
||||
[ "$interface" == "wan" ] && return
|
||||
[ "$interface" == "wan6" ] && return
|
||||
|
||||
local type proto
|
||||
config_get type $interface type
|
||||
config_get proto $interface proto "none"
|
||||
[ "$type" == "bridge" -a "$proto" == "none" ] && return
|
||||
|
||||
local is_lan
|
||||
config_get is_lan $interface is_lan
|
||||
[ "$is_lan" == "1" ] && return
|
||||
|
||||
local ifname
|
||||
config_get ifname $interface ifname
|
||||
[ "${ifname:0:1}" == "@" ] && return
|
||||
|
||||
MGMT_INTERFACES="$MGMT_INTERFACES $interface"
|
||||
}
|
||||
|
||||
owsd_interfaces() {
|
||||
local config=$1
|
||||
local interface
|
||||
config_get interface $config interface
|
||||
[ "$interface" == "loopback" ] && return
|
||||
[ "$interface" == "lan" ] && return
|
||||
[ "$interface" == "wan" ] && return
|
||||
[ "$interface" == "wan6" ] && return
|
||||
|
||||
OWSD_INTERFACES="$OWSD_INTERFACES $interface"
|
||||
|
||||
NOT_DEFAULT=1
|
||||
}
|
||||
|
||||
not_owsd() {
|
||||
local interface=$1
|
||||
local there=0
|
||||
for owsd in $OWSD_INTERFACES; do
|
||||
if [ "$interface" == "$owsd" ]; then
|
||||
there=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
return $there
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach mgmt_interfaces interface
|
||||
|
||||
config_load owsd
|
||||
config_foreach owsd_interfaces owsd-listen
|
||||
|
||||
if [ $NOT_DEFAULT -eq 0 ]; then
|
||||
for mgmt in $MGMT_INTERFACES; do
|
||||
if $(not_owsd $mgmt); then
|
||||
uci -q set owsd.$mgmt=owsd-listen
|
||||
uci -q set owsd.$mgmt.port=80
|
||||
uci -q set owsd.$mgmt.interface="$mgmt"
|
||||
uci -q set owsd.$mgmt.ipv6="on"
|
||||
uci -q set owsd.$mgmt.whitelist_interface_as_origin="1"
|
||||
uci -q set owsd.$mgmt.origin="*"
|
||||
|
||||
uci -q set owsd.$mgmt"_8080"=owsd-listen
|
||||
uci -q set owsd.$mgmt"_8080".port=8080
|
||||
uci -q set owsd.$mgmt"_8080".interface="$mgmt"
|
||||
uci -q set owsd.$mgmt"_8080".ipv6="on"
|
||||
uci -q set owsd.$mgmt"_8080".whitelist_interface_as_origin="1"
|
||||
uci -q set owsd.$mgmt"_8080".origin="*"
|
||||
|
||||
uci commit owsd
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDHzCCAgegAwIBAgIJAKmrHnhgM9CZMA0GCSqGSIb3DQEBCwUAMCYxJDAiBgNV
|
||||
BAMMG3Jvb3QgQ0EgZm9yIGlvcHN5cyBnYXRld2F5czAeFw0xOTA0MjcxMDQ4MTJa
|
||||
Fw0yNzA3MTQxMDQ4MTJaMCYxJDAiBgNVBAMMG3Jvb3QgQ0EgZm9yIGlvcHN5cyBn
|
||||
YXRld2F5czCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM7i0RqyVvpl
|
||||
WVm4ioXV7H/5oII6nmlGb+eQM4p0QBujhyvwtT6z0L0KXwwWRGFdYBNChBfsi9zm
|
||||
AAhgQaR5D/QPRGDIiB69O3iBd2JFqzxo1rkN/nUMbZ2OplXRscmOs34yT68hV0ov
|
||||
nv0iAr06bzyoa2sxOfN262Ic2tKYG5UYtRVnbaX40U80DYm1tvoeJfZgTiZmeuky
|
||||
7t6PrWhJ+tfKdzK+IGDsIQ3k4k+3AfS8dwDEBbGocFhx+sOG/yv5OhGlZ3dH9toz
|
||||
Gq+xrkawoa0hkKKVOFhNINdHcPG0UH7iET779nsgylT/8OGkQG3vLSBkVJ8rAaAh
|
||||
j9vKBWdxIG0CAwEAAaNQME4wHQYDVR0OBBYEFMsfty2iwKt5U+WLdsYpgYVX1ZX2
|
||||
MB8GA1UdIwQYMBaAFMsfty2iwKt5U+WLdsYpgYVX1ZX2MAwGA1UdEwQFMAMBAf8w
|
||||
DQYJKoZIhvcNAQELBQADggEBALv1l6C94e6Xos4DkiIDToLQasO0nQLcq3eZhsa6
|
||||
XJgWnBcoe7p4iLXzHzutacwTj/mx+ptbLkyqPzvIsufKeQf3hat5ICtCLZOpOW55
|
||||
fPc4GY4TMixEJDzt3L5U89BXVFTSh7aY5KbphD9zQgYcy1IpkEEPtSOL8B8KWdHb
|
||||
lrW1AE9p7YLHb4YgtS6NjEN04a1wHug/flcfes4u9DOnmJzSih9p8UtQP86hjiPK
|
||||
C9znwLrbbrJANz4D6QSTtTT+qi8iQo68sKXYLyUC10Kp19pq1FMnfY1IkCcBDSip
|
||||
hbGdxwd4txkrl52YZyuo14mXRGP/c2lvEO0a1P6IpR2kMj4=
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAzuLRGrJW+mVZWbiKhdXsf/mggjqeaUZv55AzinRAG6OHK/C1
|
||||
PrPQvQpfDBZEYV1gE0KEF+yL3OYACGBBpHkP9A9EYMiIHr07eIF3YkWrPGjWuQ3+
|
||||
dQxtnY6mVdGxyY6zfjJPryFXSi+e/SICvTpvPKhrazE583brYhza0pgblRi1FWdt
|
||||
pfjRTzQNibW2+h4l9mBOJmZ66TLu3o+taEn618p3Mr4gYOwhDeTiT7cB9Lx3AMQF
|
||||
sahwWHH6w4b/K/k6EaVnd0f22jMar7GuRrChrSGQopU4WE0g10dw8bRQfuIRPvv2
|
||||
eyDKVP/w4aRAbe8tIGRUnysBoCGP28oFZ3EgbQIDAQABAoIBACYwBcr4ukdT589A
|
||||
2gjkONhSeocvTMg/4S4MFwdqd97iK3Q35SyiwlfyjyLLBWo3cyF6+Kj118c5iS4C
|
||||
nns+gWxaWRPIUB/kbBLNSv0PwRDQhTn5VEvEtIMNrrROlZOPzJ/xp3W7IMKn0aAF
|
||||
5B2LqLa4m8NYfcrr23zruJSA0S6O4O9+E2ilI0bLwMPmSEbrRhDYvOUUTP5bqWAy
|
||||
DUcOZQp26LIbx9B1gBA9XcQADjSR59ZY0vUCh6Rhd9qmJ2ZVAj78hv7yLkGOUOwS
|
||||
O9LnvBQjb7AZ9YNntTx/YlNLtbEMLfhv1/tpBZ8jVa9ZvCNBWNmrzpSCIEzhcQUY
|
||||
jv+WGyECgYEA718+bHissVTet0kcuC18XCbdg7LelOws9aSo0ZgQaRCr7BjTXNMi
|
||||
NrQPira0QmGyWtQ5eoxLw0s44b8ol0I+zwqA9q5bRMvdNUaZxE01ObC0aaZx0Sex
|
||||
51exHN7knVyWS94kMGBYQRQW5ElrmOTUUFN9WOVwsIuhx22hUd8XZ4UCgYEA3UHf
|
||||
jWzbdWlOw8ZB7hOu6MS46IFuKdztblHu3n+qw65x9i6VHy5yL8+dDOiFa8earpyP
|
||||
bPNuDr0URTj6Xu4OzQ04gLXE3SXghSKZPSOq9UoJ56fw6wXq2Dtz5rFGD4Mt+WHR
|
||||
/NiWccKSkA+x0bu8ab2hYBIAeURfqSQfAcmiRckCgYEAmTElLBpWuu6L0lTyElTZ
|
||||
38fnwB87H6e+Zj7I48ojxnmq7WA99IwSu1ulDqs61bjcghCL8IfU/NkpQCAshBEb
|
||||
TTl1q2mOc4rcuPnD8sNOqusRqwOgl7CFxH50lPt459SXQ1qZYnRmRs/qjpMGT0Uz
|
||||
M20bLUc5RWM3WAArW9AglFkCgYAdk+XHqSq5SmeeIk3D/tueAFZbtpm8fO08lzVg
|
||||
hx6T5CkV6OpEbdgT7iQnipnza46RExrVTMGEtOAV1OUbdaWC4eaQxjvX+G1IPvTP
|
||||
SIpdGhWy4y+Aq5zWZTQ8PayI/FdUBDCnJWkPMhyXp5F04Szx0cjV5/IqQ+qp2MtQ
|
||||
WN0ZiQKBgQDT7UFw5svbtjzE6pcjImRSDI4BwmA8F6C7bkK3M5mu10k+/kr5jDGG
|
||||
xgByyY61TY3TpHKLOmuxqKb3nOy8umPlFt3P7xpYTuV5+dZRrbIFKtDy2uKkYi9E
|
||||
N5xyVfanlXhlU7JoJtc2Xtkdjr5SwESHjNSjR8jDG/sd7opjeltOZg==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -1 +0,0 @@
|
||||
514CD4028F0A688DAD8236D20F352623455A4D74
|
||||
@@ -1,18 +0,0 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIC+zCCAeMCFFFM1AKPCmiNrYI20g81JiNFWk10MA0GCSqGSIb3DQEBCwUAMCYx
|
||||
JDAiBgNVBAMMG3Jvb3QgQ0EgZm9yIGlvcHN5cyBnYXRld2F5czAeFw0xOTA2MjQx
|
||||
NzEwMjhaFw0yOTA2MjExNzEwMjhaME4xCzAJBgNVBAYTAlNFMRIwEAYDVQQIDAlT
|
||||
dG9ja2hvbG0xFTATBgNVBAoMDGlvcHN5cywgSW5jLjEUMBIGA1UEAwwLVUJVUy1Y
|
||||
IERlbW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDosnAz7cNKUCWZ
|
||||
9+qFs8PpV1J1o+Eq6Hv3Bc5ceNrPxcEsE2vDWQdl7QXU9Je++xILSxfvljHIUO7D
|
||||
8AOcH03NO3N0F1H4KhmYIRjTKogQL8y/YIGFkzL4bZXwXRtvzXxMYNtdX4Lbdiyc
|
||||
AtGTiSWJ3zBtShPGPFqgR4JpYmf3VaVy/f74tRdUL86rnVNaU5OIBMHGLLxwMf2Z
|
||||
w3MPKSNj1ATcNoegKvMvHpd7FE2o5lDgFkUV3b8QqcAFTrmLXx6mYYpo9Fo1KHrA
|
||||
6SiUP0KQ/lkQ28yfkvzmN4JpJtLpomzscn9nmJfbI5g3GezSGGFHDAyW/Y2c+VPN
|
||||
N9C9n/NhAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAFEBujnBMhFVqLUPnDM41Cd0
|
||||
ZzbY5n/haBN885xQP0tNdCJ9qN0L8dr8bDe1IR02WHZ4UIXzvOj20Nu2+AFP1OCG
|
||||
CEEPLTQwlaJhaBzhnfLaxb7XCHqVodKBiYDYLQLFNdY9wYOKvyNI5xXMtPbH5fUK
|
||||
GJA4bZTbL5c4iaqtdXwLE/6a9FCtfGsv9k70tPw+KYR4tcA2t3SS2Oe/bGRrj5yQ
|
||||
Tjy0P7R033S4GlrsCRa7sRGg8yd7TgNpGsgyncsFRLHDG4V71I9NhOkoHR64oUfT
|
||||
YVPt/16TIi31vF5FJO4TJtbA2wEpUWPk7x2VjIOvvauMoYE6Hf3YLatzdaIQNHo=
|
||||
-----END CERTIFICATE-----
|
||||
@@ -1,16 +0,0 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIICkzCCAXsCAQAwTjELMAkGA1UEBhMCU0UxEjAQBgNVBAgMCVN0b2NraG9sbTEV
|
||||
MBMGA1UECgwMaW9wc3lzLCBJbmMuMRQwEgYDVQQDDAtVQlVTLVggRGVtbzCCASIw
|
||||
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOiycDPtw0pQJZn36oWzw+lXUnWj
|
||||
4Sroe/cFzlx42s/FwSwTa8NZB2XtBdT0l777EgtLF++WMchQ7sPwA5wfTc07c3QX
|
||||
UfgqGZghGNMqiBAvzL9ggYWTMvhtlfBdG2/NfExg211fgtt2LJwC0ZOJJYnfMG1K
|
||||
E8Y8WqBHgmliZ/dVpXL9/vi1F1QvzqudU1pTk4gEwcYsvHAx/ZnDcw8pI2PUBNw2
|
||||
h6Aq8y8el3sUTajmUOAWRRXdvxCpwAVOuYtfHqZhimj0WjUoesDpKJQ/QpD+WRDb
|
||||
zJ+S/OY3gmkm0umibOxyf2eYl9sjmDcZ7NIYYUcMDJb9jZz5U8030L2f82ECAwEA
|
||||
AaAAMA0GCSqGSIb3DQEBCwUAA4IBAQDWLgiuSq41EX4J5v5RH2gE3Ywr1FdzPMMe
|
||||
SCJxYL3JOcIvDl0aNyx2bAd9Gc6Zj8uRXT8gDsB3cEgAoHdGjiZB0uoNV/Auz6kS
|
||||
mYNnmpcZfAw775cBQpYBZvg2CRFqsv8mD4/OhBmoRjMpoosLkAYPuRmE58U/Ah+6
|
||||
9MJIzVca6dn7iLMLVWndkCoD9OUwBZNHU+SGTkn0IKUGyMUTmduADPBGbB7mYg6j
|
||||
DQsHiR1v7/ngb3uaQoVS8QA+XYmTUa1UZ+/83cmzjvf17rG10KwrJZh0lQNVUt5d
|
||||
gvH8aUvQq92xcXYQlhLfVFkqxmrLZNR0rIEeUVwYvVawPK8ZR+UK
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
@@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpQIBAAKCAQEA6LJwM+3DSlAlmffqhbPD6VdSdaPhKuh79wXOXHjaz8XBLBNr
|
||||
w1kHZe0F1PSXvvsSC0sX75YxyFDuw/ADnB9NzTtzdBdR+CoZmCEY0yqIEC/Mv2CB
|
||||
hZMy+G2V8F0bb818TGDbXV+C23YsnALRk4klid8wbUoTxjxaoEeCaWJn91Wlcv3+
|
||||
+LUXVC/Oq51TWlOTiATBxiy8cDH9mcNzDykjY9QE3DaHoCrzLx6XexRNqOZQ4BZF
|
||||
Fd2/EKnABU65i18epmGKaPRaNSh6wOkolD9CkP5ZENvMn5L85jeCaSbS6aJs7HJ/
|
||||
Z5iX2yOYNxns0hhhRwwMlv2NnPlTzTfQvZ/zYQIDAQABAoIBAQC+o9IA+T4R1++2
|
||||
YMImn8xVk1DfSE/lE2rcSklywSCjMGS+c3rKJFpHSxSID4tyz8dMsUz+4JIQhx3W
|
||||
MQEEGzFmftprtd9V7UfittrbxfCLMl4QPERg5uPPXBiHQACGbFb1TDTsHp/apMqP
|
||||
Vk/VC3tRpSTLpPDma/PjdDKHnDOJEXXvIiI6lWzDjkFS8cmb+ZChAVJSAVDpM3v5
|
||||
OjtH6Cfn7QnlQh5v6OEcScmdHjGKaVstoQnulr9fK632KsWd4DVrPjcs6IYz+AmI
|
||||
w6iMVWwfXM4HmtBZKmFZDB+QedvkKj3GoIGW7rbUWWWW5Nvk549SbrV4dFLmGjFe
|
||||
Vg2X59yxAoGBAPfOj/f7aJcltV6Guf4jmt0r9fB+wHAl9Vx1Dg0Etg10LJnjbgEI
|
||||
2jkvVr4qp71GUg0vTdbAwcX5ha1gjvvLEfH2ikSut7je1L26Lcm7tcyCGnlIIOU5
|
||||
gwyLwTFArdmK8yn2gC56I+MOdiqsw3xgvGeLaM39BTdAcDYtnJ2E0ysLAoGBAPBj
|
||||
/G30UVQ3bXcPuP2vZHNUSVBRr3Rsi4YO4Ue+pF4y1tcxaEDHYR+WuD03l/Vnu9mK
|
||||
xZxHLwQuVjAeogwrzNgbN3CMN9jytGfnwPPG8YOw0umpS7wk4ZBA6wh97R6H8hlI
|
||||
6rSZYt2i92rBKEDU0i5ciUnR0pjyy/IUhM9o/L7DAoGBAJqKWKCXSl/QpW5g6QdD
|
||||
3yWFb+hes9Z85aqWWX/m6z4ysEn8WrMMeUNmcVtBMMDKZQtR7+I47d9wQFyitijz
|
||||
OKrETPCOYYdKeDQmMr33cWYr0STHxbQOjNq7IW18366miAUodEIH6++DKlBs07Dy
|
||||
hyyv9VlZLPKLHi+7fEuD9UmHAoGBAL/2OCfdx+xGbsV66rC6FK78Cad383I3E5uz
|
||||
2jYeiMcoNeOV8rh3/pjpFKrd8Bzp/1oStQa82VCvZ+f5LlIlz+hqo3Teo+I8vc+T
|
||||
g8OnhEkzNNmedXoCwZUeIhGf7XBKAwwp7DLXodl3P7giEvDiggy/nGo0gcXdbPsd
|
||||
Y4j1P49dAoGAPlVSKQx+s7zfcUwJMG9AqOXvXUEg9+AJZBn/xqVVwbd0jb/yf1lB
|
||||
7Y+3Q3FndrVF/Gd7kTbgIlwI6sk7l0+CN1jjN1WEHgFenz6O4nlwIcdbQRovw/4S
|
||||
okAV3yLGjubMCjyKdBP8bpocBcstYdr2PEmrt37XFNhQVL3C8HjdPmU=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# do not create ubusproxy section if it exists already
|
||||
[ "$(uci -q get owsd.ubusproxy)" == "ubusproxy" ] && exit 0
|
||||
|
||||
uci set owsd.ubusproxy="ubusproxy"
|
||||
uci set owsd.ubusproxy.enable="1"
|
||||
uci set owsd.ubusproxy.peer_key="/etc/ubusx/ubusx_demo_only.key"
|
||||
uci set owsd.ubusproxy.peer_cert="/etc/ubusx/ubusx_demo_only.crt"
|
||||
uci set owsd.ubusproxy.peer_ca="/etc/ubusx/ubusxDemoCA.crt"
|
||||
uci commit owsd
|
||||
|
||||
# do not create wan_https section if it exists already
|
||||
[ "$(uci -q get owsd.wan_https)" == "owsd-listen" ] && exit 0
|
||||
|
||||
# do not create wan_https section if wan interface doesn't exist
|
||||
[ "$(uci -q get network.wan)" == "interface" ] || exit 0
|
||||
|
||||
uci set owsd.wan_https="owsd-listen"
|
||||
uci set owsd.wan_https.port="443"
|
||||
uci set owsd.wan_https.interface="wan"
|
||||
uci set owsd.wan_https.key="/etc/ubusx/ubusx_demo_only.key"
|
||||
uci set owsd.wan_https.cert="/etc/ubusx/ubusx_demo_only.crt"
|
||||
uci set owsd.wan_https.ca="/etc/ubusx/ubusxDemoCA.crt"
|
||||
uci set owsd.wan_https.whitelist_interface_as_origin="1"
|
||||
uci del_list owsd.wan_https.origin="*"
|
||||
uci add_list owsd.wan_https.origin="*"
|
||||
uci commit owsd
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_NAME:=peripheral_manager
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=769430115b6dd984313574c3fa2a6d99c65cd223
|
||||
PKG_SOURCE_VERSION:=02903ce5b594420331f80c6973fa3635921d7080
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/peripheral-manager
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=12
|
||||
START=19
|
||||
STOP=91
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
@@ -56,7 +56,7 @@ configure_ethports(){
|
||||
config_get speed $name speed
|
||||
config_get ifname $name ifname
|
||||
config_get pause $name pause
|
||||
set_port_speed $ifname $speed $name
|
||||
set_port_speed $ifname $speed
|
||||
set_port_pause $ifname $pause
|
||||
}
|
||||
|
||||
@@ -73,8 +73,3 @@ service_triggers() {
|
||||
procd_add_reload_trigger ports
|
||||
}
|
||||
|
||||
boot() {
|
||||
wan=$(db -q get hw.board.ethernetWanPort)
|
||||
restart_port $wan
|
||||
start
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# Copyright (C) 2013-2019 iopsys
|
||||
# Copyright (C) 2013 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=4.1.1
|
||||
PKG_VERSION:=3.1.40
|
||||
|
||||
PKG_SOURCE_VERSION:=68ccbdd0c689b26d3ded3569f6eed9ff785320df
|
||||
PKG_SOURCE_VERSION:=9edeefb6942c1a806a82274d124d8889bfb4f8e7
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/questd
|
||||
|
||||
@@ -27,7 +27,7 @@ else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
QUESTD_TARGET:=-DIOPSYS_MARVELL
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
# BUG FIXME the Intel mips target is not handled in questd this is just to get it to compile
|
||||
QUESTD_TARGET:=-DIOPSYS_INTEL
|
||||
QUESTD_TARGET:=-DIOPSYS_BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
QUESTD_TARGET:=-DIOPSYS_MEDIATEK
|
||||
QUESTD_CFLAGS:=\
|
||||
@@ -44,18 +44,7 @@ export QUESTD_CFLAGS
|
||||
|
||||
define Package/questd
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libuci \
|
||||
+libubox \
|
||||
+ubus \
|
||||
+libpthread \
|
||||
+TARGET_iopsys_ramips:swconfig \
|
||||
+TARGET_iopsys_ramips:libnl-tiny \
|
||||
+TARGET_iopsys_ramips:ip-full \
|
||||
+TARGET_intel_mips:ip-full \
|
||||
+libopenssl \
|
||||
+easy-soc-libs \
|
||||
+libmnl \
|
||||
+libnetfilter-conntrack
|
||||
DEPENDS:=+libuci +libubox +ubus +libpthread +TARGET_iopsys_ramips:swconfig +TARGET_iopsys_ramips:libnl-tiny +libopenssl
|
||||
TITLE:=router info daemon
|
||||
endef
|
||||
|
||||
@@ -70,6 +59,7 @@ define Package/questd/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/questd $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wificontrol $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/graphd $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uproxyd $(1)/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/netcheck $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
add_required_ubusproxy_objects() {
|
||||
uci -q del_list owsd.ubusproxy.object="wifix"
|
||||
uci -q add_list owsd.ubusproxy.object="wifix"
|
||||
uci commit owsd
|
||||
}
|
||||
|
||||
add_required_ubusproxy_objects
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys
|
||||
# Copyright (C) 2018 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=rulengd
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/rulengd.git
|
||||
PKG_SOURCE_VERSION:=ad94ccdd82b22527ab32937ca1a2682030319ed3
|
||||
PKG_SOURCE_VERSION:=99881f39232154530ac129dc2109d78963017ad1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_MAINTAINER:=Sartura Support for Inteno <support-inteno@sartura.hr>
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
config rule
|
||||
option event 'test.event'
|
||||
list event_data "{'test': 1, 'reason': 1}"
|
||||
list event_data "{'tests': [1, 2, 3]}"
|
||||
option method 'file->write'
|
||||
list method_data "{'path': '/tmp/test_event.txt'}"
|
||||
list method_data "{'data': 'test event received!'}"
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Start the rulengd
|
||||
#
|
||||
|
||||
START=17
|
||||
STOP=11
|
||||
START=99
|
||||
STOP=01
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=rulengd
|
||||
|
||||
@@ -72,25 +72,9 @@ hex_filter() {
|
||||
IFS=';'
|
||||
for i in $hex_chars;
|
||||
do
|
||||
local filtered
|
||||
|
||||
IFS=' '
|
||||
filtered=${dump//$i/}
|
||||
|
||||
set -- $i
|
||||
divider=$#
|
||||
|
||||
set -- $dump
|
||||
start=$#
|
||||
|
||||
set -- $filtered
|
||||
end=$#
|
||||
|
||||
wc=$((start-end))
|
||||
wc=$((wc/divider))
|
||||
|
||||
[ $wc -eq 0 ] || wc_tot=$((wc_tot+wc))
|
||||
IFS=';'
|
||||
local wc
|
||||
wc=$(echo "$dump" | grep -o "$i" | wc -w)
|
||||
wc_tot=$((wc_tot+wc))
|
||||
done
|
||||
|
||||
[ $wc_tot -gt $wc_max ] && echo "corrupt"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys
|
||||
# Copyright (C) 2013 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
@@ -13,11 +13,11 @@ PKG_VERSION:=2016.08
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
||||
ifdef CONFIG_TARGET_intel_mips
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/intel/uboot.git
|
||||
PKG_SOURCE_VERSION:=819227ec4cf4f2f8f7e8d46a3bee58e329089de6
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:intel/uboot.git
|
||||
PKG_SOURCE_VERSION:=a6292375108a6d5f200f234f5eef3fe17f427092
|
||||
else
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/uboot.git
|
||||
PKG_SOURCE_VERSION:=670ad7a30f3c6871b6c8a972e19ca2dd78ea8c9b
|
||||
PKG_SOURCE_VERSION:=3ef2ba866a99205496e0ce01935c89a1778d9b85
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -46,7 +46,7 @@ UBOOT_IMG:=uboot.img
|
||||
define uboot/ex400
|
||||
TITLE:=U-Boot for the ex400
|
||||
DEPENDS:=@TARGET_iopsys_ramips
|
||||
PKG_RELEASE:=7
|
||||
PKG_RELEASE:=6
|
||||
endef
|
||||
|
||||
define uboot/sdx810_ap
|
||||
@@ -59,10 +59,9 @@ define uboot/grx500
|
||||
TITLE:=U-Boot for the grx
|
||||
UBOOT_IMG:=u-boot-nand.bin
|
||||
DEPENDS:=@TARGET_intel_mips
|
||||
PKG_RELEASE:=10
|
||||
PKG_RELEASE:=8
|
||||
endef
|
||||
|
||||
# obsolete: no longer supported
|
||||
define uboot/grx500_speedport_smart3
|
||||
TITLE:=U-Boot for the Speedport Smart3
|
||||
UBOOT_IMG:=u-boot-nand.bin
|
||||
@@ -74,7 +73,7 @@ define uboot/grx500_norrland
|
||||
TITLE:=U-Boot for Norrland Board
|
||||
UBOOT_IMG:=u-boot-nand.bin
|
||||
DEPENDS:=@TARGET_intel_mips
|
||||
PKG_RELEASE:=15
|
||||
PKG_RELEASE:=8
|
||||
endef
|
||||
|
||||
UBOOTS := \
|
||||
@@ -124,13 +123,8 @@ define Build/Compile
|
||||
CROSS_COMPILE=$(TARGET_CROSS) env
|
||||
endef
|
||||
|
||||
# don't install /etc/init.d/uboot for intel-mips as it's not needed
|
||||
define Package/uboot/install/default
|
||||
$(INSTALL_DIR) $$(1)/lib/upgrade
|
||||
$(CP) ./files/uboot-upgrade $$(1)/lib/upgrade/
|
||||
$(if $(CONFIG_TARGET_intel_mips), ,$(INSTALL_DIR) $$(1)/etc/init.d)
|
||||
$(if $(CONFIG_TARGET_intel_mips), ,$(CP) ./files/uboot $$(1)/etc/init.d/)
|
||||
|
||||
$(CP) ./files/* $$(1)/
|
||||
$(INSTALL_DIR) $(BIN_DIR)/$(TARGET)
|
||||
$(INSTALL_DIR) $$(1)/boot
|
||||
$(CP) \
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=50
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
|
||||
sanity_check_env(){
|
||||
|
||||
# make sure iboot is used to start board, but only if verify_boot != 1
|
||||
@@ -22,24 +26,18 @@ sanity_check_env(){
|
||||
fw_setenv baudrate 115200
|
||||
}
|
||||
|
||||
do_uboot_upgrade(){
|
||||
uboot_upgrade(){
|
||||
local u_ver
|
||||
echo "doing upgrade of u-boot old version $cur_Major.$cur_Minor new version $Major.$Minor"
|
||||
mtd erase /dev/mtd0
|
||||
mtd write $1 /dev/mtd0
|
||||
mtd write /boot/uboot.img /dev/mtd0
|
||||
u_ver=$(strings /dev/mtd0 | grep 938f0820-2ffb-11e7-bbc9-2f21351ee6fb)
|
||||
[ -n "$u_ver" ] && fw_setenv uboot_inteno_version "$u_ver"
|
||||
sanity_check_env
|
||||
}
|
||||
|
||||
|
||||
# Return:
|
||||
# 0: update is successfull
|
||||
# 1: update is not needed
|
||||
# 2: error occured
|
||||
uboot_upgrade() {
|
||||
[ ! -f $1 ] && return 2
|
||||
|
||||
start() {
|
||||
iver=$(fw_printenv -n uboot_inteno_version 2>/dev/null)
|
||||
|
||||
# Fixup improper json string for major and minor key.
|
||||
@@ -49,8 +47,8 @@ uboot_upgrade() {
|
||||
if [ -z "$iver" ]
|
||||
then
|
||||
# if this variable is not set by u-boot the u-boot version is too old.
|
||||
do_uboot_upgrade $1
|
||||
return 0
|
||||
uboot_upgrade
|
||||
return
|
||||
fi
|
||||
|
||||
# read in current version into Major Minor variables
|
||||
@@ -65,7 +63,7 @@ uboot_upgrade() {
|
||||
cur_Minor=$Minor
|
||||
|
||||
# read in new uboot version into Major Minor variables
|
||||
json_load $(strings $1 | grep 938f0820-2ffb-11e7-bbc9-2f21351ee6fb |sed -e 's/938f0820-2ffb-11e7-bbc9-2f21351ee6fb: //')
|
||||
json_load $(strings /boot/uboot.img | grep 938f0820-2ffb-11e7-bbc9-2f21351ee6fb |sed -e 's/938f0820-2ffb-11e7-bbc9-2f21351ee6fb: //')
|
||||
json_get_vars Major Minor
|
||||
|
||||
# echo "Major $Major"
|
||||
@@ -73,15 +71,14 @@ uboot_upgrade() {
|
||||
|
||||
if [ $Major -gt $cur_Major ]
|
||||
then
|
||||
do_uboot_upgrade $1
|
||||
return 0
|
||||
uboot_upgrade
|
||||
return
|
||||
fi
|
||||
|
||||
if [ $Major -eq $cur_Major -a $Minor -gt $cur_Minor ]
|
||||
then
|
||||
do_uboot_upgrade $1
|
||||
return 0
|
||||
uboot_upgrade
|
||||
return
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=50
|
||||
|
||||
start() {
|
||||
. /lib/upgrade/uboot-upgrade
|
||||
uboot_upgrade /boot/uboot.img
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uspd
|
||||
PKG_VERSION:=1.0.3
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f033acb40afd9b087587d3cfba292e1d884600d6
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/uspd
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=USP ubus backend
|
||||
DEPENDS:=+libubox +ubus +icwmp-curl
|
||||
endef
|
||||
|
||||
define Package/uspd/description
|
||||
Ubus based backend for TR-369/USP which can be used by other USP agents
|
||||
running on top of it.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./uspd/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Package/uspd/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_BIN) ./files/uspd.init $(1)/etc/init.d/uspd
|
||||
$(INSTALL_CONF) ./files/uspd.config $(1)/etc/config/uspd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uspd $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,uspd))
|
||||
@@ -1,2 +0,0 @@
|
||||
config uspd 'usp'
|
||||
option granularitylevel '0'
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=94
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/uspd
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "cwmp"
|
||||
procd_add_config_trigger "config.change" "uspd" /etc/init.d/uspd restart
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2014 iopsys
|
||||
# Copyright (C) 2014 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
@@ -11,19 +11,6 @@ PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
VOICE_LIB:=broadcom.sh
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
VOICE_LIB:=broadcom.sh
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
VOICE_LIB:=intel.sh
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
VOICE_LIB:=broadcom.sh
|
||||
else
|
||||
$(info (UNEXPECTED CONFIG TARGET))
|
||||
VOICE_LIB:=broadcom.sh
|
||||
endif
|
||||
|
||||
define Package/voice-client
|
||||
SUBMENU:=Telephony
|
||||
SECTION:=net
|
||||
@@ -45,27 +32,7 @@ define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/voice-client/install
|
||||
$(CP) ./files/etc $(1)/
|
||||
$(CP) ./files/sbin $(1)/
|
||||
$(CP) ./files/usr $(1)/
|
||||
mkdir -p $(1)/lib/voice
|
||||
$(CP) ./files/lib/cw.sh $(1)/lib/.
|
||||
$(CP) ./files/lib/voice/$(VOICE_LIB) $(1)/lib/voice/voicelib.sh
|
||||
|
||||
ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
sed -i \
|
||||
-e 's/brcm/tapi/g' \
|
||||
-e 's/BRCM/TAPI/g' \
|
||||
-e 's/broadcom/intel/g' \
|
||||
-e 's/SWE/ETS/g' \
|
||||
$(1)/etc/config/voice_client \
|
||||
$(1)/etc/asterisk_templates/*
|
||||
sed -i \
|
||||
-e '/echo_cancel/d' \
|
||||
-e "/config.*tel_advanced.*TEL/a \ option 'echo_cancel' '1'" \
|
||||
$(1)/etc/config/voice_client
|
||||
|
||||
endif
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,voice-client))
|
||||
|
||||
@@ -64,10 +64,3 @@ featureaccesscodes = |FAC|
|
||||
;
|
||||
;language=
|
||||
|
||||
; Whether the transferor puts the transfer target on-hold before sending REFER
|
||||
;
|
||||
; The transferor needs put the transfer target on-hold before sending REFER to the transferee as per RFC5589.
|
||||
; But call transfer fails on some devices, e.g. Ericsson MTAS as the transfer target. The configuration is
|
||||
; to solve this kind of interoperability issue.
|
||||
hold_target_before_refer = |HOLDTARGET|
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ autodial_timeoutmsec=|AUTODIAL_TIMEOUT|
|
||||
dialtone_timeoutmsec=|DIALTONE_TIMEOUT|
|
||||
context=|CONTEXT|
|
||||
context_direct=|CONTEXT|-direct
|
||||
dialtone_extension_hint_context=|LINE_NAME|_dialtone
|
||||
dialtone_extension_hint_context=brcm_dialtone
|
||||
dialtone_extension_hint=|DIALTONE_EXTENSION_HINT|
|
||||
callwaiting=|CALLWAITING|
|
||||
clir=|CLIR|
|
||||
@@ -130,7 +130,7 @@ exten => s,1, Goto(s-${DIALSTATUS},1)
|
||||
exten => s,n, Hangup()
|
||||
|
||||
;handle busy (with CBBS support)
|
||||
exten => s-BUSY,1, Read(DIGIT,Busy,1,i,30)
|
||||
exten => s-BUSY,1, Read(DIGIT,Busy,1,in,30)
|
||||
exten => s-BUSY,n, GotoIf($["${DIGIT}" = "${ARG8}"]?ccbs)
|
||||
exten => s-BUSY,n, Hangup()
|
||||
exten => s-BUSY,n(ccbs), Set(result=${SHELL(/usr/lib/asterisk/cbbs.sh ${ARG1} ${ARG2} ${ARG3} ${ARG4} ${ARG5} ${ARG6} ${ARG7})})
|
||||
|
||||
@@ -1,138 +1,138 @@
|
||||
config tel_line 'brcm0'
|
||||
option extension '0000'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
option sip_account 'sip0'
|
||||
config 'brcm_line' 'brcm0'
|
||||
option 'extension' '0000'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
|
||||
config tel_line 'brcm1'
|
||||
option extension '1111'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
option sip_account 'sip0'
|
||||
config 'brcm_line' 'brcm1'
|
||||
option 'extension' '1111'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
|
||||
config tel_line 'brcm2'
|
||||
option extension '2222'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
config 'brcm_line' 'brcm2'
|
||||
option 'extension' '2222'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
|
||||
config tel_line 'brcm3'
|
||||
option extension '3333'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
config 'brcm_line' 'brcm3'
|
||||
option 'extension' '3333'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
|
||||
config tel_line 'brcm4'
|
||||
option extension '4444'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
config 'brcm_line' 'brcm4'
|
||||
option 'extension' '4444'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
|
||||
config tel_line 'brcm5'
|
||||
option extension '5555'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
config 'brcm_line' 'brcm5'
|
||||
option 'extension' '5555'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
|
||||
config tel_line 'brcm6'
|
||||
option extension '6666'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
config 'brcm_line' 'brcm6'
|
||||
option 'extension' '6666'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
|
||||
config tel_line 'brcm7'
|
||||
option extension '7777'
|
||||
option sip_account 'sip0'
|
||||
option noise '0'
|
||||
option vad '0'
|
||||
option txgain 4
|
||||
option rxgain 4
|
||||
option echo_cancel 1
|
||||
option callwaiting '0'
|
||||
option clir '0'
|
||||
config 'brcm_line' 'brcm7'
|
||||
option 'extension' '7777'
|
||||
option 'sip_account' 'sip0'
|
||||
option 'noise' '0'
|
||||
option 'vad' '0'
|
||||
option 'txgain' 4
|
||||
option 'rxgain' 4
|
||||
option 'echo_cancel' 1
|
||||
option 'callwaiting' '0'
|
||||
option 'clir' '0'
|
||||
|
||||
config dialplan 'custom_dialplan'
|
||||
option custom_outgoing_enabled '0'
|
||||
option custom_incoming_enabled '0'
|
||||
option custom_hangup_enabled '0'
|
||||
option all_ports_extension '#123456'
|
||||
option test_audio_extension '#123457'
|
||||
option test_echo_extension '#123458'
|
||||
option record_message_extension '#999999'
|
||||
config 'dialplan' 'custom_dialplan'
|
||||
option 'custom_outgoing_enabled' '0'
|
||||
option 'custom_incoming_enabled' '0'
|
||||
option 'custom_hangup_enabled' '0'
|
||||
option 'all_ports_extension' '#123456'
|
||||
option 'test_audio_extension' '#123457'
|
||||
option 'test_echo_extension' '#123458'
|
||||
option 'record_message_extension' '#999999'
|
||||
|
||||
config sip_advanced 'SIP'
|
||||
option rtpstart '10000'
|
||||
option rtpend '20000'
|
||||
option dtmfmode 'rfc2833'
|
||||
option remotehold 'yes'
|
||||
option contact_line_suffix '1'
|
||||
option registertimeoutbackoff '512'
|
||||
option registerattemptsbackoff '0'
|
||||
option register403timeout '0'
|
||||
option register503timeout '0'
|
||||
option registertimeoutguardsecs '15'
|
||||
option registertimeoutguardlimit '30'
|
||||
option registertimeoutguardpct '0.2'
|
||||
config 'sip_advanced' 'SIP'
|
||||
option 'rtpstart' '10000'
|
||||
option 'rtpend' '20000'
|
||||
option 'dtmfmode' 'rfc2833'
|
||||
option 'remotehold' 'yes'
|
||||
option 'contact_line_suffix' '1'
|
||||
option 'registertimeoutbackoff' '512'
|
||||
option 'registerattemptsbackoff' '0'
|
||||
option 'register403timeout' '0'
|
||||
option 'register503timeout' '0'
|
||||
option 'registertimeoutguardsecs' '15'
|
||||
option 'registertimeoutguardlimit' '30'
|
||||
option 'registertimeoutguardpct' '0.2'
|
||||
option defaultexpiry '300'
|
||||
option tls_version 'tlsv1'
|
||||
option tls_cipher 'DES-CBC3-SHA'
|
||||
option stun_server ''
|
||||
option dnsmgr 'no'
|
||||
option dnsmgr_refresh_interval '300'
|
||||
option srvlookup 'yes'
|
||||
option 'tls_version' 'tlsv1'
|
||||
option 'tls_cipher' 'DES-CBC3-SHA'
|
||||
option 'stun_server' ''
|
||||
option 'dnsmgr' 'no'
|
||||
option 'dnsmgr_refresh_interval' '300'
|
||||
option 'srvlookup' 'yes'
|
||||
|
||||
config tel_advanced 'TEL'
|
||||
option country 'SWE'
|
||||
option jbenable 'yes'
|
||||
option jbforce 'no'
|
||||
option jbmaxsize '500'
|
||||
option jbimpl 'adaptive'
|
||||
option genericplc 'yes'
|
||||
option dialoutmsec '4000'
|
||||
option cw_enable 'yes'
|
||||
config 'brcm_advanced' 'BRCM'
|
||||
option 'country' 'SWE'
|
||||
option 'jbenable' 'yes'
|
||||
option 'jbforce' 'no'
|
||||
option 'jbmaxsize' '500'
|
||||
option 'jbimpl' 'adaptive'
|
||||
option 'genericplc' 'yes'
|
||||
option 'dialoutmsec' '4000'
|
||||
option 'cw_enable' 'yes'
|
||||
|
||||
config features 'features'
|
||||
option cbbs_enabled '1'
|
||||
option callforward_enabled '1'
|
||||
option callwaiting_enabled '1'
|
||||
option redial_enabled '1'
|
||||
option callreturn_enabled '1'
|
||||
option advanced_register_settings '1'
|
||||
config 'features' 'features'
|
||||
option 'cbbs_enabled' '1'
|
||||
option 'callforward_enabled' '1'
|
||||
option 'callwaiting_enabled' '1'
|
||||
option 'redial_enabled' '1'
|
||||
option 'callreturn_enabled' '1'
|
||||
option 'advanced_register_settings' '1'
|
||||
|
||||
config log 'LOG'
|
||||
option console 'notice,warning,error'
|
||||
@@ -146,32 +146,31 @@ config ringing_status 'RINGING_STATUS'
|
||||
option shouldring '1'
|
||||
|
||||
config call_filter 'call_filter0'
|
||||
option block_foreign '0'
|
||||
option block_special_rate '0'
|
||||
option block_outgoing '0'
|
||||
option block_incoming '0'
|
||||
option block_foreign '0'
|
||||
option block_special_rate '0'
|
||||
option block_outgoing '0'
|
||||
option block_incoming '0'
|
||||
|
||||
config cdr_log 'CDR_LOG'
|
||||
option cdr_syslog '0'
|
||||
|
||||
config sip_service_provider 'sip0'
|
||||
option name 'Account 1'
|
||||
option enabled '0'
|
||||
option codec0 'alaw'
|
||||
config 'sip_service_provider' 'sip0'
|
||||
option 'name' 'Account 1'
|
||||
option 'enabled' '0'
|
||||
option 'codec0' 'alaw'
|
||||
option cbbs_key '5'
|
||||
option cbbs_maxretry '5'
|
||||
option cbbs_retrytime '300'
|
||||
option cbbs_waittime '30'
|
||||
option autoframing '1'
|
||||
option cfim_on '*21*'
|
||||
option cfim_off '#21#'
|
||||
option cfbs_on '*61*'
|
||||
option cfbs_off '#61#'
|
||||
option 'autoframing' '1'
|
||||
option 'cfim_on' '*21*'
|
||||
option 'cfim_off' '#21#'
|
||||
option 'cfbs_on' '*61*'
|
||||
option 'cfbs_off' '#61#'
|
||||
option cw_on '*43#'
|
||||
option cw_off '#43#'
|
||||
option cw_status '*#43#'
|
||||
option call_return '*69'
|
||||
option redial '*66'
|
||||
option is_fax '0'
|
||||
option transport 'udp'
|
||||
option 'call_return' '*69'
|
||||
option 'redial' '*66'
|
||||
option 'is_fax' '0'
|
||||
option 'transport' 'udp'
|
||||
|
||||
config cdr_log 'CDR_LOG'
|
||||
option cdr_syslog '0'
|
||||
|
||||
@@ -1,6 +1 @@
|
||||
rtpstart=$(uci -q get voice_client.SIP.rtpstart)
|
||||
rtpstart=${rtpstart:-10000}
|
||||
rtpend=$(uci -q get voice_client.SIP.rtpend)
|
||||
rtpend=${rtpend:-20000}
|
||||
|
||||
iptables -I zone_wan_input -m udp -p udp --dport $rtpstart:$rtpend -m comment --comment "!fw3: Allow-RTP" -j ACCEPT
|
||||
iptables -I zone_wan_input 4 -m udp -p udp --dport 10000:20000 -m comment --comment "!fw3: Allow-RTP" -j ACCEPT
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# The purpose of this file is to (re)create asterisk
|
||||
# configuration files from voice_client UCI config file.
|
||||
# This file is part of luci-app-voice,
|
||||
# its purpose is to (re)create asterisk configuration files
|
||||
# from luci config file(s).
|
||||
#
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
. /lib/voice/voicelib.sh
|
||||
|
||||
HOOKS=/usr/lib/inithooks/voice_client
|
||||
if [ -f "$HOOKS" ] ; then
|
||||
. $HOOKS
|
||||
@@ -16,13 +15,10 @@ START=60
|
||||
USE_PROCD=1
|
||||
|
||||
# Some global variables
|
||||
SERIAL="$(getSerial)"
|
||||
BASEMAC="$(getBaseMAC)"
|
||||
BASEMAC="${BASEMAC//:}"
|
||||
LINENAME="$(getLineName)"
|
||||
CHANNELNAME="$(getChannelName)"
|
||||
SERIAL=$(cat /proc/nvram/SerialNumber)
|
||||
BASEMAC=$(cat /proc/nvram/BaseMacAddr | sed 's/ //g')
|
||||
MODULENAME=voice
|
||||
USERAGENT="iopsys_${SERIAL}_${BASEMAC}"
|
||||
USERAGENT="Inteno_${SERIAL}_${BASEMAC}"
|
||||
|
||||
ASTUSER=nobody
|
||||
ASTGROUP=nogroup
|
||||
@@ -34,8 +30,8 @@ ASTERISKDIR=/etc/asterisk
|
||||
WORKDIR=/tmp/$MODULENAME.$$
|
||||
MD5SUMSFILE=/tmp/$MODULENAME-sums.$$
|
||||
|
||||
# Whitespace separated list of $CHANNELNAME feature access codes
|
||||
CHANNEL_FAC=
|
||||
# Whitespace separated list of BRCM feature access codes
|
||||
BRCM_FAC=
|
||||
|
||||
#TODO: go through templates, check usage
|
||||
|
||||
@@ -84,8 +80,8 @@ TMPL_ACL=$TEMPLATEDIR/acl.conf.TEMPLATE
|
||||
TMPL_CONFBRIDGE=$TEMPLATEDIR/confbridge.conf.TEMPLATE
|
||||
TMPL_UDPTL=$TEMPLATEDIR/udptl.conf.TEMPLATE
|
||||
|
||||
TMPL_CHANNEL=$TEMPLATEDIR/$LINENAME.conf.TEMPLATE
|
||||
TMPL_CHANNEL_LINE=$TEMPLATEDIR/tel_line.TEMPLATE
|
||||
TMPL_BRCM=$TEMPLATEDIR/brcm.conf.TEMPLATE
|
||||
TMPL_BRCM_LINE=$TEMPLATEDIR/brcm_line.TEMPLATE
|
||||
|
||||
TMPL_MEETME=$TEMPLATEDIR/meetme.conf.TEMPLATE
|
||||
|
||||
@@ -153,6 +149,7 @@ assemble_and_copy_config()
|
||||
[ -f $TMPL_ASTERISK ] && cp $TMPL_ASTERISK $WORKDIR/asterisk.conf
|
||||
[ -f $TMPL_CDR ] && cp $TMPL_CDR $WORKDIR/cdr.conf
|
||||
[ -f $TMPL_CEL ] && cp $TMPL_CEL $WORKDIR/cel.conf
|
||||
[ -f $TMPL_INDICATIONS ] && cp $TMPL_INDICATIONS $WORKDIR/indications.conf
|
||||
[ -f $TMPL_MANAGER ] && cp $TMPL_MANAGER $WORKDIR/manager.conf
|
||||
[ -f $TMPL_MODULES ] && cp $TMPL_MODULES $WORKDIR/modules.conf
|
||||
[ -f $TMPL_EXTENSIONS_MACRO ] && cp $TMPL_EXTENSIONS_MACRO $WORKDIR/extensions_macro.conf
|
||||
@@ -164,14 +161,6 @@ assemble_and_copy_config()
|
||||
[ -f $TMPL_UDPTL ] && cp $TMPL_UDPTL $WORKDIR/udptl.conf
|
||||
[ -f $SPECRATECFG ] && cp $SPECRATECFG $WORKDIR/special_rate_nr.cfg
|
||||
|
||||
[ -f $TMPL_INDICATIONS ] && {
|
||||
cp $TMPL_INDICATIONS $WORKDIR/indications.conf
|
||||
|
||||
config_get country TEL country
|
||||
country_code=$(supportedCountries |grep $country |cut -d':' -f3 |tr [A-Z] [a-z])
|
||||
sed -i "s/^country=.*/country=${country_code}/g" $WORKDIR/indications.conf
|
||||
}
|
||||
|
||||
test -e $TMPL_MEETME && cp $TMPL_MEETME $WORKDIR/meetme.conf
|
||||
|
||||
# Handle extensions_extra, carry over old file to new config if there is one
|
||||
@@ -191,7 +180,7 @@ assemble_and_copy_config()
|
||||
mv $WORKDIR/sip_registrations.tmp $WORKDIR/sip_registrations.conf
|
||||
mv $WORKDIR/sip_providers.tmp $WORKDIR/sip_providers.conf
|
||||
mv $WORKDIR/sip_users.tmp $WORKDIR/sip_users.conf
|
||||
mv $WORKDIR/$LINENAME.tmp $WORKDIR/$LINENAME.conf
|
||||
mv $WORKDIR/brcm.tmp $WORKDIR/brcm.conf
|
||||
mv $WORKDIR/extensions.tmp $WORKDIR/extensions.conf
|
||||
mv $WORKDIR/codecs.tmp $WORKDIR/codecs.conf
|
||||
mv $WORKDIR/rtp.tmp $WORKDIR/rtp.conf
|
||||
@@ -261,30 +250,93 @@ read_codecs_ptime()
|
||||
# returns a list of lines, formatted to replace a tag with sed
|
||||
# in a Dial() command
|
||||
#
|
||||
# For backwards compatibility, if i is only a number (not prefixed by
|
||||
# "SIP/" or "BRCM/") then add "BRCM/"
|
||||
#
|
||||
read_lines()
|
||||
{
|
||||
local line call_lines lines clength
|
||||
local lines=""
|
||||
local call_lines
|
||||
local fsxIdx fsxEpt dectIdx dectEpt
|
||||
|
||||
# Are lines already set by user conf?
|
||||
config_get call_lines $1 call_lines
|
||||
|
||||
for line in $call_lines ; do
|
||||
# Otherwise set default depending on board HW. This
|
||||
# is only done at very first boot or a default reset.
|
||||
if test -z "$call_lines"; then
|
||||
# Get all FSX voice endpoints. Translate to uppercase with awk
|
||||
# due to tr [:upper:] doesn't work in our BusyBox.
|
||||
voicePorts=$(db get hw.board.VoicePortOrder | \
|
||||
awk '{ print toupper($0) }' | \
|
||||
sed -e "s/\([[:alpha:]]*\)\([[:digit:]]\)/\1\/\2/g")
|
||||
voiceNames=$(db get hw.board.VoicePortNames)
|
||||
hasVoice=0
|
||||
|
||||
# convert line format to <LINENAME><LINEID>
|
||||
case $line in
|
||||
[0-9])
|
||||
;;
|
||||
"$CHANNELNAME"/[0-9])
|
||||
# get the index from channel name
|
||||
clength=$(echo $CHANNELNAME | wc -c)
|
||||
line="${line:$clength}"
|
||||
;;
|
||||
if test $(db get hw.board.hasVoice) = "1"; then
|
||||
# Get the first FSX voice endpoint index by
|
||||
# searching for the name usually used.
|
||||
fsxIdx=$(echo $voiceNames | \
|
||||
awk -e '{
|
||||
i = 1;
|
||||
while(i <= NF && tolower($i) !~ /^tel.*$/) {
|
||||
i++;
|
||||
}
|
||||
print i;
|
||||
}
|
||||
')
|
||||
|
||||
# Convert index to endpoint ID
|
||||
if test $fsxIdx -gt 0; then
|
||||
fsxEpt=$(echo $voicePorts | awk '{ print $'$fsxIdx' }')
|
||||
fi
|
||||
|
||||
hasVoice=1
|
||||
fi
|
||||
|
||||
if test $(db get hw.board.hasDect) = "1"; then
|
||||
# Get the first Dect voice endpoint index by
|
||||
# searching for the name usually used.
|
||||
dectIdx=$(echo $voiceNames | \
|
||||
awk -e '{
|
||||
i = 1;
|
||||
while(i <= NF && tolower($i) !~ /^dect.*$/) {
|
||||
i++;
|
||||
}
|
||||
print i;
|
||||
}
|
||||
')
|
||||
|
||||
if test $dectIdx -gt 0; then
|
||||
dectEpt=$(echo $voicePorts | awk '{ print $'$dectIdx' }')
|
||||
fi
|
||||
|
||||
hasVoice=1
|
||||
fi
|
||||
|
||||
if test $hasVoice -eq 1; then
|
||||
call_lines="$dectEpt $fsxEpt"
|
||||
|
||||
# If we didn't find any endpoint ID we
|
||||
# fallback to activate them all.
|
||||
if test -z "$call_lines"; then
|
||||
call_lines="$voicePorts"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Save the endpoint IDs we found where the
|
||||
# GUI expects to find them.
|
||||
uci_set voice_client "${1}" "call_lines" "$call_lines"
|
||||
uci_commit voice_client
|
||||
fi
|
||||
|
||||
for i in $call_lines ; do
|
||||
case $i in
|
||||
''|*[!0-9]*) lines=$lines"$i&" ;;
|
||||
*) lines=$lines"BRCM/$i&" ;;
|
||||
esac
|
||||
|
||||
[ -n "$line" ] || continue
|
||||
|
||||
lines="$lines$CHANNELNAME/$line&"
|
||||
|
||||
done
|
||||
|
||||
lines=$(escape_sed_substitution $lines)
|
||||
echo "${lines%??}"
|
||||
}
|
||||
@@ -664,25 +716,29 @@ configure_sip_provider()
|
||||
local autoframing
|
||||
local encryption
|
||||
|
||||
config_get enabled $1 enabled "0"
|
||||
config_get enabled $1 enabled
|
||||
config_get domain $1 domain
|
||||
config_get host $1 host "$domain"
|
||||
config_get host $1 host
|
||||
config_get port $1 port
|
||||
config_get outboundproxy $1 outboundproxy
|
||||
config_get outboundproxyport $1 outboundproxyport
|
||||
config_get user $1 user
|
||||
config_get authuser $1 authuser
|
||||
config_get secret $1 secret
|
||||
config_get is_fax $1 is_fax "0"
|
||||
config_get autoframing $1 autoframing "0"
|
||||
config_get transport $1 transport "udp"
|
||||
config_get encryption $1 encryption "0"
|
||||
config_get is_fax $1 is_fax
|
||||
config_get autoframing $1 autoframing
|
||||
config_get transport $1 transport
|
||||
config_get encryption $1 encryption
|
||||
|
||||
# This is a hack to fix security issue #14962
|
||||
user=${user//"'"/}
|
||||
authuser=${authuser//"'"/}
|
||||
|
||||
if [ "$enabled" == "0" ] ; then
|
||||
if [ -z "$transport" ] ; then
|
||||
transport="udp"
|
||||
fi
|
||||
|
||||
if [ -z "$enabled" -o "$enabled" = "0" ] ; then
|
||||
return
|
||||
fi
|
||||
|
||||
@@ -693,6 +749,10 @@ configure_sip_provider()
|
||||
|
||||
echo "Configuring SIP Provider $1"
|
||||
|
||||
if [ -z "$host" ] ; then
|
||||
host=$domain
|
||||
fi
|
||||
|
||||
# Get secret from existing asterisk config if its not set in luci config
|
||||
if [ -z "$secret" ] ; then
|
||||
echo "Restoring secret from old config for $1"
|
||||
@@ -739,20 +799,23 @@ configure_sip_provider()
|
||||
fi
|
||||
|
||||
# Set or remove encryption
|
||||
if [ "$encryption" == "0" ] ; then
|
||||
if [ -z "$encryption" -o "$encryption" == "0" ] ; then
|
||||
sed -i "/|ENCRYPTION|/d" $WORKDIR/sip_provider.tmp
|
||||
else
|
||||
sed -i "s/|ENCRYPTION|/yes/g" $WORKDIR/sip_provider.tmp
|
||||
fi
|
||||
|
||||
# Force ulaw/alaw if fax, otherwise read selected codecs
|
||||
if [ "$is_fax" == "1" ] ; then
|
||||
if [ -z "$is_fax" -o "$is_fax" = "1" ] ; then
|
||||
sed -i "s/|ALLOW|/allow = ulaw\nallow = alaw/" $WORKDIR/sip_provider.tmp
|
||||
else
|
||||
sed -i "s/|ALLOW|/$(read_codecs_ptime $1)/" $WORKDIR/sip_provider.tmp
|
||||
fi
|
||||
|
||||
# Autoframing
|
||||
if [ -z "$autoframing" ] ; then
|
||||
autoframing=0
|
||||
fi
|
||||
sed -i "s/|AUTOFRAMING|/$autoframing/" $WORKDIR/sip_provider.tmp
|
||||
|
||||
# Set registered extension so that incoming calls match the correct peer
|
||||
@@ -965,9 +1028,9 @@ configure_queue()
|
||||
do
|
||||
local out=""
|
||||
re='^[0-9]+$'
|
||||
num=${member#$LINENAME}
|
||||
num=${member#brcm}
|
||||
if [ -z "${num##[0-9]*}" ] ; then
|
||||
out="$CHANNELNAME/$num"
|
||||
out="BRCM/$num"
|
||||
else
|
||||
local sip_user
|
||||
config_get sip_user $member user
|
||||
@@ -1094,7 +1157,7 @@ configure_cdr()
|
||||
configure_call_filters()
|
||||
{
|
||||
local country
|
||||
config_get country TEL country
|
||||
config_get country BRCM country
|
||||
# Read the International Dialing Code and the Country Code from config
|
||||
|
||||
echo "Looking up IDC and CC for country $country"
|
||||
@@ -1372,7 +1435,7 @@ configure_extensions()
|
||||
fi
|
||||
|
||||
if [ -n "$extension_all_ports" ] ; then
|
||||
local all_lines=$(getAllLines)
|
||||
local all_lines="BRCM/0&BRCM/1&BRCM/2&BRCM/3&BRCM/4&BRCM/5&BRCM/6"
|
||||
echo "exten => $extension_all_ports,1,Dial($all_lines,,t)" >> $WORKDIR/extensions_local.tmp
|
||||
echo "exten => $extension_all_ports,n,Hangup()" >> $WORKDIR/extensions_local.tmp
|
||||
fi
|
||||
@@ -1386,6 +1449,7 @@ configure_extensions()
|
||||
echo "exten => $test_echo_extension,1,Echo()" >> $WORKDIR/extensions_local.tmp
|
||||
echo "exten => $test_echo_extension,n,Hangup()" >> $WORKDIR/extensions_local.tmp
|
||||
fi
|
||||
|
||||
|
||||
if [ -n "$record_message_extension" ] ; then
|
||||
echo "exten => $record_message_extension,1,Playback(beep)" >> $WORKDIR/extensions_local.tmp
|
||||
@@ -1399,7 +1463,7 @@ configure_extensions()
|
||||
sed -i "s/|CLIR_FAC_SET|//" $WORKDIR/extensions.tmp
|
||||
sed -i "s/|CLIR|/$clir/" $WORKDIR/extensions.tmp
|
||||
sed -i "s/|CLIR_FAC_LEN|/${#clir}/" $WORKDIR/extensions.tmp
|
||||
CHANNEL_FAC="$CHANNEL_FAC $clir."
|
||||
BRCM_FAC="$BRCM_FAC $clir."
|
||||
else
|
||||
sed -i "s/|CLIR_FAC_SET|/;/" $WORKDIR/extensions.tmp
|
||||
fi
|
||||
@@ -1621,7 +1685,7 @@ configure_extensions_provider()
|
||||
echo "exten => $user,n(norewrite),NoOp()">> $tmp
|
||||
|
||||
# read a list of lines that should be dialled on incoming calls
|
||||
incoming_lines="$(read_lines $1)"
|
||||
incoming_lines=$(read_lines $1)
|
||||
config_get call_queue $1 call_queue
|
||||
config_get call_ivr $1 call_ivr
|
||||
if [ -n "$incoming_lines" ]; then
|
||||
@@ -1658,9 +1722,9 @@ configure_extensions_provider()
|
||||
}
|
||||
|
||||
#
|
||||
# Create a local extension for a CHANNEL Line
|
||||
# Create a local extension for a BRCM Line
|
||||
#
|
||||
configure_tel_line_extension()
|
||||
configure_brcm_line_extension()
|
||||
{
|
||||
local line
|
||||
local extension
|
||||
@@ -1670,9 +1734,8 @@ configure_tel_line_extension()
|
||||
local cbbs_retrytime
|
||||
local cbbs_waittime
|
||||
local mailbox
|
||||
local line_name=$LINENAME
|
||||
|
||||
line=${1:${#line_name}}
|
||||
line=${1:4}
|
||||
config_get extension $1 extension
|
||||
|
||||
if [ -z "$line" ] ; then
|
||||
@@ -1697,7 +1760,7 @@ configure_tel_line_extension()
|
||||
|
||||
cp $TMPL_EXTENSIONS_LOCAL_LINE $WORKDIR/extensions_local_line.tmp
|
||||
sed -i "s/|EXTEN|/$extension/g" $WORKDIR/extensions_local_line.tmp
|
||||
sed -i "s/|LINE|/$(getLineIdx $line)/g" $WORKDIR/extensions_local_line.tmp
|
||||
sed -i "s/|LINE|/$line/g" $WORKDIR/extensions_local_line.tmp
|
||||
sed -i "s/|TIMEOUT|/$(get_voicemail_timeout)/g" $WORKDIR/extensions_local_line.tmp
|
||||
|
||||
#cbbs settings
|
||||
@@ -1770,16 +1833,16 @@ configure_codecs()
|
||||
{
|
||||
echo "Configuring codecs"
|
||||
local genericplc
|
||||
config_get genericplc TEL genericplc
|
||||
config_get genericplc BRCM genericplc
|
||||
sed -i "s/|PLC|/$genericplc/" $WORKDIR/codecs.tmp
|
||||
}
|
||||
|
||||
#
|
||||
# Configure default settings for $LINENAME.conf
|
||||
# Configure default settings for brcm.conf
|
||||
#
|
||||
configure_tel()
|
||||
configure_brcm()
|
||||
{
|
||||
echo "Configuring $CHANNELNAME"
|
||||
echo "Configuring BRCM"
|
||||
local jbenable
|
||||
local jbforce
|
||||
local jbmaxsize
|
||||
@@ -1787,63 +1850,44 @@ configure_tel()
|
||||
local dtmfcompatibility
|
||||
local dialoutmsec
|
||||
local fac
|
||||
local echocancel
|
||||
local hold_target_before_refer
|
||||
local calleridtype
|
||||
|
||||
config_get jbenable TEL jbenable
|
||||
config_get jbforce TEL jbforce
|
||||
config_get jbmaxsize TEL jbmaxsize
|
||||
config_get jbimpl TEL jbimpl
|
||||
config_get jbenable BRCM jbenable
|
||||
config_get jbforce BRCM jbforce
|
||||
config_get jbmaxsize BRCM jbmaxsize
|
||||
config_get jbimpl BRCM jbimpl
|
||||
config_get dtmfmode SIP dtmfmode
|
||||
config_get dialoutmsec TEL dialoutmsec
|
||||
config_get fac TEL fac
|
||||
config_get echocancel TEL echo_cancel
|
||||
config_get hold_target_before_refer TEL hold_target_before_refer
|
||||
config_get calleridtype TEL calleridtype
|
||||
config_get dialoutmsec BRCM dialoutmsec
|
||||
config_get fac BRCM fac
|
||||
|
||||
CHANNEL_FAC="$CHANNEL_FAC $fac"
|
||||
BRCM_FAC="$BRCM_FAC $fac"
|
||||
# Convert whitespace to commas
|
||||
CHANNEL_FAC=$(echo $CHANNEL_FAC | sed -e 's/^ *//' -e 's/ *$//' | tr -s ' ' | tr ' ' ',')
|
||||
BRCM_FAC=$(echo $BRCM_FAC | sed -e 's/^ *//' -e 's/ *$//' | tr -s ' ' | tr ' ' ',')
|
||||
|
||||
if [ -z "$dialoutmsec" ] ; then
|
||||
dialoutmsec=4000
|
||||
fi
|
||||
|
||||
sed -i "s/|JBENABLE|/$jbenable/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|JBFORCE|/$jbforce/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|JBMAXSIZE|/$jbmaxsize/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|JBIMPL|/$jbimpl/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|DIALOUTMSEC|/$dialoutmsec/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|FAC|/$CHANNEL_FAC/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|CHANNELS|/$(db get hw.board.VoicePorts)/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|ECHOCANCEL|/$(getEchoCancellingValue $echocancel)/" $WORKDIR/$LINENAME.tmp
|
||||
|
||||
if [ -n "${calleridtype}" ] ; then
|
||||
sed -i "s/^calleridtype *=.*/calleridtype = ${calleridtype}/g" $WORKDIR/$LINENAME.tmp
|
||||
else
|
||||
sed -i "/^calleridtype *=.*/d" $WORKDIR/$LINENAME.tmp
|
||||
fi
|
||||
sed -i "s/|JBENABLE|/$jbenable/" $WORKDIR/brcm.tmp
|
||||
sed -i "s/|JBFORCE|/$jbforce/" $WORKDIR/brcm.tmp
|
||||
sed -i "s/|JBMAXSIZE|/$jbmaxsize/" $WORKDIR/brcm.tmp
|
||||
sed -i "s/|JBIMPL|/$jbimpl/" $WORKDIR/brcm.tmp
|
||||
sed -i "s/|DIALOUTMSEC|/$dialoutmsec/" $WORKDIR/brcm.tmp
|
||||
sed -i "s/|FAC|/$BRCM_FAC/" $WORKDIR/brcm.tmp
|
||||
|
||||
if [ "$dtmfmode" == "compatibility" ] ; then
|
||||
dtmfcompatibility="1"
|
||||
else
|
||||
dtmfcompatibility="0"
|
||||
fi
|
||||
sed -i "s/|DTMFCOMPATIBILITY|/$dtmfcompatibility/" $WORKDIR/$LINENAME.tmp
|
||||
|
||||
if [ "$hold_target_before_refer" == "no" ]; then
|
||||
sed -i "s/|HOLDTARGET|/no/" $WORKDIR/$LINENAME.tmp
|
||||
else
|
||||
sed -i "s/|HOLDTARGET|/yes/" $WORKDIR/$LINENAME.tmp
|
||||
fi
|
||||
sed -i "s/|DTMFCOMPATIBILITY|/$dtmfcompatibility/" $WORKDIR/brcm.tmp
|
||||
}
|
||||
|
||||
#
|
||||
# Configure settings for individual line in $LINENAME.conf
|
||||
# Configure settings for individual line in brcm.conf
|
||||
#
|
||||
configure_tel_line()
|
||||
configure_brcm_line()
|
||||
{
|
||||
echo "Configuring BRCM line $1"
|
||||
local extension
|
||||
local sip_provider
|
||||
local codecs
|
||||
@@ -1889,30 +1933,30 @@ configure_tel_line()
|
||||
clir=0
|
||||
fi
|
||||
|
||||
cp $TMPL_CHANNEL_LINE $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|SECTION|/$1/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|CALLERID|/$extension/g" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|CONTEXT|/$sip_provider/g" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|DIALTONE_EXTENSION_HINT|/$1/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|AUTODIAL|/$autodial/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|AUTODIAL_TIMEOUT|/$autodial_timeout/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|DIALTONE_TIMEOUT|/$dialtone_timeout/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|DTMFRELAY|/$dtmfmode/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|CALLWAITING|/$callwaiting/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|CLIR|/$clir/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|LINE_NAME|/$LINENAME/" $WORKDIR/tel_line.tmp
|
||||
cp $TMPL_BRCM_LINE $WORKDIR/brcm_line.tmp
|
||||
sed -i "s/|SECTION|/$1/" $WORKDIR/brcm_line.tmp
|
||||
sed -i "s/|CALLERID|/$extension/g" $WORKDIR/brcm_line.tmp
|
||||
sed -i "s/|CONTEXT|/$sip_provider/g" $WORKDIR/brcm_line.tmp
|
||||
sed -i "s/|DIALTONE_EXTENSION_HINT|/$1/" $WORKDIR/brcm_line.tmp
|
||||
sed -i "s/|AUTODIAL|/$autodial/" $WORKDIR/brcm_line.tmp
|
||||
sed -i "s/|AUTODIAL_TIMEOUT|/$autodial_timeout/" $WORKDIR/brcm_line.tmp
|
||||
sed -i "s/|DIALTONE_TIMEOUT|/$dialtone_timeout/" $WORKDIR/brcm_line.tmp
|
||||
sed -i "s/|DTMFRELAY|/$dtmfmode/" $WORKDIR/brcm_line.tmp
|
||||
sed -i "s/|CALLWAITING|/$callwaiting/" $WORKDIR/brcm_line.tmp
|
||||
sed -i "s/|CLIR|/$clir/" $WORKDIR/brcm_line.tmp
|
||||
|
||||
#Configure CHANNEL line with codecs according to the SIP line settings
|
||||
|
||||
#Configure BRCM line with codecs according to the SIP line settings
|
||||
# local is_fax
|
||||
# config_get is_fax $sip_provider is_fax
|
||||
# if [ -z "$is_fax" -o "$is_fax" = "1" ] ; then
|
||||
# sed -i "s/|ALLOW|/allow = ulaw\nallow = alaw/" $WORKDIR/tel_line.tmp
|
||||
# sed -i "s/|ALLOW|/allow = ulaw\nallow = alaw/" $WORKDIR/brcm_line.tmp
|
||||
# else
|
||||
# sed -i "s/|ALLOW|/$(read_codecs $sip_provider)/" $WORKDIR/tel_line.tmp
|
||||
# sed -i "s/|ALLOW|/$(read_codecs $sip_provider)/" $WORKDIR/brcm_line.tmp
|
||||
# fi
|
||||
|
||||
cat $WORKDIR/tel_line.tmp >> $WORKDIR/$LINENAME.tmp
|
||||
rm -f $WORKDIR/tel_line.tmp
|
||||
cat $WORKDIR/brcm_line.tmp >> $WORKDIR/brcm.tmp
|
||||
rm -f $WORKDIR/brcm_line.tmp
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2011,35 +2055,30 @@ pbx_fix_ownership()
|
||||
}
|
||||
|
||||
#
|
||||
# Calculate a name for each $LINENAME line, depending on port type
|
||||
# Calculate a name for each brcm line, depending on port type
|
||||
# and number. The name is used to make UI look better.
|
||||
#
|
||||
set_line_name()
|
||||
{
|
||||
local maxlinenum=$2
|
||||
local curname name_ix ix item lnum
|
||||
local line_name=$LINENAME
|
||||
local line_name_len=${#line_name}
|
||||
local tel_line=$1
|
||||
|
||||
line=${tel_line:${line_name_len}}
|
||||
|
||||
# delete non-existing lines from config #
|
||||
case $tel_line in
|
||||
${line_name}[0-9])
|
||||
lnum=${tel_line:${line_name_len}:1}
|
||||
[ $((lnum+1)) -gt $maxlinenum ] && uci -q delete voice_client.$tel_line
|
||||
case $1 in
|
||||
brcm[0-9])
|
||||
lnum=${1:4:1}
|
||||
[ $((lnum+1)) -gt $maxlinenum ] && uci -q delete voice_client.$1
|
||||
;;
|
||||
esac
|
||||
#########################################
|
||||
|
||||
config_get curname $tel_line name
|
||||
config_get curname $1 name
|
||||
[ -n "$curname" ] && return
|
||||
|
||||
name_ix=""
|
||||
ix=0
|
||||
for item in $(db get hw.board.VoicePortOrder); do
|
||||
if [ "$item" == "$tel_line" ]; then
|
||||
if [ "$item" == "$1" ]; then
|
||||
name_ix=$ix
|
||||
break
|
||||
fi
|
||||
@@ -2050,14 +2089,15 @@ set_line_name()
|
||||
if [ -n "$name_ix" ]; then
|
||||
for item in $(db get hw.board.VoicePortNames); do
|
||||
if [ $ix -eq $name_ix ]; then
|
||||
uci_set voice_client $tel_line name "$(echo $item | tr '[_]' '[ ]')"
|
||||
uci_set voice_client $1 name \
|
||||
"$(echo "$item" |tr "[_]" "[ ]")"
|
||||
return
|
||||
fi
|
||||
ix=$((ix+1))
|
||||
done
|
||||
fi
|
||||
|
||||
uci_set voice_client $tel_line name $tel_line
|
||||
uci_set voice_client $1 name $1
|
||||
}
|
||||
|
||||
#
|
||||
@@ -2107,11 +2147,11 @@ start_service() {
|
||||
config_load voice_client
|
||||
|
||||
########################################################
|
||||
# Set line names according to board parameters
|
||||
# Set line names according to whats reported by brcminfo
|
||||
# and delete non-existing lines from voice_client config
|
||||
########################################################
|
||||
local maxlinenum=$(db get hw.board.VoicePorts)
|
||||
config_foreach set_line_name tel_line $maxlinenum
|
||||
config_foreach set_line_name brcm_line $maxlinenum
|
||||
uci_commit voice_client
|
||||
|
||||
#######################################
|
||||
@@ -2124,7 +2164,7 @@ start_service() {
|
||||
cp $TMPL_SIP $WORKDIR/sip.tmp
|
||||
cp $TMPL_RTP $WORKDIR/rtp.tmp
|
||||
cp $TMPL_STUN $WORKDIR/res_stun_monitor.tmp
|
||||
cp $TMPL_CHANNEL $WORKDIR/$LINENAME.tmp
|
||||
cp $TMPL_BRCM $WORKDIR/brcm.tmp
|
||||
cp $TMPL_CODECS $WORKDIR/codecs.tmp
|
||||
cp $TMPL_VOICEMAIL $WORKDIR/voicemail.tmp
|
||||
cp $TMPL_DNSMGR $WORKDIR/dnsmgr.tmp
|
||||
@@ -2168,12 +2208,12 @@ start_service() {
|
||||
config_foreach configure_sip_user_extension sip_user
|
||||
|
||||
#####################
|
||||
# CHANNEL configuration
|
||||
# BRCM configuration
|
||||
#####################
|
||||
configure_tel
|
||||
config_foreach configure_tel_line tel_line
|
||||
config_foreach configure_tel_line_extension tel_line
|
||||
config_foreach create_extensions_dialtone tel_line
|
||||
configure_brcm
|
||||
config_foreach configure_brcm_line brcm_line
|
||||
config_foreach configure_brcm_line_extension brcm_line
|
||||
config_foreach create_extensions_dialtone brcm_line
|
||||
configure_codecs
|
||||
|
||||
###########################
|
||||
@@ -2238,19 +2278,14 @@ stop_service() {
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
#stop
|
||||
start
|
||||
# turn off voice led; asterisk will turn it on if there is a registered account
|
||||
ubus call led.voice1 set '{"state":"off"}'
|
||||
|
||||
# FXS channel module must be reloaded before sip module. Otherwise some attributes like
|
||||
# line's registration state which is updated by SIP module through callback might be
|
||||
# reset.
|
||||
asterisk -rx "config reload $ASTERISKDIR/indications.conf"
|
||||
asterisk -rx "$(getChipVendor) reload"
|
||||
asterisk -rx "config reload $ASTERISKDIR/sip.conf"
|
||||
sleep 1
|
||||
asterisk -rx "core reload"
|
||||
asterisk -rx "dialplan reload"
|
||||
asterisk -rx "brcm reload"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/voice/voicelib.sh
|
||||
|
||||
# Adapt to config section name changes
|
||||
grep -q brcm_line /etc/config/voice_client && sed -i 's/brcm_line/tel_line/g' /etc/config/voice_client
|
||||
grep -q brcm_advanced /etc/config/voice_client && sed -i 's/brcm_advanced/tel_advanced/g' /etc/config/voice_client
|
||||
grep -q BRCM /etc/config/voice_client && sed -i 's/BRCM\///g' /etc/config/voice_client
|
||||
grep -q BRCM /etc/config/voice_client && sed -i 's/BRCM/TEL/g' /etc/config/voice_client
|
||||
|
||||
# Add call filter section
|
||||
uci -q get voice_client.call_filter0 >/dev/null || {
|
||||
|
||||
uci -q batch <<-EOT
|
||||
@@ -23,7 +14,6 @@ EOT
|
||||
|
||||
}
|
||||
|
||||
# Add ringing schedule section
|
||||
uci -q get voice_client.RINGING_STATUS >/dev/null || {
|
||||
|
||||
uci -q batch <<-EOT
|
||||
@@ -37,7 +27,27 @@ EOT
|
||||
|
||||
}
|
||||
|
||||
# Add firewall include
|
||||
# Default Broadcom phone volume for Iopsys 4.
|
||||
uci -q batch <<-EOT
|
||||
set voice_client.brcm0.txgain=4
|
||||
set voice_client.brcm0.rxgain=4
|
||||
set voice_client.brcm1.txgain=4
|
||||
set voice_client.brcm1.rxgain=4
|
||||
set voice_client.brcm2.txgain=4
|
||||
set voice_client.brcm2.rxgain=4
|
||||
set voice_client.brcm3.txgain=4
|
||||
set voice_client.brcm3.rxgain=4
|
||||
set voice_client.brcm4.txgain=4
|
||||
set voice_client.brcm4.rxgain=4
|
||||
set voice_client.brcm5.txgain=4
|
||||
set voice_client.brcm5.rxgain=4
|
||||
set voice_client.brcm6.txgain=4
|
||||
set voice_client.brcm6.rxgain=4
|
||||
set voice_client.brcm7.txgain=4
|
||||
set voice_client.brcm7.rxgain=4
|
||||
commit voice_client
|
||||
EOT
|
||||
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.sip
|
||||
set firewall.sip=include
|
||||
@@ -51,9 +61,9 @@ EOT
|
||||
# If dtmfmode is set to the obsolete compatability change to auto
|
||||
sed -i 's/dtmfmode\s*=\s*compatibility/dtmfmode=auto/' /etc/asterisk/sip.conf
|
||||
|
||||
if [ "$(uci get voice_client.SIP.dtmfmode)" == "compatibility" ]; then
|
||||
uci set voice_client.SIP.dtmfmode="auto"
|
||||
uci commit voice_client
|
||||
if [ $(uci get voice_client.SIP.dtmfmode) == 'compatibility' ]; then
|
||||
uci set voice_client.SIP.dtmfmode='auto'
|
||||
uci commit
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#! /bin/sh
|
||||
|
||||
. /lib/voice/voicelib.sh
|
||||
|
||||
if [ $2 != '?' ]; then
|
||||
for tel_line in `uci show voice_client | grep $(getLineName) | grep $1 | cut -d . -f 2`; do
|
||||
sed -i "/\[$tel_line\]/,/^\[/ s/\(callwaiting=\)[0-9]/\1$2/" /etc/asterisk/$(getLineName).conf
|
||||
for brcm in `uci show voice_client | grep brcm | grep $1 | cut -d . -f 2`; do
|
||||
sed -i "/\[$brcm\]/,/^\[/ s/\(callwaiting=\)[0-9]/\1$2/" /etc/asterisk/brcm.conf
|
||||
done
|
||||
else
|
||||
for tel_line in `uci show voice_client | grep $(getLineName) | grep $1 | cut -d . -f 2`; do
|
||||
status=`sed -n "/\[$tel_line\]/,/^\[/ s/callwaiting=\([0-9]\)/\1/p" /etc/asterisk/$(getLineName).conf`
|
||||
for brcm in `uci show voice_client | grep brcm | grep $1 | cut -d . -f 2`; do
|
||||
status=`sed -n "/\[$brcm\]/,/^\[/ s/callwaiting=\([0-9]\)/\1/p" /etc/asterisk/brcm.conf`
|
||||
echo $status
|
||||
exit 0
|
||||
done
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Voice library for Broadcom boards
|
||||
|
||||
getChipVendor() {
|
||||
echo brcm
|
||||
}
|
||||
|
||||
getChannelName() {
|
||||
echo BRCM
|
||||
}
|
||||
|
||||
getLineName() {
|
||||
echo brcm
|
||||
}
|
||||
|
||||
getSerial() {
|
||||
echo $(cat /proc/nvram/SerialNumber)
|
||||
}
|
||||
|
||||
getBaseMAC() {
|
||||
echo $(cat /proc/nvram/BaseMacAddr | sed 's/ //g')
|
||||
}
|
||||
|
||||
getAllLines() {
|
||||
echo "BRCM/0&BRCM/1&BRCM/2&BRCM/3&BRCM/4&BRCM/5"
|
||||
}
|
||||
|
||||
getLineIdx() {
|
||||
echo $1
|
||||
}
|
||||
|
||||
getEchoCancellingValue() {
|
||||
case $1 in
|
||||
0)
|
||||
echo '0'
|
||||
;;
|
||||
1)
|
||||
echo '1'
|
||||
;;
|
||||
*)
|
||||
# Unknown value
|
||||
echo ''
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
supportedCountries() {
|
||||
echo "Australia:AUS"
|
||||
echo "Belgium:BEL"
|
||||
echo "Brazil:BRA"
|
||||
echo "Chile:CHL"
|
||||
echo "China:CHN"
|
||||
echo "Czech:CZE"
|
||||
echo "Denmark:DNK"
|
||||
echo "ETSI:ETS"
|
||||
echo "Finland:FIN"
|
||||
echo "France:FRA"
|
||||
echo "Germany:DEU"
|
||||
echo "Hungary:HUN"
|
||||
echo "India:IND"
|
||||
echo "Italy:ITA"
|
||||
echo "Japan:JPN"
|
||||
echo "Netherlands:NLD"
|
||||
echo "New Zealand:NZL"
|
||||
echo "North America:USA"
|
||||
echo "Spain:ESP"
|
||||
echo "Sweden:SWE"
|
||||
echo "Switzerland:CHE"
|
||||
echo "Norway:NOR"
|
||||
echo "Taiwan:TWN"
|
||||
echo "United Kingdoms:GRB"
|
||||
echo "United Arab Emirates:ARE"
|
||||
echo "CFG TR57:T57"
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Voice library for Intel boards
|
||||
|
||||
getChipVendor() {
|
||||
echo intel
|
||||
}
|
||||
|
||||
getChannelName() {
|
||||
echo TAPI
|
||||
}
|
||||
|
||||
getLineName() {
|
||||
echo tapi
|
||||
}
|
||||
|
||||
getSerial() {
|
||||
sernum="$(fw_printenv -n serial_number 2> /dev/null)"
|
||||
|
||||
if [ $? ]; then
|
||||
echo $sernum
|
||||
else
|
||||
echo 0
|
||||
fi
|
||||
}
|
||||
|
||||
getBaseMAC() {
|
||||
echo $(fw_printenv -n ethaddr)
|
||||
}
|
||||
|
||||
getAllLines() {
|
||||
echo "TAPI/0&TAPI/1"
|
||||
}
|
||||
|
||||
getLineIdx() {
|
||||
echo $1
|
||||
}
|
||||
|
||||
getEchoCancellingValue() {
|
||||
case $1 in
|
||||
0)
|
||||
echo 'off'
|
||||
;;
|
||||
1)
|
||||
echo 'nlec'
|
||||
;;
|
||||
*)
|
||||
# Unknown value
|
||||
echo ''
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
supportedCountries() {
|
||||
echo "Austria:AUT:AT"
|
||||
echo "Denmark:DNK:DK"
|
||||
echo "Estonia:EST:EE"
|
||||
echo "Germany:DEU:DE"
|
||||
echo "Netherlands:NLD:NL"
|
||||
echo "Norway:NOR:NO"
|
||||
echo "Spain:ESP:ES"
|
||||
echo "Sweden:SWE:SE"
|
||||
echo "Switzerland:CHE:CH"
|
||||
echo "United Kingdom:GBR:UK"
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user