From 8482cb4ddc36af522d31ef6bb6c5a0131cba19db Mon Sep 17 00:00:00 2001 From: Vivek Kumar Dutta Date: Mon, 11 Mar 2024 12:10:38 +0530 Subject: [PATCH] icwmp: run datamodel with micro-service --- icwmp/Makefile | 6 ++++-- icwmp/files/etc/icwmpd/input.json | 16 ++++++++++++++++ icwmp/files/etc/init.d/icwmpd | 4 ++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 icwmp/files/etc/icwmpd/input.json diff --git a/icwmp/Makefile b/icwmp/Makefile index c357e3a5a..c61915141 100755 --- a/icwmp/Makefile +++ b/icwmp/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=icwmp -PKG_VERSION:=9.7.0 +PKG_VERSION:=9.7.1 LOCAL_DEV:=0 ifneq ($(LOCAL_DEV),1) @@ -48,6 +48,7 @@ define Package/icwmp/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/lib/upgrade/keep.d $(INSTALL_DIR) $(1)/etc/udhcpc.user.d + $(INSTALL_DIR) $(1)/etc/icwmpd/plugins $(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd $(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp $(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp @@ -58,8 +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 + $(INSTALL_BIN) ./files/etc/icwmpd/input.json $(1)/etc/icwmpd/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/libcwmpdm.so $(1)/etc/icwmpd/ $(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/CWMPManagementServer.json) - $(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libcwmpdm.so) endef $(eval $(call BuildPackage,icwmp)) diff --git a/icwmp/files/etc/icwmpd/input.json b/icwmp/files/etc/icwmpd/input.json new file mode 100644 index 000000000..b169472ad --- /dev/null +++ b/icwmp/files/etc/icwmpd/input.json @@ -0,0 +1,16 @@ +{ + "daemon": { + "input": { + "type": "DotSo", + "name": "/etc/icwmpd/libcwmpdm.so", + "plugin_dir": "/etc/icwmpd/plugins/" + }, + "output": { + "type": "UBUS", + "name": "bbfdm.cwmp", + "parent_dm": "Device.", + "multiple_objects": [ "ManagementServer", "XMPP" ], + "root_obj": "bbfdm" + } + } +} diff --git a/icwmp/files/etc/init.d/icwmpd b/icwmp/files/etc/init.d/icwmpd index baae7a54d..605c81346 100755 --- a/icwmp/files/etc/init.d/icwmpd +++ b/icwmp/files/etc/init.d/icwmpd @@ -6,9 +6,12 @@ STOP=00 USE_PROCD=1 PROG="/usr/sbin/icwmpd" +CWMP_INPUT_JSON="/etc/icwmpd/input.json" . /lib/functions.sh . /usr/share/libubox/jshn.sh +. /etc/bbfdm/bbfdm_services.sh + include /lib/network log() { @@ -514,6 +517,7 @@ boot() { } start_service() { + bbfdm_add_service "bbfdm.cwmp" "${CWMP_INPUT_JSON}" procd_open_instance icwmp