mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-28 23:29:17 +08:00
Compare commits
31 Commits
iup_change
...
4.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ad0074feb | ||
|
|
686d0136d7 | ||
|
|
2a1bd9f5fe | ||
|
|
bf43c42979 | ||
|
|
202bc9e3a0 | ||
|
|
44c2a71e5d | ||
|
|
658c4fb2c4 | ||
|
|
f5ffbc4b1f | ||
|
|
f51d16c2eb | ||
|
|
f7727f045c | ||
|
|
c17344d56f | ||
|
|
216ced880c | ||
|
|
39a004eb4b | ||
|
|
d41f784794 | ||
|
|
c7728860b4 | ||
|
|
f109c662e0 | ||
|
|
af708cad74 | ||
|
|
2135dead70 | ||
|
|
e4392950b0 | ||
|
|
cac8b6a97a | ||
|
|
d0207ff6da | ||
|
|
e45395560a | ||
|
|
1bce24b26d | ||
|
|
6ef0eccab2 | ||
|
|
02bd873096 | ||
|
|
0031a8a4e4 | ||
|
|
229f240c8a | ||
|
|
d589e7034e | ||
|
|
344c9c4813 | ||
|
|
a9529bc199 | ||
|
|
2047bd7fbb |
@@ -1,4 +0,0 @@
|
||||
|
||||
config ENDPT_OPEN
|
||||
bool "Use pre-compiled version for Open SDK"
|
||||
default n
|
||||
@@ -9,53 +9,31 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.1
|
||||
PKG_SOURCE_VERSION:=fa9ba5d7c942571ae6e44eb7bb5dae2c9b9e8ca4
|
||||
|
||||
|
||||
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@private.inteno.se:endptmngr
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_VERSION:=e14f741c9c7ecdc6584ce109bed22d3f85a29a16
|
||||
PKG_NAME:=endptmngr
|
||||
endif
|
||||
|
||||
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/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
|
||||
DEPENDS:= +libubox +ubus +libpicoevent
|
||||
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/
|
||||
|
||||
@@ -19,14 +19,14 @@ 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.0.3
|
||||
BASE_PKG_VERSION:=5.1.9
|
||||
PKG_RELEASE:=RC5
|
||||
PKG_VERSION:=$(BASE_PKG_VERSION)-$(PKG_RELEASE)_$(DATE)_$(LOGIN)
|
||||
export PKG_VERSION
|
||||
|
||||
###########################--RELEASE--################################
|
||||
|
||||
PKG_SOURCE_VERSION:=a7f40bfd47d0ce3f3c002460e3c83ffc821ac1e4
|
||||
PKG_SOURCE_VERSION:=3002de0a3511f7da0fe20c3f183212a84aa964bf
|
||||
ifeq ($(CONFIG_ICE_OPEN),y)
|
||||
TARGET_PROFILE=$(shell echo $(CONFIG_TARGET_BOARD) | sed s/\"//g)
|
||||
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
|
||||
@@ -132,12 +132,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
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
if PACKAGE_libdatamodel
|
||||
choice
|
||||
prompt "Select Data Model"
|
||||
default tr098
|
||||
|
||||
config DATAMODEL_TR098
|
||||
bool "TR-098"
|
||||
|
||||
config DATAMODEL_TR181
|
||||
bool "TR-181"
|
||||
endchoice
|
||||
|
||||
config UPNP_TR064
|
||||
bool "Compile with tr064 features"
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=4.0-2018-04-20
|
||||
PKG_VERSION:=4.0-2018-02-12
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=1c6398191a9269c8e885ef78c21b4bd5b618a2fb
|
||||
PKG_SOURCE_VERSION:=81a05e57b242a82781301d0bd132bd88a14c131e
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -111,7 +111,9 @@ 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,6 +160,8 @@ define Package/icwmp-$(BUILD_VARIANT)/install
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(CP) ./files/icwmp.hotplug $(1)/etc/hotplug.d/iface/90-icwmp
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmpd.init $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/90-cwmpfirewall
|
||||
ifeq ($(CONFIG_CWMP_SCRIPTS_FULL),y)
|
||||
@@ -167,7 +171,6 @@ ifeq ($(CONFIG_CWMP_SCRIPTS_FULL),y)
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/icwmp.sh $(1)/usr/sbin/icwmp
|
||||
endif
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
|
||||
@@ -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
|
||||
@@ -6,7 +6,16 @@
|
||||
|
||||
[ -f /etc/config/cwmp ] || exit 0
|
||||
|
||||
handle_icwmp_reload() {
|
||||
handle_icwmp_restart() {
|
||||
[ -f /tmp/70-shiftrange.lock ] && exit 0
|
||||
[ -f /tmp/switching_mode ] && exit 0
|
||||
[ -f /tmp/wificontrol.txt -a ! -f /tmp/netmode_done ] && 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
|
||||
|
||||
@@ -41,17 +50,16 @@ handle_icwmp_reload() {
|
||||
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
|
||||
|
||||
[ "$previpaddr" = "$curipaddr" -a "$prevgateway" = "$curgateway" -a "$prevsubnets" = "$cursubnets" -a "$prevdnsservers" = "$curdnsservers" ] && exit 0
|
||||
[ "$prevdev" == "$curdev" -a "$previpaddr" = "$curipaddr" -a "$prevgateway" = "$curgateway" -a "$prevsubnets" = "$cursubnets" ] && exit 0
|
||||
|
||||
/etc/init.d/icwmpd reload &
|
||||
}
|
||||
|
||||
handle_icwmp_reload
|
||||
|
||||
handle_icwmp_restart
|
||||
@@ -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:=http://public.inteno.se/imonitor.git
|
||||
PKG_SOURCE_VERSION:=defec6849fb987619fc7fd9295895f4f0b9db5a9
|
||||
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))
|
||||
@@ -1,8 +0,0 @@
|
||||
config monitor
|
||||
option app 'test'
|
||||
option test 'echo test'
|
||||
option stream 'stdout'
|
||||
option string_match 'test'
|
||||
option execute 'echo executing'
|
||||
option interval '10'
|
||||
option nr_tests '2'
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Start the imonitor
|
||||
#
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=imonitor
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "imonitor"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop imonitor
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=inteno-netmodes
|
||||
PKG_VERSION:=0.2.0
|
||||
|
||||
PKG_SOURCE_VERSION:=e43701f76ba2a8699df797d88fffc3895a3bfeb8
|
||||
PKG_SOURCE_VERSION:=fbd7dcfab03df19b3c32675940e0aee708c7cf75
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/netmoded
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
. /lib/functions/network.sh
|
||||
. /lib/functions/netmode.sh
|
||||
|
||||
network_flush_cache
|
||||
network_get_ipaddr ipaddr $INTERFACE
|
||||
[ -z "$ipaddr" ] && exit
|
||||
|
||||
@@ -17,13 +16,11 @@ if [ "$(netmode_get_ip_type $ipaddr)" == "private" ]; then
|
||||
if [ "$repeaterready" == "1" -o "${curmode:0:8}" == "repeater" ]; then
|
||||
# flush the ip on br-lan; br-lan will anyhow be deleted.
|
||||
# this is needed if the ip received on the wan is also from the same net
|
||||
logger -s -p user.info -t $0: [netmode] ip addr flush dev br-lan >/dev/console
|
||||
ip addr flush dev br-lan 2>/dev/null
|
||||
|
||||
# flush iptables in case the MASTER
|
||||
# tries to configure us before
|
||||
# firewall is disabled the proper way
|
||||
logger -s -p user.info -t $0: [netmode] iptables -F >/dev/console
|
||||
iptables -F
|
||||
|
||||
disable_firewall 1
|
||||
|
||||
@@ -13,10 +13,7 @@ case "$(uci get netmode.setup.curmode)" in
|
||||
repeater*)
|
||||
;;
|
||||
*)
|
||||
ping -c 1 -w 5 $defroute >/dev/null 2>&1 || {
|
||||
logger -s -t "80-repeater" "ping to $defroute failed, sending USR1 to udhcpc" >/dev/console
|
||||
killall -USR1 udhcpc
|
||||
}
|
||||
ping -c 1 -w 5 $defroute >/dev/null 2>&1 || killall -USR1 udhcpc
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"CG300",
|
||||
"CG301",
|
||||
"EX400",
|
||||
"SDX810-AP"
|
||||
"SDX*"
|
||||
],
|
||||
"acl" : [
|
||||
"admin",
|
||||
|
||||
@@ -28,39 +28,10 @@ config interface 'iptv'
|
||||
option proto 'dhcp'
|
||||
option gateway '0.0.0.0'
|
||||
option reqopts 'staticroutes'
|
||||
option ifname 'ptm0.100 $WAN.100 $LAN4'
|
||||
option ifname 'ptm0.100 atm1.1 $WAN.100 $LAN4'
|
||||
option defaultroute '0'
|
||||
|
||||
config interface 'wan6'
|
||||
option proto 'dhcpv6'
|
||||
option ifname '@wan'
|
||||
|
||||
config device 'atmwan'
|
||||
option type 'untagged'
|
||||
option ifname 'atm0'
|
||||
option name 'atm0.1'
|
||||
|
||||
config device 'ptmwan'
|
||||
option type 'untagged'
|
||||
option ifname 'ptm0'
|
||||
option name 'ptm0.1'
|
||||
|
||||
config device 'ethwan'
|
||||
option type 'untagged'
|
||||
option ifname '$WAN'
|
||||
option name '$WAN.1'
|
||||
|
||||
config device 'ethtv'
|
||||
option type '8021q'
|
||||
option name '$WAN.100'
|
||||
option ifname '$WAN'
|
||||
option vid '100'
|
||||
option priority '0'
|
||||
|
||||
config device 'ptmtv'
|
||||
option type '8021q'
|
||||
option name 'ptm0.100'
|
||||
option ifname 'ptm0'
|
||||
option vid '100'
|
||||
option priority '0'
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ config wifi-iface
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option ifname 'wl0'
|
||||
|
||||
config wifi-device 'wl1'
|
||||
option type 'broadcom'
|
||||
@@ -91,5 +90,4 @@ config wifi-iface
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option ifname 'wl1'
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"CG301",
|
||||
"EX400",
|
||||
"F*",
|
||||
"SDX810-AP"
|
||||
"SDX*"
|
||||
],
|
||||
"acl" : [
|
||||
"admin",
|
||||
|
||||
@@ -28,7 +28,7 @@ config interface 'iptv'
|
||||
option proto 'dhcp'
|
||||
option gateway '0.0.0.0'
|
||||
option reqopts 'staticroutes'
|
||||
option ifname 'ptm0.100 $WAN.100 $LAN4'
|
||||
option ifname 'ptm0.100 atm1.1 $WAN.100 $LAN4'
|
||||
option defaultroute '0'
|
||||
|
||||
config interface 'voip'
|
||||
@@ -36,53 +36,10 @@ config interface 'voip'
|
||||
option proto 'dhcp'
|
||||
option gateway '0.0.0.0'
|
||||
option reqopts 'staticroutes'
|
||||
option ifname 'ptm0.200 $WAN.200'
|
||||
option ifname 'ptm0.200 atm2.1 $WAN.200'
|
||||
option defaultroute '0'
|
||||
|
||||
config interface 'wan6'
|
||||
option proto 'dhcpv6'
|
||||
option ifname '@wan'
|
||||
|
||||
config device 'atmwan'
|
||||
option type 'untagged'
|
||||
option ifname 'atm0'
|
||||
option name 'atm0.1'
|
||||
|
||||
config device 'ptmwan'
|
||||
option type 'untagged'
|
||||
option ifname 'ptm0'
|
||||
option name 'ptm0.1'
|
||||
|
||||
config device 'ethwan'
|
||||
option type 'untagged'
|
||||
option ifname '$WAN'
|
||||
option name '$WAN.1'
|
||||
|
||||
config device 'ethtv'
|
||||
option type '8021q'
|
||||
option name '$WAN.100'
|
||||
option ifname '$WAN'
|
||||
option vid '100'
|
||||
option priority '0'
|
||||
|
||||
config device 'ptmtv'
|
||||
option type '8021q'
|
||||
option name 'ptm0.100'
|
||||
option ifname 'ptm0'
|
||||
option vid '100'
|
||||
option priority '0'
|
||||
|
||||
config device 'ethvoip'
|
||||
option type '8021q'
|
||||
option name '$WAN.200'
|
||||
option ifname '$WAN'
|
||||
option vid '200'
|
||||
option priority '0'
|
||||
|
||||
config device 'ptmvoip'
|
||||
option type '8021q'
|
||||
option name 'ptm0.200'
|
||||
option ifname 'ptm0'
|
||||
option vid '200'
|
||||
option priority '0'
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ config wifi-iface
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option ifname 'wl0'
|
||||
|
||||
config wifi-device 'wl1'
|
||||
option type 'broadcom'
|
||||
@@ -91,5 +90,4 @@ config wifi-iface
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option ifname 'wl1'
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
"DG40*",
|
||||
"EG40*",
|
||||
"EX40*",
|
||||
"SDX*",
|
||||
"F*"
|
||||
],
|
||||
"uplink_band" : "b",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
config ethernet_interface 'Wan'
|
||||
option baseifname '$WAN'
|
||||
option ifname '$WAN.1'
|
||||
option name 'WAN'
|
||||
option bridge '1'
|
||||
|
||||
@@ -13,8 +13,3 @@ config interface 'wan'
|
||||
option ifname '$WAN.1 $LAN1 $LAN2 $LAN3 $LAN4'
|
||||
option reqopts '43'
|
||||
|
||||
config device 'ethwan'
|
||||
option type 'untagged'
|
||||
option ifname '$WAN'
|
||||
option name '$WAN.1'
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ config wifi-iface
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option ifname 'wl0'
|
||||
option autoconf '1'
|
||||
|
||||
config wifi-device 'wl1'
|
||||
option type 'broadcom'
|
||||
@@ -89,5 +89,5 @@ config wifi-iface
|
||||
option cipher 'auto'
|
||||
option wps_pbc '0'
|
||||
option wmf_bss_enable '1'
|
||||
option ifname 'wl1'
|
||||
option autoconf '1'
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
"DG40*",
|
||||
"EG40*",
|
||||
"EX40*",
|
||||
"SDX*",
|
||||
"F*"
|
||||
],
|
||||
"uplink_band" : "b",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
config ethernet_interface 'Wan'
|
||||
option baseifname '$WAN'
|
||||
option ifname '$WAN.1'
|
||||
option name 'WAN'
|
||||
option bridge '1'
|
||||
|
||||
@@ -13,8 +13,3 @@ config interface 'wan'
|
||||
option ifname '$WAN.1 $LAN1 $LAN2 $LAN3 $LAN4'
|
||||
option reqopts '43'
|
||||
|
||||
config device 'ethwan'
|
||||
option type 'untagged'
|
||||
option ifname '$WAN'
|
||||
option name '$WAN.1'
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ config wifi-iface
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option ifname 'wl0'
|
||||
option autoconf '1'
|
||||
|
||||
config wifi-device 'wl1'
|
||||
option type 'broadcom'
|
||||
@@ -104,5 +104,5 @@ config wifi-iface
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option ifname 'wl1'
|
||||
option autoconf '1'
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ config interface 'loopback'
|
||||
config device 'lan_dev'
|
||||
option name 'eth0.1'
|
||||
option macaddr '$MACLAN'
|
||||
option vid 1
|
||||
|
||||
config interface 'wan'
|
||||
option type 'bridge'
|
||||
@@ -20,7 +19,6 @@ config interface 'wan'
|
||||
config device 'wan_dev'
|
||||
option name 'eth0.2'
|
||||
option macaddr '$MACWAN'
|
||||
option vid 2
|
||||
|
||||
config interface 'wan6'
|
||||
option ifname '@wan'
|
||||
|
||||
@@ -7,7 +7,6 @@ config interface 'loopback'
|
||||
config device 'lan_dev'
|
||||
option name 'eth0.1'
|
||||
option macaddr '$MACLAN'
|
||||
option vid 1
|
||||
|
||||
config interface 'wan'
|
||||
option type 'bridge'
|
||||
@@ -20,7 +19,6 @@ config interface 'wan'
|
||||
config device 'wan_dev'
|
||||
option name 'eth0.2'
|
||||
option macaddr '$MACWAN'
|
||||
option vid 2
|
||||
|
||||
config interface 'wan6'
|
||||
option ifname '@wan'
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
{ "sv" : "" }
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"EX4*",
|
||||
"SDX810-AP"
|
||||
"EX4*"
|
||||
],
|
||||
"credentials" : 0
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
config atm_bridge
|
||||
option link_type 'EoA'
|
||||
option encapseoa 'llcsnap_eth'
|
||||
option unit '0'
|
||||
option ifname 'atm0.1'
|
||||
option baseifname 'atm0'
|
||||
option atmtype 'ubr'
|
||||
option name 'atm_inet'
|
||||
option vpi '8'
|
||||
option vci '35'
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
config ethernet_interface 'Wan'
|
||||
option baseifname '$WAN'
|
||||
option ifname '$WAN.1'
|
||||
option name 'WAN'
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
config vdsl_interface
|
||||
option unit '0'
|
||||
option ifname 'ptm0.1'
|
||||
option baseifname 'ptm0'
|
||||
option name 'VDSL2'
|
||||
option dslat '1'
|
||||
option ptmprio '1'
|
||||
option ipqos '1'
|
||||
|
||||
@@ -27,18 +27,3 @@ config interface 'wan6'
|
||||
option proto 'dhcpv6'
|
||||
option ifname '@wan'
|
||||
|
||||
config device 'atmwan'
|
||||
option type 'untagged'
|
||||
option ifname 'atm0'
|
||||
option name 'atm0.1'
|
||||
|
||||
config device 'ptmwan'
|
||||
option type 'untagged'
|
||||
option ifname 'ptm0'
|
||||
option name 'ptm0.1'
|
||||
|
||||
config device 'ethwan'
|
||||
option type 'untagged'
|
||||
option ifname '$WAN'
|
||||
option name '$WAN.1'
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ config wifi-iface
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option ifname 'wl0'
|
||||
|
||||
config wifi-device 'wl1'
|
||||
option type 'broadcom'
|
||||
@@ -91,5 +90,4 @@ config wifi-iface
|
||||
option wps_pbc '1'
|
||||
option wmf_bss_enable '1'
|
||||
option bss_max '32'
|
||||
option ifname 'wl1'
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ config interface 'lan'
|
||||
config device 'lan_dev'
|
||||
option name 'eth0.1'
|
||||
option macaddr '$MACLAN'
|
||||
option vid 1
|
||||
|
||||
config interface 'wan'
|
||||
option ifname 'eth0.2'
|
||||
@@ -28,7 +27,6 @@ config interface 'wan'
|
||||
config device 'wan_dev'
|
||||
option name 'eth0.2'
|
||||
option macaddr '$MACWAN'
|
||||
option vid 2
|
||||
|
||||
config interface 'wan6'
|
||||
option ifname '@wan'
|
||||
|
||||
@@ -27,7 +27,6 @@ config wifi-iface
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option wps_pbc 1
|
||||
option ifname ra0
|
||||
|
||||
config wifi-device rai0
|
||||
option band a
|
||||
@@ -46,5 +45,4 @@ config wifi-iface
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option wps_pbc 1
|
||||
option ifname rai0
|
||||
|
||||
|
||||
@@ -8,8 +8,9 @@ OLD_MODE_FILE=/var/netmodes/old_mode
|
||||
SWITCHMODELOCK="/tmp/switching_mode"
|
||||
MODEDIR=$(uci -q get netmode.setup.dir)
|
||||
MTK=0
|
||||
|
||||
opkg list-installed | grep -q kmod-mt.*mtk && MTK=1
|
||||
case "$(db -q get hw.board.hardware)" in
|
||||
EX400|SDX_500AP) MTK=1 ;;
|
||||
esac
|
||||
|
||||
[ -n "$MODEDIR" ] || MODEDIR="/etc/netmodes"
|
||||
|
||||
@@ -99,9 +100,11 @@ correct_uplink() {
|
||||
|
||||
if [ "$link" == "up" ]; then
|
||||
ubus call network.device set_state "{\"name\":\"$WETIF\", \"defer\":true}"
|
||||
ifconfig $WETIF down
|
||||
ubus call network.device set_state "{\"name\":\"$WANDEV\", \"defer\":false}"
|
||||
else
|
||||
ubus call network.device set_state "{\"name\":\"$WETIF\", \"defer\":false}"
|
||||
ifconfig $WETIF up
|
||||
ubus call network.device set_state "{\"name\":\"$WANDEV\", \"defer\":true}"
|
||||
ubus call led.internet set '{"state" : "notice"}'
|
||||
fi
|
||||
@@ -155,23 +158,26 @@ switch_netmode() {
|
||||
echo $curmode >$OLD_MODE_FILE
|
||||
|
||||
[ -d "/etc/netmodes/$curmode" ] || return
|
||||
logger -s -p user.info -t $0 "[netmode] Copying /etc/netmodes/$curmode in /etc/config" >/dev/console
|
||||
cp /etc/netmodes/$curmode/* /etc/config/
|
||||
rm -f /etc/config/DETAILS
|
||||
sync
|
||||
|
||||
local reboot=$(uci -q get netmode.$curmode.reboot)
|
||||
|
||||
if [ "$reboot" != "0" ]; then
|
||||
if [ "$reboot" == "1" ]; then
|
||||
reboot &
|
||||
exit
|
||||
fi
|
||||
|
||||
/etc/init.d/environment reload
|
||||
case "$curmode" in
|
||||
routed*)
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
;;
|
||||
repeater*)
|
||||
touch $SWITCHMODELOCK
|
||||
logger -s -p user.info -t $0 "Switching to $curmode mode" > /dev/console
|
||||
echo "Switching to $curmode mode" > /dev/console
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
[ -f /etc/init.d/omcproxy ] && /etc/init.d/omcproxy stop
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
@@ -183,10 +189,6 @@ switch_netmode() {
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
rm -f $SWITCHMODELOCK
|
||||
;;
|
||||
*)
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -223,13 +225,7 @@ wait_for_netmode_handler() {
|
||||
}
|
||||
|
||||
netmode_get_ip_type() {
|
||||
[ -n "$(echo $1 | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)')" ] && {
|
||||
logger -t "[netmode]" "netmode_get_ip_type: ip $1 is private"
|
||||
echo "private"
|
||||
} || {
|
||||
logger -t "[netmode]" "netmode_get_ip_type: ip $1 is public"
|
||||
echo "public"
|
||||
}
|
||||
[ -n "$(echo $1 | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)')" ] && echo "private" || echo "public"
|
||||
}
|
||||
|
||||
get_device_of() {
|
||||
@@ -420,10 +416,14 @@ start_netmode_tools() {
|
||||
/sbin/netmode-discover &
|
||||
/sbin/wificontrol --repeater &
|
||||
;;
|
||||
*)
|
||||
/sbin/netmode-client-detect &
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
stop_netmode_tools() {
|
||||
/sbin/netmode-client-detect stop
|
||||
killall -9 netmode-discover >/dev/null 2>&1
|
||||
killall -9 wificontrol >/dev/null 2>&1
|
||||
}
|
||||
|
||||
@@ -3,6 +3,15 @@
|
||||
# receive new client events
|
||||
# and trigger wificontrol in --router mode for that client
|
||||
|
||||
NCDPF="/tmp/netmode-client-detector.pid"
|
||||
|
||||
if [ -f $NCDPF ]; then
|
||||
kill -9 $(cat $NCDPF) 2>/dev/null
|
||||
rm -f $NCDPF
|
||||
fi
|
||||
|
||||
[ "$1" == "stop" ] && exit
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
action=
|
||||
@@ -10,15 +19,6 @@ ipaddr=
|
||||
macaddr=
|
||||
network=
|
||||
|
||||
timed_check() {
|
||||
while true; do
|
||||
network=${network:-lan}
|
||||
ubus call repeater get_creds '{"network":"'$network'","file":"/tmp/wificontrol.txt"}'
|
||||
wificontrol --router
|
||||
sleep $1
|
||||
done
|
||||
}
|
||||
|
||||
is_inteno_macaddr()
|
||||
{
|
||||
macaddr=$1
|
||||
@@ -36,24 +36,23 @@ is_inteno_macaddr()
|
||||
false
|
||||
}
|
||||
|
||||
timed_check 60 &
|
||||
ubus listen client | \
|
||||
while read event ; do
|
||||
#echo "netmode-client-detect got event: $event" >/dev/console
|
||||
json_load "$event"
|
||||
json_select client
|
||||
json_get_var action action
|
||||
[ "$action" == "connect" ] || continue
|
||||
json_get_var macaddr macaddr
|
||||
json_get_var ipaddr ipaddr
|
||||
json_get_var network network "lan"
|
||||
|
||||
while true ; do
|
||||
ubus listen client | \
|
||||
while read event ; do
|
||||
#echo "netmode-client-detect got event: $event" >/dev/console
|
||||
json_load "$event"
|
||||
json_select client
|
||||
json_get_var action action
|
||||
[ "$action" == "connect" ] || continue
|
||||
json_get_var macaddr macaddr
|
||||
json_get_var ipaddr ipaddr
|
||||
json_get_var network network "lan"
|
||||
if is_inteno_macaddr $macaddr; then
|
||||
echo "netmode-client-detect: a new Inteno device detected on '$network' network (MACAddr:$macaddr IPAddr:$ipaddr)" >/dev/console
|
||||
ubus call repeater get_creds '{"network":"'$network'","file":"/tmp/wificontrol.txt"}' >/dev/null
|
||||
grep -q ssid /tmp/wificontrol.txt && /sbin/wificontrol --router --destination $ipaddr
|
||||
fi
|
||||
done &
|
||||
|
||||
echo $(($!-1)) $! > $NCDPF
|
||||
|
||||
if is_inteno_macaddr $macaddr; then
|
||||
logger -s -p user.info -t $0 "netmode-client-detect: a new Inteno device detected on '$network' network (MACAddr:$macaddr IPAddr:$ipaddr)" >/dev/console
|
||||
ubus call repeater get_creds '{"network":"'$network'","file":"/tmp/wificontrol.txt"}'
|
||||
/sbin/wificontrol --router --destination $ipaddr
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
@@ -109,8 +109,10 @@ backup() {
|
||||
|
||||
file="$1"
|
||||
from_gui="$2"
|
||||
done_file="/tmp/netmode_done"
|
||||
|
||||
[ -f "$file" ] || exit
|
||||
[ -f "$done_file" ] && rm $done_file
|
||||
|
||||
# let netmode-handler up to 20 seconds to finish switching mode
|
||||
wait_for_netmode_handler
|
||||
@@ -161,6 +163,7 @@ done
|
||||
|
||||
[ "$apcliband" == "$band" -o "$band" == "" ] || {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
touch $done_file
|
||||
exit
|
||||
}
|
||||
|
||||
@@ -168,6 +171,7 @@ repeater_iface_num=$(uci -q show wireless | grep -e ".mode='wet'" -e ".mode='sta
|
||||
|
||||
[ -z "$repeater_iface_num" ] && {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
touch $done_file
|
||||
exit
|
||||
}
|
||||
|
||||
@@ -197,6 +201,7 @@ while json_get_var dummy $i; do
|
||||
a_num=$((a_num+1))
|
||||
[ -z $iface_num ] && {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
touch $done_file
|
||||
exit
|
||||
}
|
||||
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
|
||||
@@ -205,6 +210,7 @@ while json_get_var dummy $i; do
|
||||
b_num=$((b_num+1))
|
||||
[ -z $iface_num ] && {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
touch $done_file
|
||||
exit
|
||||
}
|
||||
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
|
||||
@@ -222,6 +228,7 @@ while json_get_var dummy $i; do
|
||||
esac
|
||||
[ -z $iface_num ] && {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
touch $done_file
|
||||
exit
|
||||
}
|
||||
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
|
||||
@@ -269,6 +276,7 @@ if [ "$from_gui" == "true" ]; then
|
||||
ping -w1 $ip
|
||||
if [ $? -eq 0 ]; then
|
||||
restore
|
||||
touch $done_file
|
||||
exit
|
||||
else
|
||||
i=$((i-10))
|
||||
@@ -278,6 +286,7 @@ if [ "$from_gui" == "true" ]; then
|
||||
restore "back"
|
||||
else
|
||||
if [ "$state" == "exit" ]; then
|
||||
touch $done_file
|
||||
return
|
||||
fi
|
||||
ubus call leds set '{"state":"allflash"}'
|
||||
@@ -291,4 +300,7 @@ else
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
correct_uplink
|
||||
ubus call leds set '{"state":"normal"}'
|
||||
touch $done_file
|
||||
# we need to trigger a reload of icwmp but ONLY if ip or device has changed
|
||||
[ -f "/etc/hotplug.d/iface/90-icwmp" ] && INTERFACE=wan ACTION=ifup sh /etc/hotplug.d/iface/90-icwmp
|
||||
fi
|
||||
|
||||
3
inteno-netmodes/files/sbin/start-netmode-conf
Executable file
3
inteno-netmodes/files/sbin/start-netmode-conf
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
netmode-conf "$1" "$2" &
|
||||
@@ -65,13 +65,13 @@ ping_uplink()
|
||||
wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
# If there is an uplink IP address but no connection for 5 minutes, reboot
|
||||
if [ $enableCounter -gt 32 ]; then
|
||||
logger -s -p user.info -t "testnet" "No uplink connection; reboot" >/dev/console
|
||||
logger -t "testnet" "No uplink connection; reboot"
|
||||
ubus call led.internet set '{"state" : "error"}'
|
||||
reboot &
|
||||
elif [ $((enableCounter % 8)) -eq 0 -a $enableCounter -ge 8 -o $enableCounter -eq 0 ]; then
|
||||
ps | grep -v grep | grep -q 'wifi reload\|wifi import\|wifi.credentials\|iwpriv' && return
|
||||
|
||||
logger -s -p user.info -t "testnet" "No uplink connection; try to re-connect" >/dev/console
|
||||
logger -t "testnet" "No uplink connection; try to re-connect"
|
||||
|
||||
if [ -f /usr/sbin/wlctl ]; then
|
||||
assoclist="$(wlctl -i $wetif assoclist | head -1 | awk '{print$2}')"
|
||||
@@ -114,7 +114,7 @@ ping_uplink()
|
||||
AccessPolicy=1
|
||||
if [ -f /usr/sbin/iwpriv ]; then
|
||||
grep -q up /sys/class/net/$ETHWAN/operstate 2>/dev/null || {
|
||||
logger -s -p user.info -t "testnet" "Disconnect all stations and disable WiFi access on downlink wireless interfaces" >/dev/console
|
||||
logger -t "testnet" "Disconnect all stations and disable WiFi access on downlink wireless interfaces"
|
||||
# Do not allow clients to connect on 2.4GHz radio
|
||||
iwpriv ra0 set AccessPolicy=$AccessPolicy
|
||||
# Do not allow clients to connect on 5GHz radio
|
||||
@@ -126,7 +126,7 @@ ping_uplink()
|
||||
}
|
||||
fi
|
||||
else
|
||||
grep -q "true" /tmp/internet_connection_status 2>/dev/null || logger -s -p user.info -t "testnet" "Uplink connection is gained" >/dev/console
|
||||
grep -q "true" /tmp/internet_connection_status 2>/dev/null || logger -t "testnet" "Uplink connection is gained"
|
||||
echo "{ \"online\" : true }" > /tmp/internet_connection_status
|
||||
ubus call led.internet set '{"state" : "eok"}'
|
||||
|
||||
@@ -140,7 +140,7 @@ ping_uplink()
|
||||
AccessPolicy=0
|
||||
|
||||
if [ -f /usr/sbin/iwpriv ]; then
|
||||
logger -s -p user.info -t "testnet" "Enable WiFi access on downlink wireless interfaces" >/dev/console
|
||||
logger -t "testnet" "Enable WiFi access on downlink wireless interfaces"
|
||||
iwpriv ra0 set AccessPolicy=$AccessPolicy
|
||||
iwpriv rai0 set AccessPolicy=$AccessPolicy
|
||||
fi
|
||||
|
||||
@@ -129,12 +129,12 @@ case "$1" in
|
||||
json_load "`cat $file`" || write_error "invalid file content"
|
||||
json_select "wifi_ifaces" || write_error "invalid file content"
|
||||
|
||||
start-netmode-conf "$file" "$from_gui" >/dev/null 2>/dev/null
|
||||
|
||||
json_init
|
||||
json_add_string "status" success
|
||||
json_dump
|
||||
|
||||
netmode-conf "$file" "$from_gui" >/dev/null 2>&1 &
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
@@ -43,34 +43,35 @@ CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
CONFIG_PACKAGE_iup=y
|
||||
CONFIG_PACKAGE_iwatchdog=y
|
||||
CONFIG_PACKAGE_juci=y
|
||||
CONFIG_PACKAGE_juci-broadcom-dsl=y
|
||||
CONFIG_PACKAGE_juci-broadcom-ethernet=y
|
||||
CONFIG_PACKAGE_juci-broadcom-iptv=y
|
||||
CONFIG_PACKAGE_juci-broadcom-pwrmgmt=y
|
||||
CONFIG_PACKAGE_juci-broadcom-vlan=y
|
||||
CONFIG_PACKAGE_juci-wireless=y
|
||||
CONFIG_PACKAGE_juci-broadcom-xdsl=y
|
||||
CONFIG_PACKAGE_juci-ddns=y
|
||||
CONFIG_PACKAGE_juci-diagnostics=y
|
||||
CONFIG_PACKAGE_juci-dnsmasq-dhcp=y
|
||||
CONFIG_PACKAGE_juci-dropbear=y
|
||||
CONFIG_PACKAGE_juci-ethernet=y
|
||||
CONFIG_PACKAGE_juci-event=y
|
||||
CONFIG_PACKAGE_juci-firewall-fw3=y
|
||||
CONFIG_PACKAGE_juci-ice-client=y
|
||||
CONFIG_PACKAGE_juci-icwmp=y
|
||||
CONFIG_PACKAGE_juci-igmpinfo=y
|
||||
CONFIG_PACKAGE_juci-config-backup=y
|
||||
CONFIG_PACKAGE_juci-inteno-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-provisioning=y
|
||||
# CONFIG_PACKAGE_juci-inteno-qos is not set
|
||||
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
|
||||
@@ -86,6 +87,7 @@ CONFIG_PACKAGE_juci-utils=y
|
||||
# CONFIG_PACKAGE_kmod-ipt-nathelper is not set
|
||||
CONFIG_PACKAGE_kmod-nls-base=y
|
||||
CONFIG_PACKAGE_kmod-siit=y
|
||||
CONFIG_PACKAGE_layer2interface=y
|
||||
CONFIG_PACKAGE_libcgroup-daemon=y
|
||||
CONFIG_PACKAGE_libcgroup=y
|
||||
# CONFIG_PACKAGE_libcgroup-utils is not set
|
||||
@@ -118,7 +120,7 @@ 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-pppoe is not set
|
||||
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
|
||||
CONFIG_PACKAGE_ppp-mod-pptp=y
|
||||
CONFIG_PACKAGE_ppp-multilink=y
|
||||
@@ -155,7 +157,6 @@ 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
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
# CONFIG_PACKAGE_libcgroup-daemon is not set
|
||||
# CONFIG_PACKAGE_libcgroup is not set
|
||||
|
||||
# CONFIG_PACKAGE_juci-broadcom-wl is not set
|
||||
# CONFIG_PACKAGE_juci-minisnmpd is not set
|
||||
# CONFIG_PACKAGE_juci-router-openwrt is not set
|
||||
# CONFIG_PACKAGE_speedsvc is not set
|
||||
|
||||
# CONFIG_juci_broadcom_wl is not set
|
||||
# CONFIG_juci_minisnmpd is not set
|
||||
# CONFIG_juci_router_openwrt is not set
|
||||
|
||||
# CONFIG_PACKAGE_brcminfo is not set
|
||||
CONFIG_PACKAGE_brcm_fw_tool=y
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
CONFIG_TARGET_NO_DECT=y
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
CONFIG_TARGET_NO_DECT=y
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
CONFIG_BCM_I2C=y
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
CONFIG_TARGET_NO_DECT=y
|
||||
CONFIG_TARGET_NO_DSL=y
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
CONFIG_TARGET_NO_DECT=y
|
||||
CONFIG_USE_DSL=y
|
||||
CONFIG_TARGET_DSL_GFAST=y
|
||||
@@ -1,4 +0,0 @@
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
CONFIG_TARGET_NO_DECT=y
|
||||
CONFIG_USE_DSL=y
|
||||
CONFIG_TARGET_DSL_GFAST=y
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
CONFIG_TARGET_NO_DECT=y
|
||||
CONFIG_TARGET_NO_DSL=y
|
||||
@@ -1,4 +0,0 @@
|
||||
CONFIG_TARGET_NO_DSL=y
|
||||
CONFIG_BCM_I2C=y
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# CONFIG_PACKAGE_libcgroup-daemon is not set
|
||||
# CONFIG_PACKAGE_libcgroup is not set
|
||||
|
||||
# CONFIG_PACKAGE_natalie-dect is not set
|
||||
# CONFIG_PACKAGE_juci-broadcom-wl is not set
|
||||
# CONFIG_PACKAGE_juci-minisnmpd is not set
|
||||
# CONFIG_PACKAGE_juci-router-openwrt is not set
|
||||
# CONFIG_PACKAGE_speedsvc is not set
|
||||
|
||||
# CONFIG_juci_broadcom_wl is not set
|
||||
# CONFIG_juci_minisnmpd is not set
|
||||
# CONFIG_juci_router_openwrt is not set
|
||||
|
||||
# CONFIG_PACKAGE_brcminfo is not set
|
||||
CONFIG_PACKAGE_brcm_fw_tool=y
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
CONFIG_BCM_I2C=y
|
||||
CONFIG_TARGET_NO_DECT=y
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_TARGET_NO_VOICE=y
|
||||
CONFIG_BCM_I2C=y
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_BCM_I2C=y
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
CONFIG_TARGET_NO_VOICE=y
|
||||
CONFIG_BCM_I2C=y
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
CONFIG_TARGET_NO_DSL=y
|
||||
CONFIG_BCM_I2C=y
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
CONFIG_TARGET_NO_DHD=y
|
||||
CONFIG_TARGET_NO_VOICE=y
|
||||
CONFIG_BCM_I2C=y
|
||||
CONFIG_BCM_ENDPOINT_MODULE=y
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
# CONFIG_PACKAGE_libcgroup-daemon is not set
|
||||
# CONFIG_PACKAGE_libcgroup is not set
|
||||
# CONFIG_PACKAGE_power-management is not set
|
||||
# CONFIG_PACKAGE_qos-scripts is not set
|
||||
# CONFIG_PACKAGE_mtd-utils-deubinize is not set
|
||||
# CONFIG_PACKAGE_mtd-utils-imagewrite is not set
|
||||
# CONFIG_PACKAGE_mtd-utils-mkfs.jffs2 is not set
|
||||
# CONFIG_PACKAGE_mtd-utils-nanddump is not set
|
||||
CONFIG_PACKAGE_mtd-utils-nandwrite=y
|
||||
CONFIG_PACKAGE_mtk-bndstrg=y
|
||||
CONFIG_PACKAGE_omcproxy=y
|
||||
CONFIG_PACKAGE_kmod-nf-nathelper=y
|
||||
CONFIG_PACKAGE_kmod-nf-nathelper-extra=y
|
||||
# CONFIG_PACKAGE_endptmngr is not set
|
||||
@@ -36,7 +36,7 @@ _iop()
|
||||
feeds_update genconfig generate_tarballs install_key \
|
||||
scp_changes setup_host ssh_install_key ssh_sysupgrade \
|
||||
ssh_sysupgrade_latest ssh_sysupgrade_latest_w status \
|
||||
update_package update_feed_branches"
|
||||
update_package"
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ] ; then
|
||||
|
||||
|
||||
@@ -1,57 +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"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function branch_exists {
|
||||
local branch=$1
|
||||
[ -z "$branch" ] && return 1
|
||||
git branch | grep -q $branch && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
function build_branch {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
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>"
|
||||
@@ -15,8 +15,8 @@ function genconfig {
|
||||
LOCAL_MIRROR="http://mirror.inteno.se/mirror"
|
||||
|
||||
iopsys_brcm63xx_mips="cg300 cg301 dg150 dg150v2 dg150alv2 dg200 dg200al dg301 dg301al eg300 vg50 vox25 hpc_hu02"
|
||||
iopsys_brcm63xx_arm="dg400 eg400 sdx810_rg f104w f104 dg400prime dg400primeb 963138REF_P502"
|
||||
iopsys_ramips="ex400 sdx810_ap"
|
||||
iopsys_brcm63xx_arm="dg400 eg400 f104w f104 dg400prime dg400primeb 963138REF_P502"
|
||||
iopsys_ramips="ex400 sdx_500ap"
|
||||
ramips="mt7621"
|
||||
target="bogus"
|
||||
masterconfig=1
|
||||
@@ -216,15 +216,11 @@ function genconfig {
|
||||
cp $CONFIGPATH/config .config
|
||||
fi
|
||||
|
||||
# Add target (soc/board specific )
|
||||
if [ -f $CONFIGPATH/target/config ]; then
|
||||
cat $CONFIGPATH/target/config >> .config
|
||||
fi
|
||||
if [ -f $CONFIGPATH/target/$target/config ]; then
|
||||
cat $CONFIGPATH/target/$target/config >> .config
|
||||
fi
|
||||
if [ -f $CONFIGPATH/target/$target/$BOARDTYPE/config ]; then
|
||||
cat $CONFIGPATH/target/$target/$BOARDTYPE/config >> .config
|
||||
# Add target diff
|
||||
local target_name=$(echo $target | sed 's/_/-/g')
|
||||
local target_conf=target/linux/${target_name}/config
|
||||
if [ -f $target_conf ]; then
|
||||
cat $target_conf >> .config
|
||||
fi
|
||||
|
||||
# Apply profile diff to master config if selected
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
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/feed_inteno_broadcom/bcmkernel/${sdkversion:0:5}*.mk | cut -d'=' -f2)
|
||||
bcmkernelcommith=$(grep -w "PKG_SOURCE_VERSION:" $curdir/feeds/feed_inteno_broadcom/bcmkernel/${sdkversion:0:4}*.mk | cut -d'=' -f2)
|
||||
# do not build bcmopen sdk if it was already built before
|
||||
[ -n "$board" -a -n "$bcmkernelcommith" ] || return
|
||||
ssh $SERVER "ls $FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz" && return
|
||||
@@ -37,24 +36,22 @@ build_natalie_consumer() {
|
||||
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/feed_inteno_packages/endptmngr/Makefile | cut -d'=' -f2)
|
||||
endptcommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/feed_inteno_packages/endptmngr/Makefile | cut -d'=' -f2)
|
||||
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)
|
||||
[ -n "$profile" -a -n "$endptversion" -a -n "$endptcommith" ] || return
|
||||
ssh $SERVER "ls $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 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
|
||||
ssh $SERVER "ls $FPATH/endptcfg-$profile-$endptversion-$endptcommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/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 $SERVER:$FPATH/
|
||||
cp endptcfg-$profile-$endptversion-$endptcommith.tar.gz $curdir/
|
||||
rm -rf endptcfg-open-$endptversion
|
||||
rm -f endptcfg-$profile-$endptversion-$endptcommith.tar.gz
|
||||
cd $curdir
|
||||
}
|
||||
|
||||
@@ -85,7 +82,7 @@ build_mediatek_kernel() {
|
||||
ssh $SERVER "ls $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
|
||||
cd build_dir/target-mipsel_1004kc*/linux-iopsys-ramips_*/$kernel
|
||||
|
||||
# Save Kconfig files to recreate the same kernel config,
|
||||
# delete everyting else.
|
||||
@@ -147,7 +144,7 @@ function generate_tarballs {
|
||||
if [ "$stk_target" == "broadcom" ]; then
|
||||
build_bcmkernel_consumer
|
||||
build_natalie_consumer
|
||||
build_endptmngr_consumer
|
||||
build_endptcfg_consumer
|
||||
build_ice_consumer
|
||||
elif [ "$stk_target" == "mediatek" ]; then
|
||||
build_mediatek_kernel
|
||||
|
||||
@@ -22,7 +22,7 @@ function ssh_sysupgrade {
|
||||
fi
|
||||
IMAGE=`basename $2`
|
||||
echo "sysupgrade host: $1 with file $IMAGE"
|
||||
[ "$2" ] && [ -e "$2" ] && scp $2 root@$1:/tmp/ && ssh -o ConnectTimeout=60 root@$1 "sysupgrade -v $3 /tmp/$IMAGE" && echo "sysupgrade done!"
|
||||
[ "$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"
|
||||
|
||||
@@ -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 feed_inteno feeds.conf | awk '{print$2}' | cut -d'_' -f3 | tr '\n' ' ')"
|
||||
|
||||
for f in $ifeeds; do
|
||||
commith=$(grep feed_inteno_$f feeds.conf | cut -d'^' -f2)
|
||||
cd $ipath/feeds/feed_inteno_$f
|
||||
git branch -D $release 2>/dev/null
|
||||
echo "feed_inteno_$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"
|
||||
@@ -41,7 +41,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 ""
|
||||
|
||||
@@ -184,7 +184,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
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
management_interfaces() {
|
||||
local DHCP_IFACES=""
|
||||
|
||||
is_notbridged_dhcp() {
|
||||
local config="$1"
|
||||
local proto="$(uci -q get network.$config.proto)"
|
||||
local typ="$(uci -q get network.$config.type)"
|
||||
if [ "$proto" == "dhcp" -a "$typ" != "bridge" ]; then
|
||||
DHCP_IFACES="$DHCP_IFACES $config"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach is_notbridged_dhcp interface
|
||||
echo $DHCP_IFACES
|
||||
}
|
||||
|
||||
set_iup_reqopts() {
|
||||
### Ask for IUP related DHCP options only if IUP is enabled ###
|
||||
new_reqopts() {
|
||||
local net=$1
|
||||
local enabled="$(uci -q get provisioning.iup.enabled)"
|
||||
enabled="${enabled:-on}"
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$net.reqopts)"
|
||||
local iupopts="66 67 128 224 225 226"
|
||||
local ropt iopt
|
||||
local net
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224|225|226) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $iupopts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224|225|226) [ $enabled == "on" ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
echo "$newreqopts"
|
||||
}
|
||||
for net in $(management_interfaces); do
|
||||
uci -q set network.$net.reqopts="$(new_reqopts $net)"
|
||||
done
|
||||
uci commit network
|
||||
}
|
||||
|
||||
set_iup_reqopts
|
||||
@@ -1,219 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# functions that take dhcp options received on the wan interface
|
||||
# and relay/repeat them for specific clients
|
||||
|
||||
#config dhcp_option_relay
|
||||
# option enable 1
|
||||
# list dhcp_option 43
|
||||
# list from_interface wan
|
||||
# option vendorclass '*SDX*'
|
||||
|
||||
# where:
|
||||
# dhcp_option_relay is the name of the section parsed by this script
|
||||
# enable/enabled - option, enable the uci section [default on]
|
||||
# dhcp_option/dhcp_options - list of dhcp options (0-255) to be relayed/repeated
|
||||
# overwrite - if same dhcp_option already exists in /etc/config/dhcp, overwrite it with this option [default off]
|
||||
# from_interface - list of interfaces (e.g. wan) to get the dhcp options from
|
||||
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
interface=""
|
||||
opt224=""
|
||||
opt225=""
|
||||
opt226=""
|
||||
opt43=""
|
||||
opt128=""
|
||||
opt66=""
|
||||
opt67=""
|
||||
opt132=""
|
||||
opt133=""
|
||||
newsectionid="0"
|
||||
|
||||
function parse_the_json()
|
||||
{
|
||||
local the_json="$@"
|
||||
|
||||
json_load "$the_json"
|
||||
json_get_var interface interface
|
||||
json_get_var opt224 privopt224
|
||||
json_get_var opt225 privopt225
|
||||
json_get_var opt226 privopt226
|
||||
json_get_var opt43 vendorspecinf # option 43
|
||||
json_get_var opt128 httpurl128
|
||||
json_get_var opt66 tftp # option 66
|
||||
json_get_var opt67 bootfile #option 67
|
||||
json_get_var opt132 vlanid # option 132
|
||||
json_get_var opt133 vlanpriority # option 133
|
||||
}
|
||||
|
||||
function add_section_dhcp_vendorclass()
|
||||
{
|
||||
local dhcp_option=$1
|
||||
local dhcp_option_value=$2
|
||||
local vendorclass=$3
|
||||
local new=
|
||||
newsectionid=$((newsectionid+1))
|
||||
|
||||
#echo "add_section_dchp_vendorclass $dhcp_option ${dhcp_option_value} $vendorclass"
|
||||
new=$(uci add dhcp vendorclass)
|
||||
uci set dhcp.$new.vendorclass="$vendorclass"
|
||||
uci set dhcp.$new.networkid="dhcp_option_relay_$newsectionid"
|
||||
uci add_list dhcp.$new.dhcp_option=$dhcp_option,\"${dhcp_option_value}\"
|
||||
|
||||
uci commit dhcp
|
||||
}
|
||||
|
||||
function dhcp_option_relay()
|
||||
{
|
||||
local section="$1"
|
||||
local enable="" enabled=""
|
||||
local dhcp_option="" dhcp_option_value=""
|
||||
local vendorclass=""
|
||||
#local overwrite=""
|
||||
local from_interface
|
||||
|
||||
#echo "section: $section"
|
||||
|
||||
# parse only enabled sections
|
||||
config_get_bool enabled $section enabled 1
|
||||
config_get_bool enable $section enable 1
|
||||
#echo "enabled: $enabled"
|
||||
#echo "enable : $enable"
|
||||
if [ "$enable" == "0" -o "$enabled" == "0" ] ; then
|
||||
#echo "section $section is not enabled"
|
||||
return
|
||||
fi
|
||||
# todo: for disabled sections: run only the removal of the dhcp options
|
||||
|
||||
# option overwrite 1
|
||||
#config_get_bool overwrite $section overwrite 0
|
||||
config_get vendorclass $section vendorclass
|
||||
if [ ${#vendorclass} -le 1 ]; then
|
||||
#echo "vendorclass must not be empty"
|
||||
return
|
||||
fi
|
||||
|
||||
# list to_interface lan
|
||||
# to_interface - list of interfaces (e.g. lan, guest) to advertise the dhcp options to
|
||||
#foreach_to_interface() {
|
||||
# local to_interface=$1
|
||||
# echo ""
|
||||
# echo " from_interface $from_interface"
|
||||
# echo " dhcp_option $dhcp_option"
|
||||
# echo " dhcp_option_value $dhcp_option_value"
|
||||
# echo " overwrite $overwrite"
|
||||
# echo " to_interface $to_interface"
|
||||
#
|
||||
# if [ ! $(uci -q get dhcp.$to_interface) ] ; then
|
||||
# echo "to_interface $to_interface does not exist in dhcp uci config"
|
||||
# return
|
||||
# fi
|
||||
#
|
||||
#}
|
||||
|
||||
|
||||
foreach_dhcp_option() {
|
||||
dhcp_option=$1
|
||||
|
||||
echo "dhcp_option: $dhcp_option"
|
||||
case $dhcp_option in
|
||||
43) dhcp_option_value=$opt43 ;;
|
||||
66) dhcp_option_value=$opt66 ;;
|
||||
67) dhcp_option_value=$opt67 ;;
|
||||
128) dhcp_option_value=$opt128 ;;
|
||||
132) dhcp_option_value=$opt132 ;;
|
||||
133) dhcp_option_value=$opt133 ;;
|
||||
224) dhcp_option_value=$opt224 ;;
|
||||
225) dhcp_option_value=$opt225 ;;
|
||||
226) dhcp_option_value=$opt226 ;;
|
||||
*) dhcp_option_value="unsupported" ;;
|
||||
esac
|
||||
|
||||
if [ "${dhcp_option_value}" == "unsupported" ] ; then
|
||||
echo "dhcp_option $dhcp_option is unsupported"
|
||||
return
|
||||
fi
|
||||
if [ "${dhcp_option_value}" == "" ] ; then
|
||||
echo "dhcp_option $dhcp_option is empty"
|
||||
return
|
||||
fi
|
||||
|
||||
#echo "dhcp_option: $dhcp_option dhcp_option_value: ${dhcp_option_value}"
|
||||
|
||||
#config_list_foreach $section to_interface foreach_to_interface
|
||||
|
||||
add_section_dhcp_vendorclass $dhcp_option ${dhcp_option_value} $vendorclass
|
||||
}
|
||||
|
||||
foreach_from_interface() {
|
||||
from_interface="$1"
|
||||
#echo "from_interface: $from_interface"
|
||||
if [ "$from_interface" != "$interface" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
dhcp_option=""
|
||||
config_list_foreach $section dhcp_option foreach_dhcp_option
|
||||
#config_list_foreach $section dhcp_options foreach_dhcp_option
|
||||
}
|
||||
|
||||
from_interface=""
|
||||
config_list_foreach $section from_interface foreach_from_interface
|
||||
}
|
||||
|
||||
|
||||
# in uci dhcp config:
|
||||
# remove all the vendorclass sections
|
||||
# that have previosly been configured by this script.
|
||||
# all are identified by "option networkid dhcp_option_relay_*"
|
||||
function dhcp_option_relay_clear_prev()
|
||||
{
|
||||
local to_remove=""
|
||||
|
||||
foreach_vendorclass() {
|
||||
local section="$1"
|
||||
local networkid
|
||||
config_get networkid $section networkid
|
||||
|
||||
case "$networkid"
|
||||
in dhcp_option_relay*)
|
||||
to_remove="$to_remove $section"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
config_load dhcp
|
||||
config_foreach foreach_vendorclass vendorclass
|
||||
|
||||
local sect
|
||||
for sect in $to_remove ; do
|
||||
uci_remove dhcp $sect
|
||||
done
|
||||
uci_commit dhcp
|
||||
}
|
||||
|
||||
|
||||
# the main function
|
||||
function dhcp_option_relay_parse()
|
||||
{
|
||||
local the_json="$@"
|
||||
parse_the_json "$the_json"
|
||||
|
||||
dhcp_option_relay_clear_prev
|
||||
|
||||
newsectionid="0"
|
||||
|
||||
config_load provisioning
|
||||
config_foreach dhcp_option_relay dhcp_option_relay
|
||||
#config_foreach dhcp_option_relay dhcp_options_relay
|
||||
#config_foreach dhcp_option_relay dhcpoption_relay
|
||||
#config_foreach dhcp_option_relay dhcpoptions_relay
|
||||
#config_foreach dhcp_option_relay dhcp_optionrelay
|
||||
#config_foreach dhcp_option_relay dhcp_optionsrelay
|
||||
#config_foreach dhcp_option_relay dhcpoptionrelay
|
||||
#config_foreach dhcp_option_relay dhcpoptionsrelay
|
||||
}
|
||||
|
||||
#dhcp_option_relay_parse
|
||||
@@ -5,7 +5,6 @@ echo $$ > /var/run/iup.pid
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
. /lib/functions/savecfg.sh
|
||||
. /lib/functions/dhcp_option_relay.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
include /lib/upgrade
|
||||
@@ -71,7 +70,8 @@ reload ()
|
||||
local pack
|
||||
pack=$(get_packages $1)
|
||||
v "Calling ubus call uci commit for $pack"
|
||||
for packname in $pack ; do
|
||||
for packname in $pack
|
||||
do
|
||||
ubus call uci commit '{"config":"'$packname'"}'
|
||||
sleep 1
|
||||
done
|
||||
@@ -117,12 +117,10 @@ handle_provisioning() {
|
||||
mkdir $IUPTEMP
|
||||
fi
|
||||
touch $IUPCONFFILES
|
||||
|
||||
config_get_bool enabled "$config" enabled "$default"
|
||||
config_get_bool defaultreset "$config" defaultreset
|
||||
config_get deckey "$config" deckey
|
||||
|
||||
if [ "$enabled" -eq 1 ]; then
|
||||
if [ "$enabled" -eq 1 ]; then
|
||||
if [ "$config" == "iup" ]; then
|
||||
v "Using url received in dhcp options"
|
||||
config_get url "$config" urliup
|
||||
@@ -132,25 +130,26 @@ handle_provisioning() {
|
||||
url=${url//\$MAC/$MAC}
|
||||
v "Downloading from url \"$url\""
|
||||
|
||||
while [ $retry -le $RETRYSTOP ]; do
|
||||
if [ ${url%%:*} == "tftp" ]; then
|
||||
tftpfile=${url#*\/\/}
|
||||
host=${tftpfile%%\/*}
|
||||
tftpfile=${tftpfile#*\/}
|
||||
while [ $retry -le $RETRYSTOP ]
|
||||
do
|
||||
if [ ${url%%:*} == "tftp" ]; then
|
||||
tftpfile=${url#*\/\/}
|
||||
host=${tftpfile%%\/*}
|
||||
tftpfile=${tftpfile#*\/}
|
||||
|
||||
/usr/bin/tftp -l $IUPCONFFILES -r "$tftpfile" -g "$host"
|
||||
else
|
||||
get_image "$url" "cat" > $IUPCONFFILES
|
||||
fi
|
||||
if [ -s $IUPCONFFILES ]; then
|
||||
v "Download finished"
|
||||
retry=$((RETRYSTOP + 1))
|
||||
else
|
||||
v "Download failed, retrying in $incsleep seconds"
|
||||
sleep $incsleep
|
||||
incsleep=$((incsleep * retry + number))
|
||||
retry=$((retry+1))
|
||||
fi
|
||||
/usr/bin/tftp -l $IUPCONFFILES -r "$tftpfile" -g "$host"
|
||||
else
|
||||
get_image "$url" "cat" > $IUPCONFFILES
|
||||
fi
|
||||
if [ -s $IUPCONFFILES ]; then
|
||||
v "Download finished"
|
||||
retry=$((RETRYSTOP + 1))
|
||||
else
|
||||
v "Download failed, retrying in $incsleep seconds"
|
||||
sleep $incsleep
|
||||
incsleep=$((incsleep * retry + number))
|
||||
retry=$((retry+1))
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ ! -s "$IUPCONFFILES" ] && [ "$enabled" -eq 1 ]; then
|
||||
@@ -170,11 +169,11 @@ handle_Downloaded_file()
|
||||
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
|
||||
"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
|
||||
@@ -192,13 +191,15 @@ handle_Downloaded_file()
|
||||
save_usercfg
|
||||
cd $IUPTEMP
|
||||
tar xvzf $IUPCONFFILES
|
||||
for f in $CONFILESLURP ; do
|
||||
for f in $CONFILESLURP
|
||||
do
|
||||
v "File to be applied $f and config $(cat $f)"
|
||||
uci -f $f import
|
||||
done
|
||||
pack=$(get_packages $CONFILESLURP)
|
||||
v "Packages to be commited: $pack"
|
||||
for packname in $pack ; do
|
||||
for packname in $pack
|
||||
do
|
||||
uci commit $packname
|
||||
done
|
||||
apply_usercfg
|
||||
@@ -237,7 +238,7 @@ handle_Downloaded_file()
|
||||
v "Downloaded file is a firmware, will start reflashing"
|
||||
if [ "$defaultreset" -eq 1 ]; then
|
||||
v "Not saving configuration over reflash"
|
||||
/sbin/sysupgrade -v -n $IUPCONFFILES
|
||||
/sbin/sysupgrade -v -n $IUPCONFFILES
|
||||
else
|
||||
v "Saving configuration over reflash"
|
||||
/sbin/sysupgrade -v $IUPCONFFILES
|
||||
@@ -267,20 +268,19 @@ change_to_vlan() {
|
||||
base_dev=$(echo ${base_dev} | cut -d. -f1)
|
||||
|
||||
# add "VLAN interface" to the "end of the file".
|
||||
uci add network device
|
||||
uci rename network.@device[-1]=${name}
|
||||
uci set network.@device[-1].type=8021q
|
||||
uci set network.@device[-1].ifname=${base_dev}
|
||||
uci set network.@device[-1].name="${base_dev}.${1}"
|
||||
uci set network.@device[-1].vid=${1}
|
||||
uci set network.@device[-1].priority=${2}
|
||||
uci add layer2_interface_vlan vlan_interface
|
||||
uci set layer2_interface_vlan.@vlan_interface[-1].name=${name}
|
||||
uci set layer2_interface_vlan.@vlan_interface[-1].vlan8021q=${1}
|
||||
uci set layer2_interface_vlan.@vlan_interface[-1].vlan8021p=${2}
|
||||
uci set layer2_interface_vlan.@vlan_interface[-1].ifname="${base_dev}.${1}"
|
||||
uci set layer2_interface_vlan.@vlan_interface[-1].baseifname=${base_dev}
|
||||
# and commit the change.
|
||||
uci commit network
|
||||
v "option 132: committed update to file network"
|
||||
uci commit layer2_interface_vlan
|
||||
v "option 132: committed update to file layer2_interface_vlan"
|
||||
|
||||
# reload configuration files.
|
||||
/etc/init.d/layer2_interface_vlan reload
|
||||
v "option 132: reload network config"
|
||||
v "option 132: reload layer2_interface_vlan config"
|
||||
|
||||
# replace old interface (like eth0.1 with new eth0.101).
|
||||
wan_if=$(uci get network.$3.ifname)
|
||||
@@ -288,14 +288,14 @@ change_to_vlan() {
|
||||
|
||||
# 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.
|
||||
;;
|
||||
esac
|
||||
#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.
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# append new interface.
|
||||
new_wan_if=${new_wan_if}${base_dev}.${1}
|
||||
@@ -383,10 +383,6 @@ handle_option224()
|
||||
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
|
||||
@@ -530,6 +526,7 @@ main()
|
||||
touch $IUPMD5
|
||||
fi
|
||||
|
||||
|
||||
local iupurl
|
||||
local configurl
|
||||
local software
|
||||
@@ -565,7 +562,7 @@ main()
|
||||
if [ "$filesystem" == "JFFS2" ] ; then
|
||||
firmware=$firmware.w
|
||||
else
|
||||
firmware=$firmware.y3
|
||||
firmware=$firmware.y
|
||||
fi
|
||||
if [ "$sofwareminuspath" == "${sofwareminuspath/$firmware/}" ] ; then
|
||||
v "Software \"$software\""
|
||||
|
||||
42
layer2interface/Makefile
Normal file
42
layer2interface/Makefile
Normal file
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
define Package/layer2interface/install
|
||||
$(CP) ./broadcom/* $(1)/
|
||||
endef
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
define Package/layer2interface/install
|
||||
$(CP) ./broadcom/* $(1)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,layer2interface))
|
||||
48
layer2interface/broadcom/etc/config/dsl
Normal file
48
layer2interface/broadcom/etc/config/dsl
Normal file
@@ -0,0 +1,48 @@
|
||||
# DSL Modes
|
||||
config dsl-line line
|
||||
list mode gdmt
|
||||
list mode glite
|
||||
list mode t1413
|
||||
list mode adsl2
|
||||
list mode adsl2p
|
||||
list mode annexl
|
||||
list mode annexm
|
||||
list mode vdsl2
|
||||
list mode gfast
|
||||
list profile 8a
|
||||
list profile 8b
|
||||
list profile 8c
|
||||
list profile 8d
|
||||
list profile 12a
|
||||
list profile 12b
|
||||
list profile 17a
|
||||
list profile 30a
|
||||
list profile 35b
|
||||
option bitswap 1
|
||||
option sra 1
|
||||
option trellis
|
||||
option sesdrop
|
||||
# VDSL2 only
|
||||
option us0
|
||||
option dynamicd
|
||||
option dynamicf
|
||||
option sos
|
||||
|
||||
config atm-device atm0
|
||||
option name 'ATM'
|
||||
option vpi '8'
|
||||
option vci '35'
|
||||
option device atm0
|
||||
option link_type 'eoa' # EoA, IPoA, PPPoA, CIP
|
||||
option encapsulation 'llc' # llc, vcmux
|
||||
option qos_class 'ubr' # ubr, cbr, gfr, vbr-nrt, vbr-rt, ubr+, abr
|
||||
# option pcr '512'
|
||||
# option scr '256'
|
||||
# option mbs '1024'
|
||||
|
||||
config ptm-device ptm0
|
||||
option name 'PTM'
|
||||
option device 'ptm0'
|
||||
option priority '1'
|
||||
option portid '1'
|
||||
|
||||
26
layer2interface/broadcom/etc/config/layer2_interface
Normal file
26
layer2interface/broadcom/etc/config/layer2_interface
Normal file
@@ -0,0 +1,26 @@
|
||||
config dsltype 'vdsl'
|
||||
option 'enabled' 'on'
|
||||
|
||||
config dsltype 'adsl'
|
||||
option 'enabled' 'on'
|
||||
|
||||
config dslsettings 'capabilities'
|
||||
option 'GDmt' 'Enabled'
|
||||
option 'Glite' 'Enabled'
|
||||
option 'T1413' 'Enabled'
|
||||
option 'ADSL2' 'Enabled'
|
||||
option 'AnnexL' 'Enabled'
|
||||
option 'ADSL2plus' 'Enabled'
|
||||
option 'VDSL2' 'Enabled'
|
||||
option '8a' 'Enabled'
|
||||
option '8b' 'Enabled'
|
||||
option '8c' 'Enabled'
|
||||
option '8d' 'Enabled'
|
||||
option '12a' 'Enabled'
|
||||
option '12b' 'Enabled'
|
||||
option '17a' 'Enabled'
|
||||
option '30a' 'Enabled'
|
||||
option 'US0' 'on'
|
||||
option 'bitswap' 'on'
|
||||
option 'sra' 'on'
|
||||
|
||||
11
layer2interface/broadcom/etc/config/layer2_interface_adsl
Normal file
11
layer2interface/broadcom/etc/config/layer2_interface_adsl
Normal file
@@ -0,0 +1,11 @@
|
||||
config atm_bridge
|
||||
option 'link_type' 'EoA'
|
||||
option 'encapseoa' 'llcsnap_eth'
|
||||
option 'unit' '0'
|
||||
option 'ifname' 'atm0.1'
|
||||
option 'baseifname' 'atm0'
|
||||
option 'vpi' '8'
|
||||
option 'vci' '35'
|
||||
option 'name' 'DSL8_35'
|
||||
option 'atmtype' 'ubr'
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
config ethernet_interface 'Wan'
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
config vdsl_interface
|
||||
option 'unit' '0'
|
||||
option 'ifname' 'ptm0.1'
|
||||
option 'baseifname' 'ptm0'
|
||||
option 'name' 'VDSL2'
|
||||
option 'dslat' '1'
|
||||
option 'ptmprio' '1'
|
||||
option 'ipqos' '1'
|
||||
|
||||
38
layer2interface/broadcom/etc/ethertypes
Normal file
38
layer2interface/broadcom/etc/ethertypes
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# Ethernet frame types
|
||||
# This file describes some of the various Ethernet
|
||||
# protocol types that are used on Ethernet networks.
|
||||
#
|
||||
# This list could be found on:
|
||||
# http://www.iana.org/assignments/ethernet-numbers
|
||||
#
|
||||
# <name> <hexnumber> <alias1>...<alias35> #Comment
|
||||
#
|
||||
IPv4 0800 ip ip4 # Internet IP (IPv4)
|
||||
X25 0805
|
||||
ARP 0806 ether-arp #
|
||||
FR_ARP 0808 # Frame Relay ARP [RFC1701]
|
||||
BPQ 08FF # G8BPQ AX.25 Ethernet Packet
|
||||
DEC 6000 # DEC Assigned proto
|
||||
DNA_DL 6001 # DEC DNA Dump/Load
|
||||
DNA_RC 6002 # DEC DNA Remote Console
|
||||
DNA_RT 6003 # DEC DNA Routing
|
||||
LAT 6004 # DEC LAT
|
||||
DIAG 6005 # DEC Diagnostics
|
||||
CUST 6006 # DEC Customer use
|
||||
SCA 6007 # DEC Systems Comms Arch
|
||||
TEB 6558 # Trans Ether Bridging [RFC1701]
|
||||
RAW_FR 6559 # Raw Frame Relay [RFC1701]
|
||||
AARP 80F3 # Appletalk AARP
|
||||
ATALK 809B # Appletalk
|
||||
802_1Q 8100 8021q 1q 802.1q dot1q # 802.1Q Virtual LAN tagged frame
|
||||
IPX 8137 # Novell IPX
|
||||
NetBEUI 8191 # NetBEUI
|
||||
IPv6 86DD ip6 # IP version 6
|
||||
PPP 880B # PPP
|
||||
ATMMPOA 884C # MultiProtocol over ATM
|
||||
PPP_DISC 8863 # PPPoE discovery messages
|
||||
PPP_SES 8864 # PPPoE session messages
|
||||
ATMFATE 8884 # Frame-based ATM Transport over Ethernet
|
||||
LOOP 9000 loopback # loop proto
|
||||
|
||||
2
layer2interface/broadcom/etc/hotplug.d/dsl/10-devices
Normal file
2
layer2interface/broadcom/etc/hotplug.d/dsl/10-devices
Normal file
@@ -0,0 +1,2 @@
|
||||
[ "$STATUS" == "up" -o "$STATUS" == "down" ] && /etc/init.d/dsl reload
|
||||
|
||||
8
layer2interface/broadcom/etc/hotplug.d/dsl/20-leds
Normal file
8
layer2interface/broadcom/etc/hotplug.d/dsl/20-leds
Normal file
@@ -0,0 +1,8 @@
|
||||
if [ "$STATUS" == "up" ]; then
|
||||
ubus call led.dsl set '{"state":"ok"}'
|
||||
elif [ "$STATUS" == "down" ]; then
|
||||
ubus call led.dsl set '{"state":"off"}'
|
||||
elif [ "$STATUS" == "training" ]; then
|
||||
ubus call led.dsl set '{"state":"alert"}'
|
||||
fi
|
||||
|
||||
73
layer2interface/broadcom/etc/hotplug.d/switch/10-switch
Normal file
73
layer2interface/broadcom/etc/hotplug.d/switch/10-switch
Normal file
@@ -0,0 +1,73 @@
|
||||
include /lib/network
|
||||
|
||||
# true if speed on interface is Gbit
|
||||
gigatest() {
|
||||
local speed=$(ethctl $INTERFACE media-type 2>&1 | awk '{if (NR == 2) print $6}')
|
||||
case "$speed" in
|
||||
1000*) return 0 ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# true if there is a link on any lan port
|
||||
lan_test () {
|
||||
local ledontest
|
||||
for dev in $(db get hw.board.ethernetLanPorts); do
|
||||
ledontest=$(cat /sys/class/net/$dev/operstate)
|
||||
if [ "$ledontest" == "up" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
add|register)
|
||||
INTFNAME=$(interfacename $INTERFACE)
|
||||
OPERSTATE=$(cat /sys/class/net/$INTERFACE/operstate)
|
||||
# if [ "$OPERSTATE" == "up" ]; then
|
||||
if true ; then
|
||||
case "$INTFNAME" in
|
||||
GbE*)
|
||||
ubus call led.lan set '{"state" : "ok"}'
|
||||
ubus call led.gbe set '{"state" : "ok"}'
|
||||
ubus call led.gbe_phy_link set '{"state" : "ok"}'
|
||||
ubus call led.gbe_phy_speed set '{"state": "off"}'
|
||||
$(gigatest) && ubus call led.gbe_phy_speed set '{"state":"ok"}'
|
||||
;;
|
||||
LAN*)
|
||||
ubus call led.lan set '{"state":"ok"}'
|
||||
;;
|
||||
WAN*)
|
||||
ubus call led.wan set '{"state" : "ok"}'
|
||||
ubus call led.wan_phy_link set '{"state" : "ok"}'
|
||||
ubus call led.wan_phy_speed set '{"state" : "off"}'
|
||||
$(gigatest) && ubus call led.wan_phy_speed set '{"state":"ok"}'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
remove|unregister)
|
||||
INTFNAME=$(interfacename $INTERFACE)
|
||||
OPERSTATE=$(cat /sys/class/net/$INTERFACE/operstate)
|
||||
if [ "$OPERSTATE" == "down" ]; then
|
||||
case "$INTFNAME" in
|
||||
GbE*)
|
||||
ubus call led.gbe set '{"state" : "off"}'
|
||||
ubus call led.gbe_phy_link set '{"state" : "off"}'
|
||||
ubus call led.gbe_phy_speed set '{"state" : "off"}'
|
||||
$(lan_test) || ubus call led.lan set '{"state":"off"}'
|
||||
;;
|
||||
LAN*)
|
||||
$(lan_test) || ubus call led.lan set '{"state":"off"}'
|
||||
;;
|
||||
WAN*)
|
||||
ubus call led.wan set '{"state" : "off"}'
|
||||
ubus call led.wan_phy_speed set '{"state" : "off"}'
|
||||
ubus call led.wan_phy_link set '{"state" : "off"}'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
515
layer2interface/broadcom/etc/init.d/dsl
Executable file
515
layer2interface/broadcom/etc/init.d/dsl
Executable file
@@ -0,0 +1,515 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/network
|
||||
|
||||
START=20
|
||||
USE_PROCD=1
|
||||
|
||||
DEVICE_ADDED=0
|
||||
|
||||
device_config_exists() {
|
||||
ubus call uci get '{"config":"network","type":"device"}' | grep -w name | grep -qw "$1" && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
configure_untagged_vlan() {
|
||||
local name="$1"
|
||||
local device="$2"
|
||||
local ifname="$3"
|
||||
|
||||
[ -n "$ifname" -a -n "$name" ] || return
|
||||
device_config_exists "$ifname" && return
|
||||
|
||||
uci -q set network.$name=device
|
||||
uci -q set network.$name.type=untagged
|
||||
uci -q set network.$name.ifname="$device"
|
||||
uci -q set network.$name.name="$ifname"
|
||||
uci -q commit network
|
||||
|
||||
DEVICE_ADDED=1
|
||||
}
|
||||
|
||||
# ATM #
|
||||
check_pvc() {
|
||||
local vpi=$1
|
||||
local vci=$2
|
||||
local ret
|
||||
|
||||
ret=$(xtmctl operate conn --show | awk -v test="$vpi/$vci" '{if ($3==test ) print $5 }')
|
||||
|
||||
case $ret in
|
||||
''|*[!0-9]*) return 0 ;;
|
||||
*) return $ret ;;
|
||||
esac
|
||||
}
|
||||
|
||||
check_xtm_list() {
|
||||
local qclass=$1
|
||||
local pcr scr mbs
|
||||
local ret
|
||||
|
||||
case $# in
|
||||
1)
|
||||
pcr=0
|
||||
scr=0
|
||||
mbs=0
|
||||
;;
|
||||
2)
|
||||
pcr=$2
|
||||
scr=0
|
||||
mbs=0
|
||||
;;
|
||||
4)
|
||||
pcr=$2
|
||||
scr=$3
|
||||
mbs=$4
|
||||
;;
|
||||
esac
|
||||
|
||||
ret=$(xtmctl operate tdte --show | awk -v test="$qclass" -v pcr="$pcr" -v scr="$scr" -v mbs="$mbs" '{if ($2==test && $3==pcr && $4==scr && $5==mbs ) print $1 }')
|
||||
|
||||
case $ret in
|
||||
''|*[!0-9]*) return 0 ;;
|
||||
*) return $ret ;;
|
||||
esac
|
||||
}
|
||||
|
||||
configure_atm_device() {
|
||||
local name vpi vci device link_type encapsulation qos_class pcr mbs scr
|
||||
|
||||
config_get name $1 name "ATM"
|
||||
config_get vpi $1 vpi "8"
|
||||
config_get vci $1 vci "35"
|
||||
config_get device $1 device "atm0"
|
||||
config_get link_type $1 link_type "eoa"
|
||||
config_get encapsulation $1 encapsulation "llc"
|
||||
config_get qos_class $1 qos_class "ubr"
|
||||
config_get pcr $1 pcr
|
||||
config_get mbs $1 mbs
|
||||
config_get scr $1 scr
|
||||
|
||||
check_pvc $vpi $vci
|
||||
ret=$?
|
||||
|
||||
if [ "$ret" -eq 0 ]; then
|
||||
check_xtm_list $qos_class $pcr $scr $mbs
|
||||
ret=$?
|
||||
|
||||
if [ "$ret" -eq 0 ]; then
|
||||
case $qos_class in # ubr, cbr, gfr, vbr-nrt, vbr-rt, ubr+, abr
|
||||
ubr)
|
||||
xtmctl operate tdte --add "$qos_class"
|
||||
;;
|
||||
ubr_pcr|ubr+)
|
||||
xtmctl operate tdte --add "$qos_class" $pcr
|
||||
;;
|
||||
cbr)
|
||||
xtmctl operate tdte --add "$qos_class" $pcr
|
||||
;;
|
||||
nrtvbr|vbr-nrt)
|
||||
xtmctl operate tdte --add "$qos_class" $pcr $scr $mbs
|
||||
;;
|
||||
rtvbr|vbr-rt)
|
||||
xtmctl operate tdte --add "$qos_class" $pcr $scr $mbs
|
||||
;;
|
||||
gfr)
|
||||
;;
|
||||
abr)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $link_type in # EoA, IPoA, PPPoA, CIP
|
||||
EoA|eoa)
|
||||
[ $encapsulation == "vcmux" ] && encapsulation="vcmux_eth" || encapsulation="llcsnap_eth"
|
||||
;;
|
||||
PPPoA|pppoa)
|
||||
[ $encapsulation == "vcmux" ] && encapsulation="vcmux_pppoa" || encapsulation="llcencaps_ppp"
|
||||
;;
|
||||
IPoA|ipoa)
|
||||
[ $encapsulation == "vcmux" ] && encapsulation="vcmux_ipoa" || encapsulation="llcsnap_rtip"
|
||||
;;
|
||||
CIP|cip)
|
||||
;;
|
||||
esac
|
||||
|
||||
check_xtm_list $qos_class $pcr $scr $mbs
|
||||
ret="$?"
|
||||
|
||||
xtmctl operate conn --add 1.$vpi.$vci aal5 $encapsulation 0 1 $ret
|
||||
xtmctl operate conn --addq 1.$vpi.$vci 0 wrr 1 dt # low priority queue
|
||||
xtmctl operate conn --addq 1.$vpi.$vci 1 wrr 1 dt # mid priority queue upstream ACK's and ping from LAN will use this queue
|
||||
xtmctl operate conn --addq 1.$vpi.$vci 7 wrr 1 dt # high priority queue, internal traffic dhcp igmp dns and icmp
|
||||
xtmctl operate conn --createnetdev 1.$vpi.$vci $device
|
||||
xtmctl operate intf --state 1 enable
|
||||
|
||||
configure_untagged_vlan "$name" "$device" "$device.1"
|
||||
[ $DEVICE_ADDED -eq 1 ] && ubus call network reload
|
||||
fi
|
||||
}
|
||||
|
||||
remove_atm_devices() {
|
||||
local vpi vci rest
|
||||
local vpivci=`xtmctl operate conn --show | grep "ATM\|mode" | 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
|
||||
}
|
||||
|
||||
create_atm_devices() {
|
||||
echo "Creating ATM Device(s)"
|
||||
config_load dsl
|
||||
config_foreach configure_atm_device atm-device
|
||||
}
|
||||
# ATM END #
|
||||
|
||||
# PTM #
|
||||
check_ptm() {
|
||||
local ret
|
||||
local ptmprio=$1
|
||||
local dslat=$2
|
||||
|
||||
if [ "$ptmprio" -eq 2 ]; then
|
||||
ptmprio="high"
|
||||
else
|
||||
ptmprio="low"
|
||||
fi
|
||||
|
||||
ret=$(xtmctl operate conn --show | awk -v dslat="$dslat" -v ptmprio="$ptmprio" '{if ($2 == dslat && $3 == ptmprio ) print $2 }')
|
||||
|
||||
case $ret in
|
||||
''|*[!0-9]*) return 0 ;;
|
||||
*) return $ret ;;
|
||||
esac
|
||||
}
|
||||
|
||||
configure_ptm_device() {
|
||||
local name device priority portid
|
||||
|
||||
config_get name $1 name "PTM"
|
||||
config_get device $1 device "ptm0"
|
||||
config_get priority $1 priority 1
|
||||
config_get portid $1 portid 1
|
||||
|
||||
check_ptm $priority $portid
|
||||
ret=$?
|
||||
|
||||
if [ "$ret" -eq 0 ]; then
|
||||
xtmctl operate conn --add $portid.$priority
|
||||
xtmctl operate conn --addq $portid.$priority 0 wrr 1 dt -1 -1 3000 # low priority queue
|
||||
xtmctl operate conn --addq $portid.$priority 1 wrr 1 dt -1 -1 3000 # mid priority queue upstream ACK's and ping from LAN will use this queue
|
||||
xtmctl operate conn --addq $portid.$priority 7 wrr 1 dt -1 -1 3000 # high priority queue, internal traffic dhcp igmp dns and icmp
|
||||
echo "xtmctl operate conn --createnetdev $portid.$priority $device"
|
||||
xtmctl operate conn --createnetdev $portid.$priority $device
|
||||
xtmctl operate intf --state 1 enable
|
||||
|
||||
configure_untagged_vlan "$name" "$device" "$device.1"
|
||||
[ $DEVICE_ADDED -eq 1 ] && ubus call network reload
|
||||
fi
|
||||
}
|
||||
|
||||
remove_ptm_devices() {
|
||||
local delptm
|
||||
local x=0
|
||||
|
||||
IFS=$'\n'
|
||||
for i in `xtmctl operate conn --show | grep "PTM\|mode"`
|
||||
do
|
||||
if [ $x -eq 1 ]; then
|
||||
delptm=$(echo $i | awk '{if ($1!="ATM") print $2"."$11}')
|
||||
echo "xtmctl operate conn --delete $delptm"
|
||||
xtmctl operate conn --delete $delptm
|
||||
xtmctl operate conn --deletenetdev $delptm
|
||||
fi
|
||||
x=1
|
||||
done
|
||||
unset IFS
|
||||
}
|
||||
|
||||
create_ptm_devices() {
|
||||
echo "Creating PTM Device(s)"
|
||||
config_load dsl
|
||||
config_foreach configure_ptm_device ptm-device
|
||||
}
|
||||
# PTM END #
|
||||
|
||||
prioritize_arp()
|
||||
{
|
||||
ebtables -t nat -D POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
|
||||
ebtables -t nat -A POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
|
||||
}
|
||||
|
||||
remove_devices() {
|
||||
remove_atm_devices
|
||||
remove_ptm_devices
|
||||
}
|
||||
|
||||
create_devices() {
|
||||
local tpstc="$(xdslctl info --show | grep TPS-TC)"
|
||||
if echo "$tpstc" | grep -q "ATM Mode"; then
|
||||
create_atm_devices
|
||||
elif echo "$tpstc" | grep -q "PTM Mode"; then
|
||||
create_ptm_devices
|
||||
fi
|
||||
}
|
||||
|
||||
start_dsl() {
|
||||
local VDSL=0
|
||||
local GFAST=0
|
||||
local mod=""
|
||||
local modes=""
|
||||
local profile=""
|
||||
|
||||
config_load dsl
|
||||
|
||||
# Modes
|
||||
config_get mode line mode
|
||||
for mod in $mode; do
|
||||
[ $mod == "gdmt" ] && "${modes}d"
|
||||
[ $mod == "glite" ] && modes="${modes}l"
|
||||
[ $mod == "t1413" ] && modes="${modes}t"
|
||||
[ $mod == "adsl2" ] && modes="${modes}2"
|
||||
[ $mod == "adsl2p" ] && modes="${modes}p"
|
||||
[ $mod == "annexl" ] && modes="${modes}e"
|
||||
[ $mod == "annexm" ] && modes="${modes}m"
|
||||
[ $mod == "vdsl2" ] && modes="${modes}v" && VDSL=1
|
||||
[ $mod == "gfast" ] && modes="${modes}f" && GFAST=1
|
||||
done
|
||||
|
||||
# VDSL Profiles
|
||||
config_get profile line profile
|
||||
profile="$(echo $profile | sed 's/35b/BrcmPriv1/g')"
|
||||
|
||||
# Capabilities
|
||||
config_get_bool bitswap line bitswap 1
|
||||
[ $bitswap -eq 1 ] && bitswap="on" || bitswap="off"
|
||||
config_get_bool sra line sra 1
|
||||
[ $sra -eq 1 ] && sra="on" || sra="off"
|
||||
# config_get_bool trellis line trellis 1
|
||||
# config_get_bool sesdrop line sesdrop 1
|
||||
# VDSL2 only
|
||||
config_get_bool us0 line us0 1
|
||||
[ $us0 -eq 1 ] && us0="on" || us0="off"
|
||||
# config_get_bool dynamicd line dynamicd 1
|
||||
# config_get_bool dynamicf line dynamicf 1
|
||||
# config_get_bool sos line sos 1
|
||||
|
||||
|
||||
echo "Starting DSL"
|
||||
|
||||
xtmctl start
|
||||
xtmctl operate intf --state 1 enable
|
||||
|
||||
if [ $VDSL -eq 1 -o $GFAST -eq 1 ]; then
|
||||
echo "xdslctl start --up --mod $modes --profile "$profile" --sra $sra --bitswap $bitswap --us0 $us0"
|
||||
xdslctl start --up --mod $modes --profile "$profile" --sra $sra --bitswap $bitswap --us0 $us0
|
||||
else
|
||||
echo "xdslctl start --up --mod $modes --sra $sra --bitswap $bitswap"
|
||||
xdslctl start --up --mod $modes --sra $sra --bitswap $bitswap
|
||||
fi
|
||||
|
||||
if [ $GFAST -eq 1 ]; then
|
||||
# enable V43 tone set for GFAST
|
||||
echo "xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x400000 0x400000"
|
||||
xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x400000 0x400000
|
||||
fi
|
||||
}
|
||||
|
||||
# CONVERT OLD CONFIG #
|
||||
convert_old_atm() {
|
||||
local name ifname baseifname
|
||||
local vpi vci link_type atmtype pcr scr mbs
|
||||
local encapseoa encapspppoa encapsipoa encapsulation
|
||||
|
||||
config_get atmtype $1 atmtype "ubr"
|
||||
config_get link_type $1 link_type "EoA"
|
||||
config_get pcr $1 pcr
|
||||
config_get scr $1 scr
|
||||
config_get mbs $1 mbs
|
||||
config_get vpi $1 vpi "8"
|
||||
config_get vci $1 vci "35"
|
||||
config_get encapseoa $1 encapseoa
|
||||
config_get encapspppoa $1 encapspppoa
|
||||
config_get encapsipoa $1 encapsipoa
|
||||
config_get baseifname $1 baseifname "atm0"
|
||||
config_get name $1 name "ATM$vpi$vci"
|
||||
|
||||
uci -q set dsl.$baseifname=atm-device
|
||||
uci -q set dsl.$baseifname.name="$name"
|
||||
uci -q set dsl.$baseifname.device="$baseifname"
|
||||
uci -q set dsl.$baseifname.qos_class="$atmtype"
|
||||
uci -q set dsl.$baseifname.vpi="$vpi"
|
||||
uci -q set dsl.$baseifname.vci="$vci"
|
||||
uci -q set dsl.$baseifname.pcr="$pcr"
|
||||
uci -q set dsl.$baseifname.mbs="$mbs"
|
||||
uci -q set dsl.$baseifname.scr="$scr"
|
||||
|
||||
case $link_type in
|
||||
EoA)
|
||||
uci -q set dsl.$baseifname.link_type="eoa"
|
||||
[ "$encapseoa" == "vcmux_eth" ] && encapsulation="vcmux" || encapsulation="llc"
|
||||
uci -q set dsl.$baseifname.encapsulation="$encapsulation"
|
||||
;;
|
||||
PPPoA)
|
||||
uci -q set dsl.$baseifname.link_type="pppoa"
|
||||
[ "$encapspppoa" == "vcmux_pppoa" ] && encapsulation="vcmux" || encapsulation="llc"
|
||||
uci -q set dsl.$baseifname.encapsulation="$encapsulation"
|
||||
;;
|
||||
IPoA)
|
||||
uci -q set dsl.$baseifname.link_type="ipoa"
|
||||
[ "$encapsipoa" == "vcmux_ipoa" ] && encapsulation="vcmux" || encapsulation="llc"
|
||||
uci -q set dsl.$baseifname.encapsulation="$encapsulation"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
convert_old_ptm() {
|
||||
local name ifname baseifname
|
||||
local dslat ptmprio
|
||||
|
||||
config_get name $1 name "PTM"
|
||||
config_get baseifname $1 baseifname "ptm0"
|
||||
config_get dslat $1 dslat
|
||||
config_get ptmprio $1 ptmprio
|
||||
|
||||
uci -q set dsl.$baseifname=ptm-device
|
||||
uci -q set dsl.$baseifname.name="$name"
|
||||
uci -q set dsl.$baseifname.device="$baseifname"
|
||||
uci -q set dsl.$baseifname.priority="$ptmprio"
|
||||
uci -q set dsl.$baseifname.portid="$dslat"
|
||||
}
|
||||
|
||||
convert_old_dsl() {
|
||||
local cap
|
||||
|
||||
sed -i 's/Enabled/1/g' /etc/config/layer2_interface
|
||||
sed -i 's/Disabled/0/g' /etc/config/layer2_interface
|
||||
|
||||
|
||||
uci -q delete dsl.line.mode
|
||||
uci -q delete dsl.line.profile
|
||||
uci -q delete dsl.line.us0
|
||||
uci -q delete dsl.line.sra
|
||||
uci -q delete dsl.line.bitswap
|
||||
|
||||
config_load layer2_interface
|
||||
# Mode
|
||||
config_get_bool cap capabilities GDmt 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=gdmt
|
||||
config_get_bool cap capabilities Glite 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=glite
|
||||
config_get_bool cap capabilities T1413 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=t1413
|
||||
config_get_bool cap capabilities ADSL2 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=adsl2
|
||||
config_get_bool cap capabilities ADSL2plus 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=adsl2p
|
||||
config_get_bool cap capabilities AnnexL 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=annexl
|
||||
config_get_bool cap capabilities AnnexM 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=annexm
|
||||
config_get_bool cap capabilities VDSL2 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=vdsl2
|
||||
config_get_bool cap capabilities GFast 0
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.mode=gfast
|
||||
|
||||
# Profile
|
||||
config_get_bool cap capabilities 8a 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=8a
|
||||
config_get_bool cap capabilities 8b 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=8b
|
||||
config_get_bool cap capabilities 8c 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=8c
|
||||
config_get_bool cap capabilities 8d 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=8d
|
||||
config_get_bool cap capabilities 12a 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=12a
|
||||
config_get_bool cap capabilities 12b 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=12b
|
||||
config_get_bool cap capabilities 17a 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=17a
|
||||
config_get_bool cap capabilities 30a 1
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=30a
|
||||
config_get_bool cap capabilities 35b 0
|
||||
[ $cap -eq 1 ] && uci -q add_list dsl.line.profile=35b
|
||||
|
||||
# Capability
|
||||
config_get_bool cap capabilities US0 1
|
||||
uci -q set dsl.line.us0=$cap
|
||||
config_get_bool cap capabilities bitswap 1
|
||||
uci -q set dsl.line.bitswap=$cap
|
||||
config_get_bool cap capabilities sra 1
|
||||
uci -q set dsl.line.sra=$cap
|
||||
}
|
||||
|
||||
convert_old_config() {
|
||||
[ -f /etc/config/dsl ] || touch /etc/config/dsl
|
||||
|
||||
# DSL
|
||||
if uci -q get layer2_interface.capabilities >/dev/null; then
|
||||
convert_old_dsl
|
||||
fi
|
||||
|
||||
# ATM Devices
|
||||
if uci -q get layer2_interface_adsl.@atm_bridge[0] >/dev/null; then
|
||||
config_load layer2_interface_adsl
|
||||
config_foreach convert_old_atm atm_bridge
|
||||
fi
|
||||
|
||||
# PTM Devices
|
||||
if uci -q get layer2_interface_vdsl.@vdsl_interface[0] >/dev/null; then
|
||||
config_load layer2_interface_vdsl
|
||||
config_foreach convert_old_ptm vdsl_interface
|
||||
fi
|
||||
|
||||
uci -q commit dsl
|
||||
|
||||
# rm -f /etc/config/layer2_interface
|
||||
# rm -f /etc/config/layer2_interface_adsl
|
||||
# rm -f /etc/config/layer2_interface_vdsl
|
||||
}
|
||||
# CONVERT OLD CONFIG END#
|
||||
|
||||
start_service() {
|
||||
create_devices
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
remove_devices
|
||||
|
||||
# echo "Stopping DSL"
|
||||
# stop causes IRQ issues
|
||||
# xdslctl stop
|
||||
}
|
||||
|
||||
boot() {
|
||||
local HASADSL="$(db -q get hw.board.hasAdsl)"
|
||||
local HASVDSL="$(db -q get hw.board.hasVdsl)"
|
||||
[ "$HASADSL" == "1" -o "$HASVDSL" == "1" ] || return
|
||||
|
||||
convert_old_config
|
||||
|
||||
prioritize_arp
|
||||
start_dsl
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger dsl layer2_interface layer2_interface_adsl layer2_interface_vdsl
|
||||
}
|
||||
|
||||
119
layer2interface/broadcom/etc/init.d/layer2
Executable file
119
layer2interface/broadcom/etc/init.d/layer2
Executable file
@@ -0,0 +1,119 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/network
|
||||
|
||||
START=20
|
||||
USE_PROCD=1
|
||||
|
||||
DEVICE_ADDED=0
|
||||
|
||||
device_config_exists() {
|
||||
ubus call uci get '{"config":"network","type":"device"}' | grep -w name | grep -qw "$1" && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
configure_ethernet_iface() {
|
||||
local name baseifname ifname
|
||||
|
||||
config_get name $1 name
|
||||
config_get baseifname $1 baseifname
|
||||
config_get ifname $1 ifname
|
||||
|
||||
[ -n "$ifname" -a -n "$name" ] || return
|
||||
device_config_exists "$ifname" && return
|
||||
|
||||
uci -q set network.$name=device
|
||||
uci -q set network.$name.type=untagged
|
||||
uci -q set network.$name.ifname="$baseifname"
|
||||
uci -q set network.$name.name="$ifname"
|
||||
|
||||
DEVICE_ADDED=1
|
||||
}
|
||||
|
||||
configure_vlan_iface() {
|
||||
local name baseifname ifname
|
||||
local vlan8021p vlan8021q
|
||||
|
||||
config_get name $1 name
|
||||
config_get baseifname $1 baseifname
|
||||
config_get ifname $1 ifname
|
||||
config_get vlan8021p $1 vlan8021p
|
||||
config_get vlan8021q $1 vlan8021q
|
||||
|
||||
[ -n "$ifname" -a -n "$name" ] || return
|
||||
device_config_exists "$ifname" && return
|
||||
|
||||
uci -q set network.$name=device
|
||||
uci -q set network.$name.type=8021q
|
||||
uci -q set network.$name.priority=$vlan8021p
|
||||
uci -q set network.$name.vid="$vlan8021q"
|
||||
uci -q set network.$name.ifname="$baseifname"
|
||||
uci -q set network.$name.name="$ifname"
|
||||
uci -q commit network
|
||||
|
||||
DEVICE_ADDED=1
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load layer2_interface_ethernet
|
||||
config_foreach configure_ethernet_iface ethernet_interface
|
||||
|
||||
config_load layer2_interface_vlan
|
||||
config_foreach configure_vlan_iface vlan_interface
|
||||
|
||||
[ $DEVICE_ADDED -eq 1 ] && ubus call network reload
|
||||
}
|
||||
|
||||
boot() {
|
||||
local baseifname port unit uplinkport
|
||||
|
||||
config_load layer2_interface_ethernet
|
||||
config_get baseifname Wan baseifname
|
||||
|
||||
[ -n "$baseifname" ] || baseifname="$(db -q get hw.board.ethernetWanPort)"
|
||||
|
||||
uplinkport=$(uci show ports | grep "uplink='1'" | cut -d'.' -f2)
|
||||
|
||||
if [ -n "$uplinkport" ]; then
|
||||
baseifname="$(uci -q get ports.$uplinkport.ifname)"
|
||||
else
|
||||
uplinkport=$(uci show ports | grep "ifname='$baseifname'" | cut -d'.' -f2)
|
||||
[ -n "$uplinkport" ] && uci -q set ports.$uplinkport.uplink=1 && uci commit ports
|
||||
fi
|
||||
|
||||
# if [ "$(db get hw.board.hardware)" != "EG300" ]; then
|
||||
# if [ "$(get_port_speed $baseifname)" != "1000FD" ]; 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
|
||||
|
||||
unit=$(echo $(get_port_number $baseifname) | cut -d ' ' -f 1)
|
||||
port=$(echo $(get_port_number $baseifname) | cut -d ' ' -f 2)
|
||||
|
||||
ethswctl -c pause -n $unit -p $port -v 1
|
||||
|
||||
ethswctl -c hw-switching -o enable
|
||||
|
||||
if [ -n "$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
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger layer2_interface_ethernet layer2_interface_vlan
|
||||
}
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
#!/bin/sh
|
||||
|
||||
hasEthWan="$(db -q get hw.board.hasEthWan)"
|
||||
hasEthWan=${hasEthWan:-1}
|
||||
hasAdsl="$(db -q get hw.board.hasAdsl)"
|
||||
hasVdsl="$(db -q get hw.board.hasVdsl)"
|
||||
|
||||
LANPORTS="$(db -q get hw.board.ethernetLanPorts)"
|
||||
|
||||
ETHDEV=""
|
||||
PTMDEV=""
|
||||
ATMDEV=""
|
||||
WANIFACE=""
|
||||
|
||||
device_config_exists() {
|
||||
ubus call uci get '{"config":"network","type":"device"}' | grep -w name | grep -qw "$1" && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
populate_dsl_settings() {
|
||||
if [ "$hasAdsl" == "0" -a "$hasVdsl" == "0" ]; then
|
||||
rm -f /etc/config/dsl
|
||||
return
|
||||
else
|
||||
touch /etc/config/dsl
|
||||
fi
|
||||
|
||||
if ! uci -q get dsl.line >/dev/null; then
|
||||
uci -q set dsl.line="dsl-line"
|
||||
if [ "$hasAdsl" == "1" ]; then
|
||||
# Mode
|
||||
uci -q add_list dsl.line.mode=gdmt
|
||||
uci -q add_list dsl.line.mode=glite
|
||||
uci -q add_list dsl.line.mode=t1413
|
||||
uci -q add_list dsl.line.mode=adsl2
|
||||
uci -q add_list dsl.line.mode=adsl2p
|
||||
uci -q add_list dsl.line.mode=annexl
|
||||
uci -q add_list dsl.line.mode=annexm
|
||||
uci -q add_list dsl.line.mode=vdsl2
|
||||
#uci -q add_list dsl.line.mode=gfast
|
||||
fi
|
||||
|
||||
if [ "$hasVdsl" == "1" ]; then
|
||||
# Mode
|
||||
uci -q add_list dsl.line.mode=vdsl2
|
||||
|
||||
# Profile
|
||||
uci -q add_list dsl.line.profile=8a
|
||||
uci -q add_list dsl.line.profile=8b
|
||||
uci -q add_list dsl.line.profile=8c
|
||||
uci -q add_list dsl.line.profile=8d
|
||||
uci -q add_list dsl.line.profile=12a
|
||||
uci -q add_list dsl.line.profile=12b
|
||||
uci -q add_list dsl.line.profile=17a
|
||||
uci -q add_list dsl.line.profile=30a
|
||||
#uci -q add_list dsl.line.profile=35b
|
||||
|
||||
# Capability
|
||||
uci -q set dsl.line.us0=1
|
||||
fi
|
||||
|
||||
# Capability
|
||||
uci -q set dsl.line.bitswap=1
|
||||
uci -q set dsl.line.sra=1
|
||||
fi
|
||||
|
||||
uci -q commit dsl
|
||||
}
|
||||
|
||||
populate_atm_device() {
|
||||
[ "$hasAdsl" == "0" ] && return
|
||||
|
||||
# ATM Device
|
||||
if ! uci -q get dsl.@atm-device[0] >/dev/null; then
|
||||
uci -q set dsl.atm0=atm-device
|
||||
uci -q set dsl.atm0.name="ATM835"
|
||||
uci -q set dsl.atm0.device="atm0"
|
||||
uci -q set dsl.atm0.vpi="8"
|
||||
uci -q set dsl.atm0.vci="35"
|
||||
uci -q set dsl.atm0.qos_class="ubr"
|
||||
uci -q set dsl.atm0.link_type="eoa"
|
||||
uci -q set dsl.atm0.encapsulation="llc"
|
||||
uci -q commit dsl
|
||||
else
|
||||
ATMDEV="$(uci -q get dsl.@atm-device[0].device)"
|
||||
fi
|
||||
|
||||
ATMDEV="${ATMDEV:-atm0}"
|
||||
|
||||
WANIFACE="$ATMDEV.1"
|
||||
|
||||
device_config_exists "$WANIFACE" && return
|
||||
|
||||
uci -q set network.atmwan=device
|
||||
uci -q set network.atmwan.type=untagged
|
||||
uci -q set network.atmwan.ifname="$ATMDEV"
|
||||
uci -q set network.atmwan.name="$WANIFACE"
|
||||
}
|
||||
|
||||
populate_ptm_device() {
|
||||
[ "$hasVdsl" == "0" ] && return
|
||||
|
||||
# PTM Device
|
||||
if ! uci -q get dsl.@ptm-device[0] >/dev/null; then
|
||||
uci -q set dsl.ptm0=atm-device
|
||||
uci -q set dsl.ptm0.name="PTM"
|
||||
uci -q set dsl.ptm0.device="ptm0"
|
||||
uci -q set dsl.ptm0.priority="1"
|
||||
uci -q set dsl.ptm0.portid="1"
|
||||
uci -q commit dsl
|
||||
else
|
||||
PTMDEV="$(uci -q get dsl.@ptm-device[0].device)"
|
||||
fi
|
||||
|
||||
PTMDEV="${PTMDEV:-ptm0}"
|
||||
|
||||
WANIFACE="$PTMDEV.1"
|
||||
|
||||
device_config_exists "$PTMDEV" && return
|
||||
|
||||
uci -q set network.ptmwan=device
|
||||
uci -q set network.ptmwan.type=untagged
|
||||
uci -q set network.ptmwan.ifname="$PTMDEV"
|
||||
uci -q set network.ptmwan.name="$WANIFACE"
|
||||
}
|
||||
|
||||
populate_eth_device() {
|
||||
[ "$hasEthWan" == "0" ] && return
|
||||
|
||||
ETHDEV="$(db -q get hw.board.ethernetWanPort)"
|
||||
|
||||
WANIFACE="$ETHDEV.1"
|
||||
|
||||
device_config_exists "$WANIFACE" && return
|
||||
|
||||
uci -q set network.ethwan=device
|
||||
uci -q set network.ethwan.type=untagged
|
||||
uci -q set network.ethwan.ifname="$ETHDEV"
|
||||
uci -q set network.ethwan.name="$WANIFACE"
|
||||
}
|
||||
|
||||
populate_network_config_ifnames() {
|
||||
# LAN ports
|
||||
uci -q get network.lan.ifname >/dev/null || uci -q set network.lan.ifname="$LANPORTS"
|
||||
|
||||
[ $((hasEthWan+hasAdsl+hasVdsl)) -eq 0 ] && {
|
||||
uci -q commit network
|
||||
return
|
||||
}
|
||||
|
||||
WANTYPE="$(uci -q get network.wan.type)"
|
||||
[ "$WANTYPE" == "anywan" ] && {
|
||||
uci -q delete network.wan.type
|
||||
uci -q set network.wan.ifname="$WANIFACE"
|
||||
}
|
||||
|
||||
uci -q get network.wan.ifname >/dev/null || uci -q set network.wan.ifname="$WANIFACE"
|
||||
|
||||
uci -q commit network
|
||||
}
|
||||
|
||||
populate_dsl_settings
|
||||
populate_atm_device
|
||||
populate_ptm_device
|
||||
populate_eth_device
|
||||
populate_network_config_ifnames
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.1
|
||||
PKG_SOURCE_URL:=http://public.inteno.se/libpicoevent
|
||||
PKG_SOURCE_URL:=git@public.inteno.se:libpicoevent.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c96770b32f66c6e799f8430d8e85d94780358135
|
||||
PKG_NAME:=libpicoevent
|
||||
|
||||
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=http://public.inteno.se/owsd.git
|
||||
PKG_SOURCE_VERSION:=fa25ad0b5af3c9a5c16124a9f699dae3be7b68dd
|
||||
PKG_SOURCE_VERSION:=1a815efff25ae4d52bfee67cc4642eb4627f1388
|
||||
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>
|
||||
@@ -61,8 +61,8 @@ define Package/owsd/install
|
||||
$(INSTALL_CONF) ./files/owsd.config $(1)/etc/config/owsd
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/owsd.hotplug $(1)/etc/hotplug.d/iface/55-owsd
|
||||
# $(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
# $(INSTALL_BIN) ./files/owsd.uci_default $(1)/etc/uci-defaults/55-owsd-interfaces
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/owsd.uci_default $(1)/etc/uci-defaults/55-owsd-interfaces
|
||||
endef
|
||||
|
||||
define Package/owsd-testdata
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
config owsd 'global'
|
||||
option sock '/var/run/ubus.sock'
|
||||
option www '/www'
|
||||
# option redirect '/cgi-bin/luci:/cacheflush.html'
|
||||
option redirect '/cgi-bin/luci:/cacheflush.html'
|
||||
# option www_maxage '3600'
|
||||
|
||||
# ubusproxy is enbaled if: enable = 1 or peer exists or path exists
|
||||
|
||||
@@ -151,7 +151,6 @@ validate_owsd_iface() {
|
||||
'whitelist_dhcp_domains:bool:0' \
|
||||
'ipv6:bool:1' \
|
||||
'ipv6only:bool:0' \
|
||||
'linklocal:bool:0' \
|
||||
'cert:file' \
|
||||
'key:file' \
|
||||
'ca:file' \
|
||||
@@ -161,7 +160,7 @@ validate_owsd_iface() {
|
||||
}
|
||||
|
||||
parse_owsd_iface() {
|
||||
local port interface whitelist_interface_as_origin whitelist_dhcp_domains ipv6 ipv6only linklocal
|
||||
local port interface whitelist_interface_as_origin whitelist_dhcp_domains ipv6 ipv6only
|
||||
local cert key ca
|
||||
local restrict_to_user
|
||||
|
||||
@@ -200,7 +199,7 @@ parse_owsd_iface() {
|
||||
}
|
||||
|
||||
local http="http${cert:+s}"
|
||||
local ip4addrs ip6addrs linklocaladdrs
|
||||
local ip4addrs ip6addrs
|
||||
|
||||
# bind to some network
|
||||
if [ -n "${interface}" ]; then
|
||||
@@ -218,11 +217,6 @@ parse_owsd_iface() {
|
||||
# ipv6 addresses
|
||||
if [ "${ipv6}" -eq 1 ]; then
|
||||
network_get_ipaddrs6 ip6addrs "${interface}"
|
||||
if [ "${linklocal}" -eq 1 ]; then
|
||||
network_get_device device "${interface}"
|
||||
[ -n "${device}" ] && linklocaladdrs=$(ifconfig $device | grep inet6 | grep Scope:Link | awk '{print$3}' | cut -d'/' -f1)
|
||||
ip6addrs="${ip6addrs} ${linklocaladdrs}"
|
||||
fi
|
||||
fi
|
||||
for addr in ${ip6addrs}; do
|
||||
new_listen_socket "$1" "${addr}"
|
||||
|
||||
@@ -36,7 +36,7 @@ define Package/peripheral_manager
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Application deamon for handling of peripheral
|
||||
URL:=
|
||||
DEPENDS:=+libuci +libubus +libblobmsg-json +PACKAGE_bcmkernel:bcmkernel +PACKAGE_bcmopen:bcmopen
|
||||
DEPENDS:=+libuci +libubus +libblobmsg-json +PACKAGE_bcmkernel:bcmkernel
|
||||
endef
|
||||
|
||||
define Package/peripheral_manager/description
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
usage () {
|
||||
echo "Usage: ledctl [normal|test|allon|alloff|production]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ $# -ne 1 ] && usage
|
||||
ledstate=$(echo $1 | tr '[A-Z]' '[a-z]')
|
||||
|
||||
case $ledstate in
|
||||
normal|test|allon|alloff|production)
|
||||
ubus call leds set "{\"state\" : \"$ledstate\"}"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -26,10 +26,9 @@ check_for_config(){
|
||||
uci set ports.@ethport[-1].name="$(interfacename $port)"
|
||||
uci set ports.@ethport[-1].ifname=$port
|
||||
uci set ports.@ethport[-1].speed='auto'
|
||||
if [ "$(db -q get hw.board.ethernetWanPort)" = "$port" ]
|
||||
if [ "$(interfacename $port)" = "WAN" ]
|
||||
then
|
||||
uci set ports.@ethport[-1].pause=1
|
||||
uci set ports.@ethport[-1].uplink=1
|
||||
else
|
||||
uci set ports.@ethport[-1].pause=0
|
||||
fi
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=3.1.40
|
||||
|
||||
PKG_SOURCE_VERSION:=d3a77faeadac7c7094fa084524d08e03c296bb56
|
||||
PKG_SOURCE_VERSION:=4bb88410200d26780dae58e624da23d32f48b942
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=http://public.inteno.se:/questd
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ start_service() {
|
||||
procd_set_param command "/sbin/graphd"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
# pidof imonitor > /dev/null 2>&1 || /sbin/imonitor &
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user