mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 19:14:05 +08:00
Compare commits
1 Commits
ne_map
...
porttrigge
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8bada4cf3 |
@@ -1,3 +1,7 @@
|
||||
config BBF_VENDOR_EXTENSION
|
||||
bool "Enable Vendor Extension"
|
||||
default y
|
||||
|
||||
config BBF_VENDOR_LIST
|
||||
string "Vendor List"
|
||||
default "iopsys"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.7.4
|
||||
PKG_VERSION:=1.5.4
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=57a3aedb8f6dea2a951d3edf1da0c868e252b27c
|
||||
PKG_SOURCE_VERSION:=cd2066de6781ace66d3165937a138a0f12353d8c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -21,14 +21,13 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include bbfdm.mk
|
||||
|
||||
define Package/libbbfdm-api
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF datamodel library, provides API to extend datamodel using DotSO plugins
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libcurl
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||
ABI_VERSION:=1.0
|
||||
endef
|
||||
|
||||
@@ -37,7 +36,7 @@ define Package/libbbfdm
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for broadband forum data model support
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api \
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libcurl +libbbfdm-api \
|
||||
+BBF_TR471:obudpst +libopenssl
|
||||
endef
|
||||
|
||||
@@ -49,6 +48,17 @@ define Package/bbfdmd
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +libbbfdm
|
||||
endef
|
||||
|
||||
define Package/userinterface
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Package to add Device.UserInterface. datamodel support
|
||||
endef
|
||||
|
||||
define Package/userinterface/description
|
||||
Package to add Device.UserInterface. datamodel support
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
source "$(SOURCE)/Config_bbfdm.in"
|
||||
endef
|
||||
@@ -81,11 +91,17 @@ CMAKE_OPTIONS += \
|
||||
-DBBF_TR471=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_EXTENSION=ON
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
|
||||
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES)
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_bbfdmd),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBFDMD_MAX_MSG_LEN:Integer=10485760
|
||||
@@ -109,13 +125,10 @@ define Package/libbbfdm/install
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-link-core-plugins $(1)/etc/uci-defaults/99-link-core-plugins
|
||||
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
|
||||
$(INSTALL_BIN) ./files/etc/firewall.service $(1)/etc/firewall.service
|
||||
ifeq ($(findstring iopsys,$(CONFIG_BBF_VENDOR_LIST)),iopsys)
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/iopsys/libbbfdm_iopsys_ext.so)
|
||||
endif
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm
|
||||
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
|
||||
endif
|
||||
endef
|
||||
@@ -140,14 +153,36 @@ define Package/bbfdmd/install
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
endef
|
||||
|
||||
define Package/userinterface/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DATA) ./files/etc/config/userinterface $(1)/etc/config/userinterface
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/userinterface $(1)/lib/upgrade/keep.d/userinterface
|
||||
$(INSTALL_BIN) ./files/etc/init.d/userinterface $(1)/etc/init.d/userinterface
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/93-userinterface-firewall $(1)/etc/uci-defaults/93-userinterface-firewall
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/94-userinterface-json $(1)/etc/uci-defaults/94-userinterface-json
|
||||
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-api
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbfdm-api/
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/*.h $(1)/usr/include/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm/dmtree/tr181/device.h $(1)/usr/include/libbbfdm/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/vendor.h $(1)/usr/include/libbbfdm/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbfdm-api/
|
||||
# Work around for backward compatibility
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbf_api/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/libbbfdm_api.h $(1)/usr/include/libbbf_api.h
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbbfdm-api))
|
||||
$(eval $(call BuildPackage,libbbfdm))
|
||||
$(eval $(call BuildPackage,bbfdmd))
|
||||
|
||||
$(eval $(call BuildPackage,userinterface))
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=capiagent
|
||||
PKG_VERSION:=2.1.1
|
||||
PKG_VERSION:=2.1.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=136cab3a9f1eec0132db9fa3f7bb1c8748ce1449
|
||||
PKG_SOURCE_VERSION:=3e671db8f567b19c109fc13b25bc571c4c73a962
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/capiagent.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -31,7 +31,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/capiagent
|
||||
TITLE+= capiagent (daemon implementing Wi-Fi Alliance's CAPI commands)
|
||||
DEPENDS= +libubox +libuci +libubus +libnl-genl +libeasy +libwifi \
|
||||
+libjson-c +libblobmsg-json +ubus +libieee1905 +libwifiutils
|
||||
+libjson-c +libblobmsg-json +ubus +libieee1905
|
||||
endef
|
||||
|
||||
define Package/capiagent/description
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020-2024 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=csmngr
|
||||
PKG_VERSION:=0.0.5
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=dcdaba75b85bf8758c34d3ae4a1be0ba09359331
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/csmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_CONFIG_DEPENDS := \
|
||||
CONFIG_PACKAGE_libwifiutils \
|
||||
CONFIG_PACKAGE_libwifi
|
||||
|
||||
PKG_BUILD_DEPENDS := libwifi
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/csmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi channel selection manager
|
||||
DEPENDS:=+libwifiutils +libwifi +libuci +libubox +ubus +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/csmngr/description
|
||||
WiFi Auto Channel Selection manager.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/csmngr/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/csmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/csmngr $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,csmngr))
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=95
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/csmngr
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
# procd_set_param stderr 1 #for debugging only
|
||||
# procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
if PACKAGE_ddnsmngr
|
||||
choice
|
||||
prompt "Select backend for dynamic DNS management"
|
||||
default DDNSMNGR_BACKEND_DDNSSCRIPT
|
||||
depends on PACKAGE_ddnsmngr
|
||||
help
|
||||
Select which package to use for dynamic DNS support
|
||||
|
||||
config DDNSMNGR_BACKEND_DDNSSCRIPT
|
||||
bool "Use ddns_script"
|
||||
|
||||
config DDNSMNGR_BACKEND_INADYN
|
||||
bool "Use inadyn"
|
||||
|
||||
endchoice
|
||||
endif
|
||||
@@ -1,79 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2024 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddnsmngr
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/ddnsmngr.git
|
||||
PKG_SOURCE_VERSION:=d0d37df44644ef2c1a0b11d3a4f92dc694ae1010
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_DDNSMNGR_BACKEND_DDNSSCRIPT CONFIG_DDNSMNGR_BACKEND_INADYN
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Dynamic DNS manager
|
||||
DEPENDS:=+libbbfdm-api +DDNSMNGR_BACKEND_DDNSSCRIPT:ddns-scripts +DDNSMNGR_BACKEND_INADYN:inadyn
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Manage dynamic DNS updation and provides Device.DynamicDNS. datamodel object based on TR181-2.16
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/ddnsmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/etc/ddnsmngr
|
||||
$(INSTALL_DIR) $(1)/etc/ddnsmngr/ddns
|
||||
$(INSTALL_DIR) $(1)/etc/ddnsmngr/servers
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ddnsmngr
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/libddnsmngr.so $(1)/etc/ddnsmngr/
|
||||
$(INSTALL_DATA) ./files/etc/ddnsmngr/input.json $(1)/etc/ddnsmngr/
|
||||
$(INSTALL_DATA) ./files/etc/config/ddnsmngr $(1)/etc/config/ddnsmngr
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-ddns-config-migrate $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/ddnsmngr $(1)/etc/init.d/ddnsmngr
|
||||
ifeq ($(CONFIG_DDNSMNGR_BACKEND_DDNSSCRIPT),y)
|
||||
$(INSTALL_BIN) ./files/usr/lib/ddns_script/ddnsmngr_service.sh $(1)/usr/lib/ddnsmngr/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns-script/usr/lib/ddnsmngr/ddnsmngr_updater.sh $(1)/usr/lib/ddnsmngr/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/ddns-script/server/* $(1)/etc/ddnsmngr/servers
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns-script/usr/libexec/rpcd/ddnsmngr $(1)/usr/libexec/rpcd/ddnsmngr
|
||||
endif
|
||||
ifeq ($(CONFIG_DDNSMNGR_BACKEND_INADYN),y)
|
||||
$(INSTALL_BIN) ./files/usr/lib/inadyn/ddnsmngr_service.sh $(1)/usr/lib/ddnsmngr/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/inadyn/server/* $(1)/etc/ddnsmngr/servers
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/inadyn/usr/libexec/rpcd/ddnsmngr $(1)/usr/libexec/rpcd/ddnsmngr
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -1,23 +0,0 @@
|
||||
config ddnsmngr 'global'
|
||||
option configfile '/var/run/ddnsmngr/ddnsmngr.json'
|
||||
option ddns_dateformat '%F %R'
|
||||
option ddns_rundir '/var/run/ddnsmngr'
|
||||
option ddns_logdir '/var/log/ddnsmngr'
|
||||
option ddns_loglines '250'
|
||||
option upd_privateip '0'
|
||||
option use_curl '1'
|
||||
|
||||
config server 'ddns_server_1'
|
||||
option enabled '1'
|
||||
option service 'dynu.com'
|
||||
option name 'dynu.com'
|
||||
|
||||
config server 'ddns_server_2'
|
||||
option enabled '1'
|
||||
option service 'dyndns.org'
|
||||
option name 'dyndns.org'
|
||||
|
||||
config server 'ddns_server_3'
|
||||
option enabled '1'
|
||||
option service 'zoneedit.com'
|
||||
option name 'zoneedit.com'
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/ddnsmngr/libddnsmngr.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.ddnsmngr",
|
||||
"parent_dm": "Device.",
|
||||
"object": "DynamicDNS",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
STOP=10
|
||||
USE_PROCD=1
|
||||
DM_INPUT="/etc/ddnsmngr/input.json"
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
. /usr/lib/ddnsmngr/ddnsmngr_service.sh
|
||||
|
||||
start_service() {
|
||||
start_ddnsmngr_service
|
||||
bbfdm_add_service "bbfdm.ddnsmngr" "${DM_INPUT}"
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
stop_ddnsmngr_service
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger ddnsmngr
|
||||
add_ddnsmngr_triggers
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
cl_id=1
|
||||
srv_id=1
|
||||
|
||||
function get_ddns_config_option() {
|
||||
local val
|
||||
|
||||
val="$(uci -q get ddns.${1}.${2})"
|
||||
|
||||
if [ -z "${val}" ] && [ -n "${3}" ]; then
|
||||
val="${3}"
|
||||
fi
|
||||
|
||||
echo "${val}"
|
||||
}
|
||||
|
||||
function config_supported_service() {
|
||||
if ! uci -q get ddnsmngr.global >/dev/null 2>&1; then
|
||||
uci -q set ddnsmngr.global="ddnsmngr"
|
||||
fi
|
||||
|
||||
servers=""
|
||||
|
||||
for i in $(find /etc/ddnsmngr/servers/ -name '*.json' | cut -d'/' -f 5 | sed "s/.json//")
|
||||
do
|
||||
if [ -z "${servers}" ]; then
|
||||
servers="${i}"
|
||||
else
|
||||
servers="${servers},${i}"
|
||||
fi
|
||||
done
|
||||
|
||||
uci -q set ddnsmngr.global.supported_services="${servers}"
|
||||
}
|
||||
|
||||
function migrate_service_section() {
|
||||
client_sec=""
|
||||
enabled="$(get_ddns_config_option ${1} enabled "0")"
|
||||
service_name="$(get_ddns_config_option ${1} service_name)"
|
||||
interface="$(get_ddns_config_option ${1} interface)"
|
||||
ip_network="$(get_ddns_config_option ${1} ip_network)"
|
||||
username="$(get_ddns_config_option ${1} username)"
|
||||
password="$(get_ddns_config_option ${1} password)"
|
||||
lookup_host="$(get_ddns_config_option ${1} lookup_host)"
|
||||
use_ipv6="$(get_ddns_config_option ${1} use_ipv6 "0")"
|
||||
force_ipversion="$(get_ddns_config_option ${1} force_ipversion "0")"
|
||||
use_https="$(get_ddns_config_option ${1} use_https "0")"
|
||||
force_dnstcp="$(get_ddns_config_option ${1} force_dnstcp "0")"
|
||||
|
||||
if [ -z "${service_name}" ]; then
|
||||
uci -q delete ddns."${1}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# check server file is present in device
|
||||
if [ ! -f "/etc/ddnsmngr/servers/${service_name}.json" ]; then
|
||||
uci -q delete ddns."${1}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Check if client section is already added for this service
|
||||
clients=$(uci -q show ddnsmngr | grep "=client")
|
||||
client_count=$(echo "${clients}" | wc -l)
|
||||
|
||||
tmp=0
|
||||
while [ $tmp -lt $client_count ]
|
||||
do
|
||||
mngr_serv="$(uci -q get ddnsmngr.@client[$tmp].service_name)"
|
||||
mngr_intf="$(uci -q get ddnsmngr.@client[$tmp].interface)"
|
||||
mngr_netw="$(uci -q get ddnsmngr.@client[$tmp].ip_network)"
|
||||
mngr_user="$(uci -q get ddnsmngr.@client[$tmp].username)"
|
||||
mngr_ipv6="$(uci -q get ddnsmngr.@client[$tmp].use_ipv6)"
|
||||
mngr_forceip="$(uci -q get ddnsmngr.@client[$tmp].force_ipversion)"
|
||||
mngr_https="$(uci -q get ddnsmngr.@client[$tmp].use_https)"
|
||||
mngr_dnstcp="$(uci -q get ddnsmngr.@client[$tmp].force_dnstcp)"
|
||||
|
||||
[ -z "${mngr_ipv6}" ] && mngr_ipv6="0"
|
||||
[ -z "${mngr_forceip}" ] && mngr_forceip="0"
|
||||
[ -z "${mngr_https}" ] && mngr_https="0"
|
||||
[ -z "${mngr_dnstcp}" ] && mngr_dnstcp="0"
|
||||
|
||||
if [ "${mngr_serv}" == "${service_name}" ] && [ "${mngr_intf}" == "${interface}" ] && \
|
||||
[ "${mngr_netw}" == "${ip_network}" ] && [ "${mngr_user}" == "${username}" ] && \
|
||||
[ "${mngr_ipv6}" == "${use_ipv6}" ] && [ "${mngr_forceip}" == "${force_ipversion}" ] && \
|
||||
[ "${mngr_https}" == "${use_https}" ] && [ "${mngr_dnstcp}" == "${force_dnstcp}" ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
tmp=$(( tmp + 1 ))
|
||||
done
|
||||
|
||||
if [ $tmp -ne $client_count ]; then
|
||||
i=0
|
||||
for client in $clients; do
|
||||
if [ $i -eq $tmp ]; then
|
||||
client_sec="$(echo $client | cut -d'=' -f 1 | cut -d'.' -f 2)"
|
||||
break
|
||||
fi
|
||||
i=$(( i + 1 ))
|
||||
done
|
||||
|
||||
if [ $enabled -eq 1 ]; then
|
||||
uci -q set ddnsmngr."${client_sec}".enabled="1"
|
||||
fi
|
||||
else
|
||||
client_sec=ddns_mig_client_"${cl_id}"
|
||||
|
||||
uci -q set ddnsmngr."${client_sec}"="client"
|
||||
uci -q set ddnsmngr."${client_sec}".enabled="${enabled}"
|
||||
uci -q set ddnsmngr."${client_sec}".service_name="${service_name}"
|
||||
uci -q set ddnsmngr."${client_sec}".interface="${interface}"
|
||||
uci -q set ddnsmngr."${client_sec}".ip_network="${ip_network}"
|
||||
uci -q set ddnsmngr."${client_sec}".username="${username}"
|
||||
uci -q set ddnsmngr."${client_sec}".password="${password}"
|
||||
uci -q set ddnsmngr."${client_sec}".use_ipv6="${use_ipv6}"
|
||||
uci -q set ddnsmngr."${client_sec}".force_ipversion="${force_ipversion}"
|
||||
uci -q set ddnsmngr."${client_sec}".use_https="${use_https}"
|
||||
uci -q set ddnsmngr."${client_sec}".force_dnstcp="${force_dnstcp}"
|
||||
|
||||
cl_id=$(( cl_id + 1 ))
|
||||
|
||||
# add server section if not added
|
||||
servers=$(uci -q show ddnsmngr | grep "service=\'${service_name}\'")
|
||||
if [ -z "${servers}" ]; then
|
||||
server_sec=ddns_mig_server_"${srv_id}"
|
||||
uci -q set ddnsmngr."${server_sec}"="server"
|
||||
uci -q set ddnsmngr."${server_sec}".enabled="1"
|
||||
uci -q set ddnsmngr."${server_sec}".service="${service_name}"
|
||||
uci -q set ddnsmngr."${server_sec}".name="${service_name}"
|
||||
|
||||
srv_id=$(( srv_id + 1 ))
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# if lookup_host is set then add host section
|
||||
if [ -n "${lookup_host}" ] && [ -n "${client_sec}" ]; then
|
||||
# check number of hosts present for this client
|
||||
host_count=$(uci -q show ddnsmngr | grep "dm_parent=\'${client_sec}\'" | wc -l)
|
||||
host_ix=$(( host_count + 1 ))
|
||||
host_sec="${client_sec}"_host_"${host_ix}"
|
||||
|
||||
uci -q set ddnsmngr."${host_sec}"="host"
|
||||
uci -q set ddnsmngr."${host_sec}".enabled="${enabled}"
|
||||
uci -q set ddnsmngr."${host_sec}".lookup_host="${lookup_host}"
|
||||
uci -q set ddnsmngr."${host_sec}".dm_parent="${client_sec}"
|
||||
fi
|
||||
|
||||
uci -q delete ddns."${1}"
|
||||
}
|
||||
|
||||
function migrate_ddns_config() {
|
||||
if [ ! -f "/etc/config/ddnsmngr" ]; then
|
||||
# Create ddnsmngr config file
|
||||
touch /etc/config/ddnsmngr
|
||||
fi
|
||||
|
||||
config_supported_service
|
||||
|
||||
config_load ddns
|
||||
config_foreach migrate_service_section service
|
||||
|
||||
uci -q commit ddns
|
||||
uci -q commit ddnsmngr
|
||||
}
|
||||
|
||||
migrate_ddns_config
|
||||
@@ -1,169 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
RUNDIR="/var/run/ddnsmngr"
|
||||
LOGDIR="/var/log/ddnsmngr"
|
||||
PROG="/usr/lib/ddnsmngr/ddnsmngr_updater.sh"
|
||||
CONFIGFILE="/var/run/ddnsmngr/ddnsmngr.json"
|
||||
CLIENT_INTFS=""
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
log() {
|
||||
echo "$*"|logger -t ddnsmngr.init -p debug
|
||||
}
|
||||
|
||||
validate_host_section() {
|
||||
uci_validate_section ddnsmngr host "${1}" \
|
||||
'enabled:bool:0' \
|
||||
'lookup_host:string' \
|
||||
'dm_parent:string'
|
||||
}
|
||||
|
||||
validate_client_section() {
|
||||
uci_validate_section ddnsmngr client "${1}" \
|
||||
'enabled:bool:0' \
|
||||
'service_name:string' \
|
||||
'interface:string' \
|
||||
'ip_network:string' \
|
||||
'username:string' \
|
||||
'password:string' \
|
||||
'use_https:bool:0' \
|
||||
'force_dnstcp:bool:0' \
|
||||
'use_ipv6:bool:0' \
|
||||
'force_ipversion:bool:0'
|
||||
}
|
||||
|
||||
add_object() {
|
||||
local enabled lookup_host dm_parent use_ipv6 force_ipversion proc_info_file
|
||||
local service_name interface ip_network username password use_https force_dnstcp
|
||||
|
||||
validate_host_section "${1}" || {
|
||||
log "Validation of host section failed"
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ "${enabled}" -ne 1 ] || [ -z "${dm_parent}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
validate_client_section "${dm_parent}" || {
|
||||
log "Validation of client section failed"
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ "${enabled}" -ne 1 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
service_name=$(uci -q get ddnsmngr.${dm_parent}.service_name)
|
||||
if [ -z "${service_name}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
service_section=$(uci -q show ddnsmngr | grep "service=\'${service_name}\'" | cut -d'.' -f 2 | head -1)
|
||||
if [ -z "${service_section}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
service_enabled=$(uci -q get ddnsmngr.${service_section}.enabled)
|
||||
if [ "${service_enabled}" -ne 1 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_add_object
|
||||
json_add_string "interface" "${interface}"
|
||||
json_add_string "service_name" "${service_name}"
|
||||
json_add_string "username" "${username}"
|
||||
json_add_string "password" "${password}"
|
||||
json_add_string "lookup_host" "${lookup_host}"
|
||||
json_add_string "ip_network" "${ip_network}"
|
||||
json_add_string "proc_info_file" "${1}"
|
||||
json_add_string "use_ipv6" "${use_ipv6}"
|
||||
json_add_string "force_ipversion" "${force_ipversion}"
|
||||
json_add_string "use_https" "${use_https}"
|
||||
json_add_string "force_dnstcp" "${force_dnstcp}"
|
||||
json_close_object
|
||||
|
||||
if [ -z "${interface}" ]; then
|
||||
if [ "${use_ipv6}" -eq 0 ]; then
|
||||
interface="wan"
|
||||
else
|
||||
interface="wan6"
|
||||
fi
|
||||
fi
|
||||
|
||||
for intf in $CLIENT_INTFS; do
|
||||
if [ "${intf}" == "${interface}" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
CLIENT_INTFS="${CLIENT_INTFS} ${interface}"
|
||||
}
|
||||
|
||||
start_ddnsmngr_service() {
|
||||
run_dir=$(uci -q get ddnsmngr.global.ddns_rundir)
|
||||
log_dir=$(uci -q get ddnsmngr.global.ddns_logdir)
|
||||
|
||||
if [ -n "${run_dir}" ]; then
|
||||
RUNDIR="${run_dir}"
|
||||
fi
|
||||
|
||||
if [ -n "${log_dir}" ]; then
|
||||
LOGDIR="${log_dir}"
|
||||
fi
|
||||
|
||||
mkdir -p "${RUNDIR}"
|
||||
mkdir -p "${LOGDIR}"
|
||||
|
||||
conf_file=$(uci -q get ddnsmngr.global.configfile)
|
||||
if [ -n "${conf_file}" ]; then
|
||||
CONFIGFILE="${conf_file}"
|
||||
fi
|
||||
|
||||
touch "${CONFIGFILE}"
|
||||
|
||||
if [ ! -f "${CONFIGFILE}" ]; then
|
||||
log "Can not create ${CONFIGFILE}, exit"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
json_init
|
||||
json_add_array "services"
|
||||
|
||||
config_load ddnsmngr
|
||||
config_foreach add_object host
|
||||
|
||||
json_close_array
|
||||
json_dump > "${CONFIGFILE}"
|
||||
|
||||
procd_open_instance ddnsmngr
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -c "${CONFIGFILE}"
|
||||
procd_append_param command -- start
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_ddnsmngr_service() {
|
||||
conf_file=$(uci -q get ddnsmngr.global.configfile)
|
||||
if [ -n "${conf_file}" ]; then
|
||||
CONFIGFILE="${conf_file}"
|
||||
fi
|
||||
|
||||
if [ ! -f "${CONFIGFILE}" ]; then
|
||||
log "${CONFIGFILE} not found, can't stop services if running any"
|
||||
fi
|
||||
|
||||
"$PROG" -c "${CONFIGFILE}" -- stop
|
||||
return 0
|
||||
}
|
||||
|
||||
add_ddnsmngr_triggers() {
|
||||
procd_open_trigger
|
||||
for intf in $CLIENT_INTFS; do
|
||||
# No need to handle other ifevents like ifupdate etc
|
||||
procd_add_interface_trigger "interface.*.up" $intf /etc/init.d/ddnsmngr restart
|
||||
procd_add_interface_trigger "interface.*.down" $intf /etc/init.d/ddnsmngr restart
|
||||
done
|
||||
procd_close_trigger
|
||||
}
|
||||
@@ -1,311 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
PROG="/usr/sbin/inadyn"
|
||||
CONFIGPATH="/tmp/inadyn_config"
|
||||
PIDPATH="/etc/inadyn_pid"
|
||||
CLIENT_INTFS=""
|
||||
CONFIG_FILES=""
|
||||
SERVER_PATH="/etc/ddnsmngr/servers"
|
||||
|
||||
FORMAT="custom [SECTION] {\n\tusername\t= [USER]\n\tpassword\t= [PWD]\n\tddns-server\t= [SERV]\n\tddns-path\t= [URI]\n\tssl\t\t= [SSL]\n\thostname\t= [NAME]\n\tcheckip-command\t= [CMD]\n\tddns-response\t= [RESPONSES]\n}"
|
||||
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
log() {
|
||||
echo "$*"|logger -t ddnsmngr.init -p debug
|
||||
}
|
||||
|
||||
get_service_data() {
|
||||
local provider="$1"
|
||||
shift
|
||||
local dir="$1"
|
||||
shift
|
||||
local ipv6="$1"
|
||||
shift
|
||||
|
||||
local name data url answer script
|
||||
|
||||
[ $# -ne 2 ] && {
|
||||
return 1
|
||||
}
|
||||
|
||||
[ -f "${dir}/${provider}.json" ] || {
|
||||
eval "$1=\"\""
|
||||
eval "$2=\"\""
|
||||
return 1
|
||||
}
|
||||
|
||||
json_load_file "${dir}/${provider}.json"
|
||||
json_get_var name "name"
|
||||
if [ "$ipv6" -eq "1" ]; then
|
||||
json_select "ipv6"
|
||||
else
|
||||
json_select "ipv4"
|
||||
fi
|
||||
json_get_var data "url"
|
||||
json_get_var answer "answer"
|
||||
json_select ".."
|
||||
json_cleanup
|
||||
|
||||
response=""
|
||||
if [ -n "${answer}" ]; then
|
||||
answer=$(echo "${answer}" | sed 's/|/ /g')
|
||||
for ans in $answer; do
|
||||
if [ -z "${response}" ]; then
|
||||
response="${ans}"
|
||||
else
|
||||
response="${response}, ${ans}"
|
||||
fi
|
||||
done
|
||||
response="{ ${response} }"
|
||||
fi
|
||||
|
||||
eval "$1=\"$data\""
|
||||
eval "$2=\"$response\""
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
generate_inadyn_config() {
|
||||
json_load "${1}"
|
||||
json_get_var service_name service_name
|
||||
json_get_var use_ipv6 use_ipv6
|
||||
json_get_var interface interface
|
||||
json_get_var username username
|
||||
json_get_var password password
|
||||
json_get_var host lookup_host
|
||||
json_get_var conf_file config_file
|
||||
json_get_var conf_dir config_dir
|
||||
json_get_var server_address server_address
|
||||
json_cleanup
|
||||
|
||||
if [ -z "${service_name}" ] || [ -z "${host}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "${conf_file}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "${conf_dir}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# First look into custom path to load the url otherwise default path
|
||||
get_service_data "${service_name}" "${SERVER_PATH}" "${use_ipv6}" server_url server_answer
|
||||
|
||||
if [ -z "${server_url}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Need to pick proto, server address and request uri separately from the url
|
||||
# format http://[server_address]/[update_Request_uri]
|
||||
proto=$(echo $server_url | cut -d':' -f 1)
|
||||
serv=$(echo $server_url | cut -d'/' -f 3 | cut -d'@' -f 2)
|
||||
uri=${server_url#*$serv}
|
||||
|
||||
if [ -z $proto ] || [ -z $serv ] || [ -z $uri ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
path=$(echo "$uri" | sed 's/&/\\&/g')
|
||||
update_uri=$(echo $path | sed -e "s#\[DOMAIN\]#%h#g" -e "s#\[PASSWORD\]#%p#g" \
|
||||
-e "s#\[USERNAME\]#%u#g" -e "s#\[IP\]#%i#g")
|
||||
|
||||
if [ -z "${interface}" ]; then
|
||||
if [ "${use_ipv6}" -eq 0 ]; then
|
||||
interface="wan"
|
||||
else
|
||||
interface="wan6"
|
||||
fi
|
||||
fi
|
||||
|
||||
# now get the physical interface name
|
||||
intf=$(ifstatus "${interface}" | jsonfilter -e '@.device')
|
||||
if [ -z "${intf}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# command to get ip of the interface
|
||||
if [ "${use_ipv6}" -eq 0 ]; then
|
||||
get_ip="\"ifstatus ${interface} | jsonfilter -e '@[\\\\\"ipv4-address\\\\\"][0].address'\""
|
||||
else
|
||||
get_ip="\"ifstatus ${interface} | jsonfilter -e '@[\\\\\"ipv6-address\\\\\"][0].address'\""
|
||||
fi
|
||||
|
||||
if [ "${proto}" = "http" ]; then
|
||||
ssl="false"
|
||||
else
|
||||
ssl="true"
|
||||
fi
|
||||
|
||||
inadyn_ver=$(inadyn -v)
|
||||
user_agent="inadyn/${inadyn_ver}"
|
||||
|
||||
config_file="${conf_dir}/${conf_file}"
|
||||
touch "${config_file}"
|
||||
|
||||
echo "iface = ${intf}" > "${config_file}"
|
||||
echo "period = 600" >> "${config_file}"
|
||||
echo "user-agent = ${user_agent}" >> "${config_file}"
|
||||
|
||||
if [ "${use_ipv6}" -eq 1 ]; then
|
||||
echo "allow-ipv6 = true" >> "${config_file}"
|
||||
fi
|
||||
|
||||
if [ -z "${password}" ]; then
|
||||
FORMAT=$(echo "${FORMAT}" | sed 's/\\tpassword\\t= \[PWD\]\\n//g')
|
||||
fi
|
||||
|
||||
if [ -z "${server_answer}" ]; then
|
||||
FORMAT=$(echo "${FORMAT}" | sed 's/\\tddns-response\\t= \[RESPONSES\]\\n//g')
|
||||
fi
|
||||
|
||||
config=$(echo $FORMAT | sed -e "s#\[SECTION\]#$conf_file#g" -e "s#\[PWD\]#$password#g" \
|
||||
-e "s#\[USER\]#$username#g" -e "s#\[SERV\]#$serv#g" \
|
||||
-e "s#\[URI\]#\"$update_uri\"#g" -e "s#\[SSL\]#$ssl#g" \
|
||||
-e "s#\[NAME\]#$host#g" -e "s#\[CMD\]#$get_ip#g" \
|
||||
-e "s#\[RESPONSES\]#$server_answer#g")
|
||||
|
||||
echo -e "\n\n${config}" >> "${config_file}"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_host_section() {
|
||||
uci_validate_section ddnsmngr host "${1}" \
|
||||
'enabled:bool:0' \
|
||||
'lookup_host:string' \
|
||||
'dm_parent:string'
|
||||
}
|
||||
|
||||
validate_client_section() {
|
||||
uci_validate_section ddnsmngr client "${1}" \
|
||||
'enabled:bool:0' \
|
||||
'service_name:string' \
|
||||
'interface:string' \
|
||||
'ip_network:string' \
|
||||
'username:string' \
|
||||
'password:string' \
|
||||
'use_https:bool:0' \
|
||||
'force_dnstcp:bool:0' \
|
||||
'use_ipv6:bool:0' \
|
||||
'force_ipversion:bool:0'
|
||||
}
|
||||
|
||||
add_object() {
|
||||
local enabled lookup_host dm_parent use_ipv6 force_ipversion
|
||||
local service_name interface ip_network username password use_https force_dnstcp
|
||||
|
||||
validate_host_section "${1}" || {
|
||||
log "Validation of host section failed"
|
||||
return
|
||||
}
|
||||
|
||||
if [ "${enabled}" -ne 1 ] || [ -z "${dm_parent}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
validate_client_section "${dm_parent}" || {
|
||||
log "Validation of client section failed"
|
||||
return
|
||||
}
|
||||
|
||||
if [ "${enabled}" -ne 1 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
service_name=$(uci -q get ddnsmngr.${dm_parent}.service_name)
|
||||
if [ -z "${service_name}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
service_section=$(uci show ddnsmngr | grep "service=\'${service_name}\'" | cut -d'.' -f 2 | head -1)
|
||||
if [ -z "${service_section}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
service_enabled=$(uci -q get ddnsmngr.${service_section}.enabled)
|
||||
if [ "${service_enabled}" -ne 1 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
json_init
|
||||
json_add_string "interface" "${interface}"
|
||||
json_add_string "service_name" "${service_name}"
|
||||
json_add_string "username" "${username}"
|
||||
json_add_string "password" "${password}"
|
||||
json_add_string "lookup_host" "${lookup_host}"
|
||||
json_add_string "ip_network" "${ip_network}"
|
||||
json_add_string "use_ipv6" "${use_ipv6}"
|
||||
json_add_string "force_ipversion" "${force_ipversion}"
|
||||
json_add_string "use_https" "${use_https}"
|
||||
json_add_string "force_dnstcp" "${force_dnstcp}"
|
||||
json_add_string "config_file" "${1}"
|
||||
json_add_string "config_dir" "${CONFIGPATH}"
|
||||
|
||||
json_str=$(json_dump)
|
||||
json_cleanup
|
||||
|
||||
generate_inadyn_config "${json_str}"
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
CONFIG_FILES="${CONFIG_FILES} ${1}"
|
||||
|
||||
if [ -z "${interface}" ]; then
|
||||
if [ "${use_ipv6}" -eq 0 ]; then
|
||||
interface="wan"
|
||||
else
|
||||
interface="wan6"
|
||||
fi
|
||||
fi
|
||||
|
||||
for intf in $CLIENT_INTFS; do
|
||||
if [ "${intf}" == "${interface}" ]; then
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
CLIENT_INTFS="${CLIENT_INTFS} ${interface}"
|
||||
}
|
||||
|
||||
start_ddnsmngr_service() {
|
||||
rm -rf $CONFIGPATH
|
||||
mkdir $CONFIGPATH
|
||||
mkdir -p $PIDPATH
|
||||
|
||||
config_load ddnsmngr
|
||||
config_foreach add_object host
|
||||
|
||||
i=1
|
||||
for conf in $CONFIG_FILES; do
|
||||
instance="ddnsmngr_${i}"
|
||||
i=$(( i + 1 ))
|
||||
|
||||
procd_open_instance $instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -f "${CONFIGPATH}/${conf}"
|
||||
procd_append_param command -l debug
|
||||
procd_append_param command -P "${PIDPATH}/${conf}"
|
||||
procd_append_param command -n -C
|
||||
procd_close_instance
|
||||
done
|
||||
}
|
||||
|
||||
stop_ddnsmngr_service() {
|
||||
rm -rf $CONFIGPATH
|
||||
return 0
|
||||
}
|
||||
|
||||
add_ddnsmngr_triggers() {
|
||||
procd_open_trigger
|
||||
for intf in $CLIENT_INTFS; do
|
||||
# No need to handle other ifevents like ifupdate etc
|
||||
procd_add_interface_trigger "interface.*.up" $intf /etc/init.d/ddnsmngr restart
|
||||
done
|
||||
procd_close_trigger
|
||||
}
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=4.2.1.3
|
||||
PKG_VERSION:=4.2.1.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=0fe317cbe2b2e37c25a6d6d4e6f5c1d6964f9e50
|
||||
PKG_SOURCE_VERSION:=ae836adb0779979686d0dad34b941f319ffed1b8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -29,7 +29,7 @@ define Package/decollector
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi DataElements Collector Proxy
|
||||
DEPENDS:=+libuci +libubox +ubus +libpthread +libnl-genl \
|
||||
+libeasy +libwifiutils +libieee1905 +ieee1905-map-plugin
|
||||
+libeasy +libwifiutils +libieee1905 +map-plugin
|
||||
endef
|
||||
|
||||
define Package/decollector/description
|
||||
|
||||
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.6.5
|
||||
PKG_VERSION:=3.6.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=192e74db2082e3f89f6defe9d752d752b0b09079
|
||||
PKG_SOURCE_VERSION:=d9cc11c81ce1ff625e4e789afa180b301c7fcf74
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ define Package/ethmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Ethernet status and configration utility
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/ethmngr/description
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_VERSION:=1.1.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b4990b384461f2d1ff75a122a7fa5d9276f211bb
|
||||
PKG_SOURCE_VERSION:=edb5bbe57c5bc83035e217c73071c9b3e878dc22
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -31,8 +31,7 @@ define Package/hostmngr
|
||||
DEPENDS= +libubox +libuci +libubus +ubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +libnfnetlink +libmnl \
|
||||
+libnetfilter-conntrack \
|
||||
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api \
|
||||
+libwifiutils
|
||||
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api
|
||||
|
||||
endef
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
schedule_added=""
|
||||
|
||||
ACCESS_RULE=""
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
@@ -111,77 +108,70 @@ ip_rule_east_zone() {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
add_access_rule() {
|
||||
local rule="$1"
|
||||
echo "iptables -w -A hosts_forward ${rule}" >> $ACL_FILE
|
||||
echo "ip6tables -w -A hosts_forward ${rule}" >> $ACL_FILE
|
||||
}
|
||||
|
||||
handle_day_list() {
|
||||
local value=$1
|
||||
|
||||
val=$(echo $value | cut -c 1-3)
|
||||
next_day_val=$(get_next_day $val)
|
||||
prev_day_val=$(get_previous_day $val)
|
||||
if [ -z $day ]; then
|
||||
day="$val"
|
||||
next_days="$next_day_val"
|
||||
prev_days="$prev_day_val"
|
||||
else
|
||||
day="$day,$val"
|
||||
next_days="$next_days,$next_day_val"
|
||||
prev_days="$prev_days,$prev_day_val"
|
||||
fi
|
||||
}
|
||||
|
||||
handle_schedule() {
|
||||
local schd_section="$1"
|
||||
local ac_section="$2"
|
||||
local acs_id
|
||||
local start_time
|
||||
local duration
|
||||
|
||||
IP_RULE="$ACCESS_RULE"
|
||||
IP_RULE1=""
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
|
||||
config_get acs_id "$schd_section" "dm_parent"
|
||||
|
||||
if [ "$acs_id" != "$ac_section" ]; then
|
||||
return # schedule not for this access control section
|
||||
fi
|
||||
|
||||
process_ac_schedule() {
|
||||
local acs_id="$1"
|
||||
local is_enabled
|
||||
config_get is_enabled "$schd_section" "enable" 0
|
||||
local access_control
|
||||
local start_time=""
|
||||
local mac=""
|
||||
|
||||
|
||||
handle_day_list() {
|
||||
local value=$1
|
||||
|
||||
val=$(echo $value | cut -c 1-3)
|
||||
next_day_val=$(get_next_day $val)
|
||||
prev_day_val=$(get_previous_day $val)
|
||||
if [ -z $day ]; then
|
||||
day="$val"
|
||||
next_days="$next_day_val"
|
||||
prev_days="$prev_day_val"
|
||||
else
|
||||
day="$day,$val"
|
||||
next_days="$next_days,$next_day_val"
|
||||
prev_days="$prev_days,$prev_day_val"
|
||||
fi
|
||||
}
|
||||
|
||||
config_list_foreach "$acs_id" "day" handle_day_list
|
||||
config_get is_enabled "$acs_id" "enable" 1
|
||||
config_get access_control "$acs_id" "dm_parent"
|
||||
|
||||
if [ "$is_enabled" == "0" ] || [ -z "$access_control" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
config_get is_enabled "$access_control" "enable" 1
|
||||
if [ "$is_enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local all_days="Monday Tuesday Wednesday Thursday Friday Saturday Sunday"
|
||||
local day_config
|
||||
config_get day_config "$schd_section" "day" "$all_days"
|
||||
mac=$(uci -q get hosts.$access_control.macaddr)
|
||||
access_policy=$(uci -q get hosts.$access_control.access_policy)
|
||||
|
||||
IFS=" "
|
||||
for d in $day_config; do
|
||||
handle_day_list $d
|
||||
done
|
||||
config_get start_time "$acs_id" "start_time"
|
||||
config_get duration "$acs_id" "duration"
|
||||
|
||||
config_get start_time "$schd_section" "start_time" "00:00"
|
||||
config_get duration "$schd_section" "duration"
|
||||
if [ -z "$mac" ] && [ -z "$start_time" ] && [ -z "$duration" ] && [ -z "$day" ] && [ -z "$access_policy" ]; then
|
||||
return
|
||||
fi
|
||||
if [ -n "$mac" ]; then
|
||||
IP_RULE="$IP_RULE -m mac --mac-source $mac"
|
||||
fi
|
||||
|
||||
zone=$(date +%z | cut -c 1)
|
||||
local_start_time=$start_time
|
||||
hh=$(echo $local_start_time | awk -F: '{ print $1 }')
|
||||
mm=$(echo $local_start_time | awk -F: '{ print $2 }')
|
||||
hh_s=`expr $hh \* 3600`
|
||||
mm_s=`expr $mm \* 60`
|
||||
ss=$(( hh_s + mm_s ))
|
||||
local_start_hh=$hh
|
||||
|
||||
if [ -n "$duration" ]; then
|
||||
hh=$(echo $local_start_time | awk -F: '{ print $1 }')
|
||||
mm=$(echo $local_start_time | awk -F: '{ print $2 }')
|
||||
hh_s=`expr $hh \* 3600`
|
||||
mm_s=`expr $mm \* 60`
|
||||
ss=$(( hh_s + mm_s ))
|
||||
local_start_hh=$hh
|
||||
|
||||
stop_ss=$(( ss + duration ))
|
||||
hh=$(( stop_ss / 3600 ))
|
||||
rem_ss=$(( stop_ss % 3600 ))
|
||||
@@ -189,10 +179,6 @@ handle_schedule() {
|
||||
ss=$(( rem_ss % 60 ))
|
||||
local_stop_time="$hh:$mm:$ss"
|
||||
local_stop_hh=$hh
|
||||
else
|
||||
# if duartion is not specified, then apply rule to end of the day
|
||||
local_stop_time="23:59:59"
|
||||
local_stop_hh="23"
|
||||
fi
|
||||
|
||||
utc_start_time=$(date -u -d @$(date "+%s" -d "$local_start_time") +%H:%M)
|
||||
@@ -205,91 +191,43 @@ handle_schedule() {
|
||||
ip_rule_east_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
|
||||
fi
|
||||
|
||||
IP_RULE="$IP_RULE -j ACCEPT"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j ACCEPT"
|
||||
fi
|
||||
|
||||
add_access_rule "$IP_RULE"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
add_access_rule "$IP_RULE1"
|
||||
fi
|
||||
|
||||
# for access rules to be effective for a schedule, need to add DROP rule
|
||||
# to block the access outside the defined schedule
|
||||
if [ "$schedule_added" == "0" ]; then
|
||||
schedule_added="1"
|
||||
fi
|
||||
}
|
||||
|
||||
handle_access_control() {
|
||||
local ac_section="$1"
|
||||
local is_enabled
|
||||
|
||||
# default value of Hosts.AccessControl.{i}.Enable is false,
|
||||
# so, if not defined in uci as 1, assume 0
|
||||
config_get is_enabled "$ac_section" "enable" 0
|
||||
if [ "$is_enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local mac_addr
|
||||
config_get mac_addr "$ac_section" "macaddr"
|
||||
if [ -z "$mac_addr" ]; then
|
||||
return
|
||||
else
|
||||
ACCESS_RULE="-m mac --mac-source $mac_addr"
|
||||
fi
|
||||
|
||||
local access_policy
|
||||
config_get access_policy "$ac_section" "access_policy"
|
||||
if [ -z "$access_policy" ]; then
|
||||
return # since system default is allow so no need to do anything
|
||||
fi
|
||||
|
||||
# As per Data Model, if access policy is deny, then schedule is to be ignored
|
||||
# and no access is to be provided for the device
|
||||
if [ "$access_policy" == "Deny" ]; then
|
||||
ACCESS_RULE="$ACCESS_RULE -j DROP"
|
||||
add_access_rule "$ACCESS_RULE"
|
||||
return # no need to parse schedule
|
||||
IP_RULE="$IP_RULE -j DROP"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j DROP"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -j ACCEPT"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j ACCEPT"
|
||||
fi
|
||||
fi
|
||||
|
||||
schedule_added="0"
|
||||
# check if schedule is defined for this access_control instance
|
||||
# and if yes, create rule accordingly
|
||||
config_foreach handle_schedule ac_schedule "$ac_section"
|
||||
|
||||
# for access rule to work, need to have default drop rule as last rule
|
||||
if [ "$schedule_added" == "1" ]; then
|
||||
IP_RULE="$ACCESS_RULE -j DROP"
|
||||
add_access_rule "$IP_RULE"
|
||||
iptables -w -A hosts_forward ${IP_RULE}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE}
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
iptables -w -A hosts_forward ${IP_RULE1}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE1}
|
||||
fi
|
||||
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
}
|
||||
|
||||
ACL_FILE="/tmp/hosts_access_control/access_control.rules"
|
||||
|
||||
rm -f $ACL_FILE
|
||||
|
||||
mkdir -p /tmp/hosts_access_control/
|
||||
touch $ACL_FILE
|
||||
|
||||
echo "iptables -w -F hosts_forward" >> $ACL_FILE
|
||||
echo "ip6tables -w -F hosts_forward" >> $ACL_FILE
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
|
||||
hosts_forward=$(iptables -t filter --list | grep hosts_forward)
|
||||
if [ -z "$hosts_forward" ]; then
|
||||
echo "iptables -w -t filter -N hosts_forward" >> $ACL_FILE
|
||||
iptables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE
|
||||
echo "ip6tables -w -t filter -N hosts_forward" >> $ACL_FILE
|
||||
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
|
||||
ip6tables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "ip6tables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE
|
||||
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
|
||||
fi
|
||||
|
||||
# Load /etc/config/hosts UCI file
|
||||
config_load hosts
|
||||
config_foreach handle_access_control access_control
|
||||
|
||||
# apply the rules
|
||||
sh $ACL_FILE
|
||||
config_foreach process_ac_schedule ac_schedule
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.6.8
|
||||
PKG_VERSION:=9.6.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=7ff419cefc314156a0ac518972096ef0dfb87162
|
||||
PKG_SOURCE_VERSION:=601708dd0a2ca4fad5213e78cc456e0f355f45bc
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,7 +5,6 @@ config acs 'acs'
|
||||
option periodic_inform_interval '1800'
|
||||
option periodic_inform_time '0001-01-01T00:00:00Z'
|
||||
option dhcp_discovery 'enable'
|
||||
option ssl_capath "/etc/ssl/certs"
|
||||
# compression possible configs: GZIP, Deflate, Disabled
|
||||
option compression 'Disabled'
|
||||
# possible configs interval :[1:65535]
|
||||
@@ -22,7 +21,7 @@ config cpe 'cpe'
|
||||
option log_to_file 'disable'
|
||||
# log_severity: INFO (Default)
|
||||
# log_severity possible configs: EMERG, ALERT, CRITIC ,ERROR, WARNING, NOTICE, INFO, DEBUG
|
||||
option log_severity 'ERROR'
|
||||
option log_severity 'DEBUG'
|
||||
option log_file_name '/var/log/icwmpd.log'
|
||||
option log_max_size '102400'
|
||||
option userid '' #$OUI-$SER
|
||||
|
||||
@@ -15,24 +15,32 @@ log() {
|
||||
echo "${@}"|logger -t cwmp.init -p info
|
||||
}
|
||||
|
||||
regenerate_ssl_link() {
|
||||
local cert_dir="${1%/}"
|
||||
[ ! -d "${cert_dir}" ] || [ "${cert_dir}" = "/etc/ssl/certs" ] && return 0
|
||||
regenerate_ssl_link()
|
||||
{
|
||||
local cert_dir all_file rehash
|
||||
|
||||
generate_links() {
|
||||
local file_type="$1"
|
||||
local files="${cert_dir}"/*."${file_type}"
|
||||
for cfile in ${files}; do
|
||||
if [ -f "${cfile}" ]; then
|
||||
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
|
||||
[ -f "${cert_dir}/${rehash}.0" ] || \
|
||||
ln -s "${cfile}" "${cert_dir}/${rehash}.0"
|
||||
fi
|
||||
cert_dir="${1}"
|
||||
[ ! -d "${cert_dir}" ] && return 0;
|
||||
|
||||
### Generate all ssl link for pem certicates ###
|
||||
all_file=$(ls "${cert_dir}"/*.pem 2>/dev/null)
|
||||
if [ -n "${all_file}" ]; then
|
||||
for cfile in $all_file; do
|
||||
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
|
||||
[ -f "${cert_dir}"/"${rehash}".0 ] || \
|
||||
ln -s "${cfile}" "${cert_dir}"/"${rehash}".0
|
||||
done
|
||||
}
|
||||
fi
|
||||
|
||||
generate_links "pem"
|
||||
generate_links "crt"
|
||||
### Generate all ssl link for crt certicates ###
|
||||
all_file=$(ls "${cert_dir}"/*.crt 2>/dev/null)
|
||||
if [ -n "${all_file}" ]; then
|
||||
for cfile in $all_file; do
|
||||
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
|
||||
[ -f "${cert_dir}"/"${rehash}".0 ] || \
|
||||
ln -s "${cfile}" "${cert_dir}"/"${rehash}".0
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
enable_dhcp_option43() {
|
||||
@@ -450,10 +458,11 @@ validate_defaults() {
|
||||
|
||||
ssl_capath="${ssl_capath%/}"
|
||||
# Put the cert pem file in keep list
|
||||
if [ -d "${ssl_capath}" ] && [ "${ssl_capath}" != "/etc/ssl/certs" ]; then
|
||||
if [ -d "${ssl_capath}" ]; then
|
||||
if ! grep "*.pem\|*.crt" /lib/upgrade/keep.d/icwmp; then
|
||||
echo "${ssl_capath}"'/*.pem' >> /lib/upgrade/keep.d/icwmp
|
||||
echo "${ssl_capath}"'/*.crt' >> /lib/upgrade/keep.d/icwmp
|
||||
echo "${ssl_capath}"'/*.0' >> /lib/upgrade/keep.d/icwmp
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Copyright (C) 2020-2024 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.3.7.1
|
||||
PKG_VERSION:=8.3.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=490979bd8ec0395795801f3bfb9dc47af1eb4ade
|
||||
PKG_SOURCE_VERSION:=526690993c93720ee1707bba6b7a08e8c28f2dd9
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -60,12 +60,12 @@ define Package/libieee1905/description
|
||||
endef
|
||||
|
||||
plugins := \
|
||||
$(if $(CONFIG_PACKAGE_ieee1905-map-plugin),map) \
|
||||
$(if $(CONFIG_PACKAGE_ieee1905-snoop-plugin),snoop) \
|
||||
$(if $(CONFIG_PACKAGE_ieee1905-topology-plugin),topology)
|
||||
$(if $(CONFIG_PACKAGE_map-plugin),map) \
|
||||
$(if $(CONFIG_PACKAGE_snoop-plugin),snoop) \
|
||||
$(if $(CONFIG_PACKAGE_topology-plugin),topology)
|
||||
|
||||
|
||||
ppkg:=$(patsubst plugins/%.mk,ieee1905-%-plugin,$(wildcard plugins/*.mk))
|
||||
ppkg:=$(patsubst plugins/%.mk,%-plugin,$(wildcard plugins/*.mk))
|
||||
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
define Package/ieee1905-map-plugin
|
||||
define Package/map-plugin
|
||||
$(call Package/ieee1905/Default)
|
||||
TITLE:=Multi-AP plugin supporting WiFi-Alliance Easymesh standard
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
||||
endef
|
||||
|
||||
define Package/ieee1905-map-plugin/config
|
||||
if (PACKAGE_ieee1905-map-plugin)
|
||||
define Package/map-plugin/config
|
||||
if (PACKAGE_map-plugin)
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
@@ -32,7 +32,7 @@ ifeq ($(CONFIG_MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG),y)
|
||||
TARGET_CFLAGS += -DDYNAMIC_CNTLR_SYNC_CONFIG
|
||||
endif
|
||||
|
||||
define Build/InstallDev/ieee1905-map-plugin
|
||||
define Build/InstallDev/map-plugin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
@@ -43,7 +43,7 @@ define Build/InstallDev/ieee1905-map-plugin
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
||||
endef
|
||||
|
||||
define Package/ieee1905-map-plugin/install
|
||||
define Package/map-plugin/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
define Package/ieee1905-snoop-plugin
|
||||
define Package/snoop-plugin
|
||||
$(call Package/ieee1905/Default)
|
||||
TITLE:=Show all received 1905 CMDUs over UBUS
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
||||
endef
|
||||
|
||||
define Package/ieee1905-snoop-plugin/install
|
||||
define Package/snoop-plugin/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/snoop/snoop.so $(1)/usr/lib/ieee1905/snoop.so
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
define Package/ieee1905-topology-plugin
|
||||
define Package/topology-plugin
|
||||
$(call Package/ieee1905/Default)
|
||||
TITLE:=Build full network topology of the 1905 nodes only
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
||||
endef
|
||||
|
||||
define Package/ieee1905-topology-plugin/install
|
||||
define Package/topology-plugin/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/topology/topology.so $(1)/usr/lib/ieee1905/topology.so
|
||||
|
||||
@@ -71,7 +71,7 @@ CONFIG_PACKAGE_wifimngr=y
|
||||
# Multi-AP #
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_IEEE1905_CMDU_SA_IS_ALMAC=y
|
||||
CONFIG_PACKAGE_ieee1905-topology-plugin=y
|
||||
CONFIG_PACKAGE_topology-plugin=y
|
||||
CONFIG_PACKAGE_decollector=y
|
||||
CONFIG_PACKAGE_map-agent=y
|
||||
CONFIG_PACKAGE_map-controller=y
|
||||
@@ -142,6 +142,7 @@ CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
|
||||
# Services #
|
||||
CONFIG_PACKAGE_atftp=y
|
||||
CONFIG_PACKAGE_atftpd=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_dnsmasq=y
|
||||
|
||||
@@ -33,8 +33,7 @@ _iop()
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
iopcmds="bootstrap cfe_upgrade cfe_upgrade_latest extract_core \
|
||||
feeds_update feeds_update-legacy genconfig genconfig-legacy \
|
||||
generate_tarballs install_key \
|
||||
feeds_update genconfig generate_tarballs install_key \
|
||||
scp_changes setup_host ssh_install_key status \
|
||||
update_package update_feed_branches ssh_upgrade smoketest"
|
||||
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function feeds_update-legacy {
|
||||
heads=1
|
||||
developer=0
|
||||
override=1
|
||||
force=1
|
||||
|
||||
function update_failure {
|
||||
if [ $force == 1 ]; then
|
||||
echo "WARNING: Failed to update feed(s). Forced update, proceeding anyway." >&2
|
||||
else
|
||||
echo "ERROR: Failed to update feed(s). Omit -F to proceed anyway." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
while getopts "inFh" opt; do
|
||||
case $opt in
|
||||
i)
|
||||
heads=0
|
||||
;;
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
F)
|
||||
force=0
|
||||
;;
|
||||
h|\?)
|
||||
echo "Usage: ./iop feeds_update-legacy [-i] [-n] [-F] [-h]"
|
||||
echo
|
||||
echo "OPTIONS:"
|
||||
echo " -i - Only update index. Do not change HEAD in feeds."
|
||||
echo " -n - Do not replace core packages with iopsys versions."
|
||||
echo " -F - Do not force update if there are inaccessible feeds."
|
||||
echo " -h - Display this help message and exit."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
if [ $heads == 1 ]; then
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g || update_failure
|
||||
else
|
||||
./scripts/feeds update || update_failure
|
||||
fi
|
||||
fi
|
||||
./scripts/feeds update -ai || exit 1
|
||||
|
||||
# replace core packages with iopsys versions
|
||||
if [ $override == 1 ]; then
|
||||
./scripts/feeds install -f -p openwrt_core -a || exit 1
|
||||
./scripts/feeds install -f -p qualcomm -a || exit 1
|
||||
fi
|
||||
|
||||
(
|
||||
echo '# DO NOT EDIT. Autogenerated file by ./iop feeds_update'
|
||||
echo 'FEED_DEVICES_DIRS:='
|
||||
find feeds -type f -name .is-feed-devices-dir -printf 'FEED_DEVICES_DIRS+=$(TOPDIR)/%h\n'
|
||||
) > target/linux/feed-devices/feed-devices-list.mk || exit 1
|
||||
|
||||
# targets need to be installed explicitly
|
||||
for target in $(ls ./feeds/targets); do
|
||||
./scripts/feeds install -f -p targets $target || exit 1
|
||||
done
|
||||
|
||||
# install all packages
|
||||
./scripts/feeds install -a || exit 1
|
||||
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete || exit 1
|
||||
|
||||
cp .genconfig_config_bak .config
|
||||
make defconfig || exit 1
|
||||
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap || exit 1
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
}
|
||||
|
||||
register_command "feeds_update-legacy" "Update feeds to point to commit hashes from feeds.conf - legacy mode"
|
||||
@@ -1,9 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
function feeds_update {
|
||||
heads=1
|
||||
developer=0
|
||||
override=1
|
||||
force=1
|
||||
|
||||
function update_failure {
|
||||
if [ $force == 1 ]; then
|
||||
echo "WARNING: Failed to update feed(s). Forced update, proceeding anyway." >&2
|
||||
else
|
||||
echo "ERROR: Failed to update feed(s). Omit -F to proceed anyway." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
while getopts "inFh" opt; do
|
||||
case $opt in
|
||||
i)
|
||||
heads=0
|
||||
;;
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
F)
|
||||
force=0
|
||||
;;
|
||||
h|\?)
|
||||
echo "Usage: ./iop feeds_update [-i] [-n] [-F] [-h]"
|
||||
echo
|
||||
echo "OPTIONS:"
|
||||
echo " -i - Only update index. Do not change HEAD in feeds."
|
||||
echo " -n - Do not replace core packages with iopsys versions."
|
||||
echo " -F - Do not force update if there are inaccessible feeds."
|
||||
echo " -h - Display this help message and exit."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
if [ $heads == 1 ]; then
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g || update_failure
|
||||
else
|
||||
./scripts/feeds update || update_failure
|
||||
fi
|
||||
fi
|
||||
./scripts/feeds update -ai || exit 1
|
||||
|
||||
# replace core packages with iopsys versions
|
||||
if [ $override == 1 ]; then
|
||||
./scripts/feeds install -f -p openwrt_core -a || exit 1
|
||||
./scripts/feeds install -f -p qualcomm -a || exit 1
|
||||
fi
|
||||
|
||||
(
|
||||
echo '# DO NOT EDIT. Autogenerated file by ./iop feeds_update'
|
||||
echo 'FEED_DEVICES_DIRS:='
|
||||
find feeds -type f -name .is-feed-devices-dir -printf 'FEED_DEVICES_DIRS+=$(TOPDIR)/%h\n'
|
||||
) > target/linux/feed-devices/feed-devices-list.mk || exit 1
|
||||
|
||||
# targets need to be installed explicitly
|
||||
for target in $(ls ./feeds/targets); do
|
||||
./scripts/feeds install -f -p targets $target || exit 1
|
||||
done
|
||||
|
||||
# install all packages
|
||||
./scripts/feeds install -a || exit 1
|
||||
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete || exit 1
|
||||
|
||||
cp .genconfig_config_bak .config
|
||||
make defconfig || exit 1
|
||||
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap || exit 1
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
}
|
||||
|
||||
register_command "feeds_update" "Compatibility function only"
|
||||
register_command "feeds_update" "Update feeds to point to commit hashes from feeds.conf"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig-legacy {
|
||||
function genconfig {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export IMPORT=1
|
||||
@@ -196,7 +196,7 @@ function genconfig-legacy {
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 genconfig-legacy [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
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 " -D|--no-dirty\t\tIgnore dirty tree"
|
||||
@@ -210,7 +210,7 @@ function genconfig-legacy {
|
||||
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-legacy eg400 OPERATORX"
|
||||
echo "Example ./iop genconfig eg400 OPERATORX"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
@@ -496,7 +496,7 @@ function genconfig-legacy {
|
||||
if [ $# -eq 0 ]; then
|
||||
echo Current profile:
|
||||
cat $CURRENT_CONFIG_FILE
|
||||
echo "Try ./iop genconfig-legacy -h' to get instructions if you want to change current config"
|
||||
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
else
|
||||
while [ -n "$1" ]; do
|
||||
@@ -532,4 +532,4 @@ function genconfig-legacy {
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig-legacy" "Generate configuration for board and customer - legacy mode"
|
||||
register_command "genconfig" "Generate configuration for board and customer"
|
||||
10
iop/scripts/genconfig_min-legacy.sh → iop/scripts/genconfig_min.sh
Executable file → Normal file
10
iop/scripts/genconfig_min-legacy.sh → iop/scripts/genconfig_min.sh
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig_min-legacy {
|
||||
function genconfig_min {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export SRCTREEOVERR=0
|
||||
@@ -195,7 +195,7 @@ function genconfig_min-legacy {
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 genconfig_min-legacy [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
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 " -D|--no-dirty\t\tIgnore dirty tree"
|
||||
@@ -209,7 +209,7 @@ function genconfig_min-legacy {
|
||||
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_min-legacy eg400 OPERATORX"
|
||||
echo "Example ./iop genconfig eg400 OPERATORX"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
@@ -464,7 +464,7 @@ function genconfig_min-legacy {
|
||||
if [ $# -eq 0 ]; then
|
||||
echo Current profile:
|
||||
cat $CURRENT_CONFIG_FILE
|
||||
echo "Try ./iop genconfig_min-legacy -h' to get instructions if you want to change current config"
|
||||
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
else
|
||||
while [ -n "$1" ]; do
|
||||
@@ -500,4 +500,4 @@ function genconfig_min-legacy {
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig_min-legacy" "Generate configuration for customer with manual board configuration - legacy mode"
|
||||
register_command "genconfig_min" "Generate configuration for customer with manual board configuration"
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Function to convert parameters to lowercase
|
||||
function to_lowercase {
|
||||
local params=()
|
||||
for param in "$@"; do
|
||||
params+=("$(tr '[:upper:]' '[:lower:]' <<< "$param")")
|
||||
done
|
||||
echo "${params[@]}"
|
||||
}
|
||||
|
||||
function genconfig {
|
||||
target_script="./scripts/gen_config.py"
|
||||
|
||||
# First convert all to lowercase
|
||||
args=$(to_lowercase "$@")
|
||||
|
||||
# Check if an option is provided
|
||||
if [[ ${args[0]} == -* ]]; then
|
||||
# Convert options for target script
|
||||
if [[ ${args[0]} == "-b" || ${args[0]} == "--boards" ]]; then
|
||||
args=("--list")
|
||||
fi
|
||||
fi
|
||||
|
||||
${target_script} ${args[@]}
|
||||
}
|
||||
|
||||
register_command "genconfig" "Generate configuration for board and customer"
|
||||
@@ -1,10 +1,646 @@
|
||||
# Exported interface
|
||||
update_package() {
|
||||
echo "update_package is no longer supported." >&2
|
||||
echo "Its replacement will come soon." >&2
|
||||
echo >&2
|
||||
echo "For now update references in profiles/include/*.yml and feeds.conf.io manually." >&2
|
||||
return 1
|
||||
#!/bin/bash
|
||||
|
||||
print_git_update()
|
||||
{
|
||||
echo "pkg -> ${PKG_NAME}"
|
||||
echo " PKG_BUILD_DIR = ${PKG_BUILD_DIR}"
|
||||
echo " PKG_DIR = ${PKG_DIR}"
|
||||
echo " PKG_SOURCE = ${PKG_SOURCE}"
|
||||
echo " PKG_NAME = ${PKG_NAME}"
|
||||
echo " PKG_SOURCE_URL = ${PKG_SOURCE_URL}"
|
||||
echo " PKG_SOURCE_PROTO= ${PKG_SOURCE_PROTO}"
|
||||
echo " PKG_SOURCE_VERSION= ${PKG_SOURCE_VERSION}"
|
||||
echo " PKG_SOURCE = ${PKG_SOURCE}"
|
||||
echo " PKG_SOURCE_VERSION_FILE=${PKG_SOURCE_VERSION_FILE}"
|
||||
}
|
||||
|
||||
register_command "update_package" "No longer used command"
|
||||
is_git_same()
|
||||
{
|
||||
git_last=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
|
||||
#echo "$PKG_NAME $git_last = ${PKG_SOURCE_VERSION}"
|
||||
if [ "$git_last" == "${PKG_SOURCE_VERSION}" ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
update_this_pkg()
|
||||
{
|
||||
mk_hash=$(get_makefile_hash)
|
||||
|
||||
if [ "$mk_hash" != "${PKG_SOURCE_VERSION}" ]
|
||||
then
|
||||
echo "${PKG_NAME}:"
|
||||
echo " build dir = ${PKG_BUILD_DIR}"
|
||||
echo " feed makefile = ${mk_hash}"
|
||||
echo " stale hash = ${PKG_SOURCE_VERSION}"
|
||||
echo " build git = $(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)"
|
||||
echo " Git hash in package makefile and the git hash recorded from last compile of"
|
||||
echo " package is different. You probably want to recompile the package"
|
||||
echo " to get an up to date version in ${PKG_BUILD_DIR}/.git_update"
|
||||
echo ""
|
||||
|
||||
echo -n " Should we continue with the update anyway? [y/N]:"
|
||||
read answer
|
||||
echo ""
|
||||
|
||||
case $answer in
|
||||
y|Y)
|
||||
;;
|
||||
n|N|*)
|
||||
return 1;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "${PKG_NAME}:"
|
||||
echo " build dir = ${PKG_BUILD_DIR}"
|
||||
echo " pkg dir = ${PKG_DIR}"
|
||||
echo " feed makefile = ${PKG_SOURCE_VERSION}"
|
||||
echo " build git = $(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)"
|
||||
echo " package is at a different git commit in build compared to feed"
|
||||
echo -n " Should we update the feed and top project to reflect the new version ? [y/N]:"
|
||||
read answer
|
||||
echo ""
|
||||
|
||||
case $answer in
|
||||
y|Y)
|
||||
return 0;;
|
||||
*)
|
||||
echo ""
|
||||
return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_makefile_hash()
|
||||
{
|
||||
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
|
||||
then
|
||||
name="$PKG_SOURCE_VERSION_FILE"
|
||||
else
|
||||
name=Makefile
|
||||
fi
|
||||
grep "PKG_SOURCE_VERSION:=" ${PKG_DIR}/${name} | sed -e "s/\(^PKG_SOURCE_VERSION:=\)\(.*\)/\2/"
|
||||
}
|
||||
|
||||
insert_hash_in_feed_makefile()
|
||||
{
|
||||
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
|
||||
then
|
||||
name="$PKG_SOURCE_VERSION_FILE"
|
||||
else
|
||||
name=Makefile
|
||||
fi
|
||||
|
||||
git_last=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
|
||||
|
||||
sed -i -e "s/\(^PKG_SOURCE_VERSION:=\).*/\1${git_last}/" ${PKG_DIR}/${name}
|
||||
(cd ${PKG_DIR}; git add ${name})
|
||||
}
|
||||
|
||||
insert_version_in_feed_makefile()
|
||||
{
|
||||
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
|
||||
then
|
||||
name="$PKG_SOURCE_VERSION_FILE"
|
||||
else
|
||||
name=Makefile
|
||||
fi
|
||||
|
||||
last_version=$(awk -F '=' '/PKG_VERSION:=/ {print $2}' ${PKG_DIR}/${name})
|
||||
|
||||
echo -n "please enter version: "
|
||||
read -ei "$last_version" answer
|
||||
|
||||
if [ -z ${answer} ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i -e "s/\(^PKG_VERSION:=\).*/\1${answer}/" ${PKG_DIR}/${name}
|
||||
(cd ${PKG_DIR}; git add ${name})
|
||||
}
|
||||
|
||||
|
||||
# BUG: fix if only local branche name!
|
||||
branch_uptodate()
|
||||
{
|
||||
# $1 git repo
|
||||
# $2 if it exist dont abort do the pull
|
||||
(cd $1
|
||||
git remote update 2>&1 >/dev/null
|
||||
|
||||
LOCAL=$(git rev-parse @)
|
||||
REMOTE=$(git rev-parse @{u})
|
||||
BASE=$(git merge-base @ @{u})
|
||||
|
||||
if [ -z "$REMOTE" ]; then
|
||||
BRANCH=$(basename $(git symbolic-ref -q HEAD))
|
||||
echo "You need to setup a tracking branch for $BRANCH"
|
||||
exit 99
|
||||
fi
|
||||
|
||||
if [ $LOCAL = $REMOTE ]; then
|
||||
return
|
||||
elif [ $LOCAL = $BASE ]; then
|
||||
if [ -n "$2" ]
|
||||
then
|
||||
echo "Doing automatic pull on [ $1 ]"
|
||||
if git pull
|
||||
then
|
||||
return
|
||||
else
|
||||
echo "Something wrong with pull. aborting, repo at"
|
||||
echo " [ $1 ]"
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo "Local repo behind remote:"
|
||||
echo "do git pull at repo"
|
||||
echo " [ $1 ]"
|
||||
exit 99
|
||||
fi
|
||||
elif [ $REMOTE = $BASE ]; then
|
||||
echo "Local repo ahead of remote. A push is needed"
|
||||
echo "Repo is at: $1"
|
||||
echo ""
|
||||
echo -n "Should we try a push ? [Y/n]:"
|
||||
read answer
|
||||
echo ""
|
||||
|
||||
case $answer in
|
||||
n|N|q|Q)
|
||||
exit 99;;
|
||||
*)
|
||||
echo -e "${Yellow}"
|
||||
if ! git push origin HEAD
|
||||
then
|
||||
echo -e "${Color_Off}"
|
||||
exit 99
|
||||
fi
|
||||
echo -e "${Color_Off}Push done."
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
echo "Diverged. not sure what you did but there is no tracking branch. "
|
||||
echo "repo at [ $1 ]. fix it so that there is a tracking branch remote."
|
||||
echo "Often this is related to somebody having commited to the same branch"
|
||||
echo "on the server so a simple push wont work, try a 'git rebase'."
|
||||
exit 99
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
on_a_branch()
|
||||
{
|
||||
local repo=$1
|
||||
local type=$2
|
||||
(
|
||||
cd $repo
|
||||
name=$(git symbolic-ref -q HEAD)
|
||||
if [ -z "$name" ]
|
||||
then
|
||||
echo "git $type repo [ $repo ] is detached."
|
||||
|
||||
branches=($(git branch -r --contains $(git rev-parse HEAD)))
|
||||
if [ 0 == ${#branches[@]} ]
|
||||
then
|
||||
echo "It needs to be on a branch but git could not find any associated branch"
|
||||
echo ""
|
||||
echo "you need to make sure that the commit is not on a detached branch"
|
||||
echo "and that the branch exist in the remote repo also. it can not be a local name"
|
||||
echo "as it is about to get pushed so it can be part of system release"
|
||||
exit 99
|
||||
fi
|
||||
|
||||
echo "It needs to be on a branch. Please select one or quit if it is not in list."
|
||||
echo ""
|
||||
|
||||
i=0
|
||||
for branch in ${branches[*]}
|
||||
do
|
||||
echo "$i: $branch"
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo -n "Select what branch to checkout. Q/q or N/n to quit? "
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
q|Q|n|N)
|
||||
echo "Aborting!"
|
||||
exit 99;;
|
||||
esac
|
||||
|
||||
echo -e "${Yellow}"
|
||||
pwd
|
||||
echo "git checkout ${branches[$answer]}"
|
||||
if ! git checkout -t ${branches[$answer]}
|
||||
then
|
||||
local_branch=$(basename ${branches[$answer]})
|
||||
if ! git checkout ${local_branch}
|
||||
then
|
||||
echo -e "${Color_Off}"
|
||||
echo "update_git aborting! something was wrong changing to branch ${branches[$answer]}"
|
||||
echo "go to [ $repo ] and fix it."
|
||||
exit 99
|
||||
fi
|
||||
fi
|
||||
echo -e "${Color_Off}"
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
git_repos_uptodate()
|
||||
{
|
||||
on_a_branch ${PKG_BUILD_DIR} package
|
||||
on_a_branch ${PKG_DIR} feed
|
||||
on_a_branch ${PWD} top
|
||||
branch_uptodate ${PKG_BUILD_DIR}
|
||||
branch_uptodate ${PKG_DIR} do_pull
|
||||
branch_uptodate ${PWD} do_pull
|
||||
}
|
||||
|
||||
get_feed_name()
|
||||
{
|
||||
|
||||
echo $1 |sed -e "s|.*feeds/\([^/]*\).*|\1|"
|
||||
|
||||
# rest=$(dirname $1)
|
||||
# base=$(basename $1)
|
||||
# prev=$base
|
||||
|
||||
# while [ -n "$rest" ]
|
||||
# do
|
||||
# if [ "$base" == "feeds" ]
|
||||
# then
|
||||
# echo "$prev"
|
||||
# fi
|
||||
# done
|
||||
}
|
||||
|
||||
create_message()
|
||||
{
|
||||
FORMAT="commit %H%n\
|
||||
Author: %aN <%aE>%n\
|
||||
Date: %ai%n\
|
||||
%n\
|
||||
%w(80,4,4)%s%n
|
||||
%b%n\
|
||||
%w()Base directory -> ${repo_PATH}/"
|
||||
local FROM=${PKG_SOURCE_VERSION}
|
||||
local TO=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
|
||||
|
||||
local commits=$(cd ${PKG_BUILD_DIR};git rev-list ${FROM}..${TO})
|
||||
|
||||
local feed=$(get_feed_name ${PKG_DIR})
|
||||
|
||||
echo "Update feed [ $feed ] package [ $PKG_NAME ]"
|
||||
echo ""
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
(cd ${PKG_BUILD_DIR}; git log --graph --oneline ${FROM}..${TO})
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
|
||||
for commit in $commits
|
||||
do
|
||||
(cd ${PKG_BUILD_DIR}; git show --stat --pretty=format:"$FORMAT" $commit)
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
done
|
||||
}
|
||||
|
||||
edit_file()
|
||||
{
|
||||
echo -en "${Red}"
|
||||
echo "Here is the commit message we are going to use!"
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo -en "${Color_Off}"
|
||||
cat $1
|
||||
echo -en "${Red}"
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo -en "${Color_Off}"
|
||||
|
||||
echo -n "Do you want to edit the message [y/N]? "
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
y|Y)
|
||||
$EDITOR $1;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
commit_feed()
|
||||
{
|
||||
template=$(readlink -f $1)
|
||||
edit_file $template
|
||||
|
||||
echo -e "${Yellow}"
|
||||
(
|
||||
cd ${PKG_DIR}
|
||||
if git commit -F $template
|
||||
then
|
||||
if git push origin HEAD
|
||||
then
|
||||
echo -e "${Color_Off} Feed Updated!"
|
||||
return
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong push feed git ${PKG_DIR}"
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong committing to feed git ${PKG_DIR}"
|
||||
exit 99
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
commit_feeds_config()
|
||||
{
|
||||
template=$(readlink -f $1)
|
||||
edit_file $template
|
||||
|
||||
echo -e "${Yellow}"
|
||||
if git commit -F $template
|
||||
then
|
||||
if git push origin HEAD
|
||||
then
|
||||
echo -e "${Color_Off}Feeds.conf updated!"
|
||||
return
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong push change to feeds.conf"
|
||||
echo "try \"git remote update ; git stash ;git rebase; git push;git stash pop\""
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong committing to feed git"
|
||||
exit 99
|
||||
fi
|
||||
}
|
||||
|
||||
insert_hash_in_feeds_config()
|
||||
{
|
||||
local feed=$(get_feed_name ${PKG_DIR})
|
||||
local TO=$(cd ${PKG_DIR}; git rev-parse HEAD)
|
||||
|
||||
sed -i feeds.conf -e "/ ${feed} / s/\(.*\)[;^].*/\1^${TO}/"
|
||||
git add feeds.conf
|
||||
}
|
||||
|
||||
check_packages()
|
||||
{
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
echo "Now checking if any changes have been done to the packages."
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
# only scan in the build directory that is currently in use.
|
||||
CPU=$(grep "CONFIG_CPU_TYPE=" .config| cut -f2 -d\")
|
||||
LIBC=$(grep "CONFIG_LIBC=" .config| cut -f2 -d\")
|
||||
|
||||
# First scan all files in build dir for packages that have .git directories.
|
||||
all_pkgs=$(find build_dir/*${CPU}*${LIBC}* -name ".git")
|
||||
|
||||
for pkg in `echo "$all_pkgs"`
|
||||
do
|
||||
pkg=$(dirname $pkg)
|
||||
|
||||
# check if the git in build is at same commit id as the feed makefile points out
|
||||
if [ -e ${pkg}/.git_update ]
|
||||
then
|
||||
source ${pkg}/.git_update
|
||||
fi
|
||||
|
||||
# print_git_update
|
||||
|
||||
if [ -n "${PKG_NAME}" ]
|
||||
then
|
||||
if ! is_git_same
|
||||
then
|
||||
if update_this_pkg
|
||||
then
|
||||
# print_git_update
|
||||
git_repos_uptodate
|
||||
insert_hash_in_feed_makefile
|
||||
[ ${UPDATE} -eq 1 ] && insert_version_in_feed_makefile
|
||||
create_message >tmp/msg
|
||||
commit_feed tmp/msg
|
||||
insert_hash_in_feeds_config
|
||||
commit_feeds_config tmp/msg
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# now handle the target git. we have only one
|
||||
|
||||
|
||||
feeds_hash()
|
||||
{
|
||||
grep -v "^#" feeds.conf | grep " $1 " | grep "\^" | sed -e "s/.*[;^]\(.*\)/\1/"
|
||||
}
|
||||
|
||||
insert_feed_hash_in_feeds_config()
|
||||
{
|
||||
local feed=$1
|
||||
local TO=$(cd feeds/${feed}; git rev-parse HEAD)
|
||||
|
||||
sed -i feeds.conf -e "/ ${feed} / s/\(.*\)[;^].*/\1^${TO}/"
|
||||
git add feeds.conf
|
||||
}
|
||||
|
||||
create_feed_message()
|
||||
{
|
||||
local feed=$1
|
||||
local FROM=$2
|
||||
local TO=$3
|
||||
|
||||
local FORMAT="commit %H%n\
|
||||
Author: %aN <%aE>%n\
|
||||
Date: %ai%n\
|
||||
%n\
|
||||
%w(80,4,4)%s%n
|
||||
%b%n\
|
||||
%w()Base directory -> feeds/$feed/"
|
||||
|
||||
|
||||
local commits=$(cd feeds/$feed;git rev-list ${FROM}..${TO})
|
||||
|
||||
echo "Update feed [ $feed ]"
|
||||
echo ""
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
(cd feeds/$feed; git log --graph --oneline ${FROM}..${TO})
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
|
||||
for commit in $commits
|
||||
do
|
||||
(cd feeds/$feed; git show --stat --pretty=format:"$FORMAT" $commit)
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
check_feeds()
|
||||
{
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
echo "Now checking if any changes have been done to the feeds."
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
feeds="$1"
|
||||
[ -n "$feeds" ] || feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
||||
for feed in `echo $feeds`
|
||||
do
|
||||
feed_hash=$(feeds_hash $feed)
|
||||
[ -n "$feed_hash" ] || continue
|
||||
if [ -d feeds/$feed ]; then
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
|
||||
if [ "$feed_hash" != "$in_git" ]
|
||||
then
|
||||
|
||||
name=$(cd feeds/$feed;git symbolic-ref -q HEAD)
|
||||
if [ -z "$name" ]
|
||||
then
|
||||
echo "Feed feeds/${feed} is at a git commit which is different from feeds.conf"
|
||||
#echo "git id from feeds.conf [$feed_hash] git id from feeds/${feed} [$in_git]"
|
||||
on_a_branch feeds/${feed} feed
|
||||
|
||||
#redo the test here and see if the feeds.conf and git is still different.
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
if [ "$feed_hash" = "$in_git" ]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
LOCAL=$(cd feeds/$feed;git rev-parse @)
|
||||
REMOTE=$(cd feeds/$feed;git rev-parse @{u})
|
||||
BASE=$(cd feeds/$feed;git merge-base @ @{u})
|
||||
|
||||
# if we are behind the remote automatically do a pull
|
||||
if [ $LOCAL = $BASE ]; then
|
||||
(cd feeds/$feed ; git pull 1>/dev/null)
|
||||
|
||||
#redo the test here and see if the feeds.conf and git is still different.
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
if [ "$feed_hash" = "$in_git" ]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Feed feeds/${feed} is at different commit than what is in feeds.conf"
|
||||
#echo "git id from feeds.conf [$feed_hash] git id from feeds/${feed} [$in_git]"
|
||||
echo -n "Should we update feeds.conf to reflect the new version ? [y/N]:"
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
n|N|'')
|
||||
continue;;
|
||||
esac
|
||||
branch_uptodate feeds/${feed}
|
||||
create_feed_message ${feed} $feed_hash $in_git >tmp/msg
|
||||
insert_feed_hash_in_feeds_config ${feed}
|
||||
commit_feeds_config tmp/msg
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
is_local_and_remote_same()
|
||||
{
|
||||
git remote update 2>/dev/null 1>/dev/null
|
||||
LOCAL=$(git rev-parse @)
|
||||
REMOTE=$(git rev-parse @{u})
|
||||
|
||||
if [ $LOCAL = $REMOTE ]
|
||||
then
|
||||
return
|
||||
fi
|
||||
|
||||
local_name=$(git rev-parse --abbrev-ref @ )
|
||||
remote_name=$(git rev-parse --abbrev-ref @{u} )
|
||||
|
||||
echo "Top repo local branch \"$local_name\" is not at same point as remote \"$remote_name\""
|
||||
echo "This update script will update the feeds.conf file and for that to work it needs to"
|
||||
echo "be up to date with the remote."
|
||||
echo ""
|
||||
echo "please run:"
|
||||
echo " git pull"
|
||||
echo " ./iop feeds_update"
|
||||
echo ""
|
||||
echo "do not forget the bootstrap. but do not run make it can delete your package in build"
|
||||
exit 0
|
||||
}
|
||||
|
||||
usage(){
|
||||
echo -e "$0 [flags]"
|
||||
echo -e "flags:"
|
||||
echo -e " -f\tFeed to update"
|
||||
echo -e " -h\tShow this help"
|
||||
echo -e " -u\tUpdate package version\n"
|
||||
}
|
||||
|
||||
# Exported interface
|
||||
function update_package {
|
||||
|
||||
UPDATE=0
|
||||
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
# Regular Colors
|
||||
Black='\033[0;30m' # Black
|
||||
Red='\033[0;31m' # Red
|
||||
Green='\033[0;32m' # Green
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
Blue='\033[0;34m' # Blue
|
||||
Purple='\033[0;35m' # Purple
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;37m' # White
|
||||
|
||||
while getopts "f:hu" opt; do
|
||||
case $opt in
|
||||
f)
|
||||
feed=$OPTARG
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
u)
|
||||
UPDATE=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$EDITOR" ]
|
||||
then
|
||||
if [ -f /usr/bin/vi ]; then
|
||||
EDITOR=vi
|
||||
else
|
||||
echo "env variable EDITOR needs to be set"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# allow subshells to abort the whole program by exiting with "exit 99"
|
||||
set -E
|
||||
trap '[ "$?" -ne 99 ] || exit 99' ERR
|
||||
|
||||
is_local_and_remote_same
|
||||
[ -n "$feed" ] || check_packages
|
||||
check_feeds $feed
|
||||
}
|
||||
|
||||
register_command "update_package" "Publish changes to packages and feeds"
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iopsys-analytics
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=88dd7997ed78b1ab02c2904ed90518c46a8fa26b
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopsys-analytics.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Analytics tweaks for IOPSYS CI/CD purposes
|
||||
|
||||
# setting core dump limit
|
||||
DEPENDS+= \
|
||||
+prlimit \
|
||||
# monitoring
|
||||
DEPENDS+= \
|
||||
+collectd \
|
||||
+collectd-mod-cpu \
|
||||
+collectd-mod-exec \
|
||||
+collectd-mod-load \
|
||||
+collectd-mod-memory \
|
||||
+collectd-mod-network \
|
||||
+collectd-mod-processes \
|
||||
+collectd-mod-write-http \
|
||||
+@PACKAGE_COLLECTD_ENCRYPTED_NETWORK \
|
||||
# remote syslog
|
||||
DEPENDS+= \
|
||||
+syslog-ng \
|
||||
+@SYSLOGNG_LOGROTATE \
|
||||
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Analytics tweaks for IOPSYS internal CI/CD purposes
|
||||
e.g. syslog, system health, coredumps...
|
||||
endef
|
||||
|
||||
Build/Compile=
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(CP) -r $(PKG_BUILD_DIR)/files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libeasy
|
||||
PKG_VERSION:=7.4.3
|
||||
PKG_VERSION:=7.4.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ba80dcc51056772c906cac8022a2537b74959e6a
|
||||
PKG_SOURCE_VERSION:=11eb263666556c419220e2a50c3a67422e79f884
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libeasy.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -28,12 +28,6 @@ TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/libeasy/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall"
|
||||
|
||||
@@ -62,7 +56,6 @@ define Build/InstallDev/libeasy
|
||||
$(CP) $(PKG_BUILD_DIR)/if_utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/debug.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/hlist.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/timestamp.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.12
|
||||
PKG_VERSION:=1.0.10
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=68f0b4f3edecea9b8f05e72b6bbf3952d3946b7c
|
||||
PKG_SOURCE_VERSION:=e6ba6fca814f6c83a3d6ff4a5b7560fbc36d3101
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.9
|
||||
PKG_VERSION:=1.0.8
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=3a8d0954ca351a1f8f669dc2f3d294409b90f091
|
||||
PKG_SOURCE_VERSION:=e1de60c2c05935fb2f4adfc1f73feba0bb32ade6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.4
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=17388c54e14d8505254c0640067cf697760310ee
|
||||
PKG_SOURCE_VERSION:=e6d689334000bc57498d9a3f203a8933160e1ef4
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.4.42
|
||||
PKG_VERSION:=7.4.18
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c3efa4ecd3bbf8247bc1b4c3e0ff512e42649531
|
||||
PKG_SOURCE_VERSION:=4f6d22e0afa199bcff63f084a022c6142883973f
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.5.1.15.1
|
||||
PKG_VERSION:=4.5.1.0
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=e0538bb1eb0b85ac085e6abb61ebbf8e1712f1e7
|
||||
PKG_SOURCE_VERSION:=6d74ca3c6a4a2893160a5de2f7f455a8d8596fec
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -28,7 +28,7 @@ define Package/map-agent
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+ieee1905-map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp
|
||||
+map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_AGENT_USE_LIBDPP),y)
|
||||
@@ -40,7 +40,7 @@ define Package/dynbhd
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Dynamic Backhaul Daemon
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+ieee1905-map-plugin +map-agent
|
||||
+map-plugin +map-agent
|
||||
endef
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ config agent 'agent'
|
||||
option island_prevention '0'
|
||||
option eth_onboards_wifi_bhs '1'
|
||||
option scan_on_boot_only '0'
|
||||
option chan_ch_relay_mcast '0'
|
||||
option chan_ch_relay_mcast '1'
|
||||
option guest_isolation '1'
|
||||
list map_port 'all'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
|
||||
@@ -69,7 +69,7 @@ fi
|
||||
|
||||
remove_from_bridge() {
|
||||
config_get ifname "$section" ifname
|
||||
[ -n "$ifname" ] && brctl delif ${al_bridge} ${ifname}
|
||||
[ -n "$ifname" ] && ubus call network.interface.${al_brnet} remove_device '{"name":"$ifname"}'
|
||||
}
|
||||
|
||||
update_bstas() {
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.6.0.5.2
|
||||
PKG_VERSION:=4.5.0.4
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=27b2dabe45811909122a90e185bab3860a340084
|
||||
PKG_SOURCE_VERSION:=59a3bb0e2cbd0f37f60bd121e4b30289a64d310e
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
@@ -27,7 +27,7 @@ define Package/map-controller
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi Multi-AP Controller (EasyMesh R2)
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +ieee1905-map-plugin \
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +map-plugin \
|
||||
+CONTROLLER_USE_LIBDPP:libdpp
|
||||
endef
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ config ap
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH-2.4GHz'
|
||||
option encryption 'sae'
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
@@ -67,7 +67,7 @@ config ap
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH-5GHz'
|
||||
option encryption 'sae'
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
@@ -75,7 +75,7 @@ config ap
|
||||
|
||||
config ap
|
||||
option band '6'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH-6GHz'
|
||||
option encryption 'sae'
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
|
||||
@@ -15,7 +15,7 @@ snooping_bridges=
|
||||
|
||||
__device_is_bridge() {
|
||||
local device="$2"
|
||||
local devsec__="$(uci show network | grep -F ".name='$device'" | cut -d'.' -f2)"
|
||||
local devsec__="$(uci show network | grep name=.*$device | grep -v ifname | cut -d'.' -f2)"
|
||||
local sectype="$(uci -q get network.$devsec__)"
|
||||
local devtype="$(uci -q get network.$devsec__.type)"
|
||||
[ "$sectype" != "device" -o "$devtype" != "bridge" ] && return 1
|
||||
@@ -302,12 +302,7 @@ config_mcproxy_instance() {
|
||||
# for snooping to work we should enable it on the bridge, doing it from
|
||||
# here instead of from inside network config
|
||||
if [ "$downstreams" != "$snooping_bridges" ]; then
|
||||
if [ "$mcast_mode" == "0" ]; then
|
||||
config_sysfs_mcast_snooping "$downstreams" 0
|
||||
else
|
||||
config_sysfs_mcast_snooping "$downstreams" 1
|
||||
fi
|
||||
|
||||
config_sysfs_mcast_snooping "$downstreams" 1
|
||||
[ -n $fast_leave ] &&
|
||||
config_sysfs_mcast_fastleave "$downstreams" "$fast_leave"
|
||||
config_sysfs_mcast_flood "$downstreams" "$mcast_mode"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netmode
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=0.3.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
config netmode global
|
||||
option enabled 0
|
||||
# option mode 'router'
|
||||
|
||||
#config testnet testnet
|
||||
# option enabled 1
|
||||
# option destination '8.8.8.8'
|
||||
|
||||
#config shiftrange shiftrange
|
||||
# option enabled 1
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# do not start testnet if the feature is explicitly disabled
|
||||
[ "$(uci -q get testnet.global.enabled)" = "0" ] && exit 0
|
||||
[ "$(uci -q get netmode.testnet.enabled)" = "0" ] && exit 0
|
||||
|
||||
[ "$ACTION" == "ifup" -o "$ACTION" == "ifdown" ] || exit 0
|
||||
|
||||
@@ -14,4 +14,8 @@ interface_check() {
|
||||
}
|
||||
|
||||
interface_check
|
||||
/etc/init.d/testnet reload
|
||||
if [ -n "$(pgrep -f testnet)" ]; then
|
||||
testnet once
|
||||
else
|
||||
testnet &
|
||||
fi
|
||||
252
netmode/files/etc/hotplug.d/iface/70-shiftrange
Normal file
252
netmode/files/etc/hotplug.d/iface/70-shiftrange
Normal file
@@ -0,0 +1,252 @@
|
||||
#!/bin/sh
|
||||
# this scripts shifts the lan network prefixes
|
||||
# if a wan interface has the same network prefix.
|
||||
|
||||
# do not shift range if the feature is explicitly disabled
|
||||
[ "$(uci -q get netmode.shiftrange.enabled)" == "0" ] && exit 0
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
|
||||
LOCKFILE="/tmp/70-shiftrange.lock"
|
||||
RESTRICTED_NETS=""
|
||||
ALL_NETS=""
|
||||
|
||||
#####
|
||||
##### initial functions
|
||||
#####
|
||||
|
||||
initial_check()
|
||||
{
|
||||
# run only on ifup
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
|
||||
# run only for uplink (not is_lan) interfaces
|
||||
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||
[ "$islan" != "1" ] || exit 0
|
||||
|
||||
# run only if the uplink interface has a configured protocol
|
||||
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||
[ "$proto" != "none" ] || exit 0
|
||||
}
|
||||
|
||||
finish()
|
||||
{
|
||||
lock -u $LOCKFILE
|
||||
rm -f $LOCKFILE
|
||||
}
|
||||
|
||||
# just one instance of this script at a time
|
||||
just_one_instance()
|
||||
{
|
||||
local counter=0
|
||||
local limit=10
|
||||
|
||||
#wait for the lock to become free
|
||||
while [ -e $LOCKFILE ] ; do
|
||||
sleep 1
|
||||
counter=$((counter + 1))
|
||||
[ "$counter" -gt "$limit" ] && exit 1
|
||||
done
|
||||
|
||||
lock $LOCKFILE
|
||||
trap finish EXIT INT TERM
|
||||
}
|
||||
|
||||
|
||||
#####
|
||||
##### helper functions
|
||||
#####
|
||||
|
||||
#given a an ip and a mask in the form of "192.168.1.1/24"
|
||||
#return the network address like "192.168.1.0/24"
|
||||
get_network_address()
|
||||
{
|
||||
local ip="$1"
|
||||
[ -z "$ip" ] && return
|
||||
|
||||
local prefix=${ip##*/}
|
||||
|
||||
local ip1=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip2=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip3=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip4=${ip%%/*}
|
||||
|
||||
local ip=$((($ip1 << 24) + ($ip2 << 16) + ($ip3 << 8) + $ip4))
|
||||
local mask=$((0xFFFFFFFF >> (32 - $prefix) << (32 - $prefix)))
|
||||
local network=$(($ip & $mask))
|
||||
|
||||
local n1=$((($network & 0xFF000000) >> 24))
|
||||
local n2=$((($network & 0x00FF0000) >> 16))
|
||||
local n3=$((($network & 0x0000FF00) >> 8))
|
||||
local n4=$(( $network & 0x000000FF))
|
||||
|
||||
echo "$n1.$n2.$n3.$n4/$prefix"
|
||||
}
|
||||
|
||||
#given a network address (192.168.1.0/24)
|
||||
#find the next network address (192.168.2.0/24)
|
||||
next_network_address()
|
||||
{
|
||||
local ip=$1
|
||||
local prefix=${ip##*/}
|
||||
|
||||
local ip1=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip2=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip3=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip4=${ip%%/*}
|
||||
|
||||
local ip=$((($ip1 << 24) + ($ip2 << 16) + ($ip3 << 8) + $ip4))
|
||||
local one="$((1 << (32-$prefix)))"
|
||||
local new=$(($ip + $one))
|
||||
|
||||
local n1=$((($new & 0xFF000000) >> 24))
|
||||
local n2=$((($new & 0x00FF0000) >> 16))
|
||||
local n3=$((($new & 0x0000FF00) >> 8))
|
||||
local n4=$(( $new & 0x000000FF))
|
||||
|
||||
echo "$n1.$n2.$n3.$n4/$prefix"
|
||||
}
|
||||
|
||||
# given a network address and a prefix (192.168.2.0/24)
|
||||
# return the first host ip available (192.168.2.1)
|
||||
first_host_in_network ()
|
||||
{
|
||||
local ip=$1
|
||||
local prefix=${ip##*/}
|
||||
|
||||
local ip1=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip2=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip3=${ip%%.*} ; ip=${ip#*.*}
|
||||
local ip4=${ip%%/*}
|
||||
|
||||
local ip=$((($ip1 << 24) + ($ip2 << 16) + ($ip3 << 8) + $ip4))
|
||||
local new=$(($ip + 1))
|
||||
|
||||
local n1=$((($new & 0xFF000000) >> 24))
|
||||
local n2=$((($new & 0x00FF0000) >> 16))
|
||||
local n3=$((($new & 0x0000FF00) >> 8))
|
||||
local n4=$(( $new & 0x000000FF))
|
||||
|
||||
echo "$n1.$n2.$n3.$n4"
|
||||
}
|
||||
|
||||
# given a network address,
|
||||
# find the next available network address.
|
||||
shift_range()
|
||||
{
|
||||
local net="$1"
|
||||
while true ; do
|
||||
if [ "$RESTRICTED_NETS" == "${RESTRICTED_NETS//$net/}" ] && [ "$ALL_NETS" == "${ALL_NETS//$net/}" ]; then
|
||||
# found a net that is not in restricted nets nor in all nets
|
||||
break
|
||||
fi
|
||||
net=$(next_network_address $net)
|
||||
done
|
||||
|
||||
echo "$net"
|
||||
}
|
||||
|
||||
|
||||
#####
|
||||
##### parse all interfaces section
|
||||
#####
|
||||
|
||||
# RESTRICTED_NETS = all the IPs on wan interfaces
|
||||
# ALL_NETS = all the IPs on any interface
|
||||
parse_interface()
|
||||
{
|
||||
local interface=$1
|
||||
local nets="" # "192.168.1.1/24"
|
||||
local networks="" # "192.168.1.0/24"
|
||||
|
||||
config_get is_lan $interface is_lan
|
||||
network_get_subnets nets $interface
|
||||
|
||||
for n in $nets ; do
|
||||
networks="$networks $(get_network_address $n)"
|
||||
done
|
||||
|
||||
[ "$is_lan" != "1" ] && RESTRICTED_NETS="$RESTRICTED_NETS $networks"
|
||||
ALL_NETS="$ALL_NETS $networks"
|
||||
}
|
||||
|
||||
# parse all the interfaces
|
||||
# get all the IPs on wan interfaces and store them in restrict_nets
|
||||
# get all the IPs on all interfaces and store them in ALL_NETS
|
||||
parse_interfaces()
|
||||
{
|
||||
config_foreach parse_interface "interface"
|
||||
}
|
||||
|
||||
|
||||
#####
|
||||
##### parse all lan interfaces section
|
||||
#####
|
||||
|
||||
parse_lan()
|
||||
{
|
||||
local interface=$1
|
||||
local nets=""
|
||||
local ips=""
|
||||
local newips=""
|
||||
local ips_changed=0
|
||||
|
||||
[ "$interface" == "loopback" ] && return
|
||||
config_get is_lan $interface is_lan
|
||||
[ "$is_lan" == "1" ] || return
|
||||
|
||||
network_get_subnets ips $interface
|
||||
|
||||
for ip in $ips ; do
|
||||
net="$(get_network_address $ip)"
|
||||
|
||||
if [ "$RESTRICTED_NETS" == "${RESTRICTED_NETS//$net/}" ] ; then
|
||||
# net is not in restricted nets
|
||||
# append ip to newips
|
||||
[ -z "$newips" ] && newips="${ip%/*}" || newips="$newips ${ip%/*}"
|
||||
continue
|
||||
fi
|
||||
|
||||
#net is in RESTRICTED_NETS
|
||||
local newnet=$(shift_range $net)
|
||||
local newip="$(first_host_in_network $newnet)"
|
||||
# append newip to newips
|
||||
[ -z "$newips" ] && newips="$newip" || newips="$newips $newip"
|
||||
|
||||
ips_changed=1
|
||||
logger "$0: Changing the ip on interface $interface from $ip to $newip/${newnet##*/}"
|
||||
echo "$0: Changing the ip on interface $interface from $ip to $newip/${newnet##*/}" >/dev/console
|
||||
done
|
||||
|
||||
#assign the new ips
|
||||
if [ "$ips_changed" == "1" ] ; then
|
||||
uci -q set network.$interface.ipaddr="$newips"
|
||||
fi
|
||||
}
|
||||
|
||||
# parse all the interface with is_lan=1
|
||||
parse_lans()
|
||||
{
|
||||
config_foreach parse_lan "interface"
|
||||
}
|
||||
|
||||
#####
|
||||
##### main
|
||||
#####
|
||||
|
||||
main()
|
||||
{
|
||||
initial_check
|
||||
just_one_instance
|
||||
|
||||
config_load network
|
||||
parse_interfaces
|
||||
parse_lans
|
||||
|
||||
if [ -n "$(uci changes network)" ] ; then
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
fi
|
||||
}
|
||||
|
||||
main $@
|
||||
@@ -1,110 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
source "/etc/device_info"
|
||||
|
||||
l2_mcast_config() {
|
||||
# configure L2 mcast config for snooping
|
||||
logger -s -p user.info -t "netmode" "Generating L2 mcast configuration"
|
||||
|
||||
# remove proxy sections
|
||||
uci -q delete mcast.igmp_proxy_1
|
||||
uci -q delete mcast.mc_proxy_MLD
|
||||
|
||||
# add igmp_snooping section
|
||||
uci -q set mcast.igmp_snooping_1=snooping
|
||||
uci -q set mcast.igmp_snooping_1.enable='1'
|
||||
uci -q set mcast.igmp_snooping_1.proto='igmp'
|
||||
uci -q set mcast.igmp_snooping_1.version='2'
|
||||
uci -q set mcast.igmp_snooping_1.robustness='2'
|
||||
uci -q set mcast.igmp_snooping_1.query_interval='125'
|
||||
uci -q set mcast.igmp_snooping_1.query_response_interval='100'
|
||||
uci -q set mcast.igmp_snooping_1.last_member_query_interval='10'
|
||||
uci -q set mcast.igmp_snooping_1.fast_leave='1'
|
||||
uci -q set mcast.igmp_snooping_1.snooping_mode='2'
|
||||
uci -q set mcast.igmp_snooping_1.interface='br-lan'
|
||||
uci -q add_list mcast.igmp_snooping_1.filter='239.0.0.0/8'
|
||||
|
||||
# add mld_snooping section
|
||||
uci -q set mcast.mld_snooping_1=snooping
|
||||
uci -q set mcast.mld_snooping_1.enable='1'
|
||||
uci -q set mcast.mld_snooping_1.proto='mld'
|
||||
uci -q set mcast.mld_snooping_1.version='2'
|
||||
uci -q set mcast.mld_snooping_1.robustness='2'
|
||||
uci -q set mcast.mld_snooping_1.query_interval='125'
|
||||
uci -q set mcast.mld_snooping_1.query_response_interval='100'
|
||||
uci -q set mcast.mld_snooping_1.last_member_query_interval='10'
|
||||
uci -q set mcast.mld_snooping_1.fast_leave='1'
|
||||
uci -q set mcast.mld_snooping_1.snooping_mode='2'
|
||||
uci -q set mcast.mld_snooping_1.interface='br-lan'
|
||||
|
||||
uci -q commit mcast
|
||||
}
|
||||
|
||||
l2_network_config() {
|
||||
logger -s -p user.info -t "netmode" "Generating L2 network configuration"
|
||||
|
||||
# Configure L2 Network Mode
|
||||
uci -q delete network.lan
|
||||
uci -q delete network.wan
|
||||
uci -q delete network.wan6
|
||||
uci -q set network.lan=interface
|
||||
uci -q set network.lan.proto='dhcp'
|
||||
uci -q set network.lan.device='br-lan'
|
||||
uci -q set network.lan.force_link='1'
|
||||
uci -q set network.lan6=interface
|
||||
uci -q set network.lan6.proto='dhcpv6'
|
||||
uci -q set network.lan6.device='@lan'
|
||||
uci -q set network.lan6.reqprefix='no'
|
||||
uci -q delete network.br_lan.ports
|
||||
uci -q set network.br_lan.bridge_empty='1'
|
||||
|
||||
add_port_to_br_lan() {
|
||||
port="$1"
|
||||
[ -n "$port" -a -d /sys/class/net/$port ] || continue
|
||||
uci add_list network.br_lan.ports="$port"
|
||||
}
|
||||
|
||||
if [ -f /etc/board.json ]; then
|
||||
json_load_file /etc/board.json
|
||||
json_select network
|
||||
json_select lan
|
||||
if json_is_a ports array; then
|
||||
json_for_each_item add_port_to_br_lan ports
|
||||
else
|
||||
json_get_var device device
|
||||
[ -n "$device" ] && uci add_list network.br_lan.ports="$device"
|
||||
fi
|
||||
json_select ..
|
||||
json_select wan 2>/dev/null
|
||||
json_get_var device device
|
||||
[ -n "$device" ] && uci add_list network.br_lan.ports="$device"
|
||||
json_cleanup
|
||||
fi
|
||||
|
||||
uci -q commit network
|
||||
|
||||
# Disable DHCP Server
|
||||
uci -q set dhcp.lan.ignore=1
|
||||
uci -q commit dhcp
|
||||
/etc/init.d/odhcpd disable
|
||||
|
||||
# Disable SSDPD
|
||||
uci -q set ssdpd.ssdp.enabled="0"
|
||||
uci -q commit ssdpd
|
||||
|
||||
# Update CWMP Agent WAN Interface
|
||||
uci -q set cwmp.cpe.default_wan_interface="lan"
|
||||
uci -q commit cwmp
|
||||
}
|
||||
|
||||
network_mode="$(fw_printenv -n netmode 2>/dev/null)"
|
||||
|
||||
case "$network_mode" in
|
||||
layer2|extender)
|
||||
l2_network_config
|
||||
l2_mcast_config
|
||||
;;
|
||||
esac
|
||||
@@ -14,17 +14,14 @@ test_connection() {
|
||||
local defroute="$(ip r | grep default | awk '{print$3}' | head -1)"
|
||||
local def6route="$(ip -f inet6 r | grep default | awk '{print$3}')"
|
||||
local ping6dev="$(ip -f inet6 r | grep default | awk '{print$5}')"
|
||||
local resolvfile="$(uci -q get dhcp.@dnsmasq[0].resolvfile)"
|
||||
|
||||
if [ -n "$addr" ]; then
|
||||
ping -q -w 5 -c 1 $addr >/dev/null 2>&1 && return 0
|
||||
elif [ -n "$defroute" ]; then
|
||||
ping -q -w 5 -c 1 $defroute >/dev/null 2>&1 && return 0
|
||||
if [ -e "$resolvfile" ]; then
|
||||
for nmsrv in $(grep nameserver "$resolvfile" | awk '{print$2}'); do
|
||||
ping -q -w 5 -c 1 $nmsrv >/dev/null 2>&1 && return 0
|
||||
done
|
||||
fi
|
||||
for nmsrv in $(grep nameserver /var/resolv.conf.auto | awk '{print$2}'); do
|
||||
ping -q -w 5 -c 1 $nmsrv >/dev/null 2>&1 && return 0
|
||||
done
|
||||
elif [ -n "$def6route" -a -n "$ping6dev" ]; then
|
||||
ndisc6 -w 5 -1 $def6route $ping6dev >/dev/null 2>&1 && return 0
|
||||
fi
|
||||
@@ -35,9 +32,9 @@ internet_test() {
|
||||
local link dest
|
||||
|
||||
# use the destination address given in config for connectivity check
|
||||
dest="$(uci -q get testnet.global.destination)"
|
||||
dest="$(uci -q get netmode.testnet.destination)"
|
||||
# for backwards compatibility
|
||||
[ -n "$dest" ] || dest="$(uci -q get system.@system[0].netping_addr)"
|
||||
[ -n "$dest" ] || dest="$(uci -q get diagnostics.@connectivity[0].destination)"
|
||||
|
||||
test_connection $dest
|
||||
|
||||
@@ -22,12 +22,4 @@ config OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
bool "Adds a test controller by default"
|
||||
default n
|
||||
|
||||
config OBUSPA_MAX_CONTROLLERS_NUM
|
||||
int "The maximum number of controllers to be supported"
|
||||
range 1 10
|
||||
default 5
|
||||
help
|
||||
This value must be in range of 1 to 10. (default 5)
|
||||
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.5.16
|
||||
PKG_VERSION:=7.0.5.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=8249b1e9ae996ed45ec5edcd1adc128bd810a45b
|
||||
PKG_SOURCE_VERSION:=d11c8505ffddb4c840d630632b0bb7dda04ca5b2
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -32,7 +32,7 @@ define Package/obuspa
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl +ca-certificates
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
@@ -81,14 +81,10 @@ else
|
||||
CMAKE_OPTIONS += -DENABLE_WEBSOCKETS=OFF
|
||||
endif
|
||||
|
||||
ifdef $(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM)
|
||||
TARGET_CFLAGS += -DOBUSPA_MAX_CONTROLLERS_NUM=$(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM)
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/obuspa/* $(PKG_BUILD_DIR)/
|
||||
$(Build/Patch)
|
||||
$(CP) -rf ~/git/obuspa/* $(PKG_BUILD_DIR)/
|
||||
$(Build/Patch)
|
||||
endef
|
||||
endif
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ config obuspa 'global'
|
||||
option enabled '1'
|
||||
option debug '1'
|
||||
option dhcp_discovery '1'
|
||||
option log_level '1'
|
||||
option log_level '2'
|
||||
option prototrace '0'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
option role_file '/etc/obuspa/roles.json'
|
||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||
option trust_cert '/etc/ssl/cert.pem'
|
||||
#option trust_cert '/etc/obuspa/rootCA.pem'
|
||||
#option client_cert '/etc/obuspa/client.pem'
|
||||
#option log_dest '/tmp/obuspa.log'
|
||||
|
||||
|
||||
@@ -92,10 +92,10 @@ get_base_path()
|
||||
count=0
|
||||
|
||||
if [ -f "${DB_DUMP}" ]; then
|
||||
path=$(grep -E "${refpath}\d+.Alias \"${value}\"" ${DB_DUMP})
|
||||
path=$(grep "${refpath}\d.Alias \"${value}\"" ${DB_DUMP})
|
||||
path=${path%.*}
|
||||
if [ -z "${path}" ]; then
|
||||
path=$(grep -oE "${refpath}\d+" ${DB_DUMP} |sort -r|head -n 1)
|
||||
path=$(grep -o "${refpath}\d" ${DB_DUMP} |sort -r|head -n 1)
|
||||
if [ -n "${path}" ]; then
|
||||
count=${path##*.}
|
||||
count=$(( count + 1 ))
|
||||
@@ -122,9 +122,9 @@ get_refrence_path()
|
||||
path=""
|
||||
|
||||
if [ -f "${DB_DUMP}" ]; then
|
||||
path=$(grep -E "${dmref}\d+.Alias " ${DB_DUMP}|grep -w "${value}")
|
||||
path=$(grep "${dmref}\d.Alias " ${DB_DUMP}|grep -w "${value}")
|
||||
elif [ -f "${RESET_FILE}" ]; then
|
||||
path=$(grep -E "${dmref}\d+.Alias " ${RESET_FILE}|grep -w "${value}")
|
||||
path=$(grep "${dmref}\d.Alias " ${RESET_FILE}|grep -w "${value}")
|
||||
fi
|
||||
path=${path%.*}
|
||||
echo "${path}"
|
||||
@@ -728,13 +728,13 @@ get_instances_from_db_dump()
|
||||
{
|
||||
local obj inst
|
||||
|
||||
obj="${1}\d+"
|
||||
obj="${1}\d"
|
||||
if [ ! -f "${DB_DUMP}" ]; then
|
||||
echo ""
|
||||
return 0;
|
||||
fi
|
||||
|
||||
inst="$(grep -oE "${obj}" "${DB_DUMP}"|uniq)"
|
||||
inst="$(grep -oe "${obj}" "${DB_DUMP}"|uniq)"
|
||||
echo "$inst"
|
||||
}
|
||||
|
||||
@@ -942,7 +942,7 @@ check_n_delete_db()
|
||||
r="${3}"
|
||||
sec="${sec/${t}_/cpe-}"
|
||||
|
||||
path=$(grep -E "${r}\d+.Alias \"${sec}\"" ${DB_DUMP})
|
||||
path=$(grep "${r}\d.Alias \"${sec}\"" ${DB_DUMP})
|
||||
path=${path%.*}
|
||||
|
||||
delete_sql_db_entry_with_pattern "${path}"
|
||||
|
||||
@@ -82,17 +82,6 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.SelfTestDiagnostics()",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.FactoryReset()",
|
||||
"perm": [
|
||||
@@ -581,7 +570,8 @@
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
"PERMIT_NONE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -594,6 +584,66 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Time.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UPnP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Bridging.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Ethernet.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv6.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.",
|
||||
"perm": [
|
||||
@@ -604,6 +654,37 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.NAT.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Routing.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
@@ -614,6 +695,16 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.InterfaceStack.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"perm": [
|
||||
@@ -624,6 +715,56 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.LANConfigSecurity.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Security.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.RouterAdvertisement.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Services.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UserInterface.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PeriodicStatistics.",
|
||||
"perm": [
|
||||
@@ -660,16 +801,30 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.AccessPoint.{i}.WPS.InitiateWPSPBC()",
|
||||
"object": "Device.DNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.DataElements.Network.SetSSID()",
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -8,11 +8,6 @@ RETRY_MIN_INTERVAL="5"
|
||||
RETRY_INTERVAL_MUL="2000"
|
||||
ENDPOINT_ID=""
|
||||
|
||||
log()
|
||||
{
|
||||
echo "$*"|logger -t obuspa.dhcp -p debug
|
||||
}
|
||||
|
||||
get_oui_from_db() {
|
||||
db -q get device.deviceinfo.ManufacturerOUI
|
||||
}
|
||||
@@ -314,7 +309,6 @@ if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
fi
|
||||
|
||||
if [ ${uci_change} -eq 1 ]; then
|
||||
log "# Reloading obuspa as dhcp config changed"
|
||||
ubus call uci commit '{"config":"obuspa"}'
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,69 +1,29 @@
|
||||
--- a/src/core/cli_server.c
|
||||
+++ b/src/core/cli_server.c
|
||||
@@ -780,6 +780,7 @@ int ExecuteCli_Set(char *arg1, char *arg
|
||||
@@ -787,6 +787,7 @@ int ExecuteCli_Set(char *arg1, char *arg
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ SetControllerRoleForInternal();
|
||||
// Exit if unable to start a transaction
|
||||
err = DM_TRANS_Start(&trans);
|
||||
if (err != USP_ERR_OK)
|
||||
@@ -865,6 +866,7 @@ int ExecuteCli_Add(char *arg1, char *arg
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ SetControllerRoleForInternal();
|
||||
// Exit if unable to start a transaction
|
||||
err = DM_TRANS_Start(&trans);
|
||||
if (err != USP_ERR_OK)
|
||||
@@ -976,6 +978,7 @@ int ExecuteCli_Del(char *arg1, char *arg
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ SetControllerRoleForInternal();
|
||||
// Exit if unable to start a transaction
|
||||
err = DM_TRANS_Start(&trans);
|
||||
if (err != USP_ERR_OK)
|
||||
// Iterate over all objects to set
|
||||
for (i=0; i < objects.num_entries; i++)
|
||||
{
|
||||
--- a/src/core/data_model.h
|
||||
+++ b/src/core/data_model.h
|
||||
@@ -325,6 +325,8 @@ void DATA_MODEL_DumpSchema(void);
|
||||
@@ -325,6 +325,7 @@ void DATA_MODEL_DumpSchema(void);
|
||||
void DATA_MODEL_DumpInstances(void);
|
||||
char DATA_MODEL_GetJSONParameterType(char *path);
|
||||
int DATA_MODEL_SetParameterInDatabase(char *path, char *value);
|
||||
+void SetControllerRoleForInternal();
|
||||
+void SetControllerDummyID();
|
||||
|
||||
int DM_PRIV_InitSetRequest(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst, char *new_value);
|
||||
void DM_PRIV_RequestInit(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst);
|
||||
--- a/src/core/dm_exec.c
|
||||
+++ b/src/core/dm_exec.c
|
||||
@@ -1207,6 +1207,7 @@ void ProcessMessageQueueSocketActivity(s
|
||||
return;
|
||||
}
|
||||
|
||||
+ SetControllerDummyID(); // To make sure session handler does not break with internal services
|
||||
switch(msg.type)
|
||||
{
|
||||
case kDmExecMsg_ProcessUspRecord:
|
||||
--- a/src/core/msg_handler.c
|
||||
+++ b/src/core/msg_handler.c
|
||||
@@ -902,6 +902,34 @@ char *MtpSendItemToString(mtp_send_item_
|
||||
@@ -902,6 +902,20 @@ char *MtpSendItemToString(mtp_send_item_
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
+** SetControllerDummyID
|
||||
+**
|
||||
+** Sets the role for internal user
|
||||
+**
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+void SetControllerDummyID()
|
||||
+{
|
||||
+ cur_msg_controller_info.endpoint_id = "";
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
+** SetControllerRoleForInternal
|
||||
+**
|
||||
+** Sets the role for internal user
|
||||
@@ -74,7 +34,6 @@
|
||||
+{
|
||||
+ cur_msg_combined_role.inherited = kCTrustRole_Untrusted;
|
||||
+ cur_msg_combined_role.assigned = kCTrustRole_FullAccess;
|
||||
+ SetControllerDummyID();
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 04a1a9c..8cb2ad7 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -234,6 +234,8 @@ void HandleMqttDisconnect(mqtt_client_t *client);
|
||||
#define DEFINE_MQTT_TrustCertVerifyCallbackIndex(index) \
|
||||
int MQTT_TrustCertVerifyCallback_##index (int preverify_ok, X509_STORE_CTX *x509_ctx) \
|
||||
{\
|
||||
+ if (index >= MAX_MQTT_CLIENTS) \
|
||||
+ return 0; \
|
||||
return DEVICE_SECURITY_TrustCertVerifyCallbackWithCertChain(preverify_ok, x509_ctx, &mqtt_clients[index].cert_chain);\
|
||||
}
|
||||
|
||||
@@ -244,6 +246,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex(1);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(2);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(3);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(4);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(5);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(6);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(7);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(8);
|
||||
+DEFINE_MQTT_TrustCertVerifyCallbackIndex(9);
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@@ -254,10 +261,15 @@ ssl_verify_callback_t* mqtt_verify_callbacks[] = {
|
||||
MQTT_TrustCertVerifyCallbackIndex(2),
|
||||
MQTT_TrustCertVerifyCallbackIndex(3),
|
||||
MQTT_TrustCertVerifyCallbackIndex(4),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(5),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(6),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(7),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(8),
|
||||
+ MQTT_TrustCertVerifyCallbackIndex(9),
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
};
|
||||
|
||||
-USP_COMPILEASSERT( ((sizeof(mqtt_verify_callbacks)/sizeof(ssl_verify_callback_t*)) == MAX_MQTT_CLIENTS),
|
||||
+USP_COMPILEASSERT( ((sizeof(mqtt_verify_callbacks)/sizeof(ssl_verify_callback_t*)) >= MAX_MQTT_CLIENTS),
|
||||
"There must be MAX_MQTT_CLIENTS callbacks defined");
|
||||
|
||||
/*********************************************************************//**
|
||||
56
porttrigger/Makefile
Normal file
56
porttrigger/Makefile
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# Copyright (C) 2021-2023 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=porttrigger
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
LOCAL_DEV:=1
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/port-trigger.git
|
||||
PKG_SOURCE_VERSION:=
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/porttrigger
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Port Trigger Daemon
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/porttrigger/description
|
||||
Manage port trigger
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./port-trigger/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/porttrigger/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/lib/porttrigger
|
||||
|
||||
$(INSTALL_BIN) ./files/etc/init.d/porttrigger $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/porttrigger $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/lib/port_trigger.sh $(1)/lib/porttrigger/
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/bbf_plugin/libporttrigger.so)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,porttrigger))
|
||||
1
porttrigger/files/etc/config/porttrigger
Normal file
1
porttrigger/files/etc/config/porttrigger
Normal file
@@ -0,0 +1 @@
|
||||
#port trigger uci file
|
||||
20
porttrigger/files/etc/init.d/porttrigger
Normal file
20
porttrigger/files/etc/init.d/porttrigger
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=65
|
||||
STOP=20
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/porttrigger/port_trigger.sh
|
||||
|
||||
start_service() {
|
||||
port_trigger_handling
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "firewall"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
start
|
||||
}
|
||||
99
porttrigger/files/lib/port_trigger.sh
Executable file
99
porttrigger/files/lib/port_trigger.sh
Executable file
@@ -0,0 +1,99 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
process_port_trigger() {
|
||||
local rule_id="$1"
|
||||
local is_enabled=""
|
||||
local duration=""
|
||||
local trigger_dport=""
|
||||
local trigger_dport_end=""
|
||||
local protocol=""
|
||||
local interface=""
|
||||
local open_dport=""
|
||||
local open_dport_end=""
|
||||
local open_protocol=""
|
||||
local ptg_id=""
|
||||
|
||||
config_get ptg_id "$rule_id" "dm_parent"
|
||||
|
||||
is_enabled=$(uci -q get porttrigger."$ptg_id".enable)
|
||||
|
||||
if [ -z "$is_enabled" ] || [ "$is_enabled" = "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
IP_RULE=""
|
||||
protocol=$(uci -q get porttrigger."$ptg_id".protocol)
|
||||
[ -z "$protocol" ] && return
|
||||
|
||||
if [ "$protocol" = "UDP" ] || [ "$protocol" = "udp" ]; then
|
||||
IP_RULE="$IP_RULE -p udp"
|
||||
elif [ "$protocol" = "TCP" ] || [ "$protocol" = "tcp" ]; then
|
||||
IP_RULE="$IP_RULE -p tcp"
|
||||
else
|
||||
return
|
||||
fi
|
||||
|
||||
trigger_dport=$(uci -q get porttrigger."$ptg_id".port)
|
||||
[ -z "$trigger_dport" ] && return
|
||||
IP_RULE="$IP_RULE --dport $trigger_dport"
|
||||
|
||||
trigger_dport_end=$(uci -q get porttrigger."$ptg_id".end_port_range)
|
||||
if [ -n "$trigger_dport_end" ]; then
|
||||
IP_RULE="$IP_RULE:$trigger_dport"
|
||||
fi
|
||||
|
||||
config_get open_protocol "$rule_id" "protocol"
|
||||
if [ "$open_protocol" = "UDP" ] || [ "$open_protocol" = "udp" ]; then
|
||||
IP_RULE="$IP_RULE -j TRIGGER --trigger-type out --trigger-proto udp"
|
||||
elif [ "$open_protocol" = "TCP" ] || [ "$open_protocol" = "tcp" ]; then
|
||||
IP_RULE="$IP_RULE -j TRIGGER --trigger-type out --trigger-proto tcp"
|
||||
else
|
||||
return
|
||||
fi
|
||||
|
||||
config_get open_dport "$rule_id" "port"
|
||||
[ -z "$open_dport" ] && return
|
||||
IP_RULE="$IP_RULE --trigger-match $open_dport"
|
||||
|
||||
config_get open_dport_end "$rule_id" "end_port_range"
|
||||
if [ -z "$open_dport_end" ]; then
|
||||
IP_RULE="$IP_RULE --trigger-relate $open_dport"
|
||||
else
|
||||
IP_RULE="$IP_RULE-$open_dport_end --trigger-relate $open_dport-$open_dport_end"
|
||||
fi
|
||||
|
||||
duration=$(uci -q get porttrigger."$ptg_id".auto_disable_duration)
|
||||
if [ -n "$duration" ]; then
|
||||
IP_RULE="$IP_RULE --trigger-timeout $duration"
|
||||
fi
|
||||
|
||||
interface=$(uci -q get porttrigger."$ptg_id".src)
|
||||
[ -z "$interface" ] && return
|
||||
device=$(uci show network | grep -w "name='.*$interface'" | cut -d'.' -f2)
|
||||
ports=$(uci -q get network."$device".ports)
|
||||
for port in ${ports}; do
|
||||
IP_RULE_1="iptables -t nat -A prerouting_porttrigger -i $port $IP_RULE"
|
||||
echo "$IP_RULE_1">>/tmp/port_trigger_iptables
|
||||
done
|
||||
}
|
||||
|
||||
port_trigger_handling() {
|
||||
rm /tmp/port_trigger_iptables
|
||||
iptables -w -t nat -F prerouting_porttrigger
|
||||
|
||||
touch /tmp/port_trigger_iptables
|
||||
prerouting_porttrigger=$(iptables -t nat --list | grep prerouting_porttrigger)
|
||||
if [ -z "$prerouting_porttrigger" ]; then
|
||||
iptables -w -t nat -N prerouting_porttrigger
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t nat -I PREROUTING -j prerouting_porttrigger
|
||||
fi
|
||||
|
||||
# Load /etc/config/porttrigger UCI file
|
||||
config_load porttrigger
|
||||
config_foreach process_port_trigger rule
|
||||
|
||||
sh /tmp/port_trigger_iptables
|
||||
}
|
||||
@@ -15,6 +15,14 @@ include /lib/ethernet
|
||||
. /lib/qos/shaper.sh
|
||||
. /lib/qos/airoha.sh
|
||||
|
||||
get_rate_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
get_burst_size_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
# marking value be decimal for linux target as it uses set-mark whereas other
|
||||
# targets uses set-xmark, hence this function can't make it common
|
||||
ip_rule_get_converted_tos() {
|
||||
|
||||
@@ -34,6 +34,14 @@ get_port_number() {
|
||||
done
|
||||
}
|
||||
|
||||
get_rate_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
get_burst_size_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
# Function to handle a queue order and
|
||||
# update total number of queues
|
||||
handle_q_order() {
|
||||
|
||||
@@ -31,8 +31,8 @@ generate_queue(){
|
||||
uci set qos.@queue[-1].ifname="$ifname"
|
||||
uci set qos.@queue[-1].precedence="$order"
|
||||
uci set qos.@queue[-1].scheduling="SP"
|
||||
uci set qos.@queue[-1].rate="0"
|
||||
uci set qos.@queue[-1].burst_size="0"
|
||||
uci set qos.@queue[-1].rate=$(get_rate_per_queue)
|
||||
uci set qos.@queue[-1].burst_size=$(get_burst_size_per_queue)
|
||||
uci set qos.@queue[-1].weight="1"
|
||||
done
|
||||
|
||||
|
||||
@@ -15,6 +15,14 @@ Q_COUNT=0
|
||||
SP_Q_PRIO=7
|
||||
SOQ_wgt=0
|
||||
|
||||
get_rate_per_queue() {
|
||||
echo "1000000"
|
||||
}
|
||||
|
||||
get_burst_size_per_queue() {
|
||||
echo "1500"
|
||||
}
|
||||
|
||||
get_max_burst_size_per_queue() {
|
||||
# maximum burst size for tc class
|
||||
echo "4289999999"
|
||||
@@ -133,11 +141,10 @@ handle_queue() {
|
||||
config_get sc_alg "$qid" "scheduling"
|
||||
config_get wgt "$qid" "weight" 1
|
||||
config_get rate "$qid" "rate"
|
||||
config_get bs "$qid" "burst_size" 1500
|
||||
config_get bs "$qid" "burst_size"
|
||||
config_get qsize "$qid" "queue_size" 1024
|
||||
|
||||
[ "$rate" == "0" ] && rate="$port_bw"
|
||||
[ "$bs" == "0" ] && bs=1500
|
||||
|
||||
bs=$(( bs * 8 ))
|
||||
rate_bs=$(( rate * 25 ))
|
||||
@@ -398,20 +405,18 @@ pre_configure_queue() {
|
||||
}
|
||||
|
||||
get_link_rate() {
|
||||
local ifname="$1"
|
||||
local phycap="$(ethtool $ifname | grep -A 10 "Supported link modes" | grep 00 | tail -n 1 | awk '{print$NF}')"
|
||||
local speed=1000
|
||||
intf="$1"
|
||||
speed=1000
|
||||
|
||||
# Get the max capability of this port
|
||||
case "$phycap" in
|
||||
10000*) speed=10000 ;;
|
||||
5000*) speed=5000 ;;
|
||||
2500*) speed=2500 ;;
|
||||
1000*) speed=1000 ;;
|
||||
100*) speed=100 ;;
|
||||
10*) speed=10 ;;
|
||||
*) speed=1000 ;;
|
||||
esac
|
||||
if [ -d "/sys/class/net/$intf/" ]; then
|
||||
speed=$(cat /sys/class/net/$intf/speed 2>/dev/null)
|
||||
[ -z "$speed" ] & speed=1000
|
||||
fi
|
||||
|
||||
if [ $speed -le 0 ]; then
|
||||
# assuming default 1000
|
||||
speed=1000
|
||||
fi
|
||||
|
||||
echo "$speed"
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-base
|
||||
PKG_VERSION:=3.1.53
|
||||
PKG_VERSION:=3.1.45
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=0108f9c192a168936ee223dbf4d85a7ceba7093d
|
||||
PKG_SOURCE_VERSION:=9f3525957ac203c8900996c467032c2be6343ae5
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
SULU_MOD:=core
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-builder
|
||||
PKG_VERSION:=3.1.53
|
||||
PKG_VERSION:=3.1.45
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
|
||||
PKG_SOURCE_VERSION:=5d0336f678a116cdf4c73fec7c0d8ab06c0f65d6
|
||||
PKG_SOURCE_VERSION:=32f297540eca2d80aea425968d3503b3c41d86eb
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/sulu-$(PKG_VERSION)/sulu-builder-$(PKG_SOURCE_VERSION)
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-lcm
|
||||
PKG_VERSION:=3.1.52
|
||||
PKG_VERSION:=3.1.27
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-lcm.git
|
||||
PKG_SOURCE_VERSION:=af612edb4ea186d9c71fc2157883bf686b14e376
|
||||
PKG_SOURCE_VERSION:=6b1d30d7918adeb19c5177dd7c5472cb0dac9896
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-multi-ap
|
||||
PKG_VERSION:=3.1.52
|
||||
PKG_VERSION:=3.1.42
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-multi-ap.git
|
||||
PKG_SOURCE_VERSION:=ac4a73768844796be5678559b64269e6fe073192
|
||||
PKG_SOURCE_VERSION:=e209cbc04a92494b96c74cee443e1b385c6687fe
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-parental-control
|
||||
PKG_VERSION:=3.1.52
|
||||
PKG_VERSION:=3.1.38
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-parental-control.git
|
||||
PKG_SOURCE_VERSION:=e1c5b4473fba9d42ef7d1e95e634416585bf5887
|
||||
PKG_SOURCE_VERSION:=dd9dab9fb8aca87991cd2cc02c5fedd8baee3b97
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.5.5
|
||||
PKG_VERSION:=2.5.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
|
||||
PKG_SOURCE_VERSION:=723d3597ef0f1b20fd3212b3e1ced3242f2491f1
|
||||
PKG_SOURCE_VERSION:=80d8a2f0dddc8e1575c0a6dee1e496c52104d033
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -22,20 +22,20 @@ validate_globals_section()
|
||||
}
|
||||
|
||||
start_lxc_container() {
|
||||
local root_dir
|
||||
local root
|
||||
|
||||
config_get name "${1}" name ""
|
||||
config_get type "${1}" type ""
|
||||
config_get autostart "${1}" autostart "0"
|
||||
config_get timeout "${1}" timeout "300"
|
||||
root_dir="${2}"
|
||||
root="${2}"
|
||||
|
||||
if [ -z "${name}" ] || [ -z "${type}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# workaround to install lxc container with installdu and autostart them
|
||||
if [ -f "${root_dir}/$name/config" ]; then
|
||||
if [ -f "${root}/$name/config" ]; then
|
||||
type=lxc
|
||||
fi
|
||||
|
||||
@@ -81,29 +81,31 @@ start_service() {
|
||||
local enabled debug log_level sock root
|
||||
|
||||
config_load swmodd
|
||||
|
||||
validate_globals_section || {
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ "${enabled}" -eq 0 ] && return 0
|
||||
|
||||
# crun default runtime directory /run, if not present then create
|
||||
[ ! -d "/run" ] && ln -fs /var/run /run
|
||||
if [ ! -d "${root}" ]; then
|
||||
log "# Not staring root [${root}] not present/defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -d "${root}" ]; then
|
||||
log "# root [${root}] not present, creating ..."
|
||||
if [ -n "${root}" ]; then
|
||||
mkdir -p "${root}"
|
||||
else
|
||||
log "# Not starting, root [${root}] not defined"
|
||||
return 1
|
||||
env_name=""
|
||||
execenvs=$(uci show swmodd | grep "=execenv" | cut -d'=' -f 1 | cut -d'.' -f 2)
|
||||
for env in ${execenvs}; do
|
||||
name=$(uci get swmodd.${env}.name)
|
||||
if [ -n "${name}" ]; then
|
||||
env_name="${name}"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Currently only one execenv supported
|
||||
env_name="$(uci -q get swmodd.@execenv[0].name)"
|
||||
if [ -z "${env_name}" ]; then
|
||||
log "# Not starting, execenv name [${env_name}] not defined"
|
||||
log "# Not starting execenv name [${env_name}] not defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -113,14 +115,10 @@ start_service() {
|
||||
fi
|
||||
|
||||
bundle_root="${bundle_root}${env_name}"
|
||||
if [ ! -d "${bundle_root}" ]; then
|
||||
if [ -n "${bundle_root}" ]; then
|
||||
mkdir -p "${bundle_root}"
|
||||
else
|
||||
log "# Not starting, execenv [${bundle_root}] not defined"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
if [ ! -d "${bundle_root}" ]; then
|
||||
log "# Not staring execenv [${bundle_root}] not present"
|
||||
return 1
|
||||
fi
|
||||
|
||||
procd_open_instance swmodd
|
||||
procd_set_param command ${PROG}
|
||||
@@ -156,5 +154,5 @@ reload_service() {
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "swmodd"
|
||||
procd_add_reload_trigger "swmodd"
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=testnet
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/testnet
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Check WAN IP Connection
|
||||
DEPENDS:=+ndisc6
|
||||
endef
|
||||
|
||||
define Package/testnet/description
|
||||
Check WAN IP connection
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/testnet/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,testnet))
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=21
|
||||
STOP=10
|
||||
USE_PROCD=1
|
||||
|
||||
TESTNET=$(which testnet)
|
||||
|
||||
start_service() {
|
||||
# do not start testnet if the feature is explicitly disabled
|
||||
[ "$(uci -q get testnet.global.enabled)" = "0" ] && return 0
|
||||
|
||||
[ -n "$TESTNET" ] && {
|
||||
procd_open_instance
|
||||
procd_set_param command "$TESTNET"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
[ -n "$TESTNET" ] && procd_running testnet && "$TESTNET" once
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
config TR104_RUNAS_BBFDM_MICROSERVICE
|
||||
bool "Use bbfdmd datamodel microservice to run tr104, preferred if TR104 and BBFDMD are on different base"
|
||||
depends on PACKAGE_tr104
|
||||
default y
|
||||
default n
|
||||
|
||||
config TR104_VENDOR_EXTENSIONS
|
||||
bool "Use TR104 vendor extensions"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tr104
|
||||
PKG_VERSION:=1.0.21
|
||||
PKG_VERSION:=1.0.14
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifeq ($(LOCAL_DEV),0)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/voice/tr104.git
|
||||
PKG_SOURCE_VERSION:=666b47da19fac73f43fc04722a21fde9decc1fdb
|
||||
PKG_SOURCE_VERSION:=fa19217fbd589d064e1f32ec20d0df53e31fb610
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -32,7 +32,7 @@ define Package/$(PKG_NAME)
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=TR104 Datamodel Daemon
|
||||
MENU:=1
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +asterisk +libcurl +PACKAGE_libbbfdm-api:libbbfdm-api
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +asterisk
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
@@ -54,7 +54,7 @@ CMAKE_OPTIONS += \
|
||||
-DTR104_EXTENSION_DIR:String="iowrt"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TR104_RUNAS_BBFDM_MICROSERVICE),y)
|
||||
ifeq ($(CONFIG_RUNAS_BBFDM_MICROSERVICE),y)
|
||||
MAKE_PATH:=libdm
|
||||
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/libbbfdm-api
|
||||
CMAKE_OPTIONS += -DRUNAS_BBFDM_MICROSERVICE:BOOL=ON
|
||||
@@ -76,7 +76,7 @@ define Package/$(PKG_NAME)/install
|
||||
ifeq ($(CONFIG_TR104_VENDOR_EXTENSIONS),y)
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libdm/extensions/iowrt/libtr104ext.so $(1)/etc/tr104/plugins/
|
||||
endif
|
||||
ifeq ($(CONFIG_TR104_RUNAS_BBFDM_MICROSERVICE),y)
|
||||
ifeq ($(CONFIG_RUNAS_BBFDM_MICROSERVICE),y)
|
||||
$(INSTALL_BIN) ./files/etc/init.d/tr104d.bbfdm $(1)/etc/init.d/tr104d
|
||||
else
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2023 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=userinterface
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/userinterface
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Package to add Device.UserInterface. datamodel support using bbfdm
|
||||
endef
|
||||
|
||||
define Package/userinterface/description
|
||||
Package to add Device.UserInterface. datamodel support
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
# Pass
|
||||
endef
|
||||
|
||||
define Package/userinterface/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DATA) ./files/etc/config/userinterface $(1)/etc/config/userinterface
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/userinterface $(1)/lib/upgrade/keep.d/userinterface
|
||||
$(INSTALL_BIN) ./files/etc/init.d/userinterface $(1)/etc/init.d/userinterface
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/93-userinterface-firewall $(1)/etc/uci-defaults/93-userinterface-firewall
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/94-userinterface-json $(1)/etc/uci-defaults/94-userinterface-json
|
||||
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,userinterface))
|
||||
@@ -1,9 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2023 IOPSYS
|
||||
#
|
||||
|
||||
|
||||
define BbfdmInstallPlugin
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
|
||||
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
|
||||
endef
|
||||
@@ -6,11 +6,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usp-js
|
||||
PKG_VERSION:=1.2.4
|
||||
PKG_VERSION:=1.2.3
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/usp-js.git
|
||||
PKG_SOURCE_VERSION:=0cb6c0ce635918cd7f73bb22c924d432dfcab647
|
||||
PKG_SOURCE_VERSION:=61cf7adb3258820f12f5dc02c69c5bdd612ed4cd
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -23,7 +23,7 @@ define Package/usp-js
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=A JS library for USP(TR369) protocol
|
||||
DEPENDS:=+quickjs +quickjs-websocket +@OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
DEPENDS:=+quickjs +quickjs-websocket
|
||||
EXTRA_DEPENDS:=obuspa mosquitto-ssl
|
||||
endef
|
||||
|
||||
|
||||
59
usp-js/files/etc/uci-defaults/10-add-obuspa-test-config
Executable file
59
usp-js/files/etc/uci-defaults/10-add-obuspa-test-config
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
if [ ! -f "/etc/config/obuspa" ]; then
|
||||
echo "Local obuspa not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/config/mosquitto" ]; then
|
||||
echo "Local mosquitto broker not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
add_obuspa_test_mtp()
|
||||
{
|
||||
uci_add obuspa mtp test_mtp
|
||||
uci_set obuspa test_mtp Protocol 'MQTT'
|
||||
uci_set obuspa test_mtp ResponseTopicConfigured '/usp/endpoint'
|
||||
uci_set obuspa test_mtp mqtt 'testmqtt'
|
||||
}
|
||||
|
||||
add_obuspa_test_mqtt()
|
||||
{
|
||||
# Adds Device.MQTT.Client.
|
||||
uci_add obuspa mqtt testmqtt
|
||||
uci_set obuspa testmqtt BrokerAddress '127.0.0.1'
|
||||
uci_set obuspa testmqtt BrokerPort '1883'
|
||||
uci_set obuspa testmqtt TransportProtocol 'TCP/IP'
|
||||
}
|
||||
|
||||
add_obuspa_test_controller()
|
||||
{
|
||||
# Adds Device.LocalAgent.Controller.
|
||||
uci_add obuspa controller testcontroller
|
||||
uci_set obuspa testcontroller EndpointID 'proto::interop-usp-controller'
|
||||
uci_set obuspa testcontroller Protocol 'MQTT'
|
||||
uci_set obuspa testcontroller Topic '/usp/controller'
|
||||
uci_set obuspa testcontroller mqtt 'testmqtt'
|
||||
uci_set obuspa testcontroller assigned_role_name 'full_access'
|
||||
}
|
||||
|
||||
add_obuspa_config()
|
||||
{
|
||||
uci_add mosquitto listener obuspa
|
||||
uci_set mosquitto obuspa enabled 1
|
||||
uci_set mosquitto obuspa port '1883'
|
||||
uci_set mosquitto obuspa no_remote_access '1'
|
||||
uci_set mosquitto obuspa allow_anonymous '1'
|
||||
}
|
||||
|
||||
# Add local controller for usp-js
|
||||
uci_load mosquitto
|
||||
add_obuspa_config
|
||||
|
||||
uci_load obuspa
|
||||
add_obuspa_test_mtp
|
||||
add_obuspa_test_mqtt
|
||||
add_obuspa_test_controller
|
||||
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=voicemngr
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.8
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -19,7 +19,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=c6c95fafefc39705217afd6743ab1da2a14ac417
|
||||
PKG_SOURCE_VERSION:=25571796f18c91a2070f98881bd1205f15575fea
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=16.2.11
|
||||
PKG_VERSION:=16.2.3
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=646887db86a4e115455f5bf78d05540f21e76be7
|
||||
PKG_SOURCE_VERSION:=3e5799f9cae80b3f9a1bc1fa6503020005f76aa9
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
Reference in New Issue
Block a user