Compare commits

...

1 Commits

Author SHA1 Message Date
Vivek Kumar Dutta
74f11c7b74 bbfdm: unified path for services 2024-04-10 09:44:47 +05:30
46 changed files with 209 additions and 266 deletions

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.7.28
PKG_VERSION:=1.8.0
USE_LOCAL:=0
ifneq ($(USE_LOCAL),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=fd894e7cb7bfaf695f6dccc996478589f162d38b
PKG_SOURCE_VERSION:=f64c33163742fb1b379952ea8ae34dac677f5e57
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -107,7 +107,8 @@ define Package/libbbfdm/install
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(CP) $(PKG_BUILD_DIR)/libbbfdm/libbbfdm.so $(1)/lib/
$(INSTALL_DIR) $(1)/usr/share/bbfdm/
$(CP) $(PKG_BUILD_DIR)/libbbfdm/libbbfdm.so $(1)/usr/share/bbfdm/libbbfdm.so
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
$(INSTALL_BIN) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/95-portmap-firewall
$(INSTALL_BIN) ./files/etc/uci-defaults/97-firewall-service $(1)/etc/uci-defaults/97-firewall-service
@@ -117,13 +118,13 @@ define Package/libbbfdm/install
$(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
$(call BbfdmInstallCorePlugin, $(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/iopsys/libbbfdm_iopsys_ext.so, $(1))
endif
ifeq ($(CONFIG_BBF_TR143),y)
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts/
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(CP) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
$(CP) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm/scripts/
$(LN) /usr/share/bbfdm/scripts/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
endif
endef

View File

@@ -38,77 +38,3 @@ $ echo -n "Sup3rS3cur3Passw0rd" | sha512sum
bbfdm provides a helper utility [bbfdm.mk](./bbfdm.mk) to install datamodel plugins in bbfdm core or in microservice directory.
### Install datamodel DotSO/JSON plugin in bbfdm core
Utility to install the DotSO/JSON plugin in bbfdm core plugin path
```bash
# inputs:
# $1 => package install directory
# $2 => Plugin artifact
```
Example:
```make
define Package/$(PKG_NAME)/install
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/CWMPManagementServer.json)
endef
```
### Install datamodel DotSO/JSON plugin in bbfdm core with priority
Its now possible to overwrite/remove core datamodel with plugin, so, if some datamodel objects/parameters are present in more than one plugin, order in which they loaded into memory becomes crucial, this Utility help to configure a priority order in which they gets loaded in memory.
```bash
# inputs:
# $1 => package install directory
# $2 => Priority of the installed plugin
# $3 => Plugin artifact
```
Example:
```make
define Package/$(PKG_NAME)/install
$(call BbfdmInstallPluginWithPriority,$(1),01,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
endef
```
> Note: Last loaded plugin gets the highest priority
### Install plugin into micro-service directory
Utility to install the plugin in datamodel microservice directory, ex. user wants to run a datamodel micro-service, it required to install the DotSO/JSON plugin into a non bbf core directory, this utility helps in installing the DotSO/JSON plugin in mentioned directory.
```bash
# inputs:
# $1 => package install directory with micro-service directory
# $2 => Plugin artifact
```
Example:
```make
define Package/$(PKG_NAME)/install
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/bulkdata,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
endef
```
### Install datamodel micro-service input file
Utility to install the datamodel plugin input file into the bbfdm micro-service directory, so that bbfdm auto start the datamodel micro-service before main bbfdm process.
```bash
# inputs:
# $1 => package install directory
# $2 => Microservice input.json path
```
Example:
```make
define Package/$(PKG_NAME)/install
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bulkdata/input.json)
endef
```

View File

@@ -2,56 +2,107 @@
# Copyright (C) 2023 IOPSYS
#
BBFDM_BASE_DM_PATH=/usr/share/bbfdm
# Utility to install the plugin in bbfdm core path
# inputs:
# $1 => package install directory
# $2 => Plugin artifact
# $1 => Plugin artifact
# $2 => package install directory
#
# Example:
# $(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/CWMPManagementServer.json)
# $(call BbfdmInstallCorePlugin, ./files/etc/bbfdm/json/CWMPManagementServer.json, $(1))
#
define BbfdmInstallPlugin
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
define BbfdmInstallCorePlugin
$(INSTALL_DIR) $(strip $(2))$(BBFDM_BASE_DM_PATH)/plugins
$(INSTALL_DATA) $(1) $(strip $(2))$(BBFDM_BASE_DM_PATH)/plugins/
endef
# Utility to install the plugin in bbfdm core path with priority
# Utility to install the plugin in bbfdm core path with priority.
# Its now possible to overwrite/remove core datamodel with plugin, so, if some
# datamodel objects/parameters are present in more than one plugin, order in
# which they loaded into memory becomes crucial, this Utility help to configure
# a priority order in which they gets loaded in memory.
#
# inputs:
# $1 => package install directory
# $2 => Priority of the installed plugin
# $3 => Plugin artifact
# $1 => Plugin artifact
# $2 => package install directory
# $3 => Priority of the installed plugin
#
# Note:
# - Last loaded plugin gets the highest priority
#
# Example:
# $(call BbfdmInstallPluginWithPriority,$(1),01,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
# $(call BbfdmInstallCorePluginPriority, $(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json, $(1), 01)
#
define BbfdmInstallPluginWithPriority
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
$(INSTALL_DATA) $(3) $(1)/etc/bbfdm/plugins/$(2)_$(shell basename ${3})
endef
# Utility to install the plugin in datamodel microservice directory
# inputs:
# $1 => package install directory with micro-service directory
# $2 => Plugin artifact
#
# Example:
# $(call BbfdmInstallPluginInMicroservice,$(1)/etc/bulkdata,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
#
define BbfdmInstallPluginInMicroservice
$(INSTALL_DIR) $(1)
$(INSTALL_DATA) $(2) $(1)/
define BbfdmInstallCorePluginPriority
$(INSTALL_DIR) $(strip $(2))$(BBFDM_BASE_DM_PATH)/plugins
$(INSTALL_DATA) $(1) $(strip $(2))$(BBFDM_BASE_DM_PATH)/plugins/$(strip $(3))_$(notdir $(strip $(1)))
endef
# Utility to install the datamodel plugin input file
# inputs:
# $1 => package install directory
# $2 => Microservice input.json path
# $1 => Microservice input.json path
# $2 => package install directory
#
# Example:
# $(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bulkdata/input.json)
# $(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/bulkdata/input.json, $(1))
#
define BbfdmInstallMicroServiceInputFile
$(INSTALL_DIR) $(1)/etc/bbfdm/micro_services
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/micro_services/$(PKG_NAME).json
define BbfdmInstallMicroServiceDMInputFile
$(INSTALL_DIR) $(strip $(2))/etc/bbfdm/micro_services
$(INSTALL_DATA) $(1) $(strip $(2))/etc/bbfdm/micro_services/$(PKG_NAME).json
endef
# Utility to install the main plugin in bbfdm service directory, ex.
# user wants to run a datamodel micro-service, it required to install the
# DotSO/JSON plugin into a bbf shared directory, this utility helps in
# installing the DotSO/JSON plugin in bbfdm shared directory.
#
# inputs:
# $1 => DotSo or Json plugin with complete path
# $2 => package install directory
#
# Note:
# - There could be only one main plugin file, so its bind to PKG_NAME
#
# Example:
# $(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/libcwmp.so, $(1))
#
define BbfdmInstallMicroServiceDM
$(INSTALL_DIR) $(strip $(2))$(BBFDM_BASE_DM_PATH)/micro_services
$(INSTALL_DATA) $(1) $(strip $(2))$(BBFDM_BASE_DM_PATH)/micro_services/$(strip $(PKG_NAME))$(suffix $(strip $(1)))
endef
# Utility to install the plugins and datamodel extensions inside a microservice plugin directory
# inputs:
# $1 => package install directory
# $2 => DotSo or Json datamodel plugin/extension with complete path
# $3 => service name
#
# Note:
# - Use the service_name/PKG_NAME of the service in which this has to run
#
# Example:
# $(call BbfdmInstallMicroServicePlugin, $(PKG_BUILD_DIR)/libxmpp.so, $(1), icwmp)
#
define BbfdmInstallMicroServicePlugin
$(INSTALL_DIR) $(strip $(2))$(BBFDM_BASE_DM_PATH)/micro_services/$(strip $(3))
$(INSTALL_DATA) $(1) $(strip $(2))$(BBFDM_BASE_DM_PATH)/micro_services/$(strip $(3))/
endef
# Deprecated functions errors
define BbfdmInstallPluginInMicroservice
$(error # BbfdmInstallPluginInMicroservice is deprecated, use BbfdmInstallMicroServiceDM or BbfdmInstallMicroServicePlugin #)
endef
define BbfdmInstallMicroServiceInputFile
$(error # BbfdmInstallMicroServiceInputFile deprecated, use BbfdmInstallMicroServiceDMInputFile #)
endef
define BbfdmInstallPlugin
$(error # BbfdmInstallPlugin deprecated, use BbfdmInstallCorePlugin #)
endef
define BbfdmInstallPluginWithPriority
$(error # BbfdmInstallPluginWithPriority deprecated, use BbfdmInstallCorePluginPriority #)
endef

View File

@@ -4,8 +4,8 @@
},
"input": {
"type": "DotSo",
"name": "/lib/libbbfdm.so",
"plugin_dir": "/etc/bbfdm/plugins"
"name": "/usr/share/bbfdm/libbbfdm.so",
"plugin_dir": "/usr/share/bbfdm/plugins"
},
"output": {
"type": "UBUS",

View File

@@ -36,22 +36,25 @@ validate_bbfdm_micro_service_section()
'enable_respawn:bool:true'
}
bbfdm_add_micro_service()
_add_microservice()
{
local name path cmd
local enable enable_core enable_respawn
validate_bbfdm_micro_service_section || {
log "Validation of micro_service section failed"
return 1;
}
[ "${enable}" -eq "0" ] && return 0
# Check enable from micro-service
path="${1}"
enable_respawn="${2}"
enable_core="${3}"
name="$(basename ${path})"
name="${name//.json}"
enable="$(jq '.daemon.enable//1' ${path})"
if [ "${enable}" -eq "0" ]; then
log "datamodel micro-service ${name} not enabled"
return 0
fi
json_init
json_add_string name "bbfdm.services"
json_add_object "instances"
@@ -59,7 +62,7 @@ bbfdm_add_micro_service()
json_add_array "command"
json_add_string "" "${PROG}"
json_add_string "" "-m"
json_add_string "" "${path}"
json_add_string "" "${name}"
json_close_array
if [ "${enable_core}" -eq "1" ]; then
@@ -84,30 +87,24 @@ bbfdm_add_micro_service()
ubus call service add "${cmd}"
}
_add_microservice()
{
local enable loglevel input_json name
name="${1}"
input_json="$(jq -r '.daemon.input.name' ${name})"
if [ -f "${input_json}" ]; then
bbfdm_add_micro_service "${name}"
else
log "Input json [${input_json}] does not defined/present"
fi
}
configure_bbfdm_micro_services()
{
local enable enable_core enable_respawn
validate_bbfdm_micro_service_section || {
log "Validation of micro_service section failed"
return 1;
}
[ "${enable}" -eq "0" ] && return 0
if [ -d "${BBFDM_MICROSERVICE_DIR}" ]; then
FILES="$(ls -1 ${BBFDM_MICROSERVICE_DIR}/*.json)"
for service in $FILES;
do
[ -e "$service" ] || continue
_add_microservice $service
_add_microservice $service "${enable_respawn}" "${enable_core}"
done
fi
ubus call service state '{"name":"bbfdm.services", "spawn":true}'

View File

@@ -1,6 +1,6 @@
#!/bin/sh
UNIFIED_PATH="/etc/bbfdm/plugins/"
UNIFIED_PATH="/usr/share/bbfdm/plugins/"
# Link JSON plugins
for f in `ls -1 /etc/bbfdm/json/*.json`; do

View File

@@ -52,8 +52,8 @@ define Package/$(PKG_NAME)/install
$(INSTALL_DATA) ./files/etc/config/bulkdata $(1)/etc/config/
$(INSTALL_BIN) ./files/etc/init.d/bulkdatad $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/uci-defaults/95-bulkdata-translation-options $(1)/etc/uci-defaults/
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/bulkdata,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bulkdata/input.json)
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/bulkdata/input.json, $(1))
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "bulkdata",
"config": {
"loglevel": "1"
},
"input": {
"type": "JSON",
"name": "/etc/bulkdata/bulkdata.json"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -49,17 +49,15 @@ 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
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/ddnsmngr,$(PKG_BUILD_DIR)/src/libddnsmngr.so)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/ddnsmngr/input.json)
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/src/libddnsmngr.so, $(1), $(PKG_NAME))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/ddnsmngr/input.json, $(1))
$(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

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "ddnsmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/ddnsmngr/libddnsmngr.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -42,9 +42,8 @@ endef
endif
define Package/dnsmngr/install
$(INSTALL_DIR) $(1)/etc/dnsmngr
$(CP) $(PKG_BUILD_DIR)/src/libdnsmngr.so $(1)/etc/dnsmngr
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/dnsmngr/input.json)
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/src/libdnsmngr.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/dnsmngr/input.json, $(1))
endef
$(eval $(call BuildPackage,dnsmngr))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "dnsmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/dnsmngr/libdnsmngr.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -77,7 +77,7 @@ ifeq ($(CONFIG_TARGET_brcmbca),y)
endif
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dslmngr $(1)/sbin/
$(CP) $(PKG_BUILD_DIR)/libbbfdsl.so $(1)/etc/dsl/
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/libbbfdsl.so, $(1))
endef
$(eval $(call BuildPackage,dslmngr))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "dslmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/dsl/libbbfdsl.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -69,9 +69,9 @@ ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
endif
$(CP) $(PKG_BUILD_DIR)/libbbfethernet.so $(1)/etc/ethmngr
$(CP) $(PKG_BUILD_DIR)/libbbfethernetmacvlan.so $(1)/etc/ethmngr/plugins
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bbfdm/micro_services/ethernet.json)
$(call BbfdmInstallMicroServiceDM,$(PKG_BUILD_DIR)/libbbfethernet.so, $(1))
$(call BbfdmInstallMicroServicePlugin, $(PKG_BUILD_DIR)/libbbfethernetmacvlan.so, $(1), $(PKG_NAME))
$(call BbfdmInstallMicroServiceDMInputFile,./files/etc/bbfdm/micro_services/ethernet.json, $(1))
endef
$(eval $(call BuildPackage,ethmngr))

View File

@@ -1,13 +1,9 @@
{
"daemon": {
"service_name": "ethmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/ethmngr/libbbfethernet.so",
"plugin_dir": "/etc/ethmngr/plugins"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -22,6 +22,7 @@ PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
define Package/hostmngr
@@ -58,13 +59,18 @@ endif
MAKE_PATH:=src
define Package/hostmngr/install
$(CP) ./files/etc $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/hostmngr/
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1)/etc/hostmngr/
$(INSTALL_DIR) $(1)/usr/share/hostmngr
$(INSTALL_DATA) ./files/scripts/hosts_acl.sh $(1)/usr/share/hostmngr/
$(INSTALL_BIN) ./files/scripts/hosts_acl.sh $(1)/usr/share/hostmngr/
$(INSTALL_DATA) ./files/etc/config/hosts $(1)/etc/config/
$(INSTALL_BIN) ./files/etc/init.d/hostmngr $(1)/etc/init.d/
$(INSTALL_BIN) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
$(call BbfdmInstallMicroServiceDMInputFile, ./files/bbfdm/input.json, $(1))
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so, $(1))
endef
ifeq ($(LOCAL_DEV),1)

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "hostmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/hostmngr/libhostmngr.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -59,9 +59,9 @@ define Package/icwmp/install
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/icwmpd,$(PKG_BUILD_DIR)/libcwmpdm.so)
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/icwmpd/plugins,./files/etc/bbfdm/json/CWMPManagementServer.json)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/icwmpd/input.json)
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/libcwmpdm.so, $(1))
$(call BbfdmInstallMicroServicePlugin, ./files/etc/bbfdm/json/CWMPManagementServer.json, $(1), icwmp)
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/icwmpd/input.json, $(1))
endef
$(eval $(call BuildPackage,icwmp))

View File

@@ -1,13 +1,9 @@
{
"daemon": {
"service_name": "icwmp",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/icwmpd/libcwmpdm.so",
"plugin_dir": "/etc/icwmpd/plugins/"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -108,7 +108,7 @@ define Package/obuspa/install
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/02-obuspa-dhcp-option $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/USPAgent.json)
$(call BbfdmInstallCorePlugin, ./files/etc/bbfdm/json/USPAgent.json, $(1))
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/

View File

@@ -20,6 +20,7 @@ PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
define Package/periodicstats
SECTION:=utils
@@ -39,12 +40,14 @@ endef
endif
define Package/periodicstats/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/periodicstatsd $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/periodicstats
$(CP) $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so $(1)/etc/periodicstats
$(INSTALL_DATA) ./files/etc/config/periodicstats $(1)/etc/config/
$(INSTALL_BIN) ./files/etc/init.d/periodicstats $(1)/etc/init.d/
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/bbfdm/micro_services/periodicstats.json, $(1))
endef
$(eval $(call BuildPackage,periodicstats))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "periodicstats",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/periodicstats/libperiodicstats.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -40,8 +40,8 @@ ifneq ($(CONFIG_TARGET_brcmbca),)
else ifneq ($(CONFIG_TARGET_airoha),)
$(CP) ./files/airoha/* $(1)/
endif
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/ponmngr,./files/etc/ponmngr/xpon.json)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/ponmngr/input.json)
$(call BbfdmInstallMicroServiceDM, ./files/etc/ponmngr/xpon.json, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/ponmngr/input.json, $(1))
endef
$(eval $(call BuildPackage,ponmngr))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "ponmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "JSON",
"name": "/etc/ponmngr/xpon.json"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -48,8 +48,8 @@ define Package/port-trigger/install
$(INSTALL_BIN) ./files/etc/init.d/port-trigger $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/port-trigger $(1)/etc/config/
$(INSTALL_DATA) ./files/lib/port-trigger/port_trigger.sh $(1)/lib/port-trigger/
$(call BbfdmInstallPluginInMicroservice, $(1)/etc/port-trigger,$(PKG_BUILD_DIR)/bbf_plugin/libporttrigger.so)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bbfdm/micro_services/port-trigger.json)
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/bbf_plugin/libporttrigger.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/bbfdm/micro_services/port-trigger.json, $(1))
endef
$(eval $(call BuildPackage,port-trigger))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "port-trigger",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/port-trigger/libporttrigger.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.NAT.",

View File

@@ -53,8 +53,8 @@ else
endif
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/qosmngr $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/bbf_plugin/libqos_bbf.so $(1)/etc/qos_bbf
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/common/etc/qos_bbf/input.json)
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/bbf_plugin/libqos_bbf.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/common/etc/qos_bbf/input.json, $(1))
endef
$(eval $(call BuildPackage,qosmngr))

View File

@@ -1,12 +1,11 @@
{
"daemon": {
"input": {
"type": "DotSo",
"name": "/etc/qos_bbf/libqos_bbf.so"
"service_name": "qosmngr",
"config": {
"loglevel": "1"
},
"output": {
"type": "UBUS",
"name": "bbfdm.qos.",
"parent_dm": "Device.",
"object": "QoS",
"root_obj": "bbfdm"

View File

@@ -63,8 +63,8 @@ ifeq ($(CONFIG_SSHMNGR_BACKEND_DROPBEAR),y)
else
$(INSTALL_DATA) ./files/openssh_backend/lib/sshmngr/backend.sh $(1)/lib/sshmngr/
endif
$(call BbfdmInstallPluginInMicroservice, $(1)/etc/sshmngr,$(PKG_BUILD_DIR)/src/libsshmngr.so)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/common/etc/sshmngr/input.json)
$(call BbfdmInstallMicroServiceDM,$(PKG_BUILD_DIR)/src/libsshmngr.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/common/etc/sshmngr/input.json, $(1))
endef
$(eval $(call BuildPackage,sshmngr))

View File

@@ -1,12 +1,11 @@
{
"daemon": {
"input": {
"type": "DotSo",
"name": "/etc/sshmngr/libsshmngr.so"
"service_name": "sshmngr",
"config": {
"loglevel": "1"
},
"output": {
"type": "UBUS",
"name": "bbfdm.ssh.",
"parent_dm": "Device.",
"object": "SSH",
"root_obj": "bbfdm"

View File

@@ -23,6 +23,7 @@ PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
MAKE_PATH:=src
@@ -52,7 +53,7 @@ define Package/stunc/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/stunc $(1)/usr/sbin/
$(INSTALL_BIN) ./files/etc/init.d/stunc $(1)/etc/init.d/stunc
$(INSTALL_DATA) ./files/etc/config/stunc $(1)/etc/config/stunc
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/libstunc.so $(1)/etc/icwmpd/plugins/
$(call BbfdmInstallMicroServicePlugin, $(PKG_BUILD_DIR)/src/libstunc.so, $(1), icwmp)
endef
$(eval $(call BuildPackage,stunc))

View File

@@ -96,8 +96,8 @@ ifeq ($(CONFIG_PACKAGE_crun),y)
$(INSTALL_BIN) ./files/etc/config/crun $(1)/etc/config/crun
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/crun_create $(1)/usr/sbin/crun_create
endif
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/swmodd,$(PKG_BUILD_DIR)/libswmodd.so)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/swmodd/input.json)
$(call BbfdmInstallMicroServiceDM,$(PKG_BUILD_DIR)/libswmodd.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile,./files/etc/swmodd/input.json, $(1))
endef
define Package/swmodd-cgroup/install

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "swmodd",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/swmodd/libswmodd.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -57,8 +57,8 @@ define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/timemngr $(1)/usr/sbin/timemngr
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/timemngr,$(PKG_BUILD_DIR)/src/libtimemngr.so)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/timemngr/input.json)
$(call BbfdmInstallMicroServiceDM,$(PKG_BUILD_DIR)/src/libtimemngr.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile,./files/etc/timemngr/input.json, $(1))
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/21-timemngr $(1)/etc/hotplug.d/iface/
$(INSTALL_BIN) ./files/etc/hotplug.d/ntp/40-firstUseDate $(1)/etc/hotplug.d/ntp/
$(INSTALL_BIN) ./files/etc/init.d/timemngr $(1)/etc/init.d/

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "timemngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/timemngr/libtimemngr.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -72,12 +72,12 @@ define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/tr104/plugins/
$(INSTALL_DIR) $(1)/etc/uci-defaults/
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/tr104,$(PKG_BUILD_DIR)/libdm/tr104/libtr104.so)
$(call BbfdmInstallMicroServiceDM,$(PKG_BUILD_DIR)/libdm/tr104/libtr104.so, $(1))
ifeq ($(CONFIG_TR104_VENDOR_EXTENSIONS),y)
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/tr104/plugins,$(PKG_BUILD_DIR)/libdm/extensions/iowrt/libtr104ext.so)
$(call BbfdmInstallMicroServicePlugin, $(PKG_BUILD_DIR)/libdm/extensions/iowrt/libtr104ext.so, $(1), tr104)
endif
ifeq ($(CONFIG_TR104_RUNAS_BBFDM_MICROSERVICE),y)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/tr104/input.json)
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/tr104/bbfdm_input.json, $(1))
else
$(INSTALL_BIN) ./files/etc/tr104/input.json $(1)/etc/tr104/input.json
$(INSTALL_DIR) $(1)/usr/sbin

View File

@@ -0,0 +1,14 @@
{
"daemon": {
"service_name": "tr104",
"config": {
"loglevel": "1"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.Services.",
"object": "VoiceService",
"root_obj": "bbfdm"
}
}
}

View File

@@ -1,14 +1,12 @@
{
"daemon": {
"config": {
"loglevel": "1",
"refresh_time": "10",
"transaction_timeout": "30"
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/tr104/libtr104.so",
"plugin_dir": "/etc/tr104/plugins/"
"name": "/usr/share/bbfdm/tr104.so",
"plugin_dir": "/usr/share/bbfdm/tr104/"
},
"output": {
"type": "UBUS",

View File

@@ -56,7 +56,7 @@ define Package/$(PKG_NAME)/install
$(INSTALL_BIN) ./files/etc/firewall.twamp $(1)/etc/firewall.twamp
$(INSTALL_BIN) ./files/etc/uci-defaults/92-twampfirewall $(1)/etc/uci-defaults/92-twampfirewall
$(INSTALL_BIN) ./files/etc/uci-defaults/93-twamp_fix_reflector $(1)/etc/uci-defaults/93-twamp_fix_reflector
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libtwamp.so)
$(call BbfdmInstallCorePlugin, $(PKG_BUILD_DIR)/libtwamp.so, $(1))
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -70,7 +70,7 @@ define Package/$(PKG_NAME)-server/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/udpechoserverd $(1)/usr/sbin/
$(INSTALL_DATA) ./files/etc/config/udpechoserver $(1)/etc/config/udpechoserver
$(INSTALL_BIN) ./files/etc/init.d/udpechoserverd $(1)/etc/init.d/udpechoserverd
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libudpechoserver.so)
$(call BbfdmInstallCorePlugin, $(PKG_BUILD_DIR)/src/libudpechoserver.so, $(1))
endef
define Package/$(PKG_NAME)-client/install

View File

@@ -52,8 +52,8 @@ define Package/urlfilter/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/urlfilter $(1)/usr/sbin
$(INSTALL_BIN) ./files/etc/init.d/urlfilter $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/urlfilter $(1)/etc/config/
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/urlfilter,./files/etc/urlfilter/urlfilter.json)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/urlfilter/input.json)
$(call BbfdmInstallMicroServiceDM,./files/etc/urlfilter/urlfilter.json, $(1))
$(call BbfdmInstallMicroServiceDMInputFile,./files/etc/urlfilter/input.json, $(1))
endef
$(eval $(call BuildPackage,urlfilter))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "urlfilter",
"config": {
"loglevel": "1"
},
"input": {
"type": "JSON",
"name": "/etc/urlfilter/urlfilter.json"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -1,9 +0,0 @@
#
# Copyright (C) 2023 IOPSYS
#
define BbfdmInstallPlugin
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
endef

View File

@@ -50,7 +50,7 @@ define Package/usermngr/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/uci-defaults/90-indicate-bootstrap $(1)/etc/uci-defaults/90-indicate-bootstrap
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/uci-defaults/91-sync-shells $(1)/etc/uci-defaults/91-sync-shells
$(INSTALL_BIN) ./files/etc/config/users $(1)/etc/config/users
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libusermngr.so)
$(call BbfdmInstallCorePlugin, $(PKG_BUILD_DIR)/src/libusermngr.so, $(1))
endef
$(eval $(call BuildPackage,usermngr))

View File

@@ -28,6 +28,7 @@ PKG_LICENSE_FILES:=LICENSE
MAKE_PATH:=src
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
define Package/$(PKG_NAME)
SECTION:=utils
@@ -54,9 +55,9 @@ TARGET_CFLAGS += \
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/icwmpd/plugins
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/libxmppc.so $(1)/etc/icwmpd/plugins/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/xmppc $(1)/usr/sbin/
$(CP) ./files/* $(1)/
$(call BbfdmInstallMicroServicePlugin, $(PKG_BUILD_DIR)/src/libxmppc.so, $(1), icwmp)
endef
$(eval $(call BuildPackage,$(PKG_NAME)))