mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-21 01:24:10 +08:00
Compare commits
465 Commits
controller
...
vcs
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab5f60a18a | ||
|
|
00594ba01e | ||
|
|
132bba5c20 | ||
|
|
06f160af35 | ||
|
|
04bf025b8f | ||
|
|
1daa8d7f1a | ||
|
|
97a302a20a | ||
|
|
87a0fbe8bf | ||
|
|
54b4140e09 | ||
|
|
99267f902b | ||
|
|
0338a2fd7c | ||
|
|
e134a5ed08 | ||
|
|
0d8f4a3de8 | ||
|
|
d5e7cb1a28 | ||
|
|
e995fcb14d | ||
|
|
f865531fa5 | ||
|
|
104f3e2e83 | ||
|
|
d298757300 | ||
|
|
b66ade378a | ||
|
|
be36f2e3e8 | ||
|
|
00dc43eb39 | ||
|
|
efeeb00a0a | ||
|
|
cc5b7a8a17 | ||
|
|
ce8425ce70 | ||
|
|
ce5b916828 | ||
|
|
7f04196f58 | ||
|
|
762d5a5daa | ||
|
|
abc997d3f3 | ||
|
|
924b54d8d3 | ||
|
|
bd8dd65766 | ||
|
|
5372956a9a | ||
|
|
bf0ddc5321 | ||
|
|
7895966aa2 | ||
|
|
0f716b5197 | ||
|
|
dd56712aa4 | ||
|
|
b7de0cf4bb | ||
|
|
09f6449a6e | ||
|
|
f00e7fe965 | ||
|
|
dd7aac2a8c | ||
|
|
49ffec4bc9 | ||
|
|
0a638e202b | ||
|
|
82676d8390 | ||
|
|
95d6cadee1 | ||
|
|
4672442d50 | ||
|
|
7a8759e46a | ||
|
|
f28659ebe0 | ||
|
|
f10457c8cb | ||
|
|
bd3f962614 | ||
|
|
a4aa0b3521 | ||
|
|
06204d8523 | ||
|
|
4b5dbec851 | ||
|
|
ab6035acbd | ||
|
|
72b7726f1e | ||
|
|
56ab101640 | ||
|
|
4ee030a2ea | ||
|
|
ec402a2ea1 | ||
|
|
52466671ab | ||
|
|
3a54432533 | ||
|
|
7a8e1b9076 | ||
|
|
237e8d7b6d | ||
|
|
bd468e4761 | ||
|
|
67169eff2a | ||
|
|
1ad1ef12b4 | ||
|
|
a012f98b4c | ||
|
|
1f3c696867 | ||
|
|
b861a89031 | ||
|
|
ca9e4f1765 | ||
|
|
a94c701f66 | ||
|
|
13684e1ce6 | ||
|
|
00d5c0849c | ||
|
|
2ae25830e7 | ||
|
|
645a3bb5e5 | ||
|
|
85fbea1d40 | ||
|
|
4be8594678 | ||
|
|
1cb7520cb9 | ||
|
|
bb6131b1f7 | ||
|
|
f268b27622 | ||
|
|
85387d16b1 | ||
|
|
566a5ebcc7 | ||
|
|
48104e2831 | ||
|
|
f9e6d17778 | ||
|
|
47ffb81c08 | ||
|
|
fd050bc759 | ||
|
|
76d1fd9cb3 | ||
|
|
3bf86b8652 | ||
|
|
c914639104 | ||
|
|
425d48e974 | ||
|
|
c339eae256 | ||
|
|
fa7ef67b91 | ||
|
|
fc374d0f29 | ||
|
|
01808d21b2 | ||
|
|
5a1fdc0b07 | ||
|
|
6a84c4511a | ||
|
|
11704f2f91 | ||
|
|
d48965a03f | ||
|
|
bd12c3d6e8 | ||
|
|
249072f280 | ||
|
|
ece01dd366 | ||
|
|
2d82d20613 | ||
|
|
e6371c74d6 | ||
|
|
aa25a78ff1 | ||
|
|
60d1c43735 | ||
|
|
795fc9e805 | ||
|
|
1af894cba6 | ||
|
|
4ba1558caa | ||
|
|
cfb06f61d0 | ||
|
|
d786c69d46 | ||
|
|
5d2b838d3e | ||
|
|
88060bc42a | ||
|
|
16c3f49ff5 | ||
|
|
4b6eaad9a8 | ||
|
|
af241bb222 | ||
|
|
ae621822c4 | ||
|
|
1a6ac9fa87 | ||
|
|
749e38735a | ||
|
|
292276ce75 | ||
|
|
1bcc2854af | ||
|
|
cee063223e | ||
|
|
44e1f1c867 | ||
|
|
0b2d89a810 | ||
|
|
d16a53087d | ||
|
|
f4ca987fae | ||
|
|
c6e8ad013c | ||
|
|
76e6d34d67 | ||
|
|
3bdc80057b | ||
|
|
87f6ea2a1c | ||
|
|
24e065f9a8 | ||
|
|
ba7d1c1153 | ||
|
|
42a13509a4 | ||
|
|
d5b529311a | ||
|
|
dd7e804cab | ||
|
|
ea779bb6c7 | ||
|
|
7ea1adc2d9 | ||
|
|
ae186df3c9 | ||
|
|
8fe00c184f | ||
|
|
a5f99f4fc3 | ||
|
|
5c2c368800 | ||
|
|
8d078181f9 | ||
|
|
6b8e047d33 | ||
|
|
b073b86450 | ||
|
|
61eccddf93 | ||
|
|
98465ecf62 | ||
|
|
fdad57f796 | ||
|
|
8da760a491 | ||
|
|
fb8010b5fd | ||
|
|
7a669d7e1b | ||
|
|
21cb7c14e0 | ||
|
|
7fc00dbbda | ||
|
|
4cf278cbf1 | ||
|
|
7ac322b707 | ||
|
|
818bf818a3 | ||
|
|
e7f75bba07 | ||
|
|
542e9d02e1 | ||
|
|
266a8d27a0 | ||
|
|
52bd1b02c4 | ||
|
|
79f9a81d66 | ||
|
|
5722b66e40 | ||
|
|
03ab529375 | ||
|
|
fa071854de | ||
|
|
6f5d1b88f9 | ||
|
|
326c9b75b9 | ||
|
|
1568031ba3 | ||
|
|
b1dbd89de8 | ||
|
|
aef1a050fa | ||
|
|
e42c88e453 | ||
|
|
7b0dd92085 | ||
|
|
88a46d54d5 | ||
|
|
3ccf98a642 | ||
|
|
fa449667fe | ||
|
|
2abf0f63df | ||
|
|
c53c3dcfc7 | ||
|
|
ab3e270238 | ||
|
|
1d5f1647b1 | ||
|
|
a3b5bf68b8 | ||
|
|
92ec110e27 | ||
|
|
fbf8cea8af | ||
|
|
3843bcea55 | ||
|
|
b9ef557a02 | ||
|
|
c3924d5761 | ||
|
|
a7f537e734 | ||
|
|
24f09d7048 | ||
|
|
973cd18a45 | ||
|
|
99717b5254 | ||
|
|
61641f1b14 | ||
|
|
c6eadab0b8 | ||
|
|
73c1c6aee0 | ||
|
|
f096e3a76c | ||
|
|
25c9a7ebac | ||
|
|
89ff50412e | ||
|
|
1f839c80bb | ||
|
|
e3a42fc8cf | ||
|
|
8f5d47b5d5 | ||
|
|
5bab70dee7 | ||
|
|
e1b385b676 | ||
|
|
c55f8790ff | ||
|
|
1171e41fe5 | ||
|
|
5ef2844c7b | ||
|
|
99efedcf0f | ||
|
|
f5afeba8ac | ||
|
|
0f5dfa0395 | ||
|
|
377e940927 | ||
|
|
41df4b3105 | ||
|
|
88cc1792d8 | ||
|
|
b775d2b45b | ||
|
|
28e3fc9223 | ||
|
|
1f6145e16b | ||
|
|
44fbd4c993 | ||
|
|
a082f44bba | ||
|
|
a06e9017bd | ||
|
|
860d5c40a6 | ||
|
|
7dcc594fba | ||
|
|
9ebc827e85 | ||
|
|
7002da04e2 | ||
|
|
e47a300305 | ||
|
|
40a04b8615 | ||
|
|
c45a0ceae4 | ||
|
|
a4f53e11da | ||
|
|
2936f538aa | ||
|
|
49634a0c0e | ||
|
|
c191553de2 | ||
|
|
04b0490017 | ||
|
|
984f5454ef | ||
|
|
3f60546197 | ||
|
|
33a8f7fe81 | ||
|
|
ae1a0b0738 | ||
|
|
04205b9ac2 | ||
|
|
55fd3f6241 | ||
|
|
7bab39b4b2 | ||
|
|
095a635ac2 | ||
|
|
f1a9452b56 | ||
|
|
cdd1f7ab75 | ||
|
|
f709852ae3 | ||
|
|
b84033c641 | ||
|
|
aadbbda3e9 | ||
|
|
c9e6cf8428 | ||
|
|
7265b88a70 | ||
|
|
ec3128865b | ||
|
|
78c895f23a | ||
|
|
f87742703b | ||
|
|
27e2d73ae1 | ||
|
|
3de93cf5c2 | ||
|
|
4b0041f6fd | ||
|
|
f020406a90 | ||
|
|
74b15fdca3 | ||
|
|
e113ff5534 | ||
|
|
4e3216e405 | ||
|
|
58c8fe5bb4 | ||
|
|
5cf12fea90 | ||
|
|
ca74205ac1 | ||
|
|
c8b670737a | ||
|
|
89314cae0b | ||
|
|
d85d2048c0 | ||
|
|
426a2b89a3 | ||
|
|
1a8a95e2f6 | ||
|
|
cec2fe6f92 | ||
|
|
dba7f1f97c | ||
|
|
15a5c5dedf | ||
|
|
0c20ed1c78 | ||
|
|
6995815f77 | ||
|
|
eb8d678e0f | ||
|
|
f831eb5259 | ||
|
|
3a19aca30f | ||
|
|
4a039722fc | ||
|
|
6a51fb87de | ||
|
|
6eb4364b48 | ||
|
|
730335f7d2 | ||
|
|
9775ac0bb4 | ||
|
|
0c779bb73b | ||
|
|
9d8957d853 | ||
|
|
bb9cfdf487 | ||
|
|
dcb6cad37d | ||
|
|
379d6b878b | ||
|
|
1e0e15653a | ||
|
|
bd25c841d4 | ||
|
|
5a67915eec | ||
|
|
f78381e0d2 | ||
|
|
c657b6cd76 | ||
|
|
cdb6bed47c | ||
|
|
fe8ac41906 | ||
|
|
b0c0230535 | ||
|
|
36ae18c95b | ||
|
|
963af3d4b5 | ||
|
|
08825a3914 | ||
|
|
cd3c3669c3 | ||
|
|
8141f9d62c | ||
|
|
2603da87a7 | ||
|
|
98a9ee7ba5 | ||
|
|
8dd0627a3f | ||
|
|
bf73f20997 | ||
|
|
ecba6c9067 | ||
|
|
2778420bcd | ||
|
|
abc2c6c233 | ||
|
|
3c96d7d3b9 | ||
|
|
a0165dcc73 | ||
|
|
5ae47c1892 | ||
|
|
882d6911d4 | ||
|
|
6e49e15db6 | ||
|
|
c1f4516d8e | ||
|
|
26a05cbb75 | ||
|
|
30baf028d7 | ||
|
|
678d8ad567 | ||
|
|
47f5c981f7 | ||
|
|
656f9fb27b | ||
|
|
402669463a | ||
|
|
f9b9d172ef | ||
|
|
6a8445c545 | ||
|
|
92addd0ba0 | ||
|
|
4f061b4b66 | ||
|
|
bc3991024d | ||
|
|
e42b1097a1 | ||
|
|
84bd79bdd6 | ||
|
|
156fd4f766 | ||
|
|
3fc4b8a73e | ||
|
|
3706e0b9ef | ||
|
|
5017b9155e | ||
|
|
f1a24d7008 | ||
|
|
11efefb309 | ||
|
|
864c69d8ae | ||
|
|
66290ca8bb | ||
|
|
3a603c64eb | ||
|
|
904cc86836 | ||
|
|
a6b4cccfcc | ||
|
|
1ba929a1bc | ||
|
|
27db3c5545 | ||
|
|
c0d178f2a5 | ||
|
|
b76cf64e03 | ||
|
|
cb0f28ef56 | ||
|
|
cad2b4be1f | ||
|
|
1b3b27088b | ||
|
|
52ede67c78 | ||
|
|
da710a8ea5 | ||
|
|
e0685ee791 | ||
|
|
77d1a1fe79 | ||
|
|
f8af9dc5ec | ||
|
|
2948186053 | ||
|
|
7750caf7f5 | ||
|
|
317145634e | ||
|
|
a0bca11b5e | ||
|
|
b92491464e | ||
|
|
f9e82d7b5b | ||
|
|
6ce90a657e | ||
|
|
00f9ef780c | ||
|
|
ae820c047d | ||
|
|
c00060ccd6 | ||
|
|
99fe0ef701 | ||
|
|
3272f6a7ca | ||
|
|
be779fb032 | ||
|
|
cdaa705bf2 | ||
|
|
b25640f5cd | ||
|
|
3e1eb2c26a | ||
|
|
502a2208da | ||
|
|
f5b4997f5a | ||
|
|
7f3363ed1b | ||
|
|
4a088ffd1c | ||
|
|
b3a24bc064 | ||
|
|
b8b49c884a | ||
|
|
3bbd300a6f | ||
|
|
228e5d6e2c | ||
|
|
5073a86a81 | ||
|
|
09fb98d1a8 | ||
|
|
c8fcae0267 | ||
|
|
bb1a867ba9 | ||
|
|
12f7b56d8e | ||
|
|
9b9b69db8f | ||
|
|
bfd89fed46 | ||
|
|
6b3dd5818f | ||
|
|
fdd1dca318 | ||
|
|
598b38c030 | ||
|
|
3faff63044 | ||
|
|
8f7c3669b4 | ||
|
|
f719073b64 | ||
|
|
38324be853 | ||
|
|
eda07c2623 | ||
|
|
8e57bbc89b | ||
|
|
d96302eea4 | ||
|
|
d808393085 | ||
|
|
be10424499 | ||
|
|
885f7f1239 | ||
|
|
3267182a19 | ||
|
|
1b5c95d390 | ||
|
|
ab22b4c6b1 | ||
|
|
58734bc8f3 | ||
|
|
16a80f24ec | ||
|
|
9f23a4e63c | ||
|
|
2154f7c134 | ||
|
|
1327943b0d | ||
|
|
3511b47856 | ||
|
|
d9ddb5f128 | ||
|
|
9e7915e0b8 | ||
|
|
df488dcfb4 | ||
|
|
529cb0aeb2 | ||
|
|
5ab09d60df | ||
|
|
f7121e0e84 | ||
|
|
9f632e96a7 | ||
|
|
64d79c39bc | ||
|
|
ae15ae5dd7 | ||
|
|
313fb95cdd | ||
|
|
b56536c1e0 | ||
|
|
5a6c51162c | ||
|
|
358b411758 | ||
|
|
d3dbf90646 | ||
|
|
8539d6cfe8 | ||
|
|
7c173a7357 | ||
|
|
219d8e7557 | ||
|
|
10a7f18099 | ||
|
|
da2393edec | ||
|
|
36c46c3717 | ||
|
|
6272cb32de | ||
|
|
9ce26b7f23 | ||
|
|
15134a7247 | ||
|
|
2de708e08b | ||
|
|
38e5604fed | ||
|
|
131c152165 | ||
|
|
242327a978 | ||
|
|
c25e6ab28f | ||
|
|
fe1e1af143 | ||
|
|
891e294746 | ||
|
|
61f2920db1 | ||
|
|
ca051ca489 | ||
|
|
afbb5646bd | ||
|
|
1647299798 | ||
|
|
efbdd85054 | ||
|
|
0b2f5dda9a | ||
|
|
bea9ff0f87 | ||
|
|
9bbfeee6aa | ||
|
|
8a1f53463d | ||
|
|
dd41b4b573 | ||
|
|
abee9b7f90 | ||
|
|
7bb1e1fabe | ||
|
|
1f06ccede8 | ||
|
|
b111eb1246 | ||
|
|
c3eeb956d9 | ||
|
|
fdabc69dfa | ||
|
|
e4f56f549c | ||
|
|
debc7f9ec6 | ||
|
|
0c8cdd6297 | ||
|
|
6cecf882b8 | ||
|
|
4d12bc6833 | ||
|
|
2dbce56aa9 | ||
|
|
00b1d90297 | ||
|
|
63bb34d06a | ||
|
|
aede464e88 | ||
|
|
6ab355131f | ||
|
|
8564d6081e | ||
|
|
c01d17de44 | ||
|
|
f5cdc3a3e7 | ||
|
|
10b20e8fd4 | ||
|
|
49f3ec4cd4 | ||
|
|
ae23f756ec | ||
|
|
c7ae8699ca | ||
|
|
df6a493b47 | ||
|
|
14136cd10a | ||
|
|
923747dc4e | ||
|
|
efb2c35438 | ||
|
|
00887c2cfc | ||
|
|
6afb559fe3 | ||
|
|
be301272fa | ||
|
|
b2ac4d3a46 | ||
|
|
52b4f37130 | ||
|
|
88fc0d3692 | ||
|
|
a9c8166acd | ||
|
|
8e21ad37f7 | ||
|
|
329458ea54 | ||
|
|
aa34cd098e | ||
|
|
c2fad5fad2 |
20
bbf/Makefile
20
bbf/Makefile
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=4.1.5
|
||||
PKG_VERSION:=6.0.6
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=838372a16ed0029cd681626bb5adb722f6a7681e
|
||||
PKG_SOURCE_VERSION:=9842552d421adb529b8771b8f9dc41ddc89f5b62
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -35,7 +35,7 @@ define Package/libbbfdm
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=BBF
|
||||
TITLE:=Library for broadband-forum data model
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libmbedtls +libcurl
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libcurl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
@@ -57,11 +57,9 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_LIST=\\\"$(CONFIG_BBF_VENDOR_LIST)\\\"
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror \
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR181),y)
|
||||
CONFIGURE_ARGS += \
|
||||
@@ -83,17 +81,13 @@ CONFIGURE_ARGS += \
|
||||
--enable-libopenssl
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_libmbedtls),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-libmbedtls
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-vendor-extension
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
BBF_VENDOR_LIST="$(CONFIG_BBF_VENDOR_LIST)"
|
||||
BBF_VENDOR_LIST="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
BBF_VENDOR_PREFIX="$(CONFIG_BBF_VENDOR_PREFIX)"
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
PKG_SOURCE_VERSION:=e4f39d1bf4678fc05b9d02e81b194c70719909e4
|
||||
PKG_SOURCE_VERSION:=150eb3122c969d1646c8ca8c8152154990f91823
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=crun
|
||||
PKG_VERSION:=0.18
|
||||
PKG_VERSION:=0.20
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/containers/crun.git
|
||||
PKG_SOURCE_DATE:=2021-03-18
|
||||
PKG_SOURCE_VERSION:=496e81bdd69f117f10e4477e4204e4611a94b68f
|
||||
PKG_MIRROR_HASH:=26941b0d84bbeabeb5e982af48d131f55d0aa16f4a2f2ca3279a5c812cdeea8b
|
||||
PKG_SOURCE_DATE:=2021-06-07
|
||||
PKG_SOURCE_VERSION:=8d6a8b5ab80461cfed19f020a36584af13c32038
|
||||
PKG_MIRROR_HASH:=9ca1f0e530b33ce8820bd03329eb6731c5050d6e7f35bd2463d9a81cc00382e0
|
||||
|
||||
PKG_BUILD_DEPENDS:=argp-standalone
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
@@ -74,8 +74,7 @@ define Package/crun/install
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/crun $(1)/usr/bin/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrun.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
@@ -8,17 +8,17 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.0.13
|
||||
PKG_VERSION:=3.1.18
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=2c4fdf3f3ffc299c7596e6d0dc4be86485250533
|
||||
PKG_SOURCE_VERSION:=0e937cfb839f845cf28922c4dde0572ec2842f85
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
RSTRIP:=true
|
||||
@@ -34,7 +34,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=DECT Manager
|
||||
DEPENDS:= +libubox +ubus
|
||||
DEPENDS:= +libubox +ubus +uci
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
|
||||
2
dectmngr/files/etc/config/dect
Normal file
2
dectmngr/files/etc/config/dect
Normal file
@@ -0,0 +1,2 @@
|
||||
config dect 'global'
|
||||
option log_dect_cmbs '0'
|
||||
BIN
dectmngr/files/etc/dspg/04131410.bin
Normal file
BIN
dectmngr/files/etc/dspg/04131410.bin
Normal file
Binary file not shown.
@@ -9,6 +9,7 @@ USE_PROCD=1
|
||||
NAME=dectmngr
|
||||
PROG=/usr/sbin/dectmngr
|
||||
LOG_PATH=/var/log/dectmngr
|
||||
DB_PATH=/etc/dect
|
||||
|
||||
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
|
||||
stop_and_wait_dectmngr() {
|
||||
@@ -22,17 +23,35 @@ stop_and_wait_dectmngr() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local opt_ext=
|
||||
local rfpi=
|
||||
local opt_rfpi=
|
||||
local model_id=
|
||||
|
||||
test $(db get hw.board.hasDect) = "0" && return
|
||||
|
||||
echo 1 > /sys/class/gpio/gpio14/value
|
||||
|
||||
rfpi=$(db -q get hw.board.dect_rfpi)
|
||||
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_rfpi="-rfpi $rfpi"
|
||||
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
|
||||
|
||||
# model_id=$(db -q get hw.board.dect_model_id)
|
||||
# Setting model_id to 0x010203 is a workaround to reduce synchronisation time of some handset
|
||||
# TODO: remove below line and uncomment the line above to get value from db when the problem is solved
|
||||
model_id="01.02.03"
|
||||
[ -n "$model_id" -a ${#model_id} -eq 8 ] && opt_ext="$opt_ext -model $model_id"
|
||||
|
||||
config_load dect
|
||||
config_get_bool log_dect_cmbs global log_dect_cmbs 0
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_rfpi
|
||||
if [ $log_dect_cmbs -eq 0 ]; then
|
||||
echo "Starting dectmngr with cmbs logging disabled"
|
||||
procd_set_param command $PROG -comname ttyH0 $opt_ext
|
||||
rm -f $LOG_PATH/*
|
||||
else
|
||||
echo "Starting dectmngr with cmbs logging enabled"
|
||||
procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_ext
|
||||
fi
|
||||
procd_set_param respawn 6 2 3
|
||||
procd_set_param term_timeout 20
|
||||
procd_set_param triggers asterisk
|
||||
@@ -53,7 +72,7 @@ reload_service() {
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger asterisk
|
||||
procd_add_reload_trigger asterisk dect
|
||||
}
|
||||
|
||||
boot() {
|
||||
@@ -61,6 +80,7 @@ boot() {
|
||||
echo out > /sys/class/gpio/gpio14/direction
|
||||
|
||||
[ ! -d $LOG_PATH ] && mkdir -p $LOG_PATH
|
||||
[ ! -d $DB_PATH ] && mkdir -p $DB_PATH
|
||||
start
|
||||
}
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_VERSION:=1.1.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d17c699c1fc9588303d6da35ac2250903bf17cd8
|
||||
PKG_SOURCE_VERSION:=bb754ae620a9fc66fd6fc0745f0fead0708c7a17
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=6.2.19
|
||||
PKG_VERSION:=6.4.5
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d1fd660106d9ac3c937d005775608df43e1aa17c
|
||||
PKG_SOURCE_VERSION:=23028753fdfc5f4a0e8da33fb6b813e21c5d6c23
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -18,6 +18,7 @@ define Build/InstallDev/libeasy
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/if_utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/debug.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/hlist.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ endef
|
||||
define Build/InstallDev/libqos
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libqos/qos.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libqos/include/qos.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libqos/libqos.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
@@ -9,11 +9,14 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=endptmngr
|
||||
PKG_VERSION:=0.5
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_VERSION:=d3938443caffea15641bff72837d2de0cf87d62c
|
||||
PKG_SOURCE_VERSION:=debfc47348d6e1fc1c8b126ad50a7f5f8db3e19d
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@@ -47,6 +50,12 @@ define Package/endptmngr/description
|
||||
endptmngr
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -av --exclude=.* ~/git/endptmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/endptmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_VERSION:=1.0
|
||||
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=485a38bc4eaf2a54d080b8529d5130b2955626d1
|
||||
PKG_SOURCE_VERSION:=45575262de7a9690bcb2c760f35e2c74e88e1176
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
|
||||
@@ -43,10 +43,15 @@
|
||||
static ssize_t get_led_color(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
/* [ln] todo: dummy implementation */
|
||||
int len;
|
||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
||||
|
||||
len = scnprintf(buf, PAGE_SIZE, "%d\n", 123);
|
||||
if (IS_ERR(sk9822)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
len = scnprintf(buf, PAGE_SIZE, "%02x%02x%02x\n", sk9822->led_colors[0].r, sk9822->led_colors[0].g, sk9822->led_colors[0].b);
|
||||
if (len <= 0) {
|
||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
||||
return -EIO;
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=7.0.1-2021-05-14
|
||||
PKG_VERSION:=8.2.0-2021-10-05
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f70cc81e5688e32aa82084faae5bc6ff710bb81b
|
||||
PKG_SOURCE_VERSION:=ab875277578d851a9f8eed57883ca05c886b127d
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -29,8 +29,6 @@ PKG_CONFIG_DEPENDS:= \
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
@@ -57,24 +55,8 @@ endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
ifneq ($(CWMP_REVISION)_,_)
|
||||
ifneq ($(CWMP_REVISION),exported)
|
||||
ifneq ($(CWMP_REVISION),Unversioned directory)
|
||||
TARGET_CFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
|
||||
TARGET_LDFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
TARGET_LDFLAGS += \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--with-uci-include-path=$(STAGING_DIR)/usr/include \
|
||||
--with-libubox-include-path=$(STAGING_DIR)/usr/include \
|
||||
--with-libubus-include-path=$(STAGING_DIR)/usr/include
|
||||
-D_GNU_SOURCE \
|
||||
"-DCWMP_REVISION=\\\"$(PKG_SOURCE_VERSION)\\\""
|
||||
|
||||
ifeq ($(CONFIG_CWMP_ACS_MULTI),y)
|
||||
CONFIGURE_ARGS += \
|
||||
@@ -99,26 +81,20 @@ endif
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
echo "Enabling rc.d symlink for icwmpd"
|
||||
/etc/init.d/icwmpd enable
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
echo "Disabling rc.d symlink for icwmpd"
|
||||
/etc/init.d/icwmpd disable
|
||||
fi
|
||||
exit 0
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/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
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/90-icwmp $(1)/etc/hotplug.d/iface/90-icwmp
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(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/90-icwmp-set-dhcp-reqopts $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -39,6 +39,7 @@ config cpe 'cpe'
|
||||
option exec_download '0'
|
||||
option periodic_notify_enable '1'
|
||||
option periodic_notify_interval '10'
|
||||
option incoming_rule 'Port_Only'
|
||||
|
||||
config lwn 'lwn'
|
||||
option enable '1'
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
#created by the icwmp package
|
||||
zone_name=""
|
||||
port=""
|
||||
#created by the icwmp package
|
||||
|
||||
if [ ! -f "/var/state/cwmp" ]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
zone_name=$(uci -c /var/state -q get cwmp.acs.zonename)
|
||||
port=$(uci -c /var/state -q get cwmp.acs.port)
|
||||
ipaddr=$(uci -c /var/state -q get cwmp.acs.ip)
|
||||
ipv6enable=$(uci -c /var/state -q get cwmp.acs.ipv6_enable)
|
||||
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|tr [A-Z] [a-z])
|
||||
|
||||
if [ "$zone_name" = "" ]; then
|
||||
exit 0
|
||||
elif [ "$zone_name" = "icwmp" ]; then
|
||||
@@ -18,4 +27,45 @@ else
|
||||
iptables -t filter -D INPUT -j zone_icwmp_input 2> /dev/null
|
||||
iptables -X zone_icwmp_input 2> /dev/null
|
||||
fi
|
||||
#iptables -I FW_ZONE -p tcp -s ACS_ADDRESS --dport PORT -j ACCEPT --comment "Open ACS port"
|
||||
|
||||
cmd=""
|
||||
|
||||
if [ "${ipv6enable}" = "1" ]; then
|
||||
cmd="ip6tables"
|
||||
else
|
||||
cmd="iptables"
|
||||
fi
|
||||
|
||||
cmd="${cmd} -I zone_${zone_name}_input -p tcp"
|
||||
|
||||
# default incoming rule is Port only
|
||||
if [ -z "${incoming_rule}" ]; then
|
||||
incoming_rule="port_only"
|
||||
fi
|
||||
|
||||
if [ "${incoming_rule}" = "ip_only" ]; then
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
fi
|
||||
elif [ "${incoming_rule}" = "port_only" ]; then
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
fi
|
||||
else
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
fi
|
||||
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ${cmd}|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -ne 0 ]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
cmd="${cmd} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
|
||||
${cmd}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
|
||||
[ -f /etc/config/cwmp ] || exit 0
|
||||
@@ -23,7 +24,7 @@ handle_icwmp_restart() {
|
||||
|
||||
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||
|
||||
|
||||
mkdir -p /tmp/ipv4
|
||||
|
||||
network_flush_cache
|
||||
@@ -63,11 +64,41 @@ handle_icwmp_restart() {
|
||||
network_get_device curdev $INTERFACE
|
||||
[ -n "$curdev" ] && echo $curdev > $devfile || rm -f $devfile
|
||||
|
||||
local wan_iface=`uci get cwmp.cpe.default_wan_interface`
|
||||
local vendorspecinf=`ubus call network.interface.wan status | jsonfilter -e "@.data.vendorspecinf"`
|
||||
[ -n "$vendorspecinf" ] && {
|
||||
local url=""
|
||||
case $vendorspecinf in
|
||||
http://*|https://*)
|
||||
url="$vendorspecinf"
|
||||
;;
|
||||
*)
|
||||
for optval in $vendorspecinf; do
|
||||
case $optval in
|
||||
1=*)
|
||||
url="$(echo $optval | cut -d"=" -f2-)"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
esac
|
||||
if [ ! -f /var/state/cwmp ]; then
|
||||
touch /var/state/cwmp
|
||||
fi
|
||||
uci -q -c /var/state/ get cwmp.acs
|
||||
if [ "$?" -ne 0 ]; then
|
||||
unnamed=`uci -q -c /var/state/ add cwmp acs`
|
||||
uci -c /var/state/ -q rename cwmp.$unnamed='acs'
|
||||
fi
|
||||
[ -n "$url" ] && uci -c /var/state -q set cwmp.acs.dhcp_url="$url"
|
||||
uci -c /var/state commit cwmp
|
||||
}
|
||||
|
||||
local prevopt43url=""
|
||||
local curopt43url=""
|
||||
local opt43urlfile=/tmp/ipv4/$INTERFACE-opt43url
|
||||
prevopt43url=$(cat $opt43urlfile 2>/dev/null)
|
||||
curopt43url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||
curopt43url="$(uci -c /var/state -q get cwmp.acs.dhcp_url)"
|
||||
[ -n "$curopt43url" ] && echo $curopt43url > $opt43urlfile || rm -f $opt43urlfile
|
||||
|
||||
[ \
|
||||
@@ -81,6 +112,8 @@ handle_icwmp_restart() {
|
||||
[ -z "$prevopt43url" ] && exit 0
|
||||
}
|
||||
|
||||
echo "Restarting icwmp"|logger -t cwmp.hotplug -p info
|
||||
|
||||
/etc/init.d/icwmpd reload &
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@ PROG="/usr/sbin/icwmpd"
|
||||
|
||||
EXTRA_HELP=" start [GetRPCMethods] Start icwmpd service and send GetRPCMethods"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t cwmp.init -p info
|
||||
}
|
||||
|
||||
validate_url() {
|
||||
# SCHEMA_LIST: contain list of possible schemas that could be present in the acs url
|
||||
# Example: SCHEMA_LIST="http https"
|
||||
@@ -31,19 +35,19 @@ get_acs_url() {
|
||||
local default_acs="http://10.10.1.6:8000/openacs/acs"
|
||||
local acs_dhcp_discovery="$(uci -q get cwmp.acs.dhcp_discovery)"
|
||||
local url="$(uci -q get cwmp.acs.url)"
|
||||
local dhcp_url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||
local dhcp_url="$(uci -c /var/state -q get cwmp.acs.dhcp_url)"
|
||||
|
||||
if [ "$acs_dhcp_discovery" == "enable" -a -n "$dhcp_url" -o -z "$url" ]; then
|
||||
url="$dhcp_url"
|
||||
echo "ACS URL from DHCP server: $url"
|
||||
[ -n "$url" ] && uci -P /var/state -q set cwmp.acs.url="$url" || url="$default_acs"
|
||||
log "ACS URL from DHCP server: $url"
|
||||
[ -n "$url" ] && uci -c /var/state -q set cwmp.acs.url="$url" || url="$default_acs"
|
||||
elif [ -n "$url" ];then
|
||||
url="$(uci -q get cwmp.acs.url)"
|
||||
echo "ACS URL from configuration: $url"
|
||||
log "ACS URL from configuration: $url"
|
||||
else
|
||||
url="$default_acs"
|
||||
echo "Using default ACS URL: $url"
|
||||
[ -n "$url" ] && uci -P /var/state -q set cwmp.acs.url="$url"
|
||||
log "Using default ACS URL: $url"
|
||||
[ -n "$url" ] && uci -c /var/state -q set cwmp.acs.url="$url"
|
||||
fi
|
||||
|
||||
validate_url "$url"
|
||||
@@ -108,10 +112,10 @@ wait_for_option43() {
|
||||
|
||||
if [ "$dhcp_discovery" == "enable" -o "$dhcp_discovery" == "1" ]
|
||||
then
|
||||
echo "Waiting for discovery of ACS URL from dhcp server ..."
|
||||
log "Waiting for discovery of ACS URL from dhcp server ..."
|
||||
while [ $tm -le $time ]
|
||||
do
|
||||
acs_url=`uci -P /var/state -q get cwmp.acs.dhcp_url`
|
||||
acs_url=`uci -c /var/state -q get cwmp.acs.dhcp_url`
|
||||
if [ "$acs_url" != "" ]
|
||||
then
|
||||
break
|
||||
@@ -150,30 +154,40 @@ set_wan_interface() {
|
||||
fi
|
||||
}
|
||||
|
||||
service_running() {
|
||||
ubus wait_for usp.raw
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ ! -f /tmp/.icwmpd_boot ]; then
|
||||
touch /etc/icwmpd/.icwmpd_boot
|
||||
touch /tmp/.icwmpd_boot
|
||||
else
|
||||
[ -f /sbin/netifd ] && echo "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
||||
[ -f /etc/config/wireless ] && echo "Waiting for WiFi to be started ..." && ubus -t 5 wait_for network.wireless
|
||||
[ -f /usr/sbin/dnsmasq ] && echo "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
|
||||
[ -f /etc/config/dhcp ] && echo "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
|
||||
[ -f /usr/sbin/asterisk ] && echo "Waiting for Voice to be started ..." && ubus -t 5 wait_for asterisk
|
||||
[ -f /sbin/netifd ] && log "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
||||
[ -f /etc/config/wireless ] && log "Waiting for WiFi to be started ..." && ubus -t 5 wait_for network.wireless
|
||||
[ -f /usr/sbin/dnsmasq ] && log "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
|
||||
[ -f /etc/config/dhcp ] && log "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
|
||||
[ -f /usr/sbin/asterisk ] && log "Waiting for Voice to be started ..." && ubus -t 5 wait_for asterisk
|
||||
|
||||
log "Waiting for usp.raw to be started"
|
||||
ubus wait_for usp.raw
|
||||
|
||||
config_load cwmp
|
||||
set_wan_interface
|
||||
wait_for_option43 20
|
||||
get_acs_url
|
||||
|
||||
procd_open_instance
|
||||
procd_open_instance icwmp
|
||||
procd_set_param command "$PROG"
|
||||
if [ "$1" = "GetRPCMethods" ];then
|
||||
procd_append_param command -g
|
||||
elif [ -f /etc/icwmpd/.icwmpd_boot ]; then
|
||||
procd_append_param command -b
|
||||
fi
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
procd_set_param respawn \
|
||||
${respawn_threshold:-5} \
|
||||
${respawn_timeout:-10} ${respawn_retry:-3}
|
||||
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# As part of sysupgrade we copy CWMP Backup Session XML file.
|
||||
|
||||
|
||||
# Abort on any error.
|
||||
set -e
|
||||
|
||||
|
||||
# Do nothing if user want to discard old settings.
|
||||
if [ -n "$SAVE_CONFIG" ] && [ $SAVE_CONFIG -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Source functions.
|
||||
for f in /lib/upgrade/iopsys*.sh; do
|
||||
[ -r "$f" -a -s "$f" ] || continue
|
||||
source $f
|
||||
done
|
||||
|
||||
|
||||
if [ -s "${2}/etc/icwmpd/.icwmpd_backup_session.xml" ]; then
|
||||
cat "${2}/etc/icwmpd/.icwmpd_backup_session.xml" > "/etc/icwmpd/.icwmpd_backup_session.xml"
|
||||
fi
|
||||
|
||||
# Report success.
|
||||
log "post-hooks" "CWMP Backup Session XML file migrated"
|
||||
|
||||
exit 0
|
||||
@@ -1,29 +1,10 @@
|
||||
if PACKAGE_ieee1905 || PACKAGE_lib1905al
|
||||
if (PACKAGE_ieee1905)
|
||||
|
||||
menu "developer/debug options"
|
||||
menu "Configurations"
|
||||
|
||||
config IEEE1905_MAP_COMPLETE_NETWORK
|
||||
bool "Create network topology for complete network"
|
||||
default n
|
||||
config IEEE1905_EXTENSION_ALLOWED
|
||||
bool "Allow plugins to extend 1905 CMDUs and/or TLVs"
|
||||
default y
|
||||
|
||||
config IEEE1905_SPEED_UP_DISCOVERY
|
||||
bool "Speed up discovery of an AL in network"
|
||||
default y
|
||||
|
||||
config IEEE1905_DO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS
|
||||
bool "Do not accept M1/M2 messages from unknown AL(s)"
|
||||
default y
|
||||
|
||||
choice
|
||||
prompt "Select ALME support"
|
||||
default IEEE1905_ALME_OVER_UBUS
|
||||
|
||||
config IEEE1905_ALME_OVER_UBUS
|
||||
bool "ALME methods supported over ubus"
|
||||
|
||||
#config IEEE1905_ALME_OVER_TCP
|
||||
# bool "ALME server over TCP port"
|
||||
|
||||
endchoice
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -1,142 +1,129 @@
|
||||
#
|
||||
# Copyright (C) 2019 Iopsys
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=2.1.44
|
||||
PKG_VERSION:=4.0.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=33d05c2223023ce5b57001008555bd0f82e88541
|
||||
PKG_SOURCE_VERSION:=c4e6275434c65d64a90edbefa225f582f2ce356e
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ieee1905
|
||||
|
||||
define Package/ieee1905/Default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 daemon
|
||||
DEPENDS:= +libuci +libjson-c +libieee1905 +ubox +libpcap +libopenssl +libwifi +libeasy
|
||||
SUBMENU:=IEEE-1905.1 stack
|
||||
endef
|
||||
|
||||
define Package/ieee1905/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/ieee1905/description
|
||||
IEEE1905 stack with extended functionalities.
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/libieee1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 cmdu tlv utility library
|
||||
$(call Package/ieee1905/Default,$(1))
|
||||
TITLE+= (library for CMDU and TLV handling)
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl +libwifi \
|
||||
+libjson-c +libblobmsg-json
|
||||
endef
|
||||
|
||||
define Package/libwsc
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Wifi Simple Configuration building and processing library
|
||||
DEPENDS= +libopenssl +libuci +libubus
|
||||
define Package/ieee1905
|
||||
$(call Package/ieee1905/Default,$(1))
|
||||
TITLE+= ieee1905d (daemon implementing 1905.1 and provides cli)
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl +libwifi \
|
||||
+libjson-c +libblobmsg-json +libwifi +ubus +libpthread \
|
||||
+libnl-genl +libieee1905
|
||||
endef
|
||||
|
||||
define Package/lib1905hle
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 hle stack library
|
||||
|
||||
define Package/map-plugin
|
||||
$(call Package/ieee1905/Default,$(1))
|
||||
TITLE:=Multi-AP (Easymesh) plugin
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl +libwifi \
|
||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
||||
endef
|
||||
|
||||
LIBS := \
|
||||
$(if $(CONFIG_PACKAGE_libwsc),libwsc.so)
|
||||
define Package/ieee1905/description
|
||||
This package provides IEEE Std 1905.1 stack.
|
||||
endef
|
||||
|
||||
define Package/libieee1905/description
|
||||
This package provides library functions for IEEE Std 1905.1 stack.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
-fstrict-aliasing \
|
||||
-Wall \
|
||||
-Wextra
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
MAKE_FLAGS += \
|
||||
LIBS="$(LIBS)"
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(CONFIG_IEEE1905_SPEED_UP_DISCOVERY),y)
|
||||
TARGET_CFLAGS += -DSPEED_UP_DISCOVERY
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_DO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS),y)
|
||||
TARGET_CFLAGS += -DDO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_ALME_OVER_TCP),y)
|
||||
TARGET_CFLAGS += -DALME_OVER_TCP
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_ALME_OVER_UBUS),y)
|
||||
TARGET_CFLAGS += -DALME_OVER_UBUS
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_MAP_COMPLETE_NETWORK),y)
|
||||
TARGET_CFLAGS += -DIEEE1905_MAP_COMPLETE_NETWORK
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/ieee1905/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/ieee1905/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/etc/init.d/ieee1905 $(1)/etc/init.d/ieee1905
|
||||
$(INSTALL_DATA) ./files/etc/config/ieee1905 $(1)/etc/config/ieee1905
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ieee1905d $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/lib1905hle/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/lib1905hle.so $(1)/usr/lib/lib1905hle.so
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ieee1905d $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/libieee1905/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libieee1905.so $(1)/usr/lib/libieee1905.so
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libieee1905.so $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libwsc/install
|
||||
define Package/map-plugin/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libwsc.so $(1)/usr/lib/libwsc.so
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libwsc.so
|
||||
define Build/InstallDev/map-plugin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map2.h $(1)/usr/include/map2.h
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map_module.h $(1)/usr/include/map_module.h
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
||||
endef
|
||||
|
||||
|
||||
define Build/InstallDev/libieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwsc/include/wsc.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libwsc.so $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/cmdu.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/1905_tlvs.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_wsc.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/bufutil.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/timer_impl.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libieee1905.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/include/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/include/lib1905hle
|
||||
$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/ieee1905/
|
||||
$(CP) $(PKG_BUILD_DIR)/libieee1905/include/*.h $(1)/usr/include/ieee1905/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib1905hle/include/*.h $(1)/usr/include/lib1905hle/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libieee1905.so $(1)/usr/lib
|
||||
$(foreach lib,$(LIBS),$(call Build/InstallDev/$(lib),$(1),$(2));)
|
||||
$(call Build/InstallDev/libieee1905,$(1),$(2))
|
||||
$(call Build/InstallDev/map-plugin,$(1),$(2))
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libieee1905))
|
||||
$(eval $(call BuildPackage,lib1905hle))
|
||||
$(eval $(call BuildPackage,libwsc))
|
||||
|
||||
$(eval $(call BuildPackage,ieee1905))
|
||||
$(eval $(call BuildPackage,libieee1905))
|
||||
$(eval $(call BuildPackage,map-plugin))
|
||||
|
||||
31
ieee1905/files/etc/config/ieee1905
Normal file → Executable file
31
ieee1905/files/etc/config/ieee1905
Normal file → Executable file
@@ -1,17 +1,22 @@
|
||||
config ieee1905 'ieee1905'
|
||||
option enabled '1'
|
||||
option debug true
|
||||
option debug_level 2
|
||||
option macaddress 'auto'
|
||||
option registrar 0
|
||||
option cmdu_event 1
|
||||
option map_plugin 1
|
||||
option enabled '1'
|
||||
option extension '1'
|
||||
list extmodule 'map'
|
||||
option registrar '2 5'
|
||||
|
||||
config security 'security'
|
||||
list method 'PBC'
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid 'TestSSID.2'
|
||||
option encryption 'psk2'
|
||||
option key '5555500000'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid 'TestSSID.5'
|
||||
option encryption 'psk2'
|
||||
option key '2222200000'
|
||||
|
||||
config al-iface
|
||||
option enabled 1
|
||||
option ifname 'br-lan'
|
||||
option media 'bridge'
|
||||
|
||||
option enabled 1
|
||||
option ifname 'br-lan'
|
||||
option type 'bridge'
|
||||
67
ieee1905/files/etc/init.d/ieee1905
Normal file → Executable file
67
ieee1905/files/etc/init.d/ieee1905
Normal file → Executable file
@@ -1,72 +1,25 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
STOP=22
|
||||
STOP=21
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ieee1905d
|
||||
|
||||
validate_ieee1905_section()
|
||||
{
|
||||
uci_validate_section ieee1905 ieee1905 "${1}" \
|
||||
'debug:bool:false' \
|
||||
'enabled:bool:false'
|
||||
}
|
||||
|
||||
configure_ieee1905()
|
||||
{
|
||||
local enabled debug
|
||||
|
||||
validate_ieee1905_section ${1} || {
|
||||
echo "Validation of ieee1905 section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
#procd_set_param stdout 1
|
||||
# Same for stderr
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
if [ ${enabled} -ne 1 ]; then
|
||||
exit 0;
|
||||
fi
|
||||
}
|
||||
|
||||
configure_network()
|
||||
{
|
||||
ebtables -L FORWARD|grep -iqE "1:80:C2:(0)+:(0)+:13.*-j.*DROP"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Applying drop rule to drop pkts forwared by kernel to 1905.1 multicast mac"
|
||||
ebtables -A FORWARD -d 01:80:c2:00:00:13 -j DROP
|
||||
fi
|
||||
}
|
||||
|
||||
service_running() {
|
||||
ubus -t 2 wait_for wifi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
|
||||
[ -d /usr/lib/ieee1905 ] || mkdir -p /usr/lib/ieee1905
|
||||
|
||||
procd_open_instance ieee1905
|
||||
procd_set_param command ${PROG}
|
||||
configure_ieee1905 "ieee1905"
|
||||
configure_network
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/ieee1905d"
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "ieee1905"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "network"
|
||||
procd_add_reload_trigger "wireless"
|
||||
procd_add_reload_trigger "netmode"
|
||||
procd_add_reload_trigger "ieee1905"
|
||||
}
|
||||
|
||||
10
iop/config
10
iop/config
@@ -22,14 +22,12 @@ CONFIG_PACKAGE_glib2=y
|
||||
CONFIG_PACKAGE_gre=y
|
||||
CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_PACKAGE_map-1905=y
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_wfadatad=y
|
||||
CONFIG_PACKAGE_imonitor=m
|
||||
CONFIG_PACKAGE_inbd=y
|
||||
CONFIG_PACKAGE_iopupgrade=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
CONFIG_PACKAGE_iperf3=y
|
||||
CONFIG_PACKAGE_ipset=y
|
||||
@@ -42,7 +40,7 @@ CONFIG_PACKAGE_jq=y
|
||||
CONFIG_PACKAGE_libreswan=m
|
||||
CONFIG_PACKAGE_libwifi=y
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
CONFIG_PACKAGE_luci=y
|
||||
CONFIG_PACKAGE_luci-nginx=y
|
||||
# CONFIG_LUCI_JSMIN is not set
|
||||
# CONFIG_LUCI_CSSTIDY is not set
|
||||
CONFIG_PACKAGE_luci-mod-dashboard=y
|
||||
@@ -63,6 +61,7 @@ CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_PACKAGE_owsd=y
|
||||
CONFIG_PACKAGE_periodicstats=y
|
||||
CONFIG_PACKAGE_peripheral_manager=y
|
||||
CONFIG_PACKAGE_port-management=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
||||
@@ -81,6 +80,7 @@ CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rulengd=y
|
||||
CONFIG_PACKAGE_strace=y
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
CONFIG_PACKAGE_swmodd=m
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_terminfo=y
|
||||
@@ -219,3 +219,7 @@ CONFIG_TARGET_ROOTFS_TARGZ=y
|
||||
# Disable it. Most SoCs nowadays has HW random generators anyway.
|
||||
# CONFIG_PACKAGE_urandom-seed is not set
|
||||
# CONFIG_PACKAGE_urngd is not set
|
||||
|
||||
# We use OpenSSL, no need to ship multiple TLS libraries
|
||||
CONFIG_PACKAGE_libustream-openssl=y
|
||||
# CONFIG_PACKAGE_libustream-wolfssl is not set
|
||||
|
||||
@@ -14,7 +14,7 @@ function feeds_update {
|
||||
done
|
||||
|
||||
|
||||
git remote -v | grep -q http || developer=1
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
@@ -32,7 +32,7 @@ function feeds_update {
|
||||
fi
|
||||
|
||||
# targets need to be installed explicitly
|
||||
targets="iopsys-brcm63xx-arm iopsys-ramips intel_mips iopsys-x86 iopsys-armvirt iopsys-bcm27xx iopsys-mediatek"
|
||||
targets="iopsys-brcm63xx-arm iopsys-ramips intel_mips iopsys-x86 iopsys-armvirt iopsys-bcm27xx iopsys-mediatek iopsys-econet"
|
||||
for target in $targets
|
||||
do
|
||||
rm -f target/linux/$target
|
||||
|
||||
@@ -5,7 +5,6 @@ function genconfig {
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
export THEMEDIR="tmp/juci-themes"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
@@ -17,8 +16,9 @@ function genconfig {
|
||||
bcm27xx="target/linux/iopsys-bcm27xx"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
mediatek="target/linux/iopsys-mediatek"
|
||||
econet="target/linux/iopsys-econet"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
|
||||
@@ -116,6 +116,8 @@ function genconfig {
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $mediatek/genconfig ] &&
|
||||
iopsys_mediatek=$(cd $mediatek; ./genconfig)
|
||||
[ -e $econet/genconfig ] &&
|
||||
iopsys_econet=$(cd $econet; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
[ -e $x86/genconfig ] &&
|
||||
@@ -126,7 +128,7 @@ function genconfig {
|
||||
iopsys_bcm27xx=$(cd $bcm27xx; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_mediatek iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_mediatek iopsys_econet iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
@@ -159,6 +161,14 @@ function genconfig {
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_econet; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_econet"
|
||||
target_config_path="$econet/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_intel_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
@@ -195,12 +205,6 @@ function genconfig {
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
endptAllowed=0
|
||||
|
||||
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
|
||||
}
|
||||
|
||||
v() {
|
||||
@@ -233,7 +237,7 @@ function genconfig {
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common | grep -v juci-theme)"
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common)"
|
||||
if [ "$boards" ]; then
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
@@ -250,7 +254,7 @@ function genconfig {
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common | grep -v juci-theme)"
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common)"
|
||||
if [ "$boards" ]; then
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
@@ -304,13 +308,6 @@ function genconfig {
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
|
||||
if [ ! -d "$THEMEDIR" ]; then
|
||||
mkdir -p $THEMEDIR
|
||||
elif [ -d "$THEMEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $THEMEDIR/*"
|
||||
rm -rf $THEMEDIR/*
|
||||
fi
|
||||
}
|
||||
|
||||
create_and_copy_files()
|
||||
@@ -360,26 +357,26 @@ function genconfig {
|
||||
subtarget="xrx500"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||
elif [ "$target" = "iopsys_ramips" ]; then
|
||||
subtarget="mt7621"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_mediatek" ]; then
|
||||
subtarget="mt7622"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_econet" ]; then
|
||||
subtarget="en7562"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
elif [ "$target" = "iopsys_bcm27xx" ]; then
|
||||
subtarget="iopsys_bcm2711"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
@@ -399,11 +396,6 @@ function genconfig {
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/juci-theme" ]; then
|
||||
customer="$(echo $CUSTOMER | tr 'A-Z' 'a-z')"
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
@@ -419,11 +411,14 @@ function genconfig {
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||
local GIT_REV=$(git rev-parse --short HEAD)
|
||||
local GIT_VER="$GIT_TAG"
|
||||
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
# Enable Pckage source tree override if selected
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
# developer mode selected ?
|
||||
@@ -431,12 +426,8 @@ function genconfig {
|
||||
if [ $DEVELOPER -eq 1 ]; then
|
||||
# rewrite url to clone with ssh instead of http
|
||||
echo "CONFIG_GITMIRROR_REWRITE=y" >>.config
|
||||
[ $bcmAllowed -eq 0 ] && echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
[ $endptAllowed -eq 0 ] && echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
else
|
||||
echo "# CONFIG_GITMIRROR_REWRITE is not set" >>.config
|
||||
echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
fi
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
@@ -444,9 +435,6 @@ function genconfig {
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# Force regeneration of themes
|
||||
touch package/feeds/iopsys/juci/Makefile
|
||||
|
||||
# Force regeneration of kernel Makefile
|
||||
# Needed to disable kmods for iopsys-brcm targets
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
@@ -9,13 +9,14 @@ function genconfig_min {
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
#always use the mirror
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
config_path=""
|
||||
target_config_path=""
|
||||
bcm27xx="target/linux/iopsys-bcm27xx"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
mediatek="target/linux/iopsys-mediatek"
|
||||
econet="target/linux/iopsys-econet"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
@@ -80,7 +81,7 @@ function genconfig_min {
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
local profile=$1
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
@@ -102,7 +103,7 @@ function genconfig_min {
|
||||
|
||||
if [ $pfound -eq 1 ]; then
|
||||
target="$(echo $TARGET | tr '-' '_')"
|
||||
config_path="$targetpath/config"
|
||||
target_config_path="$targetpath/config"
|
||||
fi
|
||||
|
||||
return
|
||||
@@ -112,6 +113,10 @@ function genconfig_min {
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $mediatek/genconfig ] &&
|
||||
iopsys_mediatek=$(cd $mediatek; ./genconfig)
|
||||
[ -e $econet/genconfig ] &&
|
||||
iopsys_econet=$(cd $econet; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
[ -e $x86/genconfig ] &&
|
||||
@@ -122,7 +127,7 @@ function genconfig_min {
|
||||
iopsys_bcm27xx=$(cd $bcm27xx; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_mediatek iopsys_econet iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
@@ -134,7 +139,7 @@ function genconfig_min {
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
config_path="$brcm63xx_arm/config"
|
||||
target_config_path="$brcm63xx_arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -142,7 +147,23 @@ function genconfig_min {
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
config_path="$ramips/config"
|
||||
target_config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_mediatek; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_mediatek"
|
||||
target_config_path="$mediatek/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_econet; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_econet"
|
||||
target_config_path="$econet/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -150,7 +171,7 @@ function genconfig_min {
|
||||
for p in $iopsys_intel_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
config_path="$intel_mips/config"
|
||||
target_config_path="$intel_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -158,7 +179,7 @@ function genconfig_min {
|
||||
for p in $iopsys_x86; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_x86"
|
||||
config_path="$x86/config"
|
||||
target_config_path="$x86/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -166,7 +187,7 @@ function genconfig_min {
|
||||
for p in $iopsys_armvirt; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_armvirt"
|
||||
config_path="$armvirt/config"
|
||||
target_config_path="$armvirt/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -174,14 +195,14 @@ function genconfig_min {
|
||||
for p in $iopsys_bcm27xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_bcm27xx"
|
||||
config_path="$bcm27xx/config"
|
||||
target_config_path="$bcm27xx/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
git remote -v | grep -q http || {
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
@@ -210,7 +231,8 @@ function genconfig_min {
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig dg400prime IOPSYS"
|
||||
echo "Example ./iop genconfig eg400 OPERATORX"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
@@ -260,12 +282,12 @@ function genconfig_min {
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
@@ -312,11 +334,13 @@ function genconfig_min {
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $config_path/config ]; then
|
||||
cat $config_path/config >> .config
|
||||
if [ -f $target_config_path/config ]; then
|
||||
cat $target_config_path/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -f $config_path/$BOARDTYPE/config ]; then
|
||||
cat $config_path/$BOARDTYPE/config >> .config
|
||||
if [ -f $target_config_path/$BOARDTYPE/config ]; then
|
||||
cat $target_config_path/$BOARDTYPE/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips/iopsys_ramips which use TARGET_DEVICES
|
||||
@@ -324,23 +348,29 @@ function genconfig_min {
|
||||
subtarget="xrx500"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||
elif [ "$target" = "iopsys_ramips" ]; then
|
||||
subtarget="mt7621"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_mediatek" ]; then
|
||||
subtarget="mt7622"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_econet" ]; then
|
||||
subtarget="en7562"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
elif [ "$target" = "iopsys_bcm27xx" ]; then
|
||||
subtarget="iopsys_bcm2711"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
@@ -362,21 +392,25 @@ function genconfig_min {
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||
local GIT_REV=$(git rev-parse --short HEAD)
|
||||
local GIT_VER="$GIT_TAG"
|
||||
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
@@ -449,6 +483,8 @@ function genconfig_min {
|
||||
shift;
|
||||
done
|
||||
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
fi
|
||||
|
||||
@@ -1,12 +1,29 @@
|
||||
# this is a developer helper script to install the public ssh key in the created image
|
||||
|
||||
DROPBEAR_AUTHORIZED_KEYS_FILE=/etc/dropbear/authorized_keys
|
||||
|
||||
function get_ssh_public_keys {
|
||||
(
|
||||
shopt -s nullglob
|
||||
# home directory, not all of those are supported by dropbear,
|
||||
# but let's include them now already to decrease future maintenance
|
||||
cat /dev/null ~/.ssh/{id_rsa,id_dsa,id_ecdsa,id_ecdsa_sk,id_ed25519,id_ed25519_sk,id_xmss}.pub 2> /dev/null
|
||||
# keys added manually or automatically to the build dir
|
||||
cat "files${DROPBEAR_AUTHORIZED_KEYS_FILE}" 2>/dev/null
|
||||
# keys in the agent (useful when using SSH agent forwarding)
|
||||
ssh-add -L 2> /dev/null
|
||||
) | sort | uniq
|
||||
}
|
||||
|
||||
function install_key {
|
||||
|
||||
mkdir -p files/etc/dropbear
|
||||
test -e ~/.ssh/id_dsa.pub && cat ~/.ssh/id_dsa.pub >>files/etc/dropbear/authorized_keys
|
||||
test -e ~/.ssh/id_rsa.pub && cat ~/.ssh/id_rsa.pub >>files/etc/dropbear/authorized_keys
|
||||
chmod 0644 files/etc/dropbear/authorized_keys
|
||||
|
||||
local build_dir_dropbear_authorized_keys_file="files${DROPBEAR_AUTHORIZED_KEYS_FILE}"
|
||||
mkdir -p "$(dirname "$build_dir_dropbear_authorized_keys_file")"
|
||||
get_ssh_public_keys > "$build_dir_dropbear_authorized_keys_file"
|
||||
chmod 0644 "$build_dir_dropbear_authorized_keys_file"
|
||||
echo "Keys in "$build_dir_dropbear_authorized_keys_file" are now:"
|
||||
cat "$build_dir_dropbear_authorized_keys_file"
|
||||
echo
|
||||
echo "Disabling login on serial console..."
|
||||
echo "::sysinit:/etc/init.d/rcS S boot" >files/etc/inittab
|
||||
echo "::shutdown:/etc/init.d/rcS K shutdown" >>files/etc/inittab
|
||||
echo "console::askconsolelate:/bin/cttyhack /bin/ash --login" >>files/etc/inittab
|
||||
@@ -14,4 +31,25 @@ function install_key {
|
||||
echo Done
|
||||
}
|
||||
|
||||
function ssh_install_key_help() {
|
||||
echo Usage: $0 ssh_install_key HOSTNAME
|
||||
echo
|
||||
echo "Installs SSH public keys to a device's authorized_keys file"
|
||||
}
|
||||
|
||||
|
||||
# this is a developer helper script to install the public ssh key on host running dropbear
|
||||
function ssh_install_key {
|
||||
if [ $# -ne 1 ] || [ "$1" == '--help' ]; then
|
||||
ssh_install_key_help
|
||||
[ $# -eq 1 ]; return
|
||||
fi
|
||||
host="$1"
|
||||
local keys="$(get_ssh_public_keys)"
|
||||
echo "Adding the following keys to $DROPBEAR_AUTHORIZED_KEYS_FILE on $host:"
|
||||
echo "$keys"
|
||||
ssh root@$host "echo '$keys' >> '$DROPBEAR_AUTHORIZED_KEYS_FILE'" && echo ok
|
||||
}
|
||||
|
||||
register_command "ssh_install_key" "Install the users public ssh key on host running dropbear"
|
||||
register_command "install_key" "Install the user's public ssh key in the created image"
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# this is a developer helper script to install the public ssh key on host running dropbear
|
||||
|
||||
function ssh_install_key {
|
||||
if [ -e ~/.ssh/id_rsa.pub ]; then
|
||||
echo "Adding public RSA key to $1"
|
||||
KEY=`cat ~/.ssh/id_rsa.pub`
|
||||
elif [ -e ~/.ssh/id_dsa.pub ]; then
|
||||
echo "Adding public DSA key to $1"
|
||||
KEY=`cat ~/.ssh/id_dsa.pub`
|
||||
else
|
||||
echo "No public key found"
|
||||
exit 1
|
||||
fi
|
||||
ssh root@$1 "echo '$KEY' >> /etc/dropbear/authorized_keys" && echo ok
|
||||
}
|
||||
|
||||
register_command "ssh_install_key" "Install the users public ssh key on host running dropbear"
|
||||
@@ -26,14 +26,8 @@ function taas-init() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# NAND erase block size.
|
||||
nandBlkSz=$(grep CONFIG_TARGET_NAND_BLOCKSZ .config | \
|
||||
tr -s "=\"" " " | cut -d " " -f 2)
|
||||
nandBlkSz=$((nandBlkSz / 1024))
|
||||
|
||||
# Create a list of all images which might be of use.
|
||||
for f in ${PWD}/bin/targets/iopsys-*/generic/last.* \
|
||||
${PWD}/build_dir/target-arm*/bcmkernel/bcm963xx/targets/9*/bcm*_linux_raw_image_${nandBlkSz}.bin; do
|
||||
for f in ${PWD}/bin/targets/iopsys-*/generic/last.*; do
|
||||
[[ -s "$f" ]] && images+=("$f")
|
||||
done
|
||||
|
||||
|
||||
@@ -492,7 +492,8 @@ check_feeds()
|
||||
echo "Now checking if any changes have been done to the feeds."
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
||||
feeds="$1"
|
||||
[ -n "$feeds" ] || feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
||||
for feed in `echo $feeds`
|
||||
do
|
||||
feed_hash=$(feeds_hash $feed)
|
||||
@@ -552,7 +553,7 @@ check_feeds()
|
||||
done
|
||||
}
|
||||
|
||||
feeds_at_top()
|
||||
is_local_and_remote_same()
|
||||
{
|
||||
git remote update 2>/dev/null 1>/dev/null
|
||||
LOCAL=$(git rev-parse @)
|
||||
@@ -581,7 +582,7 @@ feeds_at_top()
|
||||
usage(){
|
||||
echo -e "$0 [flags]"
|
||||
echo -e "flags:"
|
||||
echo -e " -v\tVerbose mode"
|
||||
echo -e " -f\tFeed to update"
|
||||
echo -e " -h\tShow this help"
|
||||
echo -e " -u\tUpdate package version\n"
|
||||
}
|
||||
@@ -589,7 +590,7 @@ usage(){
|
||||
# Exported interface
|
||||
function update_package {
|
||||
|
||||
UPDATE=0
|
||||
UPDATE=0
|
||||
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
@@ -603,18 +604,18 @@ function update_package {
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;37m' # White
|
||||
|
||||
while getopts "v:hu" opt; do
|
||||
while getopts "f:hu" opt; do
|
||||
case $opt in
|
||||
v)
|
||||
verbose=$OPTARG
|
||||
f)
|
||||
feed=$OPTARG
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
u)
|
||||
UPDATE=1
|
||||
;;
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
u)
|
||||
UPDATE=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
@@ -637,9 +638,9 @@ function update_package {
|
||||
set -E
|
||||
trap '[ "$?" -ne 99 ] || exit 99' ERR
|
||||
|
||||
feeds_at_top
|
||||
check_packages
|
||||
check_feeds
|
||||
is_local_and_remote_same
|
||||
[ -n "$feed" ] || check_packages
|
||||
check_feeds $feed
|
||||
}
|
||||
|
||||
register_command "update_package" "Publish changes to packages and feeds"
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 iopsys
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=iopupgrade
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=01f2afd6c831d6f9eb2940c7e7af16f7e4d439c2
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopupgrade
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
# support parallel build
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
#re create configure scripts if not present.
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
|
||||
# this way we don't need to pick out the resulting files from the build dir.
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/iopupgrade
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Iopsys system upgrade utility
|
||||
URL:=
|
||||
# DEPENDS:=
|
||||
endef
|
||||
|
||||
define Package/iopupgrade/description
|
||||
Application handling peripheral
|
||||
endef
|
||||
|
||||
define Package/iopupgrade/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iopupgrade $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,iopupgrade))
|
||||
|
||||
@@ -1,329 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################################
|
||||
# Global variables. can be used directly in any function called.
|
||||
cur_vol="" # num,[0/1] Number used for ubifs root filesystem volume name.
|
||||
# eg: rootfs_0 or rootfs_1, currently used
|
||||
upd_vol="" # num,[0/1] Number used for ubifs root filesystem volume name.
|
||||
# eg: rootfs_0 or rootfs_1, the one we want to update
|
||||
cmdline="" # command line settings.
|
||||
cmdline_match="" # Headers to match to the image
|
||||
|
||||
###############################################################################
|
||||
# file local variables. should not be used in imported functions. Can be used
|
||||
# by functions declared in this script
|
||||
chroot_cmdline="" # command line for the iop_chroot command.
|
||||
board="" # string, Board name that is going to be matched
|
||||
# against header of firmware image
|
||||
upd_ubi_id="" # num, UBI volume number for the volume name
|
||||
# "rootfs_$upd_vol", use to know what volume to run
|
||||
# ubiupdatevol on.
|
||||
run_cleanup=0 # if set the cleanup should be run otherwise we skip it.
|
||||
run_mount_cleanup=0 # set if we should run umount in cleanup
|
||||
upd_kernel=0 # set to 1 if system has the kernel in own mtd partition
|
||||
log_stdout=1 # set to 0 to prevent the log to also print to stdout
|
||||
upd_noreboot=0 # set to 1 if we should not reboot after programming
|
||||
upd_forceimage=0 # set this to force upgrade even if image is for wrong board.
|
||||
upd_forceboot=0 # set this to force upgrade of boot loader
|
||||
upd_keepconfig=0 # set this to keep the current configuration.
|
||||
###############################################################################
|
||||
# import external functions
|
||||
source /lib/upgrade/iopsys.sh
|
||||
[ -f /lib/upgrade/iopupgrade ] && source /lib/upgrade/iopupgrade
|
||||
|
||||
# only call function if it exists
|
||||
function_call() {
|
||||
if type "$1" 2>/dev/null >/dev/null
|
||||
then
|
||||
$1 $@
|
||||
fi
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Cleanup and error handling functions.
|
||||
function log {
|
||||
TIME=$(date)
|
||||
[ $log_stdout -eq 1 ] && echo "$@"
|
||||
echo "[$TIME] $@" >>/tmp/upd_log
|
||||
}
|
||||
|
||||
# we need to handle ctrl-c, segmentation fault, sigpipe and other abnormal
|
||||
# terminations. no printing to stdout/stderr allowed in this function or
|
||||
# anyhting it calls as stdout/stderr might no longer exist
|
||||
function finish {
|
||||
|
||||
if [ $run_cleanup -eq 1 ]
|
||||
then
|
||||
|
||||
function_call upd_cleanup
|
||||
run_cleanup=0
|
||||
log ""
|
||||
fi
|
||||
|
||||
if [ $run_mount_cleanup -eq 1 ]
|
||||
then
|
||||
log "Cleaning up after mount"
|
||||
umount_newroot
|
||||
fi
|
||||
# always kill the timeout process, will leave the sleep but that is harmless
|
||||
# as long as the kill will nerver be run.
|
||||
if [ -n "$TIMEOUT_PID" ]; then
|
||||
kill $TIMEOUT_PID 2>/dev/null
|
||||
TIMEOUT_PID=""
|
||||
fi
|
||||
|
||||
lock -u /tmp/iopu.lock
|
||||
}
|
||||
|
||||
function ctrl_c {
|
||||
|
||||
# on ctrl-c we remove the exit handler as it is called directly.
|
||||
trap - EXIT
|
||||
|
||||
# call cleanup function
|
||||
finish
|
||||
|
||||
# do not continue program
|
||||
exit 1
|
||||
}
|
||||
|
||||
function sig_pipe {
|
||||
log_stdout=0 # stdin,stdout,stderr do not exist anymore
|
||||
log "Got sigpipe. Turning of log printing to stdout"
|
||||
}
|
||||
|
||||
# if a timout happens terminate
|
||||
function timeout {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Not much that can be done if the mount fails but to try again.
|
||||
# if after 10 seconds there still is errors abort program.
|
||||
# UBIFS has some wierd time intervall after ubiupdatevol where
|
||||
# a mount of the newly written data results in a busy error.
|
||||
function mount_retry {
|
||||
local tries=0
|
||||
|
||||
while [ $tries -lt 10 ]
|
||||
do
|
||||
if mount $@ 2>/dev/null
|
||||
then
|
||||
return
|
||||
fi
|
||||
tries=$((tries + 1))
|
||||
sleep 1
|
||||
done
|
||||
|
||||
log "mount failed for command [mount $@] so upgrade failed."
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
function mount_newroot {
|
||||
run_mount_cleanup=1
|
||||
mkdir -p /tmp/newroot
|
||||
mkdir -p /tmp/newroot_overlay
|
||||
|
||||
mount_retry -t ubifs ubi0:rootfs_$upd_vol /tmp/newroot
|
||||
|
||||
mount_retry -o noatime,lowerdir=/tmp/newroot,upperdir=/tmp/newroot/overlay,workdir=/tmp/newroot/lib/overlay.tmp -t overlay "overlayfs:/tmp/newroot/overlay" /tmp/newroot_overlay
|
||||
mount_retry --bind /tmp/newroot/ /tmp/newroot_overlay/rom
|
||||
|
||||
mount_retry --bind /dev /tmp/newroot_overlay/dev
|
||||
mount_retry --bind /proc /tmp/newroot_overlay/proc
|
||||
mount_retry --bind /sys /tmp/newroot_overlay/sys
|
||||
mount_retry -t tmpfs -o noatime,mode=0755 root /tmp/newroot_overlay/tmp
|
||||
|
||||
mkdir -p /tmp/newroot_overlay/tmp/oldroot
|
||||
mount_retry --bind / /tmp/newroot_overlay/tmp/oldroot
|
||||
mount_retry --bind /tmp /tmp/newroot_overlay/tmp/oldroot/tmp
|
||||
}
|
||||
|
||||
function umount_newroot {
|
||||
umount /tmp/newroot_overlay/tmp/oldroot/tmp
|
||||
umount /tmp/newroot_overlay/tmp/oldroot
|
||||
umount /tmp/newroot_overlay/tmp
|
||||
umount /tmp/newroot_overlay/sys
|
||||
umount /tmp/newroot_overlay/proc
|
||||
umount /tmp/newroot_overlay/dev
|
||||
umount /tmp/newroot_overlay/rom
|
||||
umount /tmp/newroot_overlay
|
||||
umount /tmp/newroot
|
||||
rmdir /tmp/newroot_overlay /tmp/newroot
|
||||
run_mount_cleanup=0
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $0 iopu [opts] "
|
||||
echo ""
|
||||
echo "opts:"
|
||||
echo ""
|
||||
echo " -n Do not do the final reboot of the target board"
|
||||
echo " -c Keep configuration"
|
||||
echo " -x Force install even if firmware is not for this board"
|
||||
echo " -b Force install of bootloader regardless of version installed"
|
||||
echo " -r Jump into chroot env of other system"
|
||||
echo " -f Firmware file to use"
|
||||
echo " -C \"command\" Execute command in chroot env of other system"
|
||||
}
|
||||
|
||||
# Execute command in newroot(other system root)
|
||||
function newroot_exec {
|
||||
|
||||
upd_vol=$(get_flashbank_next)
|
||||
mount_newroot
|
||||
(ENV=/sbin/iopu_chroot_env chroot /tmp/newroot_overlay "$@")
|
||||
echo ""
|
||||
umount_newroot
|
||||
|
||||
}
|
||||
|
||||
function system_is_y_image {
|
||||
|
||||
# find out what rootfs volume is active.
|
||||
cur_vol=$(get_flashbank_current)
|
||||
upd_vol=$(get_flashbank_next)
|
||||
|
||||
# convert volume name "rootfs_$upd_vol" into ubi volume id
|
||||
upd_ubi_id=$(ubinfo -d 0 -N rootfs_$upd_vol | awk "/Volume ID:/ {print \$3}")
|
||||
log "installing Root Fileystem into UBI volume rootfs_$upd_vol"
|
||||
|
||||
# prepare to match dsl.
|
||||
function_call upd_conf_dsl
|
||||
|
||||
log "now starting writing data to flash with [ iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id ]"
|
||||
run_cleanup=1 # When we start to actually write data there might be some
|
||||
# things that need cleanup if we get an error/crash
|
||||
if ! iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id; then
|
||||
log "iopupgrade program Failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Firmware programmed to flash."
|
||||
|
||||
# Force upgrade of boot loader
|
||||
[ $upd_forceboot -eq 1 ] && chroot_cmdline="$chroot_cmdline -b"
|
||||
|
||||
if [ $upd_keepconfig -eq 1 ]; then
|
||||
log "Transfering configuration to new system."
|
||||
chroot_cmdline="$chroot_cmdline -c"
|
||||
fi
|
||||
|
||||
mount_newroot
|
||||
if ! chroot /tmp/newroot_overlay /sbin/iopu_chroot $chroot_cmdline; then
|
||||
log "Configuration migration failed!"
|
||||
exit 1
|
||||
fi
|
||||
umount_newroot
|
||||
|
||||
log "New firmware fully installed."
|
||||
run_cleanup=0
|
||||
|
||||
|
||||
# Now make sure that we actually boot the new system on the next reboot
|
||||
upd_finnish
|
||||
|
||||
}
|
||||
|
||||
function system_is_FIT_image {
|
||||
|
||||
# prepare to match dsl.
|
||||
#function_call upd_conf_dsl
|
||||
|
||||
#here we write data
|
||||
bcm_flasher $firmware_file
|
||||
bcm_bootstate 1
|
||||
log "Firmware programmed to flash."
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
# just one instance
|
||||
# this check has to be done before we install handler to avoid removing the
|
||||
# lock even if it was not available.
|
||||
if ! lock -n /tmp/iopu.lock
|
||||
then
|
||||
echo "Another instance of iopu already running"
|
||||
echo "If you are sure this is wrong remove file /tmp/iopu.lock"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap finish EXIT
|
||||
trap ctrl_c INT
|
||||
trap timeout SIGALRM
|
||||
trap sig_pipe SIGPIPE
|
||||
|
||||
while getopts "nrxbhcC:f:" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
upd_noreboot=1
|
||||
;;
|
||||
x)
|
||||
upd_forceimage=1
|
||||
;;
|
||||
b)
|
||||
upd_forceboot=1
|
||||
;;
|
||||
c)
|
||||
upd_keepconfig=1
|
||||
;;
|
||||
r)
|
||||
newroot_exec /bin/sh
|
||||
exit
|
||||
;;
|
||||
C)
|
||||
newroot_exec "${OPTARG}"
|
||||
exit
|
||||
;;
|
||||
f)
|
||||
firmware_file="${OPTARG}"
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# put a timeout on this if it takes longer than 120 seconds we should abort
|
||||
# and clean up
|
||||
(
|
||||
sleep 120 && kill -ALRM $$ 2>/dev/null # send it a SIGALRM signal
|
||||
)&
|
||||
TIMEOUT_PID=$!
|
||||
|
||||
log "Firmware upgrade started"
|
||||
|
||||
# Should board name be checked
|
||||
if [ $upd_forceimage -eq 0 ]
|
||||
then
|
||||
board=$(db get hw.board.model_name)
|
||||
cmdline_match="board=$board"
|
||||
fi
|
||||
|
||||
# BUG: should probably read a config file.
|
||||
if [ -f /proc/nvram/boardid ]
|
||||
then
|
||||
system_is_FIT_image
|
||||
else
|
||||
system_is_y_image
|
||||
fi
|
||||
|
||||
# spawn the reboot to a subshell to allow the main program to quit before reset
|
||||
# to avoid any hanged network connection like ssh
|
||||
if [ $upd_noreboot -eq 0 ]
|
||||
then
|
||||
(
|
||||
log_stdout=0 # stdin,stdout,stderr do not exist anymore, we are in a
|
||||
# subshell and then the trap is no longer working.
|
||||
sleep 1
|
||||
log "Rebooting NOW!!!"
|
||||
log ""
|
||||
reboot
|
||||
)&
|
||||
log "Reboot initiated"
|
||||
else
|
||||
log "Skipping reboot"
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This program is intended to be run in a chroot environment where the old system
|
||||
# is mounted in /tmp/oldroot
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Global variables. can be used directly in any function called.
|
||||
|
||||
|
||||
###############################################################################
|
||||
# file local variables. should not be used in imported functions. Can be used
|
||||
# by functions declared in this script
|
||||
upd_forceboot=0
|
||||
log_stdout=1 # set to 0 to prevent the log to also print to stdout
|
||||
upd_keepconfig=0 # set this to keep the current configuration.
|
||||
|
||||
###############################################################################
|
||||
# import external functions
|
||||
|
||||
source /lib/upgrade/iopsys.sh
|
||||
[ -f /lib/upgrade/iopupgrade ] && source /lib/upgrade/iopupgrade
|
||||
|
||||
|
||||
# only call function if it exists
|
||||
function_call() {
|
||||
if [ -n "$1" ] && type "$1" 2>/dev/null >/dev/null
|
||||
then
|
||||
$1 "$@" || exit
|
||||
fi
|
||||
}
|
||||
# Cleanup and error handling functions.
|
||||
function log {
|
||||
TIME=$(date)
|
||||
[ $log_stdout -eq 1 ] && echo "$@"
|
||||
echo "[$TIME] $@" >>/root/upd_log
|
||||
}
|
||||
|
||||
|
||||
while getopts "hbc" opt; do
|
||||
case $opt in
|
||||
h)
|
||||
upd_usage
|
||||
exit 1
|
||||
;;
|
||||
c)
|
||||
upd_keepconfig=1
|
||||
;;
|
||||
b)
|
||||
upd_forceboot=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# copy old install log over
|
||||
cp /tmp/oldroot/tmp/upd_log /root/upd_log
|
||||
|
||||
# Upgrade boot loader if needed.
|
||||
function_call upd_program_boot
|
||||
|
||||
# Let the new upgrade do whatever it needs,
|
||||
# such as configuration migration etc.
|
||||
if [ $upd_keepconfig -eq 1 -a -x /lib/upgrade/post-rootfs-fixup ]; then
|
||||
(/lib/upgrade/post-rootfs-fixup /dev/null /tmp/oldroot) || exit
|
||||
fi
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
# this is run when "iopr -r" is executed.
|
||||
# intended to just show what environment is actually started.
|
||||
|
||||
cat /etc/banner
|
||||
|
||||
echo "/tmp/oldroot:"
|
||||
echo " Contains the running root filesystem. It is live so files are in use"
|
||||
echo " Anything copying/reading files from there needs to make sure it is done safely."
|
||||
echo ""
|
||||
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
Red='\033[0;31m' # Red
|
||||
|
||||
PS1="${Red}chroot_new${Color_Off}:\w\#"
|
||||
export PS1
|
||||
export Red
|
||||
export Color_Off
|
||||
122
juci/Makefile
122
juci/Makefile
@@ -1,122 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=juci
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/juci.git
|
||||
PKG_SOURCE_VERSION:=70b66bfc7f0e25e77b6920c3d44e5b05f4bfcf95
|
||||
PKG_VERSION:=2020-05-27
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
|
||||
PKG_RELEASE=$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/juci
|
||||
$(Package/juci/default)
|
||||
SECTION:=juci
|
||||
CATEGORY:=JUCI
|
||||
MENU=1
|
||||
TITLE:=JUCI Core Package (select this to select default plugins)
|
||||
DEPENDS:=+libubox +libubus +owsd +rpcd +rpcd-mod-file +questd
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/src/
|
||||
ln -s $(PKG_BUILD_DIR) $(1)/usr/src/juci
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default,THEME_PATH="$(TOPDIR)/tmp/juci-themes/")
|
||||
endef
|
||||
|
||||
define Package/juci/description
|
||||
JUCI Javascript UCI Web interface.
|
||||
endef
|
||||
|
||||
define Package/juci/install
|
||||
$(INSTALL_DIR) $(1)/
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/juci/* $(1)/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/juci/postinst
|
||||
#!/bin/sh
|
||||
|
||||
juci-update
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,juci))
|
||||
|
||||
####### Extensions / Themes and Plugins
|
||||
|
||||
define RegisterAddonInner
|
||||
define Package/$(2)
|
||||
SECTION:=juci
|
||||
CATEGORY:=JUCI
|
||||
TITLE:=default
|
||||
SUBMENU:=$(1)
|
||||
TITLE:=$(if $(3),$(3),JUCI $(2) plugin)
|
||||
DEPENDS:=$(4)
|
||||
endef
|
||||
|
||||
define Package/$(2)/install
|
||||
$(INSTALL_DIR) $$(1)/
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/$(2)/* $$(1)/
|
||||
endef
|
||||
endef
|
||||
|
||||
define RegisterAddon
|
||||
$(eval $(call RegisterAddonInner,$(1),$(2),$(3),$(4),$(5)))
|
||||
$(eval $(call BuildPackage,$(2)))
|
||||
endef
|
||||
|
||||
$(eval $(call RegisterAddon,Plugins,juci-catv, CATV Module,@(PACKAGE_catv)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-cgroups, CGroups Module,@(PACKAGE_icgroupd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-ddns, DDNS Configuration,@(PACKAGE_ddns-scripts)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-diagnostics, Simple Diagnostics,@(PACKAGE_busybox)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-ndt, NDT Speed Test client,@(PACKAGE_ndt)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-dnsmasq-dhcp, DHCP/DNSMasq Configuration,@(PACKAGE_dnsmasq||PACKAGE_dnsmasq-full)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-dropbear, Dropbear Configuration,@(PACKAGE_dropbear)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-easyqos, Easy QoS module,@(PACKAGE_easy-qos)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-event, Event Module,@(PACKAGE_owsd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-firewall-fw3, Firewall Configuration,@(PACKAGE_firewall)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-icwmp, TR-069 Module,@(PACKAGE_icwmp)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-config-backup, Config Backup Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-qos, QoS module,@(PACKAGE_qos-scripts)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-voice-client, Asterisk Voice Client Module,@(PACKAGE_asterisk)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-minidlna, MiniDLNA Configuration,@(PACKAGE_minidlna)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mcproxy, Multicast Proxy Configuration,@(PACKAGE_mcproxy)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mod-status, Status Reporting Module,@(PACKAGE_questd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mod-system, System Administration Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mwan3, mwan3 Configuration,@(PACKAGE_mwan3)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-natalie-dect, DECT Module,@(PACKAGE_dectmngr2)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-netmode, Netmode Module,@(PACKAGE_netmode)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-device, Network Device Configuration,@(PACKAGE_netifd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-dsl, DSL Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-netifd, Network Module,@(PACKAGE_netifd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-port, Ethernet Port Configuration,@(PACKAGE_port-management)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-openvpn, OpenVPN configuration,@(PACKAGE_openvpn)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-owsd, OWSD configuration,@(PACKAGE_owsd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-printer, p910nd Printer Server Configuration,@(PACKAGE_p910nd)))
|
||||
#$(eval $(call RegisterAddon,Plugins,juci-realtime-graphs, Realtime Graphs))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-samba, Samba Configuration,@(PACKAGE_samba3)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-sfp, SFP Configuration,@(PACKAGE_peripheral_manager)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-snmpd, SNMP Module,@(PACKAGE_snmpd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-sysupgrade, Sysupgrade Firmware Upgrade,@(PACKAGE_rpcd-mod-rpcsys)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-uhttpd, uHTTPD Configuration,@(PACKAGE_uhttpd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-upnp, UPnP Configuration Module,@(PACKAGE_miniupnpd)))
|
||||
#$(eval $(call RegisterAddon,Plugins,juci-usb, USB Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-wireless, Wireless Management Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-wifilife, WiFi Life Module,@(PACKAGE_wifilife)))
|
||||
$(eval $(call RegisterAddon,Themes,juci-theme-iopsys))
|
||||
|
||||
####### dynamically publish themes as packages #######
|
||||
$(foreach th,$(wildcard $(TOPDIR)/tmp/juci-themes/*),$(eval $(call RegisterAddon,Themes,$(notdir $(th)))))
|
||||
@@ -1,66 +0,0 @@
|
||||
config juci 'juci'
|
||||
option homepage 'overview'
|
||||
option theme 'juci-theme-iopsys'
|
||||
option favicon 'favicon.ico'
|
||||
|
||||
config login 'login'
|
||||
option showusername '1'
|
||||
option defaultuser 'user'
|
||||
|
||||
config localization 'localization'
|
||||
option default_language 'en'
|
||||
list languages 'en'
|
||||
|
||||
config wiki 'wiki'
|
||||
option visible '0'
|
||||
option version 'v4.2.x'
|
||||
|
||||
config widget
|
||||
list name 'overviewWidget11WAN'
|
||||
list require 'ubus:network.interface'
|
||||
|
||||
config widget
|
||||
list name 'overviewWidget10Network'
|
||||
list require 'ubus:network.interface'
|
||||
list require 'ubus:router.network->hosts'
|
||||
|
||||
config widget
|
||||
list name 'overviewWidget00WiFi'
|
||||
list require 'ubus:wifi'
|
||||
list require 'ubus:wifi.wps'
|
||||
|
||||
config menu
|
||||
option path 'overview'
|
||||
option page 'overview'
|
||||
|
||||
config menu
|
||||
option path 'system'
|
||||
option page 'system'
|
||||
option redirect 'first'
|
||||
|
||||
config menu
|
||||
option path 'status'
|
||||
option page 'status'
|
||||
option redirect 'first'
|
||||
|
||||
config menu
|
||||
option path 'status/system'
|
||||
option page 'status-system'
|
||||
list require 'ubus:router.system->info'
|
||||
|
||||
config menu
|
||||
option path 'status/network'
|
||||
option page 'status-network'
|
||||
list require 'ubus:network.interface'
|
||||
|
||||
config menu
|
||||
option path 'status/dsl'
|
||||
option page 'network-dsl-status'
|
||||
list require 'ubus:dsl->stats'
|
||||
list require 'ubus:dsl->status'
|
||||
|
||||
config menu
|
||||
option path 'system/upgrade'
|
||||
option page 'settings-upgrade'
|
||||
list expose 'admin'
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
. /lib/functions.sh
|
||||
|
||||
START=94
|
||||
STOP=06
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=juci
|
||||
|
||||
start_service() {
|
||||
mkdir -p /tmp/juci
|
||||
touch /www/index.html.gz
|
||||
chmod 755 /www/cgi-bin/luci
|
||||
# this will simply update index.html to include any files that are for some reason not included
|
||||
# a good way to make sure all plugins are properly included at each boot
|
||||
config_load juci
|
||||
local theme
|
||||
config_get theme juci theme
|
||||
if [ "$theme" ]
|
||||
then
|
||||
if [ -f /www/themes/theme.js.gz ]
|
||||
then
|
||||
rm -f /www/themes/theme.js.gz
|
||||
fi
|
||||
if [ -f /www/themes/*$theme.js.gz ]
|
||||
then
|
||||
ln -s /www/themes/*$theme.js.gz /www/themes/theme.js.gz
|
||||
fi
|
||||
fi
|
||||
juci-update
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /sbin/juci
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger juci
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
USER_SECTION=""
|
||||
USER_EXISTS=0
|
||||
|
||||
find_user(){
|
||||
local section="$1"
|
||||
local user="$2"
|
||||
config_get username $section username
|
||||
if [ "$username" == "$user" ]; then
|
||||
USER_SECTION="$section"
|
||||
USER_EXISTS=1
|
||||
fi
|
||||
}
|
||||
|
||||
config_load rpcd
|
||||
|
||||
USER_EXISTS=0
|
||||
config_foreach find_user login root
|
||||
if [ $USER_EXISTS -eq 1 ]; then
|
||||
uci delete rpcd.$USER_SECTION
|
||||
fi
|
||||
|
||||
USER_EXISTS=0
|
||||
config_foreach find_user login admin
|
||||
if [ $USER_EXISTS -eq 0 ]; then
|
||||
uci -q add rpcd login >/dev/null
|
||||
uci -q set rpcd.@login[-1].username="admin"
|
||||
uci -q set rpcd.@login[-1].password="\$p\$admin"
|
||||
uci -q add_list rpcd.@login[-1].read="enduser"
|
||||
uci -q add_list rpcd.@login[-1].read="administrator"
|
||||
uci -q add_list rpcd.@login[-1].write="enduser"
|
||||
uci -q add_list rpcd.@login[-1].write="administrator"
|
||||
fi
|
||||
|
||||
USER_EXISTS=0
|
||||
config_foreach find_user login user
|
||||
if [ $USER_EXISTS -eq 0 ]; then
|
||||
uci -q add rpcd login >/dev/null
|
||||
uci -q set rpcd.@login[-1].username="user"
|
||||
uci -q set rpcd.@login[-1].password="\$p\$user"
|
||||
uci -q add_list rpcd.@login[-1].read="enduser"
|
||||
uci -q add_list rpcd.@login[-1].write="enduser"
|
||||
fi
|
||||
|
||||
uci commit rpcd
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"administrator": {
|
||||
"description": "Administrator Access Rights",
|
||||
"read": {
|
||||
"ubus": {
|
||||
"file": [
|
||||
"write"
|
||||
],
|
||||
"rpc-sys": [
|
||||
"upgrade_start",
|
||||
"upgrade_test"
|
||||
]
|
||||
}
|
||||
},
|
||||
"write": {
|
||||
"file": {
|
||||
"/tmp/firmware.bin": ["write"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
{
|
||||
"enduser": {
|
||||
"description": "End User Access Rights",
|
||||
"read": {
|
||||
"ubus": {
|
||||
"dect": [
|
||||
"state",
|
||||
"handset",
|
||||
"status",
|
||||
"call"
|
||||
],
|
||||
"dsl": [
|
||||
"status",
|
||||
"stats"
|
||||
],
|
||||
"network.device": [
|
||||
"status"
|
||||
],
|
||||
"network.interface*": [
|
||||
"status",
|
||||
"dump",
|
||||
"up",
|
||||
"down"
|
||||
],
|
||||
"router.network": [
|
||||
"clients",
|
||||
"hosts",
|
||||
"dump"
|
||||
],
|
||||
"router.system": [
|
||||
"info",
|
||||
"memory",
|
||||
"filesystem",
|
||||
"process",
|
||||
"processes"
|
||||
],
|
||||
"session": [
|
||||
"access",
|
||||
"list",
|
||||
"destroy",
|
||||
"login"
|
||||
],
|
||||
"system": [
|
||||
"info",
|
||||
"board",
|
||||
"reboot"
|
||||
],
|
||||
"testnet": [
|
||||
"status"
|
||||
],
|
||||
"uci": [
|
||||
"*"
|
||||
],
|
||||
"voice.asterisk": [
|
||||
"status",
|
||||
"call_log",
|
||||
"platform",
|
||||
"supported_countries"
|
||||
],
|
||||
"wifi": [
|
||||
"status"
|
||||
],
|
||||
"wifi.ap.*": [
|
||||
"status",
|
||||
"stats",
|
||||
"assoclist",
|
||||
"stations"
|
||||
],
|
||||
"wifi.radio.*": [
|
||||
"status",
|
||||
"stats",
|
||||
"scan",
|
||||
"scanresults",
|
||||
"autochannel"
|
||||
],
|
||||
"wifi.wps": [
|
||||
"start",
|
||||
"stop",
|
||||
"status",
|
||||
"showpin"
|
||||
]
|
||||
},
|
||||
"uci": [
|
||||
"dhcp",
|
||||
"firewall",
|
||||
"juci",
|
||||
"network",
|
||||
"voice_client",
|
||||
"wireless"
|
||||
],
|
||||
"owsd": [
|
||||
"client",
|
||||
"wifi.radio",
|
||||
"wifi.sta",
|
||||
"wifi.wps"
|
||||
]
|
||||
},
|
||||
"write": {
|
||||
"uci": [
|
||||
"dhcp",
|
||||
"firewall",
|
||||
"network",
|
||||
"wireless"
|
||||
],
|
||||
"uci_granular": {
|
||||
"dhcp": [
|
||||
{
|
||||
"match": {
|
||||
".type": "dhcp"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "host"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"firewall": [
|
||||
{
|
||||
"match": {
|
||||
".type": "settings",
|
||||
".name": "settings"
|
||||
},
|
||||
"option": [
|
||||
"disabled"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "zone"
|
||||
},
|
||||
"option": [
|
||||
"masq",
|
||||
"name",
|
||||
"network"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "redirect"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "rule"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "dmz"
|
||||
},
|
||||
"option": [
|
||||
"enabled",
|
||||
"host",
|
||||
"ip6addr"
|
||||
]
|
||||
}
|
||||
],
|
||||
"network": [
|
||||
{
|
||||
"match": {
|
||||
".type": "interface"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"wireless": [
|
||||
{
|
||||
"match": {
|
||||
".type": "wifi-status"
|
||||
},
|
||||
"option": [
|
||||
"wps"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "wifi-iface",
|
||||
"mode": "ap"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "wifi-device"
|
||||
},
|
||||
"option": [
|
||||
"channel"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"owsd": [
|
||||
"client",
|
||||
"wifi.radio",
|
||||
"wifi.sta",
|
||||
"wifi.wps"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-1905
|
||||
PKG_VERSION:=0.0.19
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=46afa4c0aa56d8762d9402cfdaddf4adaa8a058a
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/map-1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:= MultiAP Stack
|
||||
DEPENDS:= +ubox +ieee1905
|
||||
endef
|
||||
|
||||
define Package/map-1905/description
|
||||
MultiAP plugin for ieee1905d based on Wifi alliance's MAP-r2 specification
|
||||
endef
|
||||
|
||||
define Package/libmaputils
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WFA MultiAP utility library
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
-fstrict-aliasing \
|
||||
-Wall \
|
||||
-Wextra
|
||||
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/map-1905/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/map-1905/install
|
||||
$(INSTALL_DIR) $(1)/usr/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifimap2.so $(1)/usr/lib/ieee1905/
|
||||
endef
|
||||
|
||||
define Package/libmaputils/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmaputils.so $(1)/usr/lib/libmaputils.so
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/map1905
|
||||
$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/map1905/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmaputils.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libmaputils))
|
||||
$(eval $(call BuildPackage,map-1905))
|
||||
@@ -1,13 +1,13 @@
|
||||
#
|
||||
# Copyright (C) 2020 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2020-21 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=3.5.20
|
||||
PKG_VERSION:=6.0.2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=f396b503f111461e7869f302907e1d9ec639ca3a
|
||||
PKG_SOURCE_VERSION:=184fcb9b10fcb5978da22058792af859424dbb8d
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
@@ -18,13 +18,16 @@ PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/map-agent.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_BUILD_DEPENDS:=map-plugin
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/map-agent
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libmaputils +libwsc +libeasy
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+map-plugin
|
||||
endef
|
||||
|
||||
define Package/map-agent/description
|
||||
@@ -42,20 +45,11 @@ TARGET_CFLAGS += \
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/map-agent
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/src/include/*.h $(1)/usr/include/map-agent
|
||||
$(CP) $(PKG_BUILD_DIR)/src/utils/timer_impl.h $(1)/usr/include/map-agent
|
||||
$(CP) $(PKG_BUILD_DIR)/src/utils/*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/map-agent/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/src/utils/*.so* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapagent $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,84 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
diff=0
|
||||
wan=$(uci -q get ports.WAN.ifname)
|
||||
wan=$(db -q get hw.board.ethernetWanPort)
|
||||
|
||||
[ "$wan" == "" ] && exit 1 # no configuration
|
||||
[ -z "$wan" ] && exit 1 # no configuration
|
||||
[ "$PORT" != "$wan" ] && exit 0
|
||||
|
||||
get_bridge() {
|
||||
local id
|
||||
local ifname="$1"
|
||||
local bridge=""
|
||||
id=$(cat /sys/class/net/${ifname}/brport/bridge/bridge/bridge_id)
|
||||
update_bstas() {
|
||||
local section="$1"
|
||||
local action="$2"
|
||||
local ifname onboarded
|
||||
|
||||
#echo "bridge id = $id" > /dev/console
|
||||
|
||||
[ "$id" = "" ] && return
|
||||
|
||||
bridge=$(brctl show | grep $id | cut -f1)
|
||||
|
||||
case "$bridge" in
|
||||
br-*)
|
||||
bridge=$(echo $bridge | cut -c4-)
|
||||
;;
|
||||
esac
|
||||
|
||||
echo $bridge
|
||||
}
|
||||
|
||||
disable_bstas() {
|
||||
section="$1"
|
||||
|
||||
config_get mode "$section" mode "ap"
|
||||
config_get ifname "$section" ifname
|
||||
config_get device "$section" device
|
||||
#echo mode=$mode ifname=$ifname > /dev/console
|
||||
config_get_bool onboarded "$section" onboarded 0
|
||||
|
||||
[ "$mode" == "sta" ] || return
|
||||
[ "$onboarded" -eq 0 ] && return
|
||||
|
||||
uci set wireless.$section.disabled=1
|
||||
bridge=$(get_bridge $ifname)
|
||||
if [ "$bridge" != "" ]; then
|
||||
#echo got bridge = $bridge > /dev/console
|
||||
ubus call network.interface.$bridge remove_device '{"name":"$ifname"}'
|
||||
fi
|
||||
ifconfig "$ifname" down
|
||||
|
||||
diff=1
|
||||
#echo disabled $ifname > /dev/console
|
||||
wpa_cli -i "$ifname" "$action" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
enable_bstas() {
|
||||
section="$1"
|
||||
config_load "wireless"
|
||||
|
||||
config_get mode "$section" mode "ap"
|
||||
config_get ifname "$section" ifname
|
||||
config_get device "$section" device
|
||||
#echo mode=$mode ifname=$ifname > /dev/console
|
||||
|
||||
[ "$mode" == "sta" ] || return
|
||||
|
||||
uci set wireless.$section.disabled=0
|
||||
ifconfig "$ifname" up
|
||||
|
||||
diff=1
|
||||
#echo enabled $ifname > /dev/console
|
||||
}
|
||||
|
||||
config_load "wireless"
|
||||
|
||||
if [ "$LINK" == "up" ]; then
|
||||
config_foreach disable_bstas wifi-iface
|
||||
if [ "$LINK" = "up" ]; then
|
||||
touch /tmp/map.agent.bsta_global_disable
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bk-iface disconnect
|
||||
else
|
||||
config_foreach enable_bstas wifi-iface
|
||||
rm -f /tmp/map.agent.bsta_global_disable
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bk-iface reconnect
|
||||
fi
|
||||
|
||||
#echo diff = $diff > /dev/console
|
||||
|
||||
uci -q commit wireless
|
||||
[ "$diff" == "1" ] && {
|
||||
#echo reloading via uci > /dev/console
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
}
|
||||
|
||||
46
map-agent/files/etc/hotplug.d/ethernet/map-topology-discovery
Executable file
46
map-agent/files/etc/hotplug.d/ethernet/map-topology-discovery
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
[ "$LINK" == "up" ] || exit 0
|
||||
[ "$PORT" == "" ] && exit 1
|
||||
|
||||
ubus list ieee1905 > /dev/null 2>&1
|
||||
|
||||
rc="$?"
|
||||
|
||||
[ "$rc" != 0 ] && exit 1
|
||||
|
||||
issue_discovery() {
|
||||
local iface="$1"
|
||||
|
||||
res=$(ubus -t5 call ieee1905 buildcmdu "{\"type\":0, \"ifname\":\"${iface}\"}")
|
||||
json_load "$res" > /dev/null 2>&1
|
||||
json_get_var data data
|
||||
|
||||
[ "$data" == "" ] && return
|
||||
|
||||
ubus call ieee1905 cmdu "{\"dst\":\"01:80:c2:00:00:13\", \"type\":0, \"data\":\"${data}\"}"
|
||||
}
|
||||
|
||||
process_vlans() {
|
||||
section="$1"
|
||||
|
||||
config_get ifname "$section" ifname
|
||||
config_get name "$section" name
|
||||
|
||||
[ "$2" == "$ifname" ] || return
|
||||
[ "$name" == "" ] && return
|
||||
|
||||
issue_discovery $name
|
||||
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# find and publish over any vlans
|
||||
config_load network
|
||||
config_foreach process_vlans interface $PORT
|
||||
config_foreach process_vlans device $PORT
|
||||
|
||||
issue_discovery $PORT
|
||||
@@ -5,13 +5,62 @@ STOP=20
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
MAP_DEV="map_dev"
|
||||
MAP_IF="map"
|
||||
MAP_VETH="lei"
|
||||
|
||||
create_map() {
|
||||
uci -q set network.${MAP_DEV}=device
|
||||
uci -q set network.${MAP_DEV}.name=br-map
|
||||
uci -q set network.${MAP_DEV}.type=bridge
|
||||
uci -q set network.${MAP_DEV}.bridge_empty=1
|
||||
|
||||
uci -q set network.${MAP_IF}=interface
|
||||
uci -q set network.${MAP_IF}.device=br-map
|
||||
uci -q set network.${MAP_IF}.is_lan=1
|
||||
|
||||
uci -q set mapagent.agent.al_bridge=br-map
|
||||
|
||||
uci -q commit
|
||||
|
||||
ubus call network reload
|
||||
ubus -t 5 wait_for network.device
|
||||
|
||||
ip link add ${MAP_VETH} type veth peer name ${MAP_VETH}_lan 2>/dev/null
|
||||
brctl addif br-map ${MAP_VETH} 2>/dev/null
|
||||
brctl addif br-lan ${MAP_VETH}_lan 2>/dev/null
|
||||
ip link set ${MAP_VETH} up 2>/dev/null
|
||||
ip link set ${MAP_VETH}_lan up 2>/dev/null
|
||||
}
|
||||
|
||||
remove_map() {
|
||||
ip link delete ${MAP_VETH} &>/dev/null
|
||||
|
||||
uci -q delete network.${MAP_DEV}
|
||||
uci -q delete network.${MAP_IF}
|
||||
|
||||
uci -q set mapagent.agent.al_bridge=br-lan
|
||||
|
||||
uci -q commit
|
||||
|
||||
ubus call network reload
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load "mapagent"
|
||||
|
||||
ubus -t 5 wait_for wifi
|
||||
|
||||
sleep 2
|
||||
|
||||
local enabled
|
||||
config_get_bool enabled agent enabled 1
|
||||
[ "$enabled" -eq 0 ] && return 1
|
||||
|
||||
local ts
|
||||
config_get_bool ts agent vlan_segregation 0
|
||||
[ "$ts" -eq 1 ] && create_map #|| remove_map
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/mapagent" "-d"
|
||||
procd_set_param respawn
|
||||
@@ -20,6 +69,10 @@ start_service() {
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
#stop_service() {
|
||||
# remove_map
|
||||
#}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "ieee1905"
|
||||
|
||||
523
map-agent/files/lib/wifi/multiap
Executable file
523
map-agent/files/lib/wifi/multiap
Executable file
@@ -0,0 +1,523 @@
|
||||
#!/bin/sh
|
||||
|
||||
# functions
|
||||
# wireless_teardown - tear down ifaces based on mapagent config
|
||||
# setup_network - prepare /etc/config/network if necessary
|
||||
# setup_wireless - prepare /etc/config/wireless based on mapagent config
|
||||
# write_credentials - write bBSS credentials to fBSS
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/wifi/traffic_separation
|
||||
|
||||
diff=0
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [wireless_teardown|setup_network|setup_wireless|write_credentials]
|
||||
Platform specific Multi-AP script to prepare network and wifi subsystem based on
|
||||
mapagent configuration.
|
||||
wireless_teardown - tear down ifaces in /etc/config/wireless
|
||||
setup_network - prepare /etc/config/network
|
||||
setup_wireless - prepare /etc/config/wireless
|
||||
write_credentials - write bBSS credentials to fBSS
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
brcm_sync_credentials() {
|
||||
bands=""
|
||||
mapagent_process_fh() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
|
||||
config_get device $section device
|
||||
|
||||
[ "$dev" != "$device" ] && return
|
||||
|
||||
config_get band $section band
|
||||
config_get ssid $section ssid
|
||||
config_get encryption $section encryption
|
||||
config_get key $section key
|
||||
|
||||
section=$(uci add ieee1905 ap)
|
||||
[ "$section" == "" ] && return
|
||||
|
||||
uci set ieee1905.${section}.band=$band
|
||||
uci set ieee1905.${section}.ssid="$ssid"
|
||||
uci set ieee1905.${section}.encryption=$encryption
|
||||
uci set ieee1905.${section}.key="$key"
|
||||
}
|
||||
|
||||
mapagent_process_radio() {
|
||||
local section=$1
|
||||
|
||||
config_get device $section device
|
||||
config_get band $section band
|
||||
config_get dedicated_backhaul $section dedicated_backhaul 0
|
||||
|
||||
[ "$dedicated_backhaul" != "0" ] && return
|
||||
|
||||
for b in $bands; do
|
||||
if [ "$b" == "$band" ]; then
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
config_foreach mapagent_process_fh fh-iface $device
|
||||
bands="$bands $band"
|
||||
}
|
||||
|
||||
ieee1905_del_ap() {
|
||||
local section=$1
|
||||
|
||||
uci -q delete ieee1905.${section}
|
||||
}
|
||||
|
||||
config_load ieee1905
|
||||
config_foreach ieee1905_del_ap ap
|
||||
|
||||
config_load mapagent
|
||||
config_foreach mapagent_process_radio wifi-radio
|
||||
|
||||
uci commit ieee1905
|
||||
}
|
||||
|
||||
|
||||
brcm_write_credentials() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_apply_wireless() {
|
||||
write_wireless() {
|
||||
local section=$1
|
||||
local map_ifname=$2
|
||||
local bk_ssid="$3"
|
||||
local bk_key="$4"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
#echo found device=$device map=$multi_ap ifname=$ifname mapifname=$map_ifname
|
||||
|
||||
[ "$ifname" != "$map_ifname" ] && return
|
||||
|
||||
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
|
||||
|
||||
uci -q set wireless.${section}.multi_ap_backhaul_ssid="$bk_ssid"
|
||||
uci -q set wireless.${section}.multi_ap_backhaul_key="$bk_key"
|
||||
}
|
||||
config_load wireless
|
||||
|
||||
config_foreach write_wireless wifi-iface "$1" "$2" "$3"
|
||||
}
|
||||
|
||||
mapagent_find_fbss() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
local bk_ssid="$3"
|
||||
local bk_key="$4"
|
||||
|
||||
config_get device $section device
|
||||
config_get multi_ap $section multi_ap "0"
|
||||
|
||||
#echo found dev=$dev device=$device map=$multi_ap
|
||||
|
||||
[ "$device" != "$dev" ] && return
|
||||
[ "$multi_ap" != "2" ] && return
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
|
||||
|
||||
# subshell in hopes to maintain mapagent config loaded
|
||||
echo $(mapagent_apply_wireless $ifname "$bk_ssid" "$bk_key") 2> /dev/null
|
||||
}
|
||||
|
||||
mapagent_find_bbss() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
|
||||
config_get device $section device
|
||||
config_get multi_ap $section multi_ap "0"
|
||||
config_get enabled $section enabled "1"
|
||||
|
||||
#echo found dev=$dev device=$device map=$multi_ap
|
||||
|
||||
[ "$enabled" == "0" ] && return
|
||||
[ "$device" != "$dev" ] && return
|
||||
[ "$multi_ap" != "1" ] && return
|
||||
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
|
||||
#echo found ssid="$ssid" key="$key"
|
||||
|
||||
config_foreach mapagent_find_fbss fh-iface $dev "$ssid" "$key"
|
||||
}
|
||||
|
||||
mapagent_process_radio() {
|
||||
local section=$1
|
||||
|
||||
config_get device $section device
|
||||
|
||||
#echo found dev=$dev
|
||||
|
||||
config_foreach mapagent_find_bbss fh-iface $device
|
||||
}
|
||||
|
||||
|
||||
config_foreach mapagent_process_radio wifi-radio
|
||||
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
brcm_set_network() {
|
||||
local ifname=$1
|
||||
local num=$2
|
||||
local bssid=$3
|
||||
|
||||
wpa_cli -i $ifname set_n $num bssid $bssid
|
||||
}
|
||||
|
||||
bsta_steer() {
|
||||
local ifname=$1
|
||||
local bssid=$2
|
||||
|
||||
rc=$(wpa_cli -i $ifname set_n 0 bssid $bssid)
|
||||
[ "$rc" == "FAIL" ] && {
|
||||
echo "1"
|
||||
return;
|
||||
}
|
||||
|
||||
rc=$(wpa_cli -i $ifname roam $bssid)
|
||||
[ "$rc" == "FAIL" ] && {
|
||||
echo "1"
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
write_bsta_config() {
|
||||
local ifname=$1
|
||||
|
||||
#echo diff = $diff > /dev/console
|
||||
|
||||
config_load mapagent
|
||||
|
||||
mapagent_apply_wl_bsta() {
|
||||
apply_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
local bssid=$3
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
#echo setting diff = $diff > /dev/console
|
||||
uci set wireless.${section}.bssid=$bssid
|
||||
echo 1
|
||||
}
|
||||
config_load wireless
|
||||
|
||||
config_foreach apply_config wifi-iface $1 $2
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
mapagent_process_bk() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
|
||||
config_get ifname $section ifname
|
||||
#echo bsta = $bsta > /dev/console
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
#echo found ifname=$ifname > /dev/console
|
||||
|
||||
config_get bssid $section bssid
|
||||
ret=$(mapagent_apply_wl_bsta $ifname $bssid)
|
||||
[ "$ret" == "1" ] && diff=1
|
||||
}
|
||||
|
||||
|
||||
config_foreach mapagent_process_bk bk-iface $ifname
|
||||
|
||||
#echo result diff = $diff > /dev/console
|
||||
[ "$diff" == "1" ] && {
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
#echo reloading wireless > /dev/console
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
brcm_teardown_iface() {
|
||||
config_load mapagent
|
||||
|
||||
local iface=$1
|
||||
|
||||
mapagent_teardown_wireless() {
|
||||
write_wireless() {
|
||||
local section=$1
|
||||
local map_ifname=$2
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$ifname" != "$map_ifname" ] && return
|
||||
|
||||
uci -q set wireless.${section}.start_disabled="1"
|
||||
uci -q set wireless.${section}.ssid="DISABLED-SSID"
|
||||
uci -q set wireless.${section}.key="DISABLED-KEY"
|
||||
uci -q delete wireless.${section}.multi_ap_backhaul_ssid
|
||||
uci -q delete wireless.${section}.multi_ap_backhaul_key
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach write_wireless wifi-iface $1
|
||||
}
|
||||
|
||||
mapagent_teardown_bss() {
|
||||
local section=$1
|
||||
local iface=$2
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$iface" != "$ifname" ] && return
|
||||
|
||||
config_get ifname $section ifname
|
||||
uci -q set mapagent.${section}.enabled="0"
|
||||
uci -q set mapagent.${section}.ssid="DISABLED-SSID"
|
||||
uci -q set mapagent.${section}.key="DISABLED-KEY"
|
||||
|
||||
# subshell in hopes to maintain mapagent config loaded
|
||||
$(mapagent_teardown_wireless $ifname)
|
||||
}
|
||||
|
||||
|
||||
config_foreach mapagent_teardown_bss fh-iface $iface
|
||||
|
||||
uci commit wireless
|
||||
uci commit mapagent
|
||||
}
|
||||
|
||||
brcm_bsta_to_wireless() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_find_lowest_prio_onboarded() {
|
||||
mapagent_process_bk() {
|
||||
config_get priority $1 priority "2"
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$onboarded" = "0" ] && return
|
||||
|
||||
if [ -z "$sec" -o "$prio" = "-1" -o "$priority" -lt "$prio" ]; then
|
||||
sec=$1
|
||||
prio=$priority
|
||||
fi
|
||||
}
|
||||
|
||||
local sec=""
|
||||
local prio="-1"
|
||||
|
||||
config_foreach mapagent_process_bk bk-iface
|
||||
echo $sec
|
||||
}
|
||||
|
||||
mapagent_enable_best() {
|
||||
#echo 1=$1 best=$best > /dev/console
|
||||
if [ "$1" = "$best" ]; then
|
||||
uci -q set mapagent.$1.enabled='1'
|
||||
else
|
||||
uci -q set mapagent.$1.enabled='0'
|
||||
fi
|
||||
}
|
||||
|
||||
mapagent_bsta_to_wireless() {
|
||||
mapagent_apply_wl_bsta() {
|
||||
apply_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
local ssid="$3"
|
||||
local key="$4"
|
||||
local encryption=$5
|
||||
local enabled=$6
|
||||
local disabled="0"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ -z "$enabled" -o "$enabled" = "0" ] && disabled="1"
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
|
||||
uci set wireless.${section}.ssid="$ssid"
|
||||
uci set wireless.${section}.key="$key"
|
||||
uci set wireless.${section}.encryption=$encryption
|
||||
uci set wireless.${section}.disabled=$disabled
|
||||
echo 1
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach apply_config wifi-iface $@
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
mapagent_find_other_creds() {
|
||||
#echo "trying to find other creds for $2" > /dev/console
|
||||
config_get band $1 band
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$3" != "$band" -o "$onboarded" = "0" ] && return
|
||||
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
config_get encryption $1 encryption
|
||||
config_get enabled $1 enabled "0"
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $2 "$ssid" "$key" $encryption $4) 2> /dev/null
|
||||
}
|
||||
|
||||
config_get band $1 band
|
||||
config_get ifname $1 ifname
|
||||
config_get onboarded $1 onboarded "0"
|
||||
config_get enabled $1 enabled "0"
|
||||
|
||||
if [ "$onboarded" = "0" ]; then
|
||||
config_foreach mapagent_find_other_creds bk-iface $ifname $band $enabled
|
||||
else
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
config_get encryption $1 encryption
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $ifname "$ssid" "$key" $encryption $enabled) 2> /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
best=$(mapagent_find_lowest_prio_onboarded)
|
||||
|
||||
[ -z "$best" ] && return
|
||||
|
||||
band=$1
|
||||
sec=""
|
||||
prio=""
|
||||
|
||||
config_foreach mapagent_enable_best bk-iface $best
|
||||
uci commit mapagent
|
||||
config_load mapagent
|
||||
|
||||
diff=$(config_foreach mapagent_bsta_to_wireless bk-iface)
|
||||
|
||||
[ "$diff" != "" ] && {
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
sync_mapcontroller_from_wireless() {
|
||||
ubus -t 5 wait_for wifi
|
||||
[ "$?" != "0" ] && return
|
||||
|
||||
[ ! -f "/etc/config/wireless" ] && return
|
||||
|
||||
status=$(ubus -S call wifi status)
|
||||
|
||||
device_to_band() {
|
||||
local ifname=$1
|
||||
json_load "$status"
|
||||
json_select "radios"
|
||||
json_get_keys keys
|
||||
|
||||
for key in $keys; do
|
||||
json_select $key
|
||||
json_get_var name name
|
||||
|
||||
if [ "$name" != "$ifname" ]; then
|
||||
json_select ..
|
||||
continue
|
||||
fi
|
||||
|
||||
json_get_var band band
|
||||
|
||||
if [ "$band" == "5GHz" ]; then
|
||||
echo "5"
|
||||
elif [ "$band" == "2.4GHz" ]; then
|
||||
echo "2"
|
||||
fi
|
||||
|
||||
break
|
||||
done
|
||||
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
wireless_process_iface() {
|
||||
local section=$1
|
||||
local type="ap"
|
||||
local enabled="1"
|
||||
|
||||
config_get multi_ap $section multi_ap 0
|
||||
[ "$multi_ap" != "1" ] && [ "$multi_ap" != "2" ] && return
|
||||
|
||||
config_get mode $section mode "ap"
|
||||
[ "$mode" != "ap" ] && return
|
||||
|
||||
config_get device $section device
|
||||
band=$(device_to_band $device)
|
||||
[ "$band" == "" ] && return
|
||||
|
||||
config_get ssid $section ssid
|
||||
config_get key $section key
|
||||
config_get encryption $section encryption
|
||||
config_get start_disabled $section start_disabled "0"
|
||||
config_get network $section network
|
||||
|
||||
|
||||
cntlr_section=$(uci add mapcontroller ${type})
|
||||
uci set mapcontroller.${cntlr_section}.ssid="$ssid"
|
||||
uci set mapcontroller.${cntlr_section}.key="$key"
|
||||
uci set mapcontroller.${cntlr_section}.encryption="$encryption"
|
||||
uci set mapcontroller.${cntlr_section}.band="$band"
|
||||
uci set mapcontroller.${cntlr_section}.vid="1"
|
||||
uci set mapcontroller.${cntlr_section}.network="$network"
|
||||
|
||||
[ "$multi_ap" == "1" ] && map_type="backhaul" || map_type="fronthaul"
|
||||
uci set mapcontroller.${cntlr_section}.type="$map_type"
|
||||
|
||||
[ "$start_disabled" == "1" ] && enabled="0"
|
||||
uci set mapcontroller.${cntlr_section}.enabled="$enabled"
|
||||
}
|
||||
|
||||
mapcontroller_teardown() {
|
||||
local section=$1
|
||||
|
||||
uci delete mapcontroller.$1
|
||||
}
|
||||
|
||||
config_load mapcontroller
|
||||
config_foreach mapcontroller_teardown ap
|
||||
|
||||
config_load wireless
|
||||
config_foreach wireless_process_iface wifi-iface
|
||||
uci commit mapcontroller
|
||||
}
|
||||
|
||||
|
||||
|
||||
func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
wireless_teardown) brcm_wireless_teardown;;
|
||||
setup_network) brcm_setup_network;;
|
||||
setup_wireless) brcm_setup_wireless;;
|
||||
write_credentials) brcm_write_credentials;;
|
||||
sync_credentials) brcm_sync_credentials;;
|
||||
bsta_steer) bsta_steer $@;;
|
||||
set_network) brcm_set_network $@;;
|
||||
write_bsta_config) write_bsta_config $@;;
|
||||
teardown_iface) brcm_teardown_iface $@;;
|
||||
bsta_to_wireless) brcm_bsta_to_wireless $@;;
|
||||
sync_mapcontroller_from_wireless) sync_mapcontroller_from_wireless $@;;
|
||||
ts) ts_sub $@;;
|
||||
--help|help) usage;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
|
||||
381
map-agent/files/lib/wifi/traffic_separation
Executable file
381
map-agent/files/lib/wifi/traffic_separation
Executable file
@@ -0,0 +1,381 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
### Traffic Separation ###
|
||||
|
||||
ts_sub() {
|
||||
|
||||
ts_usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [create|delete|populate]
|
||||
Traffic Separation related functions.
|
||||
create fh <iface> <vid> - create vlan device and rules for wifi fronthaul
|
||||
create bh <iface> <vid> <profile> - create vlan device and rules for wifi backhaul
|
||||
create eth <iface> <vid> <pbits> - create vlan device and rules for logical ethernet interface
|
||||
delete <iface> - delete vlan device
|
||||
populate eth <iface> <vid> - add secondary network rules for logical ethernet interface
|
||||
primary get <iface> - read primary VID for interface from driver (from Association Response frame IE)
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
_get_bridge() {
|
||||
local bridge=$(ip link show $1 | grep -o "master [^\s]*" | cut -d ' ' -f 2)
|
||||
echo $bridge
|
||||
}
|
||||
|
||||
ts_create() {
|
||||
|
||||
_create_vlan_dev() {
|
||||
iface=$1 # real iface
|
||||
vid=$2 # Vlan ID
|
||||
bridge="$(_get_bridge $iface)" # bridge iface is connected to
|
||||
vlan_dev=${iface}_vlan${vid} # name of vlan device to create
|
||||
|
||||
# remove interface from bridge if it is in one
|
||||
[ -n "$bridge" ] && brctl delif $bridge $iface &> /dev/null
|
||||
|
||||
# create vlan device
|
||||
vlanctl --mcast --if-create-name $iface $vlan_dev --if $iface --set-if-mode-rg
|
||||
|
||||
# bring the vlan device up and add back to bridge if it was in one
|
||||
[ -n "$bridge" ] && brctl addif $bridge $vlan_dev &> /dev/null
|
||||
ip link set dev $vlan_dev up
|
||||
|
||||
echo $vlan_dev
|
||||
}
|
||||
|
||||
ts_create_fh() {
|
||||
iface=$1 # fh iface
|
||||
vid=$2 # SSID specific (secondary) or primary vid
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
Adding FH device requires IFACE and VID.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# create vlan device
|
||||
vlan_dev=$(_create_vlan_dev $iface $vid)
|
||||
|
||||
# add rules
|
||||
# Note: removing these for now since these packets are read directly from the iface anyway
|
||||
# vlanctl --if $iface --rx --tags 0 --filter-ethertype 0x888e --set-rxif $vlan_dev --rule-append # incoming EAPOL
|
||||
# vlanctl --if $iface --rx --tags 0 --filter-ethertype 0x886c --set-rxif $vlan_dev --rule-append # incoming brcm
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --filter-vid $vid 0 --pop-tag --dscp2pbits 0 --rule-append
|
||||
}
|
||||
|
||||
# Note: Currently not used (will be needed for Profile 1)
|
||||
ts_create_bh() {
|
||||
iface=$1 # bh iface
|
||||
vid=$2 # primary vid
|
||||
profile=$3 # agent profile (1 or 2)
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$profile" ] || {
|
||||
cat <<EOF
|
||||
Adding BH device requires IFACE, VID and PROFILE (1 or 2).
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# create vlan device
|
||||
vlan_dev=$(_create_vlan_dev $iface $vid)
|
||||
|
||||
# add rules
|
||||
case "$profile" in
|
||||
1 | profile_1 | profile1 | Profile_1 | Profile1)
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --pop-tag --rule-append
|
||||
;;
|
||||
2 | profile_2 | profile2 | Profile_2 | Profile2)
|
||||
vlanctl --if $iface --rx --tags 1 --set-rxif $vlan_dev --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --rule-append # note: already default
|
||||
vlanctl --if $iface --tx --tags 0 --filter-ethertype 0x893a --filter-txif $vlan_dev --push-tag --set-vid $vid 0 --rule-append # note: outgoing IEEE1905.1
|
||||
vlanctl --if $iface --tx --tags 0 --filter-ethertype 0x888e --filter-txif $vlan_dev --push-tag --set-vid $vid 0 --rule-append # note: outgoing EAPOL
|
||||
;;
|
||||
*)
|
||||
ts_delete $iface
|
||||
ts_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_create_bh_drv() {
|
||||
iface=$1 # bh iface
|
||||
vid=$2 # primary vid
|
||||
profile=$3 # agent profile (1 or 2)
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$profile" ] || {
|
||||
cat <<EOF
|
||||
Adding BH device requires IFACE, VID and PROFILE (1 or 2).
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
wl vlan_mode 0 &> /dev/null # make sure this is OFF, else driver won't handle vlan
|
||||
wl -i $iface down &> /dev/null
|
||||
wl -i $iface map_profile $profile &> /dev/null # only has effect on profile 2
|
||||
wl -i $iface map_8021q_settings $vid &> /dev/null # can only be set on bBSS (read-only on bSTA)
|
||||
wl -i $iface up &> /dev/null
|
||||
}
|
||||
|
||||
ts_create_eth() {
|
||||
|
||||
_ts_setup() {
|
||||
vlan_bridge=$1
|
||||
lan_bridge=$2
|
||||
vlan_dev=$3
|
||||
lan_dev=${vlan_dev}_lan
|
||||
|
||||
ip link show $vlan_dev &> /dev/null || ip link add $vlan_dev type veth peer name $lan_dev
|
||||
brctl addif $vlan_bridge $vlan_dev &> /dev/null
|
||||
brctl addif $lan_bridge $lan_dev &> /dev/null
|
||||
ip link set $vlan_dev up
|
||||
ip link set $lan_dev up
|
||||
}
|
||||
|
||||
iface=$1 # Multi-AP Logical Ethernet Interface
|
||||
vid=$2 # primary vid
|
||||
pbits=$3 # default pbits to apply
|
||||
vlan_bridge=$4 # name of ts subsystem bridge
|
||||
lan_bridge=$5 # name of node local bridge
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$pbits" ] && [ -n "$vlan_bridge" ] && [ -n "$lan_bridge" ] || {
|
||||
cat <<EOF
|
||||
Adding ETH device requires IFACE, VID, PBITS and name of vlan and lan bridges.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# create virtual eth device between bridges (if it doesn't exist))
|
||||
_ts_setup $vlan_bridge $lan_bridge $iface
|
||||
|
||||
# create vlan device
|
||||
vlan_dev=$(_create_vlan_dev $iface $vid)
|
||||
|
||||
# TODO: how to disable returning traffic back to incoming interface?
|
||||
|
||||
# add rules
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --set-pbits $pbits 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --pop-tag --rule-append
|
||||
}
|
||||
|
||||
ts_create_dhcp() {
|
||||
_br_setup() {
|
||||
local name=$1
|
||||
local sinkname=$2
|
||||
local vid=$3
|
||||
local diff=""
|
||||
|
||||
[ -z "$(uci -q get network.${name}_dev)" ] && {
|
||||
uci -q set network.${name}_dev="device"
|
||||
uci -q set network.${name}_dev.name="br-${name}"
|
||||
uci -q set network.${name}_dev.type="bridge"
|
||||
uci -q set network.${name}_dev.bridge_empty="1"
|
||||
uci -q add_list network.${name}_dev.ports="${sinkname}"
|
||||
|
||||
diff="1"
|
||||
}
|
||||
|
||||
[ -z "$(uci -q get network.${name})" ] && {
|
||||
uci -q set network.${name}="interface"
|
||||
uci -q set network.${name}.device="br-${name}"
|
||||
uci -q set network.${name}.is_lan="1"
|
||||
uci -q set network.${name}.proto="static"
|
||||
uci -q set network.${name}.ipaddr="192.168.${vid}.1"
|
||||
uci -q set network.${name}.netmask="255.255.255.0"
|
||||
|
||||
diff="1"
|
||||
}
|
||||
|
||||
[ "$diff" = "1" ] && {
|
||||
uci -q commit network
|
||||
ubus call network reload
|
||||
ubus -t 5 wait_for network.device
|
||||
}
|
||||
}
|
||||
|
||||
_dhcp_setup() {
|
||||
local name=$1
|
||||
|
||||
[ -n "$(uci -q get dhcp.${name})" ] && return
|
||||
|
||||
uci -q set dhcp.${name}=dhcp
|
||||
uci -q set dhcp.${name}.interface="${name}"
|
||||
uci -q set dhcp.${name}.start="100"
|
||||
uci -q set dhcp.${name}.limit="150"
|
||||
uci -q set dhcp.${name}.leasetime="1h"
|
||||
uci -q set dhcp.${name}.dhcpv4="server"
|
||||
uci -q set dhcp.${name}.dhcpv6="server"
|
||||
uci -q set dhcp.${name}.ra="server"
|
||||
uci -q set dhcp.${name}.ra_slaac="1"
|
||||
uci -q add_list dhcp.${name}.ra_flags="managed-config"
|
||||
uci -q add_list dhcp.${name}.ra_flags="other-config"
|
||||
|
||||
uci -q commit dhcp
|
||||
ubus call uci commit '{"config":"dhcp"}'
|
||||
}
|
||||
|
||||
_wan_setup() {
|
||||
local name=$1
|
||||
|
||||
config_load firewall
|
||||
|
||||
_process_zone() {
|
||||
local section=$1
|
||||
local sink=$2
|
||||
local name
|
||||
local exists=false
|
||||
|
||||
config_get name $section name
|
||||
|
||||
[ "$name" == "lan" ] || return
|
||||
|
||||
_process_list() {
|
||||
local value=$1
|
||||
|
||||
[ "$value" == "$sink" ] && exists=true && return 1
|
||||
}
|
||||
|
||||
config_list_foreach "$section" network _process_list
|
||||
|
||||
[ $exists = false ] && {
|
||||
uci -q add_list firewall.${section}.network="${sink}"
|
||||
uci -q commit firewall
|
||||
ubus call uci commit '{"config":"firewall"}'
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
config_foreach _process_zone zone $name
|
||||
}
|
||||
|
||||
vid=$1 # primary vid
|
||||
|
||||
[ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
VID required to configure DHCP.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
br_dev=sink_vlan${vid} # name of vlan device to create
|
||||
|
||||
|
||||
ip l a sink1_vlan${vid} type veth peer name sink2_vlan${vid}
|
||||
vlanctl --mcast --if-create-name sink2_vlan${vid} sink3_vlan${vid} --if sink2_vlan${vid} --set-if-mode-rg
|
||||
vlanctl --if sink2_vlan${vid} --rx --tags 1 --filter-vid ${vid} 0 --set-rxif sink3_vlan${vid} --pop-tag --rule-append
|
||||
vlanctl --if sink2_vlan${vid} --tx --tags 0 --filter-txif sink3_vlan${vid} --push-tag --set-vid ${vid} 0 --rule-append
|
||||
ip l s sink1_vlan${vid} up
|
||||
ip l s sink2_vlan${vid} up
|
||||
ip l s sink3_vlan${vid} up
|
||||
|
||||
_br_setup $br_dev sink3_vlan${vid} $vid
|
||||
_dhcp_setup $br_dev
|
||||
_wan_setup $br_dev
|
||||
}
|
||||
|
||||
local type=$1
|
||||
shift
|
||||
|
||||
case "$type" in
|
||||
fh) ts_create_fh $@;;
|
||||
# bh) ts_create_bh $@;;
|
||||
bh) ts_create_bh_drv $@;;
|
||||
eth) ts_create_eth $@;;
|
||||
dhcp) ts_create_dhcp $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_delete() {
|
||||
iface=$1
|
||||
|
||||
path=$(ls -d /sys/class/net/${iface}/upper_*)
|
||||
[ -z "$path" ] && exit 0
|
||||
vlan_dev=${path##*upper_}
|
||||
bridge="$(_get_bridge $vlan_dev)"
|
||||
|
||||
vlanctl --if-delete $vlan_dev # note: also removes rules and removes from bridge
|
||||
|
||||
brctl addif $bridge $iface &> /dev/null
|
||||
}
|
||||
|
||||
ts_populate() {
|
||||
local type=$1
|
||||
shift
|
||||
|
||||
[ "$type" == "eth" ] || {
|
||||
cat <<EOF
|
||||
Populating ETH rules requires IFACE and VID.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
iface=$1 # Multi-AP Logical Ethernet Interface
|
||||
vid=$2 # secondary vid
|
||||
|
||||
path=$(ls -d /sys/class/net/${iface}/upper_*)
|
||||
[ -z "$path" ] && exit 1
|
||||
vlan_dev=${path##*upper_}
|
||||
|
||||
# add rules
|
||||
vlanctl --if $iface --rx --tags 1 --filter-vid $vid 0 --set-rxif $vlan_dev --rule-append # note: retain secondary vids
|
||||
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --rule-append # note: already default
|
||||
}
|
||||
|
||||
ts_primary() {
|
||||
local func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
get) vid=$(wl -i $1 map_8021q_settings); echo ${vid##* };;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_unicast() {
|
||||
local mac=$1
|
||||
local iface=$2
|
||||
|
||||
# TODO: improve?
|
||||
res=$(ebtables -t broute -L | grep -i "$mac" | grep "$iface")
|
||||
[ -n "$res" ] && return
|
||||
|
||||
ebtables -t broute -D BROUTING -d "$mac" -p 0x893a -j DROP
|
||||
ebtables -t broute -I BROUTING -i "$iface" -d "$mac" -p 0x893a -j DROP
|
||||
}
|
||||
|
||||
ts_multicast() {
|
||||
local iface=$1
|
||||
|
||||
# TODO: improve?
|
||||
res=$(ebtables -t broute -L | grep -i "1:80:C2:00:00:13" | grep "$iface")
|
||||
[ -n "$res" ] && return
|
||||
|
||||
ebtables -t broute -D BROUTING -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
ebtables -t broute -D BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
ebtables -t broute -I BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
}
|
||||
|
||||
local func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
create) ts_create $@;;
|
||||
delete) ts_delete $@;;
|
||||
populate) ts_populate $@;;
|
||||
primary) ts_primary $@;;
|
||||
unicast) ts_unicast $@;;
|
||||
multicast) ts_multicast $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=2.4.12
|
||||
PKG_VERSION:=5.0.2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=e4d286f6348519de2613d4ba3548ec811c60ad7b
|
||||
PKG_SOURCE_VERSION:=6ba4d74bbd196b781ba2418eb596a550d34c1028
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@@ -17,13 +17,16 @@ PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/map-controller.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
PKG_BUILD_DEPENDS:=map-plugin
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/map-controller
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi Multi-AP Controller (EasyMesh R2)
|
||||
DEPENDS:=+libuci +libubox +ubus +libmaputils +libwsc +libeasy
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 +map-plugin
|
||||
endef
|
||||
|
||||
define Package/map-controller/description
|
||||
|
||||
@@ -2,43 +2,66 @@ config controller 'controller'
|
||||
option enabled '1'
|
||||
option registrar '5 2' #bands on which wps registrar supported
|
||||
option debug '6'
|
||||
option al_bridge 'br-lan'
|
||||
option enable_sta_steer '0'
|
||||
option enable_bsta_steer '0'
|
||||
option primary_vid '1'
|
||||
option primary_pcp '0'
|
||||
|
||||
config vlan 'lan'
|
||||
option network 'lan'
|
||||
option id '1'
|
||||
config interface 'lan'
|
||||
option 'dhcp'
|
||||
|
||||
config fh-credentials
|
||||
config ap
|
||||
option band '5'
|
||||
option encryption 'psk2'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
option ssid 'map-net5'
|
||||
option vlan '1'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option network 'lan'
|
||||
|
||||
config fh-credentials
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'psk2'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
option ssid 'map-net2'
|
||||
# option bk_ssid 'multiap_ssid123'
|
||||
# option bk_key 'multiap_key123'
|
||||
option vlan '1'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option network 'lan'
|
||||
|
||||
config bk-credentials
|
||||
config ap
|
||||
option band '5'
|
||||
option encryption 'psk2'
|
||||
option encryption 'sae'
|
||||
option key '5555555555'
|
||||
option ssid 'map-bkhaul-5'
|
||||
option multi_ap '2'
|
||||
option type 'backhaul'
|
||||
option disallow_bsta '1' # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
|
||||
option vlan '1'
|
||||
option vid '1'
|
||||
option network 'lan'
|
||||
|
||||
|
||||
config bk-credentials
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'psk2'
|
||||
option encryption 'sae'
|
||||
option key '2222222222'
|
||||
option ssid 'map-bkhaul-2'
|
||||
option multi_ap '2'
|
||||
option disallow_bsta '0' # 0 or 1 profile-1 bSTA
|
||||
option vlan '1'
|
||||
list disallow_bsta '0' # 0 or 1 profile-1 bSTA
|
||||
option vid '1'
|
||||
option type 'backhaul'
|
||||
option network 'lan'
|
||||
|
||||
config policy 'policy'
|
||||
list steer_exclude '00:11:22:33:44:55'
|
||||
list steer_exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
option steer_policy '2' # 0, 1, 2 - see MultiAP spec
|
||||
option util_threshold '200' # channel-util as in BSS load
|
||||
option rcpi_threshold '30' # 0 - 220 valid range
|
||||
option report_scan '0' # 0 or 1 for independent scans
|
||||
option report_sta_assocfails '1' # 0 or 1 - stas assoc failure
|
||||
option report_sta_assocfails_rate '2' # reporting rate for STA assoc fails (attempts per minute)
|
||||
option report_metric_periodic '0' # 0, or 1 - 255 in secs
|
||||
option report_rcpi_threshold '0' # 0, or 1 - 220
|
||||
option report_util_threshold '0' # 0, or channel-util value
|
||||
option rcpi_hysteresis_margin '0' # 0, or > 0 - hysteresis margin
|
||||
option include_sta_stats '0' # sta stats in AP metric resp
|
||||
option include_sta_metric '0' # sta metric in AP metric resp
|
||||
option disallow_bsta_p1 '0' # 0 or 1 profile-1 bSTA
|
||||
option disallow_bsta_p2 '0' # 0 or 1 profile-2 bSTA
|
||||
|
||||
@@ -14,7 +14,6 @@ handle_controller_select() {
|
||||
|
||||
start_service() {
|
||||
local enabled
|
||||
local local_ctrl=0
|
||||
|
||||
config_load "mapcontroller"
|
||||
config_get_bool enabled controller enabled 1
|
||||
@@ -23,9 +22,13 @@ start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/mapcontroller" "-d"
|
||||
|
||||
config_load "mapagent"
|
||||
config_foreach handle_controller_select controller_select
|
||||
[ "$local_ctrl" -eq 0 ] && procd_append_param command "-w"
|
||||
if [ -f /etc/config/mapagent ]; then
|
||||
local local_ctrl=0
|
||||
|
||||
config_load "mapagent"
|
||||
config_foreach handle_controller_select controller_select
|
||||
[ "$local_ctrl" -eq 0 ] && procd_append_param command "-w"
|
||||
fi
|
||||
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
|
||||
@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=map-topology
|
||||
PKG_VERSION:=2.0.1
|
||||
PKG_VERSION:=3.0.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_VERSION:=eec19fb7f18863312760fe0db953d2f4e5ec9f5a
|
||||
PKG_SOURCE_VERSION:=d1fb7e76cb0fe93167648cf32193e73b1ca3522a
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-topology.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -25,7 +25,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/map-topology
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libubox +ubus +libpthread +libuci +libeasy \
|
||||
+libieee1905 +libavahi-nodbus-support
|
||||
+libieee1905 +map-plugin +libavahi-nodbus-support
|
||||
TITLE:=Utility to build topology of a multi-AP network
|
||||
endef
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
config global 'global'
|
||||
option ageing_timer '1440'
|
||||
option reboot_persistent '0'
|
||||
|
||||
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mcastmngr
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ generate_igmp_global_params(){
|
||||
|
||||
generate_mcast_config(){
|
||||
|
||||
up_itf="$(uci -q get network.wan.ifname)"
|
||||
up_itf="$(uci -q get network.wan.device)"
|
||||
|
||||
uci add mcast proxy
|
||||
uci rename mcast.@proxy[-1]="igmp_proxy_1"
|
||||
@@ -35,7 +35,6 @@ generate_mcast_config(){
|
||||
uci set mcast.@proxy[-1].last_member_query_interval="10"
|
||||
uci set mcast.@proxy[-1].fast_leave="1"
|
||||
uci set mcast.@proxy[-1].snooping_mode="2"
|
||||
uci set mcast.@proxy[-1].lan_to_lan="0"
|
||||
uci add_list mcast.@proxy[-1].downstream_interface="br-lan"
|
||||
|
||||
IFS=" "
|
||||
|
||||
@@ -60,7 +60,6 @@ mld_p_down_interfaces=""
|
||||
mld_p_exceptions=""
|
||||
|
||||
# Standard parameters need by BCM's multicast daemon
|
||||
l_2_l_mcast=0
|
||||
allow_brdevice=0
|
||||
|
||||
proxdevs=""
|
||||
@@ -89,7 +88,6 @@ read_snooping() {
|
||||
config_get igmp_s_mode "$config" snooping_mode 0
|
||||
config_get igmp_s_iface "$config" interface
|
||||
config_get igmp_s_exceptions "$config" filter
|
||||
config_get l_2_l_mcast "$config" lan_to_lan
|
||||
return
|
||||
fi
|
||||
|
||||
@@ -104,7 +102,6 @@ read_snooping() {
|
||||
config_get mld_s_mode "$config" snooping_mode 0
|
||||
config_get mld_s_iface "$config" interface
|
||||
config_get mld_s_exceptions "$config" filter
|
||||
config_get l_2_l_mcast "$config" lan_to_lan
|
||||
return
|
||||
fi
|
||||
}
|
||||
@@ -133,7 +130,6 @@ read_proxy() {
|
||||
config_get igmp_p_up_interfaces "$config" upstream_interface
|
||||
config_get igmp_p_down_interfaces "$config" downstream_interface
|
||||
config_get igmp_p_exceptions "$config" filter
|
||||
config_get l_2_l_mcast "$config" lan_to_lan
|
||||
return
|
||||
fi
|
||||
|
||||
@@ -149,7 +145,6 @@ read_proxy() {
|
||||
config_get mld_p_up_interfaces "$config" upstream_interface
|
||||
config_get mld_p_down_interfaces "$config" downstream_interface
|
||||
config_get mld_p_exceptions "$config" filter
|
||||
config_get l_2_l_mcast "$config" lan_to_lan
|
||||
return
|
||||
fi
|
||||
}
|
||||
@@ -187,8 +182,6 @@ config_snooping_on_bridge() {
|
||||
br-*)
|
||||
# set snooping mode on the bridge
|
||||
bcmmcastctl mode -i $snpif -p $bcm_mcast_p -m $3
|
||||
# set L2L snooping mode on the bridge
|
||||
bcmmcastctl l2l -i $snpif -p $bcm_mcast_p -e $l_2_l_mcast # set L2L snooping mode on the bridge
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@@ -350,7 +343,6 @@ disable_snooping() {
|
||||
|
||||
for br in $(brctl show | grep 'br-' | awk '{print$1}' | tr '\n' ' '); do
|
||||
bcmmcastctl mode -i $br -p $bcm_mcast_p -m 0 # disable snooping on all bridges
|
||||
bcmmcastctl l2l -i $br -p $bcm_mcast_p -e 0 # disable L2L snooping on all bridges
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
42
obudpst/Makefile
Normal file
42
obudpst/Makefile
Normal file
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# Copyright (c) 2020, Broadband Forum
|
||||
# Copyright (c) 2020, AT&T Communications
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obudpst
|
||||
PKG_VERSION:=7.2.1
|
||||
PKG_SOURCE_VERSION:=9c448095c9773bd7e5cea143af07817ad9f3c6ba
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/BroadbandForum/obudpst.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/obudpst
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS+=+libopenssl
|
||||
TITLE:=Open Broadband-UDP Speed Test (OB-UDPST)
|
||||
endef
|
||||
|
||||
define Build/Install
|
||||
:
|
||||
endef
|
||||
|
||||
define Package/obudpst/description
|
||||
Open Broadband-UDP Speed Test (OB-UDPST) is a client/server software utility to demonstrate
|
||||
one approach of doing IP capacity measurements described by Broadband Forum TR-471.
|
||||
endef
|
||||
|
||||
define Package/obudpst/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/udpst $(1)/usr/sbin/udpst
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obudpst))
|
||||
15
obuspa/Config.in
Normal file
15
obuspa/Config.in
Normal file
@@ -0,0 +1,15 @@
|
||||
if PACKAGE_obuspa
|
||||
|
||||
config OBUSPA_MTP_ENABLE_STOMP
|
||||
bool "Enable STOMP as mtp protocol"
|
||||
default y
|
||||
|
||||
config OBUSPA_MTP_ENABLE_MQTT
|
||||
bool "Enable MQTT as mtp protocol"
|
||||
default y
|
||||
|
||||
config OBUSPA_MTP_ENABLE_COAP
|
||||
bool "Enable CoAP as mtp protocol"
|
||||
default y
|
||||
|
||||
endif
|
||||
@@ -5,14 +5,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=3.0.0.27
|
||||
PKG_VERSION:=4.1.0.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=240201835633d1c32d29ca7caf5e021019243b93
|
||||
PKG_SOURCE_VERSION:=588a3506c197fdb9b7ea50dae5680f2aadf33b51
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -36,10 +37,38 @@ define Package/obuspa/description
|
||||
OB-USP-AGENT is a system daemon providing a User Services Platform (USP) Agent.
|
||||
endef
|
||||
|
||||
define Package/obuspa/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_STOMP),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-stomp
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-stomp
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_MQTT),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-mqtt
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-mqtt
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_COAP),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-coap
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-coap
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/obuspa/* $(PKG_BUILD_DIR)/
|
||||
@@ -55,6 +84,8 @@ define Package/obuspa/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
$(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/
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
config obuspa 'global'
|
||||
option enabled 'true'
|
||||
option enabled '1'
|
||||
option interface 'wan'
|
||||
#option ifname 'eth0.1'
|
||||
option debug '0'
|
||||
option log_level '1'
|
||||
#option db_file '/tmp/usp.db'
|
||||
#option db_file '/etc/obuspa/usp.db'
|
||||
#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'
|
||||
#option log_dest '/var/log/obuspa'
|
||||
|
||||
config localagent 'localagent'
|
||||
option Enable 'true'
|
||||
option Enable '1'
|
||||
|
||||
# Adds Device.LocalAgent.Controller.
|
||||
config controller 'localcontroller'
|
||||
@@ -18,6 +20,7 @@ config controller 'localcontroller'
|
||||
option Protocol 'MQTT'
|
||||
option Topic '/usp/controller'
|
||||
option mqtt 'localmqtt'
|
||||
option assigned_role_name 'full_access'
|
||||
|
||||
# Adds Device.LocalAgent.MTP.
|
||||
config mtp
|
||||
@@ -30,8 +33,6 @@ config mqtt 'localmqtt'
|
||||
option BrokerAddress '127.0.0.1'
|
||||
option BrokerPort '1883'
|
||||
option TransportProtocol 'TCP/IP'
|
||||
option Username 'admin'
|
||||
option Password 'admin'
|
||||
|
||||
# Add Device.LocalAgent.Subscription.
|
||||
config subscription
|
||||
@@ -41,3 +42,18 @@ config subscription
|
||||
option Persistent 'true'
|
||||
option controller 'localcontroller'
|
||||
|
||||
#config challenge 'admin'
|
||||
# option Description 'Request to get Administrative access'
|
||||
# option role_name 'full_access'
|
||||
# option Enable '1'
|
||||
# option Value 'admin'
|
||||
# option Retries 2
|
||||
# option LockoutPeriod 60
|
||||
|
||||
#config challenge 'user'
|
||||
# option Description 'Request to get User access'
|
||||
# option role_name 'user'
|
||||
# option Enable '1'
|
||||
# option Value 'user'
|
||||
# option Retries 3
|
||||
# option LockoutPeriod 30
|
||||
|
||||
@@ -5,5 +5,7 @@
|
||||
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
|
||||
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" ] && exit 0
|
||||
|
||||
echo "Restarting obuspa"|logger -t obuspa.hotplug -p debug
|
||||
|
||||
/etc/init.d/obuspa reload
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=2
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/obuspa
|
||||
|
||||
EXTRA_COMMANDS="remove_db"
|
||||
EXTRA_HELP=" remove_db Removes obuspa persistent db before restarting"
|
||||
|
||||
PARAM_FILE="/tmp/obuspa_param_reset.txt"
|
||||
CONFIGURATION=obuspa
|
||||
PARAM_FILE="/tmp/obuspa_param_reset.txt"
|
||||
KEEP_FILES="/lib/upgrade/keep.d/obuspa"
|
||||
USP_TEMP_FILE="/tmp/usp.tmp"
|
||||
controller_num=0
|
||||
@@ -16,12 +14,24 @@ mtp_num=0
|
||||
stomp_num=0
|
||||
mqtt_num=0
|
||||
subs_num=0
|
||||
challenge_num=0
|
||||
index=0
|
||||
role_def_file=""
|
||||
PROFILE="/root/.profile"
|
||||
|
||||
. /lib/functions/network.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
cleanup() {
|
||||
if [ -f "${USP_TEMP_FILE}" ]; then
|
||||
rm -f "${USP_TEMP_FILE}"
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t obuspa -p debug
|
||||
echo "${@}"|logger -t obuspa.init -p debug
|
||||
}
|
||||
|
||||
db_set() {
|
||||
@@ -32,6 +42,19 @@ db_set() {
|
||||
fi
|
||||
}
|
||||
|
||||
update_keep() {
|
||||
keep_file=${1}
|
||||
|
||||
if [ -z "${keep_file}" ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
grep -q "${keep_file}" ${KEEP_FILES}
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo ${keep_file} >> ${KEEP_FILES}
|
||||
fi
|
||||
}
|
||||
|
||||
get_index() {
|
||||
index=$(( index + 1 ))
|
||||
if [ "$1" = "$2" ]; then
|
||||
@@ -39,6 +62,39 @@ get_index() {
|
||||
fi
|
||||
}
|
||||
|
||||
get_role_index_from_json() {
|
||||
local role="${@}"
|
||||
local num=0
|
||||
|
||||
# In case of role is empty or file not present
|
||||
if [ -z "${role}" -o ! -f ${role_def_file} ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_init
|
||||
json_load_file ${role_def_file}
|
||||
|
||||
json_select roles
|
||||
json_get_keys roles_obj
|
||||
|
||||
for k in ${roles_obj}; do
|
||||
local rname
|
||||
json_select $k
|
||||
json_get_var rname name
|
||||
json_select ..
|
||||
|
||||
if [ "${rname}" != "Untrusted" -a "${rname}" != "full_access" ]; then
|
||||
num=$(( num + 1 ))
|
||||
fi
|
||||
|
||||
if [ "${role}" = "${rname}" ]; then
|
||||
return ${num}
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
get_uci_ref_index() {
|
||||
local val;
|
||||
|
||||
@@ -62,14 +118,15 @@ validate_obuspa_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} obuspa "${1}" \
|
||||
'enabled:bool:true' \
|
||||
'trust_cert:string' \
|
||||
'client_cert:string' \
|
||||
'trust_cert:file' \
|
||||
'client_cert:file' \
|
||||
'interface:string' \
|
||||
'ifname:string:"br-lan"' \
|
||||
'ifname:string:br-lan' \
|
||||
'debug:bool:false' \
|
||||
'log_level:uinteger' \
|
||||
'log_dest:string' \
|
||||
'db_file:string'
|
||||
'db_file:string' \
|
||||
'role_file:file'
|
||||
}
|
||||
|
||||
validate_localagent_section()
|
||||
@@ -85,7 +142,8 @@ validate_controller_section()
|
||||
uci_validate_section ${CONFIGURATION} controller "${1}" \
|
||||
'EndpointID:string' \
|
||||
'Enable:bool:true' \
|
||||
'AssignedRole:string:Device.LocalAgent.ControllerTrust.Role.1' \
|
||||
'AssignedRole:string' \
|
||||
'assigned_role_name:string' \
|
||||
'PeriodicNotifInterval:uinteger:86400' \
|
||||
'PeriodicNotifTime:string' \
|
||||
'USPNotifRetryMinimumWaitInterval:uinteger:5' \
|
||||
@@ -95,9 +153,9 @@ validate_controller_section()
|
||||
'Reference:string' \
|
||||
'Destination:string:controller-notify-dest' \
|
||||
'Topic:string' \
|
||||
'coap_host:string' \
|
||||
'coap_host:host' \
|
||||
'coap_path:string' \
|
||||
'coap_port:uinteger' \
|
||||
'coap_port:port' \
|
||||
'mqtt:string' \
|
||||
'stomp:string'
|
||||
}
|
||||
@@ -124,7 +182,7 @@ validate_mtp_section()
|
||||
'PublishQoS:uinteger' \
|
||||
'Destination:string' \
|
||||
'coap_path:string' \
|
||||
'coap_port:uinteger' \
|
||||
'coap_port:port' \
|
||||
'mqtt:string' \
|
||||
'stomp:string'
|
||||
}
|
||||
@@ -132,12 +190,12 @@ validate_mtp_section()
|
||||
validate_stomp_connection_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} stomp "${1}" \
|
||||
'Host:string:usp-controller.com' \
|
||||
'Host:host' \
|
||||
'Username:string' \
|
||||
'Password:string' \
|
||||
'encryption:bool:true' \
|
||||
'Enable:bool:true' \
|
||||
'Port:uinteger:61613' \
|
||||
'Port:port:61613' \
|
||||
'VirtualHost:string:/' \
|
||||
'EnableHeartbeats:bool:true' \
|
||||
'OutgoingHeartbeat:uinteger:30000' \
|
||||
@@ -150,13 +208,13 @@ validate_stomp_connection_section()
|
||||
validate_mqtt_client_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} mqtt "${1}" \
|
||||
'BrokerAddress:string' \
|
||||
'BrokerPort:uinteger:1883' \
|
||||
'BrokerAddress:host' \
|
||||
'BrokerPort:port:1883' \
|
||||
'Enable:bool:true' \
|
||||
'Username:string' \
|
||||
'Password:string' \
|
||||
'ProtocolVersion:string:5.0' \
|
||||
'TransportProtocol:string:TCP/IP' \
|
||||
'ProtocolVersion:or("3.1", "3.1.1","5.0"):5.0' \
|
||||
'TransportProtocol:or("TCP/IP","TLS"):TCP/IP' \
|
||||
'KeepAliveTime:uinteger:60' \
|
||||
'ClientID:string' \
|
||||
'ConnectRetryTime:uinteger:5' \
|
||||
@@ -180,7 +238,6 @@ configure_localagent() {
|
||||
_num=1
|
||||
while [ ${_num} -le ${controller_num} ]
|
||||
do
|
||||
db_set Device.LocalAgent.Controller.${_num}.BootParameter.1.Alias "cpe-1"
|
||||
db_set Device.LocalAgent.Controller.${_num}.BootParameter.1.Enable "${Enable}"
|
||||
db_set Device.LocalAgent.Controller.${_num}.BootParameter.1.ParameterName "${ParameterName}"
|
||||
_num=$(( ${_num} + 1 ))
|
||||
@@ -192,14 +249,14 @@ configure_localagent() {
|
||||
configure_controller() {
|
||||
local EndpointID Enable AssignedRole PeriodicNotifInterval PeriodicNotifTime USPNotifRetryMinimumWaitInterval
|
||||
local USPNotifRetryIntervalMultiplier ControllerCode Protocol Destination coap_host coap_path coap_port
|
||||
local Reference Topic mqtt stomp
|
||||
local Reference Topic mqtt stomp assigned_role_name
|
||||
|
||||
validate_controller_section "${1}" || {
|
||||
log "Validation of controller section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ -z ${EndpointID} -o -z ${Protocol} ]; then
|
||||
if [ -z "${EndpointID}" -o -z "${Protocol}" ]; then
|
||||
log "controller:: EndpointID id and Protocol cannot be empty"
|
||||
return 1;
|
||||
fi
|
||||
@@ -232,7 +289,15 @@ configure_controller() {
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.Alias "cpe-${controller_num}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.Enable "${Enable}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.EndpointID "${EndpointID}"
|
||||
#db_set Device.LocalAgent.Controller.${controller_num}.AssignedRole "${AssignedRole}"
|
||||
if [ -n "${AssignedRole}" ]; then
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.AssignedRole "${AssignedRole}"
|
||||
else
|
||||
if [ -n "${assigned_role_name}" ]; then
|
||||
AssignedRole=$(get_role_index ${assigned_role_name})
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.AssignedRole "${AssignedRole}"
|
||||
fi
|
||||
fi
|
||||
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.PeriodicNotifInterval "${PeriodicNotifInterval}"
|
||||
if [ -n "${PeriodicNotifTime}" ]; then
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.PeriodicNotifTime "${PeriodicNotifTime}"
|
||||
@@ -297,6 +362,95 @@ configure_subscription(){
|
||||
db_set Device.LocalAgent.Subscription.${subs_num}.Recipient "${Recipient}"
|
||||
}
|
||||
|
||||
validate_challenge_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} challenge "${1}" \
|
||||
'Enable:bool:true' \
|
||||
'Alias:string' \
|
||||
'Description:string' \
|
||||
'role_name:string' \
|
||||
'Role:string' \
|
||||
'Value:string' \
|
||||
'Retries:uinteger:3' \
|
||||
'LockoutPeriod:uinteger:0'
|
||||
}
|
||||
|
||||
check_json_load()
|
||||
{
|
||||
local ret=0
|
||||
if [ -f ${role_def_file} ]; then
|
||||
json_init
|
||||
json_load_file ${role_def_file} 2>&1 |grep -q Failed
|
||||
if [ $? -eq 0 ]; then # In case of invalid json file
|
||||
log "failed to load [${role_def_file}]"
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
json_init
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
get_role_index() {
|
||||
local role="Device.LocalAgent.ControllerTrust.Role"
|
||||
local idx=0
|
||||
local role_name="${@}"
|
||||
|
||||
case "${role_name}" in
|
||||
'full_access')
|
||||
idx=1;
|
||||
;;
|
||||
'Untrusted')
|
||||
idx=2;
|
||||
;;
|
||||
*)
|
||||
local ji=0
|
||||
|
||||
check_json_load
|
||||
if [ $? -eq 0 ]; then
|
||||
get_role_index_from_json ${role_name}
|
||||
ji=$?
|
||||
fi
|
||||
idx=$(( ji + 2 )) # Add predefined roles
|
||||
esac
|
||||
|
||||
echo "${role}.${idx}"
|
||||
}
|
||||
|
||||
configure_challenges() {
|
||||
local Enable Description role_name Role Value Retries LockoutPeriod Alias
|
||||
|
||||
validate_challenge_section "${1}" || {
|
||||
log "Validation of challenge section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ -z "${role_name}" -a -z ${Role} ]; then
|
||||
log "Either role_name or Role must defined for a challenge";
|
||||
return 1;
|
||||
fi
|
||||
|
||||
challenge_num=$(( challenge_num + 1))
|
||||
|
||||
db_set Device.LocalAgent.ControllerTrust.Challenge.${challenge_num}.Enable "${Enable}"
|
||||
if [ -n "${Description}" ]; then
|
||||
db_set Device.LocalAgent.ControllerTrust.Challenge.${challenge_num}.Description "${Description}"
|
||||
fi
|
||||
|
||||
if [ -z "${Role}" ]; then
|
||||
Role=$(get_role_index ${role_name})
|
||||
fi
|
||||
|
||||
if [ -z "${Alias}" -a -n "${role_name}" ]; then
|
||||
Alias=${role_name}
|
||||
fi
|
||||
|
||||
db_set Device.LocalAgent.ControllerTrust.Challenge.${challenge_num}.Alias "${Alias}"
|
||||
db_set Device.LocalAgent.ControllerTrust.Challenge.${challenge_num}.Role "${Role}"
|
||||
db_set Device.LocalAgent.ControllerTrust.Challenge.${challenge_num}.Value "${Value}"
|
||||
db_set Device.LocalAgent.ControllerTrust.Challenge.${challenge_num}.Retries "${Retries}"
|
||||
db_set Device.LocalAgent.ControllerTrust.Challenge.${challenge_num}.LockoutPeriod "${LockoutPeriod}"
|
||||
}
|
||||
|
||||
configure_mtp() {
|
||||
local Enable Protocol Reference ResponseTopicConfigured PublishQoS
|
||||
local stomp mqtt
|
||||
@@ -366,7 +520,7 @@ configure_stomp_connection() {
|
||||
db_set Device.STOMP.Connection.${stomp_num}.Alias "cpe-${stomp_num}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.Enable "${Enable}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.Port "${Port}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.X_ARRIS-COM_EnableEncryption "${encryption}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.EnableEncryption "${encryption}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.VirtualHost "${VirtualHost}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.EnableHeartbeats "${EnableHeartbeats}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.OutgoingHeartbeat "${OutgoingHeartbeat}"
|
||||
@@ -412,14 +566,14 @@ configure_mqtt_client(){
|
||||
|
||||
|
||||
configure_obuspa() {
|
||||
local enabled trust_cert ifname interface debug log_level db_file log_dest
|
||||
local enabled trust_cert ifname interface debug log_level db_file log_dest role_file
|
||||
|
||||
validate_obuspa_section "global" || {
|
||||
log "Validation of global section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ ${enabled} -eq 0 ] && return 0
|
||||
role_def_file="${role_file}"
|
||||
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
@@ -438,28 +592,38 @@ configure_obuspa() {
|
||||
fi
|
||||
|
||||
if [ -n "${interface}" ]; then
|
||||
network_get_device ifname ${interface}
|
||||
network_get_physdev ifname ${interface}
|
||||
log "ifname from ${interface} is ${ifname}"
|
||||
fi
|
||||
|
||||
# Set this variable for root user and obuspa -c tool
|
||||
grep -q "export USP_BOARD_IFNAME=${ifname}" /root/.profile || \
|
||||
echo "export USP_BOARD_IFNAME=${ifname}" >> /root/.profile
|
||||
if [ -f "${PROFILE}" ]; then
|
||||
grep -q "export USP_BOARD_IFNAME=${ifname}" ${PROFILE}
|
||||
if [ "$?" -ne 0 ]; then
|
||||
grep -q "export USP_BOARD_IFNAME" ${PROFILE}
|
||||
if [ "$?" -eq 0 ]; then
|
||||
sed -i "g/export USP_BOARD_IFNAME/d" ${PROFILE}
|
||||
fi
|
||||
echo "export USP_BOARD_IFNAME=${ifname}" >> ${PROFILE}
|
||||
fi
|
||||
else
|
||||
echo "export USP_BOARD_IFNAME=${ifname}" > ${PROFILE}
|
||||
fi
|
||||
|
||||
if [ -n "${db_file}" ]; then
|
||||
echo "${db_file}" >>${KEEP_FILES}
|
||||
update_keep "${db_file}"
|
||||
procd_append_param command -f ${db_file}
|
||||
fi
|
||||
|
||||
if [ -n "${trust_cert}" ]; then
|
||||
echo "${trust_cert}" >>${KEEP_FILES}
|
||||
update_keep "${trust_cert}"
|
||||
if [ -f "${trust_cert}" ]; then
|
||||
procd_append_param command -t ${trust_cert}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${client_cert}" ]; then
|
||||
echo "${client_cert}" >>${KEEP_FILES}
|
||||
update_keep "${client_cert}"
|
||||
if [ -f "${client_cert}" ]; then
|
||||
procd_append_param command -a ${client_cert}
|
||||
fi
|
||||
@@ -470,10 +634,6 @@ configure_obuspa() {
|
||||
|
||||
# Create factory reset file
|
||||
db_init() {
|
||||
[ -f ${PARAM_FILE} ] && rm -f ${PARAM_FILE}
|
||||
[ -f /tmp/usp.db ] && rm -f /tmp/usp.db
|
||||
[ -f ${KEEP_FILES} ] && rm -f ${KEEP_FILES}
|
||||
|
||||
# Load configuration
|
||||
config_load $CONFIGURATION
|
||||
config_foreach configure_obuspa obuspa
|
||||
@@ -483,63 +643,24 @@ db_init() {
|
||||
config_foreach configure_stomp_connection stomp
|
||||
config_foreach configure_mqtt_client mqtt
|
||||
config_foreach configure_subscription subscription
|
||||
config_foreach configure_challenges challenge
|
||||
|
||||
db_set Internal.Reboot.Cause "LocalFactoryReset"
|
||||
}
|
||||
|
||||
# if uci changes for obuspa remove persistent db and then reload
|
||||
remove_db() {
|
||||
local db_file
|
||||
|
||||
config_load obuspa
|
||||
config_get db_file global db_file
|
||||
|
||||
log "Removing db file (${db_file})"
|
||||
[ -f ${db_file} ] && rm -f ${db_file}
|
||||
|
||||
sed -i "g/export USP_BOARD_IFNAME/d" /root/.profile
|
||||
|
||||
log "Restarting service"
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_running() {
|
||||
local AgentEndpointID serial oui user pass
|
||||
local opt=""
|
||||
|
||||
ubus -t 10 wait_for usp.raw
|
||||
config_load obuspa
|
||||
config_get AgentEndpointID localagent EndpointID ""
|
||||
if [ -z "${AgentEndpointID}" ]; then
|
||||
serial=$(ubus -t 1 call usp.raw get '{"path":"Device.DeviceInfo.SerialNumber"}'|jsonfilter -e '@["parameters"][0].value')
|
||||
oui=$(ubus -t 1 call usp.raw get '{"path":"Device.DeviceInfo.ManufacturerOUI"}'|jsonfilter -e '@["parameters"][0].value')
|
||||
AgentEndpointID="os::${oui}-${serial}"
|
||||
fi
|
||||
|
||||
config_get user localmqtt Username
|
||||
if [ -n "${user}" ]; then
|
||||
opt="-u ${user}"
|
||||
fi
|
||||
config_get pass localmqtt Password
|
||||
if [ -n "${pass}" ]; then
|
||||
opt="${opt} -P ${pass}"
|
||||
fi
|
||||
# publish Agent's EndpointID in mosquito broker for discovery
|
||||
# This is a work around till obuspa does not support advertising
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" ${opt}
|
||||
|
||||
procd_running ${CONFIGURATION}
|
||||
}
|
||||
|
||||
start_service() {
|
||||
ubus wait_for usp.raw
|
||||
if [ "$?" -ne 0 ]; then
|
||||
log "OBUSPA failed to start usp.raw not available"
|
||||
return 0
|
||||
local enabled
|
||||
|
||||
config_load obuspa
|
||||
config_get enabled global enabled
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
log "OBUSPA not enabled"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
ubus wait_for usp.raw
|
||||
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
procd_set_param command ${PROG}
|
||||
db_init
|
||||
@@ -553,7 +674,19 @@ start_service() {
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
local db_file
|
||||
|
||||
config_load obuspa
|
||||
config_get db_file global db_file
|
||||
|
||||
${PROG} -c stop 2>&1 >/dev/null
|
||||
|
||||
if [ -z "${db_file}" ]; then
|
||||
db_file="/tmp/usp.db"
|
||||
fi
|
||||
|
||||
[ -f ${db_file} ] && rm -f ${db_file}
|
||||
[ -f ${PARAM_FILE} ] && rm -f ${PARAM_FILE}
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
@@ -562,8 +695,7 @@ reload_service() {
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "uspd" "mosquitto"
|
||||
procd_add_config_trigger "config.change" "${CONFIGURATION}" /etc/init.d/obuspa remove_db
|
||||
procd_add_reload_trigger "obuspa" "mosquitto"
|
||||
|
||||
# Create a reload trigger if schema update avaialble
|
||||
procd_open_trigger
|
||||
@@ -582,13 +714,7 @@ service_triggers() {
|
||||
json_add_string "" "reload"
|
||||
json_close_array
|
||||
json_close_array
|
||||
json_add_int "" "1000"
|
||||
json_add_int "" "2000"
|
||||
json_close_array
|
||||
procd_close_trigger
|
||||
|
||||
|
||||
# local interface
|
||||
# config_load obuspa
|
||||
# config_get interface global interface
|
||||
# [ -n "$interface" ] && procd_add_interface_trigger "interface.*" "$interface" /etc/init.d/obuspa reload
|
||||
}
|
||||
|
||||
6
obuspa/files/etc/obuspa/dmcaching_exclude.json
Normal file
6
obuspa/files/etc/obuspa/dmcaching_exclude.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"dmcaching_exclude": [
|
||||
"Device.DeviceInfo.ProcessStatus.Process.",
|
||||
"Device.Hosts.Host."
|
||||
]
|
||||
}
|
||||
97
obuspa/files/etc/obuspa/roles.json
Normal file
97
obuspa/files/etc/obuspa/roles.json
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"roles": [
|
||||
{
|
||||
"name": "admin",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "user",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "undefined-1"
|
||||
},
|
||||
{
|
||||
"name": "undefined-2"
|
||||
},
|
||||
{
|
||||
"name": "undefined-3"
|
||||
},
|
||||
{
|
||||
"name": "undefined-4"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,19 +2,6 @@
|
||||
|
||||
[ "$ACTION" = ifup ] || exit 0
|
||||
|
||||
handle_interface() {
|
||||
ifname=$(uci get network.$1.ifname)
|
||||
|
||||
case "$ifname" in
|
||||
@*)
|
||||
alias_interface="$1 $alias_interface"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach handle_interface "interface"
|
||||
|
||||
compare_owsd_iface() {
|
||||
local interface
|
||||
|
||||
@@ -24,13 +11,6 @@ compare_owsd_iface() {
|
||||
/etc/init.d/owsd reload
|
||||
exit
|
||||
fi
|
||||
|
||||
for i in $alias_interface; do
|
||||
if [ "$INTERFACE" == "$i" ]; then
|
||||
/etc/init.d/owsd reload
|
||||
exit
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
config_load owsd
|
||||
|
||||
@@ -5,14 +5,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=91b15f9779baccc93213ce3ca164c326235d3096
|
||||
PKG_SOURCE_VERSION:=312573b91b2ae10d0fe04a4d11ae37898f526fdb
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/periodicstats.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -25,7 +26,7 @@ define Package/periodicstats
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Periodic Statistics Daemon
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm +libbbf_api +uspd
|
||||
endef
|
||||
|
||||
define Package/periodicstats/description
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
config globals 'globals'
|
||||
option enable '0'
|
||||
option base_interval '5'
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ PROG=/usr/sbin/periodicstatsd
|
||||
. /lib/functions.sh
|
||||
|
||||
start_service() {
|
||||
ubus wait_for usp
|
||||
if [ -f "/etc/config/periodicstats" ]; then
|
||||
if [ "$(uci -q get periodicstats.globals.enable)" == "1" ]; then
|
||||
procd_open_instance periodicstatsd
|
||||
@@ -25,12 +26,8 @@ stop() {
|
||||
echo ;
|
||||
}
|
||||
|
||||
boot() {
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger periodicstats
|
||||
procd_add_reload_trigger periodicstats uspd
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
@@ -38,6 +35,3 @@ reload_service() {
|
||||
start
|
||||
}
|
||||
|
||||
restart() {
|
||||
start
|
||||
}
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=prj-unish
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=a47110968d57fa1d0765900254b63c8ef983e741
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/prj-unish.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/prj-unish
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Project unish
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/prj-unish/description
|
||||
This package provides unish-paanch.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/prj-unish/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/InstallDev
|
||||
#$(INSTALL_DIR) $(STAGING_DIR)/usr/include
|
||||
#$(CP) $(PKG_BUILD_DIR)/src/cmdu.h $(STAGING_DIR)/usr/include/
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/src/cmdu.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/lib*.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map2.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map_module.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/lib*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/prj-unish/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/src/lib*.so* $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/i1905d $(1)/usr/sbin/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,prj-unish))
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
config ieee1905 'ieee1905'
|
||||
option enabled '1'
|
||||
option extension 0
|
||||
option macaddress 'aa:aa:aa:10:20:30'
|
||||
option registrar '2 5'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid 'TestSSID.2'
|
||||
option encryption 'psk2'
|
||||
option key '5555500000'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid 'TestSSID.5'
|
||||
option encryption 'psk2'
|
||||
option key '2222200000'
|
||||
|
||||
config al-iface
|
||||
option enabled 1
|
||||
option ifname 'br-lan'
|
||||
option type 'bridge'
|
||||
@@ -6,14 +6,14 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qosmngr
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=03df56c6eb7c6737ce95576e89c915df77396953
|
||||
PKG_SOURCE_VERSION:=460327011d932580f55c7b70acb1e652dd3c95a3
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/qosmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
@@ -23,11 +23,6 @@ start_service() {
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
#stop_service() is called after procd killed the service
|
||||
echo ;
|
||||
}
|
||||
|
||||
boot() {
|
||||
setup_qos
|
||||
start
|
||||
@@ -37,12 +32,8 @@ service_triggers() {
|
||||
procd_add_reload_trigger qos
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# Call functions to configure QoS
|
||||
start
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
setup_qos
|
||||
start
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
ethwan="$(db -q get hw.board.ethernetWanPort)"
|
||||
cpu_model="$(grep Hardware /proc/cpuinfo | awk '{print$NF}')"
|
||||
cpu_model="$(brcm_fw_tool -k info)"
|
||||
|
||||
generate_queue(){
|
||||
section="$1"
|
||||
@@ -19,7 +19,7 @@ generate_queue(){
|
||||
|
||||
if [ $is_lan -eq 1 ]; then
|
||||
case $cpu_model in
|
||||
BCM968*) no_of_q="0 1 2 3" ;;
|
||||
68*) no_of_q="0 1 2 3" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
. /lib/network/port.sh
|
||||
|
||||
IP_RULE=""
|
||||
BR_RULE=""
|
||||
@@ -13,6 +14,7 @@ PREV_ORDER=""
|
||||
CURR_ORDER=""
|
||||
MAX_ORDER=""
|
||||
|
||||
|
||||
# Function to handle a queue order and
|
||||
# update total number of queues
|
||||
handle_q_order() {
|
||||
@@ -52,7 +54,7 @@ configure_precedence_to_file() {
|
||||
line="$2"
|
||||
order_file="$3"
|
||||
|
||||
if [ $order == $PREV_ORDER ]; then
|
||||
if [ $order == "$PREV_ORDER" ]; then
|
||||
queue_id=${line#*_}
|
||||
val=${CURR_ORDER}_${queue_id}
|
||||
echo $val >> $order_file
|
||||
@@ -122,7 +124,7 @@ handle_queue() {
|
||||
fi
|
||||
|
||||
# This is to get the qid per interface.
|
||||
if [ $INTF_NAME == $ifname ]; then
|
||||
if [ "$INTF_NAME" == $ifname ]; then
|
||||
Q_COUNT=$((Q_COUNT + 1))
|
||||
else
|
||||
Q_COUNT='0'
|
||||
@@ -231,6 +233,12 @@ handle_shaper() {
|
||||
fi
|
||||
|
||||
config_get rate "$sid" "rate"
|
||||
# Convert the rate from bps to kbps.
|
||||
if [ $rate -lt 1000 ];then
|
||||
return
|
||||
fi
|
||||
|
||||
rate=$(($rate / 1000))
|
||||
config_get bs "$sid" "burst_size"
|
||||
tmctl setportshaper --devtype 0 --if $ifname --shapingrate $rate --burstsize $bs
|
||||
}
|
||||
@@ -245,17 +253,17 @@ setup_qos() {
|
||||
ebtables -t broute -I BROUTING -j qos
|
||||
fi
|
||||
|
||||
iptables -t mangle -N qos_forward
|
||||
iptables -w -t mangle -N qos_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -t mangle -I FORWARD -j qos_forward
|
||||
[ $ret -eq 0 ] && iptables -w -t mangle -I FORWARD -j qos_forward
|
||||
|
||||
iptables -t mangle -N qos_prerouting
|
||||
iptables -w -t mangle -N qos_prerouting
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -t mangle -I PREROUTING -j qos_prerouting
|
||||
[ $ret -eq 0 ] && iptables -w -t mangle -I PREROUTING -j qos_prerouting
|
||||
|
||||
iptables -t mangle -N qos_output
|
||||
iptables -w -t mangle -N qos_output
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -t mangle -I OUTPUT -j qos_output
|
||||
[ $ret -eq 0 ] && iptables -w -t mangle -I OUTPUT -j qos_output
|
||||
|
||||
ip6tables -t mangle -N qos_forward
|
||||
ret=$?
|
||||
@@ -273,13 +281,13 @@ setup_qos() {
|
||||
flush_chains() {
|
||||
echo "ebtables -t broute -F qos" > /tmp/qos/classify.ebtables
|
||||
|
||||
echo "iptables -t mangle -F qos_forward" > /tmp/qos/classify.iptables
|
||||
echo "iptables -t mangle -F qos_prerouting" >> /tmp/qos/classify.iptables
|
||||
echo "iptables -t mangle -F qos_output" >> /tmp/qos/classify.iptables
|
||||
echo "iptables -w -t mangle -F qos_forward" > /tmp/qos/classify.iptables
|
||||
echo "iptables -w -t mangle -F qos_prerouting" >> /tmp/qos/classify.iptables
|
||||
echo "iptables -w -t mangle -F qos_output" >> /tmp/qos/classify.iptables
|
||||
|
||||
echo "ip6tables -t mangle -F qos_forward" > /tmp/qos/classify.ip6tables
|
||||
echo "ip6tables -t mangle -F qos_prerouting" >> /tmp/qos/classify.ip6tables
|
||||
echo "ip6tables -t mangle -F qos_output" >> /tmp/qos/classify.ip6tables
|
||||
echo "ip6tables -w -t mangle -F qos_forward" > /tmp/qos/classify.ip6tables
|
||||
echo "ip6tables -w -t mangle -F qos_prerouting" >> /tmp/qos/classify.ip6tables
|
||||
echo "ip6tables -w -t mangle -F qos_output" >> /tmp/qos/classify.ip6tables
|
||||
}
|
||||
|
||||
init_broute_rule() {
|
||||
@@ -299,7 +307,20 @@ broute_filter_on_dst_mac() {
|
||||
}
|
||||
|
||||
broute_filter_on_pcp() {
|
||||
BR_RULE="$BR_RULE --skbvlan-prio $1"
|
||||
# 5.04 onwards the vlan extension in ebtables is used for classification
|
||||
# on the basis of vlan params which needs proto to be defined as 802_1Q in
|
||||
# order to add a rule, now, proto can also be defined by specifying proto uci
|
||||
# option as well as the rule may have a vlan id as well in which case the
|
||||
# proto will already be present, hence, this check to not add --proto more
|
||||
# than once
|
||||
case "$BR_RULE" in
|
||||
*proto*)
|
||||
BR_RULE="$BR_RULE --vlan-prio $1"
|
||||
;;
|
||||
*)
|
||||
BR_RULE="$BR_RULE --proto 802_1Q --vlan-prio $1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
broute_filter_on_ether_type() {
|
||||
@@ -307,7 +328,14 @@ broute_filter_on_ether_type() {
|
||||
}
|
||||
|
||||
broute_filter_on_vid() {
|
||||
BR_RULE="$BR_RULE --skbvlan-id $1"
|
||||
case "$BR_RULE" in
|
||||
*proto*)
|
||||
BR_RULE="$BR_RULE --vlan-id $1"
|
||||
;;
|
||||
*)
|
||||
BR_RULE="$BR_RULE --proto 802_1Q --vlan-id $1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
broute_rule_set_traffic_class() {
|
||||
@@ -508,12 +536,12 @@ iptables_set_traffic_class() {
|
||||
|
||||
append_rule_to_mangle_table() {
|
||||
if [ $2 == 4 ]; then
|
||||
echo "iptables -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.iptables
|
||||
echo "iptables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.iptables
|
||||
elif [ $2 == 6 ]; then
|
||||
echo "ip6tables -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.ip6tables
|
||||
echo "ip6tables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.ip6tables
|
||||
elif [ $2 == 1 ]; then
|
||||
echo "iptables -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.iptables
|
||||
echo "ip6tables -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.ip6tables
|
||||
echo "iptables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.iptables
|
||||
echo "ip6tables -w -t mangle -A $1 $IP_RULE" >> /tmp/qos/classify.ip6tables
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -645,17 +673,20 @@ assign_policer_to_port() {
|
||||
local pindex="$2"
|
||||
local portorder="$(db -q get hw.board.ethernetPortOrder)"
|
||||
local wanport="$(db -q get hw.board.ethernetWanPort)"
|
||||
local runner_lan_ports="$(bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/examine port | grep ': port/index=lan' | sed -e 's#\.##g' | cut -f2 -d' ' | sort -u | xargs)"
|
||||
local i=1
|
||||
|
||||
for port in $portorder; do
|
||||
if [ "$ifname" == "$port" ]; then
|
||||
if [ "$wanport" == "$port" ]; then
|
||||
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=wan0 ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
|
||||
else
|
||||
local i="${port: -1}"
|
||||
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=lan$i ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
|
||||
local lanport="$(echo -n "$runner_lan_ports" | cut -f${i} -d' ')"
|
||||
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure $lanport ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
|
||||
fi
|
||||
break
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
}
|
||||
|
||||
@@ -719,11 +750,6 @@ config_ingress_rate_limit() {
|
||||
local in_burst_size=$3
|
||||
local wanport="$(db -q get hw.board.ethernetWanPort)"
|
||||
|
||||
if [ "$ifname" == "$wanport" ]; then
|
||||
logger -t qosmngr "policing is not support on port $ifname"
|
||||
return
|
||||
fi
|
||||
|
||||
# Unit in uci file is in bps while that accepted by ethswctl is kbits
|
||||
if [ $ingress_rate -lt 1000 ]; then
|
||||
return
|
||||
@@ -737,7 +763,10 @@ config_ingress_rate_limit() {
|
||||
in_burst_size=$((in_burst_size / 1000))
|
||||
fi
|
||||
|
||||
ethswctl -c rxratectrl -n 1 -p $ifname -x $ingress_rate -y $in_burst_size
|
||||
local unitport="$(get_port_number $ifname)"
|
||||
local unit=$(echo $unitport | cut -d ' ' -f 1)
|
||||
local port=$(echo $unitport | cut -d ' ' -f 2)
|
||||
ethswctl -c rxratectrl -n $unit -p $port -x $ingress_rate -y $in_burst_size
|
||||
}
|
||||
|
||||
#function to handle a classify section
|
||||
@@ -828,10 +857,14 @@ configure_policer() {
|
||||
# the old config if any and return
|
||||
if [ $POLICER_SKIP -eq 0 ]; then
|
||||
for intf in $(db get hw.board.ethernetPortOrder); do
|
||||
local unitport="$(get_port_number $intf)"
|
||||
local unit=$(echo $unitport | cut -d ' ' -f 1)
|
||||
local port=$(echo $unitport | cut -d ' ' -f 2)
|
||||
# setting rate and burst size to 0 disables rate limiting
|
||||
ethswctl -c rxratectrl -n 1 -p $intf -x 0 -y 0
|
||||
if [ $port != "" -a $unit != "" ]; then
|
||||
ethswctl -c rxratectrl -n $unit -p $port -x 0 -y 0
|
||||
fi
|
||||
done
|
||||
return
|
||||
fi
|
||||
|
||||
# Delete policer
|
||||
@@ -859,8 +892,11 @@ configure_policer() {
|
||||
}
|
||||
|
||||
configure_qos() {
|
||||
configure_queue
|
||||
#queue configuration is being done after shaper configuration,
|
||||
#If port shapingrate configuration on DISC device is called after queue configuration then
|
||||
#driver overwrites the queue shaping rate with default value of port shaping rate.
|
||||
configure_shaper
|
||||
configure_queue
|
||||
configure_policer
|
||||
configure_classify
|
||||
}
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions/network.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "dump" : {}, "hosts" : {} }'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
dump)
|
||||
dump_network() {
|
||||
local cfg="$1"
|
||||
local is_lan type bool proto ipaddr netmask ifname
|
||||
|
||||
[ "$cfg" == "loopback" ] && return
|
||||
|
||||
config_get_bool is_lan $cfg is_lan 0
|
||||
config_get type $cfg type
|
||||
config_get_bool defaultroute $cfg defaultroute 1
|
||||
config_get proto $cfg proto none
|
||||
config_get ipaddr $cfg ipaddr
|
||||
[ -z "$ipaddr" ] && network_get_ipaddr ipaddr $cfg
|
||||
config_get netmask $cfg netmask "255.255.255.255"
|
||||
config_get ifname $cfg ifname
|
||||
|
||||
json_add_object "$cfg"
|
||||
json_add_boolean is_lan $is_lan
|
||||
json_add_string type "$type"
|
||||
json_add_boolean defaultroute $defaultroute
|
||||
json_add_string proto "$proto"
|
||||
json_add_string ipaddr "$ipaddr"
|
||||
json_add_string netmask "$netmask"
|
||||
json_add_string ifname "$ifname"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
config_load network
|
||||
json_init
|
||||
config_foreach dump_network interface
|
||||
json_dump
|
||||
;;
|
||||
hosts)
|
||||
ubus call topology hosts | \
|
||||
sed 's/interface_type/type/g' | \
|
||||
sed 's/Ethernet/ethernet/g' | \
|
||||
sed 's/Wi-Fi/wifi/g'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -5,41 +5,40 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu
|
||||
PKG_VERSION:=0.2.3
|
||||
PKG_VERSION:=0.2.19
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/sulu.git
|
||||
PKG_SOURCE_VERSION:=5f9c2ffb64a4cc46ffee59b6bbfafdaa26a7ab4f
|
||||
PKG_SOURCE_VERSION:=86de40b6ebdf937419290f6a0c5c0fb79eaa5ed1
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
|
||||
PKG_RELEASE=$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/sulu
|
||||
# $(Package/sulu/default)
|
||||
SECTION:=sulu
|
||||
CATEGORY:=Utilities
|
||||
MENU=1
|
||||
TITLE:=SULU-CE ReactJS based Web UI Package
|
||||
DEPENDS:=+nginx
|
||||
SECTION:=sulu
|
||||
CATEGORY:=Utilities
|
||||
MENU=1
|
||||
TITLE:=SULU-CE ReactJS based Web UI Package
|
||||
DEPENDS:=+nginx
|
||||
endef
|
||||
|
||||
define Package/sulu/description
|
||||
SULU-CE ReactJS based Web UI.
|
||||
SULU-CE ReactJS based Web UI.
|
||||
endef
|
||||
|
||||
define Package/sulu/install
|
||||
$(INSTALL_DIR) $(1)/sulu
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/* $(1)/sulu
|
||||
# $(CP) ./files/* $(1)/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,sulu))
|
||||
|
||||
63
sulu/files/etc/init.d/sulu
Executable file
63
sulu/files/etc/init.d/sulu
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t sulu.init -p debug
|
||||
}
|
||||
|
||||
publish_endpoint() {
|
||||
local AgentEndpointID serial oui user pass
|
||||
local opt=""
|
||||
|
||||
# return if mosquitto_pub is not present
|
||||
if ! which mosquitto_pub; then
|
||||
log "mosquitto_pub not present can't publish endpointid"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
ubus -t 10 wait_for usp.raw
|
||||
|
||||
# Get endpoint id from obuspa config first
|
||||
config_load obuspa
|
||||
config_get AgentEndpointID localagent EndpointID ""
|
||||
if [ -z "${AgentEndpointID}" ]; then
|
||||
serial=$(ubus -t 1 call usp.raw get '{"path":"Device.DeviceInfo.SerialNumber"}'|jsonfilter -e '@["parameters"][0].value')
|
||||
oui=$(ubus -t 1 call usp.raw get '{"path":"Device.DeviceInfo.ManufacturerOUI"}'|jsonfilter -e '@["parameters"][0].value')
|
||||
AgentEndpointID="os::${oui}-${serial}"
|
||||
fi
|
||||
|
||||
config_get user localmqtt Username
|
||||
if [ -n "${user}" ]; then
|
||||
opt="-u ${user}"
|
||||
fi
|
||||
config_get pass localmqtt Password
|
||||
if [ -n "${pass}" ]; then
|
||||
opt="${opt} -P ${pass}"
|
||||
fi
|
||||
|
||||
# publish Agent's EndpointID in mosquito broker for discovery
|
||||
# This is a work around till obuspa does not support advertising
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" ${opt}
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance sulu
|
||||
publish_endpoint
|
||||
procd_close_instance
|
||||
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_config_trigger "config.change" "obuspa" /etc/init.d/sulu reload
|
||||
}
|
||||
18
sulu/files/etc/nginx/conf.d/sulu.locations
Normal file
18
sulu/files/etc/nginx/conf.d/sulu.locations
Normal file
@@ -0,0 +1,18 @@
|
||||
# proxy required for nginx to save the file
|
||||
location /upload_proxy {
|
||||
return 200 "File upload is successful \n";
|
||||
}
|
||||
|
||||
location /upload {
|
||||
limit_except POST { deny all; }
|
||||
client_body_temp_path /tmp/sulu; # the directory to which uploads will be saved, make sure to create the directory you wish to use
|
||||
client_body_in_file_only on;
|
||||
client_body_buffer_size 128K;
|
||||
client_max_body_size 50M;
|
||||
proxy_pass_request_headers on;
|
||||
proxy_set_header X-FILE $request_body_file;
|
||||
proxy_set_body $request_body_file;
|
||||
proxy_redirect off;
|
||||
#proxy_pass is necessary. body is only stored when being passed to middleware, so we are providing a proxy that just returns 200.
|
||||
proxy_pass http://127.0.0.1:8080/upload_proxy;
|
||||
}
|
||||
10
sulu/files/etc/uci-defaults/90-sulu-set-nginx-conf
Normal file
10
sulu/files/etc/uci-defaults/90-sulu-set-nginx-conf
Normal file
@@ -0,0 +1,10 @@
|
||||
mkdir -p /tmp/sulu
|
||||
|
||||
uci -q get nginx._sulu && exit 0
|
||||
|
||||
uci -q set nginx._sulu=server
|
||||
uci -q add_list nginx._sulu.listen='8080'
|
||||
uci -q add_list nginx._sulu.listen='[::]:8080'
|
||||
uci -q add_list nginx._sulu.include='conf.d/sulu.locations'
|
||||
uci -q set nginx._sulu.root='/sulu'
|
||||
uci -q set nginx._sulu.server_name='_sulu'
|
||||
@@ -6,13 +6,16 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_VERSION:=2.0.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c8cc4a3b332ea931dbf2fe7e6b94bebf5c4bcc33
|
||||
PKG_SOURCE_VERSION:=f0054f9413d6369bb6d9a66e7c49414b946ef0df
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/swmodd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@@ -21,12 +24,14 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/swmodd
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=SWMOD - software modules ubus backend
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid +PACKAGE_liblxc:liblxc
|
||||
TITLE:= Software Modules Daemon
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid +libbbf_api +opkg \
|
||||
+PACKAGE_liblxc:liblxc +PACKAGE_liblxc:cgroupfs-mount \
|
||||
+@BUSYBOX_CONFIG_BUSYBOX +@BUSYBOX_CONFIG_FEATURE_SHOW_SCRIPT
|
||||
endef
|
||||
|
||||
define Package/swmodd/description
|
||||
Ubus based backend for software modules which can be used by other applications running on top of it.
|
||||
Software module daemon to manage software/deployment units using TR181 datamodel.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
@@ -38,13 +43,26 @@ MAKE_FLAGS += \
|
||||
SWMOD_LXC="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/swmodd/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/swmodd/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/swmodd.init $(1)/etc/init.d/swmodd
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/swmod
|
||||
$(INSTALL_CONF) ./files/map_du $(1)/etc/swmod/map_du
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/swmodd.init $(1)/etc/init.d/swmodd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/swmodd $(1)/usr/sbin/swmodd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libswmodd.so $(1)/usr/lib/bbfdm/libswmodd.so
|
||||
ifeq ($(CONFIG_PACKAGE_liblxc),y)
|
||||
$(INSTALL_DIR) $(1)/usr/share/lxc/templates/
|
||||
$(INSTALL_DIR) $(1)/usr/share/swmodd/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/templates/lxc-iopsys $(1)/usr/share/lxc/templates/lxc-iopsys
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/opkg_offline.sh $(1)/usr/share/swmodd/opkg_offline
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,swmodd))
|
||||
|
||||
@@ -7,7 +7,7 @@ USE_PROCD=1
|
||||
PROG=/usr/sbin/swmodd
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_open_instance swmodd
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=twamp
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.1
|
||||
|
||||
PKG_SOURCE_VERSION:=f6e914508aa1f7458f87bd68026f56262595d9a5
|
||||
PKG_SOURCE_VERSION:=dbddaa0c4d826dfdf37bb92f98a2b2ad23035ca3
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/twamp.git
|
||||
|
||||
|
||||
@@ -6,14 +6,15 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=urlfilter
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.1.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=891e8d36446c0b1e7999c5798375985b1804fcf1
|
||||
PKG_SOURCE_VERSION:=a2fca29140673d058eb0bfb2b3b3c9e61d7f301f
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/urlfilter.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -26,7 +27,7 @@ define Package/urlfilter
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=URL filter
|
||||
DEPENDS:=+libuci +libnetfilter-queue +libnfnetlink +iptables-mod-nfqueue +libpthread +libubox +ubus
|
||||
DEPENDS:=+libuci +libnetfilter-queue +libnfnetlink +iptables-mod-nfqueue +libpthread +libubox +ubus +conntrack
|
||||
endef
|
||||
|
||||
define Package/urlfilter/description
|
||||
|
||||
@@ -9,14 +9,31 @@ PROG=/usr/sbin/urlfilter
|
||||
|
||||
configure_firewall()
|
||||
{
|
||||
iptables -L FORWARD|grep -iqE "NFQUEUE"
|
||||
iptables -w -L FORWARD|grep -iqE "NFQUEUE"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Applying firewall rule to setup NFQUEUE on forward traffic for urlfiltering"
|
||||
iptables -I FORWARD 1 -p tcp --dport 80 -j NFQUEUE --queue-num 0
|
||||
iptables -I FORWARD 2 -p tcp --dport 443 -j NFQUEUE --queue-num 0
|
||||
iptables -I INPUT 1 -p udp --dport 53 -j NFQUEUE --queue-num 0
|
||||
iptables -I INPUT 2 -p udp --sport 53 -j NFQUEUE --queue-num 0
|
||||
# setup netfilter queue 0, use queue bypass so that if no application is
|
||||
# listening to this queue then traffic is unaffected.
|
||||
iptables -w -I FORWARD 1 -p tcp --dport 80 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I FORWARD 2 -p tcp --dport 443 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I FORWARD 3 -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I FORWARD 4 -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I INPUT 1 -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I INPUT 2 -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
|
||||
# disable acceleration for https packet so that they can be read by urlfilter
|
||||
ebtables -A FORWARD -p ip --ip-protocol 6 --ip-destination-port 443 -j SKIPLOG
|
||||
fi
|
||||
ip6tables -w -L FORWARD|grep -iqE "NFQUEUE"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
#ip6table rules
|
||||
ip6tables -w -I FORWARD 1 -p tcp --dport 80 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I FORWARD 2 -p tcp --dport 443 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I FORWARD 3 -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I FORWARD 4 -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I INPUT 1 -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I INPUT 2 -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
start_service() {
|
||||
@@ -26,34 +43,44 @@ start_service() {
|
||||
configure_firewall
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
# Now flush the existing connections, otherwise,
|
||||
# URL filtering cannot be performed on already open sites.
|
||||
if [ -n "$(which conntrack)" ]; then
|
||||
sleep 5
|
||||
conntrack -F
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
pidof $NAME >/dev/null
|
||||
if [ "$?" -eq 0 ]; then
|
||||
pidof $NAME > /dev/null 2>&1 && killall -q $NAME
|
||||
pidof $NAME > /dev/null 2>&1
|
||||
while pidof $NAME > /dev/null 2>&1; do
|
||||
killall -q -9 $NAME
|
||||
done
|
||||
fi
|
||||
|
||||
iptables -L FORWARD|grep -iqE "NFQUEUE"
|
||||
iptables -w -L FORWARD|grep -iqE "NFQUEUE"
|
||||
if [ "$?" -eq 0 ]; then
|
||||
echo "Deleting firewall rule to setup NFQUEUE on forward traffic for urlfiltering"
|
||||
iptables -D FORWARD -p tcp --dport 80 -j NFQUEUE --queue-num 0
|
||||
iptables -D FORWARD -p tcp --dport 443 -j NFQUEUE --queue-num 0
|
||||
iptables -D INPUT -p udp --dport 53 -j NFQUEUE --queue-num 0
|
||||
iptables -D INPUT -p udp --sport 53 -j NFQUEUE --queue-num 0
|
||||
iptables -w -D FORWARD -p tcp --dport 80 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D FORWARD -p tcp --dport 443 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D FORWARD -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D FORWARD -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D INPUT -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D INPUT -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ebtables -D FORWARD -p ip --ip-protocol 6 --ip-destination-port 443 -j SKIPLOG
|
||||
fi
|
||||
ip6tables -w -L FORWARD|grep -iqE "NFQUEUE"
|
||||
if [ "$?" -eq 0 ]; then
|
||||
#ip6table rules
|
||||
ip6tables -w -D FORWARD -p tcp --dport 80 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D FORWARD -p tcp --dport 443 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D FORWARD -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D FORWARD -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D INPUT -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D INPUT -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "urlfilter"
|
||||
procd_add_reload_trigger "firewall"
|
||||
|
||||
9
uspd/Config.in
Normal file
9
uspd/Config.in
Normal file
@@ -0,0 +1,9 @@
|
||||
config USPD_MAX_MSG_LEN
|
||||
int "Maximum message length"
|
||||
default 10485760
|
||||
help
|
||||
Set the maximum data length allowed over ubus in Bytes.
|
||||
|
||||
This value should not be larger than UBUS_MAX_MSGLEN from ubusd.
|
||||
The maximum blob message length allowed is:
|
||||
(configured value - 128) bytes
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uspd
|
||||
PKG_VERSION:=2.1.17
|
||||
PKG_VERSION:=2.1.28
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8f31734007fa2d9d4c551578f9f3436ca55a5c17
|
||||
PKG_SOURCE_VERSION:=4f449cc787f07b1543c7e51dc5b3d03de4b3db8f
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -34,10 +34,14 @@ define Package/uspd/description
|
||||
running on top of it.
|
||||
endef
|
||||
|
||||
define Package/uspd/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
-D_GNU_SOURCE \
|
||||
-DUSPD_MAX_MSG_LEN=$(CONFIG_USPD_MAX_MSG_LEN)
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=98
|
||||
START=96
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
@@ -59,5 +59,5 @@ reload_service() {
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_config_trigger "config.change" "uspd" /etc/init.d/uspd restart
|
||||
procd_add_reload_trigger "uspd"
|
||||
}
|
||||
|
||||
57
wfa-capi/Makefile
Normal file
57
wfa-capi/Makefile
Normal file
@@ -0,0 +1,57 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wfa-capi
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=03d5eb8ed61b298709061458661d089474b38604
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wfa-capi.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
#define Package/wfa-capi/config
|
||||
# source "$(SOURCE)/Config.in"
|
||||
#endef
|
||||
|
||||
define Package/wfa-capi
|
||||
TITLE+= wfa-capi (agent daemon for Wi-Fi Alliance's CAPI commands)
|
||||
DEPENDS= +libubox +libuci +libubus +libnl-genl +libeasy +libwifi \
|
||||
+libjson-c +libblobmsg-json +ubus +libieee1905
|
||||
endef
|
||||
|
||||
define Package/wfa-capi/description
|
||||
This package provides agent for WiFi Alliance's CAPI specification.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
|
||||
define Package/wfa-capi/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/lib/wifi/capi
|
||||
$(CP) $(PKG_BUILD_DIR)/src/capiagent $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/src/scripts/* $(1)/lib/wifi/capi
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,wfa-capi))
|
||||
26
wfa-capi/files/etc/init.d/capiagent
Executable file
26
wfa-capi/files/etc/init.d/capiagent
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=98
|
||||
STOP=20
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/capiagent"
|
||||
procd_set_param limits core="unlimited"
|
||||
# procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "capiagent"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
@@ -5,10 +5,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wfadatad
|
||||
PKG_VERSION:=3.3.1
|
||||
PKG_VERSION:=5.0.2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9d7e1fea212fc06d7a1d37a5a52d9a55be0c36f2
|
||||
PKG_SOURCE_VERSION:=f62f7d4795fcba7e4b2906fdba8e5c390c771cba
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wfadatad.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -17,6 +17,9 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
|
||||
PKG_BUILD_DEPENDS:=map-plugin
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/wfadatad
|
||||
@@ -24,7 +27,7 @@ define Package/wfadatad
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi Data Elements-1.0 Agent and Collector
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libpthread +libnl-genl \
|
||||
+!WFA_DELM_STANDALONE:map-agent +WFA_DELM_MULTIAP_MODE:libmaputils
|
||||
+!WFA_DELM_STANDALONE:map-agent +libieee1905 +map-plugin
|
||||
endef
|
||||
|
||||
define Package/wfadatad/description
|
||||
|
||||
@@ -7,12 +7,12 @@ USE_PROCD=1
|
||||
PROG=/usr/sbin/wfadatad
|
||||
|
||||
service_running() {
|
||||
ubus -t 2 wait_for ieee1905 map.1905
|
||||
ubus -t 2 wait_for ieee1905 ieee1905.map
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" "-d"
|
||||
procd_set_param command "$PROG" "-d" "-t 15"
|
||||
#procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=10.0.4
|
||||
PKG_VERSION:=13.0.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c0df4e9898c76f28a4b12550e804a8bef89985d1
|
||||
PKG_SOURCE_VERSION:=6b1f24c940efdc563e0bfec06fdb803235494b6f
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -60,17 +60,45 @@ supp_status() {
|
||||
echo "UNCONFIGURED"
|
||||
}
|
||||
|
||||
supp_configured() {
|
||||
wpasupp=$1
|
||||
|
||||
for wpa in $wpasupp
|
||||
do
|
||||
logger -t button "WPS $wpa check if configured"
|
||||
status=$(supp_status $wpa)
|
||||
if [ "$status" = "CONFIGURED" ]; then
|
||||
logger -t button "WPS $wpa CONFIGURED"
|
||||
echo "CONFIGURED"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
echo "UNCONFIGURED"
|
||||
}
|
||||
|
||||
supp_wps() {
|
||||
wpasupp=$1
|
||||
|
||||
for wpa in $wpasupp
|
||||
do
|
||||
logger -t button "WPS $wpa start"
|
||||
ubus -t 1 call $wpa wps_start
|
||||
done
|
||||
}
|
||||
|
||||
wps_button() {
|
||||
logger -t button "WPS button is pressed"
|
||||
wpasupp="$(ubus list wpa_supplicant.* 2>/dev/null | head -1)"
|
||||
wpasupp="$(ubus list wpa_supplicant.* 2>/dev/null)"
|
||||
|
||||
logger -t button "WPS checking: $wpasupp"
|
||||
if [ -n "$wpasupp" ]; then
|
||||
status=$(supp_status $wpasupp)
|
||||
status=$(supp_configured "$wpasupp")
|
||||
logger -t button "status $status"
|
||||
if [ "$status" = "CONFIGURED" ]; then
|
||||
start_ap_wps
|
||||
else
|
||||
logger -t button "WPS start $wpasupp"
|
||||
ubus -t 1 call $wpasupp wps_start
|
||||
supp_wps "$wpasupp"
|
||||
fi
|
||||
else
|
||||
start_ap_wps
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=xmppc
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
PKG_SOURCE_VERSION:=a98cdda759418dab1c12a18c345112d94ed4c02e
|
||||
PKG_SOURCE_VERSION:=4a09b8689d67dcbf3fd1b7e80e53816b7cd12614
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/xmppc.git
|
||||
|
||||
|
||||
Reference in New Issue
Block a user