mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 03:24:14 +08:00
Compare commits
8 Commits
ledBlinkin
...
fredrik_uc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21f81a918f | ||
|
|
c5048d8ea3 | ||
|
|
33580c651a | ||
|
|
a7b955d5dc | ||
|
|
67f627bce9 | ||
|
|
cb1cd287e2 | ||
|
|
4c4ceacd10 | ||
|
|
fc7df2af6d |
31
4g-support/Makefile
Normal file
31
4g-support/Makefile
Normal file
@@ -0,0 +1,31 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
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/4g-support
|
||||
CATEGORY:=Network
|
||||
TITLE:=4G Network Setup Tools
|
||||
endef
|
||||
|
||||
define Package/4g-support/description
|
||||
4g-support contains necessary tools to setup 4G WAN connection
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/4g-support/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(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
|
||||
|
||||
74
4g-support/files/etc/hotplug.d/usb/30-usbnet
Normal file
74
4g-support/files/etc/hotplug.d/usb/30-usbnet
Normal file
@@ -0,0 +1,74 @@
|
||||
#!/bin/sh
|
||||
|
||||
local usb_dir uVid uPid uMa uPr uSe bConf bNumConfs vendor product mdmtyp netdev comdev cdcdev ttydev interface 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)
|
||||
interface=$(cat $usb_dir/interface)
|
||||
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
|
||||
|
||||
#devno=$(basename $DEVPATH)
|
||||
|
||||
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
|
||||
ubus send hotplug.usb "{'action': 'add', 'devpath': '$DEVPATH', 'manufacturer': '$uMa', 'product': '$uPr', 'serial': '$uSe', 'vendor_id': '$uVid', \
|
||||
'product_id': '$uPid', 'driver_interface': '$interface', 'driver': '$DRIVER', 'devtype': '$DEVTYPE'}"
|
||||
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$ACTION" = remove ]; then
|
||||
if [ -n "$usbno" ] && [ -n "$usbbr" ]; then
|
||||
sed -i "/$usbno:$usbbr/ d" /var/usbnets
|
||||
ubus send hotplug.usb "{'action': 'remove', 'devpath': '$DEVPATH', 'manufacturer': '$uMa', 'product': '$uPr', 'serial': '$uSe', 'vendor_id': '$uVid', \
|
||||
'product_id': '$uPid', 'driver_interface': '$interface', 'driver': '$DRIVER', 'devtype': '$DEVTYPE'}"
|
||||
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
|
||||
771
asterisk-1.8.x-mod/Makefile
Normal file
771
asterisk-1.8.x-mod/Makefile
Normal file
@@ -0,0 +1,771 @@
|
||||
#
|
||||
# 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:=1618b4881a44ea493c602da5c60723c45509719a
|
||||
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 +libsqlite3
|
||||
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-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-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-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-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
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2016 inteno
|
||||
#
|
||||
# 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:=ated
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=f614cba983d827d5185c60a6a5a35530621d44d2
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/mediatek/ated.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/ated
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Daemon for handling wifi calibration
|
||||
URL:=
|
||||
DEPENDS:= libc
|
||||
endef
|
||||
|
||||
define Package/ated/description
|
||||
Daemon for handling wifi calibration
|
||||
endef
|
||||
|
||||
#TARGET_CFLAGS += -I$(LINUX_DIR)/include -I$(LINUX_DIR)/arch/mips/include
|
||||
|
||||
MAKE_FLAGS += \
|
||||
v=2 \
|
||||
m=3
|
||||
|
||||
|
||||
#TARGET_CPPFLAGS := \
|
||||
# -I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
|
||||
# -I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
# $(TARGET_CPPFLAGS)
|
||||
|
||||
# we donot wwant to have any install.
|
||||
define Build/Install/Default
|
||||
endef
|
||||
|
||||
define Package/ated/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ated $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ated))
|
||||
@@ -1,62 +0,0 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bashdb
|
||||
PKG_VERSION:=4.4-0.92
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
#PKG_SOURCE_URL:=http://sourceforge.net/projects/bashdb/files/bashdb/$(PKG_VERSION)
|
||||
PKG_SOURCE_URL:=@SF/bashdb/
|
||||
PKG_MD5SUM:=b72c17870bfab2fd791b1f6de4d79f9e
|
||||
#PKG_CAT:=zcat
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Bash script debugging utility.
|
||||
URL:=http://sourceforge.net/projects/bashdb/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Bash script debugging utility.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
CFLAGS="$(TARGET_CFLAGS) -DLINUX $(TARGET_CPPFLAGS) \
|
||||
-I./src" \
|
||||
LIBS="$(TARGET_LDFLAGS)" \
|
||||
DESTDIR="$(PKG_INSTALL_DIR)"
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bashdb $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/share
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.sh $(1)/usr/share/$(PKG_NAME)/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.inc $(1)/usr/share/$(PKG_NAME)/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/init
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/init/*.sh $(1)/usr/share/$(PKG_NAME)/init/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/command
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/command/show_sub
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/command/set_sub
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/command/info_sub
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/command/*.sh $(1)/usr/share/$(PKG_NAME)/command/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/command/show_sub/*.sh $(1)/usr/share/$(PKG_NAME)/command/show_sub/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/command/set_sub/*.sh $(1)/usr/share/$(PKG_NAME)/command/set_sub/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/command/info_sub/*.sh $(1)/usr/share/$(PKG_NAME)/command/info_sub/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)/lib
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/lib/*.sh $(1)/usr/share/$(PKG_NAME)/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bashdb))
|
||||
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.
@@ -10,16 +10,12 @@ USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
local enable=0
|
||||
local filter=0
|
||||
local filter=0
|
||||
|
||||
config_load catv
|
||||
config_get_bool enable catv enable 0
|
||||
config_get filter catv filter
|
||||
if [ $enable -eq 0 ]; then
|
||||
ubus call catv set-enable "{\"enable\":\"off\"}"
|
||||
else
|
||||
ubus call catv set-enable "{\"enable\":\"on\"}"
|
||||
fi
|
||||
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\"}"
|
||||
|
||||
}
|
||||
|
||||
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.24
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/dectmngr
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=6ba403663bc9cfdb8f89fb34de367f0796d68552
|
||||
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"}'
|
||||
}
|
||||
@@ -8,10 +8,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.3.0
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/dectmngr2
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=5a5c94b289c79bc3a635b8d742dd9b73dcc0615f
|
||||
PKG_SOURCE_VERSION:=46658e95b19c35ff6194a9566bb5439720ec251d
|
||||
PKG_NAME:=dectmngr2
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ export BUILD_DIR
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -29,7 +28,7 @@ define Package/dectmngr2
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Dectmngr2
|
||||
URL:=
|
||||
DEPENDS:= +natalie-dect-h bcmkernel +libubox +ubus +libpicoevent
|
||||
DEPENDS:= +natalie-dect-h bcmkernel +libubox +ubus
|
||||
endef
|
||||
|
||||
define Package/dectmngr2/description
|
||||
@@ -42,7 +41,6 @@ define Package/dectmngr2/install
|
||||
$(INSTALL_DIR) $(1)/etc/dect/
|
||||
$(INSTALL_DIR) $(1)/etc/config/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults/
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dectmngr2 $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/target.bin $(1)/etc/dect/
|
||||
@@ -50,7 +48,6 @@ define Package/dectmngr2/install
|
||||
$(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
|
||||
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dectmngr2))
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# Workaround for product DG400 which has an
|
||||
# incorrect value in nvram from factory.
|
||||
|
||||
if [ -e "/proc/nvram/BoardId" ]; then
|
||||
boardid=$(cat /proc/nvram/BoardId)
|
||||
ulBoardStuffOption=$(cat /proc/nvram/ulBoardStuffOption)
|
||||
|
||||
if [ "$boardid" = "DG400R0" -a "$ulBoardStuffOption" = "0xffffffff" ]; then
|
||||
echo "0xfffffff2" >/proc/nvram/ulBoardStuffOption
|
||||
|
||||
db -q batch <<-EOT
|
||||
set hw.board.hasDect=1
|
||||
commit hw.board
|
||||
EOT
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7522faab4142fe2c0ac8cbf71bb0cc5bd49f0750
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
TARGET_PLATFORM=MARVELL
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
TARGET_PLATFORM=INTEL
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET)
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
|
||||
define Package/dslmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=XDSL status and configration utility
|
||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +easy-soc-libs
|
||||
endef
|
||||
|
||||
define Package/dslmngr/description
|
||||
This package can be used to configure and provide status about
|
||||
the XDSL subsystem through UBUS.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
FPIC="$(FPIC)"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/dslmngr/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
|
||||
endef
|
||||
|
||||
define Package/dslmngr/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dslmngr $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dslmngr))
|
||||
@@ -1,37 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-qos
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/easy-qos
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Easy QoS
|
||||
endef
|
||||
|
||||
define Package/easy-qos/description
|
||||
This package contains Easy QoS utitie
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/easy-qos/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
|
||||
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
|
||||
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,easy-qos))
|
||||
@@ -1 +0,0 @@
|
||||
/etc/init.d/easy_qos reload
|
||||
@@ -1,140 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos.ebtable -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
"low")
|
||||
echo 1;;
|
||||
"besteffort")
|
||||
echo 2;;
|
||||
"normal")
|
||||
echo 3;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 5;;
|
||||
"high")
|
||||
echo 6;;
|
||||
"highest")
|
||||
echo 7;;
|
||||
esac
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log ebtables -t broute -D BROUTING ${rule}
|
||||
rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
|
||||
done
|
||||
}
|
||||
|
||||
create_rule() {
|
||||
local protocol=$1; shift
|
||||
local mac=$1; shift
|
||||
local mark="0x$1"; shift
|
||||
local forward_port=$1;
|
||||
local cmd="";
|
||||
local protocol_number
|
||||
|
||||
cmd="-j mark --mark-or ${mark}";
|
||||
if [ -n "${forward_port}" ]; then
|
||||
cmd="--ip-destination-port ${forward_port} ${cmd}";
|
||||
fi
|
||||
|
||||
case "${protocol}" in
|
||||
"tcp")
|
||||
protocol_number=6;;
|
||||
"udp")
|
||||
protocol_number=17;;
|
||||
"dccp")
|
||||
protocol_number=33;;
|
||||
"sctp")
|
||||
protocol_number=132;;
|
||||
*)
|
||||
log "Protocol ${protocol} not supported in ebtables"
|
||||
return;;
|
||||
esac
|
||||
|
||||
cmd="--ip-proto ${protocol_number} $cmd"
|
||||
cmd="-p ip $cmd"
|
||||
|
||||
cmd="-s ${mac} $cmd"
|
||||
exec_log ebtables -t broute -A BROUTING ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num protocol
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
protocol=$(echo ${proto}|tr [A-Z] [a-z])
|
||||
prio_num=$(get_priority ${priority})
|
||||
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
|
||||
for p in ${port}; do
|
||||
if [ "${protocol}" == "none" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num} ${p}
|
||||
create_rule udp ${macaddr} ${prio_num} ${p}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num} ${p}
|
||||
fi
|
||||
done
|
||||
# Create rule for all ports if port is not mentioned in uci
|
||||
if [ -z "${port}" ]; then
|
||||
if [ "${protocol}" == "none" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num}
|
||||
create_rule udp ${macaddr} ${prio_num}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# Do not apply rules if ebtables is not present in system
|
||||
[ -x /usr/sbin/ebtables ] || return;
|
||||
|
||||
clear_existing_rules
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
}
|
||||
|
||||
start_service() {
|
||||
reload_service
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos"
|
||||
}
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
CLIENT_LIST="/tmp/easy_qos_client.list"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
"low")
|
||||
echo 1;;
|
||||
"besteffort")
|
||||
echo 2;;
|
||||
"normal")
|
||||
echo 3;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 5;;
|
||||
"high")
|
||||
echo 6;;
|
||||
"highest")
|
||||
echo 7;;
|
||||
esac
|
||||
}
|
||||
|
||||
clean_client_entries() {
|
||||
[ -f ${CLIENT_LIST} ] && rm ${CLIENT_LIST}
|
||||
}
|
||||
|
||||
map_client_entries() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(ubus call router.network 'clients')"
|
||||
json_get_keys keys
|
||||
|
||||
for key in ${keys};
|
||||
do
|
||||
json_select ${key}
|
||||
json_get_vars ipaddr macaddr hostname
|
||||
clients="${macaddr} ${ipaddr} ${hostname};${clients}"
|
||||
json_select ..
|
||||
done
|
||||
|
||||
json_init
|
||||
|
||||
# json_add_array "clients"
|
||||
IFS=";"
|
||||
for client in ${clients};
|
||||
do
|
||||
macaddr=$(echo ${client} | cut -d" " -f1)
|
||||
json_add_object "${macaddr//:/_}"
|
||||
json_add_string "ip" "$(echo ${client} | cut -d" " -f2)"
|
||||
json_add_string "macaddr" "$(echo ${client} | cut -d" " -f1)"
|
||||
json_add_string "host" "$(echo ${client} | cut -d" " -f3)"
|
||||
json_close_object
|
||||
done
|
||||
|
||||
IFS=' '
|
||||
echo `json_dump` > ${CLIENT_LIST}
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# Find the IP of a corresponding mac from arp table
|
||||
get_ipaddress() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(cat ${CLIENT_LIST})"
|
||||
json_get_keys keys
|
||||
|
||||
# jshn seems a bit iffy on having : in key, replace by _
|
||||
json_select "${1//:/_}" 2 > /dev/null
|
||||
json_get_var ip ip
|
||||
|
||||
echo "$ip"
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(iptables -t mangle -S OUTPUT|grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log iptables -t mangle ${rule}
|
||||
rule=$(iptables -t mangle -S OUTPUT|grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
done
|
||||
}
|
||||
|
||||
check_and_create() {
|
||||
iptables -t mangle -C OUTPUT ${@} 2>/dev/null
|
||||
# Create rule if not exists
|
||||
if [ ${?} -ne 0 ]; then
|
||||
exec_log iptables -t mangle -A OUTPUT ${@}
|
||||
else
|
||||
log "Rule exists for ${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
create_rule() {
|
||||
local proto=$1; shift
|
||||
local src_ip=$1; shift
|
||||
local mark="0x$1/0x$1"; shift
|
||||
local ports=$1;
|
||||
local cmd="";
|
||||
|
||||
cmd="-j MARK --set-xmark ${mark}";
|
||||
if [ -n "${ports}" ]; then
|
||||
cmd="--match multiport --dports ${ports} ${cmd}";
|
||||
fi
|
||||
|
||||
if [ "${proto}" == "icmp" ]; then
|
||||
cmd="-p icmp -m icmp --icmp-type 8 $cmd"
|
||||
elif [ "${proto}" == "all" ]; then
|
||||
cmd="-p all $cmd"
|
||||
else
|
||||
cmd="-p ${proto} -m ${proto} $cmd"
|
||||
fi
|
||||
cmd="-s ${src_ip} $cmd"
|
||||
|
||||
check_and_create ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num ip port_list
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
prio_num=$(get_priority ${priority})
|
||||
ip=$(get_ipaddress ${macaddr})
|
||||
port_list=$(echo ${port}|sed 's/ /,/g')
|
||||
|
||||
if [ -n "${ip}" -a -n "${prio_num}" ]; then
|
||||
if [ "${proto}" == "none" ]; then
|
||||
create_rule tcp ${ip} ${prio_num} ${port_list}
|
||||
create_rule udp ${ip} ${prio_num} ${port_list}
|
||||
else
|
||||
create_rule ${proto} ${ip} ${prio_num} ${port_list}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
clear_existing_rules
|
||||
map_client_entries
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
clean_client_entries
|
||||
}
|
||||
|
||||
start_service() {
|
||||
reload_service
|
||||
echo "Easy QoS installed">/dev/console;
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos"
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
# Add firewall include
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.easyqos
|
||||
set firewall.easyqos=include
|
||||
set firewall.easyqos.path=/etc/firewall.easyqos
|
||||
set firewall.easyqos.reload=1
|
||||
uci del_list firewall.easyqos._access_w="root"
|
||||
uci add_list firewall.easyqos._access_w="root"
|
||||
commit firewall
|
||||
EOT
|
||||
@@ -1,23 +0,0 @@
|
||||
if (PACKAGE_libwifi || PACKAGE_libdsl || PACKAGE_libethernet)
|
||||
menu "configurations"
|
||||
|
||||
config IOP_LLA_LIBS_DEBUG
|
||||
bool "Enable debugging support"
|
||||
default n
|
||||
|
||||
config LIBWIFI_DEBUG
|
||||
depends on PACKAGE_libwifi
|
||||
bool "Enable wifi debugging"
|
||||
default n
|
||||
|
||||
config LIBDSL_DEBUG
|
||||
depends on PACKAGE_libdsl
|
||||
bool "Enable xdsl debugging"
|
||||
default n
|
||||
|
||||
config LIBDSL_TEST
|
||||
depends on PACKAGE_libdsl
|
||||
bool "Libdsl test program"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
@@ -1,159 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4c204761a38a27ff9ff7021c3c34b92d7e3fdb84
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@inteno.se>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/easy-soc-libs
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=IOPSYS easy SoC libraries
|
||||
SUBMENU:=IOPSYS easy SoC libraries
|
||||
DEPENDS:=+libopenssl
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/libwifi/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/libwifi
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= WiFi library (libwifi)
|
||||
DEPENDS+=+TARGET_intel_mips:libnl +TARGET_intel_mips:libnl-route
|
||||
endef
|
||||
|
||||
define Package/libethernet
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= Ethernet library (libethernet)
|
||||
DEPENDS+=+TARGET_iopsys_ramips:swconfig
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138 \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
|
||||
KERNEL_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138 \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
TARGET_PLATFORM=MARVELL
|
||||
TARGET_CFLAGS +=-DIOPSYS_MARVELL
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
TARGET_PLATFORM=INTEL
|
||||
TARGET_CFLAGS +=-DIOPSYS_INTEL
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET)
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
|
||||
ifdef CONFIG_IOP_LLA_LIBS_DEBUG
|
||||
TARGET_CFLAGS += -DIOP_LLA_LIBS_DEBUG
|
||||
endif
|
||||
|
||||
define Package/libdsl
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= XDSL library (libdsl)
|
||||
DEPENDS+=+TARGET_intel_mips:dsl-cpe-api-vrx +TARGET_intel_mips:dsl-cpe-fapi
|
||||
endef
|
||||
|
||||
subdirs := \
|
||||
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
|
||||
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
|
||||
$(if $(CONFIG_PACKAGE_libethernet),libethernet)
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
FPIC="$(FPIC)" \
|
||||
PLATFORM="$(TARGET_PLATFORM)" \
|
||||
subdirs="$(subdirs)"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/easy-soc-libs/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/InstallDev/libwifi
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libdsl
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/xdsl.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libethernet
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libethernet/ethernet.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default)
|
||||
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
||||
$(MAKE) -C "$(PKG_BUILD_DIR)/libdsl/test" $(MAKE_FLAGS)
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));)
|
||||
endef
|
||||
|
||||
define Package/libwifi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libethernet/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libdsl/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
||||
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/test/libdsl_test $(1)/usr/bin/
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libwifi))
|
||||
$(eval $(call BuildPackage,libdsl))
|
||||
$(eval $(call BuildPackage,libethernet))
|
||||
0
endptmngr/Config.in → endptcfg/Config.in
Executable file → Normal file
0
endptmngr/Config.in → endptcfg/Config.in
Executable file → Normal file
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))
|
||||
@@ -1,66 +0,0 @@
|
||||
#
|
||||
# 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:=0.2
|
||||
PKG_SOURCE_VERSION:=631e61b7ab5d86f2f4c86756a117badff9fb0f2c
|
||||
|
||||
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
|
||||
PKG_SOURCE:=endptmngr-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
|
||||
PKG_NAME:=endptmngr-open
|
||||
else
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/endptmngr
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_NAME:=endptmngr
|
||||
endif
|
||||
|
||||
RSTRIP:=true
|
||||
export BUILD_DIR
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/endptmngr/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/endptmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Brcmslic
|
||||
URL:=
|
||||
DEPENDS:= +libubox +ubus +libpicoevent +PACKAGE_bcmkernel:bcmkernel +PACKAGE_bcmopen:bcmopen
|
||||
endef
|
||||
|
||||
define Package/endptmngr/description
|
||||
endptmngr
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
endif
|
||||
|
||||
|
||||
define Package/endptmngr/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
cp $(PKG_BUILD_DIR)/files/etc/init.d/* $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/endptmngr $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,endptmngr))
|
||||
@@ -1,58 +0,0 @@
|
||||
#
|
||||
# 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:=fatrace
|
||||
PKG_VERSION:=0.12
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=98af6019a4a1b478a6fa35f74528cb3cd404ae40
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://git.launchpad.net/fatrace
|
||||
|
||||
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
|
||||
|
||||
PKG_CONFIG_DEPENDS := CONFIG_KERNEL_FANOTIFY
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fatrace
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Report system wide file access events
|
||||
URL:=
|
||||
DEPENDS := +@KERNEL_FANOTIFY
|
||||
endef
|
||||
|
||||
define Package/fatrace/description
|
||||
Report system wide file access events.
|
||||
endef
|
||||
|
||||
MAKE_INSTALL_FLAGS += PREFIX="/"
|
||||
|
||||
define Package/fatrace/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/fatrace $(1)/sbin/
|
||||
# $(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fatrace))
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
diff --git a/fatrace.c b/fatrace.c
|
||||
index 1c0899a..b7d1560 100644
|
||||
--- a/fatrace.c
|
||||
+++ b/fatrace.c
|
||||
@@ -44,7 +44,8 @@
|
||||
* http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1e2ee49f7
|
||||
* O_LARGEFILE is usually 0, so hardcode it here
|
||||
*/
|
||||
-#define KERNEL_O_LARGEFILE 00100000
|
||||
+//#define KERNEL_O_LARGEFILE 00100000
|
||||
+#define KERNEL_O_LARGEFILE O_LARGEFILE
|
||||
|
||||
/* command line options */
|
||||
static char* option_output = NULL;
|
||||
@@ -1,12 +0,0 @@
|
||||
diff --git a/fatrace.c b/fatrace.c
|
||||
index b7d1560..6179272 100644
|
||||
--- a/fatrace.c
|
||||
+++ b/fatrace.c
|
||||
@@ -149,6 +149,7 @@ print_event(const struct fanotify_event_metadata *data,
|
||||
printf ("%li.%06li ", event_time->tv_sec, event_time->tv_usec);
|
||||
}
|
||||
printf ("%s(%i): %s %s\n", procname, data->pid, mask2str (data->mask), pathname);
|
||||
+ fflush(stdout);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1,54 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fping
|
||||
PKG_VERSION:=4.0
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://fping.org/dist/
|
||||
PKG_HASH:=67eb4152b98ad34f99d2eec4e1098a0bb52caf13c0c89cd147349d08190fe8ce
|
||||
|
||||
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
|
||||
PKG_LICENSE:=BSD-4-Clause
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/fping
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=sends ICMP ECHO_REQUEST packets to network hosts
|
||||
URL:=http://fping.org/
|
||||
endef
|
||||
|
||||
|
||||
define Package/fping/description
|
||||
fping is a ping like program which uses the Internet Control Message Protocol
|
||||
(ICMP) echo request to determine if a target host is responding. fping
|
||||
differs from ping in that you can specify any number of targets on the command
|
||||
line, or specify a file containing the lists of targets to ping. Instead of
|
||||
sending to one target until it times out or replies, fping will send out a
|
||||
ping packet and move on to the next target in a round-robin fashion.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--enable-ipv4 \
|
||||
--enable-ipv6
|
||||
|
||||
TARGET_CFLAGS += -std=gnu99
|
||||
|
||||
define Package/fping/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fping $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fping))
|
||||
3
gigaset-elements/.gitignore
vendored
3
gigaset-elements/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
|
||||
git-src
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gigaset-elements
|
||||
|
||||
PKG_VERSION:=2.4.2
|
||||
# PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_GIGASET_ELEMENTS_SRC_URL ?= git@dev.iopsys.eu:3rdparty/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:=aa906b37062b6d7937a9c0f8e7b62b32afe4bdeb
|
||||
|
||||
|
||||
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 +libpthread
|
||||
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))
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
# Copyright (c) 2017 Genexis B.V.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# version 2 as published by the Free Software Foundation.
|
||||
#
|
||||
# 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., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=gryphon-led-kernel-module
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/$(PKG_NAME)
|
||||
SUBMENU:=LED modules
|
||||
TITLE:=LED driver for Gryphon
|
||||
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
|
||||
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
|
||||
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
|
||||
PKG_LICENSE:=Genexis
|
||||
PKG_LICENSE_URL:=
|
||||
endef
|
||||
|
||||
define KernelPackage/$(PKG_NAME)/description
|
||||
This package contains the LED driver for Gryphon devices.
|
||||
endef
|
||||
|
||||
EXTRA_KCONFIG:= CONFIG_RGB_LED=m
|
||||
|
||||
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
|
||||
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/
|
||||
$(CP) src/* $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
SUBDIRS="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="-DKERNEL_MODULE $(BUILDFLAGS) -I$(LINUX_DIR)/include -include generated/autoconf.h $(MODULE_INCLUDE)" \
|
||||
modules
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,$(PKG_NAME)))
|
||||
@@ -1,26 +0,0 @@
|
||||
# Copyright (c) 2017 Genexis B.V.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# version 2 as published by the Free Software Foundation.
|
||||
#
|
||||
# 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., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
# 02110-1301 USA
|
||||
|
||||
MODULE_NAME = gryphon-led-kernel-module
|
||||
|
||||
obj-m := $(MODULE_NAME).o
|
||||
|
||||
GENEXIS_FILES= \
|
||||
main.o \
|
||||
sk9822.o \
|
||||
sk9822_bitbang.o
|
||||
|
||||
$(MODULE_NAME)-objs := $(GENEXIS_FILES)
|
||||
@@ -1,253 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#define DEBUG 1
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/printk.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
|
||||
#define DRIVER_NAME "canyon_led"
|
||||
#define DRIVER_AUTHOR "Genexis B.V."
|
||||
#define DRIVER_DESC "Canyon LED driver for SK9822"
|
||||
#define DRIVER_VERSION "1"
|
||||
|
||||
/**
|
||||
* sysfs interfaces
|
||||
*/
|
||||
|
||||
static ssize_t get_led_color(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
/* [ln] todo: dummy implementation */
|
||||
int len;
|
||||
|
||||
len = sprintf(buf, "%d\n", 123);
|
||||
if (len <= 0) {
|
||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set complete LED strip to a specific color
|
||||
* @retval count number of bytes written
|
||||
* @retval -EMSGSIZE if the message is too big
|
||||
* @retval -EIO for all other errors (e.g. leds cannot be configured)
|
||||
*/
|
||||
static ssize_t set_led_color(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
int ret = 0;
|
||||
size_t buflen = count;
|
||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
||||
|
||||
if (IS_ERR(sk9822)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* strip newline */
|
||||
if ((count > 0) && (buf[count-1] == '\n')) {
|
||||
buflen--;
|
||||
}
|
||||
|
||||
if (buflen != 6) { // RRGGBB\0
|
||||
return -EMSGSIZE;
|
||||
}
|
||||
|
||||
// Update the LED array here
|
||||
ret = sk9822_set_color_str(sk9822, buf);
|
||||
if (ret != 0) {
|
||||
printk(KERN_ERR "Failed to set led color\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
// Now push to the HW
|
||||
ret = sk9822_update(sk9822);
|
||||
if (ret != 0) {
|
||||
printk(KERN_ERR "Failed to update led\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR(led_color, S_IRUGO | S_IWUSR, get_led_color, set_led_color);
|
||||
|
||||
static struct attribute *sk9822_dev_attrs[] = {
|
||||
&dev_attr_led_color.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
static struct attribute_group sk9822_dev_attr_group = {
|
||||
.name = "sk9822",
|
||||
.attrs = sk9822_dev_attrs,
|
||||
};
|
||||
|
||||
/**
|
||||
* device prope and removal
|
||||
*/
|
||||
|
||||
static int canyon_led_probe(struct platform_device *pdev)
|
||||
{
|
||||
int ret;
|
||||
struct sk9822_leds *leds;
|
||||
|
||||
leds = devm_kzalloc(&pdev->dev, sizeof(*leds), GFP_KERNEL);
|
||||
if (!leds) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
leds->dev = &pdev->dev;
|
||||
leds->led_brightness = SK9822_DEFAULT_BRIGHTNESS;
|
||||
|
||||
ret = of_property_read_u16(pdev->dev.of_node, "led-count", &leds->led_count);
|
||||
if (ret < 0) {
|
||||
dev_warn(&pdev->dev, "Could not read led-count property\n");
|
||||
leds->led_count = SK9822_DEFAULT_NUM_LEDS;
|
||||
}
|
||||
|
||||
leds->led_colors = devm_kzalloc(&pdev->dev,
|
||||
(sizeof(cRGB) * leds->led_count), GFP_KERNEL);
|
||||
if (!leds->led_colors) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
platform_set_drvdata(pdev, leds);
|
||||
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 16, 0)
|
||||
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
||||
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0, GPIOD_OUT_HIGH);
|
||||
#else
|
||||
dev_warn(&pdev->dev, "Kernel version Not supported\n");
|
||||
exit(1);
|
||||
#endif
|
||||
|
||||
gpiod_direction_output(leds->clock_gpio, 1);
|
||||
if (IS_ERR(leds->clock_gpio)) {
|
||||
dev_err(&pdev->dev, "Failed to acquire clock GPIO %ld\n",
|
||||
PTR_ERR(leds->clock_gpio));
|
||||
leds->clock_gpio = NULL;
|
||||
return PTR_ERR(leds->clock_gpio);
|
||||
} else {
|
||||
printk(KERN_INFO "Got clock gpio\n");
|
||||
gpiod_set_value(leds->clock_gpio, 0);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3, 16, 0)
|
||||
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
||||
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1, GPIOD_OUT_HIGH);
|
||||
#else
|
||||
dev_warn(&pdev->dev, "Kernel version Not supported\n");
|
||||
exit(1);
|
||||
#endif
|
||||
|
||||
gpiod_direction_output(leds->data_gpio, 1);
|
||||
if (IS_ERR(leds->data_gpio)) {
|
||||
dev_err(&pdev->dev, "Failed to acquire data GPIO %ld\n",
|
||||
PTR_ERR(leds->data_gpio));
|
||||
leds->data_gpio = NULL;
|
||||
return PTR_ERR(leds->data_gpio);
|
||||
} else {
|
||||
printk(KERN_INFO "Got data gpio\n");
|
||||
gpiod_set_value(leds->data_gpio, 0);
|
||||
}
|
||||
|
||||
printk(KERN_INFO "Attempt to set filefs stuff\n");
|
||||
ret = sysfs_create_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "sysfs creation failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if 0
|
||||
printk(KERN_INFO "Flash LEDs to verify they work\n");
|
||||
sk9822_set_color_str(leds, "00FF00");
|
||||
sk9822_update(leds);
|
||||
msleep(200);
|
||||
sk9822_set_color_str(leds, "000000");
|
||||
sk9822_update(leds);
|
||||
#endif
|
||||
|
||||
printk(KERN_INFO "canyon led successfully probed\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int canyon_led_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sk9822_leds *leds;
|
||||
|
||||
sysfs_remove_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
|
||||
|
||||
leds = platform_get_drvdata(pdev);
|
||||
if (IS_ERR(leds)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (leds->clock_gpio) {
|
||||
gpiod_put(leds->clock_gpio);
|
||||
}
|
||||
|
||||
if (leds->data_gpio) {
|
||||
gpiod_put(leds->data_gpio);
|
||||
}
|
||||
|
||||
printk(KERN_NOTICE "Bye, bye\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* platform driver metadata
|
||||
*/
|
||||
|
||||
static const struct of_device_id canyon_led_of_ids[] = {
|
||||
{ .compatible = "canyon,led" },
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct platform_driver canyon_led = {
|
||||
.probe = &canyon_led_probe,
|
||||
.remove = &canyon_led_remove,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = canyon_led_of_ids,
|
||||
},
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, canyon_led_of_ids);
|
||||
module_platform_driver(canyon_led);
|
||||
MODULE_AUTHOR(DRIVER_AUTHOR);
|
||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||
MODULE_VERSION(DRIVER_VERSION);
|
||||
MODULE_LICENSE("GPL");
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
#include "sk9822_bitbang.h"
|
||||
|
||||
cRGB __hexs_to_rgb(const char *hex)
|
||||
{
|
||||
cRGB rgb;
|
||||
int r, g, b;
|
||||
|
||||
sscanf(hex, "%02x%02x%02x", &r, &g, &b);
|
||||
// This needs sanity checking
|
||||
rgb.r = r;
|
||||
rgb.g = g;
|
||||
rgb.b = b;
|
||||
return rgb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief update the color over the given device struct to the provided HEX color
|
||||
*/
|
||||
int sk9822_set_color_str(struct sk9822_leds *sk9822, const char *hex)
|
||||
{
|
||||
int i;
|
||||
cRGB color = __hexs_to_rgb(hex);
|
||||
|
||||
for (i = 0; i < sk9822->led_count; i++) {
|
||||
sk9822->led_colors[i] = color;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief write device struct to the device
|
||||
*/
|
||||
int sk9822_update(struct sk9822_leds *sk9822)
|
||||
{
|
||||
uint16_t i;
|
||||
uint16_t led_count = sk9822->led_count;
|
||||
|
||||
// Start Frame
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
sk9822_bb_write(sk9822, 0x00);
|
||||
|
||||
for (i = 0; i < led_count; i++) {
|
||||
cRGB *p = &sk9822->led_colors[i];
|
||||
sk9822_bb_write(sk9822, 0xe0+sk9822->led_brightness); // Maximum global brightness
|
||||
sk9822_bb_write(sk9822, p->b);
|
||||
sk9822_bb_write(sk9822, p->g);
|
||||
sk9822_bb_write(sk9822, p->r);
|
||||
}
|
||||
|
||||
// End frame
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
sk9822_bb_write(sk9822, 0xff);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef SK9822_H_
|
||||
#define SK9822_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define SK9822_DEFAULT_NUM_LEDS 32 // U16, used if DT param fails
|
||||
#define SK9822_DEFAULT_BRIGHTNESS 15 // 5-bit brightness, 0-31
|
||||
|
||||
typedef struct {
|
||||
uint8_t b;
|
||||
uint8_t g;
|
||||
uint8_t r;
|
||||
} cRGB; // BGR (SK9822 Standard)
|
||||
|
||||
struct sk9822_leds {
|
||||
struct device *dev;
|
||||
struct gpio_desc *clock_gpio;
|
||||
struct gpio_desc *data_gpio;
|
||||
|
||||
cRGB *led_colors;
|
||||
uint8_t led_brightness;
|
||||
uint16_t led_count;
|
||||
};
|
||||
|
||||
int sk9822_set_color_str(struct sk9822_leds *sk9822, const char *hex);
|
||||
int sk9822_update(struct sk9822_leds *sk9822);
|
||||
|
||||
#endif /* SK9822_H_ */
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
|
||||
/**
|
||||
* @brief Bitbang write operation CLOCK+DATA
|
||||
*
|
||||
* Assumed state before call: CLOCK- Low, DATA- High
|
||||
*/
|
||||
void sk9822_bb_write(struct sk9822_leds *sk9822, uint8_t c)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < 8 ; i++) {
|
||||
if (!(c&0x80)) {
|
||||
gpiod_set_value(sk9822->data_gpio, 0); // set data low
|
||||
} else {
|
||||
gpiod_set_value(sk9822->data_gpio, 1); // set data high
|
||||
}
|
||||
|
||||
gpiod_set_value(sk9822->clock_gpio, 1); // set clock high, data sampled here
|
||||
c <<= 1;
|
||||
udelay(1); // stretch clock
|
||||
gpiod_set_value(sk9822->clock_gpio, 0); // set clock low
|
||||
}
|
||||
|
||||
// State after call: SCK Low, Data high
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Genexis B.V.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _SK9822_BB_H_
|
||||
#define _SK9822_BB_H_
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
|
||||
void sk9822_bb_write(struct sk9822_leds *sk9822, uint8_t c);
|
||||
|
||||
#endif /* _SK9822_BB_H_ */
|
||||
@@ -5,10 +5,6 @@ PKG_NAME:=ice-client
|
||||
|
||||
CFMODULES:=$(filter CONFIG_PACKAGE_$(PKG_NAME)-%,$(.VARIABLES))
|
||||
CFMODULES:=$(subst CONFIG_PACKAGE_$(PKG_NAME)-,,$(CFMODULES))
|
||||
|
||||
#CFMODULES:=$(CFMODULES) webaccess texec iperf
|
||||
#CFMODULES:=$(sort $(CFMODULES))
|
||||
|
||||
$(info Building package: $(PKG_NAME))
|
||||
$(info Building with additional modules: $(CFMODULES))
|
||||
export CFMODULES
|
||||
@@ -19,34 +15,31 @@ export PLATFORM_INCLUDE:=platforms/iopsys/build.mk
|
||||
|
||||
export DATE:=$(shell date +%Y-%m-%d-%H-%M-%S)
|
||||
export LOGIN:=$(shell whoami)
|
||||
BASE_PKG_VERSION:=5.3.6
|
||||
PKG_RELEASE:=
|
||||
BASE_PKG_VERSION:=3.4.1
|
||||
PKG_RELEASE:=RC11
|
||||
PKG_VERSION:=$(BASE_PKG_VERSION)-$(PKG_RELEASE)_$(DATE)_$(LOGIN)
|
||||
export PKG_VERSION
|
||||
|
||||
###########################--RELEASE--################################
|
||||
|
||||
PKG_SOURCE_VERSION:=94aab1532fef2caf2d65579614fc413252a517eb
|
||||
PKG_SOURCE_VERSION:=184d29446fe6103f567c968bf35569625326a82c
|
||||
ifeq ($(CONFIG_ICE_OPEN),y)
|
||||
TARGET_PROFILE=$(shell echo $(CONFIG_TARGET_BOARD) | sed s/\"//g)
|
||||
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_SOURCE:=$(PKG_NAME)-$(TARGET_PROFILE)-$(BASE_PKG_VERSION)$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
SKIPHASH=1
|
||||
export SKIPHASH
|
||||
#PKG_NAME:=ice-client-open
|
||||
else
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@private.inteno.se:ice-client.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(BASE_PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(BASE_PKG_VERSION)-$(PKG_RELEASE).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
endif
|
||||
|
||||
|
||||
###########################--RELEASE--################################
|
||||
|
||||
#include $(INCLUDE_DIR)/uclibc++.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ice-client/Default
|
||||
@@ -79,7 +72,7 @@ endef
|
||||
# PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(BASE_PKG_VERSION)
|
||||
#
|
||||
#
|
||||
# These settings allow you to specify a source folder where your source code is located
|
||||
# These settings allow you to specify a soruce folder where your source code is located
|
||||
# This avoids having to tar-zip or fetch from git each time
|
||||
# Changes can be done in your sources while the build is performed somewhere else
|
||||
# If you forget some settings, your source folder will be deleted!!! So be carefull and
|
||||
@@ -88,6 +81,7 @@ endef
|
||||
#define Build/Prepare
|
||||
# rm -rf $(PKG_BUILD_DIR)
|
||||
# ln -s /home/erik/Desktop/ice-client $(PKG_BUILD_DIR)
|
||||
## ln -s /home/erik/Desktop/checkCompilation/iopsys-client $(PKG_BUILD_DIR)
|
||||
#endef
|
||||
|
||||
###########################--DEVELOPMENT--################################
|
||||
@@ -132,12 +126,12 @@ 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/
|
||||
$(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
|
||||
@@ -145,7 +139,7 @@ define Package/ice-client/install
|
||||
$(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,texecService.so.1.0.1,webaccessService.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
|
||||
@@ -155,15 +149,12 @@ define Package/ice-client/install
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/etc/config/ice $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/iopsys
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/server.ini $(1)/etc/iopsys
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/defaults.ini $(1)/etc/iopsys
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/modify.ini $(1)/etc/iopsys
|
||||
$(INSTALL_DIR) $(1)/etc/iopsys/certificates
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/cert_server_ca.pem $(1)/etc/iopsys/certificates
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/inteno_root_ca.pem $(1)/etc/iopsys/certificates
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/ice-client $(1)/etc/init.d/ice-client
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults/
|
||||
$(CP) ./files/ice-client.uci_default $(1)/etc/uci-defaults/95-ice-client
|
||||
endef
|
||||
endif
|
||||
|
||||
@@ -913,7 +904,7 @@ 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
|
||||
echo "system moduleRemove topic=texec" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
@@ -944,54 +935,6 @@ fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
# webaccess
|
||||
define Package/ice-client-webaccess
|
||||
$(call Package/ice-client/Default)
|
||||
TITLE:=webaccess
|
||||
DEPENDS+=
|
||||
endef
|
||||
|
||||
define Package/ice-client-webaccess/description
|
||||
remote script execution module for ice-client
|
||||
endef
|
||||
|
||||
define Package/ice-client-webaccess/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=webAccess" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-webaccess/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=webAccess" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/ice-client-webaccess/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/core/lib/webaccessService.so.1.0.1 $(1)/usr/lib
|
||||
endef
|
||||
|
||||
define Package/ice-client-webaccess/postinst
|
||||
#!/bin/sh
|
||||
read -t 1 <>/tmp/cfout
|
||||
if [ -f /tmp/ice.pid ]; then
|
||||
echo "system moduleAdd file=webaccessService.so.1.0.1" package="ice-client-webaccess" > /tmp/cfin
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
# bmspeedtest
|
||||
define Package/ice-client-bcmspeedmgr
|
||||
$(call Package/ice-client/Default)
|
||||
@@ -1042,5 +985,4 @@ $(eval $(call BuildPackage,ice-client-monitor))
|
||||
$(eval $(call BuildPackage,ice-client-gigaset))
|
||||
$(eval $(call BuildPackage,ice-client-texec))
|
||||
$(eval $(call BuildPackage,ice-client-bcmspeedmgr))
|
||||
$(eval $(call BuildPackage,ice-client-webaccess))
|
||||
endif
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
grep -rq "^ice:" /etc/passwd || {
|
||||
adduser -D -H -s /bin/false ice
|
||||
}
|
||||
|
||||
uci -q delete passwords.ice
|
||||
uci -q set passwords.ice=usertype
|
||||
uci -q set passwords.ice.password="\$WPAKEY"
|
||||
uci -q del_list passwords.ice._access_w=root
|
||||
uci -q add_list passwords.ice._access_w=root
|
||||
uci -q del_list passwords.ice._access_r=root
|
||||
uci -q add_list passwords.ice._access_r=root
|
||||
uci -q commit passwords
|
||||
|
||||
uci show rpcd | grep username=.*ice.* >/dev/null || {
|
||||
cat >> /etc/config/rpcd << EOF
|
||||
|
||||
config login
|
||||
option username 'ice'
|
||||
option password '\$p\$ice'
|
||||
list _access_w 'none'
|
||||
list write 'user-user'
|
||||
list write 'juci-broadcom-dsl'
|
||||
list write 'juci-broadcom-dsl-admin'
|
||||
list write 'juci-broadcom-ethernet'
|
||||
list write 'juci-broadcom-iptv'
|
||||
list write 'juci-broadcom-vlan'
|
||||
list write 'juci-broadcom-vlan-admin'
|
||||
list write 'juci-wireless'
|
||||
list write 'juci-wireless-admin'
|
||||
list write 'juci-catv'
|
||||
list write 'juci-ddns'
|
||||
list write 'juci-diagnostics'
|
||||
list write 'juci-dnsmasq-dhcp'
|
||||
list write 'juci-dropbear'
|
||||
list write 'juci-ethernet'
|
||||
list write 'juci-event'
|
||||
list write 'juci-firewall-fw3'
|
||||
list write 'juci-iconnect'
|
||||
list write 'juci-igmpinfo'
|
||||
list write 'juci-inteno-backup'
|
||||
list write 'juci-inteno-multiwan'
|
||||
list write 'juci-inteno-provisioning'
|
||||
list write 'juci-inteno-qos'
|
||||
list write 'juci-inteno-voice-client'
|
||||
list write 'juci-minidlna'
|
||||
list write 'juci-mod-status'
|
||||
list write 'juci-mod-system'
|
||||
list write 'juci-natalie-dect'
|
||||
list write 'juci-netmode'
|
||||
list write 'juci-network-netifd'
|
||||
list write 'juci-owsd'
|
||||
list write 'juci-printer'
|
||||
list write 'juci-realtime-graphs'
|
||||
list write 'juci-samba'
|
||||
list write 'juci-sfp'
|
||||
list write 'juci-snmpd'
|
||||
list write 'juci-sysupgrade'
|
||||
list write 'juci-uhttpd'
|
||||
list write 'juci-upnp'
|
||||
list write 'juci-usb'
|
||||
list write 'core'
|
||||
list write 'unauthenticated'
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
uci -q del_list dhcp.@domain[0].name="inteno.lan"
|
||||
uci -q add_list dhcp.@domain[0].name="inteno.lan"
|
||||
uci -q commit dhcp
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -15,21 +15,33 @@ 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
|
||||
|
||||
config XMPP_ENABLE
|
||||
bool "enable xmpp feature"
|
||||
default n
|
||||
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
|
||||
|
||||
config LIBDATAMODEL_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
|
||||
endif
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
if PACKAGE_libdatamodel
|
||||
|
||||
config UPNP_TR064
|
||||
bool "Compile with tr064 features"
|
||||
default n
|
||||
|
||||
endif
|
||||
134
icwmp/Makefile
134
icwmp/Makefile
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=4.0-2019-08-17
|
||||
PKG_VERSION:=3.0-2016-06-02
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=17b9e07a38753eab3964dffd0b0cc7da3118840a
|
||||
PKG_SOURCE_VERSION:=3796902ebf44c3cd00b3829ef7aca911cdde2cc7
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -30,46 +30,11 @@ CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libdatamodel
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Library for broadband-forum data model
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||
endef
|
||||
|
||||
define Package/icwmp_stun
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 stun Client
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libopenssl +libblobmsg-json
|
||||
endef
|
||||
|
||||
define Package/icwmp_xmpp
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 xmpp feature
|
||||
DEPENDS:=+libuci +libubox +libexpat +libstrophe
|
||||
endef
|
||||
|
||||
define Package/icwmp_twamp
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 twamp feature
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/icwmp_udpechoserver
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 udpechoserver feature
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/icwmp/Default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=CWMP client
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +libexpat +libstrophe +curl +libtrace +libdatamodel
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +libexpat +bcmkernel +curl
|
||||
endef
|
||||
|
||||
define Package/icwmp/description
|
||||
@@ -91,11 +56,7 @@ define Package/icwmp-zstream
|
||||
endef
|
||||
|
||||
define Package/icwmp-zstream/config
|
||||
source "$(SOURCE)/Config_cwmp.in"
|
||||
endef
|
||||
|
||||
define Package/libdatamodel/config
|
||||
source "$(SOURCE)/Config_datamodel.in"
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
@@ -105,12 +66,6 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_CFLAGS += -DEX400
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_LIBDATAMODEL_VENDOR_PREFIX)\\\"
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
@@ -130,17 +85,10 @@ CONFIGURE_ARGS += \
|
||||
--with-uci-include-path=$(STAGING_DIR)/usr/include \
|
||||
--with-libubox-include-path=$(STAGING_DIR)/usr/include \
|
||||
--with-libubus-include-path=$(STAGING_DIR)/usr/include
|
||||
|
||||
ifeq ($(CONFIG_UPNP_TR064),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-upnptr064
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_XMPP_ENABLE),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-xmpp
|
||||
endif
|
||||
|
||||
|
||||
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 \
|
||||
@@ -172,18 +120,13 @@ CONFIGURE_ARGS += \
|
||||
--enable-devel
|
||||
endif
|
||||
|
||||
define Package/libdatamodel/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libdatamodel.so* $(1)/lib/
|
||||
endef
|
||||
|
||||
define Package/icwmp-$(BUILD_VARIANT)/install
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/icwmpd $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/icwmpd
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
@@ -195,58 +138,10 @@ ifeq ($(CONFIG_CWMP_SCRIPTS_FULL),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/icwmp
|
||||
$(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
|
||||
endif
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/icwmp_stun/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_stund $(1)/usr/sbin/icwmp_stund
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_stund $(1)/etc/init.d/icwmp_stund
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_stun $(1)/etc/config
|
||||
endef
|
||||
|
||||
define Package/icwmp_xmpp/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_xmppd $(1)/usr/sbin/icwmp_xmppd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_xmppd $(1)/etc/init.d/icwmp_xmppd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_xmpp $(1)/etc/config
|
||||
$(CP) ./xmpp-files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/icwmp_udpechoserver/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_udpechoserverd $(1)/usr/sbin/icwmp_udpechoserverd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_udpechoserverd $(1)/etc/init.d/icwmp_udpechoserverd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_udpechoserver $(1)/etc/config
|
||||
endef
|
||||
|
||||
define Package/icwmp_twamp/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_twampd $(1)/usr/sbin/icwmp_twampd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_twampd $(1)/etc/init.d/icwmp_twampd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_twamp $(1)/etc/config
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/libdatamodel
|
||||
$(CP) $(PKG_BUILD_DIR)/dm/*.h $(1)/usr/include/libdatamodel
|
||||
$(CP) $(PKG_BUILD_DIR)/dm/dmtree/common/root.h $(1)/usr/include/libdatamodel
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libdatamodel.so* $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libdatamodel.a $(1)/lib
|
||||
endef
|
||||
|
||||
|
||||
define Package/icwmp-$(BUILD_VARIANT)/postinst
|
||||
#!/bin/sh
|
||||
echo "$(CWMP_BKP_FILE)" >> $${IPKG_INSTROOT}/etc/sysupgrade.conf
|
||||
@@ -268,9 +163,4 @@ endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,icwmp-curl))
|
||||
$(eval $(call BuildPackage,libdatamodel))
|
||||
$(eval $(call BuildPackage,icwmp_stun))
|
||||
$(eval $(call BuildPackage,icwmp_xmpp))
|
||||
$(eval $(call BuildPackage,icwmp_udpechoserver))
|
||||
$(eval $(call BuildPackage,icwmp_twamp))
|
||||
$(eval $(call BuildPackage,icwmp-zstream))
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
|
||||
[ -f /etc/config/cwmp ] || exit 0
|
||||
|
||||
handle_icwmp_restart() {
|
||||
[ -f /tmp/switching_mode ] && exit 0
|
||||
[ -f /tmp/wificontrol.txt -a -f /tmp/netmode-conf.pid ] && exit 0
|
||||
|
||||
[ "$INTERFACE" == "loopback" ] && exit 0
|
||||
|
||||
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
[ -n "$defwan" -a "$(uci -q get network.$defwan)" == "interface" -a "$defwan" != "$INTERFACE" ] && exit 0
|
||||
|
||||
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||
[ "$islan" == "1" ] && exit 0
|
||||
|
||||
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||
[ "$proto" == "none" ] && exit 0
|
||||
|
||||
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||
|
||||
mkdir -p /tmp/ipv4
|
||||
|
||||
network_flush_cache
|
||||
|
||||
local previpaddr=""
|
||||
local curipaddr=""
|
||||
local ipaddrfile=/tmp/ipv4/$INTERFACE-ipaddr
|
||||
previpaddr=$(cat $ipaddrfile 2>/dev/null)
|
||||
network_get_ipaddr curipaddr $INTERFACE
|
||||
[ -n "$curipaddr" ] && echo $curipaddr > $ipaddrfile || rm -f $ipaddrfile
|
||||
|
||||
local prevgateway=""
|
||||
local curgateway=""
|
||||
local gatewayfile=/tmp/ipv4/$INTERFACE-gateway
|
||||
prevgateway=$(cat $gatewayfile 2>/dev/null)
|
||||
network_get_gateway curgateway $INTERFACE
|
||||
[ -n "$curgateway" ] && echo $curgateway > $gatewayfile || rm -f $gatewayfile
|
||||
|
||||
local prevsubnets=""
|
||||
local cursubnets=""
|
||||
local subnetsfile=/tmp/ipv4/$INTERFACE-subnets
|
||||
prevsubnets=$(cat $subnetsfile 2>/dev/null)
|
||||
network_get_subnets cursubnets $INTERFACE
|
||||
[ -n "$cursubnets" ] && echo $cursubnets > $subnetsfile || rm -f $subnetsfile
|
||||
|
||||
local prevdnsservers=""
|
||||
local curdnsservers=""
|
||||
local dnsserverfile=/tmp/ipv4/$INTERFACE-dnsservers
|
||||
prevdnsservers=$(cat $dnsserverfile 2>/dev/null)
|
||||
network_get_dnsserver curdnsservers $INTERFACE
|
||||
[ -n "$curdnsservers" ] && echo $curdnsservers > $dnsserverfile || rm -f $dnsserverfile
|
||||
|
||||
local prevdev=""
|
||||
local curdev=""
|
||||
local devfile=/tmp/ipv4/$INTERFACE-dev
|
||||
prevdev=$(cat $devfile 2>/dev/null)
|
||||
network_get_device curdev $INTERFACE
|
||||
[ -n "$curdev" ] && echo $curdev > $devfile || rm -f $devfile
|
||||
|
||||
local prevopt43url=""
|
||||
local curopt43url=""
|
||||
local opt43urlfile=/tmp/ipv4/$INTERFACE-opt43url
|
||||
prevopt43url=$(cat $opt43urlfile 2>/dev/null)
|
||||
curopt43url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||
[ -n "$curopt43url" ] && echo $curopt43url > $opt43urlfile || rm -f $opt43urlfile
|
||||
|
||||
[ \
|
||||
"$prevdev" == "$curdev" -a \
|
||||
"$previpaddr" = "$curipaddr" -a \
|
||||
"$prevgateway" = "$curgateway" -a \
|
||||
"$prevsubnets" = "$cursubnets" -a \
|
||||
"$prevdnsservers" = "$curdnsservers" \
|
||||
] && {
|
||||
[ "$prevopt43url" = "$curopt43url" ] && exit 0
|
||||
[ -z "$prevopt43url" ] && exit 0
|
||||
}
|
||||
|
||||
/etc/init.d/icwmpd reload &
|
||||
}
|
||||
|
||||
handle_icwmp_restart
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
set_cwmp_reqopts() {
|
||||
### Ask for DHCP Option 43 only if CWMP is enabled ###
|
||||
local wan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
local dhcp_discovery=$(uci -q get cwmp.acs.dhcp_discovery)
|
||||
local discovery=0
|
||||
case $dhcp_discovery in
|
||||
enable|1) discovery=1 ;;
|
||||
esac
|
||||
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$wan.reqopts)"
|
||||
local proto="$(uci -q get network.$wan.proto)"
|
||||
local tropts="43"
|
||||
local oldreqopts="$reqopts"
|
||||
local ropt iopt
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $tropts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) [ $discovery -eq 1 ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
if [ "$proto" == "dhcp" ]; then
|
||||
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
oldreqopts="$(echo $oldreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
[ "$newreqopts" == "$oldreqopts" ] && return
|
||||
uci -q set network.$wan.reqopts="$newreqopts"
|
||||
uci commit network
|
||||
fi
|
||||
}
|
||||
|
||||
set_cwmp_reqopts
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -f /etc/config/cwmp_xmpp ] || exit 0
|
||||
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
[ "$INTERFACE" == "loopback" ] && exit 0
|
||||
|
||||
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
[ -n "$defwan" -a "$(uci -q get network.$defwan)" == "interface" -a "$defwan" != "$INTERFACE" ] && exit 0
|
||||
|
||||
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||
[ "$islan" == "1" ] && exit 0
|
||||
|
||||
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||
[ "$proto" == "none" ] && exit 0
|
||||
|
||||
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||
|
||||
/etc/init.d/icwmp_xmppd reload &
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ifbt
|
||||
PKG_VERSION:=0.1
|
||||
|
||||
PKG_SOURCE_VERSION:=0286812ed8036dea758f904694dc416481fba64d
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ifbt.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(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
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
TARGET_PLATFORM:=-DIOPSYS_BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM:=-DIOPSYS_BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
TARGET_PLATFORM:=-DIOPSYS_MARVELL
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
TARGET_PLATFORM:=-DIOPSYS_INTEL
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM:=-DIOPSYS_MEDIATEK
|
||||
else
|
||||
$(info (UNEXPECTED CONFIG TARGET))
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
|
||||
define Package/ifbt
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libwifi +libjson-c
|
||||
TITLE:=Fast BSS Transition
|
||||
endef
|
||||
|
||||
define Package/ifbt/description
|
||||
ifbt is Iopsys application for fast BSS transition
|
||||
endef
|
||||
|
||||
define Package/ifbt/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ifbt $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ifbt))
|
||||
@@ -1,41 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=imonitor
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/imonitor.git
|
||||
PKG_SOURCE_VERSION:=532f4900862bcb45d8cd4bf37555fabda81750b6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/imonitor
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=iopsysWrt process supervisor
|
||||
DEPENDS:=+ubox +uci +ubus +rpcd +rpcd-mod-file
|
||||
endef
|
||||
|
||||
define Package/imonitor/description
|
||||
imonitor is a process supervisor or a process control system similar to the Supervisor (http://supervisord.org/)
|
||||
endef
|
||||
|
||||
define Package/imonitor/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/imonitor $(1)/usr/bin/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,imonitor))
|
||||
@@ -1,9 +0,0 @@
|
||||
config monitor
|
||||
option app 'test'
|
||||
option test 'echo test'
|
||||
option stream 'stdout'
|
||||
option string_match 'TEST'
|
||||
option execute 'echo executing test'
|
||||
option interval '10'
|
||||
option nr_tests '2'
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Start the imonitor
|
||||
#
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=imonitor
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "imonitor"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop imonitor
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2016 iopsys
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=inbd
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=665a72a6bb2b5ea5a17ad6248957fe35525b3782
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/inbd
|
||||
|
||||
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/inbd
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=iopsys Netlink Bridge Daemon
|
||||
URL:=
|
||||
DEPENDS:=+libuci +libubus +libblobmsg-json +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/inbd/description
|
||||
Application handling netlink messages from kernel and sending them out on ubus.
|
||||
endef
|
||||
|
||||
define Package/inbd/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/inbd $(1)/usr/bin/
|
||||
cp $(PKG_BUILD_DIR)/files/etc/init.d/inbd $(1)/etc/init.d/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,inbd))
|
||||
@@ -20,7 +20,7 @@ define Package/iop
|
||||
endef
|
||||
|
||||
define Package/iop/description
|
||||
This package contains iopsysWrt SDK utilities
|
||||
This package contains Intenos Iop utilities
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
@@ -3,104 +3,124 @@ CONFIG_BUSYBOX_CUSTOM=y
|
||||
CONFIG_CCACHE=y
|
||||
CONFIG_DEBUG=y
|
||||
CONFIG_DEVEL=y
|
||||
CONFIG_LOCALMIRROR="http://mirror.inteno.se/mirror"
|
||||
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_comgt-directip=y
|
||||
CONFIG_PACKAGE_comgt-ncm=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_icwmp-curl=y
|
||||
CONFIG_PACKAGE_ifbt=y
|
||||
CONFIG_PACKAGE_imonitor=y
|
||||
CONFIG_PACKAGE_inbd=y
|
||||
CONFIG_PACKAGE_iopupgrade=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
CONFIG_PACKAGE_iperf3=y
|
||||
CONFIG_PACKAGE_iperf-mt=y
|
||||
CONFIG_PACKAGE_ipset=y
|
||||
CONFIG_PACKAGE_iptables=y
|
||||
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_iup=y
|
||||
CONFIG_PACKAGE_iwatchdog=y
|
||||
CONFIG_PACKAGE_juci=y
|
||||
CONFIG_PACKAGE_juci-config-backup=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-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-mwan3=y
|
||||
CONFIG_PACKAGE_juci-natalie-dect=y
|
||||
CONFIG_PACKAGE_juci-netmode=y
|
||||
CONFIG_PACKAGE_juci-network-device=y
|
||||
CONFIG_PACKAGE_juci-network-dsl=y
|
||||
CONFIG_PACKAGE_juci-network-netifd=y
|
||||
CONFIG_PACKAGE_juci-network-port=y
|
||||
CONFIG_PACKAGE_juci-openvpn=y
|
||||
CONFIG_PACKAGE_juci-owsd=y
|
||||
CONFIG_PACKAGE_juci-realtime-graphs=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-voice-client=y
|
||||
CONFIG_PACKAGE_juci-wifilife=y
|
||||
CONFIG_PACKAGE_juci-wireless=y
|
||||
CONFIG_PACKAGE_juci-theme-iopsys=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_libcgroup-daemon=y
|
||||
CONFIG_PACKAGE_libcgroup=y
|
||||
# CONFIG_PACKAGE_libcgroup-utils is not set
|
||||
CONFIG_PACKAGE_ldd=y
|
||||
CONFIG_PACKAGE_libdaemon=y
|
||||
CONFIG_PACKAGE_libffmpeg-mini=y
|
||||
CONFIG_PACKAGE_libgmp=y
|
||||
CONFIG_PACKAGE_libreadline=y
|
||||
CONFIG_PACKAGE_loop-detector=m
|
||||
CONFIG_PACKAGE_minidlna=y
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_mwan3=y
|
||||
CONFIG_PACKAGE_nand-utils=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_multiwan=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_netcheck=y
|
||||
CONFIG_PACKAGE_ntfs-3g=y
|
||||
CONFIG_PACKAGE_ntpd=y
|
||||
CONFIG_PACKAGE_odhcp6c=y
|
||||
CONFIG_PACKAGE_odhcpd=y
|
||||
CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=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-pppoe=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
|
||||
CONFIG_PACKAGE_ppp-mod-pptp=y
|
||||
CONFIG_PACKAGE_ppp-multilink=y
|
||||
# CONFIG_PACKAGE_ppp is not set
|
||||
# CONFIG_PACKAGE_qos-scripts is not set
|
||||
CONFIG_PACKAGE_qos-scripts=y
|
||||
CONFIG_PACKAGE_qrencode=y
|
||||
CONFIG_PACKAGE_questd=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_relayd=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rulengd=y
|
||||
CONFIG_PACKAGE_samba3=y
|
||||
CONFIG_PACKAGE_samba3-nmbd=y
|
||||
CONFIG_PACKAGE_snmpd=y
|
||||
@@ -114,46 +134,33 @@ CONFIG_PACKAGE_umbim=y
|
||||
CONFIG_PACKAGE_uqmi=y
|
||||
CONFIG_PACKAGE_usb-modeswitch=y
|
||||
CONFIG_PACKAGE_usbreset=y
|
||||
CONFIG_PACKAGE_wget=y
|
||||
CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_libwifi=y
|
||||
CONFIG_PACKAGE_wifilife=y
|
||||
CONFIG_PACKAGE_wifimngr=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
CONFIG_PACKAGE_zoneinfo-core=y
|
||||
CONFIG_PACKAGE_zoneinfo-europe=y
|
||||
CONFIG_TARGET_CUSTOMER="IOPSYS"
|
||||
CONFIG_TARGET_CUSTOMER="INT"
|
||||
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_ARPING=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT=y
|
||||
CONFIG_BUSYBOX_CONFIG_CTTYHACK=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 is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MODINFO is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MODPROBE is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODPROBE_BLACKLIST=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS=y
|
||||
CONFIG_BUSYBOX_CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
|
||||
CONFIG_BUSYBOX_CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
|
||||
CONFIG_BUSYBOX_CONFIG_INSMOD=y
|
||||
CONFIG_BUSYBOX_CONFIG_LAST_SYSTEM_ID=999
|
||||
CONFIG_BUSYBOX_CONFIG_LOGIN=y
|
||||
# CONFIG_BUSYBOX_CONFIG_LSMOD is not set
|
||||
CONFIG_BUSYBOX_CONFIG_LSMOD=y
|
||||
CONFIG_BUSYBOX_CONFIG_LSPCI=y
|
||||
CONFIG_BUSYBOX_CONFIG_LSUSB=y
|
||||
CONFIG_BUSYBOX_CONFIG_MICROCOM=y
|
||||
# CONFIG_BUSYBOX_CONFIG_RMMOD is not set
|
||||
CONFIG_BUSYBOX_CONFIG_RMMOD=y
|
||||
CONFIG_BUSYBOX_CONFIG_STTY=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
|
||||
@@ -167,26 +174,19 @@ 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_WGET is not set
|
||||
# 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_BUSYBOX_CONFIG_NTPD is not set
|
||||
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
# CONFIG_LIBCURL_MBEDTLS is not set
|
||||
CONFIG_LIBCURL_OPENSSL=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_SAMBA3_CONFIG_NO_PRINTING is not set
|
||||
# CONFIG_SIGNED_PACKAGES is not set
|
||||
CONFIG_KERNEL_DEVTMPFS=y
|
||||
CONFIG_KERNEL_DEVTMPFS_MOUNT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
||||
LOCAL_MIRROR="http://download.iopsys.eu/iopsys/mirror/"
|
||||
|
||||
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
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
_iop_get_profiles()
|
||||
{
|
||||
find feeds/targets/iopsys-*/ -name '*.diff' \
|
||||
find feeds/feed_inteno_targets/iopsys-*/ -name '*.diff' \
|
||||
|awk -F'/' '{print$NF}' \
|
||||
|awk -F. '{print$1}'
|
||||
}
|
||||
|
||||
_iop_get_models()
|
||||
{
|
||||
find feeds/targets/iopsys-*/ -mindepth 1 -maxdepth 1 -type d \
|
||||
find feeds/feed_inteno_targets/iopsys-*/ -mindepth 1 -maxdepth 1 -type d \
|
||||
|awk -F'/' '{print$NF}' \
|
||||
|egrep '^(cg|dg|eg|vg|vox)[0-9]'
|
||||
}
|
||||
@@ -34,8 +34,9 @@ _iop()
|
||||
|
||||
iopcmds="bootstrap cfe_upgrade cfe_upgrade_latest extract_core \
|
||||
feeds_update genconfig generate_tarballs install_key \
|
||||
scp_changes setup_host ssh_install_key status \
|
||||
update_package update_feed_branches ssh_upgrade"
|
||||
scp_changes setup_host ssh_install_key ssh_sysupgrade \
|
||||
ssh_sysupgrade_latest ssh_sysupgrade_latest_w status \
|
||||
update_package"
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ] ; then
|
||||
|
||||
@@ -75,13 +76,7 @@ _iop()
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
ssh_upgrade)
|
||||
if [ "$prev" == "-f" ] ; then
|
||||
_filedir
|
||||
else
|
||||
COMPREPLY=( $(compgen -W "-f -t -i -n -x -b" -- ${cur}) )
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
# No arguments or arguments not supported yet
|
||||
;;
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function disable_add_config () {
|
||||
local COPTION="$1"
|
||||
|
||||
HAVE_OPTION=`grep $COPTION .config | wc -l`
|
||||
HAVE_OPTION_DISABLED=`grep "# $COPTION" .config | wc -l`
|
||||
if [ "$HAVE_OPTION" = "1" ]
|
||||
then
|
||||
if [ "$HAVE_OPTION_DISABLED" = "0" ]
|
||||
then
|
||||
sed -i -e "s,$COPTION=y,# $COPTION is not set,g" .config
|
||||
fi
|
||||
else
|
||||
echo "# $COPTION is not set" >> .config
|
||||
fi
|
||||
}
|
||||
|
||||
function enable_option () {
|
||||
local COPTION="$1"
|
||||
# cat .config| grep DSL
|
||||
sed -i -e "s,# $COPTION is not set,$COPTION=y,g" .config
|
||||
# cat .config| grep DSL
|
||||
}
|
||||
|
||||
function annexconfig {
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
local ANNEX="$1"
|
||||
|
||||
disable_add_config CONFIG_TARGET_NO_DSL
|
||||
disable_add_config CONFIG_TARGET_DSL_ANNEX_A
|
||||
disable_add_config CONFIG_TARGET_DSL_ANNEX_B
|
||||
disable_add_config CONFIG_TARGET_DSL_ANNEX_C
|
||||
disable_add_config CONFIG_TARGET_DSL_SADSL
|
||||
disable_add_config CONFIG_TARGET_DSL_GFAST
|
||||
|
||||
|
||||
if [ "$ANNEX" = "no" ]
|
||||
then
|
||||
echo "No DSL"
|
||||
enable_option CONFIG_TARGET_NO_DSL
|
||||
elif [ "$ANNEX" = "a" ]
|
||||
then
|
||||
echo "Annex A"
|
||||
enable_option CONFIG_TARGET_DSL_ANNEX_A
|
||||
elif [ "$ANNEX" = "b" ]
|
||||
then
|
||||
echo "Annex B"
|
||||
enable_option CONFIG_TARGET_DSL_ANNEX_B
|
||||
elif [ "$ANNEX" = "c" ]
|
||||
then
|
||||
echo "Annex C"
|
||||
enable_option CONFIG_TARGET_DSL_ANNEX_C
|
||||
elif [ "$ANNEX" = "sadsl" ]
|
||||
then
|
||||
echo "sadsl"
|
||||
enable_option CONFIG_TARGET_DSL_SADSL
|
||||
elif [ "$ANNEX" = "gfast" ]
|
||||
then
|
||||
echo "G.fast"
|
||||
enable_option CONFIG_TARGET_DSL_GFAST
|
||||
else
|
||||
echo "Only option no,a,b,c,sadsl,gfast supported"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
register_command "annexconfig" "Select configuration annex"
|
||||
@@ -1,60 +0,0 @@
|
||||
#!/bin/sh
|
||||
# build_branch
|
||||
#./iop build_branch <branch> <board> [<customer>]
|
||||
|
||||
function build_branch_usage {
|
||||
echo "usage: $0 build_branch <branch> <board> [<customer>]"
|
||||
echo "example: $0 build_branch devel-new ex400 DEV"
|
||||
echo "example: $0 build_branch_sysupgrade devel-new ex400 DEV 192.168.1.1 -n"
|
||||
set +x
|
||||
exit 1
|
||||
}
|
||||
|
||||
function branch_exists {
|
||||
local branch=$1
|
||||
[ -z "$branch" ] && return 1
|
||||
git branch | grep -q $branch && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
function build_branch {
|
||||
set -x
|
||||
local branch=$1
|
||||
local board=$2
|
||||
local customer=$3
|
||||
[ "$customer" == "INT" ] && customer=""
|
||||
|
||||
if ! branch_exists $branch ; then
|
||||
echo "Branch $branch not found"
|
||||
build_branch_usage
|
||||
fi
|
||||
|
||||
time {
|
||||
git fetch origin || build_branch_usage
|
||||
git fetch --all -p || build_branch_usage
|
||||
git checkout $branch || build_branch_usage
|
||||
git pull || exit 1
|
||||
./iop feeds_update || build_branch_usage
|
||||
./iop genconfig -c $board $customer || build_branch_usage
|
||||
make -j 8 || build_branch_usage
|
||||
set +x
|
||||
}
|
||||
}
|
||||
|
||||
function build_branch_sysupgrade {
|
||||
set -x
|
||||
local branch=$1 ; shift
|
||||
local board=$1 ; shift
|
||||
local customer=$1 ; shift
|
||||
local ip=$1 ; shift
|
||||
local opts=$*
|
||||
|
||||
time {
|
||||
./iop build_branch $branch $board $customer
|
||||
[ "$?" == "0" ] && ./iop ssh_sysupgrade_latest $ip $opts
|
||||
}
|
||||
set +x
|
||||
}
|
||||
|
||||
register_command "build_branch" "<branch> <board> [<customer>] Build a <branch> for a <board> [with a <customer> profile]"
|
||||
register_command "build_branch_sysupgrade" "<branch> <board> <customer>|INT <ip> [<opts>] Build a <branch> for a <board> [with a <customer> profile] and sysupgrade [with <opts>] it on the router at <ip>"
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
function compile {
|
||||
if [ -z "$1" ]; then
|
||||
echo "Please give a valid package as first argument."
|
||||
return 1
|
||||
fi
|
||||
|
||||
local cpath pck
|
||||
local lpath=$(find package/ -type l -name $1)
|
||||
local dpath=$(find package/ -type d -name $1)
|
||||
|
||||
for pck in $lpath $dpath; do
|
||||
if [ -n "$(ls $pck/Makefile 2>/dev/null)" ]; then
|
||||
cpath=$pck
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$cpath" ]; then
|
||||
make $cpath/compile V=$2
|
||||
else
|
||||
echo "Package $1 does not exist. Make sure you have installed the necessary feed."
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "compile" "Compile a specific package: ./iop compile <PACKAGE_NAME> [0-99]; i.e ./iop compile netifd 99"
|
||||
@@ -1,134 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
function extract_core {
|
||||
initial_commit=1427738ac4b77f474999ae21af1a8b916468df36
|
||||
patch_dir=extract_core_patches
|
||||
topdir=$(pwd)
|
||||
# Intermediate repo for core packages
|
||||
core_repo=git@public.inteno.se:iopsys-cc-core.git
|
||||
|
||||
# Paths to packages that should be exported.
|
||||
paths+='package/network/services/dnsmasq '
|
||||
paths+='package/network/config/firewall '
|
||||
paths+='package/network/config/netifd '
|
||||
paths+='package/network/config/qos-scripts '
|
||||
paths+='package/utils/busybox '
|
||||
paths+='package/base-files '
|
||||
paths+='package/system/procd '
|
||||
paths+='package/system/rpcd '
|
||||
paths+='package/network/services/openvpn '
|
||||
# Repo to which core packages should be imported
|
||||
import_repo=git@public.inteno.se:feed-inteno-openwrt.git
|
||||
import_branch=openwrt-cc-core
|
||||
|
||||
function print_usage {
|
||||
echo "Usage: $0 extract_core"
|
||||
echo " -p <path-to-package> | default"
|
||||
echo " -r <import-repo>"
|
||||
echo " -b <import-branch>"
|
||||
echo ""
|
||||
echo "Example: $0 extract_core"
|
||||
echo " -p package/utils/busybox"
|
||||
echo " -r feeds/lede_core"
|
||||
echo " -b devel"
|
||||
}
|
||||
|
||||
function orphan_branch {
|
||||
local branch=$1
|
||||
function export_core {
|
||||
|
||||
git checkout --orphan $branch
|
||||
git rm -rf --cached *
|
||||
git rm -rf --cached .empty
|
||||
rm -rf *
|
||||
rm -rf .empty
|
||||
}
|
||||
local path=$1
|
||||
|
||||
function export_core {
|
||||
local path=$1
|
||||
|
||||
echo "Extracting ${path} from core to ${import_repo}:${import_branch}"
|
||||
|
||||
# Generate patches from start of openwrt repo.
|
||||
mkdir -p $patch_dir
|
||||
repo=$(basename $path)
|
||||
dir=$(dirname $path)
|
||||
git format-patch $initial_commit $path -o $patch_dir
|
||||
|
||||
# Remove dirname from patches to commit the packages to the
|
||||
# top directory in the destination repo.
|
||||
ls $patch_dir | while read line; do
|
||||
sdir=$(echo "$dir/" | sed 's/\//\\\//g')
|
||||
sed -i "s/$sdir//g" $patch_dir/$line
|
||||
done
|
||||
|
||||
cd $import_repo
|
||||
|
||||
if [ -n "$(git rev-parse -q --verify remotes/origin/$repo)" ]; then
|
||||
# Create temporary branch to apply patches on.
|
||||
# We need to do this as git am does not like it
|
||||
# when patches have already been applied.
|
||||
orphan_branch tmp
|
||||
git am $topdir/$patch_dir/*
|
||||
|
||||
# Rebase and merge.
|
||||
git rebase origin/$repo
|
||||
git checkout --track -b $repo origin/$repo
|
||||
git merge tmp
|
||||
git br -d tmp
|
||||
else
|
||||
# Remote branch does not exist for packet so create it.
|
||||
orphan_branch $repo
|
||||
git am $topdir/$patch_dir/*
|
||||
fi
|
||||
|
||||
git push origin $repo
|
||||
|
||||
# Merge the package branch into the main branch.
|
||||
git checkout $import_branch
|
||||
git merge $repo -m "Syncing $repo"
|
||||
git push origin $import_branch
|
||||
git br -d $repo
|
||||
|
||||
rm -rf $topdir/$patch_dir
|
||||
cd $topdir
|
||||
}
|
||||
|
||||
# Execute user command
|
||||
while getopts "p:r:b:h" opt; do
|
||||
case $opt in
|
||||
p)
|
||||
export_path=${OPTARG}
|
||||
;;
|
||||
r)
|
||||
import_repo=${OPTARG}
|
||||
;;
|
||||
b)
|
||||
import_branch=${OPTARG}
|
||||
;;
|
||||
h)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -n "$export_path" ] || [ ! -n "$import_repo" ] || [ ! -n "$import_branch" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$export_path" == "default" ]; then
|
||||
echo "Extracting default packages:"
|
||||
for p in $paths; do
|
||||
export_core $p
|
||||
|
||||
done
|
||||
else
|
||||
export_core $export_path
|
||||
fi
|
||||
|
||||
exit 0
|
||||
# export paths to their own branches in an intermediate repo
|
||||
repo=$(basename $path)
|
||||
git subtree push -q --prefix=$path $core_repo $repo
|
||||
}
|
||||
|
||||
register_command "extract_core" "Extract core package to separate feed"
|
||||
|
||||
function update_core {
|
||||
|
||||
local path=$1
|
||||
|
||||
if [ ! -d $topdir/feeds/feed_inteno_openwrt ]; then
|
||||
echo "You need to run ./iop feeds_update"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# ensure that we are synced with the remote
|
||||
cd $topdir/feeds/feed_inteno_openwrt
|
||||
git checkout $import_branch
|
||||
git pull
|
||||
|
||||
# first install subtrees if they don't already exist
|
||||
repo=$(basename $path)
|
||||
git subtree add --prefix=$repo $core_repo $repo
|
||||
|
||||
# install subtrees in feed from intermediate repo
|
||||
repo=$(basename $path)
|
||||
echo "Exporting $repo"
|
||||
git subtree pull -q -m "Exporting $repo" --prefix=$repo $core_repo $repo
|
||||
|
||||
# update import repo sync branch
|
||||
git push origin $import_branch
|
||||
}
|
||||
|
||||
function display_help {
|
||||
|
||||
echo "Usage: ./iop export_core -e path/to/package"
|
||||
}
|
||||
|
||||
function extract_core {
|
||||
|
||||
# Dir of script location
|
||||
topdir=$(pwd)
|
||||
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
display_help
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# Execute user command
|
||||
while getopts "he:" opt; do
|
||||
case $opt in
|
||||
e)
|
||||
path=${OPTARG}
|
||||
echo "Extracting ${path} from core to ${import_repo}:${import_branch}"
|
||||
export_core $path
|
||||
update_core $path
|
||||
;;
|
||||
h)
|
||||
display_help
|
||||
exit 0
|
||||
;;
|
||||
\?)
|
||||
display_help
|
||||
exit -1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
register_command "extract_core" "Extract core package to feeds_inteno_openwrt"
|
||||
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function extract_top {
|
||||
tmp_dir=extract_top_tmp
|
||||
|
||||
# Paths to packages that should be ignored.
|
||||
paths+='package/network/services/dnsmasq '
|
||||
paths+='package/network/config/firewall '
|
||||
paths+='package/network/config/netifd '
|
||||
paths+='package/network/config/qos-scripts '
|
||||
paths+='package/utils/busybox '
|
||||
paths+='package/base-files '
|
||||
paths+='package/system/procd '
|
||||
paths+='package/system/rpcd '
|
||||
paths+='package/network/services/openvpn '
|
||||
|
||||
function extract {
|
||||
|
||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
git format-patch $start_commit -o $tmp_dir #> /dev/null
|
||||
|
||||
ls $tmp_dir |
|
||||
while read file; do
|
||||
# Remove feed patches.
|
||||
# echo $file | grep -i Update-feed > /dev/null && \
|
||||
# rm $tmp_dir/$file && continue
|
||||
cat $tmp_dir/$file | grep "+++ b/feeds.conf" > /dev/null && \
|
||||
rm $tmp_dir/$file && continue
|
||||
|
||||
# Remove core patches.
|
||||
for path in $paths; do
|
||||
cat $tmp_dir/$file | grep $path > /dev/null && \
|
||||
rm $tmp_dir/$file && break
|
||||
done
|
||||
done
|
||||
|
||||
git checkout -b ${current_branch}-new $start_commit
|
||||
git am $tmp_dir/*
|
||||
git checkout $current_branch
|
||||
rm -rf $tmp_dir
|
||||
}
|
||||
|
||||
function print_usage {
|
||||
|
||||
echo "Usage:"
|
||||
echo " $0 -s <start_commit>"
|
||||
}
|
||||
|
||||
# Execute user command
|
||||
while getopts "s:" opt; do
|
||||
case $opt in
|
||||
s)
|
||||
start_commit=${OPTARG}
|
||||
;;
|
||||
\?)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -n "$start_commit" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
extract
|
||||
|
||||
}
|
||||
|
||||
register_command "extract_top" "Extract commits made to top repo"
|
||||
@@ -3,53 +3,57 @@
|
||||
function feeds_update {
|
||||
|
||||
developer=0
|
||||
override=1
|
||||
start=$(date -u +'%s');
|
||||
while getopts "n" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
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 update -ai
|
||||
|
||||
# replace core packages with iopsys versions
|
||||
if [ $override == 1 ]; then
|
||||
./scripts/feeds install -f -p lede_core -a
|
||||
fi
|
||||
|
||||
# targets need to be installed explicitly
|
||||
targets="iopsys-brcm63xx-mips iopsys-brcm63xx-arm iopsys-ramips intel_mips"
|
||||
for target in $targets
|
||||
do
|
||||
rm -f target/linux/$target
|
||||
./scripts/feeds install -p targets $target
|
||||
done
|
||||
./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
|
||||
./scripts/feeds uninstall libwebsockets
|
||||
./scripts/feeds uninstall libwebsockets-openssl
|
||||
./scripts/feeds install -f -p feed_inteno_juci libwebsockets
|
||||
|
||||
# install all packages
|
||||
./scripts/feeds install -a
|
||||
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete
|
||||
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
|
||||
touch tmp/.iop_bootstrap
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
|
||||
@@ -1,449 +1,259 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig {
|
||||
export CLEAN=0
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
export THEMEDIR="themes"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
config_path=""
|
||||
brcm63xx_mips="target/linux/iopsys-brcm63xx-mips"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
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
|
||||
LOCAL_MIRROR="http://mirror.inteno.se/mirror"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
iopsys_brcm63xx_mips="cg300 cg301 dg150 dg150v2 dg150alv2 dg200 dg200al dg301 dg301al eg300 vg50 vox25"
|
||||
iopsys_brcm63xx_arm="dg400"
|
||||
target="bogus"
|
||||
|
||||
function find_last {
|
||||
egrep "^[ #]*${1}[ =]" $2 | tail -n1
|
||||
}
|
||||
set_target() {
|
||||
|
||||
function is_new {
|
||||
for opt in $conf_warned
|
||||
do
|
||||
if [ "$opt" == "$1" ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
# option not found return true
|
||||
return 0
|
||||
}
|
||||
local profile=$1
|
||||
|
||||
function verify_config {
|
||||
IFS=$'\n'
|
||||
org=$(<.genconfig.config)
|
||||
unset IFS
|
||||
local num
|
||||
local conf_opt
|
||||
local conf_org
|
||||
local conf_new
|
||||
for p in $iopsys_brcm63xx_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_mips"
|
||||
fi
|
||||
done
|
||||
|
||||
#echo "lines to check $tot_lines"
|
||||
num=0
|
||||
for line in $org
|
||||
do
|
||||
conf_opt=$(echo $line | grep CONFIG_ | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
|
||||
if [ -n "${conf_opt}" ]
|
||||
then
|
||||
conf_org=$(find_last ${conf_opt} .genconfig.config)
|
||||
conf_new=$(find_last ${conf_opt} .config)
|
||||
if [ "$conf_org" != "$conf_new" ]
|
||||
then
|
||||
if is_new $conf_opt
|
||||
then
|
||||
echo -e "config option [${Red}$conf_opt${Color_Off}] is not set correctly in .config"
|
||||
echo -e "got value [${Yellow}$conf_new${Color_Off}] but wanted [${Yellow}$conf_org${Color_Off}]"
|
||||
echo "This is a real problem somebody needs to investigate"
|
||||
echo ""
|
||||
conf_warned="$conf_warned $conf_opt"
|
||||
fi
|
||||
else
|
||||
true
|
||||
# for debug to see all options
|
||||
#echo -e "wanted [$conf_org] got [$conf_new]"
|
||||
fi
|
||||
fi
|
||||
num=$((num+1))
|
||||
done
|
||||
}
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
[ -e $brcm63xx_mips/genconfig ] &&
|
||||
iopsys_brcm63xx_mips=$(cd $brcm63xx_mips; ./genconfig)
|
||||
[ -e $brcm63xx_arm/genconfig ] &&
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
git remote -v | grep -q http || {
|
||||
DEVELOPER=1
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
done
|
||||
done
|
||||
return
|
||||
fi
|
||||
bcmAllowed=0
|
||||
iceAllowed=0
|
||||
endptAllowed=0
|
||||
natalieAllowed=0
|
||||
|
||||
for p in $iopsys_brcm63xx_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_mips"
|
||||
config_path="$brcm63xx_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
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
|
||||
}
|
||||
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
config_path="$brcm63xx_arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
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
|
||||
}
|
||||
|
||||
for p in $iopsys_intel_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
config_path="$intel_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
git remote -v | grep -q http || {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
iceAllowed=0
|
||||
endptAllowed=0
|
||||
natalieAllowed=0
|
||||
mediatekAllowed=0
|
||||
wifilifeAllowed=0
|
||||
|
||||
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:mediatek/linux.git -q 2>/dev/null && mediatekAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:dialog/natalie-dect-12.26.git -q 2>/dev/null && natalieAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:iopsys/wifilife.git -q 2>/dev/null && wifilifeAllowed=1
|
||||
git ls-remote git@private.inteno.se:ice-client.git -q -q 2>/dev/null && iceAllowed=1
|
||||
}
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -s|--override\t\tEnable 'Package source tree override'"
|
||||
echo -e " -S|--brcmsingle\tForce build of bcmkernel to use only one thread"
|
||||
echo -e " -h|--help\t\tShow this message"
|
||||
echo -e " -l|--list [customer]\tList all Customers or all boards for one customer"
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig dg200 TELIA"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
|
||||
list_customers()
|
||||
{
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common | grep -v juci-theme)"
|
||||
if [ "$boards" ]; then
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "No boards found for $CUSTOMER"
|
||||
fi
|
||||
elif [ "$CUSTOMER" ]; then
|
||||
echo "No customer called $CUSTOMER"
|
||||
exit 1
|
||||
elif [ -d $CUSTCONF ]; then
|
||||
local customers="$(ls -1 $CUSTCONF)"
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common | grep -v juci-theme)"
|
||||
if [ "$boards" ]; then
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "has no boards"
|
||||
fi
|
||||
done
|
||||
elif [ "$customers" ]; then
|
||||
echo -e "$customers"
|
||||
else
|
||||
echo "no customers found"
|
||||
fi
|
||||
else
|
||||
echo "No $CUSTCONF folder found"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
generate_config()
|
||||
{
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
{
|
||||
if git ls-remote $CUSTREPO -q 2>/dev/null; then
|
||||
if [ ! -d "$CUSTPATH" ]; then
|
||||
git clone "$CUSTREPO" "$CUSTPATH"
|
||||
elif [ $IMPORT -eq 1 ]; then
|
||||
cd $CUSTPATH
|
||||
v "git pull"
|
||||
git pull
|
||||
cd - >/dev/null #go back
|
||||
fi
|
||||
else
|
||||
echo "You do not have access to $CUSTREPO"
|
||||
fi
|
||||
|
||||
if [ ! -d "$FILEDIR" ]; then
|
||||
mkdir -p $FILEDIR
|
||||
elif [ -d "$FILEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
|
||||
if [ ! -d "$THEMEDIR" ]; then
|
||||
mkdir -p $THEMEDIR
|
||||
elif [ -d "$THEMEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $THEMEDIR/*"
|
||||
rm -rf $THEMEDIR/*
|
||||
fi
|
||||
}
|
||||
|
||||
create_and_copy_files()
|
||||
{
|
||||
local BOARDTYPE=$1
|
||||
shift
|
||||
local CUSTOMERS=$@
|
||||
|
||||
# Validate seleced board and customers
|
||||
set_target $BOARDTYPE
|
||||
if [ $target == "bogus" ]; then
|
||||
echo "Hardware profile does not exist"
|
||||
exit 1
|
||||
elif [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ ! -d "$CUSTCONF/$CUSTOMER/" ]; then
|
||||
echo "Customer profile for '$CUSTOMER' does not exist"
|
||||
exit 1
|
||||
elif [ ! -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/" ]; then
|
||||
echo "'$BOARDTYPE' board profile does not exist for customer '$CUSTOMER'"
|
||||
if [ -f "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
echo "Common profile configuration will be used"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Generate base config
|
||||
rm -f .config
|
||||
v "Config $BOARDTYPE selected"
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $config_path/config ]; then
|
||||
cat $config_path/config >> .config
|
||||
fi
|
||||
if [ -f $config_path/$BOARDTYPE/config ]; then
|
||||
cat $config_path/$BOARDTYPE/config >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips which use TARGET_DEVICES
|
||||
if [ "$target" = "intel_mips" ]; then
|
||||
subtarget="xrx500"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
fi
|
||||
|
||||
echo "$CUSTOMERS $BOARDTYPE" > $CURRENT_CONFIG_FILE
|
||||
|
||||
# Add customerconfig diff if a customer is selected
|
||||
if [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/common/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/juci-theme" ]; then
|
||||
customer="$(echo $CUSTOMER | tr 'A-Z' 'a-z')"
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
fi
|
||||
done
|
||||
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 ?
|
||||
echo "CONFIG_DEVEL=y" >>.config
|
||||
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
|
||||
[ $mediatekAllowed -eq 0 ] && echo "CONFIG_MEDIATEK_OPEN=y" >> .config
|
||||
[ $wifilifeAllowed -eq 0 ] && echo "CONFIG_WIFILIFE_OPEN=y" >> .config
|
||||
else
|
||||
echo "# CONFIG_GITMIRROR_REWRITE is not set" >>.config
|
||||
echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
echo "CONFIG_ICE_OPEN=y" >> .config
|
||||
echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||
echo "CONFIG_MEDIATEK_OPEN=y" >> .config
|
||||
echo "CONFIG_WIFILIFE_OPEN=y" >> .config
|
||||
fi
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
then
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# Force regeneration of themes
|
||||
touch package/feeds/juci/juci/Makefile
|
||||
|
||||
# Force regeneration of kernel Makefile
|
||||
# Needed to disable kmods for iopsys-brcm targets
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
# we need to signal to bradcom SDK that we have changed the board id
|
||||
# currently boardparms.c and boardparms_voice.c is the only place that is depending on inteno boardid name
|
||||
# so just touch that file.
|
||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||
|
||||
# Store generated config
|
||||
cp .config .genconfig.config
|
||||
|
||||
# Set default values based on selected parameters
|
||||
v "$(make defconfig 2>&1)"
|
||||
|
||||
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
v "$(make package/base-files/clean 2>&1)"
|
||||
|
||||
verify_config
|
||||
}
|
||||
|
||||
####### 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
|
||||
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 [ $# -eq 0 ]; then
|
||||
echo Current profile:
|
||||
cat $CURRENT_CONFIG_FILE
|
||||
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
|
||||
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
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-p|--profile) export PROFILE="$2"; shift;;
|
||||
-r|--repo) export CUSTREPO="$2"; shift;;
|
||||
-s|--override) export SRCTREEOVERR=1;;
|
||||
-S|--brcmsingel) export BRCM_MAX_JOBS=1;;
|
||||
-h|--help) usage;;
|
||||
-l|--list) list_customers 0 $2;;
|
||||
-a|--list-all)list_customers 1;;
|
||||
-b|--boards)set_target LIST;exit 0;;
|
||||
-*)
|
||||
echo "Invalid option: $1 "
|
||||
echo "Try -h or --help for more information."
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
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
|
||||
setup_dirs
|
||||
create_and_copy_files "$1" "$2"
|
||||
use_local_mirror
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
register_command "genconfig" "Generate configuration for board and customer"
|
||||
|
||||
@@ -1,187 +1,88 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
|
||||
build_bcmkernel_consumer() {
|
||||
local tarfile bcmkernelcommith sdkversion
|
||||
sdkversion=$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')
|
||||
sdkversion=${sdkversion:0:4}${sdkversion:(-1)}
|
||||
bcmkernelcommith=$(grep -w "PKG_SOURCE_VERSION:" $curdir/feeds/broadcom/bcmkernel/${sdkversion:0:5}*.mk | cut -d'=' -f2)
|
||||
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
|
||||
[ -n "$board" -a -n "$bcmkernelcommith" ] || return
|
||||
ssh $SERVER "test -f $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/bcmkernel-*-${sdkversion:0:4}*/bcm963xx/release
|
||||
bash do_consumer_release -p $profile -y -F
|
||||
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 -pv $tarfile $SERVER:$FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz
|
||||
ssh $SERVER "[ -f $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz ] && ln -sf $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz $FPATH/bcmopen-$board-$majver.$minver-latest"
|
||||
scp $tarfile inteno@ihgsp.inteno.se:/home/inteno/public/www/iopsys/consumer/bcmopen-$profile-$bcmkernelcommith.tar.gz
|
||||
rm -f $tarfile
|
||||
cd "$curdir"
|
||||
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/iopsys/natalie-dect/Makefile | cut -d'=' -f2)
|
||||
nataliecommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/natalie-dect/Makefile | cut -d'=' -f2)
|
||||
[ -n "$profile" -a -n "$natalieversion" -a -n "$nataliecommith" ] || return
|
||||
ssh $SERVER "test -f $FPATH/natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/natalie-dect-$natalieversion/
|
||||
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 -f ipkg-*/natalie-dect/lib/modules/*/extra/dect.ko natalie-dect-open-$natalieversion/dect.ko
|
||||
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 -pv natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz $SERVER:$FPATH/
|
||||
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"
|
||||
cd $curdir
|
||||
}
|
||||
|
||||
build_endptmngr_consumer() {
|
||||
# create endptmngr open version tar file
|
||||
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/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
||||
endptcommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
||||
[ -n "$profile" -a -n "$endptversion" -a -n "$endptcommith" ] || return
|
||||
ssh $SERVER "test -f $FPATH/endptmngr-$profile-$endptversion-$endptcommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/endptmngr-$endptversion/
|
||||
mkdir endptmngr-open-$endptversion
|
||||
mkdir endptmngr-open-$endptversion/src
|
||||
cp ./src/endptmngr endptmngr-open-$endptversion/src
|
||||
cp -r ./files/ endptmngr-open-$endptversion/
|
||||
tar -czv endptmngr-open-$endptversion/ -f endptmngr-$profile-$endptversion-$endptcommith.tar.gz
|
||||
scp -pv endptmngr-$profile-$endptversion-$endptcommith.tar.gz $SERVER:$FPATH/
|
||||
cp endptmngr-$profile-$endptversion-$endptcommith.tar.gz $curdir/
|
||||
rm -rf endptmngr-open-$endptversion
|
||||
rm -f endptmngr-$profile-$endptversion-$endptcommith.tar.gz
|
||||
cd "$curdir"
|
||||
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/iopsys/ice-client/Makefile | head -1 | cut -d'=' -f2)
|
||||
icebasever=$(grep -w "BASE_PKG_VERSION:" ./feeds/iopsys/ice-client/Makefile | cut -d'=' -f2)
|
||||
icerelease=$(grep -w "PKG_RELEASE:" ./feeds/iopsys/ice-client/Makefile | cut -d'=' -f2)
|
||||
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
|
||||
[ -n "$target" -a -n "$iceversion" -a -n "$icecommith" ] || return
|
||||
ssh $SERVER "test -f $FPATH/ice-client-$target-$iceversion-$icecommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/ice-client-$icebasever/ipkg-* || cd ./build_dir/target-mips*musl-*/ice-client-$icebasever/ipkg-*
|
||||
tar -czv ice-client -f ice-client-$target-$iceversion-$icecommith.tar.gz
|
||||
scp -pv ice-client-$target-$iceversion-$icecommith.tar.gz $SERVER:$FPATH/
|
||||
cp ice-client-$target-$iceversion-$icecommith.tar.gz $curdir/
|
||||
rm -f ice-client-$target-$iceversion-$icecommith.tar.gz
|
||||
cd "$curdir"
|
||||
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
|
||||
}
|
||||
|
||||
build_wifilife_consumer() {
|
||||
local ver commit
|
||||
ver=$(grep -w "PKG_VERSION:" ./feeds/iopsys/wifilife/Makefile | cut -d'=' -f2)
|
||||
commit=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/wifilife/Makefile | cut -d'=' -f2)
|
||||
[ -n "$ver" -a -n "$commit" ] || return
|
||||
ssh $SERVER "test -f $FPATH/wifilife-$target-${ver}_${commit}.tar.xz" && return
|
||||
cd ./build_dir/target-*/wifilife-$ver/ipkg-* || cd ./build_dir/target-mips*musl-*/wifilife-$ver/ipkg-*
|
||||
mkdir -p wifilife-$ver/src
|
||||
cp -rf wifilife/usr/sbin/* wifilife-$ver/src/
|
||||
tar Jcf wifilife-${target}-${ver}_${commit}.tar.xz wifilife-$ver
|
||||
scp -pv wifilife-$target-${ver}_${commit}.tar.xz $SERVER:$FPATH/
|
||||
cp wifilife-${target}-${ver}_${commit}.tar.xz $curdir/
|
||||
rm -rf wifilife-$ver
|
||||
rm -f wifilife-${target}-${ver}_${commit}.tar.xz
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_mediatek_kernel() {
|
||||
local mediatek_commit kernel_version kernel
|
||||
|
||||
mediatek_commit=$(grep CONFIG_KERNEL_GIT_COMMIT .config | cut -d '=' -f2 | tr -d '"')
|
||||
kernel_version=$(grep KERNEL_PATCHVER target/linux/iopsys-ramips/Makefile | cut -d '=' -f2)
|
||||
kernel=linux-${kernel_version}.*
|
||||
[ -n "$mediatek_commit" ] || return
|
||||
ssh $SERVER "test -f $FPATH/mediatek-kernel-open-$mediatek_commit.tar.gz" && return
|
||||
echo "Building mediatek kernel tarball from kernel commit:"
|
||||
echo $mediatek_commit
|
||||
cd build_dir/target-mipsel_1004kc*/linux-iopsys-ramips*/$kernel
|
||||
|
||||
# Save Kconfig files to recreate the same kernel config,
|
||||
# delete everyting else.
|
||||
find drivers/net/wireless/mt_wifi -type f ! -name Kconfig | xargs rm
|
||||
find drivers/net/wireless/rlt_wifi -type f ! -name Kconfig | xargs rm
|
||||
|
||||
# remove git repo
|
||||
rm -rf .git
|
||||
|
||||
# patch kernel for openstk
|
||||
ls consumer_release | while read line; do patch -p1 < consumer_release/$line; done
|
||||
cd ..
|
||||
|
||||
tar -czv $kernel -f mediatek-kernel-open-$mediatek_commit.tar.gz
|
||||
scp -pv mediatek-kernel-open-$mediatek_commit.tar.gz $SERVER:$FPATH/
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
function print_usage {
|
||||
echo "Usage: $0 generate_tarballs"
|
||||
echo " -t <target>"
|
||||
}
|
||||
|
||||
function generate_tarballs {
|
||||
|
||||
SERVER="god@software.inteno.se"
|
||||
FPATH="/var/www/html/iopsys/consumer"
|
||||
|
||||
set -e
|
||||
git remote -v | grep -q http && return # do not continue if this is an open SDK environment
|
||||
|
||||
target=$(grep CONFIG_TARGET_BOARD .config | cut -d'=' -f2 | tr -d '"')
|
||||
board=$(grep CONFIG_TARGET_IBOARDID .config | cut -d'=' -f2 | tr -d '"')
|
||||
profile=$(grep CONFIG_BCM_KERNEL_PROFILE .config | cut -d'=' -f2 | tr -d '"')
|
||||
majver=$(grep CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"' | cut -f1 -d .)
|
||||
minver=$(grep CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"' | cut -f2 -d .)
|
||||
curdir="$PWD"
|
||||
sdkversion=$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')
|
||||
curdir=$(pwd)
|
||||
|
||||
|
||||
# Execute user command
|
||||
while getopts "t:h" opt; do
|
||||
case $opt in
|
||||
t)
|
||||
stk_target=${OPTARG}
|
||||
;;
|
||||
h)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -n "$stk_target" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$stk_target" == "broadcom" ]; then
|
||||
build_bcmkernel_consumer
|
||||
build_natalie_consumer
|
||||
build_endptmngr_consumer
|
||||
build_ice_consumer
|
||||
build_wifilife_consumer
|
||||
elif [ "$stk_target" == "mediatek" ]; then
|
||||
build_mediatek_kernel
|
||||
build_ice_consumer
|
||||
build_wifilife_consumer
|
||||
else
|
||||
echo "Invalid target: $stk_target"
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
build_bcmkernel_consumer
|
||||
build_natalie_consumer
|
||||
build_endptcfg_consumer
|
||||
build_ice_consumer
|
||||
|
||||
}
|
||||
|
||||
register_command "generate_tarballs" "Generate tarballs for Open SDK"
|
||||
register_command "generate_tarballs" "Generate tarballs for openstk"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ function install_key {
|
||||
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 "console::askfirst:/bin/cttyhack /bin/ash --login" >>files/etc/inittab
|
||||
echo "ttyS0::askfirst:/bin/ash --login" >>files/etc/inittab
|
||||
|
||||
echo Done
|
||||
}
|
||||
|
||||
@@ -1,326 +0,0 @@
|
||||
# this is a developer helper script to install firmware on a remote host with SSH
|
||||
|
||||
function upd_usage {
|
||||
echo "usage: $0 iopupgrade -t <host> -f <file> [opts] "
|
||||
echo ""
|
||||
echo " Default host is 192.168.1.1"
|
||||
echo " Default firmware file is the newest one found"
|
||||
echo " Default is to not keep configuration"
|
||||
echo "opts:"
|
||||
echo ""
|
||||
echo " -i Interactive use, Allows to select firmware file"
|
||||
echo " -n Do not do the final reboot of the target board"
|
||||
echo " -c Keep configuration"
|
||||
echo " -x Force install even if firmware is not for this board"
|
||||
echo " -b Force install of bootloader regardless of version installed"
|
||||
echo " -s Use sysupgade. old upgrade method, needed for old releases that do not have iopu"
|
||||
}
|
||||
|
||||
function set_config_string {
|
||||
eval `grep $1 .config`
|
||||
}
|
||||
|
||||
function upd_ask_ok {
|
||||
echo "Will Continue with the following settings"
|
||||
echo "-----------------------------------------"
|
||||
printf "%20s: %s\n" "Firmare file" "$upd_fw_base"
|
||||
printf "%20s: %s\n" "Host ip" "$upd_host"
|
||||
printf "%20s: " "Reboot"; if [ "$upd_noreboot" == "0" ] ;then printf "Yes\n" ;else printf "No\n";fi
|
||||
printf "%20s: " "Keep config"; if [ "$upd_keepconf" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi
|
||||
printf "%20s: " "Force bootloader"; if [ "$upd_forceboot" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi
|
||||
printf "%20s: " "Force image upgrade"; if [ "$upd_forceimage" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi
|
||||
printf "%20s: " "Use sysupgrade"; if [ "$upd_sysupgrade" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi
|
||||
echo "-----------------------------------------"
|
||||
|
||||
if [ "$upd_sysupgrade" == "0" ]
|
||||
then
|
||||
if [ "$upd_keepconf" == "1" ] ;then echo "keeping config is just a fantasy it's not yet implemented, try sysupgrade";fi
|
||||
fi
|
||||
|
||||
echo -n "Continue? [Y/n/q]:"
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
n|N)
|
||||
return 1;;
|
||||
q|Q)
|
||||
exit 1;;
|
||||
y|Y|*)
|
||||
return 0;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_file {
|
||||
|
||||
dialog --keep-tite --title "To select file use TAB/ARROW to hilight then press SPACEBAR -> RETURN" \
|
||||
--fselect "bin/targets/$CONFIG_TARGET_BOARD/generic/" \
|
||||
$((lines -10)) $((cols -5)) \
|
||||
2> $tempfile
|
||||
|
||||
new_file=$(cat $tempfile)
|
||||
if [ -n "$new_file" ]
|
||||
then
|
||||
upd_fw="$new_file"
|
||||
upd_fw_base=$(basename $upd_fw);
|
||||
fi
|
||||
}
|
||||
|
||||
function upd_select_target {
|
||||
|
||||
dialog --keep-tite --title "Input the name/ip number of target board" \
|
||||
--inputbox "Name/IP" \
|
||||
$((lines -10)) $((cols -5)) \
|
||||
"$upd_host" \
|
||||
2> $tempfile
|
||||
|
||||
new_file=$(cat $tempfile)
|
||||
if [ -n "$new_file" ]
|
||||
then
|
||||
upd_host="$new_file"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function upd_select_reboot {
|
||||
dialog --keep-tite --radiolist "Should the board reboot after download finished" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"Reboot" "Restart board after done" `if [ "$upd_noreboot" == "0" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
"No reboot" "Continue running old system" `if [ "$upd_noreboot" == "1" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
2> $tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"No reboot")
|
||||
upd_noreboot=1
|
||||
;;
|
||||
"Reboot")
|
||||
upd_noreboot=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_config {
|
||||
dialog --keep-tite --radiolist "Should the configuration be keept" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"Keep" "Keep the config from old system" `if [ "$upd_keepconf" == "1" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
"Default" "Use default config for new system" `if [ "$upd_keepconf" == "0" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
2> $tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"Keep")
|
||||
upd_keepconf=1
|
||||
;;
|
||||
"Default")
|
||||
upd_keepconf=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_forceboot {
|
||||
dialog --keep-tite --radiolist "Should the boot loader be updated reagardless of version installed" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"Force" "Alwasy update boot loader" `if [ "$upd_forceboot" == "1" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
"Version check" "Only upgrade if version is newer" `if [ "$upd_forceboot" == "0" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
2> $tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"Force")
|
||||
upd_forceboot=1
|
||||
;;
|
||||
"Version check")
|
||||
upd_forceboot=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_forceimage {
|
||||
dialog --keep-tite --radiolist "Should the image be stored in flash even if sanity checks would reject it" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"Force" "Dissable sanity check and force use of image (dangerous)" `if [ "$upd_forceimage" == "1" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
"Only compatible" "Normal checks apply" `if [ "$upd_forceimage" == "0" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
2> $tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"Force")
|
||||
upd_forceimage=1
|
||||
;;
|
||||
"Only compatible")
|
||||
upd_forceimage=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_sysupgrade {
|
||||
dialog --keep-tite --radiolist "Use the old way to upgrade a board" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"iopu" "Use the iop upgrade methode" `if [ "$upd_sysupgrade" == "0" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
"sysupgrade" "Use the old sysupgrade methode" `if [ "$upd_sysupgrade" == "1" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
2> $tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"iopu")
|
||||
upd_sysupgrade=0
|
||||
;;
|
||||
"sysupgrade")
|
||||
upd_sysupgrade=1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select {
|
||||
|
||||
dialog --keep-tite --ok-label "Select" --cancel-label "Done" --menu "Select Item to change" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"Firmare file" "$upd_fw_base"\
|
||||
"Host ip" "$upd_host" \
|
||||
"Reboot" `if [ "$upd_noreboot" == "0" ] ;then printf "Yes\n" ;else printf "No\n";fi` \
|
||||
"Keep config" `if [ "$upd_keepconf" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi` \
|
||||
"Force bootloader" `if [ "$upd_forceboot" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi` \
|
||||
"Force image upgrade" `if [ "$upd_forceimage" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi` \
|
||||
"sysupgrade" `if [ "$upd_sysupgrade" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi` \
|
||||
2> $tempfile
|
||||
|
||||
|
||||
case $(cat $tempfile) in
|
||||
"Firmare file")
|
||||
upd_select_file
|
||||
;;
|
||||
"Host ip")
|
||||
upd_select_target
|
||||
;;
|
||||
"Reboot")
|
||||
upd_select_reboot
|
||||
;;
|
||||
"Keep config")
|
||||
upd_select_config
|
||||
;;
|
||||
"Force bootloader")
|
||||
upd_select_forceboot
|
||||
;;
|
||||
"Force image upgrade")
|
||||
upd_select_forceimage
|
||||
;;
|
||||
"sysupgrade")
|
||||
upd_select_sysupgrade
|
||||
;;
|
||||
*)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
upd_select
|
||||
}
|
||||
function upd_select_start {
|
||||
lines=$(tput lines)
|
||||
cols=$(tput cols)
|
||||
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
|
||||
trap "rm -f $tempfile" 0 1 2 5 15
|
||||
upd_select
|
||||
|
||||
}
|
||||
|
||||
function ssh_upgrade {
|
||||
upd_noreboot=0
|
||||
upd_forceboot=0
|
||||
upd_keepconf=0
|
||||
upd_forceimage=0
|
||||
upd_fw_base=""
|
||||
upd_fw=""
|
||||
upd_host="192.168.1.1"
|
||||
upd_sysupgrade=0
|
||||
do_dialog=0
|
||||
|
||||
while getopts "f:hnxt:iscb" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
upd_noreboot=1
|
||||
;;
|
||||
x)
|
||||
upd_forceimage=1
|
||||
;;
|
||||
b)
|
||||
upd_forceboot=1
|
||||
;;
|
||||
c)
|
||||
upd_keepconf=1
|
||||
;;
|
||||
v)
|
||||
verbose=$OPTARG
|
||||
;;
|
||||
f)
|
||||
upd_fw=$OPTARG
|
||||
;;
|
||||
t)
|
||||
upd_host=$OPTARG
|
||||
;;
|
||||
i)
|
||||
do_dialog=1
|
||||
;;
|
||||
s)
|
||||
upd_sysupgrade=1
|
||||
;;
|
||||
h)
|
||||
upd_usage
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$upd_fw" ]
|
||||
then
|
||||
upd_fw_base=$(basename $upd_fw);
|
||||
else
|
||||
set_config_string CONFIG_TARGET_BOARD
|
||||
firmwares=$(cd bin/targets/$CONFIG_TARGET_BOARD/generic/; ls -t *[0-9].y[3])
|
||||
|
||||
for upd_fw_base in $firmwares
|
||||
do
|
||||
#echo "firmware $upd_fw"
|
||||
break
|
||||
done
|
||||
upd_fw="bin/targets/$CONFIG_TARGET_BOARD/generic/$upd_fw_base"
|
||||
fi
|
||||
|
||||
[ $do_dialog -eq 1 ] && upd_select_start
|
||||
|
||||
if ! upd_ask_ok
|
||||
then
|
||||
upd_select_start
|
||||
if ! upd_ask_ok
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f $upd_fw ]
|
||||
then
|
||||
echo "firmware file $firmware do not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $upd_sysupgrade -eq 0 ]
|
||||
then
|
||||
extra_args=""
|
||||
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args -n"
|
||||
[ $upd_forceimage -eq 1 ] && extra_args="$extra_args -x"
|
||||
[ $upd_forceboot -eq 1 ] && extra_args="$extra_args -b"
|
||||
|
||||
file_size_kb=`du -k "$upd_fw" | cut -f1`
|
||||
cat $upd_fw | pv -s ${file_size_kb}k | ssh root@$upd_host "iopu $extra_args"
|
||||
else
|
||||
scp $upd_fw root@$upd_host:/tmp/ &&
|
||||
ssh -o ConnectTimeout=60 root@$upd_host "sysupgrade -v $3 /tmp/$upd_fw_base" &&
|
||||
echo "sysupgrade done!"
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "ssh_upgrade" "-h <host> -f <file> [opts] Install firmware on remote host with SSH"
|
||||
|
||||
|
||||
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"
|
||||
@@ -1,61 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Exported interface
|
||||
function update_feed_branches {
|
||||
local release="$1"
|
||||
local ipath="$(pwd)"
|
||||
local branch="$2"
|
||||
local curbranch
|
||||
|
||||
[ -n "$release" ] || {
|
||||
echo "Usage: ./update_feeds <RELEASE> <BRANCH>"
|
||||
echo ""
|
||||
echo "If you do not give a branch as argument,"
|
||||
echo "<RELEASE> branch will be updated to commit"
|
||||
echo "hash given in feeds.conf for each feed repo"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ -n "$branch" ]; then
|
||||
echo "Updating release branch $release to specific commit hash given in feeds.conf for each feed repo at branch $branch"
|
||||
if git diff-index --quiet HEAD; then
|
||||
curbranch=`git symbolic-ref HEAD 2>/dev/null`
|
||||
curbranch=${curbranch##refs/heads/}
|
||||
if [ -z $curbranch ]; then
|
||||
curbranch=`git log -1 --pretty=format:"%H"`
|
||||
fi
|
||||
git checkout $branch || {
|
||||
echo "couldn't checkout branch $branch"
|
||||
exit 99
|
||||
}
|
||||
else
|
||||
echo "You have unsaved changes."
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo "Updating release branch $release to specific commit hash given in feeds.conf for each feed repo"
|
||||
fi
|
||||
|
||||
ifeeds="$(grep -r 'dev.iopsys.eu' feeds.conf | awk '{print$2}' | tr '\n' ' ')"
|
||||
|
||||
for f in $ifeeds; do
|
||||
commith=$(grep $f feeds.conf | cut -d'^' -f2)
|
||||
cd $ipath/feeds/$f
|
||||
git branch -D $release 2>/dev/null
|
||||
echo "$f: updating release branch $release to commit $commith"
|
||||
git checkout $commith
|
||||
git push origin :$release
|
||||
git checkout -b $release
|
||||
git push --set-upstream origin $release
|
||||
cd $ipath
|
||||
done
|
||||
|
||||
if [ -n "$branch" ]; then
|
||||
echo "Release branch $release is updated to specific commit hash given in feeds.conf in in branch $branch for each feed repo"
|
||||
git checkout $curbranch
|
||||
else
|
||||
echo "Release branch $release is updated to specific commit hash given in feeds.conf for each feed repo"
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "update_feed_branches" "<release> [branch] Update branches in feeds from the current top level commit or specified top level branch"
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
print_git_update()
|
||||
{
|
||||
echo "pkg -> ${PKG_NAME}"
|
||||
@@ -41,7 +42,7 @@ update_this_pkg()
|
||||
echo " to get an up to date version in ${PKG_BUILD_DIR}/.git_update"
|
||||
echo ""
|
||||
|
||||
echo -n " Should we continue with the update anyway? [y/N]:"
|
||||
echo -n " Shold we continue with the update anyway? [y/N]:"
|
||||
read answer
|
||||
echo ""
|
||||
|
||||
@@ -98,28 +99,6 @@ insert_hash_in_feed_makefile()
|
||||
(cd ${PKG_DIR}; git add ${name})
|
||||
}
|
||||
|
||||
insert_version_in_feed_makefile()
|
||||
{
|
||||
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
|
||||
then
|
||||
name="$PKG_SOURCE_VERSION_FILE"
|
||||
else
|
||||
name=Makefile
|
||||
fi
|
||||
|
||||
last_version=$(awk -F '=' '/PKG_VERSION:=/ {print $2}' ${PKG_DIR}/${name})
|
||||
|
||||
echo -n "please enter version: "
|
||||
read -ei "$last_version" answer
|
||||
|
||||
if [ -z ${answer} ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i -e "s/\(^PKG_VERSION:=\).*/\1${answer}/" ${PKG_DIR}/${name}
|
||||
(cd ${PKG_DIR}; git add ${name})
|
||||
}
|
||||
|
||||
|
||||
# BUG: fix if only local branche name!
|
||||
branch_uptodate()
|
||||
@@ -184,7 +163,7 @@ branch_uptodate()
|
||||
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 somebody having commited to the same branch"
|
||||
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
|
||||
@@ -387,23 +366,19 @@ 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}/"
|
||||
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 have been done to the packages."
|
||||
echo "Now checking if any changes has been done to the packages."
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
# only scan in the build directory that is currently in use.
|
||||
CPU=$(grep "CONFIG_CPU_TYPE=" .config| cut -f2 -d\")
|
||||
LIBC=$(grep "CONFIG_LIBC=" .config| cut -f2 -d\")
|
||||
|
||||
# First scan all files in build dir for packages that have .git directories.
|
||||
all_pkgs=$(find build_dir/*${CPU}*${LIBC}* -name ".git")
|
||||
|
||||
all_pkgs=$(find build_dir/ -name ".git")
|
||||
|
||||
for pkg in `echo "$all_pkgs"`
|
||||
do
|
||||
pkg=$(dirname $pkg)
|
||||
@@ -425,7 +400,6 @@ check_packages()
|
||||
# print_git_update
|
||||
git_repos_uptodate
|
||||
insert_hash_in_feed_makefile
|
||||
[ ${UPDATE} -eq 1 ] && insert_version_in_feed_makefile
|
||||
create_message >tmp/msg
|
||||
commit_feed tmp/msg
|
||||
insert_hash_in_feeds_config
|
||||
@@ -441,7 +415,7 @@ check_packages()
|
||||
|
||||
feeds_hash()
|
||||
{
|
||||
grep -v "^#" feeds.conf | grep " $1 " | grep "\^" | sed -e "s/.*[;^]\(.*\)/\1/"
|
||||
grep -v "^#" feeds.conf | grep " $1" | sed -e "s/.*[;^]\(.*\)/\1/"
|
||||
}
|
||||
|
||||
insert_feed_hash_in_feeds_config()
|
||||
@@ -489,66 +463,61 @@ Date: %ai%n\
|
||||
check_feeds()
|
||||
{
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
echo "Now checking if any changes have been done to the feeds."
|
||||
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)
|
||||
[ -n "$feed_hash" ] || continue
|
||||
if [ -d feeds/$feed ]; then
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
feed_hash=$(feeds_hash $feed)
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
|
||||
if [ "$feed_hash" != "$in_git" ]
|
||||
then
|
||||
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"
|
||||
#echo "git id from feeds.conf [$feed_hash] git id from feeds/${feed} [$in_git]"
|
||||
on_a_branch feeds/${feed} feed
|
||||
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 "git id from feeds.conf [$feed_hash] git id from feeds/${feed} [$in_git]"
|
||||
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
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -578,19 +547,10 @@ feeds_at_top()
|
||||
exit 0
|
||||
}
|
||||
|
||||
usage(){
|
||||
echo -e "$0 [flags]"
|
||||
echo -e "flags:"
|
||||
echo -e " -v\tVerbose mode"
|
||||
echo -e " -h\tShow this help"
|
||||
echo -e " -u\tUpdate package version\n"
|
||||
}
|
||||
|
||||
# Exported interface
|
||||
function update_package {
|
||||
|
||||
UPDATE=0
|
||||
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
# Regular Colors
|
||||
@@ -603,18 +563,15 @@ function update_package {
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;37m' # White
|
||||
|
||||
while getopts "v:hu" opt; do
|
||||
while getopts "v:h" opt; do
|
||||
case $opt in
|
||||
v)
|
||||
verbose=$OPTARG
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
u)
|
||||
UPDATE=1
|
||||
;;
|
||||
echo "some help! No options yet"
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#
|
||||
# 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:=iopupgrade
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=01f2afd6c831d6f9eb2940c7e7af16f7e4d439c2
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopupgrade
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_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/iopupgrade
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Iopsys system upgrade utility
|
||||
URL:=
|
||||
# DEPENDS:=
|
||||
endef
|
||||
|
||||
define Package/iopupgrade/description
|
||||
Application handling peripheral
|
||||
endef
|
||||
|
||||
define Package/iopupgrade/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iopupgrade $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,iopupgrade))
|
||||
|
||||
@@ -1,278 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################################
|
||||
# Global variables. can be used directly in any function called.
|
||||
cur_vol="" # num,[0/1] Number used for ubifs root filesystem volume name.
|
||||
# eg: rootfs_0 or rootfs_1, currently used
|
||||
upd_vol="" # num,[0/1] Number used for ubifs root filesystem volume name.
|
||||
# eg: rootfs_0 or rootfs_1, the one we want to update
|
||||
cmdline="" # command line settings.
|
||||
cmdline_match="" # Headers to match to the image
|
||||
|
||||
###############################################################################
|
||||
# file local variables. should not be used in imported functions. Can be used
|
||||
# by functions declared in this script
|
||||
chroot_cmdline="" # command line for the iop_chroot command.
|
||||
board="" # string, Board name that is going to be matched
|
||||
# against header of firmware image
|
||||
upd_ubi_id="" # num, UBI volume number for the volume name
|
||||
# "rootfs_$upd_vol", use to know what volume to run
|
||||
# ubiupdatevol on.
|
||||
run_cleanup=0 # if set the cleanup should be run otherwise we skip it.
|
||||
run_mount_cleanup=0 # set if we should run umount in cleanup
|
||||
upd_kernel=0 # set to 1 if system has the kernel in own mtd partition
|
||||
log_stdout=1 # set to 0 to prevent the log to also print to stdout
|
||||
upd_noreboot=0 # set to 1 if we should not reboot after programming
|
||||
upd_forceimage=0 # set this to force upgrade even if image is for wrong board.
|
||||
upd_forceboot=0 # set this to force upgrade of boot loader
|
||||
###############################################################################
|
||||
# import external functions
|
||||
source /lib/upgrade/iopsys.sh
|
||||
[ -f /lib/upgrade/iopupgrade ] && source /lib/upgrade/iopupgrade
|
||||
|
||||
# only call function if it exists
|
||||
function_call() {
|
||||
if type "$1" 2>/dev/null >/dev/null
|
||||
then
|
||||
$1 $@
|
||||
fi
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Cleanup and error handling functions.
|
||||
function log {
|
||||
TIME=$(date)
|
||||
[ $log_stdout -eq 1 ] && echo "$@"
|
||||
echo "[$TIME] $@" >>/tmp/upd_log
|
||||
}
|
||||
|
||||
# we need to handle ctrl-c, segmentation fault, sigpipe and other abnormal
|
||||
# terminations. no printing to stdout/stderr allowed in this function or
|
||||
# anyhting it calls as stdout/stderr might no longer exist
|
||||
function finish {
|
||||
|
||||
if [ "$run_cleanup" == "1" ]
|
||||
then
|
||||
|
||||
function_call upd_cleanup
|
||||
log ""
|
||||
fi
|
||||
|
||||
if [ "$run_mount_cleanup" == "1" ]
|
||||
then
|
||||
log "Cleaning up after mount"
|
||||
umount_newroot
|
||||
fi
|
||||
# always kill the timeout process, will leave the sleep but that is harmless
|
||||
# as long as the kill will nerver be run.
|
||||
kill $TIMEOUT_PID 2>/dev/null
|
||||
|
||||
lock -u /tmp/iopu.lock
|
||||
}
|
||||
|
||||
function sig_pipe {
|
||||
log_stdout=0 # stdin,stdout,stderr do not exist anymore
|
||||
log "Got sigpipe. Turning of log printing to stdout"
|
||||
}
|
||||
|
||||
# if a timout happens terminate
|
||||
function timeout {
|
||||
finish
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Not much that can be done if the mount fails but to try again.
|
||||
# if after 10 seconds there still is errors abort program.
|
||||
# UBIFS has some wierd time intervall after ubiupdatevol where
|
||||
# a mount of the newly written data results in a busy error.
|
||||
function mount_retry {
|
||||
local tries=0
|
||||
|
||||
while [ $tries -lt 10 ]
|
||||
do
|
||||
if mount $@ 2>/dev/null
|
||||
then
|
||||
return
|
||||
fi
|
||||
tries=$((tries + 1))
|
||||
sleep 1
|
||||
done
|
||||
|
||||
log "mount failed for command [mount $@] so upgrade failed."
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
function mount_newroot {
|
||||
run_mount_cleanup=1
|
||||
mkdir -p /tmp/newroot
|
||||
mkdir -p /tmp/newroot_overlay
|
||||
|
||||
mount_retry -t ubifs ubi0:rootfs_$upd_vol /tmp/newroot
|
||||
|
||||
mount_retry -o noatime,lowerdir=/tmp/newroot,upperdir=/tmp/newroot/overlay,workdir=/tmp/newroot/lib/overlay.tmp -t overlay "overlayfs:/tmp/newroot/overlay" /tmp/newroot_overlay
|
||||
mount_retry --bind /tmp/newroot/ /tmp/newroot_overlay/rom
|
||||
|
||||
mount_retry --bind /dev /tmp/newroot_overlay/dev
|
||||
mount_retry --bind /proc /tmp/newroot_overlay/proc
|
||||
mount_retry --bind /sys /tmp/newroot_overlay/sys
|
||||
mount_retry -t tmpfs -o noatime,mode=0755 root /tmp/newroot_overlay/tmp
|
||||
|
||||
mkdir -p /tmp/newroot_overlay/tmp/oldroot
|
||||
mount_retry --bind / /tmp/newroot_overlay/tmp/oldroot
|
||||
mount_retry --bind /tmp /tmp/newroot_overlay/tmp/oldroot/tmp
|
||||
}
|
||||
|
||||
function umount_newroot {
|
||||
umount /tmp/newroot_overlay/tmp/oldroot/tmp
|
||||
umount /tmp/newroot_overlay/tmp/oldroot
|
||||
umount /tmp/newroot_overlay/tmp
|
||||
umount /tmp/newroot_overlay/sys
|
||||
umount /tmp/newroot_overlay/proc
|
||||
umount /tmp/newroot_overlay/dev
|
||||
umount /tmp/newroot_overlay/rom
|
||||
umount /tmp/newroot_overlay
|
||||
umount /tmp/newroot
|
||||
run_mount_cleanup=0
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $0 iopu [opts] "
|
||||
echo ""
|
||||
echo "opts:"
|
||||
echo ""
|
||||
echo " -n Do not do the final reboot of the target board"
|
||||
echo " -c Keep configuration"
|
||||
echo " -x Force install even if firmware is not for this board"
|
||||
echo " -b Force install of bootloader regardless of version installed"
|
||||
echo " -r Jump into chroot env of other system"
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
# just one instance
|
||||
# this check has to be done before we install handler to avoid removing the
|
||||
# lock even if it was not available.
|
||||
if ! lock -n /tmp/iopu.lock
|
||||
then
|
||||
echo "Another instance of iopu already running"
|
||||
echo "If you are sure this is wrong remove file /tmp/iopu.lock"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap finish EXIT
|
||||
trap timeout SIGALRM
|
||||
trap sig_pipe SIGPIPE
|
||||
|
||||
while getopts "nrxb" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
upd_noreboot=1
|
||||
;;
|
||||
x)
|
||||
upd_forceimage=1
|
||||
;;
|
||||
b)
|
||||
upd_forceboot=1
|
||||
;;
|
||||
r)
|
||||
upd_vol=$(get_flashbank_next)
|
||||
mount_newroot
|
||||
(ENV=/sbin/iopu_chroot_env chroot /tmp/newroot_overlay /bin/sh)
|
||||
echo ""
|
||||
umount_newroot
|
||||
exit 0
|
||||
;;
|
||||
h)
|
||||
upd_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# put a timeout on this if it takes longer than 120 seconds we should abort
|
||||
# and clean up
|
||||
(
|
||||
sleep 120 # if 2 minutes pass
|
||||
kill -ALRM $$ 2>/dev/null # send it a SIGALRM signal
|
||||
)&
|
||||
TIMEOUT_PID=$!
|
||||
|
||||
log "Firmware upgrade started"
|
||||
|
||||
# Should board name be checked
|
||||
if [ $upd_forceimage -eq 0 ]
|
||||
then
|
||||
board=$(db get hw.board.iopVerBoard)
|
||||
cmdline_match="board=$board"
|
||||
fi
|
||||
|
||||
# find out what rootfs volume is active.
|
||||
cur_vol=$(get_flashbank_current)
|
||||
upd_vol=$(get_flashbank_next)
|
||||
|
||||
# convert volume name "rootfs_$upd_vol" into ubifs volume id
|
||||
upd_ubi_id=$(ubinfo -d 0 -N rootfs_$upd_vol | awk "/Volume ID:/ {print \$3}")
|
||||
log "installing Root Fileystem into UBI volume rootfs_$upd_vol"
|
||||
|
||||
# prepare to match dsl.
|
||||
function_call upd_conf_dsl
|
||||
|
||||
# prepare to update CFE if it exists
|
||||
function_call upd_conf_cfe
|
||||
|
||||
# prepare to update kernel if it is stored in MTD/JFFS2
|
||||
function_call upd_conf_kernel
|
||||
|
||||
log "now starting writing data to flash with [ iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id ]"
|
||||
run_cleanup=1 # When we start to actually write data there might be some
|
||||
# things that need cleanup if we get an error/crash
|
||||
iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id
|
||||
|
||||
# in case of any error we abort
|
||||
if [ $? -ne 0 ]; then
|
||||
log "iopupgrade program Failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Firmware programmed to flash."
|
||||
|
||||
|
||||
log "Transfering configuration to new system."
|
||||
|
||||
# Force upgrade of boot loader
|
||||
[ $upd_forceboot -eq 1 ] && chroot_cmdline="$chroot_cmdline -b"
|
||||
|
||||
mount_newroot
|
||||
chroot /tmp/newroot_overlay /sbin/iopu_chroot $chroot_cmdline
|
||||
umount_newroot
|
||||
|
||||
log "Update fully installed."
|
||||
run_cleanup=0
|
||||
|
||||
# Now make sure that we actually boot the new system on the next reboot
|
||||
upd_finnish
|
||||
|
||||
# spawn the reboot to a subshell to allow the main program to quit before reset
|
||||
# to avoid any hanged network connection like ssh
|
||||
if [ $upd_noreboot -eq 0 ]
|
||||
then
|
||||
(
|
||||
log_stdout=0 # stdin,stdout,stderr do not exist anymore, we are in a
|
||||
# subshell and then the trap is no longer working.
|
||||
sleep 1
|
||||
log "Rebooting NOW!!!"
|
||||
log ""
|
||||
reboot
|
||||
)&
|
||||
log "Reboot initiated"
|
||||
else
|
||||
log "Skipping reboot"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This program is intended to be run in a chroot environment where the old system
|
||||
# is mounted in /tmp/oldroot
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Global variables. can be used directly in any function called.
|
||||
|
||||
|
||||
###############################################################################
|
||||
# file local variables. should not be used in imported functions. Can be used
|
||||
# by functions declared in this script
|
||||
upd_forceboot=0
|
||||
log_stdout=1 # set to 0 to prevent the log to also print to stdout
|
||||
|
||||
###############################################################################
|
||||
# import external functions
|
||||
|
||||
source /lib/upgrade/iopsys.sh
|
||||
[ -f /lib/upgrade/iopupgrade ] && source /lib/upgrade/iopupgrade
|
||||
|
||||
|
||||
# only call function if it exists
|
||||
function_call() {
|
||||
if type "$1" 2>/dev/null >/dev/null
|
||||
then
|
||||
$1 $@
|
||||
fi
|
||||
}
|
||||
# Cleanup and error handling functions.
|
||||
function log {
|
||||
TIME=$(date)
|
||||
[ $log_stdout -eq 1 ] && echo "$@"
|
||||
echo "[$TIME] $@" >>/root/upd_log
|
||||
}
|
||||
|
||||
|
||||
while getopts "hb" opt; do
|
||||
case $opt in
|
||||
h)
|
||||
upd_usage
|
||||
exit 1
|
||||
;;
|
||||
b)
|
||||
upd_forceboot=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# copy old install log over
|
||||
cp /tmp/oldroot/tmp/upd_log /root/upd_log
|
||||
|
||||
# Upgrade boot loader if needed.
|
||||
function_call upd_program_boot
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
# this is run when "iopr -r" is executed.
|
||||
# intended to just show what environment is actually started.
|
||||
|
||||
cat /etc/banner
|
||||
|
||||
echo "/tmp/oldroot:"
|
||||
echo " Contains the running root filesystem. It is live so files are in use"
|
||||
echo " Anything copying/reading files from there needs to make sure it is done safely."
|
||||
echo ""
|
||||
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
Red='\033[0;31m' # Red
|
||||
|
||||
PS1="${Red}chroot_new${Color_Off}:\w\#"
|
||||
export PS1
|
||||
export Red
|
||||
export Color_Off
|
||||
@@ -21,7 +21,7 @@ define Package/iup
|
||||
endef
|
||||
|
||||
define Package/iup/description
|
||||
This package contains Inteno's IUP Client
|
||||
This package contains Intenos IUP Client
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
@@ -31,16 +31,19 @@ management_interfaces() {
|
||||
}
|
||||
|
||||
init_iup() {
|
||||
local polling_enabled
|
||||
local interval
|
||||
local starttime
|
||||
local nummber
|
||||
number=$RANDOM
|
||||
|
||||
[ -f $CRONPATH ] || touch $CRONPATH
|
||||
if [ -f $CRONPATH ]; then
|
||||
echo "File $CRONPATH exists"
|
||||
else
|
||||
echo "File $CRONPATH did not exists"
|
||||
touch $CRONPATH
|
||||
fi
|
||||
|
||||
config_load provisioning
|
||||
config_get polling_enabled polling enabled on
|
||||
config_get interval polling interval
|
||||
config_get starttime polling starttime
|
||||
|
||||
@@ -51,12 +54,12 @@ init_iup() {
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$net.reqopts)"
|
||||
local iupopts="66 67 128 224 225 226"
|
||||
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|225|226) ;;
|
||||
66|67|128|224) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
@@ -64,7 +67,7 @@ init_iup() {
|
||||
reqopts="$baseopts $iupopts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224|225|226) [ $enabled == "on" ] && newreqopts="$newreqopts $ropt" ;;
|
||||
66|67|128|224) [ $enabled == "on" ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
@@ -79,18 +82,8 @@ init_iup() {
|
||||
ubus call network reload
|
||||
#################################################################
|
||||
|
||||
if [ $polling_enabled == "off" ]; then
|
||||
sed -i "/\/sbin\/iup/d" $CRONPATH
|
||||
logger -s -t /etc/init.d/iup[$$] "Provisioning polling unscheduled" 2>/dev/console
|
||||
return
|
||||
fi
|
||||
|
||||
local log_hour=$starttime
|
||||
local log_minute
|
||||
local log_interval=$interval
|
||||
if [ $interval == "weekly" ]; then
|
||||
interval="0"
|
||||
log_interval="$log_interval/sunday"
|
||||
elif [ $interval == "hourly" ]; then
|
||||
interval='*'
|
||||
starttime='*'
|
||||
@@ -98,7 +91,9 @@ init_iup() {
|
||||
interval='*'
|
||||
fi
|
||||
let "number %= $RANGE"
|
||||
if ! grep -q "$starttime \* \* \\$interval /sbin/iup" "$CRONPATH" ; then
|
||||
if grep -q "$starttime \* \* \\$interval /sbin/iup" "$CRONPATH" ; then
|
||||
echo "IUP is scheduled $starttime \* \* \\$interval "
|
||||
else
|
||||
if grep -q "iup" "$CRONPATH" ; then
|
||||
sed -i "/iup/d" $CRONPATH
|
||||
fi
|
||||
@@ -106,14 +101,19 @@ init_iup() {
|
||||
fsync $CRONPATH
|
||||
/etc/init.d/cron restart
|
||||
fi
|
||||
log_minute=$(awk '/\/sbin\/iup/ {print $1}' /etc/crontabs/root)
|
||||
logger -s -t /etc/init.d/iup[$$] "Provisioning is scheduled at $log_hour:$log_minute $log_interval" 2>/dev/console
|
||||
}
|
||||
|
||||
boot() {
|
||||
init_iup
|
||||
}
|
||||
|
||||
start_service() {
|
||||
init_iup
|
||||
|
||||
/sbin/iup -v &
|
||||
test_default_route
|
||||
if [ "$?" -eq 0 ]; then
|
||||
/sbin/iup -v &
|
||||
fi
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
set_iup_reqopts() {
|
||||
### Ask for IUP related DHCP options only if IUP is enabled ###
|
||||
new_reqopts() {
|
||||
local net=$1
|
||||
local enabled="$(uci -q get provisioning.iup.enabled)"
|
||||
enabled="${enabled:-on}"
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$net.reqopts)"
|
||||
local iupopts="66 67 128 224 225 226"
|
||||
local ropt iopt
|
||||
local net
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224|225|226) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $iupopts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224|225|226) [ $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
|
||||
}
|
||||
|
||||
set_iup_reqopts
|
||||
@@ -1,219 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# functions that take dhcp options received on the wan interface
|
||||
# and relay/repeat them for specific clients
|
||||
|
||||
#config dhcp_option_relay
|
||||
# option enable 1
|
||||
# list dhcp_option 43
|
||||
# list from_interface wan
|
||||
# option vendorclass '*SDX*'
|
||||
|
||||
# where:
|
||||
# dhcp_option_relay is the name of the section parsed by this script
|
||||
# enable/enabled - option, enable the uci section [default on]
|
||||
# dhcp_option/dhcp_options - list of dhcp options (0-255) to be relayed/repeated
|
||||
# overwrite - if same dhcp_option already exists in /etc/config/dhcp, overwrite it with this option [default off]
|
||||
# from_interface - list of interfaces (e.g. wan) to get the dhcp options from
|
||||
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
interface=""
|
||||
opt224=""
|
||||
opt225=""
|
||||
opt226=""
|
||||
opt43=""
|
||||
opt128=""
|
||||
opt66=""
|
||||
opt67=""
|
||||
opt132=""
|
||||
opt133=""
|
||||
newsectionid="0"
|
||||
|
||||
function parse_the_json()
|
||||
{
|
||||
local the_json="$@"
|
||||
|
||||
json_load "$the_json"
|
||||
json_get_var interface interface
|
||||
json_get_var opt224 privopt224
|
||||
json_get_var opt225 privopt225
|
||||
json_get_var opt226 privopt226
|
||||
json_get_var opt43 vendorspecinf # option 43
|
||||
json_get_var opt128 httpurl128
|
||||
json_get_var opt66 tftp # option 66
|
||||
json_get_var opt67 bootfile #option 67
|
||||
json_get_var opt132 vlanid # option 132
|
||||
json_get_var opt133 vlanpriority # option 133
|
||||
}
|
||||
|
||||
function add_section_dhcp_vendorclass()
|
||||
{
|
||||
local dhcp_option=$1
|
||||
local dhcp_option_value=$2
|
||||
local vendorclass=$3
|
||||
local new=
|
||||
newsectionid=$((newsectionid+1))
|
||||
|
||||
#echo "add_section_dchp_vendorclass $dhcp_option ${dhcp_option_value} $vendorclass"
|
||||
new=$(uci add dhcp vendorclass)
|
||||
uci set dhcp.$new.vendorclass="$vendorclass"
|
||||
uci set dhcp.$new.networkid="dhcp_option_relay_$newsectionid"
|
||||
uci add_list dhcp.$new.dhcp_option=$dhcp_option,\"${dhcp_option_value}\"
|
||||
|
||||
uci commit dhcp
|
||||
}
|
||||
|
||||
function dhcp_option_relay()
|
||||
{
|
||||
local section="$1"
|
||||
local enable="" enabled=""
|
||||
local dhcp_option="" dhcp_option_value=""
|
||||
local vendorclass=""
|
||||
#local overwrite=""
|
||||
local from_interface
|
||||
|
||||
#echo "section: $section"
|
||||
|
||||
# parse only enabled sections
|
||||
config_get_bool enabled $section enabled 1
|
||||
config_get_bool enable $section enable 1
|
||||
#echo "enabled: $enabled"
|
||||
#echo "enable : $enable"
|
||||
if [ "$enable" == "0" -o "$enabled" == "0" ] ; then
|
||||
#echo "section $section is not enabled"
|
||||
return
|
||||
fi
|
||||
# todo: for disabled sections: run only the removal of the dhcp options
|
||||
|
||||
# option overwrite 1
|
||||
#config_get_bool overwrite $section overwrite 0
|
||||
config_get vendorclass $section vendorclass
|
||||
if [ ${#vendorclass} -le 1 ]; then
|
||||
#echo "vendorclass must not be empty"
|
||||
return
|
||||
fi
|
||||
|
||||
# list to_interface lan
|
||||
# to_interface - list of interfaces (e.g. lan, guest) to advertise the dhcp options to
|
||||
#foreach_to_interface() {
|
||||
# local to_interface=$1
|
||||
# echo ""
|
||||
# echo " from_interface $from_interface"
|
||||
# echo " dhcp_option $dhcp_option"
|
||||
# echo " dhcp_option_value $dhcp_option_value"
|
||||
# echo " overwrite $overwrite"
|
||||
# echo " to_interface $to_interface"
|
||||
#
|
||||
# if [ ! $(uci -q get dhcp.$to_interface) ] ; then
|
||||
# echo "to_interface $to_interface does not exist in dhcp uci config"
|
||||
# return
|
||||
# fi
|
||||
#
|
||||
#}
|
||||
|
||||
|
||||
foreach_dhcp_option() {
|
||||
dhcp_option=$1
|
||||
|
||||
echo "dhcp_option: $dhcp_option"
|
||||
case $dhcp_option in
|
||||
43) dhcp_option_value=$opt43 ;;
|
||||
66) dhcp_option_value=$opt66 ;;
|
||||
67) dhcp_option_value=$opt67 ;;
|
||||
128) dhcp_option_value=$opt128 ;;
|
||||
132) dhcp_option_value=$opt132 ;;
|
||||
133) dhcp_option_value=$opt133 ;;
|
||||
224) dhcp_option_value=$opt224 ;;
|
||||
225) dhcp_option_value=$opt225 ;;
|
||||
226) dhcp_option_value=$opt226 ;;
|
||||
*) dhcp_option_value="unsupported" ;;
|
||||
esac
|
||||
|
||||
if [ "${dhcp_option_value}" == "unsupported" ] ; then
|
||||
echo "dhcp_option $dhcp_option is unsupported"
|
||||
return
|
||||
fi
|
||||
if [ "${dhcp_option_value}" == "" ] ; then
|
||||
echo "dhcp_option $dhcp_option is empty"
|
||||
return
|
||||
fi
|
||||
|
||||
#echo "dhcp_option: $dhcp_option dhcp_option_value: ${dhcp_option_value}"
|
||||
|
||||
#config_list_foreach $section to_interface foreach_to_interface
|
||||
|
||||
add_section_dhcp_vendorclass $dhcp_option ${dhcp_option_value} $vendorclass
|
||||
}
|
||||
|
||||
foreach_from_interface() {
|
||||
from_interface="$1"
|
||||
#echo "from_interface: $from_interface"
|
||||
if [ "$from_interface" != "$interface" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
dhcp_option=""
|
||||
config_list_foreach $section dhcp_option foreach_dhcp_option
|
||||
#config_list_foreach $section dhcp_options foreach_dhcp_option
|
||||
}
|
||||
|
||||
from_interface=""
|
||||
config_list_foreach $section from_interface foreach_from_interface
|
||||
}
|
||||
|
||||
|
||||
# in uci dhcp config:
|
||||
# remove all the vendorclass sections
|
||||
# that have previosly been configured by this script.
|
||||
# all are identified by "option networkid dhcp_option_relay_*"
|
||||
function dhcp_option_relay_clear_prev()
|
||||
{
|
||||
local to_remove=""
|
||||
|
||||
foreach_vendorclass() {
|
||||
local section="$1"
|
||||
local networkid
|
||||
config_get networkid $section networkid
|
||||
|
||||
case "$networkid"
|
||||
in dhcp_option_relay*)
|
||||
to_remove="$to_remove $section"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
config_load dhcp
|
||||
config_foreach foreach_vendorclass vendorclass
|
||||
|
||||
local sect
|
||||
for sect in $to_remove ; do
|
||||
uci_remove dhcp $sect
|
||||
done
|
||||
uci_commit dhcp
|
||||
}
|
||||
|
||||
|
||||
# the main function
|
||||
function dhcp_option_relay_parse()
|
||||
{
|
||||
local the_json="$@"
|
||||
parse_the_json "$the_json"
|
||||
|
||||
dhcp_option_relay_clear_prev
|
||||
|
||||
newsectionid="0"
|
||||
|
||||
config_load provisioning
|
||||
config_foreach dhcp_option_relay dhcp_option_relay
|
||||
#config_foreach dhcp_option_relay dhcp_options_relay
|
||||
#config_foreach dhcp_option_relay dhcpoption_relay
|
||||
#config_foreach dhcp_option_relay dhcpoptions_relay
|
||||
#config_foreach dhcp_option_relay dhcp_optionrelay
|
||||
#config_foreach dhcp_option_relay dhcp_optionsrelay
|
||||
#config_foreach dhcp_option_relay dhcpoptionrelay
|
||||
#config_foreach dhcp_option_relay dhcpoptionsrelay
|
||||
}
|
||||
|
||||
#dhcp_option_relay_parse
|
||||
@@ -4,8 +4,6 @@ echo $$ > /var/run/iup.pid
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
. /lib/functions/savecfg.sh
|
||||
. /lib/functions/dhcp_option_relay.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
include /lib/upgrade
|
||||
@@ -18,43 +16,38 @@ export IUPTEMP="/tmp/iup"
|
||||
export INTERACTIVE=0
|
||||
export VERBOSE=0
|
||||
export CONF=1
|
||||
export DESKEY=
|
||||
export MAC=
|
||||
export DESKEY=$(cat /proc/nvram/DesKey | hexdump -e '16/1 "%02x"')
|
||||
export MAC=$(cat /proc/nvram/BaseMacAddr)
|
||||
export RANGE=10
|
||||
export RETRYSTOP=5
|
||||
export SLEEP=10
|
||||
#remove whitespace
|
||||
MAC=${MAC// /}
|
||||
#lower to upper Conversion
|
||||
MAC=$(echo $MAC | tr '[a-z]' '[A-Z]')
|
||||
|
||||
json_load "$(ubus call router.system info)"
|
||||
json_select system
|
||||
json_get_var MAC basemac
|
||||
json_select ..
|
||||
json_select keys
|
||||
json_get_var DESKEY des
|
||||
json_select ..
|
||||
|
||||
# MAC lowercase to uppercase and remove ':'
|
||||
MAC=$(echo $MAC | tr '[a-z]' '[A-Z]' | tr -d ':')
|
||||
|
||||
# Convert DESKEY to HEX format
|
||||
DESKEY=$(echo $DESKEY | tr -d '\n' | hexdump -e '16/1 "%02x"')
|
||||
|
||||
|
||||
# no verbose: no output
|
||||
# -v log to system log
|
||||
# -v -v log to system log and console
|
||||
# -v -v -v log to system log, console and stderr
|
||||
v() {
|
||||
[ "$VERBOSE" -eq 0 ] && return
|
||||
[ "$VERBOSE" -eq 1 ] && logger -t $0[$$] "$@" && return
|
||||
[ "$VERBOSE" -eq 2 ] && logger -s -t $0[$$] "$@" >/dev/console 2>&1 && return
|
||||
[ "$VERBOSE" -eq 3 ] && logger -s -t $0[$$] "$@" 2>&1 | tee /dev/console && return
|
||||
[ "$VERBOSE" -ge 1 ] && logger -t iup "$@"
|
||||
}
|
||||
|
||||
vv() {
|
||||
VERBOSE="$(($VERBOSE + 1))"
|
||||
v "$@"
|
||||
VERBOSE="$(($VERBOSE - 1))"
|
||||
if [ -f $IUPMD5 ]; then
|
||||
v "File $IUPMD5 exists"
|
||||
else
|
||||
v "File $IUPMD5 did not exists"
|
||||
touch $IUPMD5
|
||||
fi
|
||||
|
||||
handle_ucitrack()
|
||||
{
|
||||
local config="$1"
|
||||
config_get init "$config" init
|
||||
echo $init
|
||||
config_get affects "$config" affects
|
||||
|
||||
for aff in $affects
|
||||
do
|
||||
config_foreach handle_ucitrack $aff
|
||||
done
|
||||
}
|
||||
|
||||
get_packages()
|
||||
@@ -68,34 +61,35 @@ get_packages()
|
||||
|
||||
reload ()
|
||||
{
|
||||
local reload
|
||||
local initlist
|
||||
local reload
|
||||
local pack
|
||||
pack=$(get_packages $1)
|
||||
v "Calling ubus call uci commit for $pack"
|
||||
config_load ucitrack
|
||||
for packname in $pack
|
||||
do
|
||||
ubus call uci commit '{"config":"'$packname'"}'
|
||||
sleep 1
|
||||
initlist=$(config_foreach handle_ucitrack $packname)
|
||||
for reltest in $initlist
|
||||
do
|
||||
case $reload in
|
||||
*" $reltest "*) v "already added to reload $reltest" ;;
|
||||
*) reload="$reload"" ""$reltest" ;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
save_usercfg()
|
||||
{
|
||||
savecfg_save_config fw_redirect fw_parental wifi
|
||||
}
|
||||
|
||||
apply_usercfg()
|
||||
{
|
||||
# decide to save the user changes based on keepuserconfig received through provisioning
|
||||
local keep
|
||||
config_load provisioning
|
||||
config_get_bool keep configserver keepuserconfig "0"
|
||||
v "apply_usercfg(): keepuserconfig = $keep"
|
||||
if [ "$keep" != "1" ] ; then
|
||||
savecfg_rm_files
|
||||
return
|
||||
v "Init scripts to be run $reload"
|
||||
for inittoreload in $reload
|
||||
do
|
||||
if [ "$inittoreload" != "iup" ]; then
|
||||
/etc/init.d/$inittoreload restart
|
||||
fi
|
||||
done
|
||||
#Ugly hack need to figure out something here
|
||||
test_default_route
|
||||
if [ "$?" -eq 1 ]; then
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
savecfg_apply_config fw_redirect fw_parental wifi
|
||||
}
|
||||
|
||||
handle_provisioning() {
|
||||
@@ -123,15 +117,15 @@ handle_provisioning() {
|
||||
config_get deckey "$config" deckey
|
||||
if [ "$enabled" -eq 1 ]; then
|
||||
if [ "$config" == "iup" ]; then
|
||||
v "Using url received in dhcp options"
|
||||
v "using url from dhcp options"
|
||||
config_get url "$config" urliup
|
||||
else
|
||||
else
|
||||
config_get url "$config" url
|
||||
fi
|
||||
url=${url//\$MAC/$MAC}
|
||||
v "Downloading from url \"$url\""
|
||||
|
||||
while [ $retry -le $RETRYSTOP ]
|
||||
v "Download from $url"
|
||||
|
||||
while [ $retry -le $RETRYSTOP ]
|
||||
do
|
||||
if [ ${url%%:*} == "tftp" ]; then
|
||||
tftpfile=${url#*\/\/}
|
||||
@@ -143,17 +137,17 @@ handle_provisioning() {
|
||||
get_image "$url" "cat" > $IUPCONFFILES
|
||||
fi
|
||||
if [ -s $IUPCONFFILES ]; then
|
||||
v "Download finished"
|
||||
v "File Downloaded"
|
||||
retry=$((RETRYSTOP + 1))
|
||||
else
|
||||
v "Download failed, retrying in $incsleep seconds"
|
||||
else
|
||||
v "Download failed will try again in $incsleep sec"
|
||||
sleep $incsleep
|
||||
incsleep=$((incsleep * retry + number))
|
||||
retry=$((retry+1))
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ ! -s "$IUPCONFFILES" ] && [ "$enabled" -eq 1 ]; then
|
||||
if [ ! -s "$IUPCONFFILES" ]; then
|
||||
echo "File not Found"
|
||||
reboot="off"
|
||||
CONF=0
|
||||
@@ -166,61 +160,55 @@ handle_Downloaded_file()
|
||||
{
|
||||
local DECKEY
|
||||
local KEY
|
||||
[ -n "$1" ] && DECKEY=$(echo $1 | tr -d '\n' | hexdump -e '16/1 "%02x"')
|
||||
[ -n "$1" ] && DECKEY=$(echo $1 | hexdump -e '16/1 "%02x"')
|
||||
KEY=${DECKEY:-$DESKEY}
|
||||
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
|
||||
|
||||
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 "Downloaded file is an unencrypted config"
|
||||
v "Found Config"
|
||||
md5=$(md5sum $IUPCONFFILES)
|
||||
md5="${md5%% *}" # remove the first space and everything after it
|
||||
md5sum "$IUPCONFFILES" >> "$IUPMD5.temp"
|
||||
if grep -q "$md5" "$IUPMD5"; then
|
||||
v "Config is already up to date, nothing to do"
|
||||
#because config is up to date we need to disable last step reboot if set
|
||||
v "Config Already Up to Date"
|
||||
#becuse config is up to date we need to disable last step reboot if set
|
||||
reboot="off"
|
||||
rm -rf $IUPTEMP
|
||||
else
|
||||
save_usercfg
|
||||
cd $IUPTEMP
|
||||
cd /tmp/iup/
|
||||
tar xvzf $IUPCONFFILES
|
||||
for f in $CONFILESLURP
|
||||
do
|
||||
v "File to be applied $f and config $(cat $f)"
|
||||
uci -f $f import
|
||||
v "file to be applied $f and config $(cat $f)"
|
||||
uci import -f $f
|
||||
done
|
||||
pack=$(get_packages $CONFILESLURP)
|
||||
v "Packages to be commited: $pack"
|
||||
v "$pack packages to be commited"
|
||||
for packname in $pack
|
||||
do
|
||||
uci commit $packname
|
||||
done
|
||||
apply_usercfg
|
||||
reboot=`uci -q get provisioning.configserver.reboot`
|
||||
if [ "$reboot" != "on" ]; then
|
||||
sync
|
||||
reload $CONFILESLURP
|
||||
fi
|
||||
rm -rf $IUPTEMP
|
||||
|
||||
cp /rom/etc/uci-defaults/* /etc/uci-defaults/
|
||||
sync
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
v "Downloaded file is an encrypted config"
|
||||
v "encrypted"
|
||||
if [ $KEY ]; then
|
||||
openssl enc -d -des-ede -nosalt -K $KEY -iv "0000000000000000" -in $IUPCONFFILES -out $IUPCONFFILES.tmp
|
||||
if [ $? -eq 0 ]; then
|
||||
v "Decryption successful"
|
||||
v "Decrypted Content"
|
||||
mv $IUPCONFFILES.tmp $IUPCONFFILES
|
||||
handle_Downloaded_file
|
||||
else
|
||||
@@ -236,12 +224,11 @@ handle_Downloaded_file()
|
||||
;;
|
||||
esac
|
||||
else
|
||||
v "Downloaded file is a firmware, will start reflashing"
|
||||
v "Image found will start flashing"
|
||||
if [ "$defaultreset" -eq 1 ]; then
|
||||
v "Not saving configuration over reflash"
|
||||
v "nuke config"
|
||||
/sbin/sysupgrade -v -n $IUPCONFFILES
|
||||
else
|
||||
v "Saving configuration over reflash"
|
||||
/sbin/sysupgrade -v $IUPCONFFILES
|
||||
fi
|
||||
fi
|
||||
@@ -263,30 +250,29 @@ change_to_vlan() {
|
||||
|
||||
# bring down old interface/device.
|
||||
ifdown "${base_dev}"
|
||||
v "option 132: bringing down old if: ${base_dev}"
|
||||
logger -t dhcp_opt132 "bringing down old if: ${base_dev}"
|
||||
|
||||
# extract base name of device.
|
||||
base_dev=$(echo ${base_dev} | cut -d. -f1)
|
||||
|
||||
# add "VLAN interface" to the "end of the file".
|
||||
uci add network device
|
||||
uci rename network.@device[-1]=${name}
|
||||
uci set network.@device[-1].type=8021q
|
||||
uci set network.@device[-1].ifname=${base_dev}
|
||||
uci set network.@device[-1].name="${base_dev}.${1}"
|
||||
uci set network.@device[-1].vid=${1}
|
||||
uci set network.@device[-1].priority=${2}
|
||||
uci add layer2_interface_vlan vlan_interface
|
||||
uci set layer2_interface_vlan.@vlan_interface[-1].name=${name}
|
||||
uci set layer2_interface_vlan.@vlan_interface[-1].vlan8021q=${1}
|
||||
uci set layer2_interface_vlan.@vlan_interface[-1].vlan8021p=${2}
|
||||
uci set layer2_interface_vlan.@vlan_interface[-1].ifname="${base_dev}.${1}"
|
||||
uci set layer2_interface_vlan.@vlan_interface[-1].baseifname=${base_dev}
|
||||
# and commit the change.
|
||||
uci commit network
|
||||
v "option 132: committed update to file network"
|
||||
uci commit layer2_interface_vlan
|
||||
logger -t dhcp_opt132 "committed update to file layer2_interface_vlan"
|
||||
|
||||
# reload configuration files.
|
||||
ubus call network reload
|
||||
v "option 132: reload network config"
|
||||
/etc/init.d/layer2_interface_vlan reload
|
||||
logger -t dhcp_opt132 "reload layer2_interface_vlan config"
|
||||
|
||||
# replace old interface (like eth0.1 with new eth0.101).
|
||||
wan_if=$(uci get network.$3.ifname)
|
||||
v "option 132: old network.${3}.ifname: $wan_if"
|
||||
logger -t dhcp_opt132 "old network.${3}.ifname: $wan_if"
|
||||
|
||||
# loop through the string, remove any word close to "base_dev".
|
||||
for word in ${wan_if}; do
|
||||
@@ -304,12 +290,10 @@ change_to_vlan() {
|
||||
uci set network.wan.ifname="${new_wan_if}"
|
||||
# and commit the change.
|
||||
uci commit network
|
||||
v "option 132: committed update to file network: ifname=${new_wan_if}"
|
||||
logger -t dhcp_opt132 "committed update to file network: ifname=${new_wan_if}"
|
||||
|
||||
# reboot into new if configuration.
|
||||
vv "Rebooting"
|
||||
export REBOOT_REASON=iup
|
||||
/sbin/reboot
|
||||
reboot
|
||||
}
|
||||
|
||||
handle_option224()
|
||||
@@ -328,6 +312,11 @@ handle_option224()
|
||||
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
|
||||
@@ -360,70 +349,66 @@ handle_option224()
|
||||
softwareminuspath=${url##*/}
|
||||
|
||||
if [ $url ] && [ $active -eq 1 ]; then
|
||||
v "Software version to download \"$softwareminuspath\""
|
||||
local sysinfo=$(ubus call router.system info)
|
||||
echo "Software version to download $softwareminuspath"
|
||||
local sysinfo=$(ubus call router quest "{ \"info\": \"system\" }")
|
||||
json_load "$sysinfo"
|
||||
json_select system
|
||||
json_get_var firmware firmware
|
||||
local firmware_new=${softwareminuspath%.*} # remove extension (.w, .y or .y2) from filename
|
||||
if [ "$firmware_new" != "$firmware" ] ; then
|
||||
v "Firmware found $url will start flashing"
|
||||
v "Currently running firmware: \"$firmware\""
|
||||
v "Newly received firmware: \"$firmware_new\""
|
||||
echo "Image found $url will start flashing"
|
||||
wait_for_dns $url
|
||||
v "Start flashing"
|
||||
/sbin/sysupgrade -v $url &
|
||||
return 1
|
||||
else
|
||||
v "Firmware is up to date, nothing to do"
|
||||
echo "Will not update software, already up to date"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
### MAIN ###
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
-v) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-q) export VERBOSE="$(($VERBOSE - 1))";;
|
||||
-*)
|
||||
echo "Invalid option: $1"
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
parse_dhcp_options()
|
||||
{
|
||||
local the_json="$@"
|
||||
|
||||
# process the dhcp_option_relay sections
|
||||
dhcp_option_relay_parse "$the_json"
|
||||
|
||||
# Process IUP related DHCP options #
|
||||
local privopt224 privopt225 privopt226 vendorspecinf httpurl128
|
||||
# Process IUP related DHCP options #
|
||||
if [ -n "$1" ]; then
|
||||
local privopt224 vendorspecinf httpurl128
|
||||
local tftp bootfile vlanid vlanpriority interface
|
||||
|
||||
json_load "$the_json"
|
||||
json_load "$1"
|
||||
json_get_var interface interface
|
||||
json_get_var privopt224 privopt224
|
||||
json_get_var privopt225 privopt225
|
||||
json_get_var privopt226 privopt226
|
||||
json_get_var vendorspecinf vendorspecinf # option 43
|
||||
json_get_var vendorspecinf vendorspecinf
|
||||
json_get_var httpurl128 httpurl128
|
||||
json_get_var tftp tftp # option 66
|
||||
json_get_var bootfile bootfile #option 67
|
||||
json_get_var vlanid vlanid # option 132
|
||||
json_get_var vlanpriority vlanpriority # option 133
|
||||
json_get_var tftp tftp
|
||||
json_get_var bootfile bootfile
|
||||
json_get_var vlanid vlanid
|
||||
json_get_var vlanpriority vlanpriority
|
||||
|
||||
if [ $privopt224 ]; then
|
||||
v "dhcp option 224 firmware url $privopt224"
|
||||
echo "Option224 recived " $privopt224 > /dev/console
|
||||
handle_option224 $privopt224
|
||||
[ $? -eq 1 ] && exit
|
||||
fi
|
||||
|
||||
if [ $vendorspecinf ]; then
|
||||
v "dhcp option 43 tr69 url $vendorspecinf"
|
||||
url=${vendorspecinf%%,*}; rest=${vendorspecinf#*,}
|
||||
provisioningcode=${rest%%,*};
|
||||
[ -f /etc/config/cwmp ] && uci_set_state cwmp acs dhcp_url "$url"
|
||||
uci_set_state provisioning iup urlcwmp "$url"
|
||||
uci_set_state provisioning iup url "$url"
|
||||
uci_set_state provisioning iup provisioningcode "$provisioningcode"
|
||||
elif [ $httpurl128 ]; then
|
||||
v "dhcp option 128 http config url $httpurl128"
|
||||
uci_set_state provisioning iup urliup "$httpurl128"
|
||||
elif [ $tftp ]; then
|
||||
v "dhcp option 66 tftp config url $tftp"
|
||||
if [ ${bootfile:0:1} == '/' ]; then
|
||||
uci_set_state provisioning iup urliup "tftp://$tftp$bootfile"
|
||||
else
|
||||
@@ -431,165 +416,69 @@ parse_dhcp_options()
|
||||
fi
|
||||
fi
|
||||
|
||||
# vlanid (and vlanpriority)
|
||||
# if we get vlanid and maybe vlanpriority, configure for that.
|
||||
if [ -n "$vlanid" -a -n "$vlanpriority" ]; then
|
||||
v "dhcp option 132 vlanid: ${vlanid} vlanpriority: ${vlanpriority}"
|
||||
logger -t dhcp_opt132 "vlanid: ${vlanid}, vlanpriority: ${vlanpriority}"
|
||||
change_to_vlan ${vlanid} ${vlanpriority} ${interface}
|
||||
elif [ -n "$vlanid" ]; then
|
||||
v "dhcp option 132 vlanid: ${vlanid}"
|
||||
logger -t dhcp_opt132 "vlanid: ${vlanid}"
|
||||
change_to_vlan ${vlanid} 0 ${interface}
|
||||
elif [ -n "$privopt225" ] || [ -n "$privopt226" ]; then
|
||||
# opt225 and opt226 can be used together or separatly
|
||||
if [ -n "$privopt225" ]; then
|
||||
v "dhcp option 225: $privopt225"
|
||||
# option225 is allowd to change only once per CPE
|
||||
if [ "$(uci get -q ice.cloud.frozen)" != "1" ] ; then
|
||||
uci set ice.cloud.frozen="1"
|
||||
uci set ice.cloud.enabled="1"
|
||||
uci set ice.cloud.server="$privopt225"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$privopt226" ]; then
|
||||
v "dhcp option 226: $privopt226"
|
||||
[ -z "$(uci get -q ice.dhcp)" ] && uci set ice.dhcp="dhcp"
|
||||
uci set ice.dhcp.opt226connectionid="$privopt226"
|
||||
ubus send dhcp.opt226connectionid '{"opt226connectionid":"","value":"'$privopt226'"}'
|
||||
fi
|
||||
uci commit
|
||||
fi
|
||||
}
|
||||
|
||||
# wait_for_default_gateway to become reachable
|
||||
# return 0 if the default gateway is reachable
|
||||
# return 1 if the default gateway is not reachable after $wait_time
|
||||
wait_for_default_gateway()
|
||||
{
|
||||
local gateway
|
||||
local device
|
||||
local wait_time=120
|
||||
local wait_interval=10
|
||||
|
||||
while [ true ] ; do
|
||||
|
||||
gateway=""
|
||||
device=""
|
||||
network_flush_cache
|
||||
network_get_gateway gateway wan #true
|
||||
network_get_device device wan
|
||||
device="${device:+-I }$device"
|
||||
if ping -q -w 1 -c 1 $device $gateway >/dev/null 2>&1 ; then
|
||||
[ "$wait_time" -lt "60" ] && v "Default gateway $gateway is reachable"
|
||||
sleep $wait_interval
|
||||
return 0
|
||||
fi
|
||||
|
||||
# try the nameservers too
|
||||
for ns in $(grep nameserver /var/resolv.conf.auto | awk '{print $2}'); do
|
||||
if ping -q -w 1 -c 1 $device $ns >/dev/null 2>&1 ; then
|
||||
[ "$wait_time" -lt "60" ] && v "Name server $ns is reachable"
|
||||
sleep $wait_interval
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
v "Waiting for default gateway or name server. Countdown $wait_time seconds"
|
||||
sleep $wait_interval
|
||||
wait_time=$((wait_time - wait_interval))
|
||||
[ "$wait_time" -le "0" ] && break # timer expired
|
||||
done
|
||||
|
||||
return 1 # default gateway and name server are not reachable
|
||||
}
|
||||
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
-v) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-q) export VERBOSE="$(($VERBOSE - 1))";;
|
||||
--dhcp-options)
|
||||
shift
|
||||
parse_dhcp_options "$@"
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
echo "Invalid option: $1"
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
if ! wait_for_default_gateway ; then
|
||||
v "Neither default gateway nor name server are reachable. Aborting iup."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $IUPMD5 ]; then
|
||||
v "Creating file $IUPMD5"
|
||||
touch $IUPMD5
|
||||
fi
|
||||
|
||||
|
||||
local iupurl
|
||||
local configurl
|
||||
local software
|
||||
local sofwareminuspath
|
||||
|
||||
config_load provisioning
|
||||
#check if iup should be used or if its overridden by /etc/config
|
||||
config_get configurl configserver url
|
||||
config_get reboot configserver reboot
|
||||
config_get iupurl iup urliup
|
||||
|
||||
if [ $configurl ]; then
|
||||
handle_provisioning configserver "0"
|
||||
elif [ $iupurl ]; then
|
||||
handle_provisioning iup "1"
|
||||
else
|
||||
v "No provisioning server configured"
|
||||
exit
|
||||
logger -t dhcp_opt132 "no vlanid given"
|
||||
fi
|
||||
fi
|
||||
|
||||
config_load provisioning
|
||||
config_foreach handle_provisioning subconfig "0"
|
||||
config_get software uppgradeserver url
|
||||
sofwareminuspath=${software##*/}
|
||||
local iupurl
|
||||
local configurl
|
||||
local software
|
||||
local sofwareminuspath
|
||||
|
||||
if [ $software ]; then
|
||||
v "Software version to download \"$sofwareminuspath\""
|
||||
local sysinfo=$(ubus call router.system info)
|
||||
json_load "$sysinfo"
|
||||
json_select system
|
||||
json_get_var firmware firmware
|
||||
json_get_var filesystem filesystem
|
||||
if [ "$filesystem" == "JFFS2" ] ; then
|
||||
firmware=$firmware.w
|
||||
else
|
||||
firmware=$firmware.y3
|
||||
fi
|
||||
if [ "$sofwareminuspath" == "${sofwareminuspath/$firmware/}" ] ; then
|
||||
v "Software \"$software\""
|
||||
handle_provisioning uppgradeserver "0"
|
||||
else
|
||||
v "Will not update software, already up to date"
|
||||
fi
|
||||
config_load provisioning
|
||||
#check if iup should be used or if its overridden by /etc/config
|
||||
config_get configurl configserver url
|
||||
config_get reboot configserver reboot
|
||||
config_get iupurl iup urliup
|
||||
|
||||
if [ $configurl ]; then
|
||||
handle_provisioning configserver "0"
|
||||
elif [ $iupurl ]; then
|
||||
handle_provisioning iup "1"
|
||||
else
|
||||
v "No Provisioning Server Found"
|
||||
exit
|
||||
fi
|
||||
|
||||
config_load provisioning
|
||||
config_foreach handle_provisioning subconfig "0"
|
||||
config_get software uppgradeserver url
|
||||
sofwareminuspath=${software##*/}
|
||||
v "Software version to download $sofwareminuspath"
|
||||
|
||||
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 "0"
|
||||
else
|
||||
v "Will not update software, already up to date"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $CONF -eq 1 ]; then
|
||||
mv "$IUPMD5.temp" $IUPMD5
|
||||
fi
|
||||
if [ $CONF -eq 1 ]; then
|
||||
mv "$IUPMD5.temp" $IUPMD5
|
||||
fi
|
||||
|
||||
if [ "$reboot" == "on" ]; then
|
||||
vv "Rebooting"
|
||||
export REBOOT_REASON=iup
|
||||
/sbin/reboot
|
||||
fi
|
||||
if [ "$reboot" == "on" ]; then
|
||||
v "Reboot Signaled"
|
||||
/sbin/reboot
|
||||
fi
|
||||
|
||||
rm -rf /var/run/iup.pid
|
||||
}
|
||||
|
||||
main $@
|
||||
rm -rf /var/run/iup.pid
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=10
|
||||
START=01
|
||||
STOP=99
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
@@ -5,22 +5,15 @@
|
||||
#include <unistd.h>
|
||||
|
||||
const char *watchdog_file = "/proc/watchdog";
|
||||
const char *watchdog_file_nvram = "/proc/nvram/watchdog";
|
||||
const char *init_string = "1 5000000 1 4";
|
||||
const char *kicker = "OK";
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int ret = 0;
|
||||
char *wdt_string_prt = watchdog_file;
|
||||
int fd = open(wdt_string_prt, O_WRONLY);
|
||||
int fd = open(watchdog_file, O_WRONLY);
|
||||
if (fd < 0) {
|
||||
wdt_string_prt = watchdog_file_nvram;
|
||||
fd = open(wdt_string_prt, O_WRONLY);
|
||||
if (fd < 0) {
|
||||
perror("Open watchdog file");
|
||||
exit(1);
|
||||
}
|
||||
perror("Open watchdog file");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* init */
|
||||
@@ -30,17 +23,14 @@ int main(int argc, char **argv)
|
||||
perror("Error init watchdog");
|
||||
exit(1);
|
||||
}
|
||||
close(fd);
|
||||
|
||||
while (1) {
|
||||
fd = open(wdt_string_prt, O_WRONLY);
|
||||
sleep(1);
|
||||
res = write (fd, kicker, strlen(init_string) + 1);
|
||||
|
||||
if (res < 0 ){
|
||||
perror("Error kicking watchdog");
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
36
layer2interface/Makefile
Normal file
36
layer2interface/Makefile
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# Copyright (C) 2013 Inteno
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=layer2interface
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/layer2interface
|
||||
CATEGORY:=Base system
|
||||
TITLE:=Tools for setting up layer2 interfaces
|
||||
endef
|
||||
|
||||
define Package/layer2interface/description
|
||||
layer2interface contains necessary tools to create
|
||||
layer2 interfaces
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./broadcom/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/layer2interface/install
|
||||
$(CP) ./broadcom/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,layer2interface))
|
||||
26
layer2interface/broadcom/etc/config/layer2_interface
Normal file
26
layer2interface/broadcom/etc/config/layer2_interface
Normal file
@@ -0,0 +1,26 @@
|
||||
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'
|
||||
|
||||
11
layer2interface/broadcom/etc/config/layer2_interface_adsl
Normal file
11
layer2interface/broadcom/etc/config/layer2_interface_adsl
Normal file
@@ -0,0 +1,11 @@
|
||||
config atm_bridge
|
||||
option 'link_type' 'EoA'
|
||||
option 'encapseoa' 'llcsnap_eth'
|
||||
option 'unit' '0'
|
||||
option 'ifname' 'atm0.1'
|
||||
option 'baseifname' 'atm0'
|
||||
option 'vpi' '8'
|
||||
option 'vci' '35'
|
||||
option 'name' 'DSL8_35'
|
||||
option 'atmtype' 'ubr'
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
config ethernet_interface 'Wan'
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
config vdsl_interface
|
||||
option 'unit' '0'
|
||||
option 'ifname' 'ptm0.1'
|
||||
option 'baseifname' 'ptm0'
|
||||
option 'name' 'VDSL2'
|
||||
option 'dslat' '1'
|
||||
option 'ptmprio' '1'
|
||||
option 'ipqos' '1'
|
||||
|
||||
38
layer2interface/broadcom/etc/ethertypes
Normal file
38
layer2interface/broadcom/etc/ethertypes
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# Ethernet frame types
|
||||
# This file describes some of the various Ethernet
|
||||
# protocol types that are used on Ethernet networks.
|
||||
#
|
||||
# This list could be found on:
|
||||
# http://www.iana.org/assignments/ethernet-numbers
|
||||
#
|
||||
# <name> <hexnumber> <alias1>...<alias35> #Comment
|
||||
#
|
||||
IPv4 0800 ip ip4 # Internet IP (IPv4)
|
||||
X25 0805
|
||||
ARP 0806 ether-arp #
|
||||
FR_ARP 0808 # Frame Relay ARP [RFC1701]
|
||||
BPQ 08FF # G8BPQ AX.25 Ethernet Packet
|
||||
DEC 6000 # DEC Assigned proto
|
||||
DNA_DL 6001 # DEC DNA Dump/Load
|
||||
DNA_RC 6002 # DEC DNA Remote Console
|
||||
DNA_RT 6003 # DEC DNA Routing
|
||||
LAT 6004 # DEC LAT
|
||||
DIAG 6005 # DEC Diagnostics
|
||||
CUST 6006 # DEC Customer use
|
||||
SCA 6007 # DEC Systems Comms Arch
|
||||
TEB 6558 # Trans Ether Bridging [RFC1701]
|
||||
RAW_FR 6559 # Raw Frame Relay [RFC1701]
|
||||
AARP 80F3 # Appletalk AARP
|
||||
ATALK 809B # Appletalk
|
||||
802_1Q 8100 8021q 1q 802.1q dot1q # 802.1Q Virtual LAN tagged frame
|
||||
IPX 8137 # Novell IPX
|
||||
NetBEUI 8191 # NetBEUI
|
||||
IPv6 86DD ip6 # IP version 6
|
||||
PPP 880B # PPP
|
||||
ATMMPOA 884C # MultiProtocol over ATM
|
||||
PPP_DISC 8863 # PPPoE discovery messages
|
||||
PPP_SES 8864 # PPPoE session messages
|
||||
ATMFATE 8884 # Frame-based ATM Transport over Ethernet
|
||||
LOOP 9000 loopback # loop proto
|
||||
|
||||
115
layer2interface/broadcom/etc/init.d/layer2_interface
Executable file
115
layer2interface/broadcom/etc/init.d/layer2_interface
Executable file
@@ -0,0 +1,115 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
include /lib/network
|
||||
|
||||
START=21
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
local AnnexM
|
||||
local GDmt
|
||||
local Glite
|
||||
local T1413
|
||||
local ADSL2
|
||||
local AnnexL
|
||||
local ADSL2plus
|
||||
local VDSL2
|
||||
local a8a
|
||||
local b8b
|
||||
local c8c
|
||||
local d8d
|
||||
local a12a
|
||||
local b12b
|
||||
local a17a
|
||||
local US0
|
||||
local bitswap
|
||||
local sra
|
||||
local vdsl
|
||||
|
||||
config_load layer2_interface
|
||||
config_get Glite capabilities Glite
|
||||
config_get GDmt capabilities GDmt
|
||||
config_get T1413 capabilities T1413
|
||||
config_get ADSL2 capabilities ADSL2
|
||||
config_get ADSL2plus capabilities ADSL2plus
|
||||
config_get AnnexL capabilities AnnexL
|
||||
config_get VDSL2 capabilities VDSL2
|
||||
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=$(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')
|
||||
|
||||
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')
|
||||
|
||||
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"
|
||||
|
||||
xtmctl start
|
||||
xtmctl operate intf --state 1 enable
|
||||
json_load "$(ubus call router quest "{ \"info\": \"specs\" }")"
|
||||
json_get_var vdsl vdsl
|
||||
|
||||
if [ $vdsl -eq 1 ]; then
|
||||
echo "xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM$VDSL2 --profile \"$a8a $b8b $c8c $d8d $a12a $b12b $a17a\" --sra $sra --bitswap $bitswap --us0 $US0"
|
||||
xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM$VDSL2 --profile "$a8a $b8b $c8c $d8d $a12a $b12b $a17a" --sra $sra --bitswap $bitswap --us0 $US0
|
||||
else
|
||||
echo "xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM --sra $sra --bitswap $bitswap"
|
||||
xdslctl start --up --mod $GDmt$Glite$T1413$ADSL2$AnnexL$ADSL2plus$AnnexM --sra $sra --bitswap $bitswap
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
stop_service() {
|
||||
echo "Stopping DSL"
|
||||
# stop causes IRQ issues
|
||||
#xdslctl stop
|
||||
}
|
||||
|
||||
boot() {
|
||||
vlanctl --if-suffix .
|
||||
add_ebtables_default_arp
|
||||
start
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger layer2_interface
|
||||
}
|
||||
|
||||
160
layer2interface/broadcom/etc/init.d/layer2_interface_adsl
Executable file
160
layer2interface/broadcom/etc/init.d/layer2_interface_adsl
Executable file
@@ -0,0 +1,160 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/network
|
||||
|
||||
START=21
|
||||
USE_PROCD=1
|
||||
|
||||
checkpvc() {
|
||||
local retur
|
||||
local vpi=$1
|
||||
local vci=$2
|
||||
|
||||
retur=$(xtmctl operate conn --show | awk -v test="$vpi/$vci" '{if ($3 ==test ) print $5 }')
|
||||
|
||||
case $retur in
|
||||
''|*[!0-9]*) return 0 ;;
|
||||
*) return $retur ;;
|
||||
esac
|
||||
}
|
||||
|
||||
checkxtmlist() {
|
||||
local dtype=$1
|
||||
local pcr
|
||||
local scr
|
||||
local mbs
|
||||
local retur
|
||||
|
||||
case $# in
|
||||
1)
|
||||
pcr=0
|
||||
scr=0
|
||||
mbs=0
|
||||
;;
|
||||
2)
|
||||
pcr=$2
|
||||
scr=0
|
||||
mbs=0
|
||||
;;
|
||||
4)
|
||||
pcr=$2
|
||||
scr=$3
|
||||
mbs=$4
|
||||
;;
|
||||
esac
|
||||
|
||||
retur=$(xtmctl operate tdte --show | awk -v test="$dtype" -v pcr="$pcr" -v scr="$scr" -v mbs="$mbs" '{if ($2 ==test && $3==pcr && $4==scr && $5==mbs ) print $1 }')
|
||||
|
||||
case $retur in
|
||||
''|*[!0-9]*) return 0 ;;
|
||||
*) return $retur ;;
|
||||
esac
|
||||
}
|
||||
|
||||
atm_inf_conf() {
|
||||
local vpi
|
||||
local vci
|
||||
local link_type
|
||||
local atmtype
|
||||
local pcr
|
||||
local scr
|
||||
local mbs
|
||||
local encaps
|
||||
local ifname
|
||||
local ret
|
||||
local baseifname
|
||||
config_get atmtype $1 atmtype
|
||||
config_get link_type $1 link_type
|
||||
config_get pcr $1 pcr
|
||||
config_get scr $1 scr
|
||||
config_get mbs $1 mbs
|
||||
config_get vpi $1 vpi
|
||||
config_get vci $1 vci
|
||||
config_get ifname $1 ifname
|
||||
config_get baseifname $1 baseifname
|
||||
config_get name $1 name
|
||||
config_get bridge $1 bridge
|
||||
checkpvc $vpi $vci
|
||||
ret=$?
|
||||
|
||||
if [ "$ret" -eq 0 ]; then
|
||||
checkxtmlist $atmtype $pcr $scr $mbs
|
||||
ret=$?
|
||||
if [ "$ret" -eq 0 ]; then
|
||||
case $atmtype in
|
||||
ubr) xtmctl operate tdte --add "$atmtype";;
|
||||
ubr_pcr ) xtmctl operate tdte --add "$atmtype" $pcr;;
|
||||
cbr) xtmctl operate tdte --add "$atmtype" $pcr;;
|
||||
nrtvbr) xtmctl operate tdte --add "$atmtype" $pcr $scr $mbs;;
|
||||
rtvbr)xtmctl operate tdte --add "$atmtype" $pcr $scr $mbs;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $link_type in
|
||||
EoA)config_get encaps $1 encapseoa;;
|
||||
PPPoA)config_get encaps $1 encapspppoa;;
|
||||
IPoA)config_get encaps $1 encapsipoa;;
|
||||
esac
|
||||
|
||||
checkxtmlist $atmtype $pcr $scr $mbs
|
||||
ret="$?"
|
||||
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 7 wrr 1 # high priority queue
|
||||
xtmctl operate conn --createnetdev 1.$vpi.$vci ${ifname%%.*}
|
||||
xtmctl operate intf --state 1 enable
|
||||
|
||||
brcm_virtual_interface_rules "$baseifname" "$ifname" "$bridge"
|
||||
fi
|
||||
}
|
||||
|
||||
remove_netdevices() {
|
||||
local vpi
|
||||
local vci
|
||||
local rest
|
||||
local x=0
|
||||
#local baseifname
|
||||
local vpivci=`xtmctl operate conn --show | awk '{if (NR!=1 && $1!="PTM") {print $3}}'`
|
||||
|
||||
for i in $vpivci
|
||||
do
|
||||
rest=${i#\/}
|
||||
vpi=${rest%%\/*}
|
||||
vci=${rest#*\/}
|
||||
echo "xtmctl operate conn --delete 1.$vpi.$vci"
|
||||
xtmctl operate conn --delete 1.$vpi.$vci
|
||||
echo "xtmctl operate conn --deletenetdev 1.$vpi.$vci"
|
||||
xtmctl operate conn --deletenetdev 1.$vpi.$vci
|
||||
done
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local adslstatus
|
||||
echo "Starting ADSL"
|
||||
config_load layer2_interface
|
||||
config_get adslstatus adsl device
|
||||
if [ "$adslstatus" == "up" ]; then
|
||||
xtmctl start
|
||||
config_load layer2_interface_adsl
|
||||
config_foreach atm_inf_conf atm_bridge
|
||||
fi
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
echo "Stopping ADSL"
|
||||
#xtmctl stop causes IRQ issues"
|
||||
# xtmctl stop
|
||||
remove_netdevices
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger layer2_interface_adsl
|
||||
}
|
||||
|
||||
|
||||
104
layer2interface/broadcom/etc/init.d/layer2_interface_ethernet
Executable file
104
layer2interface/broadcom/etc/init.d/layer2_interface_ethernet
Executable file
@@ -0,0 +1,104 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/network
|
||||
|
||||
START=21
|
||||
USE_PROCD=1
|
||||
|
||||
get_current_status() {
|
||||
local port="$1"
|
||||
local media="$(ethctl $port media-type 2>&1)"
|
||||
if echo $media | grep "1000" >/dev/null; then
|
||||
return 0
|
||||
elif echo $media | grep "100" >/dev/null; then
|
||||
return 1
|
||||
elif echo $media | grep "10" >/dev/null; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
removeethernet() {
|
||||
config_get ifname $1 ifname
|
||||
vlanctl --if-delete $ifname
|
||||
config_load layer2_interface_vlan
|
||||
#kill all vlans related to this interface
|
||||
config_foreach removevlan vlan_interface
|
||||
}
|
||||
|
||||
removevlan() {
|
||||
local baseifname
|
||||
local ifname
|
||||
local wan=`uci -q get layer2_interface_ethernet.Wan.baseifname`
|
||||
|
||||
config_get baseifname $1 baseifname
|
||||
config_get ifname $1 ifname
|
||||
if [ "$wan" == "$baseifname" ]; then
|
||||
echo "vlanctl --if-delete $ifname"
|
||||
vlanctl --if-delete $ifname
|
||||
fi
|
||||
}
|
||||
|
||||
addethernet() {
|
||||
config_get baseifname $1 baseifname
|
||||
config_get ifname $1 ifname
|
||||
config_get bridge $1 bridge
|
||||
brcm_virtual_interface_rules "$baseifname" "$ifname" "$bridge"
|
||||
|
||||
}
|
||||
|
||||
boot() {
|
||||
local baseifname wanport portnum
|
||||
config_load layer2_interface_ethernet
|
||||
config_get baseifname Wan baseifname
|
||||
|
||||
if [ "$(db get hw.board.hardware)" != "EG300" ]; then
|
||||
get_current_status $baseifname
|
||||
local ret=$?
|
||||
if [ $ret -eq 1 ]; then
|
||||
ethctl $baseifname phy-power down
|
||||
ethctl $baseifname phy-power up
|
||||
fi
|
||||
fi
|
||||
for interf in `db get hw.board.ethernetPortOrder`; do ethswctl -c wan -i $interf -o disable ; done
|
||||
wanport=$(db get hw.board.ethernetWanPort)
|
||||
portnum=$(get_port_number $wanport)
|
||||
ethswctl -c pause -p $portnum -v 1
|
||||
ethswctl -c hw-switching -o enable
|
||||
if [ $baseifname ]; then
|
||||
ethswctl -c wan -i $baseifname -o enable
|
||||
fi
|
||||
|
||||
if [ "`db get hw.board.tm`" == "1" ]; then
|
||||
for interf in `db get hw.board.ethernetPortOrder`; do
|
||||
tmctl porttminit --devtype ETH --if $interf --flag 1 || \
|
||||
echo "ERROR: porttminit $interf failed!" > /dev/kmsg
|
||||
done
|
||||
fi
|
||||
echo '1' > /proc/sys/net/ipv6/conf/$baseifname/disable_ipv6
|
||||
ifconfig $baseifname up
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local baseifname
|
||||
echo "Setting up Ethernet WAN"
|
||||
config_load layer2_interface_ethernet
|
||||
config_foreach addethernet ethernet_interface
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
local ifname
|
||||
config_load layer2_interface_ethernet
|
||||
config_foreach removeethernet ethernet_interface
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger layer2_interface_ethernet
|
||||
}
|
||||
|
||||
|
||||
102
layer2interface/broadcom/etc/init.d/layer2_interface_vdsl
Executable file
102
layer2interface/broadcom/etc/init.d/layer2_interface_vdsl
Executable file
@@ -0,0 +1,102 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/network
|
||||
|
||||
START=21
|
||||
USE_PROCD=1
|
||||
|
||||
checkptm() {
|
||||
local retur
|
||||
local ptmprio=$1
|
||||
local dslat=$2
|
||||
|
||||
if [ "$ptmprio" -eq 2 ]; then
|
||||
ptmprio="high"
|
||||
else
|
||||
ptmprio="low"
|
||||
fi
|
||||
|
||||
retur=$(xtmctl operate conn --show | awk -v dslat="$dslat" -v ptmprio="$ptmprio" '{if ($2 == dslat && $3 == ptmprio ) print $2 }')
|
||||
|
||||
case $retur in
|
||||
''|*[!0-9]*) return 0 ;;
|
||||
*) return $retur ;;
|
||||
esac
|
||||
}
|
||||
|
||||
ptm_inf_conf() {
|
||||
local ret
|
||||
local ptmprio
|
||||
local dslat
|
||||
local ifname
|
||||
local bridge
|
||||
|
||||
config_get ptmprio $1 ptmprio
|
||||
config_get dslat $1 dslat
|
||||
config_get ifname $1 ifname
|
||||
config_get baseifname $1 baseifname
|
||||
config_get bridge $1 bridge
|
||||
|
||||
checkptm $ptmprio $dslat
|
||||
ret=$?
|
||||
|
||||
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
|
||||
brcm_virtual_interface_rules "$baseifname" "$ifname" "$bridge"
|
||||
fi
|
||||
}
|
||||
|
||||
remove_netdevices() {
|
||||
local delptm
|
||||
local x=0
|
||||
|
||||
IFS=$'\n'
|
||||
for i in `xtmctl operate conn --show`
|
||||
do
|
||||
if [ $x -eq 1 ]; then
|
||||
delptm=$(echo $i | awk '{if ($1!="ATM") print $2"."$10}')
|
||||
echo "xtmctl operate conn --delete $delptm"
|
||||
xtmctl operate conn --delete $delptm
|
||||
xtmctl operate conn --deletenetdev $delptm
|
||||
fi
|
||||
x=1
|
||||
done
|
||||
unset IFS
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local vdslstatus
|
||||
echo "Starting VDSL"
|
||||
config_load layer2_interface
|
||||
config_get vdslstatus vdsl device
|
||||
|
||||
if [ "$vdslstatus" == "up" ]; then
|
||||
xtmctl start
|
||||
config_load layer2_interface_vdsl
|
||||
config_foreach ptm_inf_conf vdsl_interface
|
||||
fi
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
echo "Stopping VDSL"
|
||||
# bug in broadcom stop casues IRQ issue
|
||||
# xtmctl stop
|
||||
remove_netdevices
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger layer2_interface_vdsl
|
||||
}
|
||||
|
||||
|
||||
47
layer2interface/broadcom/etc/init.d/layer2_interface_vlan
Executable file
47
layer2interface/broadcom/etc/init.d/layer2_interface_vlan
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/network
|
||||
|
||||
START=21
|
||||
USE_PROCD=1
|
||||
|
||||
vlan_inf_conf() {
|
||||
local baseifname
|
||||
local vlan8021p
|
||||
local vlan8021q
|
||||
local routed
|
||||
config_get baseifname $1 baseifname
|
||||
config_get ifname $1 ifname
|
||||
config_get vlan8021p $1 vlan8021p
|
||||
config_get vlan8021q $1 vlan8021q
|
||||
config_get bridge $1 bridge
|
||||
addbrcmvlan "$baseifname" "$vlan8021p" "$vlan8021q" "$bridge" "$ifname"
|
||||
}
|
||||
|
||||
boot() {
|
||||
echo "VLAN does not run at boot"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local vdslstatus
|
||||
echo "Starting VLAN"
|
||||
|
||||
config_load layer2_interface_vlan
|
||||
config_foreach vlan_inf_conf vlan_interface
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
echo "Stopping VLAN"
|
||||
removeall_vlandevices
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger layer2_interface_vlan
|
||||
}
|
||||
|
||||
@@ -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
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user