parental-control: Support to define vendor extension

This commit is contained in:
Vivek Kumar Dutta 2025-01-30 12:07:10 +05:30
parent d51a6fe3c6
commit 57f14e5e58
2 changed files with 15 additions and 7 deletions

View file

@ -1,7 +1,5 @@
if PACKAGE_parental-control if PACKAGE_parental-control
menu "Configuration"
config PARENTAL_CONTROL_INCLUDE_URLFILTER_BUNDLES config PARENTAL_CONTROL_INCLUDE_URLFILTER_BUNDLES
bool "Include default bundle files" bool "Include default bundle files"
default n default n
@ -9,5 +7,8 @@ config PARENTAL_CONTROL_INCLUDE_URLFILTER_BUNDLES
Set this option to include bundle files by default, Set this option to include bundle files by default,
they are also included in the UCI, urlfilter they are also included in the UCI, urlfilter
still needs to be enabled though. still needs to be enabled though.
endmenu
config PARENTAL_CONTROL_VENDOR_PREFIX
string "Package specific datamodel Vendor Prefix for TR181 extensions"
default ""
endif endif

View file

@ -39,9 +39,15 @@ define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in" source "$(SOURCE)/Config.in"
endef endef
TARGET_CFLAGS += \ TARGET_CFLAGS += -D_GNU_SOURCE
-D_GNU_SOURCE\
-DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\" ifeq ($(CONFIG_PARENTAL_CONTROL_VENDOR_PREFIX),"")
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
else
VENDOR_PREFIX = $(CONFIG_PARENTAL_CONTROL_VENDOR_PREFIX)
endif
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
TARGET_LDFLAGS += \ TARGET_LDFLAGS += \
-lcmph -lcmph
@ -71,7 +77,8 @@ define Package/parental-control/install
$(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/etc/uci-defaults/95-firewall_parentalcontrol.ucidefaults $(1)/etc/uci-defaults/ $(INSTALL_DATA) ./files/etc/uci-defaults/95-firewall_parentalcontrol.ucidefaults $(1)/etc/uci-defaults/
$(INSTALL_DATA) ./files/etc/uci-defaults/95-migrate_urlfilter.ucidefaults $(1)/etc/uci-defaults/ $(INSTALL_DATA) ./files/etc/uci-defaults/95-migrate_urlfilter.ucidefaults $(1)/etc/uci-defaults/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) parentalcontrol
$(BBFDM_REGISTER_SERVICES) -v ${VENDOR_PREFIX} ./bbfdm_service.json $(1) parentalcontrol
ifeq ($(CONFIG_PARENTAL_CONTROL_INCLUDE_URLFILTER_BUNDLES),y) ifeq ($(CONFIG_PARENTAL_CONTROL_INCLUDE_URLFILTER_BUNDLES),y)
$(INSTALL_DIR) $(1)/etc/parental-control $(INSTALL_DIR) $(1)/etc/parental-control