mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 03:24:14 +08:00
Compare commits
61 Commits
meng
...
reset_reas
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b087faf6b9 | ||
|
|
2c9a35eb8c | ||
|
|
0779d9f121 | ||
|
|
afa5f38654 | ||
|
|
1eeb06fd36 | ||
|
|
d64bf6ceea | ||
|
|
c28f5afe45 | ||
|
|
1ed383bee7 | ||
|
|
8236cd4093 | ||
|
|
46a09d8f8d | ||
|
|
61c7afe582 | ||
|
|
258449fc11 | ||
|
|
f5db3d3d45 | ||
|
|
a0c6545534 | ||
|
|
96d18ad234 | ||
|
|
18c9bef5f8 | ||
|
|
bd3b904c15 | ||
|
|
350ced4c32 | ||
|
|
b4e735e731 | ||
|
|
e96e2328a7 | ||
|
|
c8c6b5ab4b | ||
|
|
9bd7e17835 | ||
|
|
fa703437e1 | ||
|
|
cfc335aed8 | ||
|
|
1139c21f34 | ||
|
|
6af6728603 | ||
|
|
5a208be259 | ||
|
|
8764f317d0 | ||
|
|
c2e9144819 | ||
|
|
fc9f946be7 | ||
|
|
2aed4dc8f5 | ||
|
|
ce1b42e095 | ||
|
|
8fee332f4c | ||
|
|
ca78501dba | ||
|
|
9280ddd093 | ||
|
|
15563ca117 | ||
|
|
0718730d6b | ||
|
|
f9ad16934c | ||
|
|
966dbd6038 | ||
|
|
b1809e6993 | ||
|
|
ad8b8b2a55 | ||
|
|
6bf1cae138 | ||
|
|
92c3d6d721 | ||
|
|
853a0c840c | ||
|
|
49bcef77aa | ||
|
|
fa8e9fc3ef | ||
|
|
e3eec0d7ab | ||
|
|
74339e6216 | ||
|
|
8197f9ad93 | ||
|
|
1f96c3d295 | ||
|
|
d1d57ca528 | ||
|
|
10428fbda0 | ||
|
|
8e5d4c53ff | ||
|
|
1fb22dfe8c | ||
|
|
99fe2c2b2a | ||
|
|
c153911acf | ||
|
|
31cd59b33c | ||
|
|
21e6193e0a | ||
|
|
3af94e2180 | ||
|
|
df91d06078 | ||
|
|
ea090f50e1 |
@@ -149,10 +149,10 @@ define Package/bbfdmd/install
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
|
||||
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/91-fix-bbfdmd-enabled-option $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/ruleng.bbfdm $(1)/etc/uci-defaults
|
||||
|
||||
@@ -5,7 +5,6 @@ STOP=05
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/dm-service
|
||||
DM_AGENT_PROG=/usr/sbin/dm-agent
|
||||
|
||||
BBFDM_MICROSERVICE_DIR="/etc/bbfdm/services"
|
||||
|
||||
@@ -25,8 +24,7 @@ validate_bbfdm_micro_service_section()
|
||||
_add_microservice()
|
||||
{
|
||||
local name path loglevel
|
||||
local enable enable_core unified_daemon dm_framework
|
||||
local daemon_prog
|
||||
local enable enable_core unified_daemon
|
||||
|
||||
# Check enable from micro-service
|
||||
path="${1}"
|
||||
@@ -49,25 +47,14 @@ _add_microservice()
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_get_var dm_framework dm-framework 0
|
||||
if [ "${dm_framework}" -eq "1" ] || [ "${dm_framework}" = "true" ]; then
|
||||
daemon_prog="${DM_AGENT_PROG}"
|
||||
else
|
||||
daemon_prog="${PROG}"
|
||||
fi
|
||||
|
||||
json_select config
|
||||
json_get_var loglevel loglevel 4
|
||||
|
||||
procd_open_instance "${name}"
|
||||
|
||||
procd_set_param command ${daemon_prog}
|
||||
|
||||
# Only add parameters for dm-service, not for dm-agent
|
||||
if [ "${daemon_prog}" = "${PROG}" ]; then
|
||||
procd_append_param command -m "${name}"
|
||||
procd_append_param command -l "${loglevel}"
|
||||
fi
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command -m "${name}"
|
||||
procd_append_param command -l "${loglevel}"
|
||||
|
||||
if [ "${enable_core}" -eq "1" ]; then
|
||||
procd_set_param limits core="unlimited"
|
||||
|
||||
17
bridgemngr/Config.in
Normal file
17
bridgemngr/Config.in
Normal file
@@ -0,0 +1,17 @@
|
||||
if PACKAGE_bridgemngr
|
||||
|
||||
config BRIDGEMNGR_BRIDGE_VLAN
|
||||
bool "Use bridge-vlan backend"
|
||||
help
|
||||
Set this option to use bridge-vlan as backend for VLAN objects.
|
||||
|
||||
config BRIDGEMNGR_BRIDGE_VENDOR_EXT
|
||||
bool "Use bridge BBF vendor extensions"
|
||||
default y
|
||||
help
|
||||
Set this option to use bridge BBF vendor extensions.
|
||||
|
||||
config BRIDGEMNGR_BRIDGE_VENDOR_PREFIX
|
||||
string "Package specific datamodel Vendor Prefix for TR181 extensions"
|
||||
default ""
|
||||
endif
|
||||
75
bridgemngr/Makefile
Normal file
75
bridgemngr/Makefile
Normal file
@@ -0,0 +1,75 @@
|
||||
#
|
||||
# Copyright (C) 2020-2024 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bridgemngr
|
||||
PKG_VERSION:=1.1.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr.git
|
||||
PKG_SOURCE_VERSION:=e5e0d9adfc919c25d88a867d42a9c500cb09f834
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/bridgemngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Bridge Manager
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
define Package/bridgemngr/description
|
||||
Package to add Device.Bridging. data model support.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_PREFIX),"")
|
||||
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
|
||||
else
|
||||
VENDOR_PREFIX = $(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_PREFIX)
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
|
||||
|
||||
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VLAN),y)
|
||||
TARGET_CFLAGS += -DBRIDGE_VLAN_BACKEND
|
||||
endif
|
||||
|
||||
define Package/bridgemngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libbridgemngr.so $(1) $(PKG_NAME)
|
||||
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_EXT), y)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libbridgeext.so $(1) $(PKG_NAME) 10
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) -v ${VENDOR_PREFIX} ./files/VLAN_Filtering_Extension.json $(1) $(PKG_NAME) 11
|
||||
endif
|
||||
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bridging $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/bridging $(1)/etc/config/
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) ~/git/bridgemngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,bridgemngr))
|
||||
@@ -2,7 +2,6 @@
|
||||
"daemon": {
|
||||
"enable": "1",
|
||||
"service_name": "bridgemngr",
|
||||
"dm-framework": true,
|
||||
"unified_daemon": false,
|
||||
"services": [
|
||||
{
|
||||
31
bridgemngr/files/VLAN_Filtering_Extension.json
Normal file
31
bridgemngr/files/VLAN_Filtering_Extension.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"json_plugin_version": 2,
|
||||
"Device.Bridging.Bridge.{i}.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": true,
|
||||
"array": true,
|
||||
"{BBF_VENDOR_PREFIX}VLANFiltering": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"description": "Enable or disable VLAN Filtering on this bridge.",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "vlan_filtering"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,6 @@ handle_ebtables_rule() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
ubus -t 30 wait_for network.device uci
|
||||
config_load bridging
|
||||
config_foreach handle_ebtables_chain chain
|
||||
config_foreach handle_ebtables_rule rule
|
||||
@@ -6,12 +6,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=6.2.2.7
|
||||
PKG_VERSION:=6.2.3.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9d1399c09f55da14a8de55828ba57c0e296ce62f
|
||||
PKG_SOURCE_VERSION:=2f618a85b4d9dab443319ee355355c526f6429c9
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.7.11
|
||||
PKG_VERSION:=3.7.12
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=815ee44808169b8e1efa2cac44bd7d238ad33cdc
|
||||
PKG_SOURCE_VERSION:=a62611a36fa85f9fba1b8ec946397dc725c57630
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dhcpmngr
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_VERSION:=1.1.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dhcpmngr.git
|
||||
PKG_SOURCE_VERSION:=986f66608959f4f589009d580b046e250d8c620d
|
||||
PKG_SOURCE_VERSION:=5787de10680719d0c4b72e1ffcfffa895d4c0571
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2023 Genexis B.V. All rights reserved.
|
||||
# This Software and its content are protected by the Dutch Copyright Act
|
||||
# ('Auteurswet'). All and any copying and distribution of the software
|
||||
# and its content without authorization by Genexis B.V. is
|
||||
# prohibited. The prohibition includes every form of reproduction and
|
||||
# distribution.
|
||||
#
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dm-framework
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/dm-framework.git
|
||||
PKG_SOURCE_VERSION:=37dade4a2df6eaf6a4291a06ac776641ed81a79e
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
# Build directories for each component
|
||||
DATAMODELS_BUILD_DIR:=$(PKG_BUILD_DIR)/datamodels-build
|
||||
DMAPI_BUILD_DIR:=$(PKG_BUILD_DIR)/dm-api-build
|
||||
DMAGENT_BUILD_DIR:=$(PKG_BUILD_DIR)/dm-agent-build
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
-include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
|
||||
|
||||
#
|
||||
# Datamodels Package Definition
|
||||
#
|
||||
define Package/datamodels
|
||||
SECTION:=utils
|
||||
CATEGORY:=Genexis
|
||||
TITLE:=dm-framework Datamodel
|
||||
URL:=http://www.genexis.eu
|
||||
PKG_LICENSE:=GENEXIS
|
||||
PKG_LICENSE_URL:=
|
||||
endef
|
||||
|
||||
define Package/datamodels/description
|
||||
This package contains dm-framework datamodel.
|
||||
endef
|
||||
|
||||
#
|
||||
# DM-API Package Definition
|
||||
#
|
||||
define Package/dm-api
|
||||
CATEGORY:=Genexis
|
||||
TITLE:=dm-api
|
||||
PKG_BUILD_DEPENDS:=datamodels
|
||||
DEPENDS:=+libsqlite3 \
|
||||
+libjson-c +libstdcpp +quickjs \
|
||||
+libubus +libubox +libuci
|
||||
URL:=http://www.genexis.eu
|
||||
PKG_LICENSE:=GENEXIS
|
||||
PKG_LICENSE_URL:=
|
||||
endef
|
||||
|
||||
define Package/dm-api/description
|
||||
This package contains api for the dm-framework
|
||||
endef
|
||||
|
||||
#
|
||||
# DM-Agent Package Definition
|
||||
#
|
||||
define Package/dm-agent
|
||||
DEPENDS:=+dm-api +datamodels +libubox +libubus +ubus
|
||||
CATEGORY:=Genexis
|
||||
TITLE:=dm-framework agent
|
||||
URL:=http://www.genexis.eu
|
||||
PKG_LICENSE:=GENEXIS
|
||||
PKG_LICENSE_URL:=
|
||||
endef
|
||||
|
||||
define Package/dm-agent/description
|
||||
This package contains dm-framework agent.
|
||||
endef
|
||||
|
||||
#
|
||||
# Build Preparation
|
||||
#
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
|
||||
# Prepare datamodels
|
||||
mkdir -p $(DATAMODELS_BUILD_DIR)
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/datamodels/* $(DATAMODELS_BUILD_DIR)/
|
||||
# Copy scripts from top-level scripts directory
|
||||
mkdir -p $(DATAMODELS_BUILD_DIR)/scripts
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/scripts/* $(DATAMODELS_BUILD_DIR)/scripts/
|
||||
cd $(DATAMODELS_BUILD_DIR); \
|
||||
npm install better-sqlite3 quickjs && \
|
||||
node ./scripts/json2code.js && \
|
||||
node ./scripts/qjs-handlers-validate.js
|
||||
|
||||
# Prepare dm-api
|
||||
mkdir -p $(DMAPI_BUILD_DIR)
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/dm-api/* $(DMAPI_BUILD_DIR)/
|
||||
|
||||
# Prepare dm-agent
|
||||
mkdir -p $(DMAGENT_BUILD_DIR)
|
||||
$(CP) -rf $(PKG_BUILD_DIR)/dm-agent/* $(DMAGENT_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
|
||||
#
|
||||
# Build Compilation
|
||||
#
|
||||
define Build/Compile
|
||||
# Build datamodels first (dependency for others)
|
||||
$(MAKE) -C $(DATAMODELS_BUILD_DIR)\
|
||||
PROJECT_ROOT="$(DATAMODELS_BUILD_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(DATAMODELS_BUILD_DIR)" \
|
||||
all
|
||||
|
||||
# Build dm-api (depends on datamodels)
|
||||
$(MAKE) -C $(DMAPI_BUILD_DIR)\
|
||||
PROJECT_ROOT="$(DMAPI_BUILD_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(DMAPI_BUILD_DIR)" \
|
||||
all
|
||||
|
||||
# Build dm-agent (depends on both)
|
||||
$(MAKE) -C $(DMAGENT_BUILD_DIR)\
|
||||
PROJECT_ROOT="$(DMAGENT_BUILD_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
EXTRA_CFLAGS="$(TARGET_CFLAGS) -I$(DMAGENT_BUILD_DIR)" \
|
||||
all
|
||||
endef
|
||||
|
||||
#
|
||||
# Development Installation (headers and libraries)
|
||||
#
|
||||
define Build/InstallDev
|
||||
# Datamodels development files
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(DATAMODELS_BUILD_DIR)/dm.h $(1)/usr/include/
|
||||
$(CP) $(DATAMODELS_BUILD_DIR)/libdm.so $(1)/usr/lib/
|
||||
|
||||
# DM-API development files - headers are now in dm-api/include/
|
||||
$(CP) $(DMAPI_BUILD_DIR)/include/dm_types.h $(1)/usr/include/
|
||||
$(CP) $(DMAPI_BUILD_DIR)/include/dm_node.h $(1)/usr/include/
|
||||
$(CP) $(DMAPI_BUILD_DIR)/core/dm_api.h $(1)/usr/include/
|
||||
$(CP) $(DMAPI_BUILD_DIR)/core/dm_linker.h $(1)/usr/include/
|
||||
$(CP) $(DMAPI_BUILD_DIR)/core/dbmgr.h $(1)/usr/include/
|
||||
$(CP) $(DMAPI_BUILD_DIR)/include/dm_log.h $(1)/usr/include/
|
||||
$(CP) $(DMAPI_BUILD_DIR)/utils/dm_list.h $(1)/usr/include/
|
||||
$(CP) $(DMAPI_BUILD_DIR)/libdmapi.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
#
|
||||
# Package Installation - Datamodels
|
||||
#
|
||||
define Package/datamodels/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/lib/dmf_handlers
|
||||
$(INSTALL_BIN) $(DATAMODELS_BUILD_DIR)/default.db $(1)/etc/bbfdm/default_dm.db
|
||||
$(INSTALL_BIN) $(DATAMODELS_BUILD_DIR)/libdm.so $(1)/usr/lib/
|
||||
# Copy handler files from datamodels directory (new structure)
|
||||
# Copy .js files from root datamodels directory
|
||||
( cd $(DATAMODELS_BUILD_DIR); \
|
||||
find . -maxdepth 1 -type f -name '*.js' -not -path './.*' -exec $(INSTALL_BIN) {} $(1)/usr/lib/dmf_handlers/{} \; )
|
||||
# Copy .js files from subdirectories, preserving folder structure (skip hidden files/folders)
|
||||
( cd $(DATAMODELS_BUILD_DIR); \
|
||||
find . -type d -mindepth 1 -not -path './.*' -not -path './scripts*' -exec $(INSTALL_DIR) $(1)/usr/lib/dmf_handlers/{} \; ; \
|
||||
find . -type f -name '*.js' -mindepth 2 -not -path './.*' -not -path './scripts*' -exec $(INSTALL_BIN) {} $(1)/usr/lib/dmf_handlers/{} \; )
|
||||
endef
|
||||
|
||||
#
|
||||
# Package Installation - DM-API
|
||||
#
|
||||
define Package/dm-api/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/sbin/
|
||||
$(INSTALL_BIN) $(DMAPI_BUILD_DIR)/libdmapi.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
#
|
||||
# Package Installation - DM-Agent
|
||||
#
|
||||
define Package/dm-agent/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bridging $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/bridging $(1)/etc/config/
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) dm-agent
|
||||
$(INSTALL_BIN) $(DMAGENT_BUILD_DIR)/dm-agent $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
# Register all three packages
|
||||
$(eval $(call BuildPackage,datamodels))
|
||||
$(eval $(call BuildPackage,dm-api))
|
||||
$(eval $(call BuildPackage,dm-agent))
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsmngr
|
||||
PKG_VERSION:=1.0.18
|
||||
PKG_VERSION:=1.0.19
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dnsmngr.git
|
||||
PKG_SOURCE_VERSION:=80fa147e6f1f0d9c1a62a62a693ff3adaef45363
|
||||
PKG_SOURCE_VERSION:=205938aa1f686d5b43460e4a17f3900ed82bd29f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=firewallmngr
|
||||
PKG_VERSION:=1.0.10
|
||||
PKG_VERSION:=1.0.12
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/firewallmngr.git
|
||||
PKG_SOURCE_VERSION:=05ad0d6f7f21520eecd05429c14d1963de2a8463
|
||||
PKG_SOURCE_VERSION:=30319c67fb4db285a2bcd272b1c10bc040eecf19
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -110,7 +110,7 @@ configure_send_op125() {
|
||||
|
||||
|
||||
if [ "${uci}" = "network" ]; then
|
||||
new_send_opt="$sendopt $opt125"
|
||||
[ -n "${sendopt}" ] && new_send_opt="$sendopt $opt125" || new_send_opt="$opt125"
|
||||
uci -q set network."${intf}".sendopts="$new_send_opt"
|
||||
else
|
||||
new_send_opt="$sendopt$opt125"
|
||||
@@ -228,7 +228,7 @@ enable_dhcp_option125() {
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
newreqopts="$reqopts 125"
|
||||
[ -n "${reqopts}" ] && newreqopts="$reqopts 125" || newreqopts="125"
|
||||
uci -q set network."${wan}".reqopts="$newreqopts"
|
||||
fi
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.4.0
|
||||
PKG_VERSION:=1.4.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=230d55ae6769e1ebde02cef3f718e6c4cf1b1962
|
||||
PKG_SOURCE_VERSION:=ac50f621e19f74b7af4e4b8c1e810503507cc3dd
|
||||
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
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.10.5
|
||||
PKG_VERSION:=9.10.10
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=7f4a159f6ff49584655e57bb801218eb083fba67
|
||||
PKG_SOURCE_VERSION:=63251b6c9789b1428604af0a5c1d23d32d14a8b8
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -84,6 +84,7 @@ define Package/icwmp/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/50-cwmp-align-keep-config $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-set-random-inform-time $(1)/etc/uci-defaults/
|
||||
|
||||
@@ -42,7 +42,9 @@ config cpe 'cpe'
|
||||
option periodic_notify_interval '10'
|
||||
option incoming_rule 'Port_Only'
|
||||
option active_notif_throttle '0'
|
||||
option fw_upgrade_keep_settings '1'
|
||||
#option KeepConfig '1'
|
||||
#option KeepOpConf '1'
|
||||
#option ConfigScope 'UserOnly'
|
||||
option clock_sync_timeout '128'
|
||||
option disable_datatype_check '0'
|
||||
#list allowed_cr_ip '10.5.1.0/24'
|
||||
|
||||
@@ -97,7 +97,9 @@ validate_cpe_section()
|
||||
'periodic_notify_enable:bool' \
|
||||
'enable:bool:1' \
|
||||
'periodic_notify_interval:uinteger' \
|
||||
'fw_upgrade_keep_settings:bool'
|
||||
'KeepConfig:bool' \
|
||||
'KeepOpConf:bool' \
|
||||
'ConfigScope:string'
|
||||
}
|
||||
|
||||
validate_defaults() {
|
||||
@@ -168,13 +170,21 @@ start_service() {
|
||||
|
||||
stop_service()
|
||||
{
|
||||
local switch_bank
|
||||
local switch_bank KeepConfig KeepOpConf ConfigScope
|
||||
|
||||
copy_cwmp_varstate_files_to_etc
|
||||
|
||||
switch_bank=$(uci -q -c /var/state/ get icwmp.cpe.switch_bank)
|
||||
if [ -n "$switch_bank" ] && [ "$switch_bank" = "1" ]; then
|
||||
[ -x /etc/sysmngr/fwbank ] && /etc/sysmngr/fwbank call copy_config
|
||||
if [ "$switch_bank" = "1" ] && [ -x /etc/sysmngr/fwbank ]; then
|
||||
KeepConfig="$(uci -q get cwmp.cpe.KeepConfig)"
|
||||
KeepOpConf="$(uci -q get cwmp.cpe.KeepOpConf)"
|
||||
ConfigScope="$(uci -q get cwmp.cpe.ConfigScope)"
|
||||
|
||||
json_init
|
||||
[ -n "${KeepConfig}" ] && json_add_boolean "keep_config" "${KeepConfig}"
|
||||
[ -n "${KeepOpConf}" ] && json_add_boolean "keep_opconf" "${KeepOpConf}"
|
||||
[ -n "${ConfigScope}" ] && json_add_string "config_scope" "${ConfigScope}"
|
||||
|
||||
json_dump| /etc/sysmngr/fwbank call copy_config
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
7
icwmp/files/etc/uci-defaults/50-cwmp-align-keep-config
Normal file
7
icwmp/files/etc/uci-defaults/50-cwmp-align-keep-config
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
keep_settings="$(uci -q get cwmp.cpe.fw_upgrade_keep_settings)"
|
||||
if [ -n "${keep_settings}" ]; then
|
||||
uci -q delete cwmp.cpe.fw_upgrade_keep_settings
|
||||
uci -q set cwmp.cpe.KeepConfig="${keep_settings}"
|
||||
fi
|
||||
@@ -6,12 +6,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.7.39
|
||||
PKG_VERSION:=8.7.41
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=85fa0fe16d6a5a3452422b72186f6bbb16a13c62
|
||||
PKG_SOURCE_VERSION:=9a61dcdd89be917a5a34caef8170074f117a53b2
|
||||
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
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libeasy
|
||||
PKG_VERSION:=7.5.0
|
||||
PKG_VERSION:=7.5.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=18f93677bb4d33ebb6249324a5043294f0eae16c
|
||||
PKG_SOURCE_VERSION:=b981f7e1bd51f66041cd0c25d15af74ae1e3bc75
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libeasy.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.7
|
||||
PKG_VERSION:=1.1.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:=3a30086a68a3409f0396acb01380f91daabf7a2f
|
||||
PKG_SOURCE_VERSION:=9763c574ec69e2aa492db4f1296d4bcd53776fba
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -25,6 +25,5 @@ db commit
|
||||
# configure the PCM for DECT/DCX81
|
||||
[ -f "/proc/device-tree/aliases/dcx81-uart" ] && {
|
||||
uci set dect.global.pcm_fsync='SHORT_LF'
|
||||
uci set dect.global.pcm_slot_start='8'
|
||||
uci set dect.global.dect_channel_start='3'
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.22.6
|
||||
PKG_VERSION:=7.22.9
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ddeb681a9f99202b1ded6c965591bb8c1f5cb05d
|
||||
PKG_SOURCE_VERSION:=8e6dfd1f0d0d6b5a39dbb10a5820f3b80120564b
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libwifi.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=12
|
||||
START=09
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=6.4.3.6
|
||||
PKG_VERSION:=6.4.3.11
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=e37b8f1a4b988b907416161e3c8fe83cd39597c3
|
||||
PKG_SOURCE_VERSION:=9c74ba03e3f543961afe54bb08668f87f4ae169f
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=98
|
||||
START=97
|
||||
STOP=20
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=6.4.4.8
|
||||
PKG_VERSION:=6.4.4.11
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=a863fc3a9d248b0be7385524e0680155ff614467
|
||||
PKG_SOURCE_VERSION:=7e0d6921fad51c446777acf93ddb9bad87eccf76
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@genexis.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-plugins
|
||||
PKG_VERSION:=1.2.5
|
||||
PKG_VERSION:=1.2.7
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=05c0aa02b60b27aa57bf80b8fb068b1ee8bfc8ac
|
||||
PKG_SOURCE_VERSION:=dd873ca4e2cb321302dae1955da24d1be271b2b1
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-plugins.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -71,5 +71,11 @@ define Build/Compile
|
||||
$(foreach p,$(plugins),$(call Build/Compile/map-plugins-$(p), $(1)))
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/map-plugins/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,map-plugins))
|
||||
$(eval $(foreach p,$(ppkg),$(call BuildPackage,$(p))))
|
||||
|
||||
@@ -32,7 +32,7 @@ define Package/mcastmngr
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
|
||||
DEPENDS+=+!TARGET_brcmbca:mcproxy +!TARGET_brcmbca:sipcalc
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +!TARGET_brcmbca:kmod-ebt-igmpsnooping +!TARGET_brcmbca:kmod-ebt-mldsnooping
|
||||
DEPENDS+=+!TARGET_brcmbca:ebtables-legacy +dm-agent
|
||||
DEPENDS+=+!TARGET_brcmbca:ebtables-legacy +bridgemngr
|
||||
endef
|
||||
|
||||
define Package/mcastmngr/description
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netmngr
|
||||
PKG_VERSION:=1.2.0
|
||||
PKG_VERSION:=1.2.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/netmngr.git
|
||||
PKG_SOURCE_VERSION:=000da9cbb2cfe965908adf60eda0823682c8bd69
|
||||
PKG_SOURCE_VERSION:=1ece805d04b1d7843f57cae83f904268579ab4e6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -59,6 +59,8 @@ l3_network_config() {
|
||||
uci -q set network.wan.device="$wandev"
|
||||
uci -q set network.wan6.device="$wandev"
|
||||
|
||||
uci -q set network.WAN.mtu="$NETMODE_mtu"
|
||||
|
||||
uci -q delete network.wan.dns
|
||||
if [ -n "$NETMODE_dns_servers" ]; then
|
||||
dns_servers="$(echo $NETMODE_dns_servers | tr ',' ' ')"
|
||||
|
||||
@@ -57,6 +57,8 @@ l3_network_pppoe_config() {
|
||||
uci -q set network.wan.device="$wandev"
|
||||
uci -q set network.wan6.device="$wandev"
|
||||
|
||||
uci -q set network.WAN.mtu="$NETMODE_mtu"
|
||||
|
||||
uci -q delete network.wan.dns
|
||||
if [ -n "$NETMODE_dns_servers" ]; then
|
||||
dns_servers="$(echo $NETMODE_dns_servers | tr ',' ' ')"
|
||||
|
||||
@@ -58,6 +58,8 @@ l3_network_config() {
|
||||
uci -q set network.wan.device="$wandev"
|
||||
uci -q set network.wan6.device="$wandev"
|
||||
|
||||
uci -q set network.WAN.mtu="$NETMODE_mtu"
|
||||
|
||||
uci -q delete network.wan.dns
|
||||
if [ -n "$NETMODE_dns_servers" ]; then
|
||||
dns_servers="$(echo $NETMODE_dns_servers | tr ',' ' ')"
|
||||
|
||||
@@ -43,6 +43,12 @@
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"name": "mtu",
|
||||
"description": "MTU",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"name": "dns_servers",
|
||||
"description": "DNS Servers",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=10.0.7.5
|
||||
PKG_VERSION:=10.0.7.7
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
|
||||
@@ -715,7 +715,7 @@ start_service() {
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 0
|
||||
config_get_bool enabled global enabled 1
|
||||
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
if [ "${enabled}" -eq 1 ]; then
|
||||
|
||||
@@ -53,13 +53,7 @@ add_mdns_advertise() {
|
||||
json_dump > /etc/umdns/obuspa_mdns.json
|
||||
}
|
||||
|
||||
config_load obuspa
|
||||
config_get_bool enable_obuspa global enabled 1
|
||||
|
||||
if [ "${enable_obuspa}" -eq 1 ]; then
|
||||
role="$(get_device_role)"
|
||||
|
||||
if [ "${role}" == "gateway" ]; then
|
||||
add_mdns_advertise
|
||||
fi
|
||||
role="$(get_device_role)"
|
||||
if [ "${role}" == "gateway" ]; then
|
||||
add_mdns_advertise
|
||||
fi
|
||||
|
||||
@@ -19,19 +19,11 @@ get_access_role()
|
||||
|
||||
configure_dhcp_options() {
|
||||
local enabled inerface discovery
|
||||
config_load obuspa
|
||||
|
||||
config_get_bool enabled global enabled 1
|
||||
config_get interface global interface
|
||||
config_get_bool discovery global dhcp_discovery 1
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${discovery}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -z "${interface}" ]; then
|
||||
role="$(get_access_role)"
|
||||
|
||||
@@ -66,12 +58,12 @@ configure_dhcp_options() {
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
newreqopts="$reqopts 125"
|
||||
[ -n "${reqopts}" ] && newreqopts="$reqopts 125" || newreqopts="125"
|
||||
uci -q set network."${interface}".reqopts="$newreqopts"
|
||||
fi
|
||||
|
||||
if [ ${send124_present} -eq 0 ]; then
|
||||
newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70"
|
||||
[ -n "${sendopts}" ] && newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70" || newsendopts="124:00:00:0D:E9:04:03:75:73:70"
|
||||
uci -q set network."${interface}".sendopts="$newsendopts"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -32,7 +32,7 @@ define Package/qosmngr
|
||||
TITLE:=QoS Manager
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos +!(TARGET_brcmbca||TARGET_airoha):tc-full
|
||||
DEPENDS+=+kmod-ebt-vlantranslation +kmod-ebt-dscp2pbit +!(TARGET_brcmbca):ebtables-legacy
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +dm-agent
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +bridgemngr
|
||||
endef
|
||||
|
||||
define Package/qosmngr/description
|
||||
|
||||
@@ -411,33 +411,35 @@ hw_commit_all() {
|
||||
/userfs/bin/qosrule discpline Enable 0
|
||||
fi
|
||||
|
||||
if [ -x /userfs/bin/blapi_cmd ]; then
|
||||
echo 1 > /proc/ifc_send_to_ppe
|
||||
for tc in $(seq 0 7); do
|
||||
if [ -s "/tmp/qos/dscp_values_${tc}_4" ]; then
|
||||
sort -un "/tmp/qos/dscp_values_${tc}_4" | awk 'NR==1{first=$1;last=$1;next}
|
||||
$1 == last+1 {last=$1;next}
|
||||
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
|
||||
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
|
||||
fi
|
||||
if [ -s "/tmp/qos/dscp_values_${tc}_6" ]; then
|
||||
[ -s "/tmp/qos/dscp_values_${tc}_4" ] && sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
|
||||
$1 == last+1 {last=$1;next}
|
||||
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0");first=$1;last=first}
|
||||
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0")}'
|
||||
sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
|
||||
$1 == last+1 {last=$1;next}
|
||||
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
|
||||
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if ! strings /proc/device-tree/compatible | grep -qFx econet,en7523; then
|
||||
if [ -x /userfs/bin/blapi_cmd ]; then
|
||||
echo 1 > /proc/ifc_send_to_ppe
|
||||
for tc in $(seq 0 7); do
|
||||
if [ -s "/tmp/qos/dscp_values_${tc}_4" ]; then
|
||||
sort -un "/tmp/qos/dscp_values_${tc}_4" | awk 'NR==1{first=$1;last=$1;next}
|
||||
$1 == last+1 {last=$1;next}
|
||||
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
|
||||
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
|
||||
fi
|
||||
if [ -s "/tmp/qos/dscp_values_${tc}_6" ]; then
|
||||
[ -s "/tmp/qos/dscp_values_${tc}_4" ] && sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
|
||||
$1 == last+1 {last=$1;next}
|
||||
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0");first=$1;last=first}
|
||||
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0")}'
|
||||
sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
|
||||
$1 == last+1 {last=$1;next}
|
||||
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
|
||||
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -x /userfs/bin/ifc ]; then
|
||||
echo 1 > /proc/ifc_send_to_ppe
|
||||
for pbit in $(seq 0 7); do
|
||||
/userfs/bin/ifc add vip pbit $pbit
|
||||
done
|
||||
if [ -x /userfs/bin/ifc ]; then
|
||||
echo 1 > /proc/ifc_send_to_ppe
|
||||
for pbit in $(seq 0 7); do
|
||||
/userfs/bin/ifc add vip pbit $pbit
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
hw_nat -! > /dev/null 2>&1
|
||||
|
||||
2
quickjs/Makefile
Executable file → Normal file
2
quickjs/Makefile
Executable file → Normal file
@@ -15,8 +15,6 @@ PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
TARGET_CFLAGS += -fPIC
|
||||
|
||||
define Package/quickjs
|
||||
SECTION:=lang
|
||||
CATEGORY:=Languages
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-base
|
||||
PKG_VERSION:=5.2.2
|
||||
PKG_VERSION:=5.2.10
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=b2bf5c9615e0e81afb2e6bcbf6c75b347e24c705
|
||||
PKG_SOURCE_VERSION:=4aa93571b341c3a5da47fbb64b254f5ac602b5e8
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
SULU_MOD:=core
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-builder
|
||||
PKG_VERSION:=5.2.2
|
||||
PKG_VERSION:=5.2.10
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
|
||||
PKG_SOURCE_VERSION:=d270fcaec14aaf53b1a8983e71b2c61dec1ab1ed
|
||||
PKG_SOURCE_VERSION:=ec76b7e0564b9db0ef3db50aac3110fa3b7a30af
|
||||
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)
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
RESTART_REQ=0
|
||||
_RESTART_SERVICES="0"
|
||||
SULU_CON_CONFIG="/sulu/presets/connection-config.json"
|
||||
SULU_ACL_FILE=""
|
||||
SULU_CON_ROLES=""
|
||||
|
||||
slog() {
|
||||
echo "$*" | logger -t sulu.sh -p debug
|
||||
@@ -27,49 +28,21 @@ _get_agent_id() {
|
||||
fi
|
||||
}
|
||||
|
||||
_get_sulu_user_roles() {
|
||||
roles=$(uci -q get userinterface._sulu_s.role)
|
||||
|
||||
for role in ${roles}; do
|
||||
sulu_user_roles="${sulu_user_roles} ${role}"
|
||||
done
|
||||
|
||||
if [ -n "${sulu_user_roles}" ]; then
|
||||
sulu_user_roles=$(echo -e "${sulu_user_roles// /\\n}" | sort | uniq)
|
||||
fi
|
||||
|
||||
echo "${sulu_user_roles}"
|
||||
}
|
||||
|
||||
_get_sulu_root() {
|
||||
local root
|
||||
|
||||
root="$(uci -q get nginx._sulu_s.root)"
|
||||
echo "${root:-/sulu}"
|
||||
}
|
||||
|
||||
_get_sulu_connection_config() {
|
||||
local config
|
||||
|
||||
config="$(_get_sulu_root)/presets/connection-config.json"
|
||||
echo "${config}"
|
||||
}
|
||||
|
||||
_get_sulu_session_mode() {
|
||||
uci -q get sulu.global.SessionMode
|
||||
}
|
||||
|
||||
_get_sulu_acl_file() {
|
||||
uci -q get mosquitto.sulu.acl_file
|
||||
}
|
||||
|
||||
_sulu_conn_config_users() {
|
||||
for user in ${SULU_CON_ROLES}; do
|
||||
json_add_object "${user}"
|
||||
json_add_string 'fromId' "self::sulu-${user}"
|
||||
json_add_string 'publishEndpoint' "/usp/$(_get_agent_id)/${user}/endpoint"
|
||||
json_add_string 'subscribeEndpoint' "/usp/$(_get_agent_id)/${user}/controller"
|
||||
json_close_object
|
||||
done
|
||||
}
|
||||
|
||||
generate_sulu_conn_config() {
|
||||
local users SCONFIG session
|
||||
|
||||
users="$(_get_sulu_user_roles)"
|
||||
session="$(_get_sulu_session_mode)"
|
||||
SCONFIG="$(_get_sulu_connection_config)"
|
||||
|
||||
json_init
|
||||
json_add_string 'Current-connection' 'main'
|
||||
json_add_object 'Connections'
|
||||
@@ -79,41 +52,25 @@ generate_sulu_conn_config() {
|
||||
json_add_string 'toId' "os::$(_get_agent_id)"
|
||||
json_add_string 'port' "auto"
|
||||
json_add_string 'path' "/wss"
|
||||
|
||||
if [ "${session}" = "Require" ]; then
|
||||
json_add_boolean 'useSession' 1
|
||||
fi
|
||||
|
||||
json_add_string 'protocol' 'autoWs'
|
||||
|
||||
json_add_object 'overrides'
|
||||
{
|
||||
for user in ${users}; do
|
||||
json_add_object "${user}"
|
||||
{
|
||||
json_add_string 'fromId' "self::sulu-${user}"
|
||||
json_add_string 'publishEndpoint' "/usp/$(_get_agent_id)/${user}/endpoint"
|
||||
json_add_string 'subscribeEndpoint' "/usp/$(_get_agent_id)/${user}/controller"
|
||||
json_close_object
|
||||
}
|
||||
done
|
||||
_sulu_conn_config_users
|
||||
json_close_object
|
||||
}
|
||||
json_close_object
|
||||
}
|
||||
json_close_object
|
||||
}
|
||||
|
||||
json_dump >"${SCONFIG}"
|
||||
json_dump >"${SULU_CON_CONFIG}"
|
||||
}
|
||||
|
||||
_update_obuspa_config_rbac() {
|
||||
local agent users session
|
||||
update_obuspa_config() {
|
||||
local agent
|
||||
|
||||
agent="$(_get_agent_id)"
|
||||
users="$(_get_sulu_user_roles)"
|
||||
session="$(_get_sulu_session_mode)"
|
||||
|
||||
for user in ${users}; do
|
||||
for user in ${SULU_CON_ROLES}; do
|
||||
local section
|
||||
|
||||
# Add mqtt
|
||||
@@ -123,7 +80,6 @@ _update_obuspa_config_rbac() {
|
||||
uci_set obuspa "${section}" BrokerAddress "127.0.0.1"
|
||||
uci_set obuspa "${section}" BrokerPort "1883"
|
||||
uci_set obuspa "${section}" TransportProtocol "TCP/IP"
|
||||
RESTART_REQ=1
|
||||
fi
|
||||
|
||||
# Add mtp
|
||||
@@ -133,7 +89,6 @@ _update_obuspa_config_rbac() {
|
||||
uci_set obuspa "${section}" Protocol "MQTT"
|
||||
uci_set obuspa "${section}" ResponseTopicConfigured "/usp/${agent}/${user}/endpoint"
|
||||
uci_set obuspa "${section}" mqtt "mqtt_sulu_$user"
|
||||
RESTART_REQ=1
|
||||
fi
|
||||
|
||||
# Add controller
|
||||
@@ -145,88 +100,59 @@ _update_obuspa_config_rbac() {
|
||||
uci_set obuspa "${section}" Topic "/usp/${agent}/${user}/controller"
|
||||
uci_set obuspa "${section}" mqtt "mqtt_sulu_$user"
|
||||
uci_set obuspa "${section}" assigned_role_name "$user"
|
||||
RESTART_REQ=1
|
||||
fi
|
||||
|
||||
obMode="$(uci_get obuspa "${section}" SessionMode)"
|
||||
if [ "${session}" != "${obMode}" ]; then
|
||||
uci_set obuspa "${section}" SessionMode "${session}"
|
||||
RESTART_REQ=1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
_create_mosquitto_acl() {
|
||||
local agentid users
|
||||
local ACL_FILE acl_users
|
||||
create_mosquitto_acl() {
|
||||
local agentid
|
||||
local acl_users
|
||||
|
||||
RESTART_REQ="0"
|
||||
|
||||
ACL_FILE="$(_get_sulu_acl_file)"
|
||||
if [ -z "${ACL_FILE}" ]; then
|
||||
SULU_ACL_FILE="$(_get_sulu_acl_file)"
|
||||
if [ -z "${SULU_ACL_FILE}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
users="$(_get_sulu_user_roles)"
|
||||
if [ -f "${ACL_FILE}" ]; then
|
||||
acl_users="$(awk '/^user / {print $2}' "${ACL_FILE}")"
|
||||
for user in ${acl_users}; do
|
||||
if ! echo "$users" | grep -qwF "$user"; then
|
||||
rm -f "${ACL_FILE}"
|
||||
RESTART_REQ="1"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
[ -f "${ACL_FILE}" ] || touch "${ACL_FILE}"
|
||||
|
||||
echo > "${SULU_ACL_FILE}"
|
||||
agentid="$(_get_agent_id)"
|
||||
for user in ${users}; do
|
||||
if ! grep -qxF "user $user" "${ACL_FILE}"; then
|
||||
for user in ${SULU_CON_ROLES}; do
|
||||
if ! grep -qxF "user $user" "${SULU_ACL_FILE}"; then
|
||||
{
|
||||
echo "user ${user}"
|
||||
echo "topic read /usp/${agentid}/${user}/controller/reply-to"
|
||||
echo "topic write /usp/${agentid}/${user}/endpoint"
|
||||
echo "topic read /usp/${agentid}/${user}/controller"
|
||||
echo ""
|
||||
} >> "${ACL_FILE}"
|
||||
RESTART_REQ="1"
|
||||
} >> "${SULU_ACL_FILE}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "${_RESTART_SERVICES}" -eq "1" ] && [ "${RESTART_REQ}" -gt "0" ]; then
|
||||
slog "Restarting mosquitto..."
|
||||
ubus call uci commit '{"config":"mosquitto"}'
|
||||
get_sulu_roles() {
|
||||
local sec path_prefix redirect role
|
||||
|
||||
sec="${1}"
|
||||
|
||||
config_get path_prefix "${sec}" path_prefix ""
|
||||
config_get redirect "${sec}" redirect ""
|
||||
config_get role "${sec}" role ""
|
||||
|
||||
if [ -n "${redirect}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${path_prefix}" != "/sulu" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -n "${role}" ]; then
|
||||
SULU_CON_ROLES="${SULU_CON_ROLES} ${role}"
|
||||
fi
|
||||
}
|
||||
|
||||
update_obuspa_config() {
|
||||
RESTART_REQ=0
|
||||
_update_obuspa_config_rbac
|
||||
uci_commit obuspa
|
||||
config_load userinterface
|
||||
config_foreach get_sulu_roles http_access
|
||||
|
||||
if [ "${_RESTART_SERVICES}" -eq "1" ] && [ "${RESTART_REQ}" -gt "0" ]; then
|
||||
slog "Restarting obuspa..."
|
||||
ubus call uci commit '{"config":"obuspa"}'
|
||||
fi
|
||||
}
|
||||
|
||||
configure_sulu() {
|
||||
_create_mosquitto_acl
|
||||
update_obuspa_config
|
||||
generate_sulu_conn_config
|
||||
}
|
||||
|
||||
while getopts ":r" opt; do
|
||||
case ${opt} in
|
||||
r)
|
||||
_RESTART_SERVICES="1"
|
||||
;;
|
||||
*)
|
||||
slog "Invalid option: ${OPTARG}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
configure_sulu
|
||||
generate_sulu_conn_config
|
||||
create_mosquitto_acl
|
||||
update_obuspa_config
|
||||
|
||||
@@ -39,7 +39,8 @@ add_sulu_config_to_mosquitto()
|
||||
|
||||
add_sulu_userinterface_uci()
|
||||
{
|
||||
if [ -f "/etc/config/userinterface" ]; then
|
||||
# check if sulu already configured
|
||||
if ! uci show userinterface| grep -q "path_prefix='/sulu'"; then
|
||||
uci_add userinterface http_access _sulu_s
|
||||
uci_set userinterface _sulu_s path_prefix '/sulu'
|
||||
uci_set userinterface _sulu_s port '8443'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-theme-genexis
|
||||
PKG_VERSION:=5.2.2
|
||||
PKG_VERSION:=5.2.10
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/gnx/sulu-theme-genexis
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sysmngr
|
||||
PKG_VERSION:=1.0.31
|
||||
PKG_VERSION:=1.1.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/sysmngr.git
|
||||
PKG_SOURCE_VERSION:=d84dd91e19ec8e2a6baf3efa9ff319bf9d6f746a
|
||||
PKG_SOURCE_VERSION:=42b129059007cec121c900c33ece6e40dbca7a78
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=15
|
||||
START=12
|
||||
STOP=8
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/sysmngr
|
||||
RESET_REASON="/etc/sysmngr/reset_reason"
|
||||
|
||||
boot()
|
||||
{
|
||||
if [ -x "${RESET_REASON}" ]; then
|
||||
eval ${RESET_REASON}
|
||||
fi
|
||||
start
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
|
||||
@@ -22,7 +22,30 @@ fwbank_get_bootbank() {
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "dump" : {}, "set_bootbank" : {"bank":32}, "copy_config" : {}, "upgrade": {"path":"String","auto_activate":true,"bank":32,"keep_settings":true}}'
|
||||
json_init
|
||||
json_add_object "dump"
|
||||
json_close_object
|
||||
|
||||
json_add_object "set_bootbank"
|
||||
json_add_int "bank" 32
|
||||
json_close_object
|
||||
|
||||
json_add_object "copy_config"
|
||||
json_add_boolean "keep_settings" 1
|
||||
json_add_boolean "keep_opconf" 1
|
||||
json_add_string "config_scope" "String"
|
||||
json_close_object
|
||||
|
||||
json_add_object "upgrade"
|
||||
json_add_string "path" "String"
|
||||
json_add_boolean "auto_activate" 1
|
||||
json_add_int "bank" 32
|
||||
json_add_boolean "keep_settings" 1
|
||||
json_add_boolean "keep_opconf" 1
|
||||
json_add_string "config_scope" "String"
|
||||
json_add_boolean "reboot" 1
|
||||
json_close_object
|
||||
json_dump
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
@@ -125,19 +148,44 @@ case "$1" in
|
||||
fi
|
||||
;;
|
||||
copy_config)
|
||||
if [ -z "$UPGRADE_BACKUP" ]; then
|
||||
UPGRADE_BACKUP=/tmp/sysupgrade.tgz
|
||||
read -r input
|
||||
json_load "${input}"
|
||||
json_get_var keep_settings keep_settings
|
||||
json_get_var keep_opconf keep_opconf
|
||||
json_get_var config_scope config_scope
|
||||
|
||||
# Set the default value for keep_settings
|
||||
keep_settings=${keep_settings:-1}
|
||||
|
||||
if command -v "opconf_conf_handler" >/dev/null 2>&1; then
|
||||
if ! mountpoint -q /usr_data; then
|
||||
logger -t sysmngr.fwbank "copy_config: usr_data partition not present"
|
||||
config_scope="All"
|
||||
fi
|
||||
|
||||
arg="-k ${keep_settings}"
|
||||
[ -n "${keep_opconf}" ] && arg="${arg} -o ${keep_opconf}"
|
||||
[ -n "${config_scope}" ] && arg="${arg} -s ${config_scope}"
|
||||
|
||||
opconf_conf_handler ${arg}
|
||||
else
|
||||
# Fallback to default old behaviour in case opconf not present
|
||||
config_scope="All"
|
||||
fi
|
||||
|
||||
ret=0
|
||||
if [ "${keep_settings}" -eq "1" ] && [ "${config_scope}" = "All" ]; then
|
||||
if [ -z "$UPGRADE_BACKUP" ]; then
|
||||
UPGRADE_BACKUP=/tmp/sysupgrade.tgz
|
||||
fi
|
||||
|
||||
sysupgrade -b "$UPGRADE_BACKUP" || ret=1
|
||||
|
||||
if [ "$ret" -eq 0 ]; then
|
||||
if command -v platform_copy_config >/dev/null 2>&1; then
|
||||
platform_copy_config 1>&2 || ret=1
|
||||
else
|
||||
ret=1
|
||||
sysupgrade -b "$UPGRADE_BACKUP" || ret=1
|
||||
if [ "$ret" -eq 0 ]; then
|
||||
if command -v platform_copy_config >/dev/null 2>&1; then
|
||||
platform_copy_config 1>&2 || ret=1
|
||||
else
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -157,6 +205,9 @@ case "$1" in
|
||||
json_get_var auto_activate auto_activate
|
||||
json_get_var bank bank
|
||||
json_get_var keep_settings keep_settings
|
||||
json_get_var keep_opconf keep_opconf
|
||||
json_get_var config_scope config_scope
|
||||
json_get_var reboot reboot
|
||||
|
||||
ret=0
|
||||
|
||||
@@ -180,6 +231,7 @@ case "$1" in
|
||||
|
||||
# Set the default value for keep_settings
|
||||
keep_settings=${keep_settings:-1}
|
||||
reboot=${reboot:-0}
|
||||
|
||||
# This ubus call does not reboot the system at any one time.
|
||||
# Although, the newly upgraded bank is activated by default.
|
||||
@@ -187,14 +239,36 @@ case "$1" in
|
||||
# "--no-activate" otherwise.
|
||||
sysupgrade_flag=""
|
||||
if [ "${auto_activate}" -eq 1 ]; then
|
||||
sysupgrade_flag="--no-reboot"
|
||||
if [ "${reboot}" -eq 0 ]; then
|
||||
sysupgrade_flag="--no-reboot"
|
||||
fi
|
||||
else
|
||||
sysupgrade_flag="--no-activate"
|
||||
fi
|
||||
|
||||
if command -v "opconf_conf_handler" >/dev/null 2>&1; then
|
||||
if ! mountpoint -q /usr_data; then
|
||||
logger -t sysmngr.fwbank "upgrade: usr_data partition not present"
|
||||
config_scope="All"
|
||||
fi
|
||||
|
||||
arg="-k ${keep_settings}"
|
||||
[ -n "${keep_opconf}" ] && arg="${arg} -o ${keep_opconf}"
|
||||
[ -n "${config_scope}" ] && arg="${arg} -s ${config_scope}"
|
||||
|
||||
opconf_conf_handler ${arg}
|
||||
else
|
||||
# Fallback to default old behaviour in case opconf not present
|
||||
config_scope="All"
|
||||
fi
|
||||
|
||||
# Set the flag to do not save configuration over reflash
|
||||
if [ "${keep_settings}" -eq 0 ]; then
|
||||
sysupgrade_flag="${sysupgrade_flag} -n"
|
||||
elif [ "${keep_settings}" -eq 1 ]; then
|
||||
if [ "${config_scope}" != "All" ]; then
|
||||
sysupgrade_flag="${sysupgrade_flag} -n"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Call sysupgrade synchonously. It should not time out the ubus call,
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usermngr
|
||||
PKG_VERSION:=1.4.6
|
||||
PKG_VERSION:=1.4.7
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/usermngr.git
|
||||
PKG_SOURCE_VERSION:=416c49b53ed2fbbc983f404c65b8a8ce722152bd
|
||||
PKG_SOURCE_VERSION:=62390ff8d9e1c80babf3621f8b374dcd2078ff6f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -112,6 +112,8 @@ build_pam_passwdqc_line() {
|
||||
base="$base $k=$v"
|
||||
done
|
||||
|
||||
base="$base match=0"
|
||||
|
||||
echo "$base"
|
||||
}
|
||||
|
||||
@@ -141,7 +143,7 @@ update_password() {
|
||||
fi
|
||||
fi
|
||||
|
||||
write_line "$tmp_file" "password [success=1 default=ignore] pam_unix.so obscure sha512"
|
||||
write_line "$tmp_file" "password [success=1 default=ignore] pam_unix.so sha512"
|
||||
write_line "$tmp_file" ""
|
||||
write_line "$tmp_file" "password requisite pam_deny.so"
|
||||
write_line "$tmp_file" "password required pam_permit.so"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifidmd
|
||||
PKG_VERSION:=1.4.1
|
||||
PKG_VERSION:=1.4.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/wifidmd.git
|
||||
PKG_SOURCE_VERSION:=006359c351be70a45f5bc1ef3d78e14e270aa7cf
|
||||
PKG_SOURCE_VERSION:=a399309c31ecadc77ec347898c99dbd70cf35d98
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -42,23 +42,95 @@ for arg in ${input}; do
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
################################################################################
|
||||
# wait_for_wifi_reload
|
||||
#
|
||||
# Description:
|
||||
# Currently, there is no direct way to determine when WiFi reload
|
||||
# operations have fully completed. The ubus API does not provide any
|
||||
# event or flag indicating that WiFi services have finished reloading.
|
||||
#
|
||||
# To work around this, we use a timing-based heuristic:
|
||||
# - We repeatedly run `ubus call wifi status` every 1 second.
|
||||
# - Each call is timed (using `date +%s` before and after).
|
||||
# - Normally, this command returns almost instantly (<1s).
|
||||
# - However, during a WiFi reload, the call may take longer
|
||||
# (several seconds) while the subsystem is busy.
|
||||
# - Once we detect that `ubus call wifi status` takes longer than
|
||||
# 2 seconds to return, we assume the reload has been applied
|
||||
# and completed successfully.
|
||||
#
|
||||
# Additional wait constraints:
|
||||
# - Minimum wait: 5 seconds (to ensure reload started).
|
||||
# - Maximum wait: 15 seconds (to prevent indefinite blocking).
|
||||
# - If the threshold is not met within 15s, we log a timeout warning.
|
||||
################################################################################
|
||||
wait_for_wifi_reload() {
|
||||
MAX_ITER=15
|
||||
MIN_ITER=5
|
||||
THRESH=2 # seconds
|
||||
|
||||
# Check if wifi ubus object exists
|
||||
ubus -t 2 wait_for wifi >/dev/null 2>&1
|
||||
if [ "$?" -ne 0 ]; then
|
||||
log "wifi ubus object not available, skipping wait logic"
|
||||
return 0
|
||||
fi
|
||||
|
||||
#log "Waiting for WiFi reload (min ${MIN_ITER}s, max ${MAX_ITER}s)..."
|
||||
|
||||
iter=0
|
||||
while [ "${iter}" -lt "${MAX_ITER}" ]; do
|
||||
iter=$((iter + 1))
|
||||
start=$(date +%s)
|
||||
ubus call wifi status >/dev/null 2>&1
|
||||
#rc=$?
|
||||
end=$(date +%s)
|
||||
elapsed=$((end - start))
|
||||
|
||||
#log "wait_for_wifi_reload: iter=${iter}, rc=${rc}, elapsed=${elapsed}s"
|
||||
|
||||
# If ubus took >2s and we've waited at least MIN_ITER → assume reload done
|
||||
if [ "${elapsed}" -gt "${THRESH}" ] && [ "${iter}" -ge "${MIN_ITER}" ]; then
|
||||
log "Detected long ubus response (${elapsed}s) after ${iter}s → assuming WiFi reload complete"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Sleep 1s between checks
|
||||
if [ "${iter}" -lt "${MAX_ITER}" ]; then
|
||||
sleep 1
|
||||
fi
|
||||
done
|
||||
|
||||
log "Timeout after ${MAX_ITER}s — WiFi reload not confirmed"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Define function to reload mapcontroller
|
||||
reload_mapcontroller() {
|
||||
pid=$(pidof mapcontroller)
|
||||
if [ -n "$pid" ]; then
|
||||
log "Reloading mapcontroller (PID: $pid)..."
|
||||
kill -SIGHUP "$pid"
|
||||
wait_for_wifi_reload
|
||||
else
|
||||
log "Warning: mapcontroller process not found"
|
||||
fi
|
||||
}
|
||||
|
||||
# Define function to commit wireless config
|
||||
commit_wireless_config() {
|
||||
log "Committing wireless config..."
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
wait_for_wifi_reload
|
||||
}
|
||||
|
||||
# Apply logic based on flags
|
||||
if [ "$mapcontroller" -eq 1 ]; then
|
||||
reload_mapcontroller
|
||||
elif [ "$wireless" -eq 1 ]; then
|
||||
log "Committing wireless config..."
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
commit_wireless_config
|
||||
else
|
||||
log "No action needed."
|
||||
exit 1
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=20.1.8
|
||||
PKG_VERSION:=20.1.9
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b1c3ea57d027412b3cc9f9ecf8db7c1cea2c5ce5
|
||||
PKG_SOURCE_VERSION:=479e4b737d7af8ec9d1c6088f7ae42871a61c601
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/wifimngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
Reference in New Issue
Block a user