Compare commits

..

12 Commits

Author SHA1 Message Date
Sukru Senli
ee0122d570 add mtd-utils-deubunize to config 2016-05-18 10:33:53 +02:00
Jonas Höglund
3d65ed21b6 Disable signed packages 2016-05-13 13:03:17 +02:00
Jonas Höglund
600c228751 Remove libcgroup due to missing depencency 2016-05-13 13:03:17 +02:00
Jonas Höglund
21fb0c0ca6 Allow Broadcom to override taskset 2016-05-13 13:03:17 +02:00
Jonas Höglund
fa7f660e3d Remove packages provided by ubi-utils 2016-05-13 13:03:17 +02:00
Jonas Höglund
1b29a6b8c2 Deselect ppp since we are selecting ppp-multilink 2016-05-13 13:03:17 +02:00
Jonas Höglund
d7c3272440 Don't build jffs2 fs for NOR 2016-05-13 13:03:17 +02:00
Jonas Höglund
5d41cf4f5c Remove juci meta package 2016-05-13 13:03:17 +02:00
Jonas Höglund
6687e2e369 Disable ffmpeg due to broken flac package 2016-05-13 13:03:17 +02:00
Jonas Höglund
38eeda39fd Delete chan-mobile to remove bluez dependency 2016-05-13 13:03:17 +02:00
Jonas Höglund
dc8ae7c8c2 Remove btle_alarm 2016-05-13 13:03:17 +02:00
Jonas Höglund
da84670d13 Delete bluez from inteno packages 2016-05-13 13:03:17 +02:00
258 changed files with 5234 additions and 15721 deletions

31
4g-support/Makefile Normal file
View 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))

View 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

View 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

View File

@@ -0,0 +1,66 @@
#!/bin/sh
local usb_dir uVid uPid uMa uPr uSe bConf bNumConfs vendor product mdmtyp netdev comdev cdcdev ttydev usbno usbbr
sanitize() {
sed -e 's/[[:space:]]\+$//; s/[[:space:]]\+/_/g' "$@"
}
find_usb_attrs() {
usb_dir="/sys/$DEVPATH"
[ -f "$usb_dir/idVendor" ] || usb_dir="${usb_dir%/*}"
uVid=$(cat "$usb_dir/idVendor")
uPid=$(cat "$usb_dir/idProduct")
uMa=$(sanitize "$usb_dir/manufacturer")
uPr=$(sanitize "$usb_dir/product")
uSe=$(sanitize "$usb_dir/serial")
bNumConfs=$(cat "$usb_dir/bNumConfigurations")
bConf=$(cat "$usb_dir/bConfigurationValue")
netdev=$(find $usb_dir -name wwan* | awk -F'/' '{print$NF}' | head -2 | tail -1)
cdcdev=$(find $usb_dir -name cdc-wdm* | awk -F'/' '{print$NF}' | head -2 | tail -1)
ttydev=$(ls $(find $usb_dir -name tty | head -2 | tail -1) | tail -1)
if [ -n "$cdcdev" ]; then
comdev=$cdcdev
mdmtyp=$(grep $uVid:$uPid /etc/modemdb | grep 'qmi\|mbim' | awk '{print$2}' | head -1)
vendor=$(grep $uVid:$uPid /etc/modemdb | grep 'qmi\|mbim' | awk '{print$3}' | head -1)
product=$(grep $uVid:$uPid /etc/modemdb | grep 'qmi\|mbim' | awk '{print$4}' | head -1)
else
comdev=$ttydev
mdmtyp=$(grep $uVid:$uPid /etc/modemdb | grep 'ncm' | awk '{print$2}' | head -1)
vendor=$(grep $uVid:$uPid /etc/modemdb | grep 'ncm' | awk '{print$3}' | head -1)
product=$(grep $uVid:$uPid /etc/modemdb | grep 'ncm' | awk '{print$4}' | head -1)
fi
[ -n "$mdmtyp" ] || mdmtyp=$(grep $uVid:$uPid /etc/modemdb | awk '{print$2}' | head -1)
[ -n "$vendor" ] || vendor=$(grep $uVid:$uPid /etc/modemdb | awk '{print$3}' | head -1)
[ -n "$product" ] || product=$(grep $uVid:$uPid /etc/modemdb | awk '{print$4}' | head -1)
}
convert_to_mbim() {
if [ "$mdmtyp" == "mbim" ] && [ "$bNumConfs" == "2" ]; then
[ "$bConf" == "2" ] || echo 2 > $usb_dir/bConfigurationValue
fi
}
usbno=$(echo $DEVPATH | cut -d'/' -f5)
usbbr=$(echo $DEVPATH | cut -d'/' -f7)
case "$usbbr" in
*:*) usbbr=$(echo $DEVPATH | cut -d'/' -f6) ;;
esac
find_usb_attrs
if [ "$ACTION" = add ]; then
convert_to_mbim "$uVid:$uPid"
if [ -n "$uVid" ] && [ -n "$uPid" ] && [ -n "$mdmtyp" ] && [ -n "$netdev" ] && [ -n "$comdev" ]; then
if [ -n "$usbno" ] && [ -n "$usbbr" ]; then
sed -i "/$usbno:$usbbr/ d" /var/usbnets
echo $usbno:$usbbr $uVid:$uPid $uMa $uPr $netdev $comdev $mdmtyp $vendor $product >> /var/usbnets
fi
fi
fi
if [ "$ACTION" = remove ]; then
if [ -n "$usbno" ] && [ -n "$usbbr" ]; then
sed -i "/$usbno:$usbbr/ d" /var/usbnets
fi
fi

View 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

View 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

768
asterisk-1.8.x-mod/Makefile Normal file
View File

@@ -0,0 +1,768 @@
#
# 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:=2239c2d0e790abfce7ac0684dbbac1cf9c0aff40
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se:/asterisk-1.8.x
PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)-$(PKG_RELEASE).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-include $(INCLUDE_DIR)/ltqtapi.mk
include $(INCLUDE_DIR)/package.mk
define Package/asterisk18-mod/Default
SUBMENU:=Telephony
SECTION:=net
CATEGORY:=Network
URL:=http://www.asterisk.org/
endef
define Package/asterisk18-mod/Default/description
Asterisk is a complete PBX in software. It provides all of the features
you would expect from a PBX and more. Asterisk does voice over IP in three
protocols, and can interoperate with almost all standards-based telephony
equipment using relatively inexpensive hardware.
endef
define Package/asterisk18-mod
$(call Package/asterisk18-mod/Default)
TITLE:=Complete open source PBX, v1.8x
MENU:=1
DEPENDS:= +natalie-dect-h +PACKAGE_bcmkernel:bcmkernel +PACKAGE_bcmopen:bcmopen +libopenssl +libncurses +libpopt +libpthread +uci +ubus +zlib @!TARGET_avr32
endef
define Package/asterisk18-mod/description
$(call Package/asterisk18-mod/Default/description)
endef
define Package/asterisk18-mod-sounds
$(call Package/asterisk18-mod/Default)
TITLE:=Sound files
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-sounds/description
$(call Package/asterisk18-mod/Default/description)
This package contains sound files for Asterisk.
endef
define Package/asterisk18-mod-voicemail
$(call Package/asterisk18-mod/Default)
TITLE:=Voicemail support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-voicemail/description
$(call Package/asterisk18-mod/Default/description)
This package contains voicemail related modules for Asterisk.
endef
define Package/asterisk18-mod-app-transfer
$(call Package/asterisk18-mod/Default)
TITLE:=Call transfer support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-app-transfer/description
$(call Package/asterisk18-mod/Default/description)
This package contains the call transfer support module for Asterisk.
endef
define Package/asterisk18-mod-app-softhangup
$(call Package/asterisk18-mod/Default)
TITLE:=SoftHangup application
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-app-softhangup/description
$(call Package/asterisk18-mod/Default/description)
This package contains the SoftHangup support module for Asterisk.
endef
define Package/asterisk18-mod-app-meetme
$(call Package/asterisk18-mod/Default)
TITLE:=conferencing support
DEPENDS:= asterisk18-mod +dahdi-tools-libtonezone +dahdi
endef
define Package/asterisk18-mod-app-meetme/description
$(call Package/asterisk18-mod/Default/description)
This package provides the MeetMe application driver Conferencing support to
Asterisk.
endef
define Package/asterisk18-mod-chan-iax2
$(call Package/asterisk18-mod/Default)
TITLE:=IAX support
DEPENDS:= asterisk18-mod +asterisk18-res-crypto
endef
define Package/asterisk18-mod-chan-iax2/description
$(call Package/asterisk18-mod/Default/description)
This package provides IAX support to
Asterisk.
endef
define Package/asterisk18-mod-cdr
$(call Package/asterisk18-mod/Default)
TITLE:=CDR support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-cdr/description
$(call Package/asterisk18-mod/Default/description)
This package provides Call Detail Record support to
Asterisk.
endef
define Package/asterisk18-mod-res-musiconhold
$(call Package/asterisk18-mod/Default)
TITLE:=MOH support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-res-musiconhold/description
$(call Package/asterisk18-mod/Default/description)
This package provides Music On Hold support to
Asterisk.
endef
define Package/asterisk18-mod-res-voice
$(call Package/asterisk18-mod/Default)
TITLE:=Voice client/pbx support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-res-voice/description
$(call Package/asterisk18-mod/Default/description)
This package provides Voice Client/pbx support to
Asterisk.
endef
define Package/asterisk18-mod-res-srtp
$(call Package/asterisk18-mod/Default)
TITLE:=SRTP support
DEPENDS:= asterisk18-mod libsrtp +asterisk18-mod-res-crypto
endef
define Package/asterisk18-mod-res-srtp/description
$(call Package/asterisk18-mod/Default/description)
This package provides SRTP support to
Asterisk.
endef
define Package/asterisk18-mod-res-stun
$(call Package/asterisk18-mod/Default)
TITLE:=STUN support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-app-queue
$(call Package/asterisk18-mod/Default)
TITLE:=Queue support
DEPENDS:= asterisk18-mod
endef
define Package/asterisk18-mod-chan-gtalk
$(call Package/asterisk18-mod/Default)
TITLE:=GTalk support
DEPENDS:= asterisk18-mod +libiksemel
endef
define Package/asterisk18-mod-chan-gtalk/description
$(call Package/asterisk18-mod/Default/description)
This package provides the channel chan_gtalk and res_jabber for GTalk
support to Asterisk.
endef
define Package/asterisk18-mod-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
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))

View File

@@ -0,0 +1,4 @@
## startup options for /etc/init.d/asterisk
ENABLE_ASTERISK="yes"
OPTIONS=""

View 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
}

View File

@@ -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))

View File

@@ -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))

Binary file not shown.

View File

@@ -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
View 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
View File

@@ -0,0 +1,3 @@
config dect 'dect'
option 'radio' 'auto'

Binary file not shown.

Binary file not shown.

View 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
View 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
View 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"}'
}

View File

@@ -8,20 +8,23 @@
include $(TOPDIR)/rules.mk
PKG_RELEASE:=1
PKG_VERSION:=1.2.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:=0c029ed2486342e7e7687631b702d5c743f3c41a
PKG_SOURCE_VERSION:=666c3e93ad56e20493bae8a439e9655ce947f2f7
PKG_NAME:=dectmngr2
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
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
@@ -29,7 +32,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
@@ -40,17 +43,12 @@ endef
define Package/dectmngr2/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/dect/
$(INSTALL_DIR) $(1)/etc/config/
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_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/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/nvs_default $(1)/etc/dect/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dect $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dectmngr-wrapper.sh $(1)/usr/sbin/
$(CP) ./files/dect.config $(1)/etc/config/dect
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dect $(1)/etc/init.d/
endef
$(eval $(call BuildPackage,dectmngr2))

View File

@@ -1,4 +0,0 @@
config dect 'dect'
option radio 'auto'

View File

@@ -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

View File

@@ -1,19 +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
endmenu
endif

View File

@@ -1,133 +0,0 @@
#
# Copyright (C) 2018 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=easy-soc-libs
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=6a311af7cd17fc410c27de3cfae33b658195fd0b
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
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)
endef
define Package/libdsl
$(call Package/easy-soc-libs)
TITLE:= XDSL library (libdsl)
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
KERNEL_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
TARGET_PLATFORM=BROADCOM
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138
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
ifdef CONFIG_IOP_LLA_LIBS_DEBUG
TARGET_CFLAGS += -DIOP_LLA_LIBS_DEBUG
endif
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/libnl3
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
FPIC="$(FPIC)" \
PLATFORM="$(TARGET_PLATFORM)" \
subdirs="$(subdirs)"
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/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
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libwifi))
$(eval $(call BuildPackage,libdsl))
$(eval $(call BuildPackage,libethernet))

0
endptmngr/Config.in → endptcfg/Config.in Executable file → Normal file
View File

92
endptcfg/Makefile Normal file
View 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))

View File

@@ -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:=a78fe95d5c5a0a320f3b62b9d2faafd07b56e3a7
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))

View File

@@ -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))

View File

@@ -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;

View File

@@ -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);
}
/**

View File

@@ -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))

View File

@@ -1,3 +0,0 @@
git-src

View File

@@ -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))

View File

@@ -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

View File

@@ -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

View File

@@ -15,21 +15,23 @@ 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
config CWMP_DEVEL_DEBUG
bool "Compile with development debug options"
default n
config LIBDATAMODEL_VENDOR_PREFIX
string "Vendor Prefix"
default "X_IOPSYS_EU_"
endif

View File

@@ -1,7 +0,0 @@
if PACKAGE_libdatamodel
config UPNP_TR064
bool "Compile with tr064 features"
default n
endif

100
icwmp/Makefile Executable file → Normal file
View File

@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=4.0-2019-04-01
PKG_VERSION:=3.0-2016-03-30
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:=7faa875dcb825869c6bd942e140d2200e5e0dc0e
PKG_SOURCE_VERSION:=5de240514b73aff51301df4d41b88f762bca89df
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
@@ -30,32 +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/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
endef
define Package/icwmp/description
@@ -77,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)
@@ -91,15 +66,9 @@ 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
ifneq ($(CWMP_REVISION)_,_)
ifneq ($(CWMP_REVISION),exported)
ifneq ($(CWMP_REVISION),Unversioned directory)
@@ -116,17 +85,9 @@ 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)
ifeq ($(BUILD_VARIANT),zstream)
CONFIGURE_ARGS += \
--enable-http=zstream \
@@ -158,18 +119,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
@@ -181,39 +137,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
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
@@ -235,7 +162,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-zstream))

View File

@@ -9,7 +9,7 @@
- libz.so
- libcrypto.so
the librairies should be present in the "staging_dir/target-i386_uClibc-0.9.30.1/usr/lib/" or "staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib"
header files and folders:
- expat.h
- expat_external.h
@@ -33,7 +33,7 @@ this software is composed of 3 packages:
- cwmp kernel package: contains cwmp kernel module. This module could be used by other kernel modules to notify the icwmpd daemon when kernel parameter changes
The three packages should be selected in the make menu config in order to get the three packages compiled.
To compile the three packages: $ make package/cwmpd/compile
To compile the three packages: $ make package/cwmpd/compile
3) OpenWRT settings
in the OpenWRT, Add the following lines in the /usr/share/udhcpc/default.script file:
@@ -49,7 +49,7 @@ in the OpenWRT, Add the following lines in the /usr/share/udhcpc/default.script
- libopenssl package should be installed
- libz package should be installed
- libcrypto package should be installed
Configure the acs url in the /etc/config/icwmp
and then start the cwmpd service: /etc/init.d/icwmpd start
for the help: /etc/init.d/icwmpd

View File

@@ -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

View File

@@ -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

View File

@@ -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))

View File

@@ -1,42 +0,0 @@
#
# Copyright (C) 2018 Inteno
#
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:=cea60630cfac1d3c70f486acea6663d339b7d444
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
PKG_MAINTAINER:=Sartura Support for Inteno <support-inteno@sartura.hr>
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/imonitor
CATEGORY:=Utilities
TITLE:=Inteno 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))

View File

@@ -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'

View File

@@ -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
}

View File

@@ -1,53 +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:=inbd
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=12755fccb8ef87965ac684d62d56e19e73a255bd
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:=Inteno 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))

View File

@@ -3,16 +3,12 @@ CONFIG_BUSYBOX_CUSTOM=y
CONFIG_CCACHE=y
CONFIG_DEBUG=y
CONFIG_DEVEL=y
# CONFIG_LOCALMIRROR is not set
CONFIG_PACKAGE_6in4=y
CONFIG_PACKAGE_6rd=y
CONFIG_PACKAGE_6to4=y
CONFIG_PACKAGE_6tunnel=y
CONFIG_LOCALMIRROR="http://mirror.inteno.se/mirror"
CONFIG_PACKAGE_4g-support=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
@@ -31,57 +27,44 @@ CONFIG_PACKAGE_ice-client-monitor=m
CONFIG_PACKAGE_ice-client-netrounds=m
CONFIG_PACKAGE_ice-client-rshell=m
CONFIG_PACKAGE_ice-client-texec=m
# CONFIG_PACKAGE_icgroupd is not set
CONFIG_PACKAGE_icwmp-curl=y
CONFIG_PACKAGE_ifbt=y
CONFIG_PACKAGE_imonitor=y
CONFIG_PACKAGE_inbd=y
CONFIG_PACKAGE_netmode=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_iup=y
# CONFIG_PACKAGE_iwatchdog is not set
CONFIG_PACKAGE_iwatchdog=y
CONFIG_PACKAGE_juci=y
CONFIG_PACKAGE_juci-broadcom-dsl=y
CONFIG_PACKAGE_juci-broadcom-ethernet=y
CONFIG_PACKAGE_juci-broadcom-iptv=y
CONFIG_PACKAGE_juci-broadcom-pwrmgmt=y
CONFIG_PACKAGE_juci-wifilife=y
CONFIG_PACKAGE_juci-wireless=y
CONFIG_PACKAGE_juci-broadcom-vlan=y
CONFIG_PACKAGE_juci-broadcom-wl=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-ice-client=y
CONFIG_PACKAGE_juci-icwmp=y
CONFIG_PACKAGE_juci-igmpinfo=y
CONFIG_PACKAGE_juci-config-backup=y
CONFIG_PACKAGE_juci-mwan3=y
CONFIG_PACKAGE_juci-iup=y
# CONFIG_PACKAGE_juci-qos is not set
CONFIG_PACKAGE_juci-voice-client=y
CONFIG_PACKAGE_juci-inteno-backup=y
CONFIG_PACKAGE_juci-inteno-multiwan=y
CONFIG_PACKAGE_juci-inteno-provisioning=y
CONFIG_PACKAGE_juci-inteno-router=y
CONFIG_PACKAGE_juci-inteno-qos=y
CONFIG_PACKAGE_juci-inteno-voice-client=y
CONFIG_PACKAGE_juci-macdb=y
CONFIG_PACKAGE_juci-minidlna=y
CONFIG_PACKAGE_juci-mod-status=y
CONFIG_PACKAGE_juci-mod-system=y
CONFIG_PACKAGE_juci-natalie-dect=y
CONFIG_PACKAGE_juci-netmode=y
CONFIG_PACKAGE_juci-network-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-printer=y
CONFIG_PACKAGE_juci-realtime-graphs=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-iopsys=y
CONFIG_PACKAGE_juci-theme-inteno=y
CONFIG_PACKAGE_juci-ubus-core=y
CONFIG_PACKAGE_juci-upnp=y
CONFIG_PACKAGE_juci-usb=y
@@ -89,15 +72,11 @@ 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_libcgroup-daemon=y
CONFIG_PACKAGE_libcgroup=y
# CONFIG_PACKAGE_libcgroup-utils is not set
CONFIG_PACKAGE_layer2interface=y
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_mtd-utils=y
@@ -105,35 +84,29 @@ 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_mwan3=y
CONFIG_PACKAGE_nand-utils=y
CONFIG_PACKAGE_multiwan=y
CONFIG_PACKAGE_ndisc6=y
CONFIG_PACKAGE_ntfs-3g=y
CONFIG_PACKAGE_ntpd=y
CONFIG_PACKAGE_netcheck=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 is not set
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
@@ -143,15 +116,8 @@ CONFIG_PACKAGE_tcpdump=y
CONFIG_PACKAGE_terminfo=y
CONFIG_PACKAGE_tptest=y
CONFIG_PACKAGE_traceroute6=y
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
@@ -161,30 +127,19 @@ CONFIG_TARGET_ROOTFS_TARGZ=y
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
@@ -209,22 +164,11 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_SECURETTY=y
# 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_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER 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_PACKAGE_ip-full=y
# CONFIG_BUSYBOX_CONFIG_IP is not set
CONFIG_PACKAGE_iopupgrade=y

43
iop/configs/luci.diff Executable file
View File

@@ -0,0 +1,43 @@
/CONFIG_DEFAULT_juci/d
/CONFIG_PACKAGE_juci/d
/CONFIG_PACKAGE_luci/d
$a\CONFIG_PACKAGE_luci=y
$a\CONFIG_PACKAGE_luci-mod-admin-core=y
$a\CONFIG_PACKAGE_luci-mod-admin-full=y
$a\CONFIG_PACKAGE_luci-app-catv=y
$a\CONFIG_PACKAGE_luci-app-ddns=y
$a\CONFIG_PACKAGE_luci-app-dslstats=y
$a\CONFIG_PACKAGE_luci-app-firewall=y
$a\CONFIG_PACKAGE_luci-app-iup=y
$a\CONFIG_PACKAGE_luci-app-mcpd=y
$a\CONFIG_PACKAGE_luci-app-minidlna=y
$a\CONFIG_PACKAGE_luci-app-multiwan=y
$a\CONFIG_PACKAGE_luci-app-p910nd=y
$a\CONFIG_PACKAGE_luci-app-parental-control=y
$a\CONFIG_PACKAGE_luci-app-port-management=y
$a\CONFIG_PACKAGE_luci-app-power-mgmt=y
$a\CONFIG_PACKAGE_luci-app-samba=y
$a\CONFIG_PACKAGE_luci-app-sfp=y
$a\CONFIG_PACKAGE_luci-app-snmp=y
$a\CONFIG_PACKAGE_luci-app-speedtest=y
$a\CONFIG_PACKAGE_luci-app-upnp=y
$a\CONFIG_PACKAGE_luci-app-voice=y
$a\CONFIG_PACKAGE_luci-theme-base=y
$a\CONFIG_PACKAGE_luci-theme-bootstrap=y
$a\CONFIG_PACKAGE_luci-i18n-english=y
$a\CONFIG_PACKAGE_luci-proto-3g=y
$a\CONFIG_PACKAGE_luci-proto-4g=y
$a\CONFIG_PACKAGE_luci-proto-core=y
$a\CONFIG_PACKAGE_luci-proto-ipv6=y
$a\CONFIG_PACKAGE_luci-proto-ppp=y
$a\CONFIG_PACKAGE_luci-sgi-cgi=y
$a\CONFIG_PACKAGE_luci-lib-core=y
$a\CONFIG_PACKAGE_luci-lib-core_source=y
$a\CONFIG_PACKAGE_luci-lib-ipkg=y
$a\CONFIG_PACKAGE_luci-lib-json=y
$a\CONFIG_PACKAGE_luci-lib-nixio=y
$a\CONFIG_PACKAGE_luci-lib-nixio_notls=y
$a\CONFIG_PACKAGE_luci-lib-sys=y
$a\CONFIG_PACKAGE_luci-lib-web=y

View File

@@ -1,94 +0,0 @@
# Bash completion for IOPSYS "./iop" utility
# Source this file into the curent shell or copy it into
# /usr/share/bash-completion/completions/ and start a new shell
# for automatic availability.
_iop_get_profiles()
{
find feeds/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 \
|awk -F'/' '{print$NF}' \
|egrep '^(cg|dg|eg|vg|vox)[0-9]'
}
_iop_get_model_customers()
{
local model=$1
find customerconfigs/$prev -mindepth 1 -maxdepth 1 -type d \
|awk -F'/' '{print$NF}'
}
_iop()
{
local cur prev iopcmds
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
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"
if [ $COMP_CWORD -eq 1 ] ; then
# Complete the primary iop command
COMPREPLY=($(compgen -W "${iopcmds}" -- ${cur}))
return 0
else
# Complete the arguments to "iopcmds"
local cmd="${COMP_WORDS[1]}"
case "$cmd" in
extract_core)
if [ "$prev" == "-e" ] ; then
_filedir -d
else
COMPREPLY=( $(compgen -W "-e -h" -- ${cur}) )
fi
return 0
;;
genconfig)
if [ "$prev" == "-p" ] ; then
local profiles=$(_iop_get_profiles)
COMPREPLY=( $(compgen -W "juci $profiles" -- ${cur}) )
elif [[ $cur == -* ]] ; then
COMPREPLY=( $(compgen -W "-c -h -p -s -t -u -v" -- ${cur}) )
else
local models=$(_iop_get_models)
if echo $models |grep -qw -- $prev ; then
local customers=$(_iop_get_model_customers $prev)
COMPREPLY=( $(compgen -W "$customers" -- ${cur}) )
else
COMPREPLY=( $(compgen -W "$models" -- ${cur}) )
fi
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
;;
esac
fi
}
complete -F _iop ./iop
complete -F _iop iop

View File

@@ -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"

View File

@@ -1,15 +0,0 @@
#!/bin/bash
declare -a feed_list
function list_feeds {
jq '.feed[] | .name' feeds.conf
}
# Exported interface
function auto_feeds_conf {
echo "Function auto feeds conf"
echo "feed list:"
list_feeds
}
register_command "auto_feeds_conf" "Automatically update feeds"

View File

@@ -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>"

View File

@@ -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"

View File

@@ -1,134 +0,0 @@
#!/bin/bash
function extract_core {
initial_commit=1427738ac4b77f474999ae21af1a8b916468df36
patch_dir=extract_core_patches
topdir=$(pwd)
# 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 '
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
git checkout --orphan $branch
git rm -rf --cached *
git rm -rf --cached .empty
rm -rf *
rm -rf .empty
}
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
}
register_command "extract_core" "Extract core package to separate feed"

View File

@@ -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"

View File

@@ -3,45 +3,48 @@
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
./scripts/feeds install -p targets iopsys-brcm63xx-mips
./scripts/feeds install -p targets iopsys-brcm63xx-arm
./scripts/feeds install -p targets iopsys-ramips
./scripts/feeds install -p intel_targets intel_mips
# install all packages
./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
# 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

View File

@@ -1,382 +1,258 @@
#!/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
LOCAL_MIRROR="http://mirror.inteno.se/mirror"
export CLEAN=0
export IMPORT=0
export SRCTREEOVERR=0
export FILEDIR="files/"
export CONFIGPATH="package/feeds/feed_inteno_packages/iop/configs"
export CUSTCONF="customerconfigs"
export VERBOSE=0
export DEVELOPER=0
export TMPDIR="/tmp/builder/"
LOCAL_MIRROR="http://mirror.inteno.se/mirror"
target="bogus"
config_path=""
iopsys_brcm63xx_mips="cg300 cg301 dg150 dg150v2 dg150alv2 dg200 dg200al dg301 dg301al eg300 vg50 vox25"
iopsys_brcm63xx_arm="dg400"
target="bogus"
# Takes a board name and returns the target name in global var $target
set_target() {
local profile=$1
set_target() {
local iopsys_brcm63xx_mips=$(cd target/linux/iopsys-brcm63xx-mips; ./genconfig)
local iopsys_brcm63xx_arm=$(cd target/linux/iopsys-brcm63xx-arm; ./genconfig)
local iopsys_ramips=$(cd target/linux/iopsys-ramips; ./genconfig)
local intel_mips=$(cd target/linux/intel_mips; ./genconfig)
local profile=$1
if [ "$profile" == "LIST" ]
then
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips intel_mips
do
echo "$list based boards:"
for b in ${!list}
do
echo -e "\t$b"
done
done
return
fi
for p in $iopsys_brcm63xx_mips; do
if [ $p == $profile ]; then
target="iopsys_brcm63xx_mips"
fi
done
local targets
for p in $iopsys_brcm63xx_mips; do
if [ $p == $profile ]; then
target="iopsys_brcm63xx_mips"
config_path="target/linux/iopsys-brcm63xx-mips/config"
return
fi
done
for p in $iopsys_brcm63xx_arm; do
if [ $p == $profile ]; then
target="iopsys_brcm63xx_arm"
config_path="target/linux/iopsys-brcm63xx-arm/config"
return
fi
done
for p in $iopsys_ramips; do
if [ $p == $profile ]; then
target="iopsys_ramips"
config_path="target/linux/iopsys-ramips/config"
return
fi
done
for p in $intel_mips; do
if [ $p == $profile ]; then
target="intel_mips"
config_path="target/linux/intel_mips/config"
return
fi
done
}
git remote -v | grep -q http || {
DEVELOPER=1
bcmAllowed=0
iceAllowed=0
endptAllowed=0
natalieAllowed=0
mediatekAllowed=0
wifilifeAllowed=0
allowedRepos="$(ssh -o ConnectTimeout=5 git@private.inteno.se 2>/dev/null | grep -w 'R\|W' | awk '{print$NF}')"
for repo in $allowedRepos; do
case $repo in
bcmkernel) bcmAllowed=1 ;;
ice-client) iceAllowed=1 ;;
endptcfg) endptAllowed=1 ;;
natalie-dect*) natalieAllowed=1 ;;
linux) mediatekAllowed=1 ;;
wifilife) wifilifeAllowed=1 ;;
esac
done
}
v() {
[ "$VERBOSE" -ge 1 ] && echo "$@"
}
usage() {
echo
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
echo
echo -e " -c|--clean\tRemove all files under ./files and import from config "
echo -e " -v|--verbose\tVerbose"
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
echo -e " -s|--override\tEnable 'Package source tree override'"
echo -e " -h|--help\tShow this message"
echo -e " -l|--list [customer]\tList all Customers or all boards for one customer"
echo -e " -a|--list-all\tList all Customers and their board types"
echo -e " -b|--boards\tList all board types"
echo
echo "Example ./iop genconfig vg50 TELIA"
echo "(if no customerconfig is chosen the Inteno 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
}
for p in $iopsys_brcm63xx_arm; do
if [ $p == $profile ]; then
target="iopsys_brcm63xx_arm"
fi
done
}
generate_config()
{
git remote -v | grep -q http || {
DEVELOPER=1
bcmAllowed=0
iceAllowed=0
endptAllowed=0
natalieAllowed=0
allowedRepos="$(ssh -o ConnectTimeout=5 git@private.inteno.se 2>/dev/null | grep -w 'R\|W' | awk '{print$NF}')"
for repo in $allowedRepos; do
case $repo in
bcmkernel) bcmAllowed=1 ;;
ice-client) iceAllowed=1 ;;
endptcfg) endptAllowed=1 ;;
natalie-dect*) natalieAllowed=1 ;;
esac
done
}
v() {
[ "$VERBOSE" -ge 1 ] && echo "$@"
}
usage() {
echo
echo 1>&2 "Usage: $0 [OPTIONS] BoardConfig Customerconfig"
echo
echo " -c, remove all files under ./files and import from config "
echo " -v, verbose"
echo " -u, Update customer config before applying"
echo " -p, set profile (if exists)"
echo " -t, use latest git tag and number of commits since as version for the build"
echo " -s, enable 'Package source tree override'"
echo
echo "BoardConfig ex "
ls -1 configs
if [ -d "$CUSTCONF/$1" ]; then
echo "Customerconfig ex"
ls $CUSTCONF/*
fi
echo
echo "Example ./genconfig vg50 TELIA"
echo "(if no customerconfig is chosen the Inteno Config will be used)"
echo
exit 127
}
use_local_mirror()
{
if wget -T 3 -t 2 -O /dev/null $LOCAL_MIRROR >/dev/null 2>/dev/null
then
echo "mirror [$LOCAL_MIRROR] exists. Using local mirror"
sed -i "s;CONFIG_LOCALMIRROR=.*;CONFIG_LOCALMIRROR=\"$LOCAL_MIRROR\";" .config
else
echo "mirror [$LOCAL_MIRROR] does not exist. Not using local mirror"
fi
}
generate_config()
{
DIFFFILE="$1"
MASTERFILE="$2"
while read p; do
v "$p"
sed -r -i "$p" $MASTERFILE
v "$p"
sed -r -i "$p" $MASTERFILE
done < $DIFFFILE
}
}
setup_dirs()
{
if ssh -o ConnectTimeout=5 git@private.inteno.se 2>/dev/null | grep -qw ${CUSTREPO:22}; 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=n" >>.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
# 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
# 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)"
}
####### 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
# 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
generate_config configs/$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"
generate_config $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;;
-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@private.inteno.se:customerconfigs}"
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
fi
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
}
####### main #####
if [ ! -e tmp/.iop_bootstrap ]; then
echo "You have not installed feeds. Running genconfig in this state would create a non functional configuration."
echo "Run: iop feeds_update"
exit 0
fi
if [ $# -eq 0 ]; then
echo Current profile:
cat .current_config_file
echo "Try ./iop_get_config.sh -h' to get instructions if you want to change current config"
exit 0
else
while [ -n "$1" ]; do
case "$1" in
-c) export CLEAN=1;;
-u) export IMPORT=1;;
-v) export VERBOSE="$(($VERBOSE + 1))";;
-p) export PROFILE="$2"; shift;;
-t) export USE_TAG=1;;
-s) export SRCTREEOVERR=1;;
-h) usage;;
-*)
echo "Invalid option: $1 "
echo "Try -h' for more information."
exit 1
;;
*) break;;
esac
shift;
done
[ -d $TMPDIR ] || mkdir $TMPDIR
setup_dirs
create_and_copy_files "$1" "$2"
[ -d $TMPDIR ] && rm -rf $TMPDIR
use_local_mirror
fi
}
register_command "genconfig" "Generate configuration for board and customer"

View File

@@ -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"

View File

@@ -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"

177
iop/scripts/setup_host.sh Executable file
View File

@@ -0,0 +1,177 @@
#!/bin/bash
function setup_host {
if [ "$(whoami)" != "root" ]; then
echo "Please run this script as root!"
exit 1
fi
packages_all="bison flex g++ g++-multilib zlib1g-dev gettext gawk svn-buildpackage libncurses5-dev ncurses-term git automake gtk-doc-tools liblzo2-dev uuid-dev execstack"
packages_perl="libconvert-binary-c-perl libdigest-crc-perl"
packages_x64="libc6-dev-i386 lib32z1"
packages_npm="npm nodejs yui-compressor"
curdir=$(pwd)
#===============#
# Prerequisites #
#===============#
mysh=$(ls -hl /bin/sh | awk -F'[ ,/]' '{print$NF}')
if [ "$mysh" != "bash" ]; then
echo "On Debian based systems, e.g. Ubuntu, /bin/sh must point to bash instead of $mysh"
read -p "Do you approve this change (y/n): " ans
if [ "$ans" == "y" ]; then
rm -f /bin/sh
ln -s bash /bin/sh
else
echo "Warning! You haven't pointed /bin/sh to bash."
cd $curdir
exit 1
fi
fi
echo "The packages below must be installed"
echo $packages_all $packages_perl
read -p "Do you approve insallation of these packages (y/n): " ans
if [ "$ans" == "y" ]; then
apt-get install $packages_all
apt-get install $packages_perl
else
cd $curdir
exit 1
fi
if [ "$(uname -m | awk '{print$1}')" == "x86_64" ]; then
echo "You are running a Linux Distribution based on 64-bit kernel"
echo "The packages below must be installed"
echo $packages_x64
read -p "Do you approve insallation of these packages (y/n): " ans
if [ "$ans" == "y" ]; then
apt-get install $packages_x64
else
cd $curdir
exit 1
fi
fi
echo "The packages below must be installed in order to be able to compile JUCI"
echo $packages_npm
read -p "Do you approve insallation of these packages (y/n): " ans
if [ "$ans" == "y" ]; then
apt-get install npm nodejs yui-compressor
npm install -g npm
npm install -g grunt-cli
npm install -g mocha
npm install -g bower
npm install -g uglify-js
npm install -g less
if [ "$(which node)" == "" ]; then
NODEJS=$(which nodejs)
if [ "$NODEJS" != "" ]; then
read -p "Found nodejs executable at $(which nodejs), but no path to 'node'. Do you want to create a symlink? (y/n): " ans
if [ "$ans" == "y" ]; then
ln -s "$NODEJS" "/usr/bin/node"
fi
fi
fi
user=$(who | head -1 | awk '{print$1}')
[ -n $user ] && chown -R $user:$user /home/$user/.npm/
else
cd $curdir
exit 1
fi
# Get the Broadcom toolchain from here and unpack the mips/arm package to /opt:
echo -n "Checking for Broadcom MIPS toolchain: "
if [ -d /opt/toolchains/crosstools-mips-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21 ]; then
install_mips=0
echo "YES"
else
install_mips=1
echo "NO"
fi
echo -n "Checking for Broadcom ARM toolchain: "
if [ -d /opt/toolchains/crosstools-arm-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21-NPTL ]; then
install_arm=0
echo "YES"
else
install_arm=1
echo "NO"
fi
if [ $install_mips -eq 1 -o $install_arm -eq 1 ]; then
read -p "Do you approve insallation of missing toolchains (y/n): " ans
if [ "$ans" == "y" ]; then
echo "Downloading toolchain"
else
cd $curdir
exit 1
fi
cd ~
wget http://iopsys.inteno.se/iopsys/toolchain/crosstools-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21.Rel1.2-full.tar.bz2
tar jxf crosstools-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21.Rel1.2-full.tar.bz2
cd /
if [ $install_mips -eq 1 ]; then
echo "Installing MIPS toolchain"
tar jxf ~/crosstools-mips-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21.Rel1.2.tar.bz2
fi
if [ $install_arm -eq 1 ]; then
echo "Installing ARM toolchain"
tar jxf ~/crosstools-arm-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21-NPTL.Rel1.2.tar.bz2
fi
rm -f ~/crosstools-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21-sources.tar.bz2
rm -f ~/crosstools-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21.Rel1.2-full.tar.bz2
rm -f ~/crosstools-mip*-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21.Rel1.2.tar.bz2
rm -f ~/crosstools-arm-gcc-4.6-linux-3.4-uclibc-0.9.32-binutils-2.21-NPTL.Rel1.2.tar.bz2
fi
gcc_ver=$(ls -l /usr/bin/gcc-[0-9]* | head -1 | awk '{print$NF}' | cut -d'-' -f2)
if [ "$gcc_ver" != "4.8" ]; then
echo "Your current gcc version is $gcc_ver, but it must be changed to 4.8"
read -p "Do you approve this change (y/n): " ans
if [ "$ans" == "y" ]; then
apt-get install gcc-4.8
apt-get install g++-4.8
apt-get install gcc-4.8-multilib
update-alternatives --install /usr/bin/g++ c++ /usr/bin/g++-4.8 100
update-alternatives --install /usr/bin/g++ c++ /usr/bin/g++-$gcc_ver 90
update-alternatives --install /usr/bin/gcc cc /usr/bin/gcc-4.8 100
update-alternatives --install /usr/bin/gcc cc /usr/bin/gcc-$gcc_ver 90
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.8 100
update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-$gcc_ver 90
update-alternatives --set c++ /usr/bin/g++-4.8
update-alternatives --set cc /usr/bin/gcc-4.8
update-alternatives --set cpp /usr/bin/cpp-4.8
ln -s /etc/alternatives/cc /usr/bin/cc
echo "The deafult gcc version has now been changed from $gcc_ver to 4.8"
else
cd $curdir
exit 1
fi
fi
echo ""
echo ""
echo "You have successfully installed and configred prerequisites to be able to build an iopsys firmware"
echo ""
echo ""
cd $curdir
}
register_command "setup_host" "Install needed packets to host machine"

View 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"

View File

@@ -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 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"

View File

@@ -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

View File

@@ -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:=9b5ed4bc9f7ac5064414cf5feb510ffd95df6ec4
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))

View File

@@ -1,277 +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.
###############################################################################
# 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
upd_cfe=0 # set to 1 if system is using cfe as bootloader.
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="$cmdline -b $board"
else
cmdline="$cmdline -q"
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 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 -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 -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

View File

@@ -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

View File

@@ -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

View File

@@ -17,11 +17,11 @@ define Package/iup
SECTION:=net
CATEGORY:=Network
TITLE:=iup client
DEPENDS:=+libuci +uci +busybox
DEPENDS:=+libuci +uci +busybox
endef
define Package/iup/description
This package contains Inteno's IUP Client
This package contains Intenos IUP Client
endef
define Build/Compile

View File

@@ -31,66 +31,56 @@ 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
### Ask for IUP related DHCP options only if IUP is enabled ###
new_reqopts() {
local net=$1
local enabled
local newreqopts=
local baseopts=
local reqopts="$(uci -q get network.$net.reqopts)"
local iupopts="66 67 128 224 225 226"
local ropt iopt
config_get enabled iup enabled "on"
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
local enabled
local newreqopts=
local baseopts=
local reqopts="$(uci -q get network.wan.reqopts)"
local iupopts="66 67 128 224"
local ropt iopt
local net
config_get enabled iup enabled "on"
for ropt in $reqopts; do
case $ropt in
66|67|128|224) ;;
*) baseopts="$baseopts $ropt" ;;
esac
done
ropt=""
reqopts="$baseopts $iupopts"
for ropt in $reqopts; do
case $ropt in
66|67|128|224) [ $enabled == "on" ] && newreqopts="$newreqopts $ropt" ;;
*) newreqopts="$newreqopts $ropt" ;;
esac
done
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
echo "$newreqopts"
}
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
for net in $(management_interfaces); do
uci -q set network.$net.reqopts="$(new_reqopts $net)"
uci -q set network.$net.reqopts="$newreqopts"
done
uci commit network
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 +88,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 +98,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() {

View File

@@ -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

View File

@@ -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

View File

@@ -1,11 +1,6 @@
#!/bin/sh
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 +13,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()
@@ -62,40 +52,41 @@ get_packages()
local pack
pack=$(grep -w 'package' $1)
pack=${pack//package/}
#pack=${pack//[\'|\"]/}
echo $pack | tr -d '\"' | tr -d "'"
pack=${pack//[\'|\"]/}
echo $pack
}
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 +114,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 +134,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 +157,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,360 +221,78 @@ 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
}
# function: change_to_vlan
# arg 1 = vlan id
# arg 2 = vlan priority
# arg 3 = $INTERFACE
change_to_vlan() {
# local variables.
local name="vlan$1" # construct name = vlan + vlanid.
local base_dev # varible holding device name of wan port.
local wan_if # variable holding wan interfaces.
local new_wan_if #
###main
while [ -n "$1" ]; do
case "$1" in
# extract device name.
network_get_device base_dev $3
# bring down old interface/device.
ifdown "${base_dev}"
v "option 132: 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}
# and commit the change.
uci commit network
v "option 132: committed update to file network"
# reload configuration files.
ubus call network reload
v "option 132: reload network 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"
# loop through the string, remove any word close to "base_dev".
for word in ${wan_if}; do
#echo $word
case $word in
${base_dev}*) # don't add if.
;;
*) new_wan_if=${word}' '${new_wan_if} # add if.
#new_wan_if+=" ${word}" # probably not working in ash.
-v) export VERBOSE="$(($VERBOSE + 1))";;
-q) export VERBOSE="$(($VERBOSE - 1))";;
-*)
echo "Invalid option: $1"
exit 1
;;
*) break;;
esac
done
# append new interface.
new_wan_if=${new_wan_if}${base_dev}.${1}
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}"
shift;
done
# reboot into new if configuration.
vv "Rebooting"
export REBOOT_REASON=iup
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 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 [ "$reboot" == "on" ]; then
v "Reboot Signaled"
/sbin/reboot
}
handle_option224()
{
if [ -z "$1" ] ; then
echo "No argument"
return 1
fi
if [ $(echo $1|grep -o "," | wc -l) -eq 0 ] ; then
url=$1
else
url=$(echo $1|cut -d',' -f1)
a=$(echo $1|cut -d',' -f2)
b=$(echo $1|cut -d',' -f3)
c=$(echo $1|cut -d',' -f4)
fi
currdate=$(date +"%Y-%m-%d")
active=0
if [ -z $a ] ; then
active=1
elif [ $a ] && [ $b ] && [ $a -lt 25 ] ; then
#Time
begin=$(date +%s -d"$currdate $a")
now=$(date +%s)
end=$((begin+3600*$b))
if [ $now -gt $begin ] && [ $now -lt $end ] ; then
active=1
fi
elif [ $a ] && [ $b ] && [ $c ] && [ $a -gt 25 ] ; then
#Date
y=$(echo $a| cut -c1-4)
m=$(echo $a| cut -c5-6)
d=$(echo $a| cut -c7-8)
begin=$(date +%s -d"$y-$m-$d $b")
now=$(date +%s)
end=$((begin+3600*$c))
if [ $now -gt $begin ] && [ $now -lt $end ] ; then
active=1
fi
else
echo "Bad format"
return 1
fi
softwareminuspath=${url##*/}
if [ $url ] && [ $active -eq 1 ]; then
v "Software version to download \"$softwareminuspath\""
local sysinfo=$(ubus call router.system info)
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\""
wait_for_dns $url
v "Start flashing"
/sbin/sysupgrade -v $url &
return 1
else
v "Firmware is up to date, nothing to do"
return 0
fi
fi
}
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
local tftp bootfile vlanid vlanpriority interface
json_load "$the_json"
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 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
if [ $privopt224 ]; then
v "dhcp option 224 firmware url $privopt224"
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
uci_set_state provisioning iup urliup "tftp://$tftp/$bootfile"
fi
fi
# vlanid (and vlanpriority)
if [ -n "$vlanid" -a -n "$vlanpriority" ]; then
v "dhcp option 132 vlanid: ${vlanid} vlanpriority: ${vlanpriority}"
change_to_vlan ${vlanid} ${vlanpriority} ${interface}
elif [ -n "$vlanid" ]; then
v "dhcp option 132 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
fi
config_load provisioning
config_foreach handle_provisioning subconfig "0"
config_get software uppgradeserver url
sofwareminuspath=${software##*/}
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
fi
if [ $CONF -eq 1 ]; then
mv "$IUPMD5.temp" $IUPMD5
fi
if [ "$reboot" == "on" ]; then
vv "Rebooting"
export REBOOT_REASON=iup
/sbin/reboot
fi
rm -rf /var/run/iup.pid
}
main $@
fi
rm -rf /var/run/iup.pid

72
iup/files/sbin/iup224 Executable file
View File

@@ -0,0 +1,72 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/network/config.sh
if [ -z $1 ] ; then
echo "No argument"
exit 1
fi
if [ $(echo $1|grep -o "," | wc -l) -eq 0 ] ; then
url=$1
else
url=$(echo $1|cut -d',' -f1)
a=$(echo $1|cut -d',' -f2)
b=$(echo $1|cut -d',' -f3)
c=$(echo $1|cut -d',' -f4)
fi
echo "url" $url
echo "a" $a
echo "b" $b
echo "c" $c
currdate=$(date +"%Y-%m-%d")
active=0
if [ -z $a ] ; then
active=1
elif [ $a ] && [ $b ] && [ $a -lt 25 ] ; then
#Time
begin=$(date +%s -d"$currdate $a")
now=$(date +%s)
end=$((begin+3600*$b))
if [ $now -gt $begin ] && [ $now -lt $end ] ; then
active=1
fi
elif [ $a ] && [ $b ] && [ $c ] && [ $a -gt 25 ] ; then
#Date
y=$(echo $a| cut -c1-4)
m=$(echo $a| cut -c5-6)
d=$(echo $a| cut -c7-8)
begin=$(date +%s -d"$y-$m-$d $b")
now=$(date +%s)
end=$((begin+3600*$c))
if [ $now -gt $begin ] && [ $now -lt $end ] ; then
active=1
fi
else
echo "Bad format"
exit 1
fi
softwareminuspath=${url##*/}
if [ $url ] && [ $active -eq 1 ]; then
echo "Software version to download $softwareminuspath"
local sysinfo=$(ubus call router quest "{ \"info\": \"system\" }")
json_load "$sysinfo"
json_get_var firmware firmware
local firmware_new=${softwareminuspath%.*} # remove extension (.w, .y or .y2) from filename
if [ "$firmware_new" != "$firmware" ] ; then
echo "Image found $url will start flashing"
wait_for_dns $url
/sbin/sysupgrade -v $url &
exit 1
else
echo "Will not update software, already up to date"
exit 0
fi
fi

View File

@@ -1,6 +1,6 @@
#!/bin/sh /etc/rc.common
START=10
START=01
STOP=99
USE_PROCD=1

View File

@@ -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
View 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))

View 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'

View 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'

View File

@@ -0,0 +1,2 @@
config ethernet_interface 'Wan'

View File

@@ -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'

View 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

View 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
}

View 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 $ret $ret
xtmctl operate conn --addq 1.$vpi.$vci 0 wrr 1
xtmctl operate conn --addq 1.$vpi.$vci 7 wrr 1 # fixes pppoe disconnect issue
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
}

View 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
}

View 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
}

View 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
}

View File

@@ -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

View File

@@ -0,0 +1,300 @@
wlmngr_setupTPs() {
local pid_nic0=$(pgrep wl0-kthrd)
local pid_nic1=$(pgrep wl1-kthrd)
local pid_dhd0=$(pgrep dhd0_dpc)
local pid_dhd1=$(pgrep dhd1_dpc)
local pid_wfd0=$(pgrep wfd0-thrd)
local pid_wfd1=$(pgrep wfd1-thrd)
local pid_wl0=${pid_dhd0:-$pid_nic0}
local pid_wl1=${pid_dhd1:-$pid_nic1}
# set affinity
if [ -n "$pid_wl0" -a -n "$pid_wl1" ]; then
# bind to TP0
taskset -p 1 $pid_wl0
# bind to TP1
taskset -p 2 $pid_wl1
else
if [ "$pid_wl0" == "$pid_dhd0" ]; then
# bind to TP0
taskset -p 1 $pid_wl0
else
# bind to TP1
taskset -p 2 $pid_wl0
fi
fi
# set priority
local pid pids
pids="$pid_wl0 $pid_wl1 $pid_wfd0 $pid_wfd1"
for pid in $pids; do
chrt -rp 5 $pid
done
}
wlmngr_stopServices() {
local idx=$1
killall -q -9 lld2d 2>/dev/null
killall -q -9 wps_ap 2>/dev/null
killall -q -9 wps_enr 2>/dev/null
killall -q -15 wps_monitor 2>/dev/null # Kill Child Thread first, -15: SIGTERM to force to remove WPS IE
killall -15 bcmupnp 2>/dev/null # -15: SIGTERM, force bcmupnp to send SSDP ByeBye message out (refer to CR18802)
rm -rf /var/bcmupnp.pid
killall -q -9 nas 2>/dev/null
killall -q -9 eapd 2>/dev/null
killall -q -9 acsd 2>/dev/null
nvram unset acs_ifnames # remove wlidx only
killall -q -15 wapid
killall -q -15 hspotap
killall -q -15 bsd
killall -q -15 ssd
killall -q -9 vis-datacollector
killall -q -9 vis-dcon
}
wlmngr_WlConfDown() {
local idx=$1
wlconf wl$idx down
wlctl -i wl$idx chanspec 36/80
}
wlmngr_setSsid() {
# local idx=$1
# for vif in $(nvram get "wl$idx"_vifs); do
# wlctl -i wl$idx ssid -C $vifno $(nvram get "$vif"_ssid)
# done
return
}
wlmngr_wlIfcDown() {
local idx=$1
for vif in wl$idx $(nvram get "wl$idx"_vifs); do
ifconfig $vif down
done
}
wlmngr_doWlConf() {
local idx=$1;
#wlctl -i wl$idx nreqd $nreqd
wlconf wl$idx up
}
wlmngr_setupMbssMacAddr() {
local idx=$1
local hwaddr
for vif in $(nvram get "wl$idx"_vifs); do
hwaddr=$(nvram get "$vif"_hwaddr)
ifconfig $vif hw ether $hwaddr 2>/dev/null
wlctl -i $vif cur_etheraddr $hwaddr 2>/dev/null
done
}
#enableBSD() {
# nvram_set bsd_role=0
# [ act_wl_cnt == 0 ] && return FALSE
# for i in wl0 wl1; do
# if [ m_instance_wl[i].m_wlVar.wlEnbl == TRUE && m_instance_wl[i].m_wlVar.bsdRole > 0 ]; then
# nvram set bsd_role=m_instance_wl[i].m_wlVar.bsdRole
# nvram set bsd_pport=m_instance_wl[i].m_wlVar.bsdPport
# nvram set bsd_hpport=m_instance_wl[i].m_wlVar.bsdHport
# nvram set bsd_helper=m_instance_wl[i].m_wlVar.bsdHelper
# nvram set bsd_primary=m_instance_wl[i].m_wlVar.bsdPrimary
# return TRUE
# fi
# done
# return FALSE
#}
#enableSSD() {
# nvram set ssd_enable=0
# [ act_wl_cnt == 0 ] && return FALSE
# for i in wl0 wl1; do
# if [ m_instance_wl[i].m_wlVar.wlEnbl == TRUE && m_instance_wl[i].m_wlVar.ssdEnable > 0 ]; then
# nvram set ssd_enable=m_instance_wl[i].m_wlVar.ssdEnable
# return TRUE
# fi
# done
# return FALSE
#}
wlmngr_startServices() {
local idx=$1
#bcmupnp -D
lld2d br-lan # $(nvram get lan_ifname)
eapd
nas
acsd
# wlmngr_startWsc() {
# return
# }
# wlmngr_startSes() {
# if [ m_instance_wl[idx].m_wlVar.wlSesEnable == FALSE ]; then
# return
# fi
# ses -f
# }
# wlmngr_startSesCl() {
# if [ m_instance_wl[idx].m_wlVar.wlSesClEnable == FALSE ]; then
# return
# fi
# ses_cl -f
# }
# wapid
# wlmngr_BSDCtrl() {
# killall -q -15 bsd 2>/dev/null
# if [ "$(enableBSD)" == "TRUE" ]; then
# bsd&
# fi
# }
# wlmngr_SSDCtrl(){
# killall -q -15 ssd 2>/dev/null
# if [ "$(enableSSD)" == "TRUE" ]; then
# ssd&
# fi
# }
}
wlmngr_startWsc()
{
local idx=$1
local wlunit
wlunit=$(nvram get wl_unit)
[ -n $wlunit ] && nvram set wl_unit=0
nvram set wps_mode=enabled # "enabled/disabled"
nvram set wl_wps_config_state=1 # "1/0"
nvram set wl_wps_reg="enabled"
nvram set lan_wps_reg=enabled #"enabled/disabled"
nvram set wps_uuid=0x000102030405060708090a0b0c0d0ebb
nvram set wps_device_name=BroadcomAP
nvram set wps_mfstring=Broadcom
nvram set wps_modelname=Broadcom
nvram set wps_modelnum=123456
nvram set boardnum=1234
nvram set wps_timeout_enable=0
#nvram get wps_config_method
nvram set wps_version2=enabled # extra
nvram set lan_wps_oob=disabled # extra
nvram set lan_wps_reg=enabled # extra
if [ "$(nvram get wps_version2)" == "enabled" ]; then
nvram set _wps_config_method=sta-pin
else
nvram set _wps_config_method=pbc
fi
nvram set wps_config_command=0
nvram set wps_status=0
nvram set wps_method=1
nvram set wps_proc_mac=""
if [ "$(nvram get wps_restart)" == "1" ]; then
nvram set wps_restart=0
else
nvram set wps_restart=0
nvram set wps_proc_status=0
fi
nvram set wps_sta_pin=00000000
nvram set wps_currentband=""
nvram set wps_autho_sta_mac="00:00:00:00:00:00"
wps_monitor&
}
wlmngr_issueWpsCmd() {
return
}
wlmngr_WlConfStart() {
local idx=$1
wlconf wl$idx up
}
wlmngr_wlIfcUp() {
local idx=$1
for vif in wl$idx $(nvram get "wl$idx"_vifs); do
if [ "$(nvram get "$vif"_bss_enabled)" == "1" ]; then
ifconfig $vif up 2>/dev/null
wlctl -i $vif bss up # extra
else
ifconfig $vif down
fi
done
}
wlmngr_doWds() {
return
}
wlmngr_doQoS() {
local idx=$1
for vif in wl$idx $(nvram get "wl$idx"_vifs); do
ebtables -t nat -D POSTROUTING -o $vif -p IPV4 -j wmm-mark 2>/dev/null
ebtables -t nat -D POSTROUTING -o $vif -p IPV6 -j wmm-mark 2>/dev/null
ebtables -t nat -D POSTROUTING -o $vif -p 802_1Q -j wmm-mark --wmm-marktag vlan 2>/dev/null
if [ "$(nvram get "$vif"_bss_enabled)" == "1" ]; then
ebtables -t nat -A POSTROUTING -o $vif -p IPV4 -j wmm-mark 2>/dev/null
ebtables -t nat -A POSTROUTING -o $vif -p IPV6 -j wmm-mark 2>/dev/null
ebtables -t nat -A POSTROUTING -o $vif -p 802_1Q -j wmm-mark --wmm-marktag vlan 2>/dev/null
fi
done
}
wlmngr_finalize() {
local idx=$1
wlctl -i wl$idx phy_watchdog 1
wlctl -i wl$idx fcache 1
# RADAR THRESHOLD VALUES #
local pcid="$(wlctl -i wl$idx revinfo | awk 'FNR == 2 {print}' | cut -d'x' -f2)"
# local isac="$(db get hw.$pcid.is_ac)"
# if [ "$isac" == "1" ]; then
# wlctl -i $device msglevel +radar +dfs
# fi
local rdrthrs="$(db get hw.$pcid.radarthrs)"
if [ -n "$rdrthrs" ]; then
wlctl -i wl$idx radarthrs $rdrthrs
fi
# send ARP packet with bridge IP and hardware address to device
# this piece of code is -required- to make br-lan's mac work properly
# in all cases
sendarp -s br-lan -d br-lan
}
wlmngr_issueServiceCmd() {
return
}
wlmngr_HspotCtrl() {
killall -q -15 hspotap 2>/dev/null
if [ "$(enableHspot)" == "TRUE" ]; then
hspotap&
fi
}
wlmngr_postStart() {
return
}

View File

@@ -0,0 +1,42 @@
#!/bin/sh
remove_ebtables_bridge_rules ()
{
ebtables -D FORWARD -p ip --ip-protocol 17 --ip-destination-port 68 -j SKIPLOG 2>/dev/null
ebtables -D FORWARD -p ip --ip-destination 255.255.255.255 -j SKIPLOG 2>/dev/null
}
#bypass fap acceleration forwarding for dhcp in bridge mode
create_ebtables_bridge_rules ()
{
ebtables -A FORWARD -p ip --ip-protocol 17 --ip-destination-port 68 -j SKIPLOG
ebtables -A FORWARD -p ip --ip-destination 255.255.255.255 -j SKIPLOG
}
# is called when a Wifi SSID is enabled with wme, which automatically
# enables its QoS queues
remove_ebtables_wme_rules ()
{
local wifi_int=$1
ebtables -t nat -D POSTROUTING -o $wifi_int -p IPV4 -j wmm-mark 2>/dev/null
ebtables -t nat -D POSTROUTING -o $wifi_int -p IPV6 -j wmm-mark 2>/dev/null
ebtables -t nat -D POSTROUTING -o $wifi_int -p 802_1Q -j wmm-mark --wmm-marktag vlan 2>/dev/null
}
add_ebtables_wme_rules ()
{
local wifi_int=$1
ebtables -t nat -A POSTROUTING -o $wifi_int -p IPV4 -j wmm-mark >/dev/null
ebtables -t nat -A POSTROUTING -o $wifi_int -p IPV6 -j wmm-mark >/dev/null
ebtables -t nat -A POSTROUTING -o $wifi_int -p 802_1Q -j wmm-mark --wmm-marktag vlan >/dev/null
}
add_ebtables_default_arp ()
{
ebtables -t nat -A POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
}
remove_ebtables_default_arp ()
{
ebtables -t nat -D POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
}

View File

@@ -0,0 +1,219 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/network/ebtables.sh
removeall_vlandevices()
{
local vif
local i
for i in `ls /proc/sys/net/ipv4/conf`; do
case "$i" in
[eap][t][mh][0-9].v1)
;;
[eap][t][mh][0-9].1)
;;
[eap][t][mh][0-9].[v0-9]*)
vlanctl --if-delete $i
;;
esac
done
}
removevlan()
{
vlanctl --if-delete $1
}
ifvlanexits()
{
local vif=$1
local i
for i in `ls /proc/sys/net/ipv4/conf`; do
if [ "$i" == "$vif" ]; then
return 1
fi
done
return 0
}
ifbaseexists ()
{
local if=$1
if [ -d /sys/class/net/$if ]; then
ifcarrier="/sys/class/net/$if/carrier"
if [ -f $ifcarrier ] && [ "$(cat $ifcarrier)" == "1" ]; then
return 1
else
json_load "$(devstatus "$if")"
json_get_var link link
if [ "$link" == "1" ]; then
return 1
fi
fi
fi
return 0
}
addbrcmvlan ()
{
local baseifname=$1
local vlan8021p=$2
local vlan8021q=$3
local bridge=$4
local ifname=$5
#local ifname=$4
#config_get baseifname $1 baseifname
#config_get vlan8021p $1 vlan8021p
#config_get vlan8021q $1 vlan8021q
ifbaseexists $baseifname
ret=$?
if [ "$ret" -eq 1 ]; then
ifvlanexits "$ifname"
ret=$?
echo "first ret=$ret"
if [ "$ret" -eq 0 ]; then
ifconfig $baseifname up
echo "vlanctl --if-create $ifname" > /dev/console
local unmanaged=0
local nets net typ proto
nets=$(get_network_of "$ifname")
for net in $nets; do
typ=$(uci -q get network."$net".type)
proto=$(uci -q get network."$net".proto)
proto="${proto:-none}"
if [ "$typ" == "bridge" -a "$proto" == "none" ]; then
unmanaged=1
break
fi
done
echo '1' > /proc/sys/net/ipv6/conf/$baseifname/disable_ipv6
ifconfig $baseifname up
if [ "x$bridge" = "x" ]; then
bridge=0
fi
if [ "$bridge" -eq 1 ]; then
if [ "$unmanaged" == "1" ]; then
vlanctl --if-create $baseifname $vlan8021q
else
vlanctl --dhcp-bridged --if-create $baseifname $vlan8021q
fi
else
vlanctl --routed --if-create $baseifname $vlan8021q
fi
if [ "$bridge" -eq 1 ]; then
vlanctl --if $baseifname --set-if-mode-rg
vlanctl --if $baseifname --tx --tags 0 --default-miss-drop
vlanctl --if $baseifname --tx --tags 1 --default-miss-drop
vlanctl --if $baseifname --tx --tags 2 --default-miss-drop
# tags 0 tx
vlanctl --if $baseifname --tx --tags 0 --filter-txif $ifname --push-tag --set-vid $vlan8021q 0 --set-pbits $vlan8021p 0 --rule-insert-before -1
# tags 1 tx
vlanctl --if $baseifname --tx --tags 1 --filter-txif $ifname --push-tag --set-vid $vlan8021q 0 --set-pbits $vlan8021p 0 --rule-insert-before -1
# tags 2 tx
vlanctl --if $baseifname --tx --tags 2 --filter-txif $ifname --push-tag --set-vid $vlan8021q 0 --set-pbits $vlan8021p 0 --rule-insert-before -1
# tags 1 rx
vlanctl --if $baseifname --rx --tags 1 --filter-vid $vlan8021q 0 --pop-tag --set-rxif $ifname --rule-insert-before -1
# tags 2 rx
vlanctl --if $baseifname --rx --tags 2 --filter-vid $vlan8021q 0 --pop-tag --set-rxif $ifname --rule-insert-before -1
else
vlanctl --if $baseifname --set-if-mode-rg
vlanctl --if $baseifname --tx --tags 0 --default-miss-drop
vlanctl --if $baseifname --tx --tags 1 --default-miss-drop
vlanctl --if $baseifname --tx --tags 2 --default-miss-drop
# tags 0 tx
vlanctl --if $baseifname --tx --tags 0 --filter-txif $ifname --push-tag --set-vid $vlan8021q 0 --set-pbits $vlan8021p 0 --rule-insert-before -1
# tags 0 rx
vlanctl --if $baseifname --rx --tags 0 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
# tags 1 rx
vlanctl --if $baseifname --rx --tags 1 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
# tags 2 rx
vlanctl --if $baseifname --rx --tags 2 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
# tags 1 rx
vlanctl --if $baseifname --rx --tags 1 --filter-vlan-dev-mac-addr 1 --filter-vid $vlan8021q 0 --pop-tag --set-rxif $ifname --rule-insert-before -1
# tags 2 rx
vlanctl --if $baseifname --rx --tags 2 --filter-vlan-dev-mac-addr 1 --filter-vid $vlan8021q 0 --pop-tag --set-rxif $ifname --rule-insert-before -1
fi
ifconfig $ifname up
ifconfig $ifname multicast
fi
fi
}
brcm_virtual_interface_rules ()
{
local baseifname=$1
local ifname=$2
local bridge=$3
local unmanaged=0
local nets net typ proto
nets=$(get_network_of "$ifname")
for net in $nets; do
typ=$(uci -q get network."$net".type)
proto=$(uci -q get network."$net".proto)
proto="${proto:-none}"
if [ "$typ" == "bridge" -a "$proto" == "none" ]; then
unmanaged=1
break
fi
done
echo '1' > /proc/sys/net/ipv6/conf/$baseifname/disable_ipv6
ifconfig $baseifname up
if [ "x$bridge" = "x" ]; then
bridge=0
fi
if [ "$bridge" -eq 1 ]; then
if [ "$unmanaged" == "1" ]; then
vlanctl --if-create-name $baseifname $ifname
else
vlanctl --dhcp-bridged --if-create-name $baseifname $ifname
fi
else
vlanctl --routed --if-create-name $baseifname $ifname
fi
[ "$bridge" -eq 1 ] && create_ebtables_bridge_rules
#set default RG mode
vlanctl --if $baseifname --set-if-mode-rg
#Set Default Droprules
vlanctl --if $baseifname --tx --tags 0 --default-miss-drop
vlanctl --if $baseifname --tx --tags 1 --default-miss-drop
vlanctl --if $baseifname --tx --tags 2 --default-miss-drop
vlanctl --if $baseifname --tx --tags 0 --filter-txif $ifname --rule-insert-before -1
if [ "$bridge" -eq 1 ]; then
# tags 1 tx
vlanctl --if $baseifname --tx --tags 1 --filter-txif $ifname --rule-insert-before -1
# tags 2 tx
vlanctl --if $baseifname --tx --tags 2 --filter-txif $ifname --rule-insert-before -1
# tags 0 rx
vlanctl --if $baseifname --rx --tags 0 --set-rxif $ifname --rule-insert-last
# tags 1 rx
vlanctl --if $baseifname --rx --tags 1 --set-rxif $ifname --rule-insert-last
# tags 2 rx
vlanctl --if $baseifname --rx --tags 2 --set-rxif $ifname --rule-insert-last
else
# tags 1 rx
vlanctl --if $baseifname --rx --tags 1 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
# tags 2 rx
vlanctl --if $baseifname --rx --tags 2 --set-rxif $ifname --filter-vlan-dev-mac-addr 0 --drop-frame --rule-insert-before -1
# tags 0 rx
vlanctl --if $baseifname --rx --tags 0 --set-rxif $ifname --filter-vlan-dev-mac-addr 1 --rule-insert-before -1
fi
ifconfig $ifname up
ifconfig $ifname multicast
}

View File

@@ -48,7 +48,7 @@ endef
define Package/libcgroup-daemon
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+libcgroup +librt
DEPENDS:=+libcgroup
TITLE:=Control group management daemon
URL:=https://sourceforge.net/p/libcg/
endef

View File

@@ -1,52 +0,0 @@
# Copyright (C) 2018 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libjwt
PKG_VERSION:=1.0.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=866607c7741421c8ac99876e7201eb32d9af1b92
PKG_SOURCE_URL:=https://github.com/benmcollins/libjwt.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
define Package/libjwt
CATEGORY:=Libraries
DEPENDS:=+libopenssl +jansson
TITLE:= libjwt
endef
#TARGET_CFLAGS += \
# -I$(STAGING_DIR)/usr/include
# -I$(STAGING_DIR)/usr/include/libnl3
#MAKE_FLAGS += \
# CFLAGS="$(TARGET_CFLAGS)" \
# LDFLAGS="$(TARGET_LDFLAGS)" \
# FPIC="$(FPIC)" \
# PLATFORM="$(TARGET_PLATFORM)" \
# subdirs="$(subdirs)"
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/include/jwt.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libjwt/.libs/libjwt.so* $(1)/usr/lib/
endef
define Package/libjwt/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libjwt/.libs/libjwt.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libjwt))

View File

@@ -1,42 +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_URL:=https://dev.iopsys.eu/iopsys/libpicoevent.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=7875222706cb6999af0361ef0aebdc85cd75c127
PKG_NAME:=libpicoevent
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/libpicoevent
CATEGORY:=Libraries
TITLE:=Libpicoevent
URL:=
DEPENDS:=
endef
define Package/libpicoevent/description
Minimal event library
endef
define Package/libpicoevent/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(STAGING_DIR)/usr/lib
$(INSTALL_DIR) $(STAGING_DIR)/usr/include
$(CP) $(PKG_BUILD_DIR)/libpicoevent.h $(STAGING_DIR)/usr/include
$(CP) $(PKG_BUILD_DIR)/libpicoevent.so $(STAGING_DIR)/usr/lib
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libpicoevent.so $(1)/usr/lib
endef
$(eval $(call BuildPackage,libpicoevent))

View File

@@ -1,84 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libtrace
PKG_VERSION:=3.0.22
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/apietila/libtrace.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_VERSION:=e4b4c5cce35a52da152776a00532aa0b80879c5b
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/uclibc++.mk
include $(INCLUDE_DIR)/package.mk
define Package/libtrace/Default
SECTION:=net
CATEGORY:=Network
TITLE:=Libtrace library for packet trace processing
URL:=http://research.wand.net.nz/software/libtrace.php
endef
define Package/libtrace
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Libtrace library for packet trace processing
URL:=http://research.wand.net.nz/software/libtrace.php
DEPENDS:=+libpcap +libpthread +zlib +libbz2 +liblzo +librt $(CXX_DEPENDS)
endef
define Package/libtrace/description
Network trace processing library for trace processing. Supports multiple
input methods, including device capture, raw and gz-compressed
trace, and sockets.
endef
define Package/libtrace-tools
SECTION:=net
CATEGORY:=Network
TITLE:=Libtrace tools for packet trace processing
URL:=http://research.wand.net.nz/software/libtrace.php
DEPENDS:=+libncurses +libtrace
endef
define Package/libtrace-tools/description
Network trace processing tools for trace processing.
endef
CONFIGURE_ARGS += \
--with-bzip2 \
--with-zlib \
--with-lzo \
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtrace.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libwandio.{a,so*} $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump.{a,so*} $(1)/usr/lib/
endef
define Package/libtrace/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libtrace.so.* $(1)/usr/lib/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libwandio.so.* $(1)/usr/lib/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump.so.* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/libpacketdump
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump/*.so* $(1)/usr/lib/libpacketdump/
endef
define Package/libtrace-tools/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{traceanon,tracediff,traceends,tracepktdump,tracereplay,tracereport,tracertstats,tracesplit,tracestats} $(1)/usr/bin/
endef
$(eval $(call BuildPackage,libtrace))
$(eval $(call BuildPackage,libtrace-tools))

View File

@@ -1,122 +0,0 @@
#
# Copyright (C) 2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=lmbench
PKG_VERSION:=3.0-a9
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=@SF/lmbench/
PKG_MD5SUM:=b3351a3294db66a72e2864a199d37cbf
PKG_BUILD_DEPENDS:=librpc
include $(INCLUDE_DIR)/package.mk
define Package/lmbench
SECTION:=utils
CATEGORY:=Utilities
TITLE:=lmbench microbenchmarks
URL:=http://sourceforge.net/projects/lmbench
MENU:=1
endef
define Package/lmbench/description
lmbench is a series of micro benchmarks intended to measure basic operating
system and hardware system metrics.
endef
define Package/lmbench/install
true
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/src \
CC="$(TARGET_CC)" \
AR="$(TARGET_CROSS)ar" \
OS="$(ARCH)" \
BASE="$(PKG_INSTALL_DIR)" \
LDLIBS="-lrpc" \
COMPILE="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(TARGET_LDFLAGS)" \
lmbench install
endef
define PartGen
define Package/lmbench-$(subst _,-,$(1))
SECTION:=utils
CATEGORY:=Utilities
TITLE:=$(1) microbenchmark
URL:=http://sourceforge.net/projects/lmbench
DEPENDS:=lmbench +librpc
endef
endef
define PartInstall
define Package/lmbench-$(subst _,-,$(1))/install
$(INSTALL_DIR) $$(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/$(1) $$(1)/usr/sbin/$(1)
endef
endef
LMBENCH_FILES:= \
bw_file_rd \
bw_mem \
bw_mmap_rd \
bw_pipe \
bw_tcp \
bw_unix \
cache \
disk \
enough \
flushdisk \
hello \
lat_cmd \
lat_connect \
lat_ctx \
lat_dram_page \
lat_fcntl \
lat_fifo \
lat_fs \
lat_http \
lat_mem_rd \
lat_mmap \
lat_ops \
lat_pagefault \
lat_pipe \
lat_pmake \
lat_proc \
lat_rand \
lat_rpc \
lat_select \
lat_sem \
lat_sig \
lat_syscall \
lat_tcp \
lat_udp \
lat_unix \
lat_unix_connect \
lat_usleep \
line \
lmdd \
lmhttp \
loop_o \
memsize \
mhz \
msleep \
par_mem \
par_ops \
stream \
timing_o \
tlb
$(foreach file,$(LMBENCH_FILES),$(eval $(call PartGen,$(file))))
$(foreach file,$(LMBENCH_FILES),$(eval $(call PartInstall,$(file))))
$(eval $(call BuildPackage,lmbench))
$(foreach file,$(LMBENCH_FILES),$(eval $(call BuildPackage,lmbench-$(subst _,-,$(file)))))

View File

@@ -1,11 +0,0 @@
--- a/src/bench.h
+++ b/src/bench.h
@@ -77,7 +77,7 @@ typedef long long int64;
#endif /* HAVE_int64_t */
#endif /* HAVE_int64 */
-#ifndef HAVE_socklen_t
+#if (!defined(HAVE_socklen_t) && !defined(__socklen_t_defined))
typedef int socklen_t;
#endif

View File

@@ -1,10 +0,0 @@
--- a/src/Makefile
+++ b/src/Makefile
@@ -144,6 +144,7 @@ install-target:
if [ ! -d $(BASE)/include ]; then mkdir $(BASE)/include; fi
if [ ! -d $(BASE)/lib ]; then mkdir $(BASE)/lib; fi
cp $(EXES) $(BASE)/bin
+ cp $(OPT_EXES) $(BASE)/bin
cp $(INCS) $(BASE)/include
cp $O/lmbench.a $(BASE)/lib/libmbench.a
cd ../doc; env MAKEFLAGS="$(MAKEFLAGS)" make CC="${CC}" OS="${OS}" BASE="$(BASE)" install

View File

@@ -1,30 +0,0 @@
--- a/scripts/build
+++ b/scripts/build
@@ -18,7 +18,7 @@ done
trap 'rm -f ${BASE}$$.s ${BASE}$$.c ${BASE}$$.o ${BASE}$$; exit 1' 1 2 15
-LDLIBS=-lm
+LDLIBS=${LDLIBS-"-lm -lrpc"}
# check for HP-UX's ANSI compiler
echo "main(int ac, char *av[]) { int i; }" > ${BASE}$$.c
--- a/src/Makefile
+++ b/src/Makefile
@@ -38,6 +38,7 @@ CC=`../scripts/compiler`
MAKE=`../scripts/make`
AR=ar
ARCREATE=cr
+LDLIBS=
# base of installation location
BASE=/usr/local
@@ -111,7 +112,7 @@ LIBOBJS= $O/lib_tcp.o $O/lib_udp.o $O/li
$O/lib_sched.o
lmbench: $(UTILS)
- @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build all
+ @env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" LDLIBS="$(LDLIBS)" ../scripts/build all
-@env CFLAGS=-O MAKE="$(MAKE)" MAKEFLAGS="k$(MAKEFLAGS)" CC="$(CC)" OS="$(OS)" ../scripts/build opt
results: lmbench

Some files were not shown because too many files have changed in this diff Show More