mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 19:14:05 +08:00
Compare commits
422 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2599967241 | ||
|
|
8779369d7b | ||
|
|
938583d960 | ||
|
|
c29427fd51 | ||
|
|
b19040d68e | ||
|
|
ecc459f34d | ||
|
|
66c9db511b | ||
|
|
66d3110ebe | ||
|
|
5560428dc6 | ||
|
|
2eed8f2684 | ||
|
|
f7919b2471 | ||
|
|
69633fce7c | ||
|
|
d666372df6 | ||
|
|
a21c4aea1e | ||
|
|
ff0d48571e | ||
|
|
004b2b47c2 | ||
|
|
a215b5975d | ||
|
|
cf0ea79c93 | ||
|
|
da1c09a3f5 | ||
|
|
1c8f80f93d | ||
|
|
5ff7522148 | ||
|
|
3b322ba3cb | ||
|
|
57a0b0bcca | ||
|
|
0836a0cc62 | ||
|
|
52c52247eb | ||
|
|
4d7d03950a | ||
|
|
1d52207a7f | ||
|
|
194978c7d2 | ||
|
|
931ae16fec | ||
|
|
8e63cdb53b | ||
|
|
65be93fb61 | ||
|
|
f9e105133a | ||
|
|
463c4f0855 | ||
|
|
aad4b455b2 | ||
|
|
961b2caaf9 | ||
|
|
fe97541f89 | ||
|
|
9c5b671627 | ||
|
|
7d47e904d1 | ||
|
|
09e4e7cde2 | ||
|
|
b334565e90 | ||
|
|
eb07e8868f | ||
|
|
728da91a8f | ||
|
|
26a44ab3e5 | ||
|
|
b1ba9c1826 | ||
|
|
eadb49e55c | ||
|
|
68a39be532 | ||
|
|
333fbe25b1 | ||
|
|
c83a88ceb6 | ||
|
|
ae3d22ab45 | ||
|
|
59285541e3 | ||
|
|
2f312659d8 | ||
|
|
659a36547b | ||
|
|
24700f6162 | ||
|
|
17d2905283 | ||
|
|
93e9c0e4cb | ||
|
|
df039df5b3 | ||
|
|
3a30ea8209 | ||
|
|
0e22871a96 | ||
|
|
650f941dfc | ||
|
|
d563bfa099 | ||
|
|
840670bf80 | ||
|
|
645a9d919f | ||
|
|
aea3f66f51 | ||
|
|
650957082a | ||
|
|
d893622fb3 | ||
|
|
b2a32dac16 | ||
|
|
0b353ab84e | ||
|
|
82d4fef6a6 | ||
|
|
cd3e774fb1 | ||
|
|
92a6b78786 | ||
|
|
c32ced2cfe | ||
|
|
e0be33b76a | ||
|
|
117c5224cc | ||
|
|
3917419263 | ||
|
|
a6047dadbf | ||
|
|
906307df05 | ||
|
|
e8a6ff899b | ||
|
|
3c60ea1eae | ||
|
|
4ac9dcbcf4 | ||
|
|
07a4f41116 | ||
|
|
e8fd9b654a | ||
|
|
a81973c7ec | ||
|
|
ab06c82297 | ||
|
|
1d5ca37f1e | ||
|
|
98170bdb79 | ||
|
|
e3e9147597 | ||
|
|
ec82e9de8f | ||
|
|
97306df0a9 | ||
|
|
a6abec5787 | ||
|
|
88cf2ea0c2 | ||
|
|
103bbebad0 | ||
|
|
75e0d5a481 | ||
|
|
c7b88666d8 | ||
|
|
22e014b587 | ||
|
|
d3e9574ccc | ||
|
|
eccfa20011 | ||
|
|
a4b44d7415 | ||
|
|
3384f5ae7f | ||
|
|
ce9ac288ff | ||
|
|
87df5f9117 | ||
|
|
9073b24182 | ||
|
|
2d1e46af5d | ||
|
|
82d37cefd5 | ||
|
|
48a036c8aa | ||
|
|
93eaaa0aa9 | ||
|
|
ca9ba7c9f8 | ||
|
|
063e270ec4 | ||
|
|
b5db57ba45 | ||
|
|
3db08a8ec8 | ||
|
|
75ec580e89 | ||
|
|
12a7183a32 | ||
|
|
73e4a225bb | ||
|
|
3a9685332d | ||
|
|
12609ec471 | ||
|
|
c2788f796d | ||
|
|
5433164b08 | ||
|
|
0144ce9606 | ||
|
|
c595f79545 | ||
|
|
4f0d7b0de4 | ||
|
|
ab0c5c06b2 | ||
|
|
63ee5d4091 | ||
|
|
e89af64b6b | ||
|
|
0ab812d222 | ||
|
|
06679bd124 | ||
|
|
141b0c32e7 | ||
|
|
9abc466d79 | ||
|
|
93064cadd4 | ||
|
|
fc82c65364 | ||
|
|
150b9bd694 | ||
|
|
5ccec170d9 | ||
|
|
86cc70f753 | ||
|
|
c1f7ac0e5e | ||
|
|
3a7e94e956 | ||
|
|
a2220489b3 | ||
|
|
c1363317ba | ||
|
|
667e0b1073 | ||
|
|
39733b6227 | ||
|
|
789d2e2a42 | ||
|
|
353b048596 | ||
|
|
5e50e59c46 | ||
|
|
fa134b86f8 | ||
|
|
1258a086bc | ||
|
|
a9d22d5e6b | ||
|
|
b3af9d3695 | ||
|
|
e83748b3e4 | ||
|
|
fea6fc95a0 | ||
|
|
aa4aa23108 | ||
|
|
ba1337720e | ||
|
|
1d9619dfd9 | ||
|
|
8f63a74197 | ||
|
|
5d5890b591 | ||
|
|
482a88a65b | ||
|
|
351ca030d4 | ||
|
|
b306dffa63 | ||
|
|
baeaa7cc4c | ||
|
|
df9e651719 | ||
|
|
f8e7362648 | ||
|
|
378310828c | ||
|
|
1fa651ddd2 | ||
|
|
b5b88e6335 | ||
|
|
f59e3fa4bf | ||
|
|
6fdf16fc81 | ||
|
|
905423d589 | ||
|
|
a2cf8beaed | ||
|
|
d3bf187a66 | ||
|
|
0afa6e264c | ||
|
|
45e33d565a | ||
|
|
e6bc413a9b | ||
|
|
b3c28656a7 | ||
|
|
7e70ce6c5d | ||
|
|
92fafa4245 | ||
|
|
50c3c52edd | ||
|
|
01fd665c51 | ||
|
|
3409632353 | ||
|
|
0e4cf8941d | ||
|
|
7d5d9f4fd2 | ||
|
|
6445cba038 | ||
|
|
595de81dff | ||
|
|
67e42d5efd | ||
|
|
12000972d7 | ||
|
|
e83347616c | ||
|
|
8d2bdd90fd | ||
|
|
fef609fb46 | ||
|
|
169c157cbd | ||
|
|
048546b175 | ||
|
|
737efb21cf | ||
|
|
4209b2f153 | ||
|
|
23a4f85301 | ||
|
|
06068d3950 | ||
|
|
a17f3718af | ||
|
|
70855e0a4f | ||
|
|
9c4ede538b | ||
|
|
e16d6d9b5b | ||
|
|
f656693f25 | ||
|
|
d065eef18c | ||
|
|
d2511509ef | ||
|
|
85fcb1f033 | ||
|
|
074f459bea | ||
|
|
abe069dc3c | ||
|
|
1342f71b77 | ||
|
|
c617d393ee | ||
|
|
c293e680dc | ||
|
|
4f20ba679e | ||
|
|
b926cf4c34 | ||
|
|
d7030c4785 | ||
|
|
f33296afa9 | ||
|
|
be2de2f1c3 | ||
|
|
211525095b | ||
|
|
fc9e3e34e6 | ||
|
|
0650265216 | ||
|
|
1fe72d82aa | ||
|
|
5771b3bde6 | ||
|
|
1ce684c01e | ||
|
|
7e5ff6567a | ||
|
|
d2713b3bbd | ||
|
|
991eeff106 | ||
|
|
93cd4c477d | ||
|
|
c208c12ef3 | ||
|
|
7bfdea5ff3 | ||
|
|
ab88b8e133 | ||
|
|
2d7baa91e2 | ||
|
|
66ad2e3158 | ||
|
|
0981bc9ccd | ||
|
|
c9601eb4aa | ||
|
|
2f6fed6d92 | ||
|
|
6fbf823167 | ||
|
|
7833470f7a | ||
|
|
0ff160345d | ||
|
|
a63d88c100 | ||
|
|
169ebea761 | ||
|
|
069de32121 | ||
|
|
6eecfcd238 | ||
|
|
e49d908f94 | ||
|
|
24b6106ddd | ||
|
|
8cd62ff81f | ||
|
|
0d3466445c | ||
|
|
cde3056c2f | ||
|
|
5ffec072d5 | ||
|
|
6e9f0fafa3 | ||
|
|
0feb577f1a | ||
|
|
d4d189bd1e | ||
|
|
8143b29d38 | ||
|
|
78863e3174 | ||
|
|
3324bd6c94 | ||
|
|
a1a8e179d8 | ||
|
|
3e6ce7dd21 | ||
|
|
74e087814d | ||
|
|
3069b113f2 | ||
|
|
ae4bd347d0 | ||
|
|
b534f1f164 | ||
|
|
b0a857c7c9 | ||
|
|
106982c69a | ||
|
|
b24cb6f4d4 | ||
|
|
ed2f0381a0 | ||
|
|
bbede82173 | ||
|
|
256948792c | ||
|
|
b173df6ff5 | ||
|
|
31361b2bfb | ||
|
|
fb2181f279 | ||
|
|
2ef80243bf | ||
|
|
5811d46d56 | ||
|
|
e0d7cb9caa | ||
|
|
5b22a2dce6 | ||
|
|
dd481c8bfe | ||
|
|
fa760967a1 | ||
|
|
ce8bf2872c | ||
|
|
faa17d8679 | ||
|
|
ceca1c1a53 | ||
|
|
7862c07454 | ||
|
|
22129691d0 | ||
|
|
9625c3b81c | ||
|
|
a1d6b02a20 | ||
|
|
d6ab9d1a12 | ||
|
|
97ad605a1c | ||
|
|
3e66393c7b | ||
|
|
9b02ee98d2 | ||
|
|
8a2939ddde | ||
|
|
a17530309f | ||
|
|
d6f0f38524 | ||
|
|
4c99a2fb98 | ||
|
|
701cc69a03 | ||
|
|
da5615d50a | ||
|
|
6ea1aa0a2b | ||
|
|
09e49e54eb | ||
|
|
e92bc0ea7d | ||
|
|
a1e4de11f0 | ||
|
|
750d5ff091 | ||
|
|
1f5c527959 | ||
|
|
4dba945466 | ||
|
|
ce942da01f | ||
|
|
a6139059a3 | ||
|
|
a58ac037fd | ||
|
|
5ec0992e1d | ||
|
|
71c459b27d | ||
|
|
4021526a61 | ||
|
|
009d2b613c | ||
|
|
cee25ad753 | ||
|
|
221020162e | ||
|
|
6e7e03544a | ||
|
|
65dd02c8ad | ||
|
|
4b193200ed | ||
|
|
64c89e3778 | ||
|
|
46bbd6e198 | ||
|
|
351814d4eb | ||
|
|
bc7260e31f | ||
|
|
a88e8ca92a | ||
|
|
fac97aafc4 | ||
|
|
67bf9c7cc6 | ||
|
|
416807ec6d | ||
|
|
bf68e19da1 | ||
|
|
f668805565 | ||
|
|
09595f0343 | ||
|
|
0a221ad2a2 | ||
|
|
47a918ff4d | ||
|
|
4ae7bdd609 | ||
|
|
cae2808318 | ||
|
|
6f600d6f37 | ||
|
|
fdb3f55a35 | ||
|
|
486b1a854c | ||
|
|
5fb7c59fb3 | ||
|
|
86bca8523b | ||
|
|
af1516bf6c | ||
|
|
b167e072ac | ||
|
|
e11fef0a1d | ||
|
|
70597bb8de | ||
|
|
fa4e426d33 | ||
|
|
ca2d6ac266 | ||
|
|
201d3e9b69 | ||
|
|
27173c0d40 | ||
|
|
a0749cd0cf | ||
|
|
02e15998da | ||
|
|
178b836aff | ||
|
|
b2184b2b45 | ||
|
|
bba5a9e3d6 | ||
|
|
a350812bfd | ||
|
|
5eccb99fce | ||
|
|
ae92433819 | ||
|
|
dd91c8823b | ||
|
|
ab0294c188 | ||
|
|
c0fe19f4d7 | ||
|
|
803bfdd345 | ||
|
|
7a31cda783 | ||
|
|
361f3404d1 | ||
|
|
35427c3ad2 | ||
|
|
2d569ff935 | ||
|
|
b76d2ee06a | ||
|
|
207c769970 | ||
|
|
4940ba3428 | ||
|
|
4c377f65b5 | ||
|
|
9a0dcfd895 | ||
|
|
fbcf382a64 | ||
|
|
09413abb61 | ||
|
|
f29c51e68c | ||
|
|
8cce20ecb6 | ||
|
|
3f77b219b9 | ||
|
|
8bae398da7 | ||
|
|
1576532e0e | ||
|
|
8f4fdc0f7d | ||
|
|
7f34e8b807 | ||
|
|
cb0d37c698 | ||
|
|
5aee44ba2c | ||
|
|
17c2361a90 | ||
|
|
00555a7a2e | ||
|
|
de7cf6298c | ||
|
|
f9ac50cf4f | ||
|
|
be791726a4 | ||
|
|
0879221d1a | ||
|
|
ab80d8a243 | ||
|
|
8e5d63d7d3 | ||
|
|
5e7bfbd977 | ||
|
|
75e6c3f089 | ||
|
|
4b1dbd91cd | ||
|
|
52321de1ca | ||
|
|
97d6f8604e | ||
|
|
7b9db30978 | ||
|
|
eb6dc4b927 | ||
|
|
e628a79588 | ||
|
|
c5d25fdfad | ||
|
|
b207009cb4 | ||
|
|
1b94f625ea | ||
|
|
5c5c9d53a4 | ||
|
|
6403153076 | ||
|
|
17b0fcba98 | ||
|
|
4339dcddbe | ||
|
|
1f6143cdeb | ||
|
|
4cf9d8a93d | ||
|
|
10bdb7a8dc | ||
|
|
659ec81047 | ||
|
|
0513a124dc | ||
|
|
330f79b31f | ||
|
|
43be9fd282 | ||
|
|
1e3195e1ee | ||
|
|
9dea956039 | ||
|
|
7e60791000 | ||
|
|
e8bdb6bc24 | ||
|
|
3400265f13 | ||
|
|
5e797bf457 | ||
|
|
58f1084714 | ||
|
|
69a79e6b3e | ||
|
|
8f48ff9e83 | ||
|
|
794223e29e | ||
|
|
7ed295b977 | ||
|
|
9599e9fad5 | ||
|
|
96c9277e1a | ||
|
|
a1b0964e0a | ||
|
|
807f7c520f | ||
|
|
94b3e0b975 | ||
|
|
5345917eaa | ||
|
|
1f5d3f2eed | ||
|
|
be1d548163 | ||
|
|
05489b127a | ||
|
|
c525acc002 | ||
|
|
65f799faa0 | ||
|
|
8cabb87357 | ||
|
|
c19546bbdd | ||
|
|
6699e1a741 | ||
|
|
d20174daed | ||
|
|
b08557465f | ||
|
|
e46fa1b3ae | ||
|
|
e4258501a9 | ||
|
|
3dc434eb24 | ||
|
|
aa9d058747 |
@@ -1,24 +1,19 @@
|
||||
#
|
||||
# Copyright (C) 2013 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mcpd
|
||||
PKG_NAME:=4g-support
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/mcpd
|
||||
define Package/4g-support
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=IPTV
|
||||
TITLE:=Multicast Daemon
|
||||
TITLE:=4G Network Setup Tools
|
||||
endef
|
||||
|
||||
define Package/mcpd/description
|
||||
Multicast Daemon
|
||||
define Package/4g-support/description
|
||||
4g-support contains necessary tools to setup 4G WAN connection
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
@@ -29,8 +24,8 @@ endef
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/mcpd/install
|
||||
define Package/4g-support/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mcpd))
|
||||
$(eval $(call BuildPackage,4g-support))
|
||||
62
4g-support/files/etc/gcom/ncmconnection.gcom
Normal file
62
4g-support/files/etc/gcom/ncmconnection.gcom
Normal file
@@ -0,0 +1,62 @@
|
||||
opengt
|
||||
set com 115200n81
|
||||
set comecho off
|
||||
set senddelay 0.05
|
||||
waitquiet 1 0.2
|
||||
|
||||
:start
|
||||
if $env("USE_DISCONNECT")="1" goto disconnect
|
||||
send "AT^^NDISDUP=1,1,\""
|
||||
send $env("USE_APN")
|
||||
|
||||
if $env("USE_AUTHTYPE")="-1" goto noauth
|
||||
else goto auth
|
||||
|
||||
:noauth
|
||||
send "\"^m"
|
||||
goto result
|
||||
|
||||
:auth
|
||||
send "\",\""
|
||||
send $env("USE_USERID")
|
||||
send "\",\""
|
||||
send $env("USE_PASSWORD")
|
||||
send "\","
|
||||
send $env("USE_AUTHTYPE")
|
||||
send "^m"
|
||||
goto result
|
||||
|
||||
:result
|
||||
waitfor 5 "OK","ERR","ERROR"
|
||||
if % = 0 goto connok
|
||||
if % = 1 goto connerr
|
||||
if % = 2 goto connerr
|
||||
|
||||
:connok
|
||||
print "WWAN connection established.\r\n"
|
||||
goto done
|
||||
|
||||
:connerr
|
||||
print "WWAN error. Connection failed.\r\n"
|
||||
exit 1
|
||||
|
||||
:disconnect
|
||||
send "AT^^NDISDUP=1,0,\""
|
||||
send $env("USE_APN")
|
||||
send "\"^m"
|
||||
|
||||
waitfor 5 "OK","ERR","ERROR"
|
||||
if % = 0 goto disconnok
|
||||
if % = 1 goto disconnerr
|
||||
if % = 2 goto disconnerr
|
||||
|
||||
:disconnok
|
||||
print "WWAN connection disconnected.\r\n"
|
||||
goto done
|
||||
|
||||
:disconnerr
|
||||
print "WWAN disconnection error.\r\n"
|
||||
exit 1
|
||||
|
||||
:done
|
||||
exit 0
|
||||
35
4g-support/files/etc/hotplug.d/net/05-mobile
Normal file
35
4g-support/files/etc/hotplug.d/net/05-mobile
Normal file
@@ -0,0 +1,35 @@
|
||||
. /lib/network/config.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
iface_status() {
|
||||
local iface=$1
|
||||
local up
|
||||
json_load "$(ifstatus $iface)"
|
||||
json_get_var up up
|
||||
json_close_object
|
||||
return $up
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
add|register)
|
||||
if [ "${INTERFACE:0:4}" == "wwan" ]; then
|
||||
netname=$(get_network_of "$INTERFACE")
|
||||
for net in $netname; do
|
||||
local service=$(uci -q get network.$net.service)
|
||||
local cnt=0
|
||||
while $(iface_status $net); do
|
||||
ifup $net
|
||||
if [ "$service" == "qmi" ]; then
|
||||
cnt=$(($cnt+1))
|
||||
# quit trying if still not online after three times
|
||||
[ $cnt -eq 3 ] && break
|
||||
sleep 5
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
66
4g-support/files/etc/hotplug.d/usb/30-usbnet
Normal file
66
4g-support/files/etc/hotplug.d/usb/30-usbnet
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/bin/sh
|
||||
|
||||
local usb_dir uVid uPid uMa uPr uSe bConf bNumConfs vendor product mdmtyp netdev comdev cdcdev ttydev usbno usbbr
|
||||
|
||||
sanitize() {
|
||||
sed -e 's/[[:space:]]\+$//; s/[[:space:]]\+/_/g' "$@"
|
||||
}
|
||||
|
||||
find_usb_attrs() {
|
||||
usb_dir="/sys/$DEVPATH"
|
||||
[ -f "$usb_dir/idVendor" ] || usb_dir="${usb_dir%/*}"
|
||||
|
||||
uVid=$(cat "$usb_dir/idVendor")
|
||||
uPid=$(cat "$usb_dir/idProduct")
|
||||
uMa=$(sanitize "$usb_dir/manufacturer")
|
||||
uPr=$(sanitize "$usb_dir/product")
|
||||
uSe=$(sanitize "$usb_dir/serial")
|
||||
bNumConfs=$(cat "$usb_dir/bNumConfigurations")
|
||||
bConf=$(cat "$usb_dir/bConfigurationValue")
|
||||
netdev=$(find $usb_dir -name wwan* | awk -F'/' '{print$NF}' | head -2 | tail -1)
|
||||
cdcdev=$(find $usb_dir -name cdc-wdm* | awk -F'/' '{print$NF}' | head -2 | tail -1)
|
||||
ttydev=$(ls $(find $usb_dir -name tty | head -2 | tail -1) | tail -1)
|
||||
if [ -n "$cdcdev" ]; then
|
||||
comdev=$cdcdev
|
||||
mdmtyp=$(grep $uVid:$uPid /etc/modemdb | grep 'qmi\|mbim' | awk '{print$2}' | head -1)
|
||||
vendor=$(grep $uVid:$uPid /etc/modemdb | grep 'qmi\|mbim' | awk '{print$3}' | head -1)
|
||||
product=$(grep $uVid:$uPid /etc/modemdb | grep 'qmi\|mbim' | awk '{print$4}' | head -1)
|
||||
else
|
||||
comdev=$ttydev
|
||||
mdmtyp=$(grep $uVid:$uPid /etc/modemdb | grep 'ncm' | awk '{print$2}' | head -1)
|
||||
vendor=$(grep $uVid:$uPid /etc/modemdb | grep 'ncm' | awk '{print$3}' | head -1)
|
||||
product=$(grep $uVid:$uPid /etc/modemdb | grep 'ncm' | awk '{print$4}' | head -1)
|
||||
fi
|
||||
[ -n "$mdmtyp" ] || mdmtyp=$(grep $uVid:$uPid /etc/modemdb | awk '{print$2}' | head -1)
|
||||
[ -n "$vendor" ] || vendor=$(grep $uVid:$uPid /etc/modemdb | awk '{print$3}' | head -1)
|
||||
[ -n "$product" ] || product=$(grep $uVid:$uPid /etc/modemdb | awk '{print$4}' | head -1)
|
||||
}
|
||||
|
||||
convert_to_mbim() {
|
||||
if [ "$mdmtyp" == "mbim" ] && [ "$bNumConfs" == "2" ]; then
|
||||
[ "$bConf" == "2" ] || echo 2 > $usb_dir/bConfigurationValue
|
||||
fi
|
||||
}
|
||||
|
||||
usbno=$(echo $DEVPATH | cut -d'/' -f5)
|
||||
usbbr=$(echo $DEVPATH | cut -d'/' -f7)
|
||||
case "$usbbr" in
|
||||
*:*) usbbr=$(echo $DEVPATH | cut -d'/' -f6) ;;
|
||||
esac
|
||||
|
||||
find_usb_attrs
|
||||
if [ "$ACTION" = add ]; then
|
||||
convert_to_mbim "$uVid:$uPid"
|
||||
if [ -n "$uVid" ] && [ -n "$uPid" ] && [ -n "$mdmtyp" ] && [ -n "$netdev" ] && [ -n "$comdev" ]; then
|
||||
if [ -n "$usbno" ] && [ -n "$usbbr" ]; then
|
||||
sed -i "/$usbno:$usbbr/ d" /var/usbnets
|
||||
echo $usbno:$usbbr $uVid:$uPid $uMa $uPr $netdev $comdev $mdmtyp $vendor $product >> /var/usbnets
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$ACTION" = remove ]; then
|
||||
if [ -n "$usbno" ] && [ -n "$usbbr" ]; then
|
||||
sed -i "/$usbno:$usbbr/ d" /var/usbnets
|
||||
fi
|
||||
fi
|
||||
100
4g-support/files/etc/modemdb
Normal file
100
4g-support/files/etc/modemdb
Normal file
@@ -0,0 +1,100 @@
|
||||
1bbb:011e qmi
|
||||
1a8d:1001 ecm
|
||||
1a8d:100c ecm
|
||||
1a8d:100d ecm
|
||||
16d8:6280 qmi
|
||||
16d8:6803 qmi
|
||||
16d8:6804 qmi
|
||||
16d8:7003 qmi
|
||||
16d8:700a qmi
|
||||
2001:7d01 mbim
|
||||
2001:7d02 mbim
|
||||
2001:7d03 mbim
|
||||
12d1:14ac qmi
|
||||
12d1:140c qmi
|
||||
12d1:1506 qmi Huawei E367/392/398
|
||||
12d1:1506 ncm Huawei E3276
|
||||
12d1:14d2 qmi
|
||||
12d1:1c07 ncm
|
||||
12d1:1436 ecm
|
||||
12d1:14c9 qmi
|
||||
12d1:14db ecm
|
||||
12d1:151d mbim
|
||||
12d1:151e qmi Huawei E353
|
||||
12d1:1c1e ncm
|
||||
12d1:150c qmi
|
||||
12d1:150f qmi
|
||||
12d1:151b qmi
|
||||
12d1:142d ecm
|
||||
12d1:1432 ecm
|
||||
12d1:1c1f ncm
|
||||
12d1:1433 qmi
|
||||
12d1:1465 ecm
|
||||
12d1:14ca qmi
|
||||
12d1:14cf ncm
|
||||
12d1:14bc ecm
|
||||
12d1:14ae ecm
|
||||
12d1:1576 mbim
|
||||
12d1:1577 mbim
|
||||
12d1:1400 mbim
|
||||
12d1:14f7 mbim
|
||||
12d1:1464 qmi
|
||||
12d1:14cb qmi
|
||||
12d1:14cc qmi
|
||||
12d1:14c6 qmi
|
||||
12d1:14fa mbim
|
||||
12d1:1578 mbim
|
||||
12d1:14c8 qmi
|
||||
12d1:14f8 mbim
|
||||
12d1:1575 mbim
|
||||
12d1:1579 mbim
|
||||
12d1:157a mbim
|
||||
12d1:157b mbim
|
||||
12d1:157f mbim
|
||||
12d1:1f16 mbim Vodafone K5150
|
||||
12d1:1404 qmi
|
||||
19f2:1700 ecm
|
||||
1410:b001 qmi
|
||||
1527:1000 ecm
|
||||
0b3c:c005 qmi
|
||||
0f3d:68a2 qmi
|
||||
1199:68a2 qmi SierraWireless M7710
|
||||
1199:68c0 qmi SierraWireless M7304
|
||||
1349:1100 qmi
|
||||
1349:1200 qmi
|
||||
1199:683c qmi
|
||||
2360:2100 qmi
|
||||
2360:2200 qmi
|
||||
2360:2300 qmi
|
||||
2507:0000 qmi
|
||||
19d2:0055 qmi
|
||||
19d2:0052 qmi
|
||||
19d2:0063 qmi
|
||||
19d2:1008 qmi
|
||||
19d2:1010 qmi
|
||||
19d2:2002 qmi
|
||||
19d2:1176 qmi
|
||||
19d2:1023 mbim
|
||||
19d2:0104 qmi
|
||||
19d2:1018 qmi
|
||||
19d2:1032 mbim
|
||||
19d2:1402 qmi
|
||||
19d2:1405 ecm
|
||||
19d2:1426 qmi
|
||||
19d2:0031 qmi
|
||||
19d2:0124 qmi
|
||||
19d2:1254 qmi
|
||||
19d2:0017 qmi
|
||||
19d2:0002 qmi
|
||||
19d2:0121 qmi
|
||||
19d2:1252 qmi
|
||||
19d2:0157 qmi
|
||||
19d2:0167 qmi
|
||||
19d2:0199 qmi
|
||||
19d2:0257 qmi
|
||||
19d2:0326 qmi
|
||||
19d2:0349 ecm
|
||||
19d2:1408 ecm
|
||||
19d2:0284 qmi
|
||||
19d2:0019 qmi
|
||||
19d2:0265 qmi
|
||||
159
4g-support/files/lib/netifd/proto/4g.sh
Executable file
159
4g-support/files/lib/netifd/proto/4g.sh
Executable file
@@ -0,0 +1,159 @@
|
||||
#!/bin/sh
|
||||
INCLUDE_ONLY=1
|
||||
|
||||
. /lib/functions.sh
|
||||
. ../netifd-proto.sh
|
||||
init_proto "$@"
|
||||
|
||||
proto_4g_init_config() {
|
||||
proto_config_add_string "modem"
|
||||
proto_config_add_string "service"
|
||||
proto_config_add_string "comdev"
|
||||
proto_config_add_string "ipaddr"
|
||||
proto_config_add_string "netmask"
|
||||
proto_config_add_string "hostname"
|
||||
proto_config_add_string "clientid"
|
||||
proto_config_add_string "vendorid"
|
||||
proto_config_add_boolean "broadcast"
|
||||
proto_config_add_string "reqopts"
|
||||
proto_config_add_string "apn"
|
||||
proto_config_add_string "username"
|
||||
proto_config_add_string "password"
|
||||
proto_config_add_boolean "lte_apn_use"
|
||||
proto_config_add_string "lte_apn"
|
||||
proto_config_add_string "lte_username"
|
||||
proto_config_add_string "lte_password"
|
||||
proto_config_add_string "pincode"
|
||||
proto_config_add_string "technology"
|
||||
proto_config_add_string "auto"
|
||||
}
|
||||
|
||||
proto_4g_setup() {
|
||||
local config="$1"
|
||||
local iface="$2"
|
||||
|
||||
local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone
|
||||
json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone
|
||||
|
||||
local opt dhcpopts
|
||||
for opt in $reqopts; do
|
||||
append dhcpopts "-O $opt"
|
||||
done
|
||||
|
||||
for opt in $sendopts; do
|
||||
append dhcpopts "-x $opt"
|
||||
done
|
||||
|
||||
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
|
||||
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
|
||||
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
|
||||
[ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
|
||||
[ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
|
||||
[ -n "$zone" ] && proto_export "ZONE=$zone"
|
||||
[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
|
||||
|
||||
json_get_var comdev comdev
|
||||
json_get_var apn apn
|
||||
json_get_var service service
|
||||
json_get_var pincode pincode
|
||||
|
||||
|
||||
# if [ -n "$modem" ]; then
|
||||
# service=$(echo $modem | cut -d':' -f1)
|
||||
# comdev=$(echo $modem | cut -d':' -f2)
|
||||
# iface=$(echo $modem | cut -d':' -f3)
|
||||
# fi
|
||||
|
||||
case "$service" in
|
||||
ecm)
|
||||
;;
|
||||
eem)
|
||||
;;
|
||||
mbim)
|
||||
local mbimdev=/dev/$(basename $(ls /sys/class/net/${iface}/device/usb/cdc-wdm* -d))
|
||||
local comdev="${comdev:-$mbimdev}"
|
||||
[ -n "$pincode" ] && {
|
||||
if ! mbimcli -d $comdev --query-pin-state 2>&1 | grep -q "unlocked"; then
|
||||
set -o pipefail
|
||||
if ! mbimcli -d $comdev --enter-pin="${pincode}" 2>&1; then
|
||||
mbimcli -d $comdev --query-pin-state
|
||||
proto_notify_error "$config" PIN_FAILED
|
||||
proto_block_restart "$interface"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
APN="$apn" mbim-network $comdev start
|
||||
;;
|
||||
ncm)
|
||||
[ -n "$pincode" ] && echo $pincode | gcom -d $comdev
|
||||
USE_APN="$apn" gcom -d $comdev -s /etc/gcom/ncmconnection.gcom
|
||||
;;
|
||||
qmi)
|
||||
local qmidev=/dev/$(basename $(ls /sys/class/net/${iface}/device/usb/cdc-wdm* -d))
|
||||
local comdev="${comdev:-$qmidev}"
|
||||
[ -n "$pincode" ] && {
|
||||
if ! qmicli -d $comdev --dms-uim-get-pin-status 2>&1 | grep -q "enabled-verified\|disabled" >/dev/null; then
|
||||
set -o pipefail
|
||||
if ! qmicli -d $comdev --dms-uim-verify-pin="PIN,${pincode}" 2>&1; then
|
||||
qmicli -d $comdev --dms-uim-get-pin-status
|
||||
proto_notify_error "$config" PIN_FAILED
|
||||
proto_block_restart "$interface"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
APN="$apn" qmi-network $comdev start
|
||||
;;
|
||||
esac
|
||||
|
||||
proto_export "INTERFACE=$config"
|
||||
proto_run_command "$config" udhcpc -R \
|
||||
-p /var/run/udhcpc-$iface.pid \
|
||||
-s /lib/netifd/dhcp.script \
|
||||
-f -t 0 -i "$iface" \
|
||||
${ipaddr:+-r $ipaddr} \
|
||||
${hostname:+-H $hostname} \
|
||||
${vendorid:+-V $vendorid} \
|
||||
$clientid $broadcast $dhcpopts
|
||||
}
|
||||
|
||||
proto_4g_teardown() {
|
||||
local interface="$1"
|
||||
local iface="$2"
|
||||
local modem service comdev
|
||||
|
||||
config_load network
|
||||
config_get service $interface service
|
||||
config_get comdev $interface comdev
|
||||
|
||||
# config_get modem $interface modem
|
||||
# if [ -n "$modem" ]; then
|
||||
# service=$(echo $modem | cut -d':' -f1)
|
||||
# comdev=$(echo $modem | cut -d':' -f2)
|
||||
# iface=$(echo $modem | cut -d':' -f3)
|
||||
# fi
|
||||
|
||||
case "$service" in
|
||||
ecm)
|
||||
;;
|
||||
eem)
|
||||
;;
|
||||
mbim)
|
||||
local mbimdev=/dev/$(basename $(ls /sys/class/net/${iface}/device/usb/cdc-wdm* -d))
|
||||
local comdev="${comdev:-$mbimdev}"
|
||||
mbim-network $comdev stop
|
||||
;;
|
||||
ncm)
|
||||
USE_DISCONNECT=1 gcom -d $comdev -s /etc/gcom/ncmconnection.gcom
|
||||
;;
|
||||
qmi)
|
||||
local qmidev=/dev/$(basename $(ls /sys/class/net/${iface}/device/usb/cdc-wdm* -d))
|
||||
local comdev="${comdev:-$qmidev}"
|
||||
qmi-network $comdev stop
|
||||
;;
|
||||
esac
|
||||
proto_kill_command "$interface"
|
||||
}
|
||||
|
||||
add_protocol 4g
|
||||
@@ -1,188 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=alleato-base
|
||||
|
||||
PKG_VERSION:=14.49.2
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE_URL:=git@iopsys.inteno.se:alleato_base.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8314aed451255410a2cd4fa43ac3235504e8f018
|
||||
|
||||
PKG_MAINTAINER:=Martin Assarsson, ALLEATO
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
######################################################
|
||||
|
||||
define Package/alleato3
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+python
|
||||
TITLE:=Alleato python libraries
|
||||
endef
|
||||
|
||||
define Package/zwaved
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+jansson
|
||||
TITLE:=Alleato zwave daemon
|
||||
endef
|
||||
|
||||
define Package/zwave-mgr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+alleato3
|
||||
TITLE:=Alleato zwave manager
|
||||
endef
|
||||
|
||||
define Package/zwave-profiler
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+alleato3
|
||||
TITLE:=Alleato zwave profiler
|
||||
endef
|
||||
|
||||
define Package/alleato-scheduler
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+alleato3
|
||||
TITLE:=Alleato scheduler
|
||||
endef
|
||||
|
||||
define Package/alleato-boxconfig
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+alleato3
|
||||
TITLE:=Alleato boxconfig
|
||||
endef
|
||||
|
||||
define Package/all-omc
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=+alleato3 +screen
|
||||
TITLE:=Alleato remote tunnel
|
||||
endef
|
||||
|
||||
define Package/ubus-kicker
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=
|
||||
TITLE:=Alleato ubus-kicker
|
||||
endef
|
||||
|
||||
define Package/mqttnagios
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=
|
||||
TITLE:=Alleato mqttnagios
|
||||
endef
|
||||
|
||||
define Package/all4-alleato-tools
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Alleato
|
||||
DEPENDS:=
|
||||
TITLE:=Alleato tools
|
||||
endef
|
||||
|
||||
######################################################
|
||||
|
||||
define Package/alleato3/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/python2.7/
|
||||
$(CP) -r $(PKG_BUILD_DIR)/python-2.7/* $(1)/usr/lib/python2.7/
|
||||
endef
|
||||
|
||||
define Package/zwaved/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/zwaved $(1)/etc/init.d/zwaved
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/zwaved $(1)/usr/sbin/zwaved
|
||||
endef
|
||||
|
||||
define Package/zwave-mgr/install
|
||||
$(INSTALL_DIR) $(1)/usr/mqttrules $(1)/etc/init.d $(1)/etc/alleato/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/zwave-mgr $(1)/etc/init.d/zwave-mgr
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/zwave_mgr $(1)/usr/mqttrules/zwave_mgr
|
||||
endef
|
||||
|
||||
define Package/zwave-profiler/install
|
||||
$(INSTALL_DIR) $(1)/usr/mqttrules $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/zwave-profiler $(1)/etc/init.d/zwave-profiler
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/zwave-profiler $(1)/usr/mqttrules/zwave-profiler
|
||||
endef
|
||||
|
||||
define Package/alleato-scheduler/install
|
||||
$(INSTALL_DIR) $(1)/usr/mqttrules $(1)/etc/init.d $(1)/etc/crontabs/sched
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/scheduler $(1)/etc/init.d/scheduler
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/scheduler $(1)/usr/mqttrules/scheduler
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/data/schedule $(1)/etc/crontabs/sched/schedule
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/data/schedule $(1)/etc/crontabs/schedule
|
||||
endef
|
||||
|
||||
define Package/alleato-boxconfig/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/bin $(1)/etc/init.d $(1)/etc/alleato $(1)/home/mosquitto
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/boxconfig $(1)/etc/init.d/boxconfig
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/boxconfig $(1)/usr/bin/boxconfig
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/genmosquittoconf $(1)/usr/bin/genmosquittoconf
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/check_client_id $(1)/usr/sbin/check_client_id
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/data/boxconfig.conf $(1)/etc/boxconfig.conf
|
||||
endef
|
||||
|
||||
define Package/all-omc/install
|
||||
$(INSTALL_DIR) $(1)/root $(1)/etc/init.d $(1)/etc/config $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/omc $(1)/etc/init.d/omc
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/root/ssh_key $(1)/root/ssh_key
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/data/alleato.config $(1)/etc/config/alleato
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/omc $(1)/usr/bin/omc
|
||||
endef
|
||||
|
||||
define Package/ubus-kicker/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/ubus-kicker $(1)/etc/init.d/ubus-kicker
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/ubus-kicker $(1)/usr/sbin/ubus-kicker
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/akick $(1)/usr/sbin/akick
|
||||
endef
|
||||
|
||||
define Package/mqttnagios/install
|
||||
$(INSTALL_DIR) $(1)/etc/nagios.d $(1)/usr/bin $(1)/etc/crontabs $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/mqttnagios $(1)/etc/init.d/mqttnagios
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/send_mqtt_nag $(1)/usr/bin/send_mqtt_nag
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nagios.d/dropbear $(1)/etc/nagios.d/dropbear.nag
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nagios.d/mosquitto $(1)/etc/nagios.d/mosquitto.nag
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nagios.d/ssh $(1)/etc/nagios.d/ssh.nag
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/nagios.d/zwaved $(1)/etc/nagios.d/zwaved.nag
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/data/mqttnagios $(1)/etc/crontabs/mqttnagios
|
||||
echo '/5 * * * * /usr/sbin/check_client_id' >> $(1)/etc/crontabs/root
|
||||
endef
|
||||
|
||||
define Package/all4-alleato-tools/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin $(1)/etc/init.d $(1)/opt/alleato
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/house $(1)/etc/init.d/house
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init.d/rulesd $(1)/etc/init.d/rulesd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/binaries/alleato_tools $(1)/usr/bin/alleato_tools
|
||||
endef
|
||||
|
||||
######################################################
|
||||
|
||||
$(eval $(call BuildPackage,alleato3))
|
||||
$(eval $(call BuildPackage,zwaved))
|
||||
$(eval $(call BuildPackage,zwave-mgr))
|
||||
$(eval $(call BuildPackage,zwave-profiler))
|
||||
$(eval $(call BuildPackage,alleato-scheduler))
|
||||
$(eval $(call BuildPackage,alleato-boxconfig))
|
||||
$(eval $(call BuildPackage,all-omc))
|
||||
$(eval $(call BuildPackage,ubus-kicker))
|
||||
$(eval $(call BuildPackage,mqttnagios))
|
||||
$(eval $(call BuildPackage,all4-alleato-tools))
|
||||
@@ -1,7 +0,0 @@
|
||||
config ANYFI_CONTROLLER
|
||||
string "Controller IP or FQDN"
|
||||
depends on PACKAGE_anyfi
|
||||
help
|
||||
The default IP address or fully qualified domain name (FQDN)
|
||||
of the Controller that should manage the Anyfi.net software.
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
ANYFI_TARGET := $(ARCH)-linux-$(subst C,c,$(LIBC))-$(LIBCV)
|
||||
|
||||
PKG_NAME := anyfi
|
||||
PKG_VERSION := 1.3.9
|
||||
PKG_RELEASE := 1
|
||||
|
||||
PKG_SOURCE := anyfimac-$(PKG_VERSION)-$(ANYFI_TARGET).tar.bz2
|
||||
PKG_SOURCE_URL := http://anyfi.net/download
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/anyfimac-$(PKG_VERSION)-$(ANYFI_TARGET)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION := net
|
||||
CATEGORY := Network
|
||||
TITLE := Anyfi.net - Free SDWN Data Plane for IEEE 802.11
|
||||
URL := http://anyfi.net
|
||||
DEPENDS := +kmod-tun +librt +wl-anyfi
|
||||
MAINTAINER := Anyfi Networks <eng@anyfinetworks.com>
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Anyfi.net is a free Software-Defined Wirless Networking (SDWN)
|
||||
forwarding data plane implementation for IEEE 802.11.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
echo "config anyfi controller" > $(PKG_BUILD_DIR)/anyfi.conf
|
||||
echo " option 'hostname' $(CONFIG_ANYFI_CONTROLLER)" >> \
|
||||
$(PKG_BUILD_DIR)/anyfi.conf
|
||||
echo "config anyfi optimizer" >> $(PKG_BUILD_DIR)/anyfi.conf
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
@echo "Nothing to do - Anyfi.net software comes pre-built."
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/anyfi
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/anyfi.conf $(1)/etc/config/anyfi
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/anyfimac $(1)/sbin
|
||||
$(LN) anyfimac $(1)/sbin/anyfid
|
||||
$(LN) anyfimac $(1)/sbin/myfid
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(LN) ../sbin/anyfimac $(1)/bin/anyfidctl
|
||||
$(LN) ../sbin/anyfimac $(1)/bin/myfidctl
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -1,558 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2013-2014 Anyfi Networks AB.
|
||||
#
|
||||
# Overview of the Integration
|
||||
# ===========================
|
||||
#
|
||||
# Anyfi.net software consists of two user space daemons; the radio daemon
|
||||
# anyfid and the tunnel termination daemon myfid. They communicate with each
|
||||
# other and with a Controller [1] over UDP/IP.
|
||||
#
|
||||
# The radio daemon anyfid provides guests with access to remote Wi-Fi networks.
|
||||
# It needs a Wi-Fi monitor interface to detect when guest devices come within
|
||||
# range and a pool of virtual access points to serve them. The integration is
|
||||
# responsible for creating the monitor interface and the pool of virtual access
|
||||
# points; anyfid handles the rest.
|
||||
#
|
||||
# The tunnel termination daemon myfid provides remote access to the local Wi-Fi
|
||||
# network. It is up to the integration to configure myfid to authenticate remote
|
||||
# devices in the same way that devices are authenticated when connecting
|
||||
# locally.
|
||||
#
|
||||
# Myfid is also responsible for telling the controller the MAC address of
|
||||
# devices that connect locally, so that they can later be offered seamless
|
||||
# remote access whenever they come close to another access point running anyfid.
|
||||
# However, when the user changes the WPA passphrase all such associations
|
||||
# between previously connected devices and the local Wi-Fi network should be
|
||||
# removed. The integration does so by passing myfid the --reset flag.
|
||||
#
|
||||
# Below is the integration logic in pseudo code. If you need to integrate
|
||||
# Anyfi.net software in your own firmware build environment you can find step
|
||||
# by step instructions at http://anyfi.net/integration.
|
||||
#
|
||||
# 1. A Community Edition of the Controller is available for download at
|
||||
# http://www.anyfinetworks.com/download. You can also use the public
|
||||
# demonstration controller at "demo.anyfi.net".
|
||||
#
|
||||
#
|
||||
# Integration Logic in Pseudo Code
|
||||
# ================================
|
||||
#
|
||||
# After enabling a Wi-Fi device:
|
||||
# IF a controller is configured AND Anyfi.net is not disabled
|
||||
# ALLOCATE monitor interface and virtual access point pool for anyfid
|
||||
# START anyfid
|
||||
#
|
||||
# FOREACH Wi-Fi interface of this device
|
||||
# IF a controller is configured AND Anyfi.net is not disabled
|
||||
# GENERATE a config file for myfid
|
||||
#
|
||||
# IF the WPA passphrase has changed
|
||||
# ADD the --reset flag to myfid arguments
|
||||
#
|
||||
# START myfid on the Wi-Fi interface
|
||||
#
|
||||
# After disabling a Wi-Fi device:
|
||||
# STOP anyfid
|
||||
#
|
||||
# FOREACH Wi-Fi interface of this device
|
||||
# STOP myfid on the Wi-Fi interface
|
||||
#
|
||||
# NOTE 1: The integration provides remote access to all Wi-Fi interfaces on the
|
||||
# system that have anyfi_disabled set to 0. Each interface will have
|
||||
# its own myfid daemon. There should however only be one anyfid daemon
|
||||
# per radio.
|
||||
#
|
||||
# NOTE 2: On concurrent dual band routers each radio should have its own anyfid
|
||||
# daemon.
|
||||
#
|
||||
#
|
||||
# Anyfi.net UCI data model
|
||||
# ========================
|
||||
#
|
||||
# Anyfi.net global parameters:
|
||||
#
|
||||
# Name Type Default Description
|
||||
# controller
|
||||
# .hostname IP or FQDN demo.anyfi.net Controller IP or FQDN
|
||||
# .key path - Controller public key PEM file
|
||||
# optimizer
|
||||
# .key path - Optimizer public key PEM file
|
||||
#
|
||||
# Wi-Fi device parameters:
|
||||
#
|
||||
# Name Type Default Description
|
||||
# anyfi_disabled boolean 0 Enable/disable guest access on this radio
|
||||
# anyfi_iface port - Bind anyfid to a WAN interface IP address
|
||||
# anyfi_port number - Bind anyfid to a SDWN UDP port
|
||||
# anyfi_floor percent 5 Min backhaul and spectrum allocation
|
||||
# anyfi_ceiling percent 75 Max backhaul and spectrum allocation
|
||||
# anyfi_uplink integer - WAN uplink capacity in bits per second
|
||||
# anyfi_downlink integer - WAN downlink capacity in bits per second
|
||||
# anyfi_bssids integer - Max number of virtual interfaces to use
|
||||
# anyfi_clients integer - Max number of concurrent guest users
|
||||
#
|
||||
# Wi-Fi interface parameters:
|
||||
#
|
||||
# Name Type Default Description
|
||||
# anyfi_disabled boolean 0 Enable remote access on this network
|
||||
# anyfi_iface string - Bind myfid to a WAN interface IP
|
||||
# address
|
||||
# anyfi_port port - Bind myfid to a SDWN UDP port
|
||||
# anyfi_autz_server IP - RADIUS authorization server IP
|
||||
# anyfi_autz_port port 1812 RADIUS authorization server UDP port
|
||||
# anyfi_autz_secret string - RADIUS authorization server shared
|
||||
# secret
|
||||
# anyfi_acct_server IP - RADIUS extra accounting server IP
|
||||
# anyfi_acct_port port 1813 RADIUS extra accounting server UDP port
|
||||
# anyfi_acct_secret string - RADIUS extra accounting server shared
|
||||
# secret
|
||||
|
||||
append ENABLE_HOOKS anyfi_enable
|
||||
append DISABLE_HOOKS anyfi_disable
|
||||
|
||||
# Daemon run dir for temporary files.
|
||||
RUNDIR=/var/run
|
||||
|
||||
# Config file dir for persistent configuration files.
|
||||
CONFDIR=/etc
|
||||
|
||||
##### Wi-Fi device handling ##################################################
|
||||
|
||||
# Get the channel for Wi-Fi device.
|
||||
# anyfi_dev_get_channel <device>
|
||||
anyfi_dev_get_channel() {
|
||||
local device="$1"
|
||||
local hwmode channel
|
||||
|
||||
config_get hwmode "$device" hwmode
|
||||
config_get channel "$device" channel
|
||||
|
||||
if [ "$channel" = auto -o "$channel" = 0 ]; then
|
||||
case "$hwmode" in
|
||||
auto)
|
||||
channel=auto
|
||||
;;
|
||||
|
||||
*b*|*g*)
|
||||
channel=auto2
|
||||
;;
|
||||
|
||||
*a*)
|
||||
channel=auto5
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
echo "$channel"
|
||||
}
|
||||
|
||||
# Get the WLAN interface list for a WLAN device.
|
||||
# anyfi_get_vifs <device>
|
||||
anyfi_get_vifs() {
|
||||
local device=$1
|
||||
local vifs=""
|
||||
local cfg
|
||||
|
||||
for cfg in $CONFIG_SECTIONS; do
|
||||
local type dev
|
||||
config_get type "$cfg" TYPE
|
||||
config_get dev "$cfg" device
|
||||
|
||||
if [ "$type" = wifi-iface ] && [ "$dev" = "$device" ]; then
|
||||
append vifs "$cfg"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$vifs"
|
||||
}
|
||||
|
||||
# Start the Anyfi.net radio head daemon anyfid on a device.
|
||||
# anyfi_dev_start <device> <type> <controller> <controller_key>
|
||||
anyfi_dev_start()
|
||||
{
|
||||
local device="$1"
|
||||
local type="$2"
|
||||
local controller="$3"
|
||||
local controller_key="$4"
|
||||
local nvifs bssids monitor iflist
|
||||
|
||||
# Determine how many virtual interfaces we should use
|
||||
config_get bssids "$device" anyfi_bssids
|
||||
nvifs=$(anyfi_get_vifs "$device" | wc -w)
|
||||
|
||||
if [ -n "$bssids" ]; then
|
||||
# Limit the number of virtual interfaces to 32
|
||||
[ "$bssids" -lt 32 ] || bssids=32
|
||||
elif [ $nvifs -lt 4 ]; then
|
||||
# Don't use more that 8 interfaces in total if possible...
|
||||
bssids=$((8 - $nvifs))
|
||||
else
|
||||
# ...but try to allocate at least 4 interfaces for anyfid.
|
||||
bssids=4
|
||||
fi
|
||||
|
||||
# ALLOCATE monitor and pool of virtual access points
|
||||
if monitor=$(anyfi_${type}_alloc_monitor "$device") && \
|
||||
iflist=$(anyfi_${type}_alloc_iflist "$device" $bssids)
|
||||
then
|
||||
local args=""
|
||||
local wanif port floor ceiling uplink downlink clients
|
||||
|
||||
config_get wanif "$device" anyfi_iface
|
||||
config_get port "$device" anyfi_port
|
||||
config_get floor "$device" anyfi_floor
|
||||
config_get ceiling "$device" anyfi_ceiling
|
||||
config_get uplink "$device" anyfi_uplink
|
||||
config_get downlink "$device" anyfi_downlink
|
||||
config_get clients "$device" anyfi_clients
|
||||
|
||||
# If there are no interfaces on this device then
|
||||
# anyfid controls channel
|
||||
if [ "$nvifs" -eq 0 ]; then
|
||||
args="$args --channel=$(anyfi_dev_get_channel $device)"
|
||||
fi
|
||||
|
||||
[ -n "$wanif" ] && args="$args --bind-if=$wanif"
|
||||
[ -n "$port" ] && args="$args --bind-port=$port"
|
||||
[ -n "$floor" ] && args="$args --floor=$floor"
|
||||
[ -n "$ceiling" ] && args="$args --ceiling=$ceiling"
|
||||
[ -n "$uplink" ] && args="$args --uplink=$uplink"
|
||||
[ -n "$downlink" ] && args="$args --downlink=$downlink"
|
||||
[ -n "$clients" ] && args="$args --max-clients=$clients"
|
||||
[ -n "$controller_key" ] && \
|
||||
args="$args --controller-key=$controller_key"
|
||||
|
||||
# START anyfid
|
||||
echo "$device: starting anyfid"
|
||||
/sbin/anyfid --accept-license -C "$controller" -B \
|
||||
-P $RUNDIR/anyfid_$device.pid $args \
|
||||
$monitor $iflist
|
||||
else
|
||||
echo "$device: failed to allocate anyfid interfaces" 1>&2
|
||||
fi
|
||||
}
|
||||
|
||||
##### Wi-Fi interface handling ###############################################
|
||||
|
||||
# Get the printable name of an interface.
|
||||
anyfi_vif_get_name() {
|
||||
local ifname
|
||||
config_get ifname "$1" ifname
|
||||
echo "${ifname:-$1}"
|
||||
}
|
||||
|
||||
# Generate the config file for myfid from UCI variables.
|
||||
# anyfi_vif_gen_config <vif>
|
||||
anyfi_vif_gen_config() {
|
||||
local vif="$1"
|
||||
local name="$(anyfi_vif_get_name $1)"
|
||||
local device net ssid enc key isolate ifname
|
||||
|
||||
config_get device "$vif" device
|
||||
config_get net "$vif" network
|
||||
config_get ssid "$vif" ssid
|
||||
config_get enc "$vif" encryption
|
||||
config_get key "$vif" key
|
||||
config_get isolate "$vif" isolate
|
||||
config_get ifname "$vif" ifname
|
||||
|
||||
# Check basic settings before proceeding
|
||||
[ -n "$net" ] || [ -n "$ssid" ] || return 1
|
||||
|
||||
local auth_proto auth_mode auth_cache group_rekey
|
||||
local ciphers wpa_ciphers rsn_ciphers passphrase
|
||||
local auth_server auth_port auth_secret
|
||||
local autz_server autz_port autz_secret
|
||||
local acct_server acct_port acct_secret
|
||||
local acct2_server acct2_port acct2_secret
|
||||
local radius_nasid
|
||||
|
||||
# Resolve explicit cipher overrides (tkip, ccmp or tkip+ccmp)
|
||||
case "$enc" in
|
||||
*+tkip+ccmp|*+tkip+aes)
|
||||
ciphers=tkip+ccmp
|
||||
;;
|
||||
|
||||
*+ccmp|*+aes)
|
||||
ciphers=ccmp
|
||||
;;
|
||||
|
||||
*+tkip)
|
||||
ciphers=tkip
|
||||
;;
|
||||
esac
|
||||
|
||||
# Resolve authentication protocol (WPA or WPA2)
|
||||
case "$enc" in
|
||||
psk-mixed*|wpa-mixed*|mixed-psk*|mixed-wpa*)
|
||||
auth_proto=wpa+rsn
|
||||
wpa_ciphers=$ciphers
|
||||
rsn_ciphers=$ciphers
|
||||
;;
|
||||
|
||||
psk2*|wpa2*)
|
||||
auth_proto=rsn
|
||||
rsn_ciphers=$ciphers
|
||||
;;
|
||||
|
||||
psk*|wpa*)
|
||||
auth_proto=wpa
|
||||
wpa_ciphers=$ciphers
|
||||
;;
|
||||
|
||||
none)
|
||||
echo "$name: no remote access for security reasons (open network)" 1>&2
|
||||
return 1
|
||||
;;
|
||||
|
||||
wep*)
|
||||
echo "$name: no remote access for security reasons (wep is insecure)" 1>&2
|
||||
return 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "$name: unrecognized encryption type $enc" 1>&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Resolve authenticator mode (PSK or 802.1X)
|
||||
case "$enc" in
|
||||
psk*)
|
||||
auth_mode=psk
|
||||
passphrase=$key
|
||||
[ -n "$passphrase" ] || return 1
|
||||
;;
|
||||
|
||||
wpa*)
|
||||
auth_mode=eap
|
||||
|
||||
config_get auth_server "$vif" radius_server
|
||||
config_get auth_port "$vif" radius_port
|
||||
config_get auth_secret "$vif" radius_secret
|
||||
|
||||
config_get acct_server "$vif" acct_server
|
||||
config_get acct_port "$vif" acct_port
|
||||
config_get acct_secret "$vif" acct_secret
|
||||
|
||||
config_get auth_cache "$vif" auth_cache
|
||||
config_get group_rekey "$vif" wpa_group_rekey
|
||||
|
||||
[ -n "$auth_server" ] || return 1
|
||||
[ -n "$auth_secret" ] || auth_secret="$key"
|
||||
[ -n "$acct_server" -a -z "$acct_secret" ] && acct_secret="$key"
|
||||
;;
|
||||
|
||||
none)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "$name: no remote access ('encryption' not configured)" 1>&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# Optional RADIUS authorization and accounting for Anyfi.net
|
||||
config_get autz_server "$vif" anyfi_autz_server
|
||||
config_get autz_port "$vif" anyfi_autz_port
|
||||
config_get autz_secret "$vif" anyfi_autz_secret
|
||||
|
||||
config_get acct2_server "$vif" anyfi_acct_server
|
||||
config_get acct2_port "$vif" anyfi_acct_port
|
||||
config_get acct2_secret "$vif" anyfi_acct_secret
|
||||
|
||||
config_get radius_nasid "$vif" radius_nasid
|
||||
|
||||
# Generate common config file options
|
||||
cat <<EOF
|
||||
ssid = '$ssid'
|
||||
bridge = br-$net
|
||||
auth_proto = $auth_proto
|
||||
EOF
|
||||
|
||||
# Generate dependent config file options
|
||||
[ "$isolate" = 1 ] && echo "isolation = 1"
|
||||
[ -n "$ifname" ] && echo "local_ap = $ifname"
|
||||
[ -n "$auth_mode" ] && echo "auth_mode = $auth_mode"
|
||||
[ -n "$auth_cache" ] && echo "auth_cache = $auth_cache"
|
||||
[ -n "$rsn_ciphers" ] && echo "rsn_ciphers = $rsn_ciphers"
|
||||
[ -n "$wpa_ciphers" ] && echo "wpa_ciphers = $wpa_ciphers"
|
||||
[ -n "$group_rekey" ] && echo "group_rekey = $group_rekey"
|
||||
[ -n "$passphrase" ] && echo "passphrase = '$passphrase'"
|
||||
[ -n "$radius_nasid" ] && echo "radius_nas_id = $radius_nas_id"
|
||||
if [ -n "$auth_server" ] && [ -n "$auth_secret" ]; then
|
||||
echo "radius_auth_server = $auth_server"
|
||||
echo "radius_auth_port = ${auth_port:-1812}"
|
||||
echo "radius_auth_secret = $auth_secret"
|
||||
fi
|
||||
if [ -n "$acct_server" ] && [ -n "$acct_secret" ]; then
|
||||
echo "radius_acct_server = $acct_server"
|
||||
echo "radius_acct_port = ${acct_port:-1813}"
|
||||
echo "radius_acct_secret = $acct_secret"
|
||||
fi
|
||||
if [ -n "$autz_server" ] && [ -n "$autz_secret" ]; then
|
||||
echo "radius_autz_server = $autz_server"
|
||||
echo "radius_autz_port = ${autz_port:-1812}"
|
||||
echo "radius_autz_secret = $autz_secret"
|
||||
fi
|
||||
if [ -n "$acct2_server" ] && [ -n "$acct2_secret" ]; then
|
||||
echo "radius_acct2_server = $acct2_server"
|
||||
echo "radius_acct2_port = ${acct2_port:-1813}"
|
||||
echo "radius_acct2_secret = $acct2_secret"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Get the current value from a myfid configuration file.
|
||||
# anyfi_vif_get_config <file> <config>
|
||||
anyfi_vif_get_config() {
|
||||
local file="$1"
|
||||
local key="$2"
|
||||
|
||||
[ -e "$file" ] || return 1
|
||||
|
||||
# Assume the format is exactly "key = value",
|
||||
# where value may or may not be in ''
|
||||
grep "$key = " $file | cut -d '=' -f2- | cut -b2- | \
|
||||
sed -e "/^'.*'$/s/^'\\(.*\\)'$/\\1/"
|
||||
}
|
||||
|
||||
# Start the Anyfi.net tunnel-termination daemon myfid on an interface.
|
||||
# anyfi_vif_start <vif> <controller> <controller_key> <optimizer_key>
|
||||
anyfi_vif_start()
|
||||
{
|
||||
local vif="$1"
|
||||
local controller="$2"
|
||||
local controller_key="$3"
|
||||
local optimizer_key="$4"
|
||||
|
||||
local name="$(anyfi_vif_get_name $vif)"
|
||||
local pid_file="$RUNDIR/myfid_$name.pid"
|
||||
local conf_file="$CONFDIR/myfid_$name.conf"
|
||||
local new_conf_file="$RUNDIR/myfid_$name.conf"
|
||||
|
||||
# GENERATE a config file for myfid
|
||||
if (anyfi_vif_gen_config $vif) > $new_conf_file; then
|
||||
local controller_key optimizer_key
|
||||
local key old_key wanif port
|
||||
local args=""
|
||||
|
||||
config_get key "$vif" key
|
||||
config_get wanif "$vif" anyfi_iface
|
||||
config_get port "$vif" anyfi_port
|
||||
|
||||
# ADD optional arguments
|
||||
[ -n "$wanif" ] && args="$args --bind-if=$wanif"
|
||||
[ -n "$port" ] && args="$args --bind-port=$port"
|
||||
[ -n "$controller_key" ] && \
|
||||
args="$args --controller-key=$controller_key"
|
||||
[ -n "$optimizer_key" ] && \
|
||||
args="$args --optimizer-key=$optimizer_key"
|
||||
|
||||
# ADD the --reset flag to myfid arguments if the passphrase
|
||||
# has changed or myfid is started for the first time
|
||||
old_key="$(anyfi_vif_get_config $conf_file passphrase)"
|
||||
[ "$key" == "$old_key" ] || args="$args --reset"
|
||||
|
||||
# Update the myfid config file in flash only if needed
|
||||
if ! cmp -s $new_conf_file $conf_file; then
|
||||
mv $new_conf_file $conf_file
|
||||
else
|
||||
rm -f $new_conf_file
|
||||
fi
|
||||
|
||||
# START myfid
|
||||
echo "$name: starting myfid"
|
||||
/sbin/myfid --accept-license -C "$controller" -B -P $pid_file \
|
||||
$args $conf_file
|
||||
fi
|
||||
}
|
||||
|
||||
# Stop an Anyfi.net daemon gracefully
|
||||
# anyfi_stop_daemon <pidfile>
|
||||
anyfi_stop_daemon() {
|
||||
local pidfile="$1"
|
||||
|
||||
kill -TERM $(cat $pidfile)
|
||||
for t in $(seq 0 5); do
|
||||
[ -e $pidfile ] || return 0
|
||||
sleep 1
|
||||
done
|
||||
|
||||
echo "Timeout waiting for daemon assocated with $pidfile to exit" 1>&2
|
||||
kill -KILL $(cat $pidfile)
|
||||
rm -f $pidfile
|
||||
return 1
|
||||
}
|
||||
|
||||
# Enable Anyfi.net for a Wi-Fi device.
|
||||
# Run from ENABLE_HOOKS
|
||||
anyfi_enable()
|
||||
{
|
||||
local device="$1"
|
||||
local controller
|
||||
local type vif vifs
|
||||
|
||||
# A controller IP or FQDN is required
|
||||
controller="$(uci get anyfi.controller.hostname 2>/dev/null)"
|
||||
[ -n "$controller" ] || return 0
|
||||
|
||||
# Optional controller and optimizer public keys
|
||||
controller_key="$(uci get anyfi.controller.key 2>/dev/null)"
|
||||
optimizer_key="$(uci get anyfi.optimizer.key 2>/dev/null)"
|
||||
|
||||
# Reload the wireless config to get the assigned ifnames right
|
||||
config_load wireless
|
||||
config_get type "$device" type
|
||||
vifs=$(anyfi_get_vifs "$device")
|
||||
|
||||
# START anyfid on this device
|
||||
if [ "$(config_get $device anyfi_disabled)" != 1 ] && \
|
||||
/sbin/anyfi-probe "$type"
|
||||
then
|
||||
anyfi_dev_start $device $type "$controller" "$controller_key"
|
||||
fi
|
||||
|
||||
# FOREACH Wi-Fi interface of this device
|
||||
for vif in $vifs; do
|
||||
if [ "$(config_get $vif disabled)" != 1 ] && \
|
||||
[ "$(config_get $vif anyfi_disabled)" != 1 ]
|
||||
then
|
||||
anyfi_vif_start $vif "$controller" \
|
||||
"$controller_key" "$optimizer_key"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Disable Anyfi.net for a Wi-Fi device.
|
||||
# Run from DISABLE_HOOKS
|
||||
anyfi_disable()
|
||||
{
|
||||
local device="$1"
|
||||
local type vif vifs
|
||||
|
||||
# Reload the wireless config to get the assigned ifnames right
|
||||
config_load wireless
|
||||
config_get type "$device" type
|
||||
vifs=$(anyfi_get_vifs "$device")
|
||||
|
||||
# STOP anyfid on this device (if anyfid is running)
|
||||
if [ -e $RUNDIR/anyfid_$device.pid ]; then
|
||||
echo "$device: stopping anyfid"
|
||||
anyfi_stop_daemon $RUNDIR/anyfid_$device.pid
|
||||
anyfi_${type}_release_iflist $device
|
||||
anyfi_${type}_release_monitor $device
|
||||
fi
|
||||
|
||||
# FOREACH Wi-Fi interface of this device (with myfid running)
|
||||
for vif in $vifs; do
|
||||
local name="$(anyfi_vif_get_name $vif)"
|
||||
local pidfile="$RUNDIR/myfid_$name.pid"
|
||||
|
||||
if [ -e $pidfile ]; then
|
||||
echo "$name: stopping myfid"
|
||||
anyfi_stop_daemon $pidfile
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2013-2014 Anyfi Networks AB.
|
||||
# Anyfi.net setup functions for Broadcom wl driver.
|
||||
|
||||
# Get monitor name interface based for a device.
|
||||
# anyfi_dev_monitor_name <device>
|
||||
anyfi_broadcom_name_monitor() {
|
||||
local device="$1"
|
||||
|
||||
# Map wlX => radiotapX
|
||||
echo "$device" | sed 's/^.*\([0-9]\)$/radiotap\1/'
|
||||
}
|
||||
|
||||
# Get BSS index of the last wl interface that is used (=up)
|
||||
# wl0.2 => 2
|
||||
# wl0 => (empty)
|
||||
anyfi_broadcom_get_wlindex() {
|
||||
ifconfig | grep -o "^$1\..." | cut -d'.' -f2 | sort -n | tail -n 1
|
||||
}
|
||||
|
||||
# Allocate virtual Wi-Fi interfaces for anyfid.
|
||||
# anyfi_broadcom_alloc_iflist <device> <bssids>
|
||||
anyfi_broadcom_alloc_iflist() {
|
||||
local device="$1"
|
||||
local bssids="$2"
|
||||
local count=0
|
||||
local wlindex num
|
||||
|
||||
# Enable MBSS mode if not already enabled
|
||||
if [ "$(wlctl -i $device mbss)" = 0 ]; then
|
||||
wlctl -i $device down
|
||||
wlctl -i $device mbss 1
|
||||
wlctl -i $device up
|
||||
fi
|
||||
|
||||
wlindex=$(anyfi_broadcom_get_wlindex $device)
|
||||
|
||||
# Create WLAN interfaces and let the driver assign the BSSIDs
|
||||
for num in $(seq $bssids); do
|
||||
local idx=$(($wlindex + $num))
|
||||
local wlif=$device.$idx
|
||||
|
||||
# Do the 'wlctl' dance to make the driver assign proper BSSIDs
|
||||
wlctl -i $device bss -C $idx up > /dev/null || break
|
||||
wlctl -i $device ssid -C $idx "dummy" > /dev/null
|
||||
wlctl -i $device bss -C $idx up > /dev/null
|
||||
wlctl -i $device bss -C $idx down > /dev/null
|
||||
wlctl -i $device ssid -C $idx "" > /dev/null
|
||||
|
||||
local bssid=$(wlctl -i $wlif cur_etheraddr | cut -d' ' -f2)
|
||||
ifconfig $wlif hw ether $bssid > /dev/null
|
||||
count=$(($count + 1))
|
||||
done
|
||||
|
||||
[ "$count" -gt 0 ] && echo $device.$(($wlindex + 1))/$count
|
||||
}
|
||||
|
||||
# Release virtual Wi-Fi interfaces allocated for anyfid.
|
||||
# anyfi_broadcom_release_iflist <device>
|
||||
anyfi_broadcom_release_iflist() {
|
||||
true
|
||||
}
|
||||
|
||||
# Allocate a monitor interface for anyfid.
|
||||
# anyfi_broadcom_alloc_monitor <device>
|
||||
anyfi_broadcom_alloc_monitor() {
|
||||
local device="$1"
|
||||
local monitor=$(anyfi_broadcom_name_monitor $device)
|
||||
|
||||
wlctl -i $device monitor 0 || return 1
|
||||
wlctl -i $device monitor 3 || return 1
|
||||
ifconfig $monitor down || return 1
|
||||
ifconfig $monitor up || return 1
|
||||
echo $monitor
|
||||
}
|
||||
|
||||
# Release the monitor interface for anyfid.
|
||||
# anyfi_broadcom_release_monitor <device>
|
||||
anyfi_broadcom_release_monitor() {
|
||||
local device="$1"
|
||||
local monitor=$(anyfi_broadcom_name_monitor $device)
|
||||
|
||||
ifconfig $monitor down 2> /dev/null
|
||||
wlctl -i $device monitor 0 2> /dev/null
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Check if a WLAN driver type is supported by Anyfi.net radio software."
|
||||
echo "Usage: $0 {mac80211|...}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
number() {
|
||||
echo $2 | sed -e 's/[^0-9]/ /g' | cut -d' ' -f $1
|
||||
}
|
||||
|
||||
major() {
|
||||
number 1 $1
|
||||
}
|
||||
|
||||
minor() {
|
||||
number 2 $1
|
||||
}
|
||||
|
||||
case $1 in
|
||||
mac80211)
|
||||
COMPAT_VER=$(opkg list-installed kmod-mac80211 | cut -d'+' -f2)
|
||||
KERNEL_VER=$(uname -r)
|
||||
|
||||
# Future kernels > 3.x are OK
|
||||
[ "$(major $KERNEL_VER)" -gt 3 ] && return 0
|
||||
|
||||
# The required commit 86c228a7627f3f2776893da47592234140fbfba8
|
||||
# for mac80211 support was introduced in kernel 3.12.
|
||||
[ "$(major $KERNEL_VER)" -eq 3 ] && \
|
||||
[ "$(minor $KERNEL_VER)" -ge 12 ] && return 0
|
||||
|
||||
[ "$(major $COMPAT_VER)" -gt 2013 ] && return 0
|
||||
[ "$(major $COMPAT_VER)" -eq 2013 ] && \
|
||||
[ "$(minor $COMPAT_VER)" -ge 11 ] && return 0
|
||||
|
||||
cat <<EOF
|
||||
Support for mac80211 requires Linux kernel >= 3.12 or
|
||||
compat-wireless >= 2013-11-05. Please update your system.
|
||||
EOF
|
||||
;;
|
||||
|
||||
broadcom)
|
||||
return 0
|
||||
;;
|
||||
|
||||
*)
|
||||
cat<<EOF
|
||||
WLAN driver \"$1\" is not supported by the Anyfi.net radio software.
|
||||
Improved drivers with Anyfi.net support are available for Broadcom,
|
||||
Qualcomm Atheros, Ralink and Realtek chipsets. Please contact
|
||||
support@anyfi.net for updated drivers, reference integrations and
|
||||
commercial integration services.
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
exit 1
|
||||
802
asterisk-1.8.x-mod/Makefile
Normal file
802
asterisk-1.8.x-mod/Makefile
Normal file
@@ -0,0 +1,802 @@
|
||||
#
|
||||
# Copyright (C) 2008-2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=asterisk18-mod
|
||||
PKG_VERSION:=1.8.10.1
|
||||
|
||||
PKG_SOURCE_VERSION:=015d279241d0ac5d8c1321aa6f78b9ae551575d1
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/asterisk-1.8.x
|
||||
|
||||
PKG_RELEASE:=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)-$(PKG_RELEASE).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
-include $(INCLUDE_DIR)/ltqtapi.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/asterisk18-mod/Default
|
||||
SUBMENU:=Telephony
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
URL:=http://www.asterisk.org/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod/Default/description
|
||||
Asterisk is a complete PBX in software. It provides all of the features
|
||||
you would expect from a PBX and more. Asterisk does voice over IP in three
|
||||
protocols, and can interoperate with almost all standards-based telephony
|
||||
equipment using relatively inexpensive hardware.
|
||||
endef
|
||||
|
||||
|
||||
define Package/asterisk18-mod
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Complete open source PBX, v1.8x
|
||||
MENU:=1
|
||||
DEPENDS:= +natalie-dect-h +PACKAGE_bcmkernel:bcmkernel +PACKAGE_bcmopen:bcmopen +libopenssl +libncurses +libpopt +libpthread +uci +ubus +zlib @!TARGET_avr32
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-sounds
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Sound files
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-sounds/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package contains sound files for Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-voicemail
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Voicemail support
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-voicemail/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package contains voicemail related modules for Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-transfer
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Call transfer support
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-transfer/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package contains the call transfer support module for Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-softhangup
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=SoftHangup application
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-softhangup/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package contains the SoftHangup support module for Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-meetme
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=conferencing support
|
||||
DEPENDS:= asterisk18-mod +dahdi-tools-libtonezone +dahdi
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-meetme/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides the MeetMe application driver Conferencing support to
|
||||
Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-iax2
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=IAX support
|
||||
DEPENDS:= asterisk18-mod +asterisk18-res-crypto
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-iax2/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides IAX support to
|
||||
Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-cdr
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=CDR support
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-cdr/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides Call Detail Record support to
|
||||
Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-musiconhold
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=MOH support
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-musiconhold/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides Music On Hold support to
|
||||
Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-voice
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Voice client/pbx support
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-voice/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides Voice Client/pbx support to
|
||||
Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-srtp
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=SRTP support
|
||||
DEPENDS:= asterisk18-mod libsrtp +asterisk18-mod-res-crypto
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-srtp/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides SRTP support to
|
||||
Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-stun
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=STUN support
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-queue
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Queue support
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-gtalk
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=GTalk support
|
||||
DEPENDS:= asterisk18-mod +libiksemel
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-gtalk/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides the channel chan_gtalk and res_jabber for GTalk
|
||||
support to Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-mobile
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Mobile channel support
|
||||
DEPENDS:= asterisk18-mod +bluez-libs
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-mobile/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides the channel chan_mobile support to Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-timing-timerfd
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:= Timerfd Timing Interface
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-timing-pthread
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:= pthread Timing Interface
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-fax
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Generic FAX Resource for FAX technology resource modules
|
||||
DEPENDS:= asterisk18-mod +asterisk18-mod-res-timing-pthread
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-fax-spandsp
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Spandsp T.38 and G.711 FAX Resource
|
||||
DEPENDS:= asterisk18-mod +asterisk18-mod-res-fax +libspandsp
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-mgcp
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=MGCP channel support
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-mgcp/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides the channel chan_mgcp support to Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-skinny
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Skinny channel support
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-skinny/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides the channel chan_skinny support to Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-brcm
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Broadcom channel support
|
||||
DEPENDS:= asterisk18-mod
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-brcm/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides the channel chan_brcm support to Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-curl
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=CURL support
|
||||
DEPENDS:= asterisk18-mod +libcurl
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-curl/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides CURL
|
||||
support to Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-mysql
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=MySQL support
|
||||
DEPENDS:= asterisk18-mod +PACKAGE_asterisk18-mysql:libmysqlclient
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-mysql/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides MySQL
|
||||
support to Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-lantiq
|
||||
$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=Lantiq TAPI support
|
||||
DEPENDS:= asterisk18-mod $(LTQ_TAPI_DEPENDS)
|
||||
URL:=http://git.nanl.de/?p=asterisk_channel_lantiq.git
|
||||
MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-lantiq/description
|
||||
$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides the channel chan_lantiq support to Asterisk.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--without-inotify
|
||||
|
||||
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-app-meetme),)
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-dahdi="$(STAGING_DIR)/usr"
|
||||
else
|
||||
CONFIGURE_ARGS+= \
|
||||
--without-dahdi
|
||||
endif
|
||||
|
||||
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-chan-gtalk),)
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-gnutls="$(STAGING_DIR)/usr" \
|
||||
--with-iksemel="$(STAGING_DIR)/usr"
|
||||
SITE_VARS+= \
|
||||
ac_cv_lib_iksemel_iks_start_sasl=yes \
|
||||
ac_cv_lib_gnutls_gnutls_bye=yes
|
||||
else
|
||||
CONFIGURE_ARGS+= \
|
||||
--without-gnutls \
|
||||
--without-iksemel
|
||||
endif
|
||||
|
||||
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-curl),)
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-curl="$(STAGING_DIR)/usr"
|
||||
else
|
||||
CONFIGURE_ARGS+= \
|
||||
--without-curl
|
||||
endif
|
||||
|
||||
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-mysql),)
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-mysqlclient="$(STAGING_DIR)/usr/bin"
|
||||
else
|
||||
CONFIGURE_ARGS+= \
|
||||
--without-mysqlclient
|
||||
endif
|
||||
|
||||
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-res-fax-spandsp),)
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-spandsp="$(STAGING_DIR)/usr"
|
||||
else
|
||||
CONFIGURE_ARGS+= \
|
||||
--without-spandsp
|
||||
endif
|
||||
|
||||
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-chan-mobile),)
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-bluetooth="$(STAGING_DIR)/usr"
|
||||
else
|
||||
CONFIGURE_ARGS+= \
|
||||
--without-bluetooth
|
||||
endif
|
||||
|
||||
ifneq ($(SDK)$(CONFIG_PACKAGE_asterisk18-mod-res-srtp),)
|
||||
CONFIGURE_ARGS+= \
|
||||
--with-srtp="$(STAGING_DIR)/usr"
|
||||
else
|
||||
CONFIGURE_ARGS+= \
|
||||
--without-srtp
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_IBOARDID),"D301")
|
||||
EXTRA_CFLAGS += -DNTR_SUPPORT
|
||||
endif
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--without-curses \
|
||||
--with-gsm=internal \
|
||||
--without-cap \
|
||||
--without-gtk \
|
||||
--without-gtk2 \
|
||||
--without-isdnnet \
|
||||
--without-kde \
|
||||
--without-misdn \
|
||||
--without-nbs \
|
||||
--with-ncurses="$(STAGING_DIR)/usr" \
|
||||
--without-netsnmp \
|
||||
--without-newt \
|
||||
--without-odbc \
|
||||
--without-ogg \
|
||||
--without-osptk \
|
||||
--with-popt="$(STAGING_DIR)/usr" \
|
||||
--without-pri \
|
||||
--without-qt \
|
||||
--without-radius \
|
||||
--without-sdl \
|
||||
--without-suppserv \
|
||||
--without-tds \
|
||||
--without-termcap \
|
||||
--without-tinfo \
|
||||
--without-vorbis \
|
||||
--without-vpb \
|
||||
--with-z="$(STAGING_DIR)/usr" \
|
||||
--with-sounds-cache="$(DL_DIR)" \
|
||||
--disable-xmldoc
|
||||
|
||||
# I've had strange errors with -fno-caller-saves
|
||||
# in global CFLAGS so revert it. /Ronny
|
||||
EXTRA_CFLAGS+= -O2 -fcaller-saves
|
||||
EXTRA_CFLAGS+= $(TARGET_CPPFLAGS)
|
||||
EXTRA_LDFLAGS+= $(TARGET_LDFLAGS)
|
||||
|
||||
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
ifneq ($(CONFIG_TARGET_lantiq),)
|
||||
$(CP) ./src-lantiq/* $(PKG_BUILD_DIR)/
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
-rm $(PKG_BUILD_DIR)/menuselect.makeopts
|
||||
$(call Build/Configure/Default,,$(SITE_VARS))
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(PKG_BUILD_DIR)" \
|
||||
include/asterisk/version.h \
|
||||
include/asterisk/buildopts.h defaults.h \
|
||||
makeopts.embed_rules
|
||||
ASTCFLAGS="$(EXTRA_CFLAGS) -DLOW_MEMORY" \
|
||||
ASTLDFLAGS="$(EXTRA_LDFLAGS)" \
|
||||
$(MAKE) -C "$(PKG_BUILD_DIR)" \
|
||||
ASTVARLIBDIR="/usr/lib/asterisk" \
|
||||
ASTDATADIR="/usr/lib/asterisk" \
|
||||
ASTKEYDIR="/usr/lib/asterisk" \
|
||||
ASTDBDIR="/usr/lib/asterisk" \
|
||||
NOISY_BUILD="1" \
|
||||
DEBUG="" \
|
||||
OPTIMIZE="" \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
all install samples
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/asterisk-1.8/include/asterisk/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk/*.h $(1)/usr/include/asterisk-1.8/include/asterisk/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/asterisk.h $(1)/usr/include/asterisk-1.8/include/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod/conffiles
|
||||
/etc/asterisk/asterisk.conf
|
||||
/etc/asterisk/modules.conf
|
||||
/etc/asterisk/extensions.conf
|
||||
/etc/asterisk/sip.conf
|
||||
/etc/asterisk/sip_notify.conf
|
||||
/etc/asterisk/features.conf
|
||||
/etc/asterisk/indications.conf
|
||||
/etc/asterisk/logger.conf
|
||||
/etc/asterisk/manager.conf
|
||||
/etc/asterisk/rtp.conf
|
||||
/etc/default/asterisk
|
||||
/etc/init.d/asterisk
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk/ssl
|
||||
for f in asterisk extensions features \
|
||||
indications logger manager modules \
|
||||
sip sip_notify rtp; do \
|
||||
$(CP) $(PKG_INSTALL_DIR)/etc/asterisk/$$$$f.conf $(1)/etc/asterisk/ ; \
|
||||
done
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
for f in app_dial app_echo app_playback app_macro \
|
||||
chan_sip res_rtp_asterisk res_rtp_multicast \
|
||||
codec_ulaw codec_gsm \
|
||||
format_gsm format_pcm format_wav format_wav_gsm \
|
||||
pbx_config \
|
||||
func_strings func_timeout func_callerid func_logic; do \
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$$$$f.so $(1)/usr/lib/asterisk/modules/ ; \
|
||||
done
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/asterisk $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/default
|
||||
$(INSTALL_DATA) ./files/asterisk.default $(1)/etc/default/asterisk
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/asterisk.init $(1)/etc/init.d/asterisk
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-sounds/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/* $(1)/usr/lib/asterisk/sounds/
|
||||
rm -f $(1)/usr/lib/asterisk/sounds/vm-*
|
||||
rm -f $(1)/usr/lib/asterisk/sounds/conf-*
|
||||
endef
|
||||
|
||||
|
||||
define Package/asterisk18-mod-voicemail/conffiles
|
||||
/etc/asterisk/voicemail.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-voicemail/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/voicemail.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*voicemail.so $(1)/usr/lib/asterisk/modules/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_adsi.so $(1)/usr/lib/asterisk/modules/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_smdi.so $(1)/usr/lib/asterisk/modules/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/vm-*.gsm $(1)/usr/lib/asterisk/sounds/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-meetme/conffiles
|
||||
/etc/asterisk/meetme.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-meetme/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/meetme.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_meetme.so $(1)/usr/lib/asterisk/modules/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/sounds/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/asterisk/sounds/en/conf-*.gsm $(1)/usr/lib/asterisk/sounds/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-iax2/conffiles
|
||||
/etc/asterisk/iax.conf
|
||||
/etc/asterisk/iaxprov.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-cdr/conffiles
|
||||
/etc/asterisk/cdr.conf
|
||||
/etc/asterisk/cdr_custom.conf
|
||||
/etc/asterisk/cdr_manager.conf
|
||||
/etc/asterisk/cdr_odbc.conf
|
||||
/etc/asterisk/cdr_pgsql.conf
|
||||
/etc/asterisk/cdr_tds.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-musiconhold/conffiles
|
||||
/etc/asterisk/musiconhold.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-iax2/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iax.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/iaxprov.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_iax2.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-cdr/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr*.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/*cdr*.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-musiconhold/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/musiconhold.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_musiconhold.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-voice/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_voice.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-gtalk/conffiles
|
||||
/etc/asterisk/gtalk.conf
|
||||
/etc/asterisk/jabber.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-gtalk/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/gtalk.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/jabber.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_gtalk.so $(1)/usr/lib/asterisk/modules/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_jabber.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-mobile/conffiles
|
||||
/etc/asterisk/chan_mobile.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-mobile/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/chan_mobile.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mobile.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-timing-timerfd/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_timing_timerfd.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-timing-pthread/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_timing_pthread.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-fax/conffiles
|
||||
/etc/asterisk/res_fax.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-fax/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/res_fax.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_fax.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-fax-spandsp/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_fax_spandsp.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-mgcp/conffiles
|
||||
/etc/asterisk/mgcp.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-mgcp/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/mgcp.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_mgcp.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-skinny/conffiles
|
||||
/etc/asterisk/skinny.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-skinny/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/skinny.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_skinny.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-brcm/conffiles
|
||||
/etc/asterisk/brcm.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-brcm/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/brcm.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_brcm.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-curl/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/func_curl.so $(1)/usr/lib/asterisk/modules/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_curl.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-transfer/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_transfer.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-softhangup/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_softhangup.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-mysql/conffiles
|
||||
/etc/asterisk/app_mysql.conf
|
||||
/etc/asterisk/res_config_mysql.conf
|
||||
/etc/asterisk/cdr_mysql.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-mysql/install
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/app_mysql.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/res_config_mysql.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/cdr_mysql.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_mysql.so $(1)/usr/lib/asterisk/modules/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/cdr_mysql.so $(1)/usr/lib/asterisk/modules/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_config_mysql.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-lantiq/conffiles
|
||||
/etc/asterisk/lantiq.conf
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-chan-lantiq/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_DIR) $(1)/etc/asterisk
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/asterisk/lantiq.conf $(1)/etc/asterisk/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/chan_lantiq.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-srtp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_srtp.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-res-stun/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/res_stun_monitor.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-app-queue/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/app_queue.so $(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
define Buildasterisk18-modModuleTemplate
|
||||
|
||||
define Package/asterisk18-mod-$(subst _,-,$(1))
|
||||
$$(call Package/asterisk18-mod/Default)
|
||||
TITLE:=$(2) support
|
||||
DEPENDS:= asterisk18-mod $(4)
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-$(subst _,-,$(1))/description
|
||||
$$(call Package/asterisk18-mod/Default/description)
|
||||
This package provides support $(3) in Asterisk.
|
||||
endef
|
||||
|
||||
define Package/asterisk18-mod-$(subst _,-,$(1))/install
|
||||
$(INSTALL_DIR) $$(1)/usr/lib/asterisk/modules
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/asterisk/modules/$(1).so $$(1)/usr/lib/asterisk/modules/
|
||||
endef
|
||||
|
||||
$$(eval $$(call BuildPackage,asterisk18-mod-$(subst _,-,$(1))))
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,asterisk18-mod))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-voicemail))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-sounds))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-app-meetme))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-app-transfer))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-app-softhangup))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-chan-iax2))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-cdr))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-res-musiconhold))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-res-voice))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-chan-gtalk))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-chan-mobile))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-res-fax))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-res-fax-spandsp))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-res-timing-timerfd))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-res-timing-pthread))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-chan-mgcp))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-chan-skinny))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-chan-brcm))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-curl))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-mysql))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-chan-lantiq))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-res-srtp))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-res-stun))
|
||||
$(eval $(call BuildPackage,asterisk18-mod-app-queue))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_authenticate,Authenticate,support for executing arbitrary authenticate commands))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_chanisavail,Channel availability check,support for checking if a channel is available))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_chanspy,Channel listen in,support for listening in on any channel))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_directed_pickup,Directed call pickup,support for directed call pickup))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_exec,Exec application,support for application execution))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_minivm,Minimal voicemail system,a voicemail system in small building blocks working together based on the Comedian Mail voicemail system))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_readexten,Extension to variable,a trivial application to read an extension into a variable))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_read,Variable read,a trivial application to read a variable))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_sayunixtime,Say Unix time,an application to say Unix time))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_sms,SMS,SMS support (ETSI ES 201 912 protocol 1)))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_stack,Stack applications, stack applications Gosub Return etc., +asterisk18-res-agi))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_system,System exec,support for executing system commands))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_talkdetect,File playback with audio detect,for file playback with audio detect))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_waituntil,Sleep,support sleeping until the given epoch))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_while,While loop,a while loop implementation))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,chan_agent,Agents proxy channel, an implementation of agents proxy channel))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,chan_local,Local proxy channel, an implementation of local proxy channel))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,codec_alaw,Signed linear to alaw translation,translation between signed linear and alaw codecs))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,codec_ulaw,Signed linear to ulaw translation,translation between signed linear and ulaw codecs))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,codec_a_mu,Alaw to ulaw translation,translation between alaw and ulaw codecs))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,codec_g722,G.722,a high bit rate 48/56/64Kbps ITU standard codec))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,codec_g726,Signed linear to G.726 translation,translation between signed linear and ITU G.726-32kbps codecs))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,codec_ilbc,iLBC,internet Low Bitrate Codec))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,codec_gsm,GSM,GSM codec))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,format_g726,G.726,support for headerless G.726 16/24/32/40kbps data format))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,format_g729,G.729,support for raw headerless G729 data))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,format_sln,Raw slinear format,support for raw slinear format))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,format_sln16,Raw slinear 16 format,support for Raw slinear 16 format))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,func_db,Database interaction,functions for interaction with the database))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,func_devstate,Blinky lights control,functions for manually controlled blinky lights))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,func_vmcount,vmcount dialplan,a vmcount dialplan function))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,func_extstate,Hinted extension state,retrieving the state of a hinted extension for dialplan control))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,func_global,Global variable,global variable dialplan functions))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,func_shell,Shell,support for shell execution))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,pbx_ael,Asterisk Extension Logic,support for symbolic Asterisk Extension Logic))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,res_ael_share,Shareable AEL code,support for shareable AEL code mainly between internal and external modules))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,pbx_spool,Call Spool,outgoing call spool support))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,res_agi,Asterisk Gateway Interface,support for the Asterisk Gateway Interface extension))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,res_crypto,Provide Crypto,Cryptographic Signature capability))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_alarmreceiver,Alarm receiver,Central Station Alarm receiver for Ademco Contact ID))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_setcallerid,Set callerid,support for setting callerid))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_verbose,Verbose logging,Verbose logging application))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,func_channel,Channel info,Channel info dialplan function))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,func_blacklist,Blacklist on callerid,looking up the callerid number and see if it is blacklisted))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_originate,Originate a call,originating an outbound call and connecting it to a specified extension or application))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,func_uri,URI encoding and decoding,Encodes and decodes URI-safe strings))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_disa,Direct Inward System Access,Direct Inward System Access))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_senddtmf,Send DTMF digits,Sends arbitrary DTMF digits))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,func_cut,CUT function,CUT function))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,res_clioriginate,Calls via CLI,Originate calls via the CLI))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_mixmonitor,Record a call and mix the audio,record a call and mix the audio during the recording))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_playtones,Playtones application,play a tone list))
|
||||
$(eval $(call Buildasterisk18-modModuleTemplate,app_record,Record sound file,to record a sound file))
|
||||
4
asterisk-1.8.x-mod/files/asterisk.default
Normal file
4
asterisk-1.8.x-mod/files/asterisk.default
Normal file
@@ -0,0 +1,4 @@
|
||||
## startup options for /etc/init.d/asterisk
|
||||
|
||||
ENABLE_ASTERISK="yes"
|
||||
OPTIONS=""
|
||||
57
asterisk-1.8.x-mod/files/asterisk.init
Normal file
57
asterisk-1.8.x-mod/files/asterisk.init
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=98
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=asterisk
|
||||
PROG=/usr/sbin/asterisk
|
||||
DEFAULT=/etc/default/asterisk
|
||||
|
||||
init_asterisk() {
|
||||
# do not start asterisk until the
|
||||
# router receives a default route
|
||||
while ! ip r | grep -q default; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
[ -f $DEFAULT ] && . $DEFAULT
|
||||
[ -d /var/run/asterisk ] || mkdir -p /var/run/asterisk
|
||||
[ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk
|
||||
[ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
|
||||
|
||||
# does the board have a fxs relay?
|
||||
local fxsRelayGpio=$(db -q get hw.board.fxsRelayGpio)
|
||||
if [ "$fxsRelayGpio" != "" ]; then
|
||||
/sbin/brcm_fw_tool set -x $fxsRelayGpio -p 1
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger voice_client
|
||||
}
|
||||
|
||||
start_service() {
|
||||
init_asterisk
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" -f
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
# service_start /usr/sbin/asterisk
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
asterisk -rx "core reload"
|
||||
asterisk -rx "dialplan reload"
|
||||
asterisk -rx "brcm reload"
|
||||
}
|
||||
|
||||
restart() {
|
||||
reload
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
service_stop /usr/sbin/asterisk
|
||||
}
|
||||
|
||||
81
bluez/Makefile
Normal file
81
bluez/Makefile
Normal file
@@ -0,0 +1,81 @@
|
||||
#
|
||||
# Copyright (C) 2006-2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bluez
|
||||
PKG_VERSION:=5.28
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/bluetooth
|
||||
PKG_MD5SUM:=bc20a8285530758c68f6a60e4ca62a15
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
define Package/bluez
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libpthread +libusb-compat +glib2 +dbus +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS)
|
||||
TITLE:=Bluetooth stack new version
|
||||
URL:=http://www.bluez.org/
|
||||
endef
|
||||
|
||||
define Package/bluez/conffiles
|
||||
/etc/config/bluetooth
|
||||
endef
|
||||
|
||||
TARGET_LDFLAGS+= \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib/libiconv-full/lib \
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-shared \
|
||||
--disable-cups \
|
||||
--enable-debug \
|
||||
--disable-test \
|
||||
--disable-obex \
|
||||
--disable-systemd \
|
||||
--disable-udev \
|
||||
--enable-tools \
|
||||
--enable-experimental \
|
||||
--enable-library \
|
||||
--disable-static \
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
LDFLAGS="$(TARGET_LDFLAGS) \
|
||||
-L$(ICONV_PREFIX)/lib \
|
||||
-L$(INTL_PREFIX)/lib -lm -lncurses" \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
all install
|
||||
endef
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/bluetooth
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/bluetooth/*.h $(1)/usr/include/bluetooth
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.* $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/bluez.pc $(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
define Package/bluez/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/bluetooth
|
||||
$(INSTALL_DIR) $(1)/etc/dbus-1/system.d
|
||||
$(CP) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/bluetooth.conf $(1)/etc/dbus-1/system.d/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bluetooth
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/* $(1)/usr/lib/bluetooth
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libblue* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bluez))
|
||||
43
bootchart2/Makefile
Normal file
43
bootchart2/Makefile
Normal file
@@ -0,0 +1,43 @@
|
||||
#
|
||||
# Copyright (C) 2007-2011 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bootchart2
|
||||
PKG_VERSION:=0.14.7
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/mmeeks/bootchart.git
|
||||
PKG_SOURCE_VERSION:=3ab81137cafe25c2ca4bc3a5f322a63646f9ce8d
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/bootchart2
|
||||
SECTION:=base
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Bootchart2
|
||||
URL:=https://github.com/mmeeks/bootchart
|
||||
endef
|
||||
|
||||
define Package/bootchart2/description
|
||||
Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process.
|
||||
endef
|
||||
|
||||
define Package/bootchart2/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bootchart-collector $(1)/sbin
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,bootchart2))
|
||||
10
bootchart2/files/lib/preinit/11_bootchart
Normal file
10
bootchart2/files/lib/preinit/11_bootchart
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
do_bootchart()
|
||||
{
|
||||
[ -f /dev/null ] || mknod /dev/null c 1 3
|
||||
mkdir -p /lib/bootchart/tmpfs
|
||||
echo "starting bootchart"
|
||||
/sbin/bootchart_run_preinit boot &
|
||||
}
|
||||
|
||||
boot_hook_add preinit_essential do_bootchart
|
||||
7
bootchart2/files/lib/preinit/72_bootchart
Normal file
7
bootchart2/files/lib/preinit/72_bootchart
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
bootchart_rootfs_pivot()
|
||||
{
|
||||
mount -o move /rom/lib/bootchart/tmpfs /lib/bootchart/tmpfs
|
||||
}
|
||||
|
||||
boot_hook_add preinit_mount_root bootchart_rootfs_pivot
|
||||
59
bootchart2/files/sbin/bootchart_run_preinit
Executable file
59
bootchart2/files/sbin/bootchart_run_preinit
Executable file
@@ -0,0 +1,59 @@
|
||||
#! /bin/sh
|
||||
# this is intended to be started in preinit.
|
||||
# 11_bootchart, starts it
|
||||
# 72_bootchart, fixup mount point after pivot
|
||||
#
|
||||
# program can be killed early with
|
||||
# bootchart_run_preinit stop
|
||||
|
||||
trap "stop; exit 0;" SIGINT SIGTERM
|
||||
|
||||
STOP_AFTER=250
|
||||
HZ=50
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "you need to specify start or stop"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
start()
|
||||
{
|
||||
/sbin/bootchart-collector $HZ &
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
echo "bootchart DUMP"
|
||||
|
||||
mkdir /tmp/bootchart
|
||||
/sbin/bootchart-collector --dump /tmp/bootchart
|
||||
cd /tmp/bootchart
|
||||
tar -zcf /tmp/bootchart.tgz header *.log
|
||||
cd /
|
||||
rm -rf /tmp/bootchart
|
||||
}
|
||||
|
||||
case $1 in
|
||||
boot) # secret option for preinit
|
||||
start
|
||||
sleep $STOP_AFTER
|
||||
# test to see if someone has manually killed us
|
||||
if [ -f /tmp/bootchart.tgz ]
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
stop
|
||||
;;
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
*)
|
||||
echo "you need to specify start or stop, not $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
40
bootchart2/patches/0001-add_spu_sys_time.patch
Normal file
40
bootchart2/patches/0001-add_spu_sys_time.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
diff --git a/pybootchartgui/draw.py b/pybootchartgui/draw.py
|
||||
index 7c3f60c..5c9f046 100644
|
||||
--- a/pybootchartgui/draw.py
|
||||
+++ b/pybootchartgui/draw.py
|
||||
@@ -63,6 +63,7 @@ AXIS_FONT_SIZE = 11
|
||||
LEGEND_FONT_SIZE = 12
|
||||
|
||||
# CPU load chart color.
|
||||
+CPU_SYS_COLOR = (0.65, 0.13, 0.36, 1.0)
|
||||
CPU_COLOR = (0.40, 0.55, 0.70, 1.0)
|
||||
# IO wait chart color.
|
||||
IO_COLOR = (0.76, 0.48, 0.48, 0.5)
|
||||
@@ -300,21 +301,19 @@ def render_charts(ctx, options, clip, trace, curr_y, w, h, sec_w):
|
||||
# render bar legend
|
||||
ctx.set_font_size(LEGEND_FONT_SIZE)
|
||||
|
||||
- draw_legend_box(ctx, "CPU (user+sys)", CPU_COLOR, off_x, curr_y+20, leg_s)
|
||||
- draw_legend_box(ctx, "I/O (wait)", IO_COLOR, off_x + 120, curr_y+20, leg_s)
|
||||
+ draw_legend_box(ctx, "CPU (user)", CPU_COLOR, off_x, curr_y+20, leg_s)
|
||||
+ draw_legend_box(ctx, "CPU (sys)", CPU_SYS_COLOR, off_x + 120, curr_y+20, leg_s)
|
||||
+ draw_legend_box(ctx, "I/O (wait)", IO_COLOR, off_x + 120 + 120 , curr_y+20, leg_s)
|
||||
|
||||
# render I/O wait
|
||||
chart_rect = (off_x, curr_y+30, w, bar_h)
|
||||
if clip_visible (clip, chart_rect):
|
||||
draw_box_ticks (ctx, chart_rect, sec_w)
|
||||
draw_annotations (ctx, proc_tree, trace.times, chart_rect)
|
||||
- draw_chart (ctx, IO_COLOR, True, chart_rect, \
|
||||
- [(sample.time, sample.user + sample.sys + sample.io) for sample in trace.cpu_stats], \
|
||||
- proc_tree, None)
|
||||
+ draw_chart (ctx, IO_COLOR, True, chart_rect, [(sample.time, sample.user + sample.sys + sample.io) for sample in trace.cpu_stats], proc_tree, None)
|
||||
# render CPU load
|
||||
- draw_chart (ctx, CPU_COLOR, True, chart_rect, \
|
||||
- [(sample.time, sample.user + sample.sys) for sample in trace.cpu_stats], \
|
||||
- proc_tree, None)
|
||||
+ draw_chart (ctx, CPU_SYS_COLOR, True, chart_rect, [(sample.time, sample.user + sample.sys) for sample in trace.cpu_stats], proc_tree, None)
|
||||
+ draw_chart (ctx, CPU_COLOR, True, chart_rect, [(sample.time, sample.user ) for sample in trace.cpu_stats], proc_tree, None)
|
||||
|
||||
curr_y = curr_y + 30 + bar_h
|
||||
|
||||
47
btle_alarm/Makefile
Normal file
47
btle_alarm/Makefile
Normal file
@@ -0,0 +1,47 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=btle_alarm
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=b505d7ae1524a213ca3de7f8ee15a7d51c6bbbd5
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/btle_alarm
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/btle_alarm
|
||||
SECTION:=base
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Ethernet bridging configuration utility
|
||||
#DESCRIPTION:=This variable is obsolete. use the Package/name/description define instead!
|
||||
URL:=http://btle_alarm.sourceforge.net/
|
||||
DEPENDS:=+bluez +libncurses
|
||||
endef
|
||||
|
||||
define Package/btle_alarm/description
|
||||
Ethernet bridging configuration utility
|
||||
Manage ethernet bridging; a way to connect networks together to
|
||||
form a larger network.
|
||||
endef
|
||||
|
||||
define Package/btle_alarm/install
|
||||
|
||||
$(CP) ./files/* $(1)/
|
||||
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/btle_alarm $(1)/sbin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/btle_alarm.conf $(1)/etc/config/btle_alarm
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/etc/init.d/* $(1)/etc/init.d/
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,btle_alarm))
|
||||
2
btle_alarm/files/btle_alarm.conf
Normal file
2
btle_alarm/files/btle_alarm.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
config info 'Device'
|
||||
option mac 'D0:39:72:B6:23:D6'
|
||||
29
btle_alarm/files/etc/init.d/btle_alarm
Executable file
29
btle_alarm/files/etc/init.d/btle_alarm
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2009 OpenWrt.org
|
||||
#
|
||||
|
||||
START=99
|
||||
|
||||
start() {
|
||||
for i in down reset up;do
|
||||
hciconfig hci0 $i
|
||||
done
|
||||
mac=`uci get btle_alarm.Device.mac`
|
||||
if [ $? -eq 0 ];then
|
||||
hcitool lewladd $mac
|
||||
else
|
||||
hcitool lewladd D0:39:72:B6:43:8A
|
||||
hcitool lewladd D0:39:72:B6:18:AA
|
||||
fi
|
||||
sleep 1
|
||||
/sbin/btle_alarm &> /dev/null &
|
||||
echo $! > /tmp/btle_alarm.pid
|
||||
}
|
||||
|
||||
stop() {
|
||||
hciconfig hci0 down
|
||||
kill -9 `cat /tmp/btle_alarm.pid`
|
||||
rm /tmp/btle_alarm.pid
|
||||
sleep 1
|
||||
}
|
||||
30
catv/Makefile
Normal file
30
catv/Makefile
Normal file
@@ -0,0 +1,30 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=catv
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/catv
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=CATV
|
||||
endef
|
||||
|
||||
define Package/catv/description
|
||||
CATV configuration utility
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/catv/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,catv))
|
||||
4
catv/files/etc/config/catv
Normal file
4
catv/files/etc/config/catv
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
config service 'catv'
|
||||
option enable 'no'
|
||||
option filter '3'
|
||||
BIN
catv/files/etc/init.d/.catv.kate-swp
Normal file
BIN
catv/files/etc/init.d/.catv.kate-swp
Normal file
Binary file not shown.
26
catv/files/etc/init.d/catv
Executable file
26
catv/files/etc/init.d/catv
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2015 inteno.org
|
||||
#
|
||||
|
||||
START=71
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
start_service() {
|
||||
local enable=0
|
||||
local filter=0
|
||||
|
||||
config_load catv
|
||||
config_get enable catv enable
|
||||
config_get filter catv filter
|
||||
ubus call catv set-enable "{\"enable\":\"$enable\"}"
|
||||
ubus call catv set-filter "{\"filter\":\"$filter\"}"
|
||||
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger catv
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=crashlog
|
||||
|
||||
66
dectmngr/Makefile
Normal file
66
dectmngr/Makefile
Normal file
@@ -0,0 +1,66 @@
|
||||
#
|
||||
# Copyright (C) 2006-2010 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.23
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/dectmngr
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=90aff0da98c626d58201c14c34b3b3a64878ceee
|
||||
PKG_NAME:=dectmngr
|
||||
|
||||
|
||||
LDFLAGS+= \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/lib
|
||||
|
||||
RSTRIP:=true
|
||||
export BUILD_DIR
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dectmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Broadcom endpoint test application
|
||||
URL:=
|
||||
DEPENDS:= +libevent2 +libjson +natalie-dect-h bcmkernel
|
||||
endef
|
||||
|
||||
define Package/dectmngr/description
|
||||
Dect proxy, manager and tools
|
||||
endef
|
||||
|
||||
|
||||
define Package/dectmngr/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/dect
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_DIR) $(1)/etc/dect/
|
||||
$(INSTALL_DIR) $(1)/etc/config/
|
||||
|
||||
cp $(PKG_BUILD_DIR)/dectmngr $(1)/usr/bin/
|
||||
cp $(PKG_BUILD_DIR)/atohx $(1)/usr/bin/
|
||||
cp $(PKG_BUILD_DIR)/dectproxy $(1)/usr/bin/
|
||||
cp $(PKG_BUILD_DIR)/dectdbgd $(1)/usr/bin/
|
||||
cp $(PKG_BUILD_DIR)/dect $(1)/usr/bin/
|
||||
cp $(PKG_BUILD_DIR)/dectcalib $(1)/usr/bin/
|
||||
cp $(PKG_BUILD_DIR)/dect_testmode $(1)/usr/bin/
|
||||
cp files/etc/init.d/* $(1)/etc/init.d/
|
||||
cp files/etc/hotplug.d/dect/* $(1)/etc/hotplug.d/dect/
|
||||
cp files/etc/dect/* $(1)/etc/dect/
|
||||
cp files/etc/config/* $(1)/etc/config/
|
||||
cp files/sbin/dectreg $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dectmngr))
|
||||
3
dectmngr/files/etc/config/dect
Executable file
3
dectmngr/files/etc/config/dect
Executable file
@@ -0,0 +1,3 @@
|
||||
config dect 'dect'
|
||||
option 'radio' 'auto'
|
||||
|
||||
BIN
dectmngr/files/etc/dect/dect_testmode.dat
Normal file
BIN
dectmngr/files/etc/dect/dect_testmode.dat
Normal file
Binary file not shown.
BIN
dectmngr/files/etc/dect/nvs_default
Normal file
BIN
dectmngr/files/etc/dect/nvs_default
Normal file
Binary file not shown.
15
dectmngr/files/etc/hotplug.d/dect/00-dectstate
Normal file
15
dectmngr/files/etc/hotplug.d/dect/00-dectstate
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$ACTION" == "led_blink" ]; then
|
||||
ubus call led.dect set '{"state":"notice"}'
|
||||
fi
|
||||
|
||||
if [ "$ACTION" == "led_on" ]; then
|
||||
ubus call led.dect set '{"state":"ok"}'
|
||||
fi
|
||||
|
||||
if [ "$ACTION" == "led_off" ]; then
|
||||
ubus call led.dect set '{"state":"off"}'
|
||||
fi
|
||||
|
||||
|
||||
60
dectmngr/files/etc/init.d/dect
Executable file
60
dectmngr/files/etc/init.d/dect
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=97
|
||||
STOP=10
|
||||
USE_PROCD=1
|
||||
|
||||
DEST=
|
||||
DEFAULT=
|
||||
OPTIONS=""
|
||||
|
||||
|
||||
start_service() {
|
||||
# avoid fp timing problem
|
||||
echo 1 > /proc/sys/kernel/printk_with_interrupt_enabled
|
||||
|
||||
# setup board specific dect parameters
|
||||
cat /proc/nvram/rfpi | tr -d ' ' | atohx > /tmp/rfpi
|
||||
cat /proc/nvram/fixed_emc | tr -d ' ' | atohx > /tmp/fixed_emc
|
||||
cat /proc/nvram/bcm_def_freq | tr -d ' ' | atohx > /tmp/bcm_def_freq
|
||||
DECTANTDIV=`db get hw.board.DectAntennaDiversity`
|
||||
case "$DECTANTDIV" in
|
||||
1|off) echo -ne "\x01" > /tmp/dect_antenna_diversity ;;
|
||||
2) echo -ne "\x02" > /tmp/dect_antenna_diversity ;;
|
||||
*) echo -ne "\x00" > /tmp/dect_antenna_diversity ;;
|
||||
esac
|
||||
|
||||
if [ ! -f /etc/dect/nvs ]; then
|
||||
cp /etc/dect/nvs_default /etc/dect/nvs
|
||||
dd of=/etc/dect/nvs if=/tmp/rfpi conv=notrunc bs=1 seek=0
|
||||
dd of=/etc/dect/nvs if=/tmp/fixed_emc conv=notrunc bs=1 seek=10
|
||||
dd of=/etc/dect/nvs if=/tmp/bcm_def_freq conv=notrunc bs=1 seek=6
|
||||
dd of=/etc/dect/nvs if=/tmp/dect_antenna_diversity conv=notrunc bs=1 seek=32
|
||||
fsync /etc/dect/nvs
|
||||
fi
|
||||
|
||||
# init dectproxy
|
||||
dectproxy > /dev/null 2>&1 &
|
||||
dectmngr > /tmp/dectmngr 2>&1 &
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
killall -9 dectproxy
|
||||
killall -9 dectmngr
|
||||
}
|
||||
|
||||
restart_service() {
|
||||
echo "restarting dect"
|
||||
killall dectmngr
|
||||
dectmngr > /tmp/dectmngr 2>&1 &
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# reload config
|
||||
dect -c
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger dect
|
||||
}
|
||||
|
||||
17
dectmngr/files/sbin/dectreg
Executable file
17
dectmngr/files/sbin/dectreg
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script is likely not used. Just exit with
|
||||
# an error and see if someone screems... If not,
|
||||
# we can delete this file.
|
||||
exit 1
|
||||
|
||||
|
||||
[ -f /var/dectisregistering ] || {
|
||||
touch /var/dectisregistering 2>/dev/null
|
||||
/usr/bin/dectmngr -r
|
||||
ubus call led.dect set '{"state" : "notice"}'
|
||||
sleep 20
|
||||
rm /var/dectisregistering 2>/dev/null
|
||||
/usr/bin/dectmngr -s
|
||||
ubus call led.dect set '{"state" : "ok"}'
|
||||
}
|
||||
53
dectmngr2/Makefile
Normal file
53
dectmngr2/Makefile
Normal file
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# Copyright (C) 2006-2010 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/dectmngr2
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ee63f0c087840adba9d944ae31d71a3ef9d64043
|
||||
PKG_NAME:=dectmngr2
|
||||
|
||||
|
||||
RSTRIP:=true
|
||||
export BUILD_DIR
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dectmngr2
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Dectmngr2
|
||||
URL:=
|
||||
DEPENDS:= +natalie-dect-h bcmkernel +libubox +ubus
|
||||
endef
|
||||
|
||||
define Package/dectmngr2/description
|
||||
Dectmngr2
|
||||
endef
|
||||
|
||||
|
||||
define Package/dectmngr2/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/dect/
|
||||
$(INSTALL_DIR) $(1)/etc/config/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dectmngr2 $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/target.bin $(1)/etc/dect/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/nvs_default $(1)/etc/dect/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dect $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dectmngr-wrapper.sh $(1)/usr/sbin/
|
||||
$(CP) ./files/dect.config $(1)/etc/config/dect
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dectmngr2))
|
||||
4
dectmngr2/files/dect.config
Normal file
4
dectmngr2/files/dect.config
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
config dect 'dect'
|
||||
option radio 'auto'
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2006-2008 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=endptcfg-open
|
||||
PKG_VERSION:=15-06-24
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://ihgsp.inteno.se/ihgsp/consumer/
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
|
||||
define Package/endptcfg-open
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Broadcom endpoint driver configuration application pre compiled for open SDK
|
||||
URL:=
|
||||
endef
|
||||
|
||||
define Package/endptcfg-open/description
|
||||
Broadcom endpoint driver configuration application pre compiled for open SDK
|
||||
endef
|
||||
|
||||
|
||||
|
||||
define Package/endptcfg-open/install
|
||||
mkdir -p $(1)/usr/bin/
|
||||
ifeq ($(CONFIG_BCM_CHIP_ID),"63138")
|
||||
$(CP) $(PKG_BUILD_DIR)/endptcfg_arm $(1)/usr/bin/endptcfg
|
||||
|
||||
else
|
||||
$(CP) $(PKG_BUILD_DIR)/endptcfg_mips $(1)/usr/bin/endptcfg
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,endptcfg-open))
|
||||
4
endptcfg/Config.in
Normal file
4
endptcfg/Config.in
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
config ENDPT_OPEN
|
||||
bool "Use pre-compiled version for Open SDK"
|
||||
default n
|
||||
92
endptcfg/Makefile
Normal file
92
endptcfg/Makefile
Normal file
@@ -0,0 +1,92 @@
|
||||
#
|
||||
# Copyright (C) 2006-2010 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=endptcfg
|
||||
PKG_VERSION:=0.2
|
||||
|
||||
PKG_SOURCE_VERSION:=1194b05278bd0945ca5c76436e56617b86871a65
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
|
||||
PKG_NAME:=endptcfg-open
|
||||
else
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=git@private.inteno.se:endptcfg
|
||||
PKG_SOURCE_PROTO:=git
|
||||
endif
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
LDFLAGS+= \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/lib
|
||||
|
||||
BCMKERNEL_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx
|
||||
export BCMKERNEL_DIR
|
||||
|
||||
TARGET_LDFLAGS += $(BCMKERNEL_DIR)/userspace/private/apps/vodsl/telephonyProfiles/telephonyProfiles.o \
|
||||
$(BCMKERNEL_DIR)/userspace/private/apps/vodsl/voip/util/log/vodslLog.o \
|
||||
$(BCMKERNEL_DIR)/userspace/private/apps/vodsl/endpoint/endpoint_user.o \
|
||||
$(BCMKERNEL_DIR)/userspace/private/apps/vodsl/bos/bos.o \
|
||||
-lpthread
|
||||
|
||||
TARGET_CFLAGS += -DFAKE_SSP
|
||||
|
||||
RSTRIP:=true
|
||||
export BUILD_DIR
|
||||
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/endptcfg
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Broadcom endpoint driver configuration application
|
||||
URL:=
|
||||
DEPENDS:=+libpthread bcmkernel
|
||||
endef
|
||||
|
||||
define Package/endptcfg/description
|
||||
Broadcom endpoint driver configuration application
|
||||
endef
|
||||
|
||||
define Package/endptcfg/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
ifneq ($(CONFIG_ENDPT_OPEN),y)
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
$(TARGET_CONFIGURE_OPTS) LINUX_DIR=$(LINUX_DIR) LDFLAGS="$(TARGET_LDFLAGS)" CFLAGS="$(TARGET_CFLAGS) \
|
||||
-I$(LINUX_DIR)/include \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-DRS_ENDIAN_TYPE=RS_BIG_ENDIAN \
|
||||
-DBOS_OS_LINUXUSER -DBOS_CFG_TIME \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/broadcom/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/voice_res_gw/endpt/inc \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/voice_res_gw/inc \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/voice_res_gw/codec \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/xchg_common/bos/publicInc \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/voice_res_gw/casCtl/inc \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/xchg_drivers/inc \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/private/apps/vodsl/voip/inc \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/xChange/dslx_common/xchg_common/bos/LinuxUser"
|
||||
endef
|
||||
else
|
||||
define Build/Compile
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/endptcfg/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
cp $(PKG_BUILD_DIR)/endptcfg $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,endptcfg))
|
||||
3
gigaset-elements/.gitignore
vendored
Normal file
3
gigaset-elements/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
git-src
|
||||
|
||||
65
gigaset-elements/Makefile
Normal file
65
gigaset-elements/Makefile
Normal file
@@ -0,0 +1,65 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gigaset-elements
|
||||
|
||||
PKG_VERSION:=2.4.2
|
||||
# PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_GIGASET_ELEMENTS_SRC_URL ?= git@public.inteno.se:gigaset-elements.git
|
||||
PKG_GIGASET_ELEMENTS_VERSION ?= v$(PKG_VERSION)
|
||||
|
||||
PKG_SOURCE_URL:=$(PKG_GIGASET_ELEMENTS_SRC_URL)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=$(PKG_GIGASET_ELEMENTS_VERSION)
|
||||
|
||||
|
||||
PKG_MAINTAINER:=Magier Marcin, Figlarek Piotr
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
######################################################
|
||||
|
||||
define Package/gigaset-elements
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libjson-c +libcurl
|
||||
TITLE:=Gigaset elements
|
||||
endef
|
||||
|
||||
######################################################
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) all
|
||||
endef
|
||||
|
||||
|
||||
|
||||
define Package/gigaset-elements/install
|
||||
$(CP) -r $(PKG_BUILD_DIR)/sysroot_common/* $(1)/
|
||||
$(CP) -r $(PKG_BUILD_DIR)/sysroot_$(CONFIG_ARCH)/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
|
||||
define Package/gigaset-elements/preinst
|
||||
#!/bin/sh
|
||||
mkdir -p $${IPKG_INSTROOT}/usr/gigaset/data/cert
|
||||
mkdir -p $${IPKG_INSTROOT}/usr/gigaset/data/fw
|
||||
endef
|
||||
|
||||
|
||||
define Package/gigaset-elements/postrm
|
||||
#!/bin/sh
|
||||
rm -rf $${IPKG_INSTROOT}/usr/gigaset/data
|
||||
rm -rf /usr/share/gigaset
|
||||
endef
|
||||
|
||||
|
||||
######################################################
|
||||
|
||||
$(eval $(call BuildPackage,gigaset-elements))
|
||||
|
||||
4
ice-client/Config.in
Normal file
4
ice-client/Config.in
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
config ICE_OPEN
|
||||
bool "Use pre-compiled version for Open SDK"
|
||||
default n
|
||||
@@ -15,19 +15,28 @@ export PLATFORM_INCLUDE:=platforms/iopsys/build.mk
|
||||
|
||||
export DATE:=$(shell date +%Y-%m-%d-%H-%M-%S)
|
||||
export LOGIN:=$(shell whoami)
|
||||
BASE_PKG_VERSION:=3.4.0
|
||||
PKG_RELEASE:=RC6
|
||||
BASE_PKG_VERSION:=3.4.1
|
||||
PKG_RELEASE:=RC11
|
||||
PKG_VERSION:=$(BASE_PKG_VERSION)-$(PKG_RELEASE)_$(DATE)_$(LOGIN)
|
||||
export PKG_VERSION
|
||||
|
||||
###########################--RELEASE--################################
|
||||
|
||||
PKG_SOURCE_URL:=ssh://git@iopsys.inteno.se/ice-client.git
|
||||
PKG_SOURCE_VERSION:=e860a7697ac8d6029cd1f75e1df9885e1d4131f5
|
||||
PKG_SOURCE_URL:=ssh://git@private.inteno.se/ice-client.git
|
||||
PKG_SOURCE_VERSION:=184d29446fe6103f567c968bf35569625326a82c
|
||||
ifeq ($(CONFIG_ICE_OPEN),y)
|
||||
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(BRCM_KERNEL_PROFILE)-$(BASE_PKG_VERSION)$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
#PKG_NAME:=ice-client-open
|
||||
else
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@private.inteno.se:ice-client.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(BASE_PKG_VERSION)-$(PKG_RELEASE).tar.gz
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
endif
|
||||
|
||||
|
||||
###########################--RELEASE--################################
|
||||
@@ -44,7 +53,11 @@ define Package/ice-client
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=ice-client
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libstdcpp +libubus +ubus +ubusd +jshn +libubox +libpthread +libjson-c
|
||||
DEPENDS:=+libopenssl +libstdcpp +libubus +ubus +ubusd +jshn +libubox +libpthread
|
||||
endef
|
||||
|
||||
define Package/ice-client/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
###########################--DEVELOPMENT--################################
|
||||
@@ -52,7 +65,7 @@ endef
|
||||
# Uncomment stuff Build/Prepare
|
||||
#
|
||||
# Plus make sure to comment and provide the following lines above
|
||||
# #PKG_SOURCE_URL:=ssh://git@iopsys.inteno.se/ice-client.git
|
||||
# #PKG_SOURCE_URL:=ssh://git@private.inteno.se/ice-client.git
|
||||
# #PKG_SOURCE_VERSION:=a11bf64e6b1054803b52750aabd71bf440ff6e16
|
||||
# #PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
# #PKG_SOURCE:=$(PKG_NAME)-$(BASE_PKG_VERSION)-$(PKG_RELEASE).tar.gz
|
||||
@@ -84,6 +97,10 @@ endef
|
||||
# command to copy the binary file from its current location (in our case the build
|
||||
# directory) to the install directory.
|
||||
|
||||
ifeq ($(CONFIG_ICE_OPEN),y)
|
||||
define Build/Compile
|
||||
endef
|
||||
else
|
||||
define Build/Configure
|
||||
echo $(BASE_PKG_VERSION)-$(PKG_RELEASE) > $(PKG_BUILD_DIR)/core/version.txt
|
||||
echo $(DATE) > $(PKG_BUILD_DIR)/core/date.txt
|
||||
@@ -94,21 +111,37 @@ endef
|
||||
define Build/Clean
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) clean
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/ice-client/preinst
|
||||
#!/bin/sh
|
||||
echo "backup current config"
|
||||
cp /etc/iopsys/server.ini /tmp/iopsysserver.ini
|
||||
cp /etc/config/ice /tmp/ice.back
|
||||
if [ -f "/etc/iopsys/server.ini" ]; then
|
||||
cp /etc/iopsys/server.ini /tmp/iopsysserver.ini
|
||||
fi
|
||||
if [ -f "/etc/config/ice" ]; then
|
||||
cp /etc/config/ice /tmp/ice.back
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_ICE_OPEN),y)
|
||||
define Package/ice-client/install
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/usr
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/* $(1)/bin/
|
||||
$(CP) $(PKG_BUILD_DIR)/etc/* $(1)/etc/
|
||||
$(CP) $(PKG_BUILD_DIR)/usr/* $(1)/usr/
|
||||
endef
|
||||
else
|
||||
define Package/ice-client/install
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/core/ice $(1)/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/modules/system/ubusevent/obj/iopsys/ubusevent $(1)/bin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/{systemService.so.1.0.1,libconfStore.so.1,networkService.so.1.0.1,packageService.so.1.0.1,monitorService.so.1.0.1,iperfService.so.1.0.1,logService.so.1.0.1} $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/{systemService.so.1.0.1,libconfStore.so.1,networkService.so.1.0.1,packageService.so.1.0.1,monitorService.so.1.0.1,iperfService.so.1.0.1,logService.so.1.0.1,texecService.so.1.0.1} $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/wsice/obj/iopsys/libwsice.so $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/bin/ifs/iperf/execute
|
||||
$(INSTALL_DIR) $(1)/bin/ifs/iperf/progress
|
||||
$(INSTALL_DIR) $(1)/bin/ifs/iperf/result
|
||||
@@ -124,6 +157,7 @@ define Package/ice-client/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/ice-client $(1)/etc/init.d/ice-client
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/ice-client/postinst
|
||||
#!/bin/sh
|
||||
@@ -132,14 +166,14 @@ cp /tmp/iopsysserver.ini /etc/iopsys/server.ini
|
||||
rm -f /tmp/iopsysserver.ini
|
||||
cp /tmp/ice.back /etc/config/ice
|
||||
rm -f /tmp/ice.back
|
||||
if [ -f "/etc/rc.d/S99ice-client" ]; then
|
||||
/etc/init.d/ice-client start
|
||||
if [ -f "/etc/rc.d/S98ice-client" ]; then
|
||||
/etc/init.d/ice-client restart
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# Additional modules
|
||||
|
||||
ifneq ($(CONFIG_ICE_OPEN),y)
|
||||
# Camerawatch
|
||||
define Package/ice-client-camerawatch
|
||||
$(call Package/ice-client/Default)
|
||||
@@ -452,7 +486,7 @@ endef
|
||||
define Package/ice-client-fileme
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=FileMe
|
||||
DEPENDS+= +lighttpd +samba2-client
|
||||
DEPENDS+= +lighttpd +lighttpd-mod-webdav +lighttpd-mod-setenv +lighttpd-mod-userdir +samba2-client +samba2-common +libpcre +libltdl +libxml2
|
||||
endef
|
||||
|
||||
define Package/ice-client-fileme/description
|
||||
@@ -853,11 +887,89 @@ fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# texec
|
||||
define Package/ice-client-texec
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=texec
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-texec/description
|
||||
remote script execution module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-texec/prerm
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=texec" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-texec/preinst
|
||||
#!/bin/sh
|
||||
if [ ! -f "/tmp/ice.pid" ] ; then exit 0 ; fi
|
||||
PROC_ID=$$(cat /tmp/ice.pid)
|
||||
PROC_EXISTS=$$(/usr/bin/pgrep -P $${PROC_ID})
|
||||
if [ -n "$$PROC_EXISTS" ]; then
|
||||
read -t 1 <>/tmp/cfout
|
||||
echo "system moduleRemove topic=tExecMgr" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-texec/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/texecService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-texec/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=texecService.so.1.0.1" package="ice-client-texec" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# bmspeedtest
|
||||
define Package/ice-client-bcmspeedmgr
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=bcmspeedmgr
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-bcmspeedmgr/description
|
||||
bcmspeedmgr module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-bcmspeedmgr/install
|
||||
$(INSTALL_DIR) $(1)/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/daemons/bcmspeedmgr/obj/iopsys/bcmspeedmgr $(1)/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/daemons/bcmspeedmgr/obj/iopsys/speedsvc $(1)/bin
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(CP) $(PKG_BUILD_DIR)/platforms/iopsys/bcmspeedtestservice $(1)/etc/init.d/bcmspeedtestservice
|
||||
endef
|
||||
|
||||
define Package/ice-client-bcmspeedmgr/postinst
|
||||
#!/bin/sh
|
||||
/etc/init.d/bcmspeedtestservice stop
|
||||
/etc/init.d/bcmspeedtestservice start
|
||||
exit 0
|
||||
endef
|
||||
|
||||
endif
|
||||
|
||||
# This line executes the necessary commands to compile our program.
|
||||
# The above define directives specify all the information needed, but this
|
||||
# line calls BuildPackage which in turn actually uses this information to
|
||||
# build a package.
|
||||
$(eval $(call BuildPackage,ice-client))
|
||||
ifneq ($(CONFIG_ICE_OPEN),y)
|
||||
$(eval $(call BuildPackage,ice-client-guest))
|
||||
$(eval $(call BuildPackage,ice-client-camerawatch))
|
||||
$(eval $(call BuildPackage,ice-client-openvpn))
|
||||
@@ -872,3 +984,6 @@ $(eval $(call BuildPackage,ice-client-rework))
|
||||
$(eval $(call BuildPackage,ice-client-sip))
|
||||
$(eval $(call BuildPackage,ice-client-monitor))
|
||||
$(eval $(call BuildPackage,ice-client-gigaset))
|
||||
$(eval $(call BuildPackage,ice-client-texec))
|
||||
$(eval $(call BuildPackage,ice-client-bcmspeedmgr))
|
||||
endif
|
||||
|
||||
46
icgroupd/Makefile
Normal file
46
icgroupd/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# Copyright (C) 2016 Inteno Broadband AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icgroupd
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=0
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_MAINTAINER:=Inteno Broadband AB
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/icgroupd
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
TITLE:=Inteno cgroup daemon
|
||||
DEPENDS:=+uci +busybox
|
||||
endef
|
||||
|
||||
define Package/icgroupd/description
|
||||
This package contains Intenos cgroup daemon and associated
|
||||
configuration and startup scripts.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/icgroupd/install
|
||||
$(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d $(1)/etc/config
|
||||
|
||||
$(INSTALL_CONF) ./files/cgroups.config $(1)/etc/config/cgroups
|
||||
$(INSTALL_BIN) ./files/cgroups.init $(1)/etc/init.d/cgroups
|
||||
$(INSTALL_BIN) ./files/cgroupd $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,icgroupd))
|
||||
|
||||
76
icgroupd/files/cgroupd
Executable file
76
icgroupd/files/cgroupd
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/bin/sh
|
||||
|
||||
CGBASEDIR=$1
|
||||
CGCONFIG=$2
|
||||
[ -n "$CGBASEDIR" -a -n "$CGCONFIG" ] || exit 1
|
||||
|
||||
[ -r /lib/functions.sh ] || exit 1
|
||||
. /lib/functions.sh
|
||||
|
||||
CGPROCMAP=/tmp/cgprocmap
|
||||
CGPERIOD=3s
|
||||
|
||||
DBGLOG=/tmp/cgroupd.log
|
||||
DEBUG=0
|
||||
|
||||
|
||||
add_to_procmap () {
|
||||
local name_grp=$1
|
||||
local name grp
|
||||
|
||||
name=$(echo $name_grp |awk -F= '{print $1}')
|
||||
grp=$(echo $name_grp |awk -F= '{print $2}')
|
||||
|
||||
echo "($name) $grp" >> $CGPROCMAP
|
||||
}
|
||||
|
||||
# Read configuration file and create process:group look-up table
|
||||
# in /tmp file
|
||||
read_config () {
|
||||
local enab
|
||||
|
||||
config_load $CGCONFIG
|
||||
|
||||
config_get enab cgroups enabled "1"
|
||||
[ $enab -eq 0 ] && exit 1
|
||||
|
||||
config_get CGDEFGROUP cgroups defgroup "_undef_"
|
||||
[ "$CGDEFGROUP" == "_undef_" ] && exit 1
|
||||
[ "$DEBUG" == "1" ] && echo "default $CGDEFGROUP" >> $DBGLOG
|
||||
|
||||
echo -n '' > $CGPROCMAP
|
||||
config_list_foreach procmap procmap add_to_procmap
|
||||
[ "$DEBUG" == "1" ] && cat $CGPROCMAP >> $DBGLOG
|
||||
}
|
||||
|
||||
# Move all process except init from cgroup root to cgroups according
|
||||
# to /tmp look-up table
|
||||
move_wild_procs () {
|
||||
local wild_procs=$(cat $CGBASEDIR/cgroup.procs)
|
||||
local pid name grp
|
||||
|
||||
for pid in $wild_procs; do
|
||||
|
||||
[ $pid -eq 1 ] && continue
|
||||
if [ -d /proc/$pid ]; then
|
||||
|
||||
name=$(awk '{print $2}' /proc/$pid/stat)
|
||||
grp=$(awk "\$1==\"$name\" {print \$2}" $CGPROCMAP)
|
||||
|
||||
[ "$grp" == "." ] && continue
|
||||
[ -n "$grp" ] || grp=$CGDEFGROUP
|
||||
|
||||
[ "$DEBUG" == "1" ] && \
|
||||
echo "Moving proc $pid $name to $grp" >> $DBGLOG
|
||||
echo $pid > $CGBASEDIR/$grp/cgroup.procs
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
[ "$DEBUG" == "1" ] && echo "$0 started $(date)" >> $DBGLOG
|
||||
read_config
|
||||
while true; do
|
||||
move_wild_procs
|
||||
sleep $CGPERIOD
|
||||
done
|
||||
48
icgroupd/files/cgroups.config
Normal file
48
icgroupd/files/cgroups.config
Normal file
@@ -0,0 +1,48 @@
|
||||
config cgroups cgroups
|
||||
option enabled 1
|
||||
option defgroup iopsys/normal
|
||||
|
||||
config cgroup _root_
|
||||
# list option cpu.rt_runtime_us=50000
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys
|
||||
list option cpu.shares=4096
|
||||
# list option cpu.rt_runtime_us=40000
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys_normal
|
||||
list option cpu.shares=1024
|
||||
# list option cpu.rt_runtime_us=10000
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys_high
|
||||
list option cpu.shares=4096
|
||||
# list option cpu.rt_runtime_us=30000
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt
|
||||
list option cpu.shares=1024
|
||||
# list option cpu.rt_runtime_us=10000
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt_normal
|
||||
list option cpu.shares=1024
|
||||
# list option cpu.rt_runtime_us=2500
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt_high
|
||||
list option cpu.shares=4096
|
||||
# list option cpu.rt_runtime_us=7500
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config procmap procmap
|
||||
list procmap kthreadd=.
|
||||
list procmap minidlna=3prt/normal
|
||||
|
||||
93
icgroupd/files/cgroups.init
Executable file
93
icgroupd/files/cgroups.init
Executable file
@@ -0,0 +1,93 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=01
|
||||
USE_PROCD=1
|
||||
PROCD_DEBUG=1
|
||||
NAME=cgroupd
|
||||
|
||||
CGBASEDIR=/sys/fs/cgroup
|
||||
CGCONFIG="cgroups"
|
||||
|
||||
DBGLOG=/tmp/cginit.log
|
||||
DEBUG=0
|
||||
|
||||
|
||||
cgroupinit_set_knob_value () {
|
||||
local knob_val=$1
|
||||
local dir=$2
|
||||
local knob val
|
||||
|
||||
knob=$(echo $knob_val |awk -F= '{print $1}')
|
||||
val=$(echo $knob_val |awk -F= '{print $2}')
|
||||
/bin/echo $val > $CGBASEDIR/$dir/$knob
|
||||
[ "$DEBUG" == "1" ] && \
|
||||
echo "/bin/echo $val > $CGBASEDIR/$dir/$knob (ret=$?)" >> $DBGLOG
|
||||
}
|
||||
|
||||
cgroupinit_create_group () {
|
||||
local cgrp=$1
|
||||
local dir
|
||||
|
||||
[ "$DEBUG" == "1" ] && echo "Create group $cgrp:" >> $DBGLOG
|
||||
if [ "$cgrp" == "_root_" ]; then
|
||||
dir=.
|
||||
else
|
||||
dir=$(echo $cgrp |tr '_' '/')
|
||||
|
||||
if [ ! -d $CGBASEDIR/$dir ]; then
|
||||
mkdir $CGBASEDIR/$dir
|
||||
[ "$DEBUG" == "1" ] && \
|
||||
echo "mkdir $CGBASEDIR/$dir (ret=$?)" >> $DBGLOG
|
||||
fi
|
||||
fi
|
||||
|
||||
config_list_foreach $cgrp option cgroupinit_set_knob_value $dir
|
||||
}
|
||||
|
||||
cgroupinit_configure_cgroups () {
|
||||
local enab defgrp
|
||||
|
||||
[ "$DEBUG" == "1" ] && echo "$0 started $(date)" >> $DBGLOG
|
||||
config_load $CGCONFIG
|
||||
|
||||
config_get enab cgroups enabled "1"
|
||||
[ $enab -eq 0 ] && return 1
|
||||
|
||||
config_get defgrp cgroups defgroup "_undef_"
|
||||
[ "$defgrp" == "_undef_" ] && return 1
|
||||
|
||||
if ! grep -q " $CGBASEDIR cgroup " /proc/mounts; then
|
||||
mount -t cgroup -o nodev,noexec,nosuid cgroup $CGBASEDIR
|
||||
[ $? -eq 0 ] || return 1
|
||||
fi
|
||||
|
||||
config_foreach cgroupinit_create_group cgroup
|
||||
return 0
|
||||
}
|
||||
|
||||
start_service () {
|
||||
cgroupinit_configure_cgroups
|
||||
[ $? -eq 0 ] || return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /sbin/cgroupd $CGBASEDIR $CGCONFIG
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service () {
|
||||
local cgdir procs prc
|
||||
|
||||
for cgdir in $(find $CGBASEDIR -type d -mindepth 1 -depth); do
|
||||
procs=$(cat $cgdir/cgroup.procs)
|
||||
for prc in $procs; do
|
||||
echo $prc > $CGBASEDIR/cgroup.procs
|
||||
done
|
||||
rmdir $cgdir
|
||||
done
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger $CGCONFIG
|
||||
}
|
||||
|
||||
@@ -15,10 +15,31 @@ config CWMP_ACS_HDM
|
||||
bool "HDM"
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "Select Data Model"
|
||||
default tr098
|
||||
|
||||
config DATAMODEL_TR098
|
||||
bool "TR-098"
|
||||
|
||||
config DATAMODEL_TR181
|
||||
bool "TR-181"
|
||||
endchoice
|
||||
|
||||
config CWMP_DEBUG
|
||||
bool "Compile with debug options"
|
||||
default y
|
||||
|
||||
choice
|
||||
prompt "enable xmpp feature"
|
||||
default disable
|
||||
|
||||
config XMPP_DISABLE
|
||||
bool "disable"
|
||||
|
||||
config XMPP_ENABLE
|
||||
bool "enable"
|
||||
endchoice
|
||||
config CWMP_DEVEL_DEBUG
|
||||
bool "Compile with development debug options"
|
||||
default n
|
||||
|
||||
18
icwmp/Makefile
Normal file → Executable file
18
icwmp/Makefile
Normal file → Executable file
@@ -8,15 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=3.0-2015-11-10
|
||||
PKG_VERSION:=3.0-2016-07-07
|
||||
PKG_FIXUP:=autoreconf
|
||||
ifeq ($(CONFIG_BCM_OPEN),y)
|
||||
PKG_SOURCE_URL:=http://ihgsp.inteno.se/git/freecwmp.git
|
||||
else
|
||||
PKG_SOURCE_URL:=ssh://git@iopsys.inteno.se/freecwmp.git
|
||||
endif
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8d34c241548a21b6462df5d16906824685fe916c
|
||||
PKG_SOURCE_VERSION:=6fac1df3418d727388162d5e006c7a756c9ff8d2
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -38,7 +34,7 @@ define Package/icwmp/Default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=CWMP client
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libexpat +curl
|
||||
endef
|
||||
|
||||
define Package/icwmp/description
|
||||
@@ -72,7 +68,7 @@ endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
|
||||
ifneq ($(CWMP_REVISION)_,_)
|
||||
ifneq ($(CWMP_REVISION),exported)
|
||||
ifneq ($(CWMP_REVISION),Unversioned directory)
|
||||
@@ -90,6 +86,9 @@ CONFIGURE_ARGS += \
|
||||
--with-libubox-include-path=$(STAGING_DIR)/usr/include \
|
||||
--with-libubus-include-path=$(STAGING_DIR)/usr/include
|
||||
|
||||
CONFIGURE_ARGS += $(if $(CONFIG_DATAMODEL_TR181),--enable-datamodel=tr181,--enable-datamodel=tr098)
|
||||
CONFIGURE_ARGS += $(if $(CONFIG_XMPP_ENABLE),--enable-xmpp=enable,--enable-xmpp=disable)
|
||||
|
||||
ifeq ($(BUILD_VARIANT),zstream)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-http=zstream \
|
||||
@@ -140,7 +139,6 @@ ifeq ($(CONFIG_CWMP_SCRIPTS_FULL),y)
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/icwmp.sh $(1)/usr/sbin/icwmp
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/iwepkeygen $(1)/usr/sbin/iwepkeygen
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/watchicwmpd.sh $(1)/usr/sbin/watchicwmpd
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
57
inotify-tools/Makefile
Normal file
57
inotify-tools/Makefile
Normal file
@@ -0,0 +1,57 @@
|
||||
#
|
||||
# Copyright (C) 2006-2010 OpenWrt.org
|
||||
#
|
||||
# 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:=inotify-tools
|
||||
PKG_VERSION:=3.14
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=1df9af4d6cd0f4af4b1b19254bcf056aed4ae395
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/rvoicilas/inotify-tools.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
# 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/inotify-tools
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Tools to trace filesystem events.
|
||||
URL:=
|
||||
endef
|
||||
|
||||
define Package/inotify-tools/description
|
||||
Tools to trace filesystem events.
|
||||
endef
|
||||
|
||||
define Package/inotify-tools/install
|
||||
$(INSTALL_DIR) $(1)/usr
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/usr/lib/
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libinotifytools.so.0.4.1 $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libinotifytools.so.0 $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libinotifytools.so $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/inotifywait $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/inotifywatch $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,inotify-tools))
|
||||
13
inotify-tools/files/usr/bin/iop_write_monitor
Executable file
13
inotify-tools/files/usr/bin/iop_write_monitor
Executable file
@@ -0,0 +1,13 @@
|
||||
#! /bin/sh
|
||||
|
||||
# is the real root mounted ?
|
||||
if [ ! -f /tmp/inotify_real_root/etc/preinit ]
|
||||
then
|
||||
ubivol=$( cat /proc/cmdline | sed -e "s/.*root=\(ubi:rootfs_.\).*/\1/" )
|
||||
mkdir /tmp/inotify_real_root
|
||||
mount -t ubifs $ubivol /tmp/inotify_real_root
|
||||
fi
|
||||
|
||||
inotifywait -r -m -e modify -e create -e attrib -e delete -e move /tmp/inotify_real_root
|
||||
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2012 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=inteno-configs
|
||||
|
||||
PKG_VERSION:=1.0
|
||||
PKG_SOURCE_URL:=git@iopsys.inteno.se:inteno-configs.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e6836dbc3dde40eba661b3c37d5f5d0cc6f2e5d0
|
||||
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
######################################
|
||||
|
||||
define NewConfig
|
||||
define Package/$(1)/install
|
||||
$(INSTALL_DIR) $$(1)/etc/config
|
||||
$(INSTALL_DIR) $$(1)/etc/uci-defaults
|
||||
$(CP) $(PKG_BUILD_DIR)/$(1)/etc/config/* $$(1)/etc/config/ | true
|
||||
$(CP) $(PKG_BUILD_DIR)/$(1)/etc/uci-defaults/* $$(1)/etc/uci-defaults | true
|
||||
endef
|
||||
|
||||
define Package/$(1)
|
||||
SECTION:=configs
|
||||
CATEGORY:=Configurations
|
||||
TITLE:=$(1)
|
||||
endef
|
||||
|
||||
endef
|
||||
|
||||
|
||||
define AddConfig
|
||||
$(eval $(call NewConfig,$(1)))
|
||||
$(eval $(call BuildPackage,$(1)))
|
||||
endef
|
||||
|
||||
######################################
|
||||
|
||||
$(eval $(call AddConfig,conf-common-inteno))
|
||||
$(eval $(call AddConfig,conf-caiman-inteno))
|
||||
|
||||
|
||||
34
iop/Makefile
Normal file
34
iop/Makefile
Normal file
@@ -0,0 +1,34 @@
|
||||
#
|
||||
# Copyright (C) 2006-2011 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iop
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/iop
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=iop utilities
|
||||
endef
|
||||
|
||||
define Package/iop/description
|
||||
This package contains Intenos Iop utilities
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/iop/install
|
||||
true
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,iop))
|
||||
194
iop/configs/config
Normal file
194
iop/configs/config
Normal file
@@ -0,0 +1,194 @@
|
||||
CONFIG_BUILD_NLS=y
|
||||
CONFIG_BUSYBOX_CUSTOM=y
|
||||
CONFIG_CCACHE=y
|
||||
CONFIG_DEBUG=y
|
||||
CONFIG_DEVEL=y
|
||||
CONFIG_LOCALMIRROR="http://mirror.inteno.se/mirror"
|
||||
CONFIG_PACKAGE_4g-support=y
|
||||
CONFIG_PACKAGE_6in4=y
|
||||
CONFIG_PACKAGE_6rd=y
|
||||
CONFIG_PACKAGE_6to4=y
|
||||
CONFIG_PACKAGE_6tunnel=y
|
||||
CONFIG_PACKAGE_alsa-lib=y
|
||||
CONFIG_PACKAGE_bind-host=y
|
||||
CONFIG_PACKAGE_chat=y
|
||||
CONFIG_PACKAGE_comgt=y
|
||||
CONFIG_PACKAGE_crashlog=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_ds-lite=y
|
||||
CONFIG_PACKAGE_gdb=m
|
||||
CONFIG_PACKAGE_gdbserver=m
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_glib2=y
|
||||
CONFIG_PACKAGE_ice-client=y
|
||||
CONFIG_PACKAGE_ice-client-camerawatch=m
|
||||
CONFIG_PACKAGE_ice-client-fileme=m
|
||||
CONFIG_PACKAGE_ice-client-gigaset=m
|
||||
CONFIG_PACKAGE_ice-client-guest=m
|
||||
CONFIG_PACKAGE_ice-client-iperf=m
|
||||
CONFIG_PACKAGE_ice-client-logreader=m
|
||||
CONFIG_PACKAGE_ice-client-monitor=m
|
||||
CONFIG_PACKAGE_ice-client-netrounds=m
|
||||
CONFIG_PACKAGE_ice-client-rshell=m
|
||||
CONFIG_PACKAGE_ice-client-texec=m
|
||||
# CONFIG_PACKAGE_icgroupd is not set
|
||||
CONFIG_PACKAGE_icwmp-curl=y
|
||||
CONFIG_PACKAGE_iperf-mt=y
|
||||
CONFIG_PACKAGE_ipset=y
|
||||
CONFIG_PACKAGE_iup=y
|
||||
CONFIG_PACKAGE_iwatchdog=y
|
||||
CONFIG_PACKAGE_juci=y
|
||||
CONFIG_PACKAGE_juci-broadcom-dsl=y
|
||||
CONFIG_PACKAGE_juci-broadcom-ethernet=y
|
||||
CONFIG_PACKAGE_juci-broadcom-iptv=y
|
||||
CONFIG_PACKAGE_juci-broadcom-pwrmgmt=y
|
||||
CONFIG_PACKAGE_juci-broadcom-vlan=y
|
||||
CONFIG_PACKAGE_juci-broadcom-wl=y
|
||||
CONFIG_PACKAGE_juci-broadcom-xdsl=y
|
||||
CONFIG_PACKAGE_juci-ddns=y
|
||||
CONFIG_PACKAGE_juci-diagnostics=y
|
||||
CONFIG_PACKAGE_juci-dnsmasq-dhcp=y
|
||||
CONFIG_PACKAGE_juci-dropbear=y
|
||||
CONFIG_PACKAGE_juci-ethernet=y
|
||||
CONFIG_PACKAGE_juci-event=y
|
||||
CONFIG_PACKAGE_juci-firewall-fw3=y
|
||||
CONFIG_PACKAGE_juci-icwmp=y
|
||||
CONFIG_PACKAGE_juci-igmpinfo=y
|
||||
CONFIG_PACKAGE_juci-inteno-backup=y
|
||||
CONFIG_PACKAGE_juci-inteno-multiwan=y
|
||||
CONFIG_PACKAGE_juci-inteno-provisioning=y
|
||||
CONFIG_PACKAGE_juci-inteno-router=y
|
||||
CONFIG_PACKAGE_juci-inteno-qos=y
|
||||
CONFIG_PACKAGE_juci-inteno-voice-client=y
|
||||
CONFIG_PACKAGE_juci-macdb=y
|
||||
CONFIG_PACKAGE_juci-minidlna=y
|
||||
CONFIG_PACKAGE_juci-mod-status=y
|
||||
CONFIG_PACKAGE_juci-mod-system=y
|
||||
CONFIG_PACKAGE_juci-natalie-dect=y
|
||||
CONFIG_PACKAGE_juci-netmode=y
|
||||
CONFIG_PACKAGE_juci-network-netifd=y
|
||||
CONFIG_PACKAGE_juci-printer=y
|
||||
CONFIG_PACKAGE_juci-samba=y
|
||||
CONFIG_PACKAGE_juci-simple-gui=y
|
||||
CONFIG_PACKAGE_juci-snmpd=y
|
||||
CONFIG_PACKAGE_juci-sysupgrade=y
|
||||
CONFIG_PACKAGE_juci-theme-inteno=y
|
||||
CONFIG_PACKAGE_juci-ubus-core=y
|
||||
CONFIG_PACKAGE_juci-upnp=y
|
||||
CONFIG_PACKAGE_juci-usb=y
|
||||
CONFIG_PACKAGE_juci-utils=y
|
||||
# CONFIG_PACKAGE_kmod-ipt-nathelper is not set
|
||||
CONFIG_PACKAGE_kmod-nls-base=y
|
||||
CONFIG_PACKAGE_kmod-siit=y
|
||||
CONFIG_PACKAGE_layer2interface=y
|
||||
CONFIG_PACKAGE_ldd=y
|
||||
# CONFIG_PACKAGE_libcgroup=y
|
||||
# CONFIG_PACKAGE_libcgroup-daemon=y
|
||||
CONFIG_PACKAGE_libdaemon=y
|
||||
CONFIG_PACKAGE_libffmpeg-mini=y
|
||||
CONFIG_PACKAGE_libgmp=y
|
||||
CONFIG_PACKAGE_libreadline=y
|
||||
CONFIG_PACKAGE_minidlna=y
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_mtd-utils=y
|
||||
CONFIG_PACKAGE_mtd-utils-deubinize=y
|
||||
CONFIG_PACKAGE_mtd-utils-imagewrite=y
|
||||
CONFIG_PACKAGE_mtd-utils-mkfs.jffs2=y
|
||||
CONFIG_PACKAGE_mtd-utils-nanddump=y
|
||||
CONFIG_PACKAGE_mtd-utils-ubiattach=y
|
||||
CONFIG_PACKAGE_mtd-utils-ubidetach=y
|
||||
CONFIG_PACKAGE_mtd-utils-ubimkvol=y
|
||||
CONFIG_PACKAGE_mtd-utils-ubinfo=y
|
||||
CONFIG_PACKAGE_mtd-utils-ubirmvol=y
|
||||
CONFIG_PACKAGE_mtd-utils-ubirsvol=y
|
||||
CONFIG_PACKAGE_mtd-utils-ubiupdatevol=y
|
||||
CONFIG_PACKAGE_multiwan=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_netcheck=y
|
||||
CONFIG_PACKAGE_ntfs-3g=y
|
||||
CONFIG_PACKAGE_odhcp6c=y
|
||||
CONFIG_PACKAGE_odhcpd=y
|
||||
CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_PACKAGE_p910nd=y
|
||||
CONFIG_PACKAGE_peripheral_manager=y
|
||||
CONFIG_PACKAGE_port-management=y
|
||||
CONFIG_PACKAGE_power-management=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
|
||||
CONFIG_PACKAGE_ppp-multilink=y
|
||||
CONFIG_PACKAGE_qos-scripts=y
|
||||
CONFIG_PACKAGE_qrencode=y
|
||||
CONFIG_PACKAGE_questd=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_samba3=y
|
||||
CONFIG_PACKAGE_samba3-nmbd=y
|
||||
CONFIG_PACKAGE_snmpd=y
|
||||
CONFIG_PACKAGE_strace=y
|
||||
CONFIG_PACKAGE_tc=y
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_terminfo=y
|
||||
CONFIG_PACKAGE_tptest=y
|
||||
CONFIG_PACKAGE_traceroute6=y
|
||||
CONFIG_PACKAGE_usb-modeswitch=y
|
||||
CONFIG_PACKAGE_usbreset=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
CONFIG_PACKAGE_zoneinfo-core=y
|
||||
CONFIG_PACKAGE_zoneinfo-europe=y
|
||||
CONFIG_TARGET_CUSTOMER="INT"
|
||||
CONFIG_TARGET_ROOTFS_JFFS2=y
|
||||
CONFIG_TARGET_ROOTFS_TARGZ=y
|
||||
# CONFIG_USE_SSTRIP is not set
|
||||
CONFIG_USE_STRIP=y
|
||||
CONFIG_BUILD_LOG=y
|
||||
CONFIG_BUSYBOX_CONFIG_ADDUSER=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT=y
|
||||
CONFIG_BUSYBOX_CONFIG_DELUSER=y
|
||||
# CONFIG_BUSYBOX_CONFIG_DEVMEM is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q=y
|
||||
CONFIG_BUSYBOX_CONFIG_FIRST_SYSTEM_ID=100
|
||||
CONFIG_BUSYBOX_CONFIG_HTTPD=y
|
||||
CONFIG_BUSYBOX_CONFIG_INSMOD=y
|
||||
CONFIG_BUSYBOX_CONFIG_LAST_SYSTEM_ID=999
|
||||
CONFIG_BUSYBOX_CONFIG_LOGIN=y
|
||||
CONFIG_BUSYBOX_CONFIG_LSMOD=y
|
||||
CONFIG_BUSYBOX_CONFIG_LSPCI=y
|
||||
CONFIG_BUSYBOX_CONFIG_LSUSB=y
|
||||
CONFIG_BUSYBOX_CONFIG_MICROCOM=y
|
||||
CONFIG_BUSYBOX_CONFIG_RMMOD=y
|
||||
CONFIG_BUSYBOX_CONFIG_STTY=y
|
||||
CONFIG_BUSYBOX_CONFIG_TASKSET=y
|
||||
CONFIG_BUSYBOX_CONFIG_TFTP=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_2_4_MODULES is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_CGI=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_ERROR_PAGES=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_GZIP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_PROXY=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_SETUID=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_USE_SENDFILE=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_NOLOGIN is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_SECURETTY=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_TASKSET_FANCY is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_GET=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_PUT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_LOGIN_SCRIPTS is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_LOGIN_SESSION_AS_CHILD is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_PAM is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_TFTP_DEBUG is not set
|
||||
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_SAMBA3_CONFIG_NO_PRINTING is not set
|
||||
38
iop/configs/luci.diff
Executable file
38
iop/configs/luci.diff
Executable file
@@ -0,0 +1,38 @@
|
||||
CONFIG_PACKAGE_luci=y
|
||||
CONFIG_PACKAGE_luci-mod-admin-core=y
|
||||
CONFIG_PACKAGE_luci-mod-admin-full=y
|
||||
CONFIG_PACKAGE_luci-app-ddns=y
|
||||
CONFIG_PACKAGE_luci-app-dslstats=y
|
||||
CONFIG_PACKAGE_luci-app-firewall=y
|
||||
CONFIG_PACKAGE_luci-app-iup=y
|
||||
CONFIG_PACKAGE_luci-app-mcpd=y
|
||||
CONFIG_PACKAGE_luci-app-minidlna=y
|
||||
CONFIG_PACKAGE_luci-app-multiwan=y
|
||||
CONFIG_PACKAGE_luci-app-p910nd=y
|
||||
CONFIG_PACKAGE_luci-app-parental-control=y
|
||||
CONFIG_PACKAGE_luci-app-port-management=y
|
||||
CONFIG_PACKAGE_luci-app-power-mgmt=y
|
||||
CONFIG_PACKAGE_luci-app-samba=y
|
||||
CONFIG_PACKAGE_luci-app-sfp=y
|
||||
CONFIG_PACKAGE_luci-app-snmp=y
|
||||
CONFIG_PACKAGE_luci-app-speedtest=y
|
||||
CONFIG_PACKAGE_luci-app-upnp=y
|
||||
CONFIG_PACKAGE_luci-app-voice=y
|
||||
CONFIG_PACKAGE_luci-theme-base=y
|
||||
CONFIG_PACKAGE_luci-theme-bootstrap=y
|
||||
CONFIG_PACKAGE_luci-i18n-english=y
|
||||
CONFIG_PACKAGE_luci-proto-3g=y
|
||||
CONFIG_PACKAGE_luci-proto-4g=y
|
||||
CONFIG_PACKAGE_luci-proto-core=y
|
||||
CONFIG_PACKAGE_luci-proto-ipv6=y
|
||||
CONFIG_PACKAGE_luci-proto-ppp=y
|
||||
CONFIG_PACKAGE_luci-sgi-cgi=y
|
||||
CONFIG_PACKAGE_luci-lib-core=y
|
||||
CONFIG_PACKAGE_luci-lib-core_source=y
|
||||
CONFIG_PACKAGE_luci-lib-ipkg=y
|
||||
CONFIG_PACKAGE_luci-lib-json=y
|
||||
CONFIG_PACKAGE_luci-lib-nixio=y
|
||||
CONFIG_PACKAGE_luci-lib-nixio_notls=y
|
||||
CONFIG_PACKAGE_luci-lib-sys=y
|
||||
CONFIG_PACKAGE_luci-lib-web=y
|
||||
|
||||
42
iop/scripts/cfe_upgrade.sh
Normal file
42
iop/scripts/cfe_upgrade.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
# this is a developer helper script to install firmware on a remote host running in CFE mode
|
||||
|
||||
function usage {
|
||||
echo "usage: $0 cfe_upgrade <host> <file>"
|
||||
}
|
||||
|
||||
function cfe_upgrade {
|
||||
if [ -z "$1" ] ; then
|
||||
usage
|
||||
echo "Error: host required"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$2" ] ; then
|
||||
usage
|
||||
echo "Error: firmware filename required"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -e $2 ] ; then
|
||||
usage
|
||||
echo "Error: firmware file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
IMAGE=`basename $2`
|
||||
echo "CFE upgrade host: $1 with file $IMAGE"
|
||||
[ "$2" ] && [ -e "$2" ] && curl -i -F filedata=@$2 http://$1/upload.cgi && echo "upgrade done!"
|
||||
}
|
||||
|
||||
register_command "cfe_upgrade" "<host> <file> Install firmware on remote host in CFE mode"
|
||||
|
||||
function cfe_upgrade_latest {
|
||||
if [ -z "$1" ] ; then
|
||||
echo "usage: $0 cfe_upgrade_latest <host>"
|
||||
echo "Error: host required"
|
||||
exit 1
|
||||
fi
|
||||
{ cd `dirname $0`
|
||||
IMAGE=`ls -Art bin/*/*.w | tail -n1`
|
||||
[ "$IMAGE" ] && [ -e "$IMAGE" ] && ./iop cfe_upgrade $1 $IMAGE
|
||||
}
|
||||
}
|
||||
|
||||
register_command "cfe_upgrade_latest" "<host> Install latest firmware on remote host in CFE mode"
|
||||
63
iop/scripts/feeds_update.sh
Executable file
63
iop/scripts/feeds_update.sh
Executable file
@@ -0,0 +1,63 @@
|
||||
#! /bin/bash
|
||||
|
||||
function feeds_update {
|
||||
|
||||
developer=0
|
||||
|
||||
git remote -v | grep -q http || developer=1
|
||||
|
||||
#while getopts "d" opt; do
|
||||
# case $opt in
|
||||
# d)
|
||||
# developer=1
|
||||
# ;;
|
||||
# \?)
|
||||
# echo "Invalid option: -$OPTARG" >&2
|
||||
# exit 1
|
||||
# ;;
|
||||
# esac
|
||||
#done
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
rm -rf package/feeds
|
||||
|
||||
#if -d argument is passed, clone feeds with ssh instead of http
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g
|
||||
else
|
||||
./scripts/feeds update
|
||||
fi
|
||||
|
||||
|
||||
./scripts/feeds install -f -p feed_inteno_openwrt -a
|
||||
./scripts/feeds install -f -p feed_inteno_juci -a
|
||||
./scripts/feeds install -f -p feed_inteno_packages -a
|
||||
./scripts/feeds install -f -p feed_inteno_broadcom -a
|
||||
./scripts/feeds install -f -p feed_inteno_targets iopsys-brcm63xx-mips
|
||||
./scripts/feeds install -f -p feed_inteno_targets iopsys-brcm63xx-arm
|
||||
./scripts/feeds install -a
|
||||
./scripts/feeds uninstall asterisk18
|
||||
./scripts/feeds uninstall zstream
|
||||
./scripts/feeds uninstall mtd-utils
|
||||
./scripts/feeds install -f -p feed_inteno_packages mtd-utils
|
||||
./scripts/feeds uninstall qrencode
|
||||
./scripts/feeds install -f -p feed_inteno_packages qrencode
|
||||
|
||||
rm -rf package/feeds/oldpackages/libzstream # have to run this for now since uninstall is not working every time
|
||||
|
||||
cp .genconfig_config_bak .config
|
||||
make defconfig
|
||||
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
}
|
||||
|
||||
register_command "feeds_update" "Update feeds to point to commit hashes from feeds.conf"
|
||||
|
||||
|
||||
|
||||
|
||||
262
iop/scripts/genconfig.sh
Executable file
262
iop/scripts/genconfig.sh
Executable file
@@ -0,0 +1,262 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig {
|
||||
export CLEAN=0
|
||||
export IMPORT=0
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
export CONFIGPATH="package/feeds/feed_inteno_packages/iop/configs"
|
||||
export CUSTCONF="customerconfigs"
|
||||
export VERBOSE=0
|
||||
export DEVELOPER=0
|
||||
export TMPDIR="/tmp/builder/"
|
||||
LOCAL_MIRROR="http://mirror.inteno.se/mirror"
|
||||
|
||||
iopsys_brcm63xx_mips="cg300 cg301 dg150 dg150v2 dg150alv2 dg200 dg200al dg301 dg301al eg300 vg50 vox25"
|
||||
iopsys_brcm63xx_arm="dg400"
|
||||
target="bogus"
|
||||
|
||||
set_target() {
|
||||
|
||||
local profile=$1
|
||||
|
||||
for p in $iopsys_brcm63xx_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_mips"
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
git remote -v | grep -q http || {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
iceAllowed=0
|
||||
endptAllowed=0
|
||||
natalieAllowed=0
|
||||
|
||||
allowedRepos="$(ssh -o ConnectTimeout=5 git@private.inteno.se 2>/dev/null | grep -w 'R\|W' | awk '{print$NF}')"
|
||||
for repo in $allowedRepos; do
|
||||
case $repo in
|
||||
bcmkernel) bcmAllowed=1 ;;
|
||||
ice-client) iceAllowed=1 ;;
|
||||
endptcfg) endptAllowed=1 ;;
|
||||
natalie-dect*) natalieAllowed=1 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 [OPTIONS] BoardConfig Customerconfig"
|
||||
echo
|
||||
echo " -c, remove all files under ./files and import from config "
|
||||
echo " -v, verbose"
|
||||
echo " -u, Update customer config before applying"
|
||||
echo " -p, set profile (if exists)"
|
||||
echo " -t, use latest git tag and number of commits since as version for the build"
|
||||
echo " -s, enable 'Package source tree override'"
|
||||
echo
|
||||
echo "BoardConfig ex "
|
||||
ls -1 configs
|
||||
if [ -d "$CUSTCONF/$1" ]; then
|
||||
echo "Customerconfig ex"
|
||||
ls $CUSTCONF/*
|
||||
fi
|
||||
echo
|
||||
echo "Example ./genconfig vg50 TELIA"
|
||||
echo "(if no customerconfig is chosen the Inteno Config will be used)"
|
||||
echo
|
||||
exit 127
|
||||
}
|
||||
|
||||
use_local_mirror()
|
||||
{
|
||||
if wget -T 3 -t 2 -O /dev/null $LOCAL_MIRROR >/dev/null 2>/dev/null
|
||||
then
|
||||
echo "mirror [$LOCAL_MIRROR] exists. Using local mirror"
|
||||
sed -i "s;CONFIG_LOCALMIRROR=.*;CONFIG_LOCALMIRROR=\"$LOCAL_MIRROR\";" .config
|
||||
else
|
||||
echo "mirror [$LOCAL_MIRROR] does not exist. Not using local mirror"
|
||||
fi
|
||||
}
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
{
|
||||
if [ $DEVELOPER -eq 1 ]; then
|
||||
if [ ! -d "$CUSTCONF" ]; then
|
||||
git clone git@private.inteno.se:customerconfigs
|
||||
elif [ $IMPORT -eq 1 ]; then
|
||||
cd customerconfigs
|
||||
v "git pull"
|
||||
git pull
|
||||
cd ..
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -d "$FILEDIR" ]; then
|
||||
mkdir $FILEDIR
|
||||
elif [ -d "$FILEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
create_and_copy_files()
|
||||
{
|
||||
local BOARDTYPE=$1
|
||||
local CUSTOMER=$2
|
||||
|
||||
# Validate seleced board and customer
|
||||
set_target $BOARDTYPE
|
||||
if [ $target == "bogus" ]; then
|
||||
echo "Hardware profile does not exist"
|
||||
exit 1
|
||||
elif [ -n "$CUSTOMER" -a ! -d "$CUSTCONF/$BOARDTYPE/$CUSTOMER/" ]; then
|
||||
echo "Customer profile does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
make package/base-files/clean
|
||||
|
||||
# Base config on master
|
||||
v "Config $BOARDTYPE selected"
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
# Apply profile diff to master config if selected
|
||||
if [ -n "$PROFILE" ]; then
|
||||
if [ -e "$CONFIGPATH/$PROFILE.diff" ]; then
|
||||
cat $CONFIGPATH/$PROFILE.diff >> .config
|
||||
elif [ "$PROFILE" == "juci" ]; then
|
||||
v "Default profile (juci) is selected."
|
||||
else
|
||||
echo "ERROR: profile $PROFILE does not exist!"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
v "No profile selected! Using default."
|
||||
fi
|
||||
|
||||
# Set target and profile
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
|
||||
# Add customerconfig diff if a customer is selected
|
||||
if [ -n "$CUSTOMER" ]; then
|
||||
echo "$BOARDTYPE $CUSTOMER" > .current_config_file
|
||||
if [ -d "$CUSTCONF/$BOARDTYPE/$CUSTOMER/fs" ]; then
|
||||
v "cp -rLp $CUSTCONF/$BOARDTYPE/$CUSTOMER/fs/* $FILEDIR"
|
||||
cp -rLp $CUSTCONF/$BOARDTYPE/$CUSTOMER/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$BOARDTYPE/$CUSTOMER/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$BOARDTYPE/$CUSTOMER/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$BOARDTYPE/$CUSTOMER/$BOARDTYPE.diff >> .config
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
|
||||
|
||||
# Enable Pckage source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && \
|
||||
echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
|
||||
# developer mode selected ?
|
||||
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
|
||||
[ $iceAllowed -eq 0 ] && echo "CONFIG_ICE_OPEN=y" >> .config
|
||||
[ $endptAllowed -eq 0 ] && echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
[ $natalieAllowed -eq 0 ] && echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||
else
|
||||
echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
echo "CONFIG_ICE_OPEN=y" >> .config
|
||||
echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||
fi
|
||||
|
||||
# Set default values based on selected parameters
|
||||
make defconfig
|
||||
|
||||
# Temporary fixup for juci/luci profile
|
||||
if [ "$PROFILE" == "luci" ]; then
|
||||
sed -i '/CONFIG_DEFAULT_juci/d' .config
|
||||
sed -i '/CONFIG_PACKAGE_juci/d' .config
|
||||
sed -i '/CONFIG_PACKAGE_uhttpd/d' .config
|
||||
fi
|
||||
|
||||
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
|
||||
}
|
||||
|
||||
####### main #####
|
||||
if [ ! -e tmp/.iop_bootstrap ]; then
|
||||
echo "You have not installed feeds. Running genconfig in this state would create a non functional configuration."
|
||||
echo "Run: iop feeds_update"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo Current profile:
|
||||
cat .current_config_file
|
||||
echo "Try ./iop_get_config.sh -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
else
|
||||
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
|
||||
-c) export CLEAN=1;;
|
||||
-u) export IMPORT=1;;
|
||||
-v) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-p) export PROFILE="$2"; shift;;
|
||||
-t) export USE_TAG=1;;
|
||||
-s) export SRCTREEOVERR=1;;
|
||||
-h) usage;;
|
||||
-*)
|
||||
echo "Invalid option: $1 "
|
||||
echo "Try -h' for more information."
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
[ -d $TMPDIR ] || mkdir $TMPDIR
|
||||
setup_dirs
|
||||
create_and_copy_files "$1" "$2"
|
||||
[ -d $TMPDIR ] && rm -rf $TMPDIR
|
||||
use_local_mirror
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
register_command "genconfig" "Generate configuration for board and customer"
|
||||
88
iop/scripts/generate_tarballs.sh
Executable file
88
iop/scripts/generate_tarballs.sh
Executable file
@@ -0,0 +1,88 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
|
||||
build_bcmkernel_consumer() {
|
||||
local tarfile bcmkernelcommith
|
||||
bcmkernelcommith=$(grep -w "PKG_SOURCE_VERSION:" $curdir/feeds/feed_inteno_broadcom/bcmkernel/$sdkversion.mk | cut -d'=' -f2)
|
||||
# do not build bcmopen sdk if it was already built before
|
||||
ssh inteno@iopsys.inteno.se "ls public/www/iopsys/consumer/bcmopen-$profile-$bcmkernelcommith.tar.gz" && return
|
||||
cd ./build_dir/target-*_uClibc-0.9.33.*/bcmkernel-3.4-$sdkversion/bcm963xx/release
|
||||
sh do_consumer_release -p $profile -y
|
||||
tarfile='out/bcm963xx_*_consumer.tar.gz'
|
||||
[ $(ls -1 $tarfile |wc -l) -ne 1 ] && echo "Too many tar files: '$tarfile'" && return
|
||||
scp $tarfile inteno@ihgsp.inteno.se:/home/inteno/public/www/iopsys/consumer/bcmopen-$profile-$bcmkernelcommith.tar.gz
|
||||
rm -f $tarfile
|
||||
cd $curdir
|
||||
}
|
||||
|
||||
build_natalie_consumer() {
|
||||
# create natalie-dect open version tar file
|
||||
local natalieversion nataliecommith
|
||||
grep -q "CONFIG_TARGET_NO_DECT=y" .config && return
|
||||
natalieversion=$(grep -w "PKG_VERSION:" ./feeds/feed_inteno_packages/natalie-dect/Makefile | cut -d'=' -f2)
|
||||
nataliecommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/feed_inteno_packages/natalie-dect/Makefile | cut -d'=' -f2)
|
||||
ssh inteno@iopsys.inteno.se "ls public/www/iopsys/consumer/natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz" && return
|
||||
cd ./build_dir/target-*_uClibc-0.9.33.*/natalie-dect-$natalieversion/
|
||||
mkdir natalie-dect-open-$natalieversion
|
||||
cp NatalieFpCvm6362/Src/Projects/NatalieV3/FpCvm/Linux6362/dects.ko natalie-dect-open-$natalieversion/dect.ko
|
||||
tar -czv natalie-dect-open-$natalieversion/ -f natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz
|
||||
scp natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz inteno@iopsys.inteno.se:/home/inteno/public/www/iopsys/consumer/
|
||||
cp natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz $curdir/
|
||||
rm -rf natalie-dect-open-$natalieversion
|
||||
rm -f natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz
|
||||
cd $curdir
|
||||
}
|
||||
|
||||
build_endptcfg_consumer() {
|
||||
# create endptcfg open version tar file
|
||||
local endptversion endptcommith
|
||||
grep -q "CONFIG_TARGET_NO_VOICE=y" .config && return
|
||||
endptversion=$(grep -w "PKG_VERSION:" ./feeds/feed_inteno_packages/endptcfg/Makefile | cut -d'=' -f2)
|
||||
endptcommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/feed_inteno_packages/endptcfg/Makefile | cut -d'=' -f2)
|
||||
ssh inteno@iopsys.inteno.se "ls public/www/iopsys/consumer/endptcfg-$profile-$endptversion-$endptcommith.tar.gz" && return
|
||||
cd ./build_dir/target-*_uClibc-0.9.33.*/endptcfg-$endptversion/
|
||||
mkdir endptcfg-open-$endptversion
|
||||
cp endptcfg endptcfg-open-$endptversion/
|
||||
tar -czv endptcfg-open-$endptversion/ -f endptcfg-$profile-$endptversion-$endptcommith.tar.gz
|
||||
scp endptcfg-$profile-$endptversion-$endptcommith.tar.gz inteno@iopsys.inteno.se:/home/inteno/public/www/iopsys/consumer/
|
||||
cp endptcfg-$profile-$endptversion-$endptcommith.tar.gz $curdir/
|
||||
rm -rf endptcfg-open-$endptversion
|
||||
rm -f endptcfg-$profile-$endptversion-$endptcommith.tar.gz
|
||||
cd $curdir
|
||||
}
|
||||
|
||||
build_ice_consumer() {
|
||||
# create ice-client open version tar file
|
||||
local iceversion icebasever icerelease icecommith
|
||||
icecommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/feed_inteno_packages/ice-client/Makefile | head -1 | cut -d'=' -f2)
|
||||
icebasever=$(grep -w "BASE_PKG_VERSION:" ./feeds/feed_inteno_packages/ice-client/Makefile | cut -d'=' -f2)
|
||||
icerelease=$(grep -w "PKG_RELEASE:" ./feeds/feed_inteno_packages/ice-client/Makefile | cut -d'=' -f2)
|
||||
iceversion=$icebasever$icerelease
|
||||
ssh inteno@iopsys.inteno.se "ls public/www/iopsys/consumer/ice-client-$profile-$iceversion-$icecommith.tar.gz" && return
|
||||
cd ./build_dir/target-*_uClibc-0.9.33.*/ice-client-$icebasever/ipkg-*
|
||||
tar -czv ice-client -f ice-client-$profile-$iceversion-$icecommith.tar.gz
|
||||
scp ice-client-$profile-$iceversion-$icecommith.tar.gz inteno@iopsys.inteno.se:/home/inteno/public/www/iopsys/consumer/
|
||||
cp ice-client-$profile-$iceversion-$icecommith.tar.gz $curdir/
|
||||
rm -f ice-client-$profile-$iceversion-$icecommith.tar.gz
|
||||
cd $curdir
|
||||
}
|
||||
|
||||
|
||||
function generate_tarballs {
|
||||
|
||||
git remote -v | grep -q http && return # do not continue if this is an open SDK environment
|
||||
|
||||
profile=$(grep CONFIG_BCM_KERNEL_PROFILE .config | cut -d'=' -f2 | tr -d '"')
|
||||
sdkversion=$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')
|
||||
curdir=$(pwd)
|
||||
|
||||
build_bcmkernel_consumer
|
||||
build_natalie_consumer
|
||||
build_endptcfg_consumer
|
||||
build_ice_consumer
|
||||
|
||||
}
|
||||
|
||||
register_command "generate_tarballs" "Generate tarballs for openstk"
|
||||
|
||||
18
iop/scripts/install_key.sh
Executable file
18
iop/scripts/install_key.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
# this is a developer helper script to install the public ssh key in the created image
|
||||
|
||||
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
|
||||
|
||||
echo "::sysinit:/etc/init.d/rcS S boot" >files/etc/inittab
|
||||
echo "::shutdown:/etc/init.d/rcS K shutdown" >>files/etc/inittab
|
||||
echo "tty/0::askfirst:/bin/ash --login" >>files/etc/inittab
|
||||
echo "ttyS0::askfirst:/bin/ash --login" >>files/etc/inittab
|
||||
|
||||
echo Done
|
||||
}
|
||||
|
||||
register_command "install_key" "Install the user's public ssh key in the created image"
|
||||
70
iop/scripts/scp_changes.sh
Normal file
70
iop/scripts/scp_changes.sh
Normal file
@@ -0,0 +1,70 @@
|
||||
# this is a developer helper script to SCP changed files to remote host
|
||||
|
||||
ROOT=build_dir/target-mips_uClibc-0.9.33.2/root-iopsys-brcm63xx-mips/
|
||||
ROOT_OLD=tmp/root_old/
|
||||
ROOT_TMP=tmp/root_tmp/
|
||||
|
||||
function scp_changes_reset {
|
||||
{ cd `dirname $0`
|
||||
rm -rf "$ROOT_OLD"
|
||||
mkdir -p "$ROOT_OLD"
|
||||
cp -a "$ROOT"* "$ROOT_OLD"
|
||||
}
|
||||
}
|
||||
|
||||
function scp_changes {
|
||||
if [ -z "$1" ] ; then
|
||||
echo "usage: $0 scp_changes <host/-r(eset)/-p(retend)>"
|
||||
echo "Error: host required"
|
||||
exit 1
|
||||
fi
|
||||
{ cd `dirname $0`
|
||||
if [ ! -d $ROOT ]; then
|
||||
echo "$ROOT does not exist"
|
||||
echo "please build the project first"
|
||||
exit 1;
|
||||
fi
|
||||
if [ "$1" = "-r" ]; then
|
||||
echo "reset changes"
|
||||
scp_changes_reset
|
||||
exit 0
|
||||
fi
|
||||
if [ ! -d $ROOT_OLD ]; then
|
||||
echo "$ROOT_OLD does not exist"
|
||||
echo "you didn't store state of previous buildroot"
|
||||
#echo "please run ./scp_changes_reset.sh"
|
||||
echo "doing it now"
|
||||
scp_changes_reset
|
||||
exit 1;
|
||||
fi
|
||||
FILES=`diff -rq "$ROOT" "$ROOT_OLD" 2>&1 | sed -ne "s?^Files .* and $ROOT_OLD\\(.*\\) differ?\\1?p" -ne "s?^Only in $ROOT\\(.*\\): \\(.*\\)?\\1/\\2?p"`
|
||||
if [ "$1" = "-p" ]; then
|
||||
echo "files that would be copied:"
|
||||
echo $FILES
|
||||
exit 0
|
||||
fi
|
||||
for f in $FILES
|
||||
do
|
||||
mkdir -p "$ROOT_TMP`dirname $f`"
|
||||
cp -af "$ROOT$f" "$ROOT_TMP$f"
|
||||
done
|
||||
if [ -d "$ROOT_TMP" ]; then
|
||||
echo "scp changed files to $1"
|
||||
pushd "$ROOT_TMP" 2>&1 >/dev/null
|
||||
scp -r * root@$1:/
|
||||
RETVAL=$?
|
||||
popd 2>&1 >/dev/null
|
||||
rm -rf "$ROOT_TMP"
|
||||
if [ "$RETVAL" -eq 0 ]; then
|
||||
scp_changes_reset
|
||||
else
|
||||
echo "scp error"
|
||||
exit $RETVAL
|
||||
fi
|
||||
else
|
||||
echo "no change"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
register_command "scp_changes" "<host/-r(eset)/-p(retend)> SCP only changed files to device"
|
||||
177
iop/scripts/setup_host.sh
Executable file
177
iop/scripts/setup_host.sh
Executable file
@@ -0,0 +1,177 @@
|
||||
#!/bin/bash
|
||||
|
||||
function setup_host {
|
||||
|
||||
if [ "$(whoami)" != "root" ]; then
|
||||
echo "Please run this script as root!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
packages_all="bison flex g++ g++-multilib zlib1g-dev gettext gawk svn-buildpackage libncurses5-dev ncurses-term git automake gtk-doc-tools liblzo2-dev uuid-dev execstack"
|
||||
packages_perl="libconvert-binary-c-perl libdigest-crc-perl"
|
||||
packages_x64="libc6-dev-i386 lib32z1"
|
||||
packages_npm="npm nodejs yui-compressor"
|
||||
|
||||
curdir=$(pwd)
|
||||
|
||||
#===============#
|
||||
# Prerequisites #
|
||||
#===============#
|
||||
|
||||
mysh=$(ls -hl /bin/sh | awk -F'[ ,/]' '{print$NF}')
|
||||
if [ "$mysh" != "bash" ]; then
|
||||
echo "On Debian based systems, e.g. Ubuntu, /bin/sh must point to bash instead of $mysh"
|
||||
read -p "Do you approve this change (y/n): " ans
|
||||
if [ "$ans" == "y" ]; then
|
||||
rm -f /bin/sh
|
||||
ln -s bash /bin/sh
|
||||
else
|
||||
echo "Warning! You haven't pointed /bin/sh to bash."
|
||||
cd $curdir
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "The packages below must be installed"
|
||||
echo $packages_all $packages_perl
|
||||
read -p "Do you approve insallation of these packages (y/n): " ans
|
||||
if [ "$ans" == "y" ]; then
|
||||
apt-get install $packages_all
|
||||
apt-get install $packages_perl
|
||||
else
|
||||
cd $curdir
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(uname -m | awk '{print$1}')" == "x86_64" ]; then
|
||||
echo "You are running a Linux Distribution based on 64-bit kernel"
|
||||
echo "The packages below must be installed"
|
||||
echo $packages_x64
|
||||
read -p "Do you approve insallation of these packages (y/n): " ans
|
||||
if [ "$ans" == "y" ]; then
|
||||
apt-get install $packages_x64
|
||||
else
|
||||
cd $curdir
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "The packages below must be installed in order to be able to compile JUCI"
|
||||
echo $packages_npm
|
||||
read -p "Do you approve insallation of these packages (y/n): " ans
|
||||
if [ "$ans" == "y" ]; then
|
||||
apt-get install npm nodejs yui-compressor
|
||||
npm install -g npm
|
||||
npm install -g grunt-cli
|
||||
npm install -g mocha
|
||||
npm install -g bower
|
||||
npm install -g uglify-js
|
||||
npm install -g less
|
||||
|
||||
if [ "$(which node)" == "" ]; then
|
||||
NODEJS=$(which nodejs)
|
||||
if [ "$NODEJS" != "" ]; then
|
||||
read -p "Found nodejs executable at $(which nodejs), but no path to 'node'. Do you want to create a symlink? (y/n): " ans
|
||||
if [ "$ans" == "y" ]; then
|
||||
ln -s "$NODEJS" "/usr/bin/node"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
user=$(who | head -1 | awk '{print$1}')
|
||||
[ -n $user ] && chown -R $user:$user /home/$user/.npm/
|
||||
else
|
||||
cd $curdir
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the Broadcom toolchain from here and unpack the mips/arm package to /opt:
|
||||
echo -n "Checking for Broadcom MIPS toolchain: "
|
||||
if [ -d /opt/toolchains/crosstools-mips-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21 ]; then
|
||||
install_mips=0
|
||||
echo "YES"
|
||||
else
|
||||
install_mips=1
|
||||
echo "NO"
|
||||
fi
|
||||
|
||||
echo -n "Checking for Broadcom ARM toolchain: "
|
||||
if [ -d /opt/toolchains/crosstools-arm-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21-NPTL ]; then
|
||||
install_arm=0
|
||||
echo "YES"
|
||||
else
|
||||
install_arm=1
|
||||
echo "NO"
|
||||
fi
|
||||
|
||||
if [ $install_mips -eq 1 -o $install_arm -eq 1 ]; then
|
||||
read -p "Do you approve insallation of missing toolchains (y/n): " ans
|
||||
if [ "$ans" == "y" ]; then
|
||||
echo "Downloading toolchain"
|
||||
else
|
||||
cd $curdir
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd ~
|
||||
wget http://iopsys.inteno.se/iopsys/toolchain/crosstools-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21.Rel1.2-full.tar.bz2
|
||||
tar jxf crosstools-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21.Rel1.2-full.tar.bz2
|
||||
cd /
|
||||
|
||||
if [ $install_mips -eq 1 ]; then
|
||||
echo "Installing MIPS toolchain"
|
||||
tar jxf ~/crosstools-mips-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21.Rel1.2.tar.bz2
|
||||
fi
|
||||
|
||||
if [ $install_arm -eq 1 ]; then
|
||||
echo "Installing ARM toolchain"
|
||||
tar jxf ~/crosstools-arm-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21-NPTL.Rel1.2.tar.bz2
|
||||
fi
|
||||
|
||||
rm -f ~/crosstools-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21-sources.tar.bz2
|
||||
rm -f ~/crosstools-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21.Rel1.2-full.tar.bz2
|
||||
rm -f ~/crosstools-mip*-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21.Rel1.2.tar.bz2
|
||||
rm -f ~/crosstools-arm-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21-NPTL.Rel1.2.tar.bz2
|
||||
fi
|
||||
|
||||
gcc_ver=$(ls -l /usr/bin/gcc-[0-9]* | head -1 | awk '{print$NF}' | cut -d'-' -f2)
|
||||
if [ "$gcc_ver" != "4.8" ]; then
|
||||
echo "Your current gcc version is $gcc_ver, but it must be changed to 4.8"
|
||||
read -p "Do you approve this change (y/n): " ans
|
||||
if [ "$ans" == "y" ]; then
|
||||
apt-get install gcc-4.8
|
||||
apt-get install g++-4.8
|
||||
apt-get install gcc-4.8-multilib
|
||||
|
||||
update-alternatives --install /usr/bin/g++ c++ /usr/bin/g++-4.8 100
|
||||
update-alternatives --install /usr/bin/g++ c++ /usr/bin/g++-$gcc_ver 90
|
||||
|
||||
update-alternatives --install /usr/bin/gcc cc /usr/bin/gcc-4.8 100
|
||||
update-alternatives --install /usr/bin/gcc cc /usr/bin/gcc-$gcc_ver 90
|
||||
|
||||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.8 100
|
||||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-$gcc_ver 90
|
||||
|
||||
update-alternatives --set c++ /usr/bin/g++-4.8
|
||||
update-alternatives --set cc /usr/bin/gcc-4.8
|
||||
update-alternatives --set cpp /usr/bin/cpp-4.8
|
||||
ln -s /etc/alternatives/cc /usr/bin/cc
|
||||
|
||||
echo "The deafult gcc version has now been changed from $gcc_ver to 4.8"
|
||||
else
|
||||
cd $curdir
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo "You have successfully installed and configred prerequisites to be able to build an iopsys firmware"
|
||||
echo ""
|
||||
echo ""
|
||||
|
||||
cd $curdir
|
||||
|
||||
}
|
||||
|
||||
register_command "setup_host" "Install needed packets to host machine"
|
||||
17
iop/scripts/ssh_install_key.sh
Executable file
17
iop/scripts/ssh_install_key.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
# 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"
|
||||
56
iop/scripts/ssh_sysupgrade.sh
Normal file
56
iop/scripts/ssh_sysupgrade.sh
Normal file
@@ -0,0 +1,56 @@
|
||||
# this is a developer helper script to install firmware on a remote host with SSH
|
||||
|
||||
function usage {
|
||||
echo "usage: $0 ssh_sysupgrade <host> <file> [opts]"
|
||||
}
|
||||
|
||||
function ssh_sysupgrade {
|
||||
if [ -z "$1" ] ; then
|
||||
usage
|
||||
echo "Error: host required"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$2" ] ; then
|
||||
usage
|
||||
echo "Error: firmware filename required"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -e $2 ] ; then
|
||||
usage
|
||||
echo "Error: firmware file does not exist"
|
||||
exit 1
|
||||
fi
|
||||
IMAGE=`basename $2`
|
||||
echo "sysupgrade host: $1 with file $IMAGE"
|
||||
[ "$2" ] && [ -e "$2" ] && scp $2 root@$1:/tmp/ && ssh root@$1 "sysupgrade $3 /tmp/$IMAGE" && echo "sysupgrade done!"
|
||||
}
|
||||
|
||||
register_command "ssh_sysupgrade" "<host> <file> [opts] Install firmware on remote host with SSH"
|
||||
|
||||
function ssh_sysupgrade_latest {
|
||||
if [ -z "$1" ] ; then
|
||||
echo "usage: $0 ssh_sysupgrade_latest <host> [opts]"
|
||||
echo "Error: host required"
|
||||
exit 1
|
||||
fi
|
||||
{ cd `dirname $0`
|
||||
IMAGE=`ls -Art bin/*/*.y | tail -n1`
|
||||
[ "$IMAGE" ] && [ -e "$IMAGE" ] && ./iop ssh_sysupgrade $1 $IMAGE $2
|
||||
}
|
||||
}
|
||||
|
||||
register_command "ssh_sysupgrade_latest" "<host> [opts] Install latest ubifs firmware on remote host with SSH"
|
||||
|
||||
function ssh_sysupgrade_latest_w {
|
||||
if [ -z "$1" ] ; then
|
||||
echo "usage: $0 ssh_sysupgrade_latest_w <host> [opts]"
|
||||
echo "Error: host required"
|
||||
exit 1
|
||||
fi
|
||||
{ cd `dirname $0`
|
||||
IMAGE=`ls -Art bin/*/*.w | tail -n1`
|
||||
[ "$IMAGE" ] && [ -e "$IMAGE" ] && ./iop ssh_sysupgrade $1 $IMAGE $2
|
||||
}
|
||||
}
|
||||
|
||||
register_command "ssh_sysupgrade_latest_w" "<host> [opts] Install latest jffs2 firmware on remote host with SSH"
|
||||
20
iop/scripts/status.sh
Executable file
20
iop/scripts/status.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
function status {
|
||||
topdir=$PWD
|
||||
echo
|
||||
for subdir in .git $(find feeds/ -type d -name .git); do
|
||||
|
||||
echo "======= $(dirname $subdir) ========"
|
||||
cd $subdir/..
|
||||
if git status |grep -Eq '^\s([^\s\(]+)'; then
|
||||
git status |grep -Ev '(nothing added|use "git |^$)'
|
||||
else
|
||||
git status |grep -E "(On branch|HEAD detached)"
|
||||
fi
|
||||
cd $topdir
|
||||
done
|
||||
echo
|
||||
}
|
||||
|
||||
register_command "status" "Display the state of your working tree"
|
||||
602
iop/scripts/update_package.sh
Executable file
602
iop/scripts/update_package.sh
Executable file
@@ -0,0 +1,602 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
print_git_update()
|
||||
{
|
||||
echo "pkg -> ${PKG_NAME}"
|
||||
echo " PKG_BUILD_DIR = ${PKG_BUILD_DIR}"
|
||||
echo " PKG_DIR = ${PKG_DIR}"
|
||||
echo " PKG_SOURCE = ${PKG_SOURCE}"
|
||||
echo " PKG_NAME = ${PKG_NAME}"
|
||||
echo " PKG_SOURCE_URL = ${PKG_SOURCE_URL}"
|
||||
echo " PKG_SOURCE_PROTO= ${PKG_SOURCE_PROTO}"
|
||||
echo " PKG_SOURCE_VERSION= ${PKG_SOURCE_VERSION}"
|
||||
echo " PKG_SOURCE = ${PKG_SOURCE}"
|
||||
echo " PKG_SOURCE_VERSION_FILE=${PKG_SOURCE_VERSION_FILE}"
|
||||
}
|
||||
|
||||
is_git_same()
|
||||
{
|
||||
git_last=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
|
||||
#echo "$PKG_NAME $git_last = ${PKG_SOURCE_VERSION}"
|
||||
if [ "$git_last" == "${PKG_SOURCE_VERSION}" ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
update_this_pkg()
|
||||
{
|
||||
mk_hash=$(get_makefile_hash)
|
||||
|
||||
if [ "$mk_hash" != "${PKG_SOURCE_VERSION}" ]
|
||||
then
|
||||
echo "${PKG_NAME}:"
|
||||
echo " build dir = ${PKG_BUILD_DIR}"
|
||||
echo " feed makefile = ${mk_hash}"
|
||||
echo " stale hash = ${PKG_SOURCE_VERSION}"
|
||||
echo " build git = $(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)"
|
||||
echo " Git hash in package makefile and the git hash recorded from last compile of"
|
||||
echo " package is different. You probably want to recompile the package"
|
||||
echo " to get an up to date version in ${PKG_BUILD_DIR}/.git_update"
|
||||
echo ""
|
||||
|
||||
echo -n " Shold we continue with the update anyway? [y/N]:"
|
||||
read answer
|
||||
echo ""
|
||||
|
||||
case $answer in
|
||||
y|Y)
|
||||
;;
|
||||
n|N|*)
|
||||
return 1;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "${PKG_NAME}:"
|
||||
echo " build dir = ${PKG_BUILD_DIR}"
|
||||
echo " pkg dir = ${PKG_DIR}"
|
||||
echo " feed makefile = ${PKG_SOURCE_VERSION}"
|
||||
echo " build git = $(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)"
|
||||
echo " package is at a different git commit in build compared to feed"
|
||||
echo -n " Should we update the feed and top project to reflect the new version ? [y/N]:"
|
||||
read answer
|
||||
echo ""
|
||||
|
||||
case $answer in
|
||||
y|Y)
|
||||
return 0;;
|
||||
*)
|
||||
echo ""
|
||||
return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_makefile_hash()
|
||||
{
|
||||
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
|
||||
then
|
||||
name="$PKG_SOURCE_VERSION_FILE"
|
||||
else
|
||||
name=Makefile
|
||||
fi
|
||||
grep "PKG_SOURCE_VERSION:=" ${PKG_DIR}/${name} | sed -e "s/\(^PKG_SOURCE_VERSION:=\)\(.*\)/\2/"
|
||||
}
|
||||
|
||||
insert_hash_in_feed_makefile()
|
||||
{
|
||||
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
|
||||
then
|
||||
name="$PKG_SOURCE_VERSION_FILE"
|
||||
else
|
||||
name=Makefile
|
||||
fi
|
||||
|
||||
git_last=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
|
||||
|
||||
sed -i -e "s/\(^PKG_SOURCE_VERSION:=\).*/\1${git_last}/" ${PKG_DIR}/${name}
|
||||
(cd ${PKG_DIR}; git add ${name})
|
||||
}
|
||||
|
||||
|
||||
# BUG: fix if only local branche name!
|
||||
branch_uptodate()
|
||||
{
|
||||
# $1 git repo
|
||||
# $2 if it exist dont abort do the pull
|
||||
(cd $1
|
||||
git remote update 2>&1 >/dev/null
|
||||
|
||||
LOCAL=$(git rev-parse @)
|
||||
REMOTE=$(git rev-parse @{u})
|
||||
BASE=$(git merge-base @ @{u})
|
||||
|
||||
if [ -z "$REMOTE" ]; then
|
||||
BRANCH=$(basename $(git symbolic-ref -q HEAD))
|
||||
echo "You need to setup a tracking branch for $BRANCH"
|
||||
exit 99
|
||||
fi
|
||||
|
||||
if [ $LOCAL = $REMOTE ]; then
|
||||
return
|
||||
elif [ $LOCAL = $BASE ]; then
|
||||
if [ -n "$2" ]
|
||||
then
|
||||
echo "Doing automatic pull on [ $1 ]"
|
||||
if git pull
|
||||
then
|
||||
return
|
||||
else
|
||||
echo "Something wrong with pull. aborting, repo at"
|
||||
echo " [ $1 ]"
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo "Local repo behind remote:"
|
||||
echo "do git pull at repo"
|
||||
echo " [ $1 ]"
|
||||
exit 99
|
||||
fi
|
||||
elif [ $REMOTE = $BASE ]; then
|
||||
echo "Local repo ahead of remote. A push is needed"
|
||||
echo "Repo is at: $1"
|
||||
echo ""
|
||||
echo -n "Should we try a push ? [Y/n]:"
|
||||
read answer
|
||||
echo ""
|
||||
|
||||
case $answer in
|
||||
n|N|q|Q)
|
||||
exit 99;;
|
||||
*)
|
||||
echo -e "${Yellow}"
|
||||
if ! git push origin HEAD
|
||||
then
|
||||
echo -e "${Color_Off}"
|
||||
exit 99
|
||||
fi
|
||||
echo -e "${Color_Off}Push done."
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
echo "Diverged. not sure what you did but there is no tracking branch. "
|
||||
echo "repo at [ $1 ]. fix it so that there is a tracking branch remote."
|
||||
echo "Often this is related to sombody having commited to the same branch"
|
||||
echo "on the server so a simple push wont work, try a 'git rebase'."
|
||||
exit 99
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
on_a_branch()
|
||||
{
|
||||
local repo=$1
|
||||
local type=$2
|
||||
(
|
||||
cd $repo
|
||||
name=$(git symbolic-ref -q HEAD)
|
||||
if [ -z "$name" ]
|
||||
then
|
||||
echo "git $type repo [ $repo ] is detached."
|
||||
|
||||
branches=($(git branch -r --contains $(git rev-parse HEAD)))
|
||||
if [ 0 == ${#branches[@]} ]
|
||||
then
|
||||
echo "It needs to be on a branch but git could not find any associated branch"
|
||||
echo ""
|
||||
echo "you need to make sure that the commit is not on a detached branch"
|
||||
echo "and that the branch exist in the remote repo also. it can not be a local name"
|
||||
echo "as it is about to get pushed so it can be part of system release"
|
||||
exit 99
|
||||
fi
|
||||
|
||||
echo "It needs to be on a branch. Please select one or quit if it is not in list."
|
||||
echo ""
|
||||
|
||||
i=0
|
||||
for branch in ${branches[*]}
|
||||
do
|
||||
echo "$i: $branch"
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo -n "Select what branch to checkout. Q/q or N/n to quit? "
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
q|Q|n|N)
|
||||
echo "Aborting!"
|
||||
exit 99;;
|
||||
esac
|
||||
|
||||
echo -e "${Yellow}"
|
||||
pwd
|
||||
echo "git checkout ${branches[$answer]}"
|
||||
if ! git checkout -t ${branches[$answer]}
|
||||
then
|
||||
local_branch=$(basename ${branches[$answer]})
|
||||
if ! git checkout ${local_branch}
|
||||
then
|
||||
echo -e "${Color_Off}"
|
||||
echo "update_git aborting! something was wrong changing to branch ${branches[$answer]}"
|
||||
echo "go to [ $repo ] and fix it."
|
||||
exit 99
|
||||
fi
|
||||
fi
|
||||
echo -e "${Color_Off}"
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
git_repos_uptodate()
|
||||
{
|
||||
on_a_branch ${PKG_BUILD_DIR} package
|
||||
on_a_branch ${PKG_DIR} feed
|
||||
on_a_branch ${PWD} top
|
||||
branch_uptodate ${PKG_BUILD_DIR}
|
||||
branch_uptodate ${PKG_DIR} do_pull
|
||||
branch_uptodate ${PWD} do_pull
|
||||
}
|
||||
|
||||
get_feed_name()
|
||||
{
|
||||
|
||||
echo $1 |sed -e "s|.*feeds/\([^/]*\).*|\1|"
|
||||
|
||||
# rest=$(dirname $1)
|
||||
# base=$(basename $1)
|
||||
# prev=$base
|
||||
|
||||
# while [ -n "$rest" ]
|
||||
# do
|
||||
# if [ "$base" == "feeds" ]
|
||||
# then
|
||||
# echo "$prev"
|
||||
# fi
|
||||
# done
|
||||
}
|
||||
|
||||
create_message()
|
||||
{
|
||||
FORMAT="commit %H%n\
|
||||
Author: %aN <%aE>%n\
|
||||
Date: %ai%n\
|
||||
%n\
|
||||
%w(80,4,4)%s%n
|
||||
%b%n\
|
||||
%w()Base directory -> ${repo_PATH}/"
|
||||
local FROM=${PKG_SOURCE_VERSION}
|
||||
local TO=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
|
||||
|
||||
local commits=$(cd ${PKG_BUILD_DIR};git rev-list ${FROM}..${TO})
|
||||
|
||||
local feed=$(get_feed_name ${PKG_DIR})
|
||||
|
||||
echo "Update feed [ $feed ] package [ $PKG_NAME ]"
|
||||
echo ""
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
(cd ${PKG_BUILD_DIR}; git log --graph --oneline ${FROM}..${TO})
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
|
||||
for commit in $commits
|
||||
do
|
||||
(cd ${PKG_BUILD_DIR}; git show --stat --pretty=format:"$FORMAT" $commit)
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
done
|
||||
}
|
||||
|
||||
edit_file()
|
||||
{
|
||||
echo -en "${Red}"
|
||||
echo "Here is the commit message we are going to use!"
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo -en "${Color_Off}"
|
||||
cat $1
|
||||
echo -en "${Red}"
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo -en "${Color_Off}"
|
||||
|
||||
echo -n "Do you want to edit the message [y/N]? "
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
y|Y)
|
||||
$EDITOR $1;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
commit_feed()
|
||||
{
|
||||
template=$(readlink -f $1)
|
||||
edit_file $template
|
||||
|
||||
echo -e "${Yellow}"
|
||||
(
|
||||
cd ${PKG_DIR}
|
||||
if git commit -F $template
|
||||
then
|
||||
if git push origin HEAD
|
||||
then
|
||||
echo -e "${Color_Off} Feed Updated!"
|
||||
return
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong push feed git ${PKG_DIR}"
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong committing to feed git ${PKG_DIR}"
|
||||
exit 99
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
commit_feeds_config()
|
||||
{
|
||||
template=$(readlink -f $1)
|
||||
edit_file $template
|
||||
|
||||
echo -e "${Yellow}"
|
||||
if git commit -F $template
|
||||
then
|
||||
if git push origin HEAD
|
||||
then
|
||||
echo -e "${Color_Off}Feeds.conf updated!"
|
||||
return
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong push change to feeds.conf"
|
||||
echo "try \"git remote update ; git stash ;git rebase; git push;git stash pop\""
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong committing to feed git"
|
||||
exit 99
|
||||
fi
|
||||
}
|
||||
|
||||
insert_hash_in_feeds_config()
|
||||
{
|
||||
local feed=$(get_feed_name ${PKG_DIR})
|
||||
local TO=$(cd ${PKG_DIR}; git rev-parse HEAD)
|
||||
|
||||
sed -i feeds.conf -e "/${feed}/ s/\(.*\)[;^].*/\1^${TO}/"
|
||||
git add feeds.conf
|
||||
}
|
||||
|
||||
check_packages()
|
||||
{
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
echo "Now checking if any changes has been done to the packages."
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
# First scan all files in build dir for packages that have .git directories.
|
||||
all_pkgs=$(find build_dir/ -name ".git")
|
||||
|
||||
for pkg in `echo "$all_pkgs"`
|
||||
do
|
||||
pkg=$(dirname $pkg)
|
||||
|
||||
# check if the git in build is at same commit id as the feed makefile points out
|
||||
if [ -e ${pkg}/.git_update ]
|
||||
then
|
||||
source ${pkg}/.git_update
|
||||
fi
|
||||
|
||||
# print_git_update
|
||||
|
||||
if [ -n "${PKG_NAME}" ]
|
||||
then
|
||||
if ! is_git_same
|
||||
then
|
||||
if update_this_pkg
|
||||
then
|
||||
# print_git_update
|
||||
git_repos_uptodate
|
||||
insert_hash_in_feed_makefile
|
||||
create_message >tmp/msg
|
||||
commit_feed tmp/msg
|
||||
insert_hash_in_feeds_config
|
||||
commit_feeds_config tmp/msg
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# now handle the target git. we have only one
|
||||
|
||||
|
||||
feeds_hash()
|
||||
{
|
||||
grep -v "^#" feeds.conf | grep " $1" | sed -e "s/.*[;^]\(.*\)/\1/"
|
||||
}
|
||||
|
||||
insert_feed_hash_in_feeds_config()
|
||||
{
|
||||
local feed=$1
|
||||
local TO=$(cd feeds/${feed}; git rev-parse HEAD)
|
||||
|
||||
sed -i feeds.conf -e "/ ${feed}/ s/\(.*\)[;^].*/\1^${TO}/"
|
||||
git add feeds.conf
|
||||
}
|
||||
|
||||
create_feed_message()
|
||||
{
|
||||
local feed=$1
|
||||
local FROM=$2
|
||||
local TO=$3
|
||||
|
||||
local FORMAT="commit %H%n\
|
||||
Author: %aN <%aE>%n\
|
||||
Date: %ai%n\
|
||||
%n\
|
||||
%w(80,4,4)%s%n
|
||||
%b%n\
|
||||
%w()Base directory -> feeds/$feed/"
|
||||
|
||||
|
||||
local commits=$(cd feeds/$feed;git rev-list ${FROM}..${TO})
|
||||
|
||||
echo "Update feed [ $feed ]"
|
||||
echo ""
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
(cd feeds/$feed; git log --graph --oneline ${FROM}..${TO})
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
|
||||
for commit in $commits
|
||||
do
|
||||
(cd feeds/$feed; git show --stat --pretty=format:"$FORMAT" $commit)
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
check_feeds()
|
||||
{
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
echo "Now checking if any changes has been done to the feeds."
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
||||
for feed in `echo $feeds`
|
||||
do
|
||||
feed_hash=$(feeds_hash $feed)
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
|
||||
if [ "$feed_hash" != "$in_git" ]
|
||||
then
|
||||
|
||||
name=$(cd feeds/$feed;git symbolic-ref -q HEAD)
|
||||
if [ -z "$name" ]
|
||||
then
|
||||
echo "Feed feeds/${feed} is at a git commit which is different from feeds.conf"
|
||||
on_a_branch feeds/${feed} feed
|
||||
|
||||
#redo the test here and see if the feeds.conf and git is still different.
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
if [ "$feed_hash" = "$in_git" ]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
LOCAL=$(cd feeds/$feed;git rev-parse @)
|
||||
REMOTE=$(cd feeds/$feed;git rev-parse @{u})
|
||||
BASE=$(cd feeds/$feed;git merge-base @ @{u})
|
||||
|
||||
# if we are behind the remote automatically do a pull
|
||||
if [ $LOCAL = $BASE ]; then
|
||||
(cd feeds/$feed ; git pull 1>/dev/null)
|
||||
|
||||
#redo the test here and see if the feeds.conf and git is still different.
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
if [ "$feed_hash" = "$in_git" ]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Feed feeds/${feed} is at different commit than what is in feeds.conf"
|
||||
echo -n "Should we update feeds.conf to reflect the new version ? [y/N]:"
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
n|N)
|
||||
continue;;
|
||||
esac
|
||||
branch_uptodate feeds/${feed}
|
||||
create_feed_message ${feed} $feed_hash $in_git >tmp/msg
|
||||
insert_feed_hash_in_feeds_config ${feed}
|
||||
commit_feeds_config tmp/msg
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
feeds_at_top()
|
||||
{
|
||||
git remote update 2>/dev/null 1>/dev/null
|
||||
LOCAL=$(git rev-parse @)
|
||||
REMOTE=$(git rev-parse @{u})
|
||||
|
||||
if [ $LOCAL = $REMOTE ]
|
||||
then
|
||||
return
|
||||
fi
|
||||
|
||||
local_name=$(git rev-parse --abbrev-ref @ )
|
||||
remote_name=$(git rev-parse --abbrev-ref @{u} )
|
||||
|
||||
echo "Top repo local branch \"$local_name\" is not at same point as remote \"$remote_name\""
|
||||
echo "This update script will update the feeds.conf file and for that to work it needs to"
|
||||
echo "be up to date with the remote."
|
||||
echo ""
|
||||
echo "please run:"
|
||||
echo " git pull"
|
||||
echo " ./iop feeds_update"
|
||||
echo ""
|
||||
echo "do not forget the bootstrap. but do not run make it can delete your package in build"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
# Exported interface
|
||||
function update_package {
|
||||
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
# Regular Colors
|
||||
Black='\033[0;30m' # Black
|
||||
Red='\033[0;31m' # Red
|
||||
Green='\033[0;32m' # Green
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
Blue='\033[0;34m' # Blue
|
||||
Purple='\033[0;35m' # Purple
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;37m' # White
|
||||
|
||||
while getopts "v:h" opt; do
|
||||
case $opt in
|
||||
v)
|
||||
verbose=$OPTARG
|
||||
;;
|
||||
h)
|
||||
echo "some help! No options yet"
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$EDITOR" ]
|
||||
then
|
||||
if [ -f /usr/bin/vi ]; then
|
||||
EDITOR=vi
|
||||
else
|
||||
echo "env variable EDITOR needs to be set"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# allow subshells to abort the whole program by exiting with "exit 99"
|
||||
set -E
|
||||
trap '[ "$?" -ne 99 ] || exit 99' ERR
|
||||
|
||||
feeds_at_top
|
||||
check_packages
|
||||
check_feeds
|
||||
}
|
||||
|
||||
register_command "update_package" "Publish changes to packages and feeds"
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# iup at boot
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
|
||||
START=98
|
||||
STOP=15
|
||||
USE_PROCD=1
|
||||
@@ -12,6 +13,23 @@ include /lib/network
|
||||
CRONPATH="/etc/crontabs/root"
|
||||
RANGE=60
|
||||
|
||||
management_interfaces() {
|
||||
local DHCP_IFACES=""
|
||||
|
||||
is_notbridged_dhcp() {
|
||||
local config="$1"
|
||||
local proto="$(uci -q get network.$config.proto)"
|
||||
local typ="$(uci -q get network.$config.type)"
|
||||
if [ "$proto" == "dhcp" -a "$typ" != "bridge" ]; then
|
||||
DHCP_IFACES="$DHCP_IFACES $config"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach is_notbridged_dhcp interface
|
||||
echo $DHCP_IFACES
|
||||
}
|
||||
|
||||
init_iup() {
|
||||
local interval
|
||||
local starttime
|
||||
@@ -28,6 +46,42 @@ init_iup() {
|
||||
config_load provisioning
|
||||
config_get interval polling interval
|
||||
config_get starttime polling starttime
|
||||
|
||||
### Ask for IUP related DHCP options only if IUP is enabled ###
|
||||
new_reqopts() {
|
||||
local net=$1
|
||||
local enabled
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$net.reqopts)"
|
||||
local iupopts="66 67 128 224"
|
||||
local ropt iopt
|
||||
config_get enabled iup enabled "on"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $iupopts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224) [ $enabled == "on" ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
echo "$newreqopts"
|
||||
}
|
||||
for net in $(management_interfaces); do
|
||||
uci -q set network.$net.reqopts="$(new_reqopts $net)"
|
||||
done
|
||||
uci commit network
|
||||
ubus call network reload
|
||||
#################################################################
|
||||
|
||||
if [ $interval == "weekly" ]; then
|
||||
interval="0"
|
||||
elif [ $interval == "hourly" ]; then
|
||||
@@ -43,21 +97,35 @@ init_iup() {
|
||||
if grep -q "iup" "$CRONPATH" ; then
|
||||
sed -i "/iup/d" $CRONPATH
|
||||
fi
|
||||
echo "$number $starttime * * $interval /sbin/iup > /dev/null 2>&1" >> $CRONPATH
|
||||
echo "$number $starttime * * $interval /sbin/iup -v > /dev/null 2>&1" >> $CRONPATH
|
||||
fsync $CRONPATH
|
||||
/etc/init.d/cron restart
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
boot() {
|
||||
init_iup
|
||||
}
|
||||
|
||||
start_service() {
|
||||
init_iup
|
||||
|
||||
test_default_route
|
||||
if [ "$?" -eq 0 ]; then
|
||||
/sbin/iup &
|
||||
/sbin/iup -v &
|
||||
fi
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
killall -9 /sbin/iup
|
||||
if [ -f "/tmp/run/iup.pid" ]; then
|
||||
kill -9 $(cat /tmp/run/iup.pid)
|
||||
rm -rf /tmp/run/iup.pid
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo $$ > /var/run/iup.pid
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
@@ -24,7 +24,7 @@ MAC=${MAC// /}
|
||||
MAC=$(echo $MAC | tr '[a-z]' '[A-Z]')
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
[ "$VERBOSE" -ge 1 ] && logger -t iup "$@"
|
||||
}
|
||||
|
||||
if [ -f $IUPMD5 ]; then
|
||||
@@ -91,6 +91,7 @@ reload ()
|
||||
|
||||
handle_provisioning() {
|
||||
local config="$1"
|
||||
local default="$2"
|
||||
local enabled
|
||||
local url
|
||||
local tftpfile
|
||||
@@ -108,11 +109,16 @@ handle_provisioning() {
|
||||
mkdir $IUPTEMP
|
||||
fi
|
||||
touch $IUPCONFFILES
|
||||
config_get_bool enabled "$config" enabled
|
||||
config_get_bool enabled "$config" enabled "$default"
|
||||
config_get_bool defaultreset "$config" defaultreset
|
||||
config_get deckey "$config" deckey
|
||||
if [ "$enabled" -eq 1 ]; then
|
||||
config_get url "$config" urliup
|
||||
if [ "$config" == "iup" ]; then
|
||||
v "using url from dhcp options"
|
||||
config_get url "$config" urliup
|
||||
else
|
||||
config_get url "$config" url
|
||||
fi
|
||||
url=${url//\$MAC/$MAC}
|
||||
v "Download from $url"
|
||||
|
||||
@@ -153,7 +159,15 @@ handle_Downloaded_file()
|
||||
local KEY
|
||||
[ -n "$1" ] && DECKEY=$(echo $1 | hexdump -e '16/1 "%02x"')
|
||||
KEY=${DECKEY:-$DESKEY}
|
||||
if [ "$(brcm_fw_tool -i check "$IUPCONFFILES")" == "UNKNOWN" ] ; then
|
||||
local img_type
|
||||
case "$(get_image_type "$IUPCONFFILES")" in
|
||||
"INTENO") img_type=2 ;;
|
||||
"CFE+FS") img_type=1 ;;
|
||||
"FS") img_type=0 ;;
|
||||
*) img_type="UNKNOWN";;
|
||||
esac
|
||||
|
||||
if [ "$img_type" == "UNKNOWN" ] ; then
|
||||
case "$(hexdump -v -n 2 -e '1/1 "%02x"' $IUPCONFFILES)" in
|
||||
1f8b)
|
||||
v "Found Config"
|
||||
@@ -242,15 +256,15 @@ config_get configurl configserver url
|
||||
config_get reboot configserver reboot
|
||||
config_get iupurl iup urliup
|
||||
if [ $configurl ]; then
|
||||
handle_provisioning configserver
|
||||
handle_provisioning configserver "0"
|
||||
elif [ $iupurl ]; then
|
||||
handle_provisioning iup
|
||||
handle_provisioning iup "1"
|
||||
else
|
||||
echo "No Provisioning Server Found"
|
||||
v "No Provisioning Server Found"
|
||||
exit
|
||||
fi
|
||||
config_load provisioning
|
||||
config_foreach handle_provisioning subconfig
|
||||
config_foreach handle_provisioning subconfig "0"
|
||||
config_get software uppgradeserver url
|
||||
sofwareminuspath=${software##*/}
|
||||
v "Software version to download $sofwareminuspath"
|
||||
@@ -259,9 +273,15 @@ if [ $software ]; then
|
||||
local sysinfo=$(ubus call router quest "{ \"info\": \"system\" }")
|
||||
json_load "$sysinfo"
|
||||
json_get_var firmware firmware
|
||||
json_get_var filesystem filesystem
|
||||
if [ "$filesystem" == "JFFS2" ] ; then
|
||||
firmware=$firmware.w
|
||||
else
|
||||
firmware=$firmware.y
|
||||
fi
|
||||
if [ "$sofwareminuspath" == "${sofwareminuspath/$firmware/}" ] ; then
|
||||
echo $software
|
||||
handle_provisioning uppgradeserver
|
||||
handle_provisioning uppgradeserver "0"
|
||||
else
|
||||
v "Will not update software, already up to date"
|
||||
fi
|
||||
@@ -275,3 +295,4 @@ if [ "$reboot" == "on" ]; then
|
||||
v "Reboot Signaled"
|
||||
/sbin/reboot
|
||||
fi
|
||||
rm -rf /var/run/iup.pid
|
||||
|
||||
72
iup/files/sbin/iup224
Executable file
72
iup/files/sbin/iup224
Executable file
@@ -0,0 +1,72 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/network/config.sh
|
||||
|
||||
if [ -z $1 ] ; then
|
||||
echo "No argument"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $(echo $1|grep -o "," | wc -l) -eq 0 ] ; then
|
||||
url=$1
|
||||
else
|
||||
url=$(echo $1|cut -d',' -f1)
|
||||
a=$(echo $1|cut -d',' -f2)
|
||||
b=$(echo $1|cut -d',' -f3)
|
||||
c=$(echo $1|cut -d',' -f4)
|
||||
fi
|
||||
|
||||
echo "url" $url
|
||||
echo "a" $a
|
||||
echo "b" $b
|
||||
echo "c" $c
|
||||
|
||||
currdate=$(date +"%Y-%m-%d")
|
||||
|
||||
active=0
|
||||
if [ -z $a ] ; then
|
||||
active=1
|
||||
elif [ $a ] && [ $b ] && [ $a -lt 25 ] ; then
|
||||
#Time
|
||||
begin=$(date +%s -d"$currdate $a")
|
||||
now=$(date +%s)
|
||||
end=$((begin+3600*$b))
|
||||
if [ $now -gt $begin ] && [ $now -lt $end ] ; then
|
||||
active=1
|
||||
fi
|
||||
elif [ $a ] && [ $b ] && [ $c ] && [ $a -gt 25 ] ; then
|
||||
#Date
|
||||
y=$(echo $a| cut -c1-4)
|
||||
m=$(echo $a| cut -c5-6)
|
||||
d=$(echo $a| cut -c7-8)
|
||||
begin=$(date +%s -d"$y-$m-$d $b")
|
||||
now=$(date +%s)
|
||||
end=$((begin+3600*$c))
|
||||
if [ $now -gt $begin ] && [ $now -lt $end ] ; then
|
||||
active=1
|
||||
fi
|
||||
else
|
||||
echo "Bad format"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
softwareminuspath=${url##*/}
|
||||
|
||||
if [ $url ] && [ $active -eq 1 ]; then
|
||||
echo "Software version to download $softwareminuspath"
|
||||
local sysinfo=$(ubus call router quest "{ \"info\": \"system\" }")
|
||||
json_load "$sysinfo"
|
||||
json_get_var firmware firmware
|
||||
local firmware_new=${softwareminuspath%.*} # remove extension (.w, .y or .y2) from filename
|
||||
if [ "$firmware_new" != "$firmware" ] ; then
|
||||
echo "Image found $url will start flashing"
|
||||
wait_for_dns $url
|
||||
/sbin/sysupgrade -v $url &
|
||||
exit 1
|
||||
else
|
||||
echo "Will not update software, already up to date"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -39,35 +39,40 @@ start_service() {
|
||||
config_get AnnexM capabilities AnnexM
|
||||
|
||||
config_get a8a capabilities 8a
|
||||
|
||||
config_get b8b capabilities 8b
|
||||
config_get c8c capabilities 8c
|
||||
config_get d8d capabilities 8d
|
||||
config_get a12a capabilities 12a
|
||||
config_get b12b capabilities 12b
|
||||
config_get a17a capabilities 17a
|
||||
|
||||
config_get US0 capabilities US0
|
||||
config_get bitswap capabilities bitswap
|
||||
config_get sra capabilities sra
|
||||
GDmt=${GDmt/Enabled/d}
|
||||
Glite=${Glite/Enabled/l}
|
||||
T1413=${T1413/Enabled/t}
|
||||
ADSL2=${ADSL2/Enabled/2}
|
||||
AnnexL=${AnnexL/Enabled/e}
|
||||
ADSL2plus=${ADSL2plus/Enabled/p}
|
||||
AnnexM=${AnnexM/Enabled/m}
|
||||
VDSL2=${VDSL2/Enabled/v}
|
||||
|
||||
a8a=${a8a/Enabled/8a}
|
||||
b8b=${b8b/Enabled/8b}
|
||||
c8c=${c8c/Enabled/8c}
|
||||
c8c=${c8c/Enabled/8c}
|
||||
GDmt=$(echo $GDmt | sed 's/Enabled\|1/d/g')
|
||||
Glite=$(echo $Glite | sed 's/Enabled\|1/l/g')
|
||||
T1413=$(echo $T1413 | sed 's/Enabled\|1/t/g')
|
||||
ADSL2=$(echo $ADSL2 | sed 's/Enabled\|1/2/g')
|
||||
AnnexL=$(echo $AnnexL | sed 's/Enabled\|1/e/g')
|
||||
ADSL2plus=$(echo $ADSL2plus | sed 's/Enabled\|1/p/g')
|
||||
AnnexM=$(echo $AnnexM | sed 's/Enabled\|1/m/g')
|
||||
VDSL2=$(echo $VDSL2 | sed 's/Enabled\|1/v/g')
|
||||
|
||||
d8d=${d8d/Enabled/8d}
|
||||
a8a=$(echo $a8a | sed 's/Enabled\|1/8a/g')
|
||||
b8b=$(echo $b8b | sed 's/Enabled\|1/8b/g')
|
||||
c8c=$(echo $c8c | sed 's/Enabled\|1/8c/g')
|
||||
d8d=$(echo $d8d | sed 's/Enabled\|1/8d/g')
|
||||
a12a=$(echo $a12a | sed 's/Enabled\|1/12a/g')
|
||||
b12b=$(echo $b12b | sed 's/Enabled\|1/12b/g')
|
||||
a17a=$(echo $a17a | sed 's/Enabled\|1/17a/g')
|
||||
|
||||
a12a=${a12a/Enabled/12a}
|
||||
b12b=${b12b/Enabled/12b}
|
||||
a17a=${a17a/Enabled/17a}
|
||||
US0=$(echo $US0 | sed 's/1/on/g')
|
||||
US0=$(echo $US0 | sed 's/0/off/g')
|
||||
bitswap=$(echo $bitswap | sed 's/1/on/g')
|
||||
bitswap=$(echo $bitswap | sed 's/0/off/g')
|
||||
sra=$(echo $sra | sed 's/1/on/g')
|
||||
sra=$(echo $sra | sed 's/0/off/g')
|
||||
|
||||
echo "Starting DSL"
|
||||
|
||||
|
||||
@@ -99,8 +99,10 @@ atm_inf_conf() {
|
||||
|
||||
checkxtmlist $atmtype $pcr $scr $mbs
|
||||
ret="$?"
|
||||
xtmctl operate conn --add 1.$vpi.$vci aal5 $encaps 1 $ret $ret
|
||||
xtmctl operate conn --addq 1.$vpi.$vci 0 wrr 1
|
||||
xtmctl operate conn --add 1.$vpi.$vci aal5 $encaps 0 1 $ret
|
||||
xtmctl operate conn --addq 1.$vpi.$vci 0 wrr 1 # low priority queue
|
||||
xtmctl operate conn --addq 1.$vpi.$vci 1 wrr 1 # mid priority queue upstream ACK's and ping from LAN will use this queue
|
||||
xtmctl operate conn --addq 1.$vpi.$vci 7 wrr 1 # high priority queue, internal traffic dhcp igmp dns and icmp
|
||||
xtmctl operate conn --createnetdev 1.$vpi.$vci ${ifname%%.*}
|
||||
xtmctl operate intf --state 1 enable
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ boot() {
|
||||
echo "ERROR: porttminit $interf failed!" > /dev/kmsg
|
||||
done
|
||||
fi
|
||||
|
||||
echo '1' > /proc/sys/net/ipv6/conf/$baseifname/disable_ipv6
|
||||
ifconfig $baseifname up
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ ptm_inf_conf() {
|
||||
if [ "$ret" -eq 0 ]; then
|
||||
xtmctl operate conn --add $dslat.$ptmprio 0 1
|
||||
xtmctl operate conn --addq $dslat.$ptmprio 0 wrr 1 -1 -1 3000
|
||||
xtmctl operate conn --addq $dslat.$ptmprio 7 wrr 1 -1 -1 3000 # fixes pppoe disconnect issue
|
||||
xtmctl operate conn --createnetdev $dslat.$ptmprio ${ifname%%.*}
|
||||
xtmctl operate intf --state 1 enable
|
||||
xtmctl start
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
#!/bin/sh
|
||||
|
||||
local hasEthWan="1"
|
||||
local hasAdsl="$(db -q get hw.board.hasAdsl)"
|
||||
local hasVdsl="$(db -q get hw.board.hasVdsl)"
|
||||
|
||||
local LANPORTS="$(db -q get hw.board.ethernetLanPorts)"
|
||||
local WANPORTS=""
|
||||
|
||||
# populate layer2_interface_ethernet #
|
||||
if [ "$hasEthWan" == "1" ]; then
|
||||
local wanEthernetPort="$(db -q get hw.board.ethernetWanPort)"
|
||||
wanEthernetPort="${wanEthernetPort:-eth0}"
|
||||
if [ ! -f /etc/config/layer2_interface_ethernet -o -z "$(uci -q get layer2_interface_ethernet.@ethernet_interface[0].ifname)" ]; then
|
||||
cat > /etc/config/layer2_interface_ethernet <<EOF
|
||||
config ethernet_interface 'Wan'
|
||||
option name 'WAN'
|
||||
option baseifname '${wanEthernetPort}'
|
||||
option ifname '${wanEthernetPort}.1'
|
||||
EOF
|
||||
fi
|
||||
local ifname="$(uci -q get layer2_interface_ethernet.@ethernet_interface[0].ifname)"
|
||||
[ -n "$WANPORTS" ] && WANPORTS="$WANPORTS $ifname" || WANPORTS="$ifname"
|
||||
elif [ "$hasEthWan" == "0" ]; then
|
||||
echo "" > /etc/config/layer2_interface_ethernet
|
||||
fi
|
||||
|
||||
# populate layer2_interface #
|
||||
if [ "$hasAdsl" == "1" ]; then
|
||||
if [ ! -f /etc/config/layer2_interface -o -z "$(uci -q get layer2_interface.capabilities)" ]; then
|
||||
cat > /etc/config/layer2_interface <<EOF
|
||||
config dsltype 'vdsl'
|
||||
option 'enabled' 'on'
|
||||
|
||||
config dsltype 'adsl'
|
||||
option 'enabled' 'on'
|
||||
|
||||
config dslsettings 'capabilities'
|
||||
option 'GDmt' 'Enabled'
|
||||
option 'Glite' 'Enabled'
|
||||
option 'T1413' 'Enabled'
|
||||
option 'ADSL2' 'Enabled'
|
||||
option 'AnnexL' 'Enabled'
|
||||
option 'ADSL2plus' 'Enabled'
|
||||
option 'VDSL2' 'Enabled'
|
||||
option '8a' 'Enabled'
|
||||
option '8b' 'Enabled'
|
||||
option '8c' 'Enabled'
|
||||
option '8d' 'Enabled'
|
||||
option '12a' 'Enabled'
|
||||
option '12b' 'Enabled'
|
||||
option '17a' 'Enabled'
|
||||
option '30a' 'Enabled'
|
||||
option 'US0' 'on'
|
||||
option 'bitswap' 'on'
|
||||
option 'sra' 'on'
|
||||
EOF
|
||||
fi
|
||||
elif [ "$hasAdsl" == "0" -a "$hasVdsl" == "0" ]; then
|
||||
echo "" > /etc/config/layer2_interface
|
||||
fi
|
||||
|
||||
# populate layer2_interface_adsl #
|
||||
if [ "$hasAdsl" == "1" ]; then
|
||||
local wanAdslPort=$(db -q get hw.board.adslWanPort)
|
||||
wanAdslPort="${wanAdslPort:-atm0}"
|
||||
if [ ! -f /etc/config/layer2_interface_adsl -o -z "$(uci -q get layer2_interface_adsl.@atm_bridge[0].ifname)" ]; then
|
||||
cat > /etc/config/layer2_interface_adsl <<EOF
|
||||
config atm_bridge
|
||||
option 'link_type' 'EoA'
|
||||
option 'encapseoa' 'llcsnap_eth'
|
||||
option 'unit' '0'
|
||||
option 'ifname' '${wanAdslPort}.1'
|
||||
option 'baseifname' '${wanAdslPort}'
|
||||
option 'vpi' '8'
|
||||
option 'vci' '35'
|
||||
option 'name' 'DSL8_35'
|
||||
option 'atmtype' 'ubr'
|
||||
EOF
|
||||
fi
|
||||
local ifname="$(uci -q get layer2_interface_adsl.@atm_bridge[0].ifname)"
|
||||
[ -n "$WANPORTS" ] && WANPORTS="$WANPORTS $ifname" || WANPORTS="$ifname"
|
||||
elif [ "$hasAdsl" == "0" ]; then
|
||||
echo "" > /etc/config/layer2_interface_adsl
|
||||
fi
|
||||
|
||||
# populate layer2_interface_vdsl #
|
||||
if [ "$hasVdsl" == "1" ]; then
|
||||
local wanVdslPort=$(db -q get hw.board.vdslWanPort)
|
||||
wanVdslPort="${wanVdslPort:-ptm0}"
|
||||
if [ ! -f /etc/config/layer2_interface_vdsl -o -z "$(uci -q get layer2_interface_vdsl.@vdsl_interface[0].ifname)" ]; then
|
||||
cat > /etc/config/layer2_interface_vdsl <<EOF
|
||||
config vdsl_interface
|
||||
option 'unit' '0'
|
||||
option 'ifname' '${wanVdslPort}.1'
|
||||
option 'baseifname' '${wanVdslPort}'
|
||||
option 'name' 'VDSL2'
|
||||
option 'dslat' '1'
|
||||
option 'ptmprio' '1'
|
||||
option 'ipqos' '1'
|
||||
EOF
|
||||
fi
|
||||
local ifname="$(uci -q get layer2_interface_vdsl.@vdsl_interface[0].ifname)"
|
||||
[ -n "$WANPORTS" ] && WANPORTS="$WANPORTS $ifname" || WANPORTS="$ifname"
|
||||
elif [ "$hasVdsl" == "0" ]; then
|
||||
echo "" > /etc/config/layer2_interface_vdsl
|
||||
fi
|
||||
|
||||
# populate network config ifnames #
|
||||
uci -q get network.lan.ifname >/dev/null || uci -q set network.lan.ifname="$LANPORTS"
|
||||
uci -q get network.wan.ifname >/dev/null || uci -q set network.wan.ifname="$WANPORTS"
|
||||
uci commit network
|
||||
|
||||
sync
|
||||
@@ -78,8 +78,37 @@ addbrcmvlan ()
|
||||
if [ "$ret" -eq 0 ]; then
|
||||
ifconfig $baseifname up
|
||||
echo "vlanctl --if-create $ifname" > /dev/console
|
||||
|
||||
local unmanaged=0
|
||||
local nets net typ proto
|
||||
nets=$(get_network_of "$ifname")
|
||||
for net in $nets; do
|
||||
typ=$(uci -q get network."$net".type)
|
||||
proto=$(uci -q get network."$net".proto)
|
||||
proto="${proto:-none}"
|
||||
if [ "$typ" == "bridge" -a "$proto" == "none" ]; then
|
||||
unmanaged=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo '1' > /proc/sys/net/ipv6/conf/$baseifname/disable_ipv6
|
||||
ifconfig $baseifname up
|
||||
if [ "x$bridge" = "x" ]; then
|
||||
bridge=0
|
||||
fi
|
||||
|
||||
if [ "$bridge" -eq 1 ]; then
|
||||
if [ "$unmanaged" == "1" ]; then
|
||||
vlanctl --if-create $baseifname $vlan8021q
|
||||
else
|
||||
vlanctl --dhcp-bridged --if-create $baseifname $vlan8021q
|
||||
fi
|
||||
else
|
||||
vlanctl --routed --if-create $baseifname $vlan8021q
|
||||
fi
|
||||
|
||||
if [ "$bridge" -eq 1 ]; then
|
||||
vlanctl --if-create $baseifname $vlan8021q
|
||||
vlanctl --if $baseifname --set-if-mode-rg
|
||||
vlanctl --if $baseifname --tx --tags 0 --default-miss-drop
|
||||
vlanctl --if $baseifname --tx --tags 1 --default-miss-drop
|
||||
@@ -95,7 +124,6 @@ addbrcmvlan ()
|
||||
# tags 2 rx
|
||||
vlanctl --if $baseifname --rx --tags 2 --filter-vid $vlan8021q 0 --pop-tag --set-rxif $ifname --rule-insert-before -1
|
||||
else
|
||||
vlanctl --routed --if-create $baseifname $vlan8021q
|
||||
vlanctl --if $baseifname --set-if-mode-rg
|
||||
vlanctl --if $baseifname --tx --tags 0 --default-miss-drop
|
||||
vlanctl --if $baseifname --tx --tags 1 --default-miss-drop
|
||||
@@ -125,19 +153,38 @@ brcm_virtual_interface_rules ()
|
||||
local baseifname=$1
|
||||
local ifname=$2
|
||||
local bridge=$3
|
||||
|
||||
|
||||
local unmanaged=0
|
||||
local nets net typ proto
|
||||
nets=$(get_network_of "$ifname")
|
||||
for net in $nets; do
|
||||
typ=$(uci -q get network."$net".type)
|
||||
proto=$(uci -q get network."$net".proto)
|
||||
proto="${proto:-none}"
|
||||
if [ "$typ" == "bridge" -a "$proto" == "none" ]; then
|
||||
unmanaged=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
echo '1' > /proc/sys/net/ipv6/conf/$baseifname/disable_ipv6
|
||||
ifconfig $baseifname up
|
||||
if [ "x$bridge" = "x" ]; then
|
||||
bridge=0
|
||||
fi
|
||||
bridge=0
|
||||
fi
|
||||
|
||||
if [ "$bridge" -eq 1 ]; then
|
||||
vlanctl --if-create-name $baseifname $ifname
|
||||
create_ebtables_bridge_rules
|
||||
if [ "$unmanaged" == "1" ]; then
|
||||
vlanctl --if-create-name $baseifname $ifname
|
||||
else
|
||||
vlanctl --dhcp-bridged --if-create-name $baseifname $ifname
|
||||
fi
|
||||
else
|
||||
vlanctl --routed --if-create-name $baseifname $ifname
|
||||
vlanctl --routed --if-create-name $baseifname $ifname
|
||||
fi
|
||||
|
||||
[ "$bridge" -eq 1 ] && create_ebtables_bridge_rules
|
||||
|
||||
#set default RG mode
|
||||
vlanctl --if $baseifname --set-if-mode-rg
|
||||
#Set Default Droprules
|
||||
@@ -145,9 +192,8 @@ brcm_virtual_interface_rules ()
|
||||
vlanctl --if $baseifname --tx --tags 1 --default-miss-drop
|
||||
vlanctl --if $baseifname --tx --tags 2 --default-miss-drop
|
||||
vlanctl --if $baseifname --tx --tags 0 --filter-txif $ifname --rule-insert-before -1
|
||||
|
||||
|
||||
if [ "$bridge" -eq 1 ]; then
|
||||
|
||||
# tags 1 tx
|
||||
vlanctl --if $baseifname --tx --tags 1 --filter-txif $ifname --rule-insert-before -1
|
||||
# tags 2 tx
|
||||
@@ -159,7 +205,6 @@ brcm_virtual_interface_rules ()
|
||||
# tags 2 rx
|
||||
vlanctl --if $baseifname --rx --tags 2 --set-rxif $ifname --rule-insert-last
|
||||
else
|
||||
|
||||
# tags 1 rx
|
||||
vlanctl --if $baseifname --rx --tags 1 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
|
||||
# tags 2 rx
|
||||
@@ -167,9 +212,8 @@ brcm_virtual_interface_rules ()
|
||||
# tags 0 rx
|
||||
vlanctl --if $baseifname --rx --tags 0 --set-rxif $ifname --filter-vlan-dev-mac-addr 1 --rule-insert-before -1
|
||||
fi
|
||||
|
||||
|
||||
ifconfig $ifname up
|
||||
ifconfig $ifname multicast
|
||||
}
|
||||
|
||||
|
||||
|
||||
105
libcgroup/Makefile
Normal file
105
libcgroup/Makefile
Normal file
@@ -0,0 +1,105 @@
|
||||
#
|
||||
# Copyright (C) 2016 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libcgroup
|
||||
PKG_VERSION:=0.41
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_SOURCE_VERSION:=2186c97f60df7efe86ddadd5e3d9d36dd4923b98
|
||||
|
||||
PKG_SOURCE_URL:=git://git.code.sf.net/p/libcg/libcg
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)+git$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
#PKG_BUILD_PARALLEL:=1
|
||||
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/libcgroup
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+libpthread
|
||||
TITLE:=Control group configuration library
|
||||
URL:=https://sourceforge.net/p/libcg/
|
||||
endef
|
||||
|
||||
define Package/libcgroup/description
|
||||
Control groups, a new kernel feature in Linux 2.6.24 provides a file system
|
||||
interface to manipulate and control the details on task grouping including
|
||||
creation of new task groups (control groups), permission handling and task
|
||||
assignment.
|
||||
endef
|
||||
|
||||
define Package/libcgroup-daemon
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
DEPENDS:=+libcgroup
|
||||
TITLE:=Control group management daemon
|
||||
URL:=https://sourceforge.net/p/libcg/
|
||||
endef
|
||||
|
||||
define Package/libcgroup-utils
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libcgroup
|
||||
TITLE:=Control group configuration utilities
|
||||
URL:=https://sourceforge.net/p/libcg/
|
||||
endef
|
||||
|
||||
#define Package/libcgroup/conffiles
|
||||
# /etc/config/cgroups
|
||||
#endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-bindings \
|
||||
--disable-pam \
|
||||
--enable-static \
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/libcgroup
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libcgroup/*.h $(1)/usr/include/libcgroup/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib $(1)/usr/lib/pkgconfig
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libcgroup.* $(1)/usr/lib/
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libcgroup.pc $(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/libcgroup/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libcgroup.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libcgroup-daemon/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin
|
||||
|
||||
# move to its own package?
|
||||
$(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d
|
||||
$(INSTALL_CONF) ./files/cgroups.config $(1)/etc/config/cgroups
|
||||
$(INSTALL_BIN) ./files/cgroups.init $(1)/etc/init.d/cgroups
|
||||
endef
|
||||
|
||||
define Package/libcgroup-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libcgroup))
|
||||
$(eval $(call BuildPackage,libcgroup-daemon))
|
||||
$(eval $(call BuildPackage,libcgroup-utils))
|
||||
40
libcgroup/files/cgroups.config
Normal file
40
libcgroup/files/cgroups.config
Normal file
@@ -0,0 +1,40 @@
|
||||
config cgroups cgroups
|
||||
option enabled 1
|
||||
option defgroup iopsys/normal
|
||||
|
||||
config cgroup _root_
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys
|
||||
list option cpu.shares=4096
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys_normal
|
||||
list option cpu.shares=1024
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup iopsys_high
|
||||
list option cpu.shares=4096
|
||||
list option memory.limit_in_bytes=-1
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt
|
||||
list option cpu.shares=1024
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt_normal
|
||||
list option cpu.shares=1024
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config cgroup 3prt_high
|
||||
list option cpu.shares=4096
|
||||
list option memory.limit_in_bytes=75M
|
||||
list option memory.move_charge_at_immigrate=1
|
||||
|
||||
config procmap procmap
|
||||
list procmap minidlna=3prt/normal
|
||||
|
||||
123
libcgroup/files/cgroups.init
Executable file
123
libcgroup/files/cgroups.init
Executable file
@@ -0,0 +1,123 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=01
|
||||
USE_PROCD=1
|
||||
#PROCD_DEBUG=1
|
||||
NAME=cgrulesengd
|
||||
|
||||
CGBASEDIR=/sys/fs/cgroup
|
||||
CGCONFIG="cgroups"
|
||||
|
||||
CGRULESCONF=/tmp/cgrules.conf
|
||||
CGCONFIGCONF=/tmp/cgconfig.conf
|
||||
|
||||
|
||||
cgroupinit_add_knob_val_to_list () {
|
||||
CG_KNOB_VAL_LIST="$CG_KNOB_VAL_LIST
|
||||
$1"
|
||||
}
|
||||
|
||||
cgroupinit_create_group () {
|
||||
local cgrp=$1
|
||||
local dir curr
|
||||
|
||||
if [ "$cgrp" == "_root_" ]; then
|
||||
dir=.
|
||||
else
|
||||
dir=$(echo $cgrp |tr '_' '/')
|
||||
fi
|
||||
|
||||
echo -e "group $dir {" >> $CGCONFIGCONF
|
||||
|
||||
CG_KNOB_VAL_LIST=
|
||||
config_list_foreach $cgrp option cgroupinit_add_knob_val_to_list
|
||||
CG_KNOB_VAL_LIST=$(echo "$CG_KNOB_VAL_LIST" |sort)
|
||||
curr="_none_"
|
||||
|
||||
for knob_val in $CG_KNOB_VAL_LIST ; do
|
||||
local ctrlr knob val
|
||||
|
||||
knob=$(echo $knob_val |awk -F= '{print $1}')
|
||||
ctrlr=$(echo $knob |awk -F. '{print $1}')
|
||||
val=$(echo $knob_val |awk -F= '{print $2}')
|
||||
|
||||
if [ "$curr" != "$ctrlr" ]; then
|
||||
[ "$curr" == "_none_" ] || echo -e "\t}" >> $CGCONFIGCONF
|
||||
curr=$ctrlr
|
||||
echo -e "\t$curr {" >> $CGCONFIGCONF
|
||||
fi
|
||||
|
||||
echo -e "\t\t$knob = \"$val\";" >> $CGCONFIGCONF
|
||||
done
|
||||
|
||||
[ "$curr" == "_none_" ] || echo -e "\t}" >> $CGCONFIGCONF
|
||||
echo -e "}\n" >> $CGCONFIGCONF
|
||||
}
|
||||
|
||||
cgroupinit_add_to_rules () {
|
||||
local name_grp=$1
|
||||
local name grp
|
||||
|
||||
name=$(echo $name_grp |awk -F= '{print $1}')
|
||||
grp=$(echo $name_grp |awk -F= '{print $2}')
|
||||
|
||||
echo -e "*:$name\t*\t$grp" >> $CGRULESCONF
|
||||
}
|
||||
|
||||
cgroupinit_generate_config () {
|
||||
local enab defgrp
|
||||
|
||||
config_load $CGCONFIG
|
||||
|
||||
config_get enab cgroups enabled "1"
|
||||
[ $enab -eq 0 ] && return 1
|
||||
|
||||
config_get defgrp cgroups defgroup "_undef_"
|
||||
[ "$defgrp" == "_undef_" ] && return 1
|
||||
|
||||
# mount here instead of in cgconfigparser to get all options right
|
||||
# mounting without any controllers listed means mount all available
|
||||
if ! grep -q " $CGBASEDIR cgroup " /proc/mounts; then
|
||||
mount -t cgroup -o nodev,noexec,nosuid cgroup $CGBASEDIR
|
||||
[ $? -eq 0 ] || return 1
|
||||
fi
|
||||
|
||||
echo -n '' > $CGCONFIGCONF
|
||||
config_foreach cgroupinit_create_group cgroup
|
||||
|
||||
echo -n '' > $CGRULESCONF
|
||||
config_list_foreach procmap procmap cgroupinit_add_to_rules
|
||||
echo -e "*\t*\t$defgrp" >> $CGRULESCONF
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# cgrulesengd has hardcoded paths for configuration files
|
||||
# use symlinks to point to generated config files
|
||||
cgroupinit_cgrulesengd_fixup () {
|
||||
[ -r /etc/cgrules.conf ] || ln -s $CGRULESCONF /etc/cgrules.conf
|
||||
[ -r /etc/cgconfig.conf ] || ln -s $CGCONFIGCONF /etc/cgconfig.conf
|
||||
[ -d /etc/cgconfig.d ] || mkdir /etc/cgconfig.d
|
||||
}
|
||||
|
||||
start_service () {
|
||||
cgroupinit_generate_config
|
||||
[ $? -eq 0 ] || return
|
||||
|
||||
cgroupinit_cgrulesengd_fixup
|
||||
/usr/sbin/cgconfigparser -l $CGCONFIGCONF || return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command /usr/sbin/cgrulesengd --nodaemon --syslog
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service () {
|
||||
/usr/sbin/cgclear
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger $CGCONFIG
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2013 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libucix
|
||||
PKG_VERSION:=0.0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
target=$(firstword $(subst -, ,$(BOARD)))
|
||||
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/lib -luci
|
||||
|
||||
TARGET_LDFLAGS += -shared -luci -Wl,-soname
|
||||
TARGET_CFLAGS += $(FPIC) -Dtarget_$(target)=1 -Wall
|
||||
MAKE_FLAGS += TARGET="$(target)"
|
||||
|
||||
define Package/libucix
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=UCI library
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/libucix/description
|
||||
UCI helper library
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Package/libucix/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/
|
||||
( cd $(PKG_BUILD_DIR) ; rm -f libucix.so && ln -s libucix.so.$(PKG_VERSION) libucix.so )
|
||||
$(CP) $(PKG_BUILD_DIR)/libucix.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libucix.so* $(STAGING_DIR)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/*.h $(STAGING_DIR)/usr/include/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libucix))
|
||||
@@ -1,15 +0,0 @@
|
||||
# Makefile for libucix
|
||||
|
||||
OBJS = libucix.o
|
||||
SRCS = libucix.c
|
||||
|
||||
all: libucix
|
||||
|
||||
libucix: ${OBJS}
|
||||
${CC} ${LDFLAGS} -o libucix.so.${PKG_VERSION} ${OBJS} ${LIBDIR} ${LIBS}
|
||||
|
||||
clean:
|
||||
rm -f libucix.so.* libucix.a ${OBJS}
|
||||
|
||||
depend:
|
||||
${MAKEDEPEND} ${INCL} ${SRCS} ${LIBSRCS}
|
||||
@@ -1,172 +0,0 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <uci_config.h>
|
||||
#include <uci.h>
|
||||
#include "ucix.h"
|
||||
|
||||
static struct uci_ptr ptr;
|
||||
|
||||
static inline int ucix_get_ptr(struct uci_context *ctx, const char *p, const char *s, const char *o, const char *t)
|
||||
{
|
||||
memset(&ptr, 0, sizeof(ptr));
|
||||
ptr.package = p;
|
||||
ptr.section = s;
|
||||
ptr.option = o;
|
||||
ptr.value = t;
|
||||
return uci_lookup_ptr(ctx, &ptr, NULL, true);
|
||||
}
|
||||
|
||||
struct uci_context* ucix_init(const char *config_file)
|
||||
{
|
||||
struct uci_context *ctx = uci_alloc_context();
|
||||
uci_add_delta_path(ctx, "/var/state");
|
||||
if(uci_load(ctx, config_file, NULL) != UCI_OK)
|
||||
{
|
||||
printf("%s/%s is missing or corrupt\n", ctx->savedir, config_file);
|
||||
return NULL;
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
struct uci_context* ucix_init_path(const char *path, const char *config_file)
|
||||
{
|
||||
struct uci_context *ctx = uci_alloc_context();
|
||||
if(path)
|
||||
uci_set_confdir(ctx, path);
|
||||
if(uci_load(ctx, config_file, NULL) != UCI_OK)
|
||||
{
|
||||
printf("%s/%s is missing or corrupt\n", ctx->savedir, config_file);
|
||||
return NULL;
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
|
||||
void ucix_cleanup(struct uci_context *ctx)
|
||||
{
|
||||
uci_free_context(ctx);
|
||||
}
|
||||
|
||||
void ucix_save(struct uci_context *ctx)
|
||||
{
|
||||
uci_set_savedir(ctx, "/tmp/.uci/");
|
||||
uci_save(ctx, NULL);
|
||||
}
|
||||
|
||||
void ucix_save_state(struct uci_context *ctx)
|
||||
{
|
||||
uci_set_savedir(ctx, "/var/state/");
|
||||
uci_save(ctx, NULL);
|
||||
}
|
||||
|
||||
const char* ucix_get_option(struct uci_context *ctx, const char *p, const char *s, const char *o)
|
||||
{
|
||||
struct uci_element *e = NULL;
|
||||
const char *value = NULL;
|
||||
if(ucix_get_ptr(ctx, p, s, o, NULL))
|
||||
return NULL;
|
||||
if (!(ptr.flags & UCI_LOOKUP_COMPLETE))
|
||||
return NULL;
|
||||
e = ptr.last;
|
||||
switch (e->type)
|
||||
{
|
||||
case UCI_TYPE_SECTION:
|
||||
value = uci_to_section(e)->type;
|
||||
break;
|
||||
case UCI_TYPE_OPTION:
|
||||
switch(ptr.o->type) {
|
||||
case UCI_TYPE_STRING:
|
||||
value = ptr.o->v.string;
|
||||
break;
|
||||
default:
|
||||
value = NULL;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
int ucix_get_option_int(struct uci_context *ctx, const char *p, const char *s, const char *o, int def)
|
||||
{
|
||||
const char *tmp = ucix_get_option(ctx, p, s, o);
|
||||
int ret = def;
|
||||
|
||||
if (tmp)
|
||||
ret = atoi(tmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ucix_add_section(struct uci_context *ctx, const char *p, const char *s, const char *t)
|
||||
{
|
||||
if(ucix_get_ptr(ctx, p, s, NULL, t))
|
||||
return;
|
||||
uci_set(ctx, &ptr);
|
||||
}
|
||||
|
||||
void ucix_add_option(struct uci_context *ctx, const char *p, const char *s, const char *o, const char *t)
|
||||
{
|
||||
if(ucix_get_ptr(ctx, p, s, o, (t)?(t):("")))
|
||||
return;
|
||||
uci_set(ctx, &ptr);
|
||||
}
|
||||
|
||||
void ucix_add_option_int(struct uci_context *ctx, const char *p, const char *s, const char *o, int t)
|
||||
{
|
||||
char tmp[64];
|
||||
snprintf(tmp, 64, "%d", t);
|
||||
ucix_add_option(ctx, p, s, o, tmp);
|
||||
}
|
||||
|
||||
void ucix_del(struct uci_context *ctx, const char *p, const char *s, const char *o)
|
||||
{
|
||||
if(!ucix_get_ptr(ctx, p, s, o, NULL))
|
||||
uci_delete(ctx, &ptr);
|
||||
}
|
||||
|
||||
void ucix_revert(struct uci_context *ctx, const char *p, const char *s, const char *o)
|
||||
{
|
||||
if(!ucix_get_ptr(ctx, p, s, o, NULL))
|
||||
uci_revert(ctx, &ptr);
|
||||
}
|
||||
|
||||
void ucix_for_each_section_type(struct uci_context *ctx,
|
||||
const char *p, const char *t,
|
||||
void (*cb)(const char*, void*), void *priv)
|
||||
{
|
||||
struct uci_element *e;
|
||||
if(ucix_get_ptr(ctx, p, NULL, NULL, NULL))
|
||||
return;
|
||||
uci_foreach_element(&ptr.p->sections, e)
|
||||
if (!strcmp(t, uci_to_section(e)->type))
|
||||
cb(e->name, priv);
|
||||
}
|
||||
|
||||
int ucix_commit(struct uci_context *ctx, const char *p)
|
||||
{
|
||||
if(ucix_get_ptr(ctx, p, NULL, NULL, NULL))
|
||||
return 1;
|
||||
return uci_commit(ctx, &ptr.p, false);
|
||||
}
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Copyright (C) 2008 John Crispin <blogic@openwrt.org>
|
||||
*/
|
||||
|
||||
#ifndef _UCI_H__
|
||||
#define _UCI_H__
|
||||
struct uci_context* ucix_init(const char *config_file);
|
||||
struct uci_context* ucix_init_path(const char *path, const char *config_file);
|
||||
void ucix_cleanup(struct uci_context *ctx);
|
||||
void ucix_save(struct uci_context *ctx);
|
||||
void ucix_save_state(struct uci_context *ctx);
|
||||
const char* ucix_get_option(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *o);
|
||||
int ucix_get_option_int(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *o, int def);
|
||||
void ucix_add_section(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *t);
|
||||
void ucix_add_option(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *o, const char *t);
|
||||
void ucix_add_option_int(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *o, int t);
|
||||
int ucix_commit(struct uci_context *ctx, const char *p);
|
||||
void ucix_revert(struct uci_context *ctx,
|
||||
const char *p, const char *s, const char *o);
|
||||
void ucix_del(struct uci_context *ctx, const char *p,
|
||||
const char *s, const char *o);
|
||||
#endif
|
||||
@@ -1,15 +0,0 @@
|
||||
config mcpd 'mcpd'
|
||||
option igmp_proxy_interfaces 'wan'
|
||||
option igmp_default_version '2'
|
||||
option igmp_query_interval '125'
|
||||
option igmp_query_response_interval '100'
|
||||
option igmp_last_member_query_interval '10'
|
||||
option igmp_robustness_value '2'
|
||||
option igmp_max_groups '25'
|
||||
option igmp_max_sources '10'
|
||||
option igmp_max_members '25'
|
||||
option igmp_fast_leave '1'
|
||||
option igmp_proxy_enable '1'
|
||||
option igmp_snooping_enable '2'
|
||||
option igmp_snooping_interfaces 'br-lan'
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$ACTION" = ifup ] || exit 0
|
||||
|
||||
pidof mcpd >/dev/null || exit 0
|
||||
/etc/init.d/mcpd enabled && /etc/init.d/mcpd reload
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
include /lib/network
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=mcpd
|
||||
PROG=/usr/sbin/mcpd
|
||||
|
||||
|
||||
dscp_mark() {
|
||||
local mark=$1
|
||||
local dm=0
|
||||
while [[ $dm -le 56 ]]; do
|
||||
iptables -t mangle -D POSTROUTING -p igmp -j DSCP --set-dscp $dm 2>/dev/null
|
||||
dm=$((dm+2))
|
||||
done
|
||||
[ -n "$mark" ] && iptables -t mangle -A POSTROUTING -p igmp -j DSCP --set-dscp-class $mark
|
||||
}
|
||||
|
||||
mcpd_configure() {
|
||||
local igmp_snooping_enable
|
||||
local igmp_snooping_interfaces
|
||||
local igmp_proxy_interfaces
|
||||
local igmp_proxy_enable
|
||||
local device
|
||||
local proxdevs=""
|
||||
local proxbridge=""
|
||||
local bridged=0
|
||||
local routed=0
|
||||
local _i
|
||||
|
||||
config_load mcpd
|
||||
config_get igmp_snooping_enable mcpd igmp_snooping_enable
|
||||
config_get igmp_snooping_interfaces mcpd igmp_snooping_interfaces
|
||||
config_get igmp_proxy_interfaces mcpd igmp_proxy_interfaces
|
||||
config_get igmp_proxy_enable mcpd igmp_proxy_enable
|
||||
# disable port snooping on all bridges
|
||||
for br in $(brctl show | grep 'br-' | awk '{print$1}' | tr '\n' ' '); do
|
||||
brctl enableportsnooping $br 0
|
||||
done
|
||||
|
||||
grep igmp /etc/config/mcpd | awk '{print $2 $3}' | sed -e "s/[\'\"]/ /g" | tr "_" "-" > /var/mcpd.conf
|
||||
|
||||
for proxif in $igmp_proxy_interfaces; do
|
||||
json_load "$(ifstatus $proxif)"
|
||||
json_get_var device device
|
||||
case "$device" in
|
||||
br-*)
|
||||
bridged=1
|
||||
proxbridge="$device"
|
||||
json_load "$(devstatus $device)"
|
||||
_i=1
|
||||
json_select bridge-members
|
||||
while json_get_var dev $_i; do
|
||||
case "$dev" in
|
||||
*.*)
|
||||
ifconfig $dev | grep RUNNING >/dev/null && proxdevs="$proxdevs $dev" && break
|
||||
;;
|
||||
esac
|
||||
_i=$(($_i + 1))
|
||||
done
|
||||
json_select ..
|
||||
;;
|
||||
*)
|
||||
proxdevs="$proxdevs $device"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ $igmp_proxy_enable -eq 1 ]; then
|
||||
sed -i "s/igmp-proxy-interfaces.*/igmp-proxy-interfaces $proxdevs/" /tmp/mcpd.conf
|
||||
else
|
||||
sed -i "s/igmp-proxy-interfaces.*/igmp-proxy-interfaces /" /tmp/mcpd.conf
|
||||
fi
|
||||
echo "igmp-mcast-interfaces $proxdevs" >> /tmp/mcpd.conf
|
||||
|
||||
sed -i "s/igmp-snooping-interfaces.*/igmp-snooping-interfaces $igmp_snooping_interfaces/" /tmp/mcpd.conf
|
||||
for snpif in $igmp_snooping_interfaces; do
|
||||
case "$snpif" in
|
||||
br-*)
|
||||
# enable port snooping on the bridge
|
||||
/usr/sbin/brctl enableportsnooping $snpif "$igmp_snooping_enable"
|
||||
|
||||
if [ "$snpif" != "$proxbridge" ]; then
|
||||
routed=1
|
||||
json_load "$(devstatus $snpif)"
|
||||
_i=1
|
||||
json_select bridge-members
|
||||
while json_get_var dev $_i; do
|
||||
case "$dev" in
|
||||
*.*)
|
||||
routed=0
|
||||
;;
|
||||
esac
|
||||
_i=$(($_i + 1))
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
;;
|
||||
eth%d|wl%d*)
|
||||
routed=1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$((bridged+routed))" == "2" ]; then
|
||||
# enable bridged+routed igmp snooping mode
|
||||
echo "igmp-bridged-routed 1" >> /tmp/mcpd.conf
|
||||
fi
|
||||
|
||||
config_get igmp_dscp_mark mcpd igmp_dscp_mark
|
||||
dscp_mark $igmp_dscp_mark
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger network mcpd
|
||||
}
|
||||
|
||||
start_service() {
|
||||
mcpd_configure
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
service_stop $PROG
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
@@ -1,69 +1,123 @@
|
||||
#
|
||||
# Copyright (C) 2006-2012 OpenWrt.org
|
||||
#
|
||||
# Copyright (C) 2009-2010 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mtd-utils
|
||||
PKG_VERSION:=1.4.5
|
||||
PKG_RELEASE:=1
|
||||
ifeq ($(CONFIG_BCM_OPEN),y)
|
||||
PKG_SOURCE_URL:=http://ihgsp.inteno.se/git/mtd-utils
|
||||
else
|
||||
PKG_SOURCE_URL:=git@ihgsp.inteno.se:mtd-utils
|
||||
endif
|
||||
PKG_VERSION:=1.5.1
|
||||
PKG_RELEASE:=3
|
||||
PKG_INSTALL:=1
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3a0d8a01d91e0e80bc59d6320e91c07383f0ede2
|
||||
PKG_SOURCE_VERSION:=dd9f464eced6af7d5e6a4a920b727421229310f4
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/mtd-utils
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_CAT:=zcat
|
||||
|
||||
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
FILES:= \
|
||||
docfdisk \
|
||||
doc_loadbios \
|
||||
flashcp \
|
||||
flash_erase \
|
||||
flash_lock \
|
||||
flash_otp_dump \
|
||||
flash_otp_info \
|
||||
flash_otp_lock \
|
||||
flash_otp_write \
|
||||
flash_unlock \
|
||||
ftl_check \
|
||||
ftl_format \
|
||||
imagewrite \
|
||||
jffs2dump \
|
||||
jffs2reader \
|
||||
mkfs.jffs2 \
|
||||
mtd_debug \
|
||||
nanddump \
|
||||
nandtest \
|
||||
nandwrite \
|
||||
nftldump \
|
||||
nftl_format \
|
||||
recv_image \
|
||||
rfddump \
|
||||
rfdformat \
|
||||
serve_image \
|
||||
sumtool
|
||||
|
||||
HOST_CFLAGS += -I$(STAGING_DIR_HOST)/include/e2fsprogs
|
||||
CFLAGS := $(HOST_CFLAGS) -I$(HOST_BUILD_DIR)/include -L$(HOST_BUILD_DIR) -L$(STAGING_DIR_HOST)/lib -DNO_NATIVE_SUPPORT
|
||||
ifneq ($(HOST_OS),Linux)
|
||||
CFLAGS += -Dloff_t=off_t -D__BYTE_ORDER=BYTE_ORDER -include getline.h -include endian.h -I$(CURDIR)/include -include fls.h
|
||||
ifneq ($(CONFIG_LINUX_2_4),y)
|
||||
FILES += \
|
||||
mkfs.ubifs \
|
||||
mtdinfo \
|
||||
ubiattach \
|
||||
ubiblock \
|
||||
ubicrc32 \
|
||||
ubidetach \
|
||||
ubiformat \
|
||||
ubimkvol \
|
||||
ubinfo \
|
||||
ubinize \
|
||||
deubinize \
|
||||
ubirename \
|
||||
ubirmvol \
|
||||
ubirsvol \
|
||||
ubiupdatevol
|
||||
endif
|
||||
|
||||
MTD_MAKEOPTS = \
|
||||
CFLAGS="$(CFLAGS)" \
|
||||
LDFLAGS="$(HOST_LDFLAGS) $(HOST_STATIC_LINKING)" \
|
||||
WITHOUT_LZO=1 WITHOUT_XATTR=1 \
|
||||
LZMA_STATIC_LIB="$(STAGING_DIR_HOST)/lib/liblzma.a" \
|
||||
SUBDIRS="" \
|
||||
BUILDDIR="$(HOST_BUILD_DIR)"
|
||||
|
||||
define Host/Compile
|
||||
$(MAKE) -C $(HOST_BUILD_DIR)/lib \
|
||||
$(MTD_MAKEOPTS) \
|
||||
TARGETS="libmtd.a libcrc32.a" \
|
||||
LIBS="libmtd libcrc32"
|
||||
$(MAKE) -C $(HOST_BUILD_DIR) \
|
||||
$(MTD_MAKEOPTS) \
|
||||
TARGETS=mkfs.jffs2
|
||||
$(MAKE) -C $(HOST_BUILD_DIR)/ubi-utils \
|
||||
$(MTD_MAKEOPTS) \
|
||||
TARGETS=ubinize
|
||||
$(MAKE) -C $(HOST_BUILD_DIR)/mkfs.ubifs \
|
||||
$(MTD_MAKEOPTS) \
|
||||
BUILDDIR="$(HOST_BUILD_DIR)/mkfs.ubifs"
|
||||
define PartGen
|
||||
define Package/mtd-utils-$(subst _,-,$(1))
|
||||
TITLE:=MTD $(1)
|
||||
URL:=http://www.linux-mtd.infradead.org/
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=mtd-utils +zlib +liblzo +libuuid
|
||||
endef
|
||||
endef
|
||||
|
||||
define Host/Install
|
||||
$(CP) \
|
||||
$(HOST_BUILD_DIR)/mkfs.jffs2 \
|
||||
$(HOST_BUILD_DIR)/mkfs.ubifs/mkfs.ubifs \
|
||||
$(HOST_BUILD_DIR)/ubinize \
|
||||
$(STAGING_DIR_HOST)/bin/
|
||||
define Package/mtd-utils
|
||||
TITLE:=Utilities for flash info/debug
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Host/Clean
|
||||
rm -f $(STAGING_DIR_HOST)/bin/{mkfs.jffs2,mkfs.ubifs,ubinize}
|
||||
define Package/mtd-utils/description
|
||||
Utilities for manipulating memory technology devices.
|
||||
endef
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
define Package/mtd-utils/install
|
||||
true
|
||||
endef
|
||||
|
||||
$(foreach file,$(FILES),$(eval $(call PartGen,$(file))))
|
||||
|
||||
MAKE_FLAGS += \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)" \
|
||||
BUILDDIR="$(PKG_BUILD_DIR)" \
|
||||
LDLIBS+="$(LIBGCC_S)" \
|
||||
WITHOUT_XATTR=1
|
||||
|
||||
ifeq ($(CONFIG_LINUX_2_4),y)
|
||||
MAKE_FLAGS += \
|
||||
SUBDIRS=""
|
||||
endif
|
||||
|
||||
define PartInstall
|
||||
define Package/mtd-utils-$(subst _,-,$(1))/install
|
||||
$(INSTALL_DIR) \
|
||||
$$(1)/usr/sbin
|
||||
|
||||
$(INSTALL_BIN) \
|
||||
$(PKG_INSTALL_DIR)/usr/sbin/$(1) \
|
||||
$$(1)/usr/sbin/
|
||||
endef
|
||||
endef
|
||||
|
||||
$(foreach file,$(FILES),$(eval $(call PartInstall,$(file))))
|
||||
|
||||
$(eval $(call BuildPackage,mtd-utils))
|
||||
$(foreach file,$(FILES),$(eval $(call BuildPackage,mtd-utils-$(subst _,-,$(file)))))
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#include <string.h>
|
||||
#define fls local_fls
|
||||
@@ -1,18 +0,0 @@
|
||||
#ifndef _LINUX_TYPES_H
|
||||
#define _LINUX_TYPES_H
|
||||
|
||||
#include <mtd/ubi-media.h>
|
||||
|
||||
typedef uint16_t __u16;
|
||||
typedef uint32_t __u32;
|
||||
typedef uint64_t __u64;
|
||||
|
||||
typedef __u16 __le16;
|
||||
typedef __u32 __le32;
|
||||
typedef __u64 __le64;
|
||||
typedef __u64 off64_t;
|
||||
|
||||
typedef __u16 __sum16;
|
||||
typedef __u32 __wsum;
|
||||
|
||||
#endif /* _LINUX_TYPES_H */
|
||||
40
natalie-dect-h/Makefile
Normal file
40
natalie-dect-h/Makefile
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# Copyright (C) 2006-2008 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=natalie-dect-h
|
||||
PKG_VERSION:=12.26
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/natalie-dect-h
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9e2236989ff58d0db897f938b6b07b535144e0e2
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
define Package/natalie-dect-h
|
||||
SECTION:=net
|
||||
CATEGORY:=Base system
|
||||
TITLE:=Dect stack headers
|
||||
URL:=
|
||||
endef
|
||||
|
||||
define Package/natalie-dect-h/description
|
||||
Kernel dect driver headers
|
||||
endef
|
||||
|
||||
|
||||
define Package/natalie-dect-h/install
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include/natalie-dect
|
||||
$(CP) -r $(PKG_BUILD_DIR)/SrcHeaders/* $(STAGING_DIR)/usr/include/natalie-dect/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,natalie-dect-h))
|
||||
4
natalie-dect/Config.in
Normal file
4
natalie-dect/Config.in
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
config NATALIE_OPEN
|
||||
bool "Use pre-compiled version for Open SDK"
|
||||
default n
|
||||
63
natalie-dect/Makefile
Normal file
63
natalie-dect/Makefile
Normal file
@@ -0,0 +1,63 @@
|
||||
#
|
||||
# Copyright (C) 2006-2008 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=natalie-dect
|
||||
PKG_VERSION:=12.26
|
||||
|
||||
PKG_SOURCE_VERSION:=35fed3a10124bd660b74704011256039ba9cf54d
|
||||
ifeq ($(CONFIG_NATALIE_OPEN),y)
|
||||
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
|
||||
PKG_NAME:=natalie-dect-open
|
||||
else
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=git@private.inteno.se:natalie-dect-12.26
|
||||
PKG_SOURCE_PROTO:=git
|
||||
endif
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
|
||||
BCM_KERNEL_VERSION=`cat $(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-*/include/config/kernel.release`
|
||||
|
||||
export BUILD_DIR
|
||||
export BCM_KERNEL_VERSION
|
||||
|
||||
define Package/natalie-dect
|
||||
SECTION:=net
|
||||
CATEGORY:=Base system
|
||||
TITLE:=Dect stack
|
||||
URL:=
|
||||
DEPENDS:=bcmkernel
|
||||
endef
|
||||
|
||||
define Package/natalie-dect/description
|
||||
Kernel dect driver
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_NATALIE_OPEN),y)
|
||||
define Build/Compile
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/natalie-dect/install
|
||||
mkdir -p $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra/
|
||||
ifeq ($(CONFIG_NATALIE_OPEN),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/dect.ko $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra/dect.ko
|
||||
else
|
||||
$(CP) $(PKG_BUILD_DIR)/NatalieFpCvm6362/Src/Projects/NatalieV3/FpCvm/Linux6362/dects.ko $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra/dect.ko
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,natalie-dect))
|
||||
@@ -18,7 +18,7 @@ TARGET_CFLAGS += $(FPIC) -std=gnu99
|
||||
|
||||
define Package/netcheck
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libuci +libjson +questd
|
||||
DEPENDS:=+libuci +libjson-c +questd
|
||||
TITLE:=netcheck utility
|
||||
endef
|
||||
|
||||
|
||||
60
peripheral_manager/Makefile
Normal file
60
peripheral_manager/Makefile
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Copyright (C) 2006-2010 OpenWrt.org
|
||||
#
|
||||
# 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:=peripheral_manager
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=2a16b98543580d376d5862a34415f24d8be15b27
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=http://public.inteno.se/peripheral_manager
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
# 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/peripheral_manager
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Application deamon for handling of peripheral
|
||||
URL:=
|
||||
DEPENDS:=+libuci +libubus +libblobmsg-json bcmkernel
|
||||
endef
|
||||
|
||||
define Package/peripheral_manager/description
|
||||
Application handling peripheral
|
||||
endef
|
||||
|
||||
TARGET_CPPFLAGS := \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
$(TARGET_CPPFLAGS)
|
||||
|
||||
define Package/peripheral_manager/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/peripheral_manager $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpio_test $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,peripheral_manager))
|
||||
26
peripheral_manager/files/etc/init.d/peripheral_manager
Executable file
26
peripheral_manager/files/etc/init.d/peripheral_manager
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=19
|
||||
STOP=91
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=peripheral_manager
|
||||
PROG=/sbin/peripheral_manager
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" -f
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_running() {
|
||||
ubus -t 2 wait_for led.status
|
||||
ubus call led.status set '{"state":"ok"}'
|
||||
ubus -t 2 wait_for button
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /sbin/peripheral_manager
|
||||
}
|
||||
|
||||
83
picolisp/Makefile
Normal file
83
picolisp/Makefile
Normal file
@@ -0,0 +1,83 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=picolisp
|
||||
PKG_VERSION=3.1.10
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/picoLisp
|
||||
PKG_SOURCE:=picoLisp-$(PKG_VERSION).tgz
|
||||
PKG_SOURCE_URL:=http://software-lab.de/
|
||||
PKG_MD5SUM:=ac19fd6ff4d05dd2b15ea00d1ed591e7
|
||||
|
||||
PKG_BUILD_DEPENDS+= +libopenssl +@OPENSSL_WITH_EC2M
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/picolisp
|
||||
SECTION:=lang
|
||||
CATEGORY:=Languages
|
||||
TITLE:=PicoLisp interpreter
|
||||
DEPENDS:= +libopenssl +@OPENSSL_WITH_EC2M
|
||||
URL:=http://www.picolisp.org/
|
||||
MAINTAINER:=Jeronimo Pellegrini <j_p@aleph0.info>
|
||||
endef
|
||||
|
||||
define Package/picolisp/description
|
||||
Picolisp is yet another dialect of the Lisp language, specially written to be radically practical and simple.
|
||||
endef
|
||||
|
||||
TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
|
||||
|
||||
# A hack to make picoLisp's Makefile see the include path:
|
||||
MAKE_FLAGS += C_INCLUDE_PATH+=$(STAGING_DIR)/usr/include/
|
||||
|
||||
define Package/picolisp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/usr/lib/picolisp/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/picolisp/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/pil $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/psh $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/watchdog $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/picolisp $(1)/usr/bin/
|
||||
$(CP) $(PKG_BUILD_DIR)/*.l $(1)/usr/lib/picolisp/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/ht \
|
||||
$(PKG_BUILD_DIR)/lib/ext \
|
||||
$(PKG_BUILD_DIR)/lib/adm.l \
|
||||
$(PKG_BUILD_DIR)/lib/app.l \
|
||||
$(PKG_BUILD_DIR)/lib/boss.l \
|
||||
$(PKG_BUILD_DIR)/lib/btree.l \
|
||||
$(PKG_BUILD_DIR)/lib/conDbgc.l \
|
||||
$(PKG_BUILD_DIR)/lib/db.l \
|
||||
$(PKG_BUILD_DIR)/lib/debug.l \
|
||||
$(PKG_BUILD_DIR)/lib/edit.l \
|
||||
$(PKG_BUILD_DIR)/lib/ed.l \
|
||||
$(PKG_BUILD_DIR)/lib/form.l \
|
||||
$(PKG_BUILD_DIR)/lib/frac.l \
|
||||
$(PKG_BUILD_DIR)/lib/heartbeat.l \
|
||||
$(PKG_BUILD_DIR)/lib/http.l \
|
||||
$(PKG_BUILD_DIR)/lib/import.l \
|
||||
$(PKG_BUILD_DIR)/lib/led.l \
|
||||
$(PKG_BUILD_DIR)/lib/lint.l \
|
||||
$(PKG_BUILD_DIR)/lib/math32.l \
|
||||
$(PKG_BUILD_DIR)/lib/math64.l \
|
||||
$(PKG_BUILD_DIR)/lib/math.l \
|
||||
$(PKG_BUILD_DIR)/lib/misc.l \
|
||||
$(PKG_BUILD_DIR)/lib/pilog.l \
|
||||
$(PKG_BUILD_DIR)/lib/prof.l \
|
||||
$(PKG_BUILD_DIR)/lib/ps.l \
|
||||
$(PKG_BUILD_DIR)/lib/rsa.l \
|
||||
$(PKG_BUILD_DIR)/lib/scrape.l \
|
||||
$(PKG_BUILD_DIR)/lib/simul.l \
|
||||
$(PKG_BUILD_DIR)/lib/sq.l \
|
||||
$(PKG_BUILD_DIR)/lib/too.l \
|
||||
$(PKG_BUILD_DIR)/lib/xhtml.l \
|
||||
$(PKG_BUILD_DIR)/lib/xm.l \
|
||||
$(PKG_BUILD_DIR)/lib/xml.l \
|
||||
$(PKG_BUILD_DIR)/lib/xmlrpc.l $(1)/usr/lib/picolisp/lib/
|
||||
touch $(1)/usr/lib/picolisp/lib/tags
|
||||
$(STRIP) $(1)/usr/bin/picolisp
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,picolisp))
|
||||
43
picolisp/patches/001-mips.diff
Normal file
43
picolisp/patches/001-mips.diff
Normal file
@@ -0,0 +1,43 @@
|
||||
diff -Nur picoLisp/Makefile picoLisp-new/Makefile
|
||||
--- picoLisp/Makefile 1969-12-31 21:00:00.000000000 -0300
|
||||
+++ picoLisp-new/Makefile 2015-06-02 15:38:07.469726899 -0300
|
||||
@@ -0,0 +1,6 @@
|
||||
+all:
|
||||
+ (cd src; make)
|
||||
+
|
||||
+clean:
|
||||
+ (cd src; make clean)
|
||||
+
|
||||
diff -Nur picoLisp/src/Makefile picoLisp-new/src/Makefile
|
||||
--- picoLisp/src/Makefile 2015-03-31 15:48:22.000000000 -0300
|
||||
+++ picoLisp-new/src/Makefile 2015-06-02 15:40:43.541491599 -0300
|
||||
@@ -6,9 +6,13 @@
|
||||
|
||||
picoFiles = main.c gc.c apply.c flow.c sym.c subr.c big.c io.c net.c tab.c
|
||||
|
||||
-CC = gcc
|
||||
+#CC = gcc
|
||||
# CCLD is the cc (compiler frontend) to use for the link step.
|
||||
-CCLD = gcc
|
||||
+#CCLD = gcc
|
||||
+
|
||||
+# Honor the $(CC) variable, inherited form the environment (it's essential
|
||||
+# when cross-compiling)
|
||||
+CCLD = $(CC)
|
||||
|
||||
CFLAGS = -c -O2 -pipe \
|
||||
-falign-functions=32 -fomit-frame-pointer -fno-strict-aliasing \
|
||||
@@ -19,10 +23,10 @@
|
||||
|
||||
ifeq ($(shell uname), Linux)
|
||||
OS = Linux
|
||||
- CFLAGS += -m32
|
||||
- PICOLISP-FLAGS = -m32 -rdynamic
|
||||
+ CFLAGS += -mabi=32 -fPIC
|
||||
+ PICOLISP-FLAGS = -rdynamic
|
||||
LIB-FLAGS = -lm -ldl
|
||||
- DYNAMIC-LIB-FLAGS = -m32 -shared -export-dynamic
|
||||
+ DYNAMIC-LIB-FLAGS = -shared -export-dynamic -fPIC
|
||||
LCRYPT = -lcrypt
|
||||
STRIP = strip
|
||||
else
|
||||
@@ -8,13 +8,12 @@ PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/port-management
|
||||
CATEGORY:=Base system
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Port management tool
|
||||
endef
|
||||
|
||||
define Package/port-management/description
|
||||
port-management contains necessary tools to create
|
||||
layer2 interfaces
|
||||
Port configuration utility
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
|
||||
@@ -12,14 +12,14 @@ check_for_config(){
|
||||
if [ -s "/etc/config/ports" ]
|
||||
then
|
||||
debug_print "file exists and has content"
|
||||
if uci -q show ports >/dev/null #are there any valid content then continue
|
||||
if uci -q get ports.@ethport[0] >/dev/null #are there any valid content then continue
|
||||
then
|
||||
return 0
|
||||
else
|
||||
rm -f /etc/config/ports
|
||||
fi
|
||||
fi
|
||||
debug_print "file doesent exsists or is empty"
|
||||
debug_print "ports config file doesn't exsist or is empty"
|
||||
touch /etc/config/ports
|
||||
local portnames="$(db get hw.board.ethernetPortNames)"
|
||||
local portorder="$(db get hw.board.ethernetPortOrder)"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user