mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 03:24:14 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88872c139b |
@@ -81,6 +81,7 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
|
||||
@@ -88,6 +89,7 @@ define Package/obuspa/install
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/roles.json $(1)/etc/obuspa/roles.json
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-obuspa $(1)/etc/hotplug.d/iface/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/86-obuspa-set-endpointid $(1)/etc/uci-defaults/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
|
||||
@@ -5,7 +5,7 @@ config obuspa 'global'
|
||||
option debug '0'
|
||||
option log_level '1'
|
||||
#option db_file '/etc/obuspa/usp.db'
|
||||
#option role_file '/etc/obuspa/roles.json'
|
||||
option role_file '/etc/obuspa/roles.json'
|
||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||
#option trust_cert '/etc/obuspa/rootCA.pem'
|
||||
#option client_cert '/etc/obuspa/client.pem'
|
||||
@@ -34,6 +34,44 @@ config mqtt 'localmqtt'
|
||||
option BrokerPort '1883'
|
||||
option TransportProtocol 'TCP/IP'
|
||||
|
||||
config controller 'user_controller'
|
||||
option EndpointID 'usp-gui-user'
|
||||
option Protocol 'MQTT'
|
||||
option Topic '$SERIAL/usp/user/response'
|
||||
option mqtt 'user_mqtt'
|
||||
option assigned_role_name 'user'
|
||||
|
||||
# Adds Device.LocalAgent.MTP.
|
||||
config mtp
|
||||
option Protocol 'MQTT'
|
||||
option ResponseTopicConfigured '/$SERIAL/usp/user/request'
|
||||
option mqtt 'user_mqtt'
|
||||
|
||||
# Adds Device.MQTT.Client.
|
||||
config mqtt 'user_mqtt'
|
||||
option BrokerAddress '127.0.0.1'
|
||||
option BrokerPort '1883'
|
||||
option TransportProtocol 'TCP/IP'
|
||||
|
||||
config controller 'admin_controller'
|
||||
option EndpointID 'usp-gui-admin'
|
||||
option Protocol 'MQTT'
|
||||
option Topic '$SERIAL/usp/admin/response'
|
||||
option mqtt 'admin_mqtt'
|
||||
option assigned_role_name 'admin'
|
||||
|
||||
# Adds Device.LocalAgent.MTP.
|
||||
config mtp
|
||||
option Protocol 'MQTT'
|
||||
option ResponseTopicConfigured '/$SERIAL/usp/admin/request'
|
||||
option mqtt 'admin_mqtt'
|
||||
|
||||
# Adds Device.MQTT.Client.
|
||||
config mqtt 'admin_mqtt'
|
||||
option BrokerAddress '127.0.0.1'
|
||||
option BrokerPort '1883'
|
||||
option TransportProtocol 'TCP/IP'
|
||||
|
||||
# Add Device.LocalAgent.Subscription.
|
||||
config subscription
|
||||
option ID 'default-boot-event-ACS'
|
||||
|
||||
19
obuspa/files/etc/uci-defaults/86-obuspa-set-endpointid
Normal file
19
obuspa/files/etc/uci-defaults/86-obuspa-set-endpointid
Normal file
@@ -0,0 +1,19 @@
|
||||
# Copy defaults by the factory to the cwmp UCI user section.
|
||||
|
||||
|
||||
# Get factory base MAC.
|
||||
baseMac=$(db -q get hw.board.basemac)
|
||||
|
||||
# Erase colon and space characters.
|
||||
baseMac=${baseMac//:/}
|
||||
baseMac=${baseMac// /}
|
||||
|
||||
# Caseing and fixed length string.
|
||||
mac=$(printf "%12.12X" $((0x$baseMac)))
|
||||
oui=${mac:0:6}
|
||||
# Get system serial number.
|
||||
serial=$(db -q get hw.board.serial_number)
|
||||
|
||||
echo "######### SERIAL[$serial] OUI[$oui] #####" >/dev/console
|
||||
|
||||
sed -i "s/\$SERIAL/$serial/g" /etc/config/obuspa
|
||||
Reference in New Issue
Block a user