mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-14 21:10:11 +01:00
obuspa: Config option to override CT roles with fw default roles
This commit is contained in:
parent
5e13161b70
commit
acc92dfb1f
7 changed files with 26 additions and 11 deletions
|
|
@ -66,4 +66,8 @@ config OBUSPA_CWMP_DATAMODEL_SUPPORT
|
|||
config OBUSPA_VENDOR_PREFIX
|
||||
string "Package specific datamodel Vendor Prefix for TR181 extensions"
|
||||
default ""
|
||||
|
||||
config OBUSPA_OVERRIDE_CT_ROLE
|
||||
bool "Override ControllerTrust role with factory default roles"
|
||||
default y
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=9.0.4.5
|
||||
PKG_VERSION:=9.0.4.6
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=4a43be62f75b5b742e583c47c2097800bd9574a5
|
||||
PKG_SOURCE_VERSION:=e8cfcb03ecd1179d1883056ec8f44caf0d9b9d5b
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
|
@ -145,6 +145,9 @@ ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL),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/
|
||||
endif
|
||||
ifeq ($(CONFIG_OBUSPA_OVERRIDE_CT_ROLE),y)
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/61-override-ct-roles $(1)/etc/uci-defaults/
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ config obuspa 'global'
|
|||
option log_level '2'
|
||||
option prototrace '0'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
#option max_group_sep '2'
|
||||
#option ipc_timeout '30'
|
||||
#option max_cache_time '600'
|
||||
#option trust_cert '/etc/obuspa/ca.pem'
|
||||
|
|
|
|||
|
|
@ -958,12 +958,6 @@ db_init()
|
|||
mv ${SQL_DB_FILE}.old ${SQL_DB_FILE}
|
||||
fi
|
||||
|
||||
if [ -f "${role_file}" ]; then
|
||||
configure_ctrust_role "${role_file}"
|
||||
uci_set obuspa global role_file ""
|
||||
uci commit ${CONFIGURATION}
|
||||
fi
|
||||
|
||||
# Dump datamodel parameters from DB
|
||||
if [ -f "${SQL_DB_FILE}" ]; then
|
||||
dump_db
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ CTRUST_RESET_FILE="/tmp/obuspa/ctrust_reset"
|
|||
VENDOR_PREFIX_FILE="/etc/obuspa/vendor_prefix"
|
||||
FW_DEFAULT_ROLE_DIR="/etc/users/roles"
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
|
||||
# include jshn.sh
|
||||
if [ -f "/usr/local/share/libubox/jshn.sh" ]; then
|
||||
|
|
@ -196,6 +197,10 @@ configure_ctrust_role()
|
|||
local num
|
||||
local roles_obj
|
||||
|
||||
if [ -f "${CTRUST_RESET_FILE}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
if [ -f "${1}" ]; then
|
||||
json_init
|
||||
|
|
|
|||
|
|
@ -4,12 +4,14 @@
|
|||
. /etc/obuspa/usp_utils.sh
|
||||
|
||||
rfile="$(uci -q get obuspa.global.role_file)"
|
||||
|
||||
db_file="$(uci -q get obuspa.global.db_file)"
|
||||
# Reset the role_file if present
|
||||
if [ -n "${rfile}" ]; then
|
||||
uci -q set obuspa.global.role_file=""
|
||||
fi
|
||||
|
||||
configure_ctrust_role "${rfile}"
|
||||
if [ ! -f "${db_file}" ]; then
|
||||
configure_ctrust_role
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
|
|||
8
obuspa/files/etc/uci-defaults/61-override-ct-roles
Normal file
8
obuspa/files/etc/uci-defaults/61-override-ct-roles
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /etc/obuspa/usp_utils.sh
|
||||
|
||||
configure_ctrust_role
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Reference in a new issue