Compare commits

..

19 Commits

Author SHA1 Message Date
Sukru Senli
092b3fbfc8 icwmp-3.0-2017-05-01 2017-05-02 15:55:02 +02:00
Sukru Senli
25e177c7de inteno-netmodes: fix macro in layer2_interface_ethernet config as well 2017-05-02 09:50:35 +02:00
Alex Oprea
2396131a5c imonitor: do not check the ubus call before restarting questd
Do no check the ubus call before restarting questd
	because in some cases the ubus call still works as normal,
	even if there are 2 questd processes running.
2017-04-26 11:20:52 +02:00
Sukru Senli
b5311e09c6 icwmp-3.0-2017-04-26 2017-04-26 10:38:55 +02:00
Sukru Senli
2edcda6715 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* a6b12a9 initialize clients with repeated flag as false
-------------------------------------------------------------------------------
commit a6b12a910caf7c1e1b868f4f97ed004ca2bacf03
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-04-13 10:34:03 +0200

    initialize clients with repeated flag as false

Base directory -> /
 network.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
2017-04-13 10:35:38 +02:00
Alex Oprea
b0b3e6434e imonitor: restart acsd if it's using more than 20% processor 2017-04-12 16:12:08 +02:00
Alex Oprea
71d392fb9c iup: fix typo 2017-04-12 15:04:37 +02:00
Alex Oprea
23a7b45f65 iup: fix flow in handle provisioning 2017-04-12 14:03:05 +02:00
Sukru Senli
be2672ba87 Revert "icwmp: do not copy over dmmap config file"
This reverts commit b6485ad3c2.
2017-04-12 10:56:12 +02:00
Reidar Cederqvist
731af2534c Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 618a0ee network: ports call do not show repeated clients on port
* af73e44 graphd: added missing include (pthread)
-------------------------------------------------------------------------------
commit 618a0ee2a4c8022f6c55a8bb2580b1df31681846
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2017-04-12 10:15:23 +0200

    network: ports call do not show repeated clients on port

Base directory -> /
 network.c | 2 ++
 1 file changed, 2 insertions(+)
-------------------------------------------------------------------------------
commit af73e4495f6fb4aaaf8bdfb3610ec78df5038e5a
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2017-04-10 11:28:44 +0200

    graphd: added missing include (pthread)

Base directory -> /
 graphd.c | 1 +
 1 file changed, 1 insertion(+)
-------------------------------------------------------------------------------
2017-04-12 10:55:53 +02:00
Alex Oprea
4df1a9537b iup: do not check for file nor reboot if the section is not enabled 2017-04-11 16:40:23 +02:00
Sukru Senli
93f8e773f2 inteno-netmodes: make sure network config has no trailing spaces in ifname 2017-04-11 14:34:01 +02:00
Sukru Senli
b6485ad3c2 icwmp: do not copy over dmmap config file 2017-04-11 12:35:35 +02:00
Sukru Senli
160b2d2ab9 icwmp-3.0-2017-04-10 2017-04-10 16:07:11 +02:00
Erik Horemans
8e55630c38 new ice-client R4.3.0-RC13 2017-04-07 09:15:59 +02:00
Sukru Senli
094760cd1f icwmp-3.0-2017-04-05 2017-04-06 09:59:59 +02:00
Sukru Senli
1f846df579 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* 8d89f66 router.network: update linkspeed of a port for each call
-------------------------------------------------------------------------------
commit 8d89f663e30b93cd314df708bf6abbef342d52ee
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-04-05 12:41:22 +0200

    router.network: update linkspeed of a port for each call

Base directory -> /
 network.c | 7 +++++++
 1 file changed, 7 insertions(+)
-------------------------------------------------------------------------------
2017-04-05 12:42:14 +02:00
Reidar Cederqvist
8562a2b815 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* f723937 broadcom.c, scanresults: fixed rssi for mips platform
* 6d6a0ea added definition for wl_get_maxrate in broadcom.c
* b626c5c wificontrol: mtk: kick out wireless clients if uplink connection is lost
* 132c97f makefile clean : remove graphd binary
-------------------------------------------------------------------------------
commit f7239379bbf2014a9ceef947bcc6cdbd03596f3e
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2017-04-05 10:15:35 +0200

    broadcom.c, scanresults: fixed rssi for mips platform

Base directory -> /
 broadcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
-------------------------------------------------------------------------------
commit 6d6a0eaf616c1b3c1fd817d28d5df911c084fe58
Author: Reidar Cederqvist <reidar.cederqvist@gmail.com>
Date: 2017-04-05 10:14:04 +0200

    added definition for wl_get_maxrate in broadcom.c

    and change the return-type to void because it never returned anything

Base directory -> /
 broadcom.c | 2 +-
 broadcom.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
-------------------------------------------------------------------------------
commit b626c5c92f58a36a84e83d4cacec65cfb11d6e3e
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-04-03 11:54:31 +0200

    wificontrol: mtk: kick out wireless clients if uplink connection is lost

Base directory -> /
 wificontrol.c | 2 ++
 1 file changed, 2 insertions(+)
-------------------------------------------------------------------------------
commit 132c97f4fda5b6ec0a3ced5852c4683c17c4cf1e
Author: Alex Oprea <alex.oprea@inteno.se>
Date: 2017-03-28 14:10:38 +0200

    makefile clean : remove graphd binary

Base directory -> /
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2017-04-05 10:57:16 +02:00
Sukru Senli
c8084f0459 Update feed [ feed_inteno_packages ] package [ questd ]
-------------------------------------------------------------------------------
* b626c5c wificontrol: mtk: kick out wireless clients if uplink connection is lost
* 132c97f makefile clean : remove graphd binary
-------------------------------------------------------------------------------
commit b626c5c92f58a36a84e83d4cacec65cfb11d6e3e
Author: Sukru Senli <sukru.senli@inteno.se>
Date: 2017-04-03 11:54:31 +0200

    wificontrol: mtk: kick out wireless clients if uplink connection is lost

Base directory -> /
 wificontrol.c | 2 ++
 1 file changed, 2 insertions(+)
-------------------------------------------------------------------------------
commit 132c97f4fda5b6ec0a3ced5852c4683c17c4cf1e
Author: Alex Oprea <alex.oprea@inteno.se>
Date: 2017-03-28 14:10:38 +0200

    makefile clean : remove graphd binary

Base directory -> /
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
-------------------------------------------------------------------------------
2017-04-05 10:57:14 +02:00
51 changed files with 773 additions and 1816 deletions

View File

@@ -11,7 +11,6 @@ config_get bindintf SIP bindintf
if [ -n "$bindintf" ]; then
network_get_ipaddr bindaddr "$bindintf"
[ -z "$bindaddr" ] && network_get_ipaddr6 bindaddr "$bindintf"
bindaddr="${bindaddr:-0.0.0.0}"
sed -i "s/bindaddr=.*/bindaddr=$bindaddr/g" /etc/asterisk/sip.conf
[ -e /var/run/asterisk/asterisk.ctl ] && /etc/init.d/asterisk reload

View File

@@ -14,7 +14,7 @@ PKG_RELEASE:=1
PKG_SOURCE_VERSION:=f614cba983d827d5185c60a6a5a35530621d44d2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se:/ated
PKG_SOURCE_URL:=git@private.inteno.se:ated
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)

View File

@@ -1,61 +0,0 @@
#
# Copyright (C) 2014-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dbus-glib
PKG_VERSION:=0.108
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://dbus.freedesktop.org/releases/dbus-glib/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=LICENSE
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/libdbus-glib
SECTION:=libs
CATEGORY:=Libraries
TITLE:=libdbus-glib
DEPENDS:=+libdbus +glib2
endef
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
--enable-debug=no \
--disable-tests \
--disable-bash-completion \
TARGET_LDFLAGS += -Wl,-rpath-link=$(ICONV_PREFIX)/lib
TARGET_LDFLAGS += -Wl,-rpath-link=$(INTL_PREFIX)/lib
MAKE_PATH = dbus
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_BUILD_DIR)/dbus-glib-1.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libdbus-glib/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libdbus-glib))

View File

@@ -1,19 +0,0 @@
--- a/dbus/Makefile.am
+++ b/dbus/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = . examples
+SUBDIRS = .
AM_CPPFLAGS = \
-I$(top_srcdir) \
--- a/dbus/Makefile.in
+++ b/dbus/Makefile.in
@@ -612,7 +612,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = . examples
+SUBDIRS = .
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \

View File

@@ -11,7 +11,7 @@ PKG_RELEASE:=1
PKG_VERSION:=1.1.0
PKG_SOURCE_URL:=http://public.inteno.se:/dectmngr2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=13da1568d57b8e6732dadc16de828d64c81906b8
PKG_SOURCE_VERSION:=17aa3b1d8d372ebcf4d37379f7cc4fb59c461d4b
PKG_NAME:=dectmngr2

View File

@@ -1,40 +0,0 @@
#
# Copyright (C) 2013 Inteno
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dubus
PKG_VERSION:=1.0.0
#PKG_SOURCE_VERSION:=e51cd2c2af6dd31c4fe563317a14b546ae2c5ed7
PKG_SOURCE_VERSION:=e1ba28a08ca45b2f3bb77e74d127116071576850
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git@private.inteno.se:dubus
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/dubus
CATEGORY:=Utilities
DEPENDS:=+libdbus +libubox +libubus +libblobmsg-json +libxml2
TITLE:=dbus proxy for ubus
endef
define Package/dubus/description
dubus is dbus proxy for ubus. It allows calling dbus
methods through ubus
endef
define Package/dubus/install
$(CP) $(PKG_INSTALL_DIR)/* $(1)/
endef
$(eval $(call BuildPackage,dubus))

View File

@@ -19,18 +19,18 @@ export PLATFORM_INCLUDE:=platforms/iopsys/build.mk
export DATE:=$(shell date +%Y-%m-%d-%H-%M-%S)
export LOGIN:=$(shell whoami)
BASE_PKG_VERSION:=4.4.0
PKG_RELEASE:=RC4
BASE_PKG_VERSION:=4.3.0
PKG_RELEASE:=RC13
PKG_VERSION:=$(BASE_PKG_VERSION)-$(PKG_RELEASE)_$(DATE)_$(LOGIN)
export PKG_VERSION
###########################--RELEASE--################################
PKG_SOURCE_VERSION:=e855fdb65ec312e9ec044ce9319d6ac17fde57cd
PKG_SOURCE_VERSION:=e688de3925debceee8f82d7c50cacd3c90ee1bc1
ifeq ($(CONFIG_ICE_OPEN),y)
TARGET_PROFILE=$(shell echo $(CONFIG_TARGET_BOARD) | sed s/\"//g)
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
PKG_SOURCE_URL:=http://iopsys.inteno.se/iopsys/consumer/
PKG_SOURCE:=$(PKG_NAME)-$(TARGET_PROFILE)-$(BASE_PKG_VERSION)$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(BRCM_KERNEL_PROFILE)-$(BASE_PKG_VERSION)$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
else

View File

@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=3.0-2017-06-01
PKG_VERSION:=3.0-2017-05-01
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=http://public.inteno.se:/icwmp.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=cff928dae59aa115a6f74f68ee4f08dfda2beeb7
PKG_SOURCE_VERSION:=905a667679eef02a43f1d1f882374501d1837af8
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)

View File

@@ -1,53 +0,0 @@
#!/bin/sh
[ "$INTERFACE" != "wan" ] && exit
. /lib/functions/network.sh
network_get_ipaddr ip $INTERFACE
[ -z "$ip" ] && exit
toggle_firewall() {
local section=$1
local disable=$2
config_get name "$1" name
if [ "$name" == "wan" ]; then
uci -q set firewall.settings.disabled=$disable
if [ "$disable" == "1" ]; then
uci -q set firewall.$section.input="ACCEPT"
else
uci -q set firewall.$section.input="REJECT"
fi
uci -q commit firewall
fi
}
set_disabled() {
config_load firewall
config_foreach toggle_firewall zone $1
}
test_ip() {
if [ -n "$(echo $ip | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)')" ]; then
# private IP
set_disabled 1
else
# public IP
set_disabled 0
[ "$1" -eq "1" ] && {
uci set netmode.setup.repeaterready=0
uci commit netmode
local pid="$(ps | grep wificontro[l] | awk '/repeater/ {print $1}')"
[ "$pid" != "" ] && kill -9 $pid
pid="$(pidof netmode-client-detect)"
[ "$pid" == "" ] && /sbin/netmode-client-detect &
}
fi
}
case "$(uci -q get netmode.setup.curmode)" in
repeater*) test_ip ;;
*) [ "$(uci -q get netmode.setup.repeaterready)" == "1" ] && test_ip 1;;
esac

View File

@@ -0,0 +1,39 @@
[ "$INTERFACE" != "wan" ] && exit
ip="$(ip a show $DEVICE | awk '/inet / {print $2; exit}')"
ip="${ip%%/*}"
[ -z "$ip" ] && exit
handle_rule() {
local name enabled
enabled=$2
config_get name $1 name
if [ "$name" == "Repeater-Management" ]; then
uci set firewall.$1.enabled="$enabled"
uci commit firewall
fi
}
set_enabled() {
local enabled=$1
config_load firewall
config_foreach handle_rule rule $enabled
}
test_ip() {
if [ -n "$(echo $ip | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)')" ]; then
set_enabled 1
else
set_enabled 0
fi
}
case "$(uci -q get netmode.setup.curmode)" in
repeater*)
test_ip
;;
*)
exit
;;
esac

View File

@@ -34,7 +34,7 @@ get_wifi_wet_interface() {
fi
}
config_load wireless
config_foreach handle_interface wifi-iface
config_foreach handle_interface wifi-iface "$device"
}
get_wifi_iface_cfgstr() {
@@ -43,7 +43,7 @@ get_wifi_iface_cfgstr() {
[ "$ifname" == "$2" ] && echo "wireless.$1"
}
config_load wireless
config_foreach get_cfgno wifi-iface $1
config_foreach get_cfgno wifi-iface $1 $2
}
link=$(cat /sys/class/net/${WANDEV:0:4}/operstate)
@@ -84,10 +84,6 @@ case "$ACTION" in
uci set network.wan.ifname="$(echo $wetif $(uci get network.wan.ifname) | sed 's/$/ /' | sed -r "s/$WANDEV //g" | tr ' ' '\n' | sort -u | tr '\n' ' ')"
uci commit network
ubus call network reload
ping -c 1 -w 10 $defroute >/dev/null 2>&1 || {
killall -9 wifi
wifi reload nodat
killall -USR1 udhcpc
}
ping -c 1 -w 10 $defroute >/dev/null 2>&1 || killall -USR1 udhcpc
;;
esac

View File

@@ -90,6 +90,7 @@ populate_netmodes() {
desc=""
exp=""
uci -q set netmode.$mode=netmode
uci -q set netmode.$mode.conf=$mode
json_load "$(cat $modedir/$mode/DETAILS)"
if json_select excluded_boards; then
@@ -162,76 +163,33 @@ populate_netmodes() {
switch_netmode() {
[ -f /etc/config/netmode -a -d $modedir ] || return
local curmode conf repeaterready
config_load netmode
config_get repeaterready setup repeaterready "0"
if [ "$repeaterready" == "1" ] ; then
uci -q set netmode.setup.repeaterready="0"
uci commit netmode
fi
config_get curmode setup curmode
if [ "$curmode" == "repeater" ]; then
local hw="$(db -q get hw.board.hardware)"
if [ "$hw" == "EX400" ]; then
curmode="repeater_mtk_5g_up_dual_down"
else
curmode="repeater_brcm_2g_up_dual_down"
fi
uci set netmode.setup.curmode="$curmode"
uci commit netmode
fi
if [ "$curmode" == "routed" ]; then
local hw="$(db -q get hw.board.hardware)"
if [ "$hw" == "EX400" ]; then
curmode="routed_mtk"
else
curmode="routed_brcm"
fi
uci set netmode.setup.curmode="$curmode"
uci commit netmode
fi
[ -d "/etc/netmodes/$curmode" ] || return
cp /etc/netmodes/$curmode/* /etc/config/
config_get conf $curmode conf
cp /etc/netmodes/$conf/* /etc/config/
rm -f /etc/config/DETAILS
sync
local reboot=$(uci -q get netmode.$curmode.reboot)
local askcred=$(uci -q get netmode.$curmode.askcred)
if [ "$reboot" == "0" ]; then
/etc/init.d/enviroment reload
if [ "$askcred" == "1" -a -f /tmp/wifi_imported_credentials ]; then
wifi import "$(cat /tmp/wifi_imported_credentials)"
rm -f /tmp/wifi_imported_credentials
ubus call network reload
wifi reload nodat
sleep 5
ubus call router.network reload
fi
else
reboot &
fi
}
start_client_listener() {
local curmode repeaterready
config_load netmode
config_get repeaterready setup repeaterready 0
[ $repeaterready -eq 1 ] && {
killall -SIGKILL netmode-client-detect >/dev/null 2>&1
return
}
config_get curmode setup curmode
case "$curmode" in
repeater*)
killall -SIGKILL netmode-client-detect >/dev/null 2>&1
;;
*)
pidof netmode-client-detect || /sbin/netmode-client-detect &
;;
esac
}
start_service() {
populate_netmodes
start_client_listener
}
reload_service() {
@@ -240,12 +198,6 @@ reload_service() {
# set default JUCI page to overview
uci -q set juci.juci.homepage="overview"
uci commit juci
start_client_listener
}
stop_service() {
killall -SIGKILL netmode-client-detect >/dev/null 2>&1
}
service_triggers()

View File

@@ -16,7 +16,6 @@
"acl" : [
"admin"
],
"uplink_band" : "b",
"credentials" : 1,
"reboot" : 0
}

View File

@@ -0,0 +1,123 @@
config settings 'settings'
option disabled '0'
config defaults
option syn_flood 1
option input ACCEPT
option output ACCEPT
option forward REJECT
# Uncomment this line to disable ipv6 rules
# option disable_ipv6 1
config zone
option name lan
option input ACCEPT
option output ACCEPT
option forward ACCEPT
config zone
option name wan
list network 'wan'
option input REJECT
option output ACCEPT
option forward REJECT
option masq 1
option mtu_fix 1
config forwarding
option src lan
option dest wan
# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
option name Allow-DHCP-Renew
option src wan
option proto udp
option dest_port 68
option target ACCEPT
option family ipv4
option hidden 1
config rule
option name Repeater-Management
option src wan
option proto tcp
option dest_port '22 80 8080 8181 9876'
option target ACCEPT
option family ipv4
option hidden 1
# Allow IPv4 ping
config rule
option name Allow-Ping
option src wan
option proto icmp
option icmp_type echo-request
option family ipv4
option target ACCEPT
option hidden 1
# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
option name Allow-DHCPv6
option src wan
option proto udp
option src_ip fe80::/10
option src_port 547
option dest_ip fe80::/10
option dest_port 546
option family ipv6
option target ACCEPT
option hidden 1
# Allow essential incoming IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Input
option src wan
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
list icmp_type router-solicitation
list icmp_type neighbour-solicitation
list icmp_type router-advertisement
list icmp_type neighbour-advertisement
option limit 1000/sec
option family ipv6
option target ACCEPT
option hidden 1
# Allow essential forwarded IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Forward
option src wan
option dest *
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
option limit 1000/sec
option family ipv6
option target ACCEPT
option hidden 1
# include a file with users custom iptables rules
config include
option path /etc/firewall.user
option reload 1
# include a file with rules for SIP and RTP traffic
config include
option path /etc/firewall.sip
option reload 1

View File

@@ -16,7 +16,6 @@
"acl" : [
"admin"
],
"uplink_band" : "b",
"credentials" : 1,
"reboot" : 0
}

View File

@@ -0,0 +1,123 @@
config settings 'settings'
option disabled '0'
config defaults
option syn_flood 1
option input ACCEPT
option output ACCEPT
option forward REJECT
# Uncomment this line to disable ipv6 rules
# option disable_ipv6 1
config zone
option name lan
option input ACCEPT
option output ACCEPT
option forward ACCEPT
config zone
option name wan
list network 'wan'
option input REJECT
option output ACCEPT
option forward REJECT
option masq 1
option mtu_fix 1
config forwarding
option src lan
option dest wan
# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
option name Allow-DHCP-Renew
option src wan
option proto udp
option dest_port 68
option target ACCEPT
option family ipv4
option hidden 1
config rule
option name Repeater-Management
option src wan
option proto tcp
option dest_port '22 80 8080 8181 9876'
option target ACCEPT
option family ipv4
option hidden 1
# Allow IPv4 ping
config rule
option name Allow-Ping
option src wan
option proto icmp
option icmp_type echo-request
option family ipv4
option target ACCEPT
option hidden 1
# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
option name Allow-DHCPv6
option src wan
option proto udp
option src_ip fe80::/10
option src_port 547
option dest_ip fe80::/10
option dest_port 546
option family ipv6
option target ACCEPT
option hidden 1
# Allow essential incoming IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Input
option src wan
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
list icmp_type router-solicitation
list icmp_type neighbour-solicitation
list icmp_type router-advertisement
list icmp_type neighbour-advertisement
option limit 1000/sec
option family ipv6
option target ACCEPT
option hidden 1
# Allow essential forwarded IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Forward
option src wan
option dest *
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
option limit 1000/sec
option family ipv6
option target ACCEPT
option hidden 1
# include a file with users custom iptables rules
config include
option path /etc/firewall.user
option reload 1
# include a file with rules for SIP and RTP traffic
config include
option path /etc/firewall.sip
option reload 1

View File

@@ -10,7 +10,7 @@
"excluded_boards" : [
"*G*"
],
"uplink_band" : 'b',
"uplink_band": 'b',
"credentials" : 1,
"reboot" : 0
}

View File

@@ -0,0 +1,113 @@
config settings 'settings'
option disabled '0'
config defaults
option syn_flood 1
option input ACCEPT
option output ACCEPT
option forward REJECT
# Uncomment this line to disable ipv6 rules
# option disable_ipv6 1
config zone
option name wan
list network 'wan'
option input REJECT
option output ACCEPT
option forward REJECT
option masq 1
option mtu_fix 1
# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
option name Allow-DHCP-Renew
option src wan
option proto udp
option dest_port 68
option target ACCEPT
option family ipv4
option hidden 1
config rule
option name Repeater-Management
option src wan
option proto tcp
option dest_port '22 80 8080 8181 9876'
option target ACCEPT
option family ipv4
option hidden 1
# Allow IPv4 ping
config rule
option name Allow-Ping
option src wan
option proto icmp
option icmp_type echo-request
option family ipv4
option target ACCEPT
option hidden 1
# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
option name Allow-DHCPv6
option src wan
option proto udp
option src_ip fe80::/10
option src_port 547
option dest_ip fe80::/10
option dest_port 546
option family ipv6
option target ACCEPT
option hidden 1
# Allow essential incoming IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Input
option src wan
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
list icmp_type router-solicitation
list icmp_type neighbour-solicitation
list icmp_type router-advertisement
list icmp_type neighbour-advertisement
option limit 1000/sec
option family ipv6
option target ACCEPT
option hidden 1
# Allow essential forwarded IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Forward
option src wan
option dest *
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
option limit 1000/sec
option family ipv6
option target ACCEPT
option hidden 1
# include a file with users custom iptables rules
config include
option path /etc/firewall.user
option reload 1
# include a file with rules for SIP and RTP traffic
config include
option path /etc/firewall.sip
option reload 1

View File

@@ -24,7 +24,7 @@ config wifi-iface
config wifi-device rai0
option band a
option channel auto
option channel 36
option bandwidth '80'
option hwmode 11ac
option htmode VHT80

View File

@@ -10,7 +10,7 @@
"excluded_boards" : [
"*G*"
],
"uplink_band" : 'a',
"uplink_band": 'a',
"credentials" : 1,
"reboot" : 0
}

View File

@@ -0,0 +1,113 @@
config settings 'settings'
option disabled '0'
config defaults
option syn_flood 1
option input ACCEPT
option output ACCEPT
option forward REJECT
# Uncomment this line to disable ipv6 rules
# option disable_ipv6 1
config zone
option name wan
list network 'wan'
option input REJECT
option output ACCEPT
option forward REJECT
option masq 1
option mtu_fix 1
# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
option name Allow-DHCP-Renew
option src wan
option proto udp
option dest_port 68
option target ACCEPT
option family ipv4
option hidden 1
config rule
option name Repeater-Management
option src wan
option proto tcp
option dest_port '22 80 8080 8181 9876'
option target ACCEPT
option family ipv4
option hidden 1
# Allow IPv4 ping
config rule
option name Allow-Ping
option src wan
option proto icmp
option icmp_type echo-request
option family ipv4
option target ACCEPT
option hidden 1
# Allow DHCPv6 replies
# see https://dev.openwrt.org/ticket/10381
config rule
option name Allow-DHCPv6
option src wan
option proto udp
option src_ip fe80::/10
option src_port 547
option dest_ip fe80::/10
option dest_port 546
option family ipv6
option target ACCEPT
option hidden 1
# Allow essential incoming IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Input
option src wan
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
list icmp_type router-solicitation
list icmp_type neighbour-solicitation
list icmp_type router-advertisement
list icmp_type neighbour-advertisement
option limit 1000/sec
option family ipv6
option target ACCEPT
option hidden 1
# Allow essential forwarded IPv6 ICMP traffic
config rule
option name Allow-ICMPv6-Forward
option src wan
option dest *
option proto icmp
list icmp_type echo-request
list icmp_type echo-reply
list icmp_type destination-unreachable
list icmp_type packet-too-big
list icmp_type time-exceeded
list icmp_type bad-header
list icmp_type unknown-header-type
option limit 1000/sec
option family ipv6
option target ACCEPT
option hidden 1
# include a file with users custom iptables rules
config include
option path /etc/firewall.user
option reload 1
# include a file with rules for SIP and RTP traffic
config include
option path /etc/firewall.sip
option reload 1

View File

@@ -6,7 +6,7 @@ config wifi-status 'status'
config wifi-device ra0
option band b
option channel auto
option channel 1
option bandwidth '20'
option hwmode 11n
option htmode HT20

View File

@@ -0,0 +1,14 @@
config mcpd 'mcpd'
option igmp_proxy_interfaces 'wan'
option igmp_default_version '2'
option igmp_query_interval '125'
option igmp_query_response_interval '100'
option igmp_last_member_query_interval '10'
option igmp_robustness_value '2'
option igmp_max_groups '25'
option igmp_max_sources '10'
option igmp_max_members '25'
option igmp_fast_leave '1'
option igmp_proxy_enable '1'
option igmp_snooping_enable '2'
option igmp_snooping_interfaces 'br-lan'

View File

@@ -1,36 +0,0 @@
#!/bin/sh
# receive new client events
# and trigger wificontrol in --router mode for that client
. /usr/share/libubox/jshn.sh
local action ipaddr macaddr network
timed_check() {
while true; do
wificontrol --router
sleep $1
done
}
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 netwrork "lan"
if echo $macaddr | grep -i -e "^00:22:07" -e "^44:D4:37" -e "^02:0C:07" -e "^06:0C:07"; 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"}'
/sbin/wificontrol --router --destination $ipaddr
fi
done

View File

@@ -1,250 +0,0 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/functions.sh
state="exit"
TMPPATH="/tmp/netmode_config_backup"
CURMODE=""
SLEEPTIME=300
set_wireless_values() {
local iface_num="$1"
local ssid="$2"
local key="$3"
local encryption="$4"
local device="$5"
local old_ssid old_key old_encryption
if ! uci -q get wireless.@wifi-iface[$iface_num] >/dev/null 2>&1; then
state="reload"
uci add wireless wifi-iface >/dev/null 2>&1
uci set wireless.@wifi-iface[$iface_num].device="$device"
fi
local network="$(uci -q get wireless.@wifi-iface[$iface_num].network)"
old_ssid="$(uci -q get wireless.@wifi-iface[$iface_num].ssid)"
old_key="$(uci -q get wireless.@wifi-iface[$iface_num].key)"
old_encryption="$(uci -q get wireless.@wifi-iface[$iface_num].encryption)"
if [ "$old_ssid" != "$ssid" -o "$old_encryption" != "$encryption" -o "$old_key" != "$key" -o -z "$network" ]; then
#TODO: get network dynamicaly
[ "$state" == "exit" ] && state="apply"
[ -z "$network" ] && network="wan"
uci set wireless.@wifi-iface[$iface_num].network="$network"
uci set wireless.@wifi-iface[$iface_num].ssid="$ssid"
uci set wireless.@wifi-iface[$iface_num].key="$key"
uci set wireless.@wifi-iface[$iface_num].encryption="$encryption"
fi
}
get_wifi_device_from_band(){
local section="$1"
local band="$2"
local __ret="$3"
local b
config_get b $section "band"
if [ "$band" == "$b" ]; then
eval "export -- \"$__ret=$section\""
fi
}
get_device(){
local band="$1"
config_foreach get_wifi_device_from_band "wifi-device" "$band" "$2"
}
get_iface_num() {
local device="$1"
local prev="$2"
local __save="$3"
local i=0
local dev
while true; do
[ $i -gt 100 ] && break ## just a safty messure
if ! uci -q get wireless.@wifi-iface[$i] >/dev/null; then
break
fi
mode="$(uci -q get wireless.@wifi-iface[$i].mode)"
if [ "$mode" != "ap" ]; then
i=$((i+1))
continue
fi
dev="$(uci -q get wireless.@wifi-iface[$i].device)"
if [ "$dev" != "$device" ]; then
[ -z "$dev" ] && break
i=$((i+1))
elif [ $prev -ne 0 ]; then
i=$((i+1))
prev=$((prev-1))
else
break
fi
done
eval "export -- \"$__save=$i\""
}
restore() {
if [ "$1" == "back" ]; then
uci set juci.juci.homepage='netmode-wizard'
uci commit juci
cp $TMPPATH/* /etc/config/
uci set netmode.setup.curmode=$CURMODE
uci commit netmode
ubus call network reload
wifi reload
ubus call router.network reload
fi
rm -r $TMPPATH
ubus call leds set '{"state":"normal"}'
}
backup() {
mkdir -p $TMPPATH
cp /etc/config/* $TMPPATH/
CURMODE="$(uci -q get netmode.setup.curmode)"
ubus call leds set '{"state":"allflash"}'
}
###### START HERE #######
file="$1"
from_gui="$2"
[ -f "$file" ] || exit
[ "$from_gui" == "true" ] && backup
json_load "`cat $file`"
json_select "wifi_ifaces"
local curmode repmode
config_load netmode
config_get curmode setup curmode
case $curmode in
*repeater*)
;;
*)
uci set netmode.setup.curmode="repeater"
uci commit netmode
/etc/init.d/netmode reload
curmode="$(uci -q get netmode.setup.curmode)"
;;
esac
local apcliband="a"
case $curmode in
*_2g_*) apcliband="b";;
esac
i=1
local dummy band ssid key encryption device iface_num
while json_get_var dummy $i; do
json_select $i
json_get_var band band
[ "$apcliband" == "$band" ] && break
json_select ..
i=$((i+1))
done
[ "$apcliband" == "$band" ] || {
[ "$from_gui" == "true" ] && restore "back"
exit
}
repeater_iface_num=$(uci -q show wireless | grep -e ".mode='wet'" -e ".mode='sta'" | sed 's/.*\[\([0-9]\)\].*/\1/')
[ -z "$repeater_iface_num" ] && {
[ "$from_gui" == "true" ] && restore "back"
exit
}
json_get_var ssid ssid
json_get_var key key
json_get_var encryption encryption
set_wireless_values "$repeater_iface_num" "$ssid" "$key" "$encryption"
json_load "`cat $file`"
json_select "wifi_ifaces"
config_load wireless
local b_num=0
local a_num=0
i=1
while json_get_var dummy $i; do
json_select $i
json_get_var band band
get_device "$band" device
case $band in
a)
get_iface_num "$device" "$a_num" iface_num
a_num=$((a_num+1))
;;
b)
get_iface_num "$device" "$b_num" iface_num
b_num=$((b_num+1))
;;
esac
[ -z $iface_num ] && {
[ "$from_gui" == "true" ] && restore "back"
exit
}
json_get_var ssid ssid
json_get_var encryption encryption
json_get_var key key
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
json_select ..
i=$((i+1))
done
while uci -q get wireless.@wifi-iface[$i] >/dev/null; do
local mode="$(uci -q get wireless.@wifi-iface[$i].mode)"
if [ "$mode" == "wet" -o "$mode" == "sta" ]; then
i=$((i+1))
continue
fi
state="reload"
uci -q delete wireless.@wifi-iface[$i] >/dev/null
i=$((i+1))
done
uci commit wireless
if [ "$from_gui" == "true" ]; then
# check for connectivity
wifi reload
[ -f /etc/init.d/layer2_interface_ethernet -a -f /etc/config/layer2_interface_ethernet ] && /etc/init.d/layer2_interface_ethernet reload
i=$SLEEPTIME;
while [ $i -gt 0 ]; do
ip=`route -n | awk '/^0.0.0.0/{print $2}'`
if [ "$ip" == "" ]; then
i=$((i-10))
sleep 10
continue
fi
ping -w1 $ip
if [ $? -eq 0 ]; then
restore
exit
else
i=$((i-10))
sleep 9
fi
done
restore "back"
else
if [ "$state" == "exit" ]; then
return
elif [ "$state" == "apply" ]; then
# wifi apply
wifi reload
else
# wifi reload
wifi reload
fi
[ -f /etc/init.d/layer2_interface_ethernet -a -f /etc/config/layer2_interface_ethernet ] && /etc/init.d/layer2_interface_ethernet reload
fi

View File

@@ -1,19 +0,0 @@
#!/bin/sh
MTK=0
[ "$(db -q get hw.board.hardware)" == "EX400" ] && MTK=1
if [ $MTK -eq 1 ]; then
WANDEV="eth0.2"
link=$(swconfig dev switch0 port 0 get link | awk '{print$2}' | cut -d':' -f2)
else
WANDEV="$(uci get layer2_interface_ethernet.Wan.ifname)"
link=$(cat /sys/class/net/${WANDEV:0:4}/operstate)
fi
[ "$link" == "up" ] && action=add
[ "$link" == "down" ] && action=remove
[ -z "$action" ] && exit
# trigger a fake hotplug net event
INTERFACE=$WANDEV ACTION=$action /sbin/hotplug-call net

View File

@@ -1,142 +0,0 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/functions.sh
get_if_creds() {
local section=$1
local network=$2
local net dev ssid key encryption band
config_get net $section "network"
if [ "$net" == "$network" ]; then
config_get dev $section "device"
band="$(uci -q get wireless.$dev.band)"
config_get ssid $section ssid
config_get key $section key
config_get encryption $section encryption
config_get disabled $section disabled 0
echo "disabled for $band = $disabled" >>/tmp/dbg
[ $disabled -eq 1 ] && return
[ "$ssid" == "" -o "$band" == "" ] && return
json_add_object
json_add_string "ssid" "$ssid"
json_add_string "band" "$band"
json_add_string "key" "$key"
json_add_string "encryption" "$encryption"
json_close_object
fi
}
validate_file() {
local file="$1"
local real="$(readlink -f `dirname $file`)"
real="${real}/`basename $file`"
case "$real" in
/tmp/*)
touch $real && return 0 || return 1
;;
*)
return 1
;;
esac
}
write_error(){
json_init
json_add_string "status" "error: $1"
json_dump
exit 1
}
duplicate_if_single_radio() {
json_select "wifi-ifaces"
local i=1
local dummy band dup_band num_radios
num_radios="$(uci -q show wireless | grep wifi-device | wc -l)"
[ "$num_radios" == "2" ] && return
band="$(uci -q get wireless.@wifi-device[0].band)"
[ "$band" == "a" ] && dup_band="b"
[ "$band" == "b" ] && dup_band="a"
[ -z "$dup_band" ] && return
while json_get_var dummy $i; do
i=$((i+1))
done
i=$((i-1))
local ssid key encryption
while [ $i -gt 0 ]; do
json_select $i
json_get_var ssid ssid
json_get_var key key
json_get_var encryption encryption
json_select ..
json_add_object
json_add_string "ssid" "$ssid"
json_add_string "band" "$dup_band"
json_add_string "key" "$key"
json_add_string "encryption" "$encryption"
json_close_object
i=$((i-1))
done
}
case "$1" in
list)
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" } }'
;;
call)
case "$2" in
get_creds)
#TODO: if not routed exit
local curmode="$(uci -q get netmode.setup.curmode)"
case $curmode in
*repeater*) write_error "not in repeater mode";;
esac
local network file input
read input
json_load $input
json_get_var network network
json_get_var file file
json_init
json_add_array "wifi-ifaces"
config_load wireless
config_foreach get_if_creds "wifi-iface" "$network"
json_close_array
duplicate_if_single_radio
if [ "$file" == "" ]; then
json_dump
else
validate_file $file && json_dump -i >$file || write_error "invalid filename (\"$file\"), file must be in /tmp/ and in an existing directory"
fi
json_init
json_add_string "status" success
json_dump
;;
set_creds)
local file from_gui
read input
json_load "$input"
json_get_var file file
json_get_var from_gui from_gui
validate_file "$file" || write_error "invalid filename (\"$file\"), file must be in /tmp and exist"
json_load "`cat $file`" || write_error "invalid file content"
json_select "wifi_ifaces" || write_error "invalid file content"
json_init
json_add_string "status" success
json_dump
netmode-conf "$file" "$from_gui" >/dev/null 2>&1 &
;;
esac
;;
esac

View File

@@ -59,7 +59,7 @@ CONFIG_PACKAGE_juci-firewall-fw3=y
CONFIG_PACKAGE_juci-icwmp=y
CONFIG_PACKAGE_juci-igmpinfo=y
CONFIG_PACKAGE_juci-inteno-backup=y
CONFIG_PACKAGE_juci-mwan3=y
CONFIG_PACKAGE_juci-inteno-multiwan=y
CONFIG_PACKAGE_juci-inteno-provisioning=y
CONFIG_PACKAGE_juci-inteno-qos=y
CONFIG_PACKAGE_juci-inteno-voice-client=y
@@ -101,7 +101,7 @@ CONFIG_PACKAGE_mtd-utils-deubinize=y
CONFIG_PACKAGE_mtd-utils-imagewrite=y
CONFIG_PACKAGE_mtd-utils-mkfs.jffs2=y
CONFIG_PACKAGE_mtd-utils-nanddump=y
CONFIG_PACKAGE_mwan3=y
CONFIG_PACKAGE_multiwan=y
CONFIG_PACKAGE_ndisc6=y
CONFIG_PACKAGE_ntfs-3g=y
CONFIG_PACKAGE_odhcp6c=y
@@ -196,5 +196,3 @@ CONFIG_LIBCURL_CRYPTO_AUTH=y
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
# CONFIG_SAMBA3_CONFIG_NO_PRINTING is not set
# CONFIG_SIGNED_PACKAGES is not set
CONFIG_KERNEL_DEVTMPFS=y
CONFIG_KERNEL_DEVTMPFS_MOUNT=y

View File

@@ -1,135 +1,88 @@
#!/bin/bash
function extract_core {
initial_commit=1427738ac4b77f474999ae21af1a8b916468df36
patch_dir=extract_core_patches
topdir=$(pwd)
# Intermediate repo for core packages
core_repo=git@public.inteno.se:iopsys-cc-core.git
# Paths to packages that should be exported.
paths+='package/network/services/samba36 '
paths+='package/network/services/dnsmasq '
paths+='package/network/services/dropbear '
paths+='package/network/services/odhcpd '
paths+='package/network/config/firewall '
paths+='package/network/config/netifd '
paths+='package/network/config/qos-scripts '
paths+='package/network/utils/iproute2 '
paths+='package/network/utils/curl '
paths+='package/utils/busybox '
# Repo to which core packages should be imported
import_repo=git@public.inteno.se:feed-inteno-openwrt.git
import_branch=openwrt-cc-core
function print_usage {
echo "Usage: $0 extract_core"
echo " -p <path-to-package> | default"
echo " -r <import-repo>"
echo " -b <import-branch>"
echo ""
echo "Example: $0 extract_core"
echo " -p package/utils/busybox"
echo " -r feeds/feed_inteno_openwrt"
echo " -b devel"
}
function orphan_branch {
local branch=$1
function export_core {
git checkout --orphan $branch
git rm -rf --cached *
git rm -rf --cached .empty
rm -rf *
rm -rf .empty
}
local path=$1
function export_core {
local path=$1
echo "Extracting ${path} from core to ${import_repo}:${import_branch}"
# Generate patches from start of openwrt repo.
mkdir -p $patch_dir
repo=$(basename $path)
dir=$(dirname $path)
git format-patch $initial_commit $path -o $patch_dir
# Remove dirname from patches to commit the packages to the
# top directory in the destination repo.
ls $patch_dir | while read line; do
sdir=$(echo "$dir/" | sed 's/\//\\\//g')
sed -i "s/$sdir//g" $patch_dir/$line
done
cd $import_repo
if [ -n "$(git rev-parse -q --verify remotes/origin/$repo)" ]; then
# Create temporary branch to apply patches on.
# We need to do this as git am does not like it
# when patches have already been applied.
orphan_branch tmp
git am $topdir/$patch_dir/*
# Rebase and merge.
git rebase origin/$repo
git checkout --track -b $repo origin/$repo
git merge tmp
git br -d tmp
else
# Remote branch does not exist for packet so create it.
orphan_branch $repo
git am $topdir/$patch_dir/*
fi
git push origin $repo
# Merge the package branch into the main branch.
git checkout $import_branch
git merge $repo -m "Syncing $repo"
git push origin $import_branch
git br -d $repo
rm -rf $topdir/$patch_dir
cd $topdir
}
# Execute user command
while getopts "p:r:b:h" opt; do
case $opt in
p)
export_path=${OPTARG}
;;
r)
import_repo=${OPTARG}
;;
b)
import_branch=${OPTARG}
;;
h)
print_usage
exit 1
;;
\?)
print_usage
exit 1
;;
esac
done
if [ ! -n "$export_path" ] || [ ! -n "$import_repo" ] || [ ! -n "$import_branch" ]; then
print_usage
exit 1
fi
if [ "$export_path" == "default" ]; then
echo "Extracting default packages:"
for p in $paths; do
export_core $p
done
else
export_core $export_path
fi
exit 0
# export paths to their own branches in an intermediate repo
repo=$(basename $path)
git subtree push -q --prefix=$path $core_repo $repo
}
register_command "extract_core" "Extract core package to separate feed"
function update_core {
local path=$1
if [ ! -d $topdir/feeds/feed_inteno_openwrt ]; then
echo "You need to run ./iop feeds_update"
exit -1
fi
# ensure that we are synced with the remote
cd $topdir/feeds/feed_inteno_openwrt
git checkout $import_branch
git pull
# first install subtrees if they don't already exist
repo=$(basename $path)
git subtree add --prefix=$repo $core_repo $repo
# install subtrees in feed from intermediate repo
repo=$(basename $path)
echo "Exporting $repo"
git subtree pull -q -m "Exporting $repo" --prefix=$repo $core_repo $repo
# update import repo sync branch
git push origin $import_branch
}
function display_help {
echo "Usage: ./iop export_core -e path/to/package"
}
function extract_core {
# Dir of script location
topdir=$(pwd)
if [ $# -eq 0 ]; then
display_help
exit -1
fi
# Execute user command
while getopts "he:" opt; do
case $opt in
e)
path=${OPTARG}
echo "Extracting ${path} from core to ${import_repo}:${import_branch}"
export_core $path
update_core $path
;;
h)
display_help
exit 0
;;
\?)
display_help
exit -1
;;
esac
done
}
register_command "extract_core" "Extract core package to feeds_inteno_openwrt"

View File

@@ -24,7 +24,6 @@ function feeds_update {
else
./scripts/feeds update
fi
./scripts/feeds update -ai
# replace core packages with iopsys versions
if [ $override == 1 ]; then

View File

@@ -64,7 +64,6 @@ function genconfig {
iceAllowed=0
endptAllowed=0
natalieAllowed=0
mediatekAllowed=0
allowedRepos="$(ssh -o ConnectTimeout=5 git@private.inteno.se 2>/dev/null | grep -w 'R\|W' | awk '{print$NF}')"
for repo in $allowedRepos; do
@@ -73,7 +72,6 @@ function genconfig {
ice-client) iceAllowed=1 ;;
endptcfg) endptAllowed=1 ;;
natalie-dect*) natalieAllowed=1 ;;
linux) mediatekAllowed=1 ;;
esac
done
}
@@ -106,7 +104,7 @@ function genconfig {
local ALL="$1"
local CUSTOMER="$2"
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common | grep -v juci-theme)"
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common)"
if [ "$boards" ]; then
echo "$CUSTOMER has following boards:"
for board in $boards; do
@@ -120,10 +118,10 @@ function genconfig {
exit 1
elif [ -d $CUSTCONF ]; then
local customers="$(ls -1 $CUSTCONF)"
if [ "$customers" -a "$ALL" == 1 ]; then
if [ "$customers" -a "$1" == 1 ]; then
for customer in $customers; do
echo $customer
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common | grep -v juci-theme)"
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common)"
if [ "$boards" ]; then
for board in $boards; do
echo -e "\t$board"
@@ -144,6 +142,16 @@ function genconfig {
}
use_local_mirror()
{
if wget -T 3 -t 2 -O /dev/null $LOCAL_MIRROR >/dev/null 2>/dev/null; then
echo "mirror [$LOCAL_MIRROR] exists. Using local mirror"
sed -i "s;CONFIG_LOCALMIRROR=.*;CONFIG_LOCALMIRROR=\"$LOCAL_MIRROR\";" .config
else
echo "mirror [$LOCAL_MIRROR] does not exist. Not using local mirror"
fi
}
generate_config()
{
DIFFFILE="$1"
@@ -207,8 +215,7 @@ function genconfig {
fi
# Add target diff
local target_name=$(echo $target | sed 's/_/-/g')
local target_conf=target/linux/${target_name}/config
local target_conf=target/linux/${target/_/-}/config
if [ -f $target_conf ]; then
cat $target_conf >> .config
fi
@@ -274,15 +281,11 @@ function genconfig {
[ $iceAllowed -eq 0 ] && echo "CONFIG_ICE_OPEN=y" >> .config
[ $endptAllowed -eq 0 ] && echo "CONFIG_ENDPT_OPEN=y" >> .config
[ $natalieAllowed -eq 0 ] && echo "CONFIG_NATALIE_OPEN=y" >> .config
[ $mediatekAllowed -eq 0 ] && echo "CONFIG_MEDIATEK_OPEN=y" >> .config
else
echo "CONFIG_DEVEL=n" >>.config
echo "CONFIG_GITMIRROR_REWRITE=n" >>.config
echo "CONFIG_BCM_OPEN=y" >> .config
echo "CONFIG_ICE_OPEN=y" >> .config
echo "CONFIG_ENDPT_OPEN=y" >> .config
echo "CONFIG_NATALIE_OPEN=y" >> .config
echo "CONFIG_MEDIATEK_OPEN=y" >> .config
fi
# Force regeneration of themes
@@ -345,6 +348,10 @@ function genconfig {
done
setup_dirs
create_and_copy_files "$1" "$2"
if [ $masterconfig -eq 1 ]; then
use_local_mirror
fi
fi
}

View File

@@ -2,8 +2,7 @@
build_bcmkernel_consumer() {
local tarfile bcmkernelcommith sdkversion
sdkversion=$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')
local tarfile bcmkernelcommith
bcmkernelcommith=$(grep -w "PKG_SOURCE_VERSION:" $curdir/feeds/feed_inteno_broadcom/bcmkernel/$sdkversion.mk | cut -d'=' -f2)
# do not build bcmopen sdk if it was already built before
ssh $SERVER "ls $FPATH/bcmopen-$profile-$bcmkernelcommith.tar.gz" && return
@@ -59,48 +58,15 @@ build_ice_consumer() {
icebasever=$(grep -w "BASE_PKG_VERSION:" ./feeds/feed_inteno_packages/ice-client/Makefile | cut -d'=' -f2)
icerelease=$(grep -w "PKG_RELEASE:" ./feeds/feed_inteno_packages/ice-client/Makefile | cut -d'=' -f2)
iceversion=$icebasever$icerelease
ssh $SERVER "ls $FPATH/ice-client-$target-$iceversion-$icecommith.tar.gz" && return
cd ./build_dir/target-*_uClibc-0.9.33.*/ice-client-$icebasever/ipkg-* || cd ./build_dir/target-mips*musl-*/ice-client-$icebasever/ipkg-*
tar -czv ice-client -f ice-client-$target-$iceversion-$icecommith.tar.gz
scp ice-client-$target-$iceversion-$icecommith.tar.gz $SERVER:$FPATH/
cp ice-client-$target-$iceversion-$icecommith.tar.gz $curdir/
rm -f ice-client-$target-$iceversion-$icecommith.tar.gz
ssh $SERVER "ls $FPATH/ice-client-$profile-$iceversion-$icecommith.tar.gz" && return
cd ./build_dir/target-*_uClibc-0.9.33.*/ice-client-$icebasever/ipkg-*
tar -czv ice-client -f ice-client-$profile-$iceversion-$icecommith.tar.gz
scp ice-client-$profile-$iceversion-$icecommith.tar.gz $SERVER:$FPATH/
cp ice-client-$profile-$iceversion-$icecommith.tar.gz $curdir/
rm -f ice-client-$profile-$iceversion-$icecommith.tar.gz
cd $curdir
}
build_mediatek_kernel() {
local mediatek_commit kernel_version kernel
mediatek_commit=$(grep CONFIG_KERNEL_GIT_COMMIT .config | cut -d '=' -f2 | tr -d '"')
kernel_version=$(grep KERNEL_PATCHVER target/linux/iopsys-ramips/Makefile | cut -d '=' -f2)
kernel=linux-${kernel_version}.*
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
# Save Kconfig files to recreate the same kernel config,
# delete everyting else.
find drivers/net/wireless/mt_wifi -type f ! -name Kconfig | xargs rm
find drivers/net/wireless/rlt_wifi -type f ! -name Kconfig | xargs rm
# remove git repo
rm -rf .git
# patch kernel for openstk
ls consumer_release | while read line; do patch -p1 < consumer_release/$line; done
cd ..
tar -czv $kernel -f mediatek-kernel-open-$mediatek_commit.tar.gz
scp mediatek-kernel-open-$mediatek_commit.tar.gz $SERVER:$FPATH/
cd $curdir
}
function print_usage {
echo "Usage: $0 generate_tarballs"
echo " -t <target>"
}
function generate_tarballs {
SERVER="god@software.inteno.se"
@@ -108,46 +74,14 @@ function generate_tarballs {
git remote -v | grep -q http && return # do not continue if this is an open SDK environment
target=$(grep CONFIG_TARGET_BOARD .config | cut -d'=' -f2 | tr -d '"')
profile=$(grep CONFIG_BCM_KERNEL_PROFILE .config | cut -d'=' -f2 | tr -d '"')
sdkversion=$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')
curdir=$(pwd)
# Execute user command
while getopts "t:h" opt; do
case $opt in
t)
stk_target=${OPTARG}
;;
h)
print_usage
exit 1
;;
\?)
print_usage
exit 1
;;
esac
done
if [ ! -n "$stk_target" ]; then
print_usage
exit 1
fi
if [ "$stk_target" == "broadcom" ]; then
build_bcmkernel_consumer
build_natalie_consumer
build_endptcfg_consumer
build_ice_consumer
elif [ "$stk_target" == "mediatek" ]; then
build_mediatek_kernel
build_ice_consumer
else
echo "Invalid target: $stk_target"
print_usage
exit 1
fi
build_bcmkernel_consumer
build_natalie_consumer
build_endptcfg_consumer
build_ice_consumer
}

View File

@@ -394,7 +394,7 @@ insert_hash_in_feeds_config()
check_packages()
{
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
echo "Now checking if any changes have been done to the packages."
echo "Now checking if any changes has been done to the packages."
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
# only scan in the build directory that is currently in use.

View File

@@ -21,7 +21,7 @@ define Package/iup
endef
define Package/iup/description
This package contains Inteno's IUP Client
This package contains Intenos IUP Client
endef
define Build/Compile

View File

@@ -4,7 +4,6 @@ echo $$ > /var/run/iup.pid
. /lib/functions.sh
. /lib/functions/network.sh
. /lib/functions/savecfg.sh
. /usr/share/libubox/jshn.sh
include /lib/upgrade
@@ -14,6 +13,8 @@ export IUPCONFFILES=/tmp/iup/sysupgrade.conffiles.tar.gz
export IUPMD5=/etc/configchecksums
export CONFILESLURP='/tmp/iup/*.conf'
export IUPTEMP="/tmp/iup"
export IUPUSERCFG="/tmp/iupusercfg"
export IUPUSERCFG_WIFI="/tmp/iupusercfg_wifi"
export INTERACTIVE=0
export VERBOSE=0
export CONF=1
@@ -68,7 +69,41 @@ reload ()
save_usercfg()
{
savecfg_save_config fw_redirect fw_parental wifi
rm -f $IUPUSERCFG $IUPUSERCFG_WIFI
touch $IUPUSERCFG $IUPUSERCFG_WIFI
# save the firewall redirects/port forwarding
uci show firewall | grep redirect >> $IUPUSERCFG
# save the parental rules
local parentalrules=$(uci show firewall | grep -i "Parental Rule" | grep -o "rule\[.*\]")
for rule in $parentalrules ; do
rule=${rule//\[/\\[} # escape [
rule=${rule//]/\]} # escape ]
uci show firewall | grep "$rule" >>$IUPUSERCFG
done
# tranfsorm the output of uci show into a uci script
# prepend "set" to each line NOT containing "]="
# firewall.@redirect[0].enabled='1' becomes
# set firewall.@redirect[0].enabled='1'
sed -i '/.*]=.*/! s/.*/set \0/' $IUPUSERCFG
# prepend "add" to each line containing "]="
# AND keep only the package name (before the first dot) and section type (after equal)
# firewall.@redirect[0]=redirect becomes
# add firewall redirect
sed -i 's/\(.*\)\..*]=\(.*\)/add \1 \2/' $IUPUSERCFG
# change all the array indexes to [-1]
sed -i 's/\[.\?.\?.\?.\?\]/[-1]/' $IUPUSERCFG
# commit at the end of the script
[ -s $IUPUSERCFG ] && echo "commit" >> $IUPUSERCFG
# save wireless interfaces
uci show wireless | grep "wifi-iface" > $IUPUSERCFG_WIFI
}
apply_usercfg()
@@ -79,11 +114,64 @@ apply_usercfg()
config_get_bool keep configserver keepuserconfig "0"
v "apply_usercfg(): keepuserconfig = $keep"
if [ "$keep" != "1" ] ; then
savecfg_rm_files
rm -f $IUPUSERCFG $IUPUSERCFG_WIFI
return
fi
savecfg_apply_config fw_redirect fw_parental wifi
local index ifname network
local newindex newifname newnetwork
# loop through all the user wifi-ifaces
for index in $(seq 0 99) ; do
ifname=$(sed -n 's/.*wifi-iface\['$index'\]\.ifname='\''\(.*\)'\''/\1/p' $IUPUSERCFG_WIFI )
[ "$ifname" ] || break
network=$(sed -n 's/.*wifi-iface\['$index'\]\.network='\''\(.*\)'\''/\1/p' $IUPUSERCFG_WIFI )
newindex=""
newifname=""
newnetwork=""
# loop through all the newly configured wifi-ifaces
for newindex in $(seq 0 99) ; do
newifname=$( uci show wireless | grep wifi-iface | sed -n 's/.*wifi-iface\['$newindex'\]\.ifname='\''\(.*\)'\''/\1/p' )
if [ -z "$newifname" ] ; then
# no newifname means that all the wifi-ifaces have already been parsed
newindex="-1"
break
fi
newnetwork=$(uci show wireless | grep wifi-iface | sed -n 's/.*wifi-iface\['$newindex'\]\.network='\''\(.*\)'\''/\1/p' )
# two wifi interfaces are the same if "ifname" and "network" are the same
if [ "$newifname" == "$ifname" ] && [ "$newnetwork" == "$network" ] ; then
break
fi
done
# prepend "set" to each line NOT containing "]="
# wireless.@wifi-iface[$index].<option>='<value>' becomes
# set wireless.@wifi-iface[$index].<option>='<value>'
sed -i '/.*]=.*/! s/\(.*\[\)'$index'\(\].*\)/set \1'$newindex'\2/' $IUPUSERCFG_WIFI
if [ "$newindex" == "-1" ] ; then
# prepend "add" to each line containing "]="
# AND keep only the package name (before the first dot) and section type (after equal)
# wireless.@wifi-iface[0]=wifi-iface becomes
# add wireless wifi-iface
sed -i 's/\(.*\)\..*\['$index'\]=\(.*\)/add \1 \2/' $IUPUSERCFG_WIFI
else
# no need to create a new uci section, just delete the line defining a new section
sed -i '/\(.*\)\..*\['$index'\]=\(.*\)/d' $IUPUSERCFG_WIFI
fi
done
# commit at the end of the script
[ -s $IUPUSERCFG_WIFI ] && echo "commit" >> $IUPUSERCFG_WIFI
# run the uci batch scripts
cat $IUPUSERCFG | uci batch >/dev/null 2>&1
cat $IUPUSERCFG_WIFI | uci batch >/dev/null 2>&1
rm -f $IUPUSERCFG $IUPUSERCFG_WIFI
}
handle_provisioning() {
@@ -140,13 +228,14 @@ handle_provisioning() {
retry=$((retry+1))
fi
done
fi
if [ ! -s "$IUPCONFFILES" ] && [ "$enabled" -eq 1 ]; then
echo "File not Found"
reboot="off"
CONF=0
else
handle_Downloaded_file $deckey
if [ ! -s "$IUPCONFFILES" ]; then
echo "File not Found"
reboot="off"
CONF=0
else
handle_Downloaded_file $deckey
fi
fi
}
@@ -388,6 +477,8 @@ parse_dhcp_options()
json_get_var vlanid vlanid # option 132
json_get_var vlanpriority vlanpriority # option 133
v "Processing dhcp options"
if [ $privopt224 ]; then
v "dhcp option 224 firmware url $privopt224"
handle_option224 $privopt224

View File

@@ -50,11 +50,10 @@ addethernet() {
config_get baseifname $1 baseifname
config_get ifname $1 ifname
config_get bridge $1 bridge
config_get mac2 $1 mac2
ifname="${ifname:-$baseifname.1}"
brcm_virtual_interface_rules "$baseifname" "$ifname" "$bridge" "$mac2"
brcm_virtual_interface_rules "$baseifname" "$ifname" "$bridge"
}

View File

@@ -161,38 +161,12 @@ addbrcmvlan()
fi
}
update_last_mac_group()
{
local ifname=$1
local last_mac_group=$2
local full_mac modified_mac dev_mac
full_mac="$(ifconfig $ifname | awk '{print $NF; exit}')"
[ "${full_mac}" == "" ] && return
modified_mac="${full_mac:0:15}${last_mac_group}"
devs="wl0 wl1 bcmsw"
for dev in $devs; do
dev_mac="$(ifconfig $dev | awk '{print $NF; exit}')"
if [ "$dev_mac" == "$modified_mac" ]; then
return
fi
done
ifconfig $ifname hw ether "${modified_mac}"
}
brcm_virtual_interface_rules()
{
local baseifname=$1
local ifname=$2
local bridge=$3
local last_mac_group=$4
bridge="${bridge:-0}"
@@ -256,10 +230,6 @@ brcm_virtual_interface_rules()
vlanctl --if $baseifname --rx --tags 0 --set-rxif $ifname --filter-vlan-dev-mac-addr 1 --rule-insert-before -1
fi
if [ "$last_mac_group" != "" ]; then
update_last_mac_group $ifname $last_mac_group
fi
ifconfig $ifname up
ifconfig $ifname multicast
}

View File

@@ -7,7 +7,7 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/apietila/libtrace.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_VERSION:=e4b4c5cce35a52da152776a00532aa0b80879c5b
PKG_SOURCE_VERSION:=HEAD
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

View File

@@ -1,41 +0,0 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mtk-bndstrg
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=8a804320c53dead1c9b9f3650cbbc58908c76832
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se:/mtk-bndstrg
PKG_SOURCE:=$(PKG_NAME).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/mtk-bndstrg
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libpthread +librt
TITLE:=Band steering daemon for Mediatek
endef
define Package/mtk-bndstrg/description
Band steering for Mediatek
endef
#define Build/Compile
#endef
define Build/Configure
#$(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))
endef
define Package/mtk-bndstrg/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bndstrg $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,mtk-bndstrg))

View File

@@ -12,7 +12,7 @@ PKG_NAME:=peripheral_manager
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=ff2cf8bfbd3a04731088e9f4540796696e961382
PKG_SOURCE_VERSION:=2217e777ce56b53878ca467a06025db935c235eb
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se/peripheral_manager

View File

@@ -1,43 +0,0 @@
#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dbus-python
PKG_VERSION:=1.2.4
PKG_RELEASE:=1
PKG_LICENSE:=MIT
PKG_SOURCE:=dbus-python-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://pypi.python.org/packages/source/d/dbus-python/
PKG_MD5SUM:=7372a588c83a7232b4e08159bfd48fe5
PKG_BUILD_DEPENDS:=python
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
include $(INCLUDE_DIR)/nls.mk
TARGET_LDFLAGS += -Wl,-rpath-link=$(ICONV_PREFIX)/lib
TARGET_LDFLAGS += -Wl,-rpath-link=$(INTL_PREFIX)/lib
define Package/python-dbus
SECTION:=language-python
CATEGORY:=Languages
SUBMENU:=Python
TITLE:=python-dbus
MAINTAINER:=Denis Osvald <denis.osvald@sartura.hr>
DEPENDS:=+python +libdbus +libdbus-glib +glib2
endef
define Package/python-dbus/description
Python bindings for libdbus
endef
$(eval $(call PyPackage,python-dbus))
$(eval $(call BuildPackage,python-dbus))

View File

@@ -1,430 +0,0 @@
diff --git a/dbus/decorators.py b/dbus/decorators.py
index 71c8be0..a792861 100644
--- a/dbus/decorators.py
+++ b/dbus/decorators.py
@@ -352,3 +352,105 @@ def signal(dbus_interface, signature=None, path_keyword=None,
return emit_signal
return decorator
+
+
+class property(object):
+ """A decorator used to mark properties of a `dbus.service.Object`.
+
+ :Since: 1.3.0
+ """
+
+ def __init__(self, dbus_interface, signature,
+ property_name=None, emits_changed_signal=None,
+ fget=None, fset=None, doc=None):
+ """Initialize the decorator used to mark properties of a
+ `dbus.service.Object`.
+
+ :Parameters:
+ `dbus_interface` : str
+ The D-Bus interface owning the property.
+
+ `signature` : str
+ The signature of the property in the usual D-Bus
+ notation. It must be a single complete type,
+ i.e. something that can be be suitable to be placed
+ in a variant.
+
+ `property_name` : str
+ A name for the property. Defaults to the name of the getter or
+ setter function.
+
+ `emits_changed_signal` : True, False, "invalidates", or None
+ Tells for introspection if the object emits PropertiesChanged
+ signal.
+
+ `fget` : func or None
+ Getter function taking the instance from which to read the
+ property.
+
+ `fset` : func or None
+ Setter function taking the instance to which set the property
+ and the property value.
+
+ `doc` : str
+ Documentation string for the property. Defaults to documentation
+ string of getter function.
+ """
+ validate_interface_name(dbus_interface)
+ self._dbus_interface = dbus_interface
+
+ # Keep the given name for later assignment of setter
+ self._init_property_name = property_name
+ if property_name is None:
+ if fget is not None:
+ property_name = fget.__name__
+ elif fset is not None:
+ property_name = fset.__name__
+ if property_name is not None and not isinstance(property_name, str):
+ if not is_py2 or not isinstance(property_name, unicode):
+ raise TypeError("Invalid property name: '%s'" % property_name)
+ self.__name__ = property_name
+
+ self._init_doc = doc
+ if doc is None and fget is not None:
+ doc = getattr(fget, "__doc__", None)
+ self.fget = fget
+ self.fset = fset
+ self.__doc__ = doc
+
+ if emits_changed_signal not in (None, True, False, 'invalidates'):
+ raise ValueError("emits_changed_signal invalid value: '%s'" %
+ emits_changed_signal)
+ self._emits_changed_signal = emits_changed_signal
+ if len(tuple(Signature(signature))) != 1:
+ raise ValueError('signature must have only one item')
+ self._dbus_signature = signature
+
+ def __get__(self, inst, type=None):
+ if inst is None:
+ return self
+ if self.fget is None:
+ raise AttributeError("unreadable attribute")
+ return self.fget(inst)
+
+ def __set__(self, inst, value):
+ if self.fset is None:
+ raise AttributeError("can't set attribute")
+ self.fset(inst, value)
+
+ def __call__(self, fget):
+ return self.getter(fget)
+
+ def _copy(self, fget=None, fset=None):
+ return property(dbus_interface=self._dbus_interface,
+ signature=self._dbus_signature,
+ property_name=self._init_property_name,
+ emits_changed_signal=self._emits_changed_signal,
+ fget=fget or self.fget, fset=fset or self.fset,
+ doc=self._init_doc)
+
+ def getter(self, fget):
+ return self._copy(fget=fget)
+
+ def setter(self, fset):
+ return self._copy(fset=fset)
diff --git a/dbus/exceptions.py b/dbus/exceptions.py
index 0930425..23d5bb2 100644
--- a/dbus/exceptions.py
+++ b/dbus/exceptions.py
@@ -118,6 +118,14 @@ class IntrospectionParserException(DBusException):
def __init__(self, msg=''):
DBusException.__init__(self, "Error parsing introspect data: %s"%msg)
+class UnknownInterfaceException(DBusException):
+
+ include_traceback = True
+ _dbus_error_name = 'org.freedesktop.DBus.Error.UnknownInterface'
+
+ def __init__(self, interface):
+ DBusException.__init__(self, "Unknown interface: %s" % interface)
+
class UnknownMethodException(DBusException):
include_traceback = True
@@ -126,6 +134,22 @@ class UnknownMethodException(DBusException):
def __init__(self, method):
DBusException.__init__(self, "Unknown method: %s"%method)
+class UnknownPropertyException(DBusException):
+
+ include_traceback = True
+ _dbus_error_name = 'org.freedesktop.DBus.Error.UnknownProperty'
+
+ def __init__(self, property):
+ DBusException.__init__(self, "Unknown property: %s" % property)
+
+class PropertyReadOnlyException(DBusException):
+
+ include_traceback = True
+ _dbus_error_name = 'org.freedesktop.DBus.Error.PropertyReadOnly'
+
+ def __init__(self, property):
+ DBusException.__init__(self, "Property is read only: %s" % property)
+
class NameExistsException(DBusException):
include_traceback = True
diff --git a/dbus/service.py b/dbus/service.py
index 2953229..d6d54bc 100644
--- a/dbus/service.py
+++ b/dbus/service.py
@@ -23,7 +23,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
-__all__ = ('BusName', 'Object', 'FallbackObject', 'method', 'signal')
+__all__ = ('BusName', 'Object', 'FallbackObject', 'PropertiesInterface', 'method', 'property', 'signal')
__docformat__ = 'restructuredtext'
import sys
@@ -34,11 +34,14 @@ from collections import Sequence
import _dbus_bindings
from dbus import (
- INTROSPECTABLE_IFACE, ObjectPath, SessionBus, Signature, Struct,
- validate_bus_name, validate_object_path)
-from dbus.decorators import method, signal
+ INTROSPECTABLE_IFACE, ObjectPath, PROPERTIES_IFACE, SessionBus, Signature,
+ Struct, validate_bus_name, validate_object_path)
+_builtin_property = property
+from dbus.decorators import method, signal, property
from dbus.exceptions import (
- DBusException, NameExistsException, UnknownMethodException)
+ DBusException, NameExistsException, UnknownInterfaceException,
+ UnknownMethodException, UnknownPropertyException,
+ PropertyReadOnlyException)
from dbus.lowlevel import ErrorMessage, MethodReturnMessage, MethodCallMessage
from dbus.proxies import LOCAL_PATH
from dbus._compat import is_py2
@@ -297,20 +300,25 @@ def _method_reply_error(connection, message, exception):
class InterfaceType(type):
- def __init__(cls, name, bases, dct):
- # these attributes are shared between all instances of the Interface
- # object, so this has to be a dictionary that maps class names to
- # the per-class introspection/interface data
- class_table = getattr(cls, '_dbus_class_table', {})
- cls._dbus_class_table = class_table
- interface_table = class_table[cls.__module__ + '.' + name] = {}
+ def __new__(cls, name, bases, dct):
+ # Properties require the PropertiesInterface base.
+ for func in dct.values():
+ if isinstance(func, property):
+ for b in bases:
+ if issubclass(b, PropertiesInterface):
+ break
+ else:
+ bases += (PropertiesInterface,)
+ break
+
+ interface_table = dct.setdefault('_dbus_interface_table', {})
# merge all the name -> method tables for all the interfaces
# implemented by our base classes into our own
for b in bases:
- base_name = b.__module__ + '.' + b.__name__
- if getattr(b, '_dbus_class_table', False):
- for (interface, method_table) in class_table[base_name].items():
+ base_interface_table = getattr(b, '_dbus_interface_table', False)
+ if base_interface_table:
+ for (interface, method_table) in base_interface_table.items():
our_method_table = interface_table.setdefault(interface, {})
our_method_table.update(method_table)
@@ -320,9 +328,9 @@ class InterfaceType(type):
method_table = interface_table.setdefault(func._dbus_interface, {})
method_table[func.__name__] = func
- super(InterfaceType, cls).__init__(name, bases, dct)
+ return type.__new__(cls, name, bases, dct)
- # methods are different to signals, so we have two functions... :)
+ # methods are different to signals and properties, so we have three functions... :)
def _reflect_on_method(cls, func):
args = func._dbus_args
@@ -370,11 +378,107 @@ class InterfaceType(type):
return reflection_data
+ def _reflect_on_property(cls, descriptor):
+ signature = descriptor._dbus_signature
+
+ if descriptor.fget:
+ if descriptor.fset:
+ access = "readwrite"
+ else:
+ access = "read"
+ elif descriptor.fset:
+ access = "write"
+ else:
+ return ""
+ reflection_data = ' <property access="%s" type="%s" name="%s"' % (access, signature, descriptor.__name__)
+ if descriptor._emits_changed_signal is not None:
+ value = {True: "true", False: "false", "invalidates": "invalidates"}[descriptor._emits_changed_signal]
+ reflection_data += '>\n <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="%s"/>\n </property>\n' % (value,)
+ else:
+ reflection_data += ' />\n'
+ return reflection_data
+
# Define Interface as an instance of the metaclass InterfaceType, in a way
# that is compatible across both Python 2 and Python 3.
Interface = InterfaceType('Interface', (object,), {})
+class PropertiesInterface(Interface):
+ """An object with properties must inherit from this interface.
+
+ This interface is added automatically to the class when the
+ @\ `dbus.decorators.property` decorator is used.
+
+ :Since: 1.3.0
+ """
+
+ def _get_decorator(self, interface_name, property_name):
+ interfaces = self._dbus_interface_table
+ if interface_name:
+ interface = interfaces.get(interface_name)
+ if interface is None:
+ raise UnknownInterfaceException(interface_name)
+ prop = interface.get(property_name)
+ if prop is None or not isinstance(prop, property):
+ raise UnknownPropertyException(property_name)
+ return prop
+ else:
+ for interface in interfaces.itervalues():
+ prop = interface.get(property_name)
+ if prop and isinstance(prop, property):
+ return prop
+ raise UnknownPropertyException(property_name)
+
+ @method(PROPERTIES_IFACE, in_signature="ss", out_signature="v")
+ def Get(self, interface_name, property_name):
+ """Get the value of the property on named interface. interface_name
+ may be empty, but if there are many properties with the same name the
+ behaviour is undefined.
+ """
+ prop = self._get_decorator(interface_name, property_name)
+ if not prop.fget:
+ raise DBusException("Property '%s' is not readable" % property_name,
+ name="org.freedesktop.DBus.Error.InvalidArgs")
+ return prop.fget(self)
+
+ @method(PROPERTIES_IFACE, in_signature="ssv")
+ def Set(self, interface_name, property_name, value):
+ """Set value of property on named interface to value. interface_name
+ may be empty, but if there are many properties with the same name the
+ behaviour is undefined.
+ """
+ prop = self._get_decorator(interface_name, property_name)
+ if not prop.fset:
+ raise PropertyReadOnlyException(property_name)
+ return prop.fset(self, value)
+
+ @method(PROPERTIES_IFACE, in_signature="s", out_signature="a{sv}")
+ def GetAll(self, interface_name):
+ """Return a dictionary of all property names and values. Returns only
+ readable properties.
+ """
+ interfaces = self._dbus_interface_table
+ if interface_name:
+ iface = interfaces.get(interface_name)
+ if iface is None:
+ raise UnknownInterfaceException(interface_name)
+ ifaces = [iface]
+ else:
+ ifaces = interfaces.values()
+ properties = {}
+ for iface in ifaces:
+ for name, prop in iface.items():
+ if not isinstance(prop, property):
+ continue
+ if not prop.fget or name in properties:
+ continue
+ properties[name] = prop.fget(self)
+ return properties
+
+ @signal(PROPERTIES_IFACE, signature='sa{sv}as')
+ def PropertiesChanged(self, interface_name, changed_properties,
+ invalidated_properties):
+ pass
#: A unique object used as the value of Object._object_path and
#: Object._connection if it's actually in more than one place
@@ -384,11 +488,12 @@ class Object(Interface):
r"""A base class for exporting your own Objects across the Bus.
Just inherit from Object and mark exported methods with the
- @\ `dbus.service.method` or @\ `dbus.service.signal` decorator.
+ @\ `dbus.service.method`, @\ `dbus.service.signal` or
+ @\ `dbus.service.property` decorator.
Example::
- class Example(dbus.service.object):
+ class Example(dbus.service.Object):
def __init__(self, object_path):
dbus.service.Object.__init__(self, dbus.SessionBus(), path)
self._last_input = None
@@ -397,6 +502,8 @@ class Object(Interface):
in_signature='v', out_signature='s')
def StringifyVariant(self, var):
self.LastInputChanged(var) # emits the signal
+ # Emit the property changed signal
+ self.PropertiesChanged('com.example.Sample', {'LastInput': var}, [])
return str(var)
@dbus.service.signal(interface='com.example.Sample',
@@ -410,6 +517,20 @@ class Object(Interface):
in_signature='', out_signature='v')
def GetLastInput(self):
return self._last_input
+
+ @dbus.service.property(interface='com.example.Sample',
+ signature='s')
+ def LastInput(self):
+ return self._last_input
+
+ @LastInput.setter
+ def LastInput(self, value):
+ self._last_input = value
+ # By default a property is expected to send the
+ # PropertiesChanged signal when value changes.
+ self.PropertiesChanged('com.example.Sample',
+ {'LastInput': var}, [])
+
"""
#: If True, this object can be made available at more than one object path.
@@ -484,7 +605,7 @@ class Object(Interface):
if conn is not None and object_path is not None:
self.add_to_connection(conn, object_path)
- @property
+ @_builtin_property
def __dbus_object_path__(self):
"""The object-path at which this object is available.
Access raises AttributeError if there is no object path, or more than
@@ -500,7 +621,7 @@ class Object(Interface):
else:
return self._object_path
- @property
+ @_builtin_property
def connection(self):
"""The Connection on which this object is available.
Access raises AttributeError if there is no Connection, or more than
@@ -516,7 +637,7 @@ class Object(Interface):
else:
return self._connection
- @property
+ @_builtin_property
def locations(self):
"""An iterable over tuples representing locations at which this
object is available.
@@ -762,7 +883,7 @@ class Object(Interface):
reflection_data = _dbus_bindings.DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
reflection_data += '<node name="%s">\n' % object_path
- interfaces = self._dbus_class_table[self.__class__.__module__ + '.' + self.__class__.__name__]
+ interfaces = self._dbus_interface_table
for (name, funcs) in interfaces.items():
reflection_data += ' <interface name="%s">\n' % (name)
@@ -771,6 +892,8 @@ class Object(Interface):
reflection_data += self.__class__._reflect_on_method(func)
elif getattr(func, '_dbus_is_signal', False):
reflection_data += self.__class__._reflect_on_signal(func)
+ elif isinstance(func, property):
+ reflection_data += self.__class__._reflect_on_property(func)
reflection_data += ' </interface>\n'

View File

@@ -1,66 +0,0 @@
#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=pygobject
PKG_VERSION:=2.28.6
PKG_RELEASE:=1
PKG_LICENSE:=LGPL
PKG_SOURCE:=PYGOBJECT_2_28_6.tar.xz
PKG_SOURCE_SUBDIR:=PYGOBJECT_2_28_6
PKG_SOURCE_URL:=https://git.gnome.org/browse/pygobject/snapshot/
PKG_MD5SUM:=791c80656105a9e1704e8568b4eb05f9
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_FIXUP:=autoreconf
PKG_BUILD_DEPENDS:=python
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
include $(INCLUDE_DIR)/nls.mk
CONFIGURE_ARGS += \
--enable-cairo=no \
--with-cairo=no \
--enable-introspection=no
TARGET_LDFLAGS += -Wl,-rpath-link=$(ICONV_PREFIX)/lib
TARGET_LDFLAGS += -Wl,-rpath-link=$(INTL_PREFIX)/lib
define Package/python-gobject2
SECTION:=language-python
CATEGORY:=Languages
SUBMENU:=Python
TITLE:=python-gobject2
MAINTAINER:=Denis Osvald <denis.osvald@sartura.hr>
DEPENDS:=+python +glib2
endef
define Package/python-gobject2/description
Python bindings for GObject Introspection
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
endef
define Package/python-gobject2/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
#find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
endef
$(eval $(call BuildPackage,python-gobject2))

View File

@@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=questd
PKG_VERSION:=3.1.38
PKG_SOURCE_VERSION:=4e1e080fb8295d89c74abb93e08dcf2f9cc5abbf
PKG_SOURCE_VERSION:=a6b12a910caf7c1e1b868f4f97ed004ca2bacf03
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se:/questd

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=samba3
PKG_VERSION:=3.0.37
PKG_RELEASE:=2
PKG_RELEASE:=1
PKG_MD5SUM:=11ed2bfef4090bd5736b194b43f67289

View File

@@ -1,38 +0,0 @@
diff --git a/source/smbd/process.c b/source/smbd/process.c
index e861e16..6499bc7 100644
--- a/source/smbd/process.c
+++ b/source/smbd/process.c
@@ -1159,6 +1159,7 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
{
static char *orig_inbuf;
static char *orig_outbuf;
+ static int orig_size;
int smb_com1, smb_com2 = CVAL(inbuf,smb_vwv0);
unsigned smb_off2 = SVAL(inbuf,smb_vwv1);
char *inbuf2, *outbuf2;
@@ -1178,6 +1179,13 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
/* this is the first part of the chain */
orig_inbuf = inbuf;
orig_outbuf = outbuf;
+ orig_size = size;
+ }
+
+ /* Validate smb_off2 */
+ if ((smb_off2 < smb_wct - 4) || orig_size < (smb_off2 + 4 - smb_wct)) {
+ exit_server_cleanly("Bad chained packet");
+ return -1;
}
/*
@@ -1192,6 +1200,11 @@ int chain_reply(char *inbuf,char *outbuf,int size,int bufsize)
SSVAL(outbuf,smb_vwv1,smb_offset(outbuf+outsize,outbuf));
SCVAL(outbuf,smb_vwv0,smb_com2);
+ if (outsize <= smb_wct) {
+ exit_server_cleanly("Bad chained packet");
+ return -1;
+ }
+
/* remember how much the caller added to the chain, only counting stuff
after the parameter words */
chain_size += outsize - smb_wct;

View File

@@ -1,82 +0,0 @@
diff --git a/source/lib/util_sid.c b/source/lib/util_sid.c
index 032be9a..2c5a0c7 100644
--- a/source/lib/util_sid.c
+++ b/source/lib/util_sid.c
@@ -403,6 +403,9 @@ BOOL sid_parse(const char *inbuf, size_t len, DOM_SID *sid)
sid->sid_rev_num = CVAL(inbuf, 0);
sid->num_auths = CVAL(inbuf, 1);
+ if (sid->num_auths > MAXSUBAUTHS) {
+ return false;
+ }
memcpy(sid->id_auth, inbuf+2, 6);
if (len < 8 + sid->num_auths*4)
return False;
diff --git a/source/libads/ldap.c b/source/libads/ldap.c
index 7479894..eebc0fd 100644
--- a/source/libads/ldap.c
+++ b/source/libads/ldap.c
@@ -1771,7 +1771,9 @@ static void dump_sid(const char *field, struct berval **values)
int i;
for (i=0; values[i]; i++) {
DOM_SID sid;
- sid_parse(values[i]->bv_val, values[i]->bv_len, &sid);
+ if (!sid_parse(values[i]->bv_val, values[i]->bv_len, &sid)) {
+ return;
+ }
printf("%s: %s\n", field, sid_string_static(&sid));
}
}
diff --git a/source/libsmb/cliquota.c b/source/libsmb/cliquota.c
index 2a47ae2..5721b67 100644
--- a/source/libsmb/cliquota.c
+++ b/source/libsmb/cliquota.c
@@ -117,7 +117,9 @@ static BOOL parse_user_quota_record(const char *rdata, unsigned int rdata_count,
}
#endif /* LARGE_SMB_OFF_T */
- sid_parse(rdata+40,sid_len,&qt.sid);
+ if (!sid_parse(rdata+40,sid_len,&qt.sid)) {
+ return False;
+ }
qt.qtype = SMB_USER_QUOTA_TYPE;
diff --git a/source/smbd/nttrans.c b/source/smbd/nttrans.c
index 2b9d5da..60bab7e 100644
--- a/source/smbd/nttrans.c
+++ b/source/smbd/nttrans.c
@@ -2424,7 +2424,10 @@ static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *ou
/* unknown 4 bytes: this is not the length of the sid :-( */
/*unknown = IVAL(pdata,0);*/
- sid_parse(pdata+4,sid_len,&sid);
+ if (!sid_parse(pdata+4,sid_len,&sid)) {
+ return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+ }
+
DEBUGADD(10,("for SID: %s\n",sid_string_static(&sid)));
if (!sid_to_uid(&sid, &uid)) {
@@ -2662,7 +2665,9 @@ static int call_nt_transact_get_user_quota(connection_struct *conn, char *inbuf,
break;
}
- sid_parse(pdata+8,sid_len,&sid);
+ if (!sid_parse(pdata+8,sid_len,&sid)) {
+ return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+ }
if (vfs_get_ntquota(fsp, SMB_USER_QUOTA_TYPE, &sid, &qt)!=0) {
ZERO_STRUCT(qt);
@@ -2828,7 +2833,9 @@ static int call_nt_transact_set_user_quota(connection_struct *conn, char *inbuf,
}
#endif /* LARGE_SMB_OFF_T */
- sid_parse(pdata+40,sid_len,&sid);
+ if (!sid_parse(pdata+40,sid_len,&sid)) {
+ return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+ }
DEBUGADD(8,("SID: %s\n",sid_string_static(&sid)));
/* 44 unknown bytes left... */

View File

@@ -1,59 +0,0 @@
From e11637c2c89c2d38963311416c34a4767b19e175 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze@samba.org>
Date: Sat, 17 Mar 2012 01:22:27 +0100
Subject: [PATCH] s3:librpc/gen_ndr: fix array checks (bug #8815 / CVE-2012-1182)
An Anonymous researcher working with HP's Zero Day Initiative program
has found this and notified us.
metze
---
source/librpc/gen_ndr/ndr_wkssvc.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/source/librpc/gen_ndr/ndr_wkssvc.c b/source/librpc/gen_ndr/ndr_wkssvc.c
index 2af3587..07cf1a1 100644
--- a/source/librpc/gen_ndr/ndr_wkssvc.c
+++ b/source/librpc/gen_ndr/ndr_wkssvc.c
@@ -1385,10 +1385,10 @@ NTSTATUS ndr_pull_USER_INFO_0_CONTAINER(struct ndr_pull *ndr, int ndr_flags, str
NDR_PULL_ALLOC_N(ndr, r->user0, ndr_get_array_size(ndr, &r->user0));
_mem_save_user0_1 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->user0, 0);
- for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) {
+ for (cntr_user0_1 = 0; cntr_user0_1 < ndr_get_array_size(ndr, &r->user0); cntr_user0_1++) {
NDR_CHECK(ndr_pull_USER_INFO_0(ndr, NDR_SCALARS, &r->user0[cntr_user0_1]));
}
- for (cntr_user0_1 = 0; cntr_user0_1 < r->entries_read; cntr_user0_1++) {
+ for (cntr_user0_1 = 0; cntr_user0_1 < ndr_get_array_size(ndr, &r->user0); cntr_user0_1++) {
NDR_CHECK(ndr_pull_USER_INFO_0(ndr, NDR_BUFFERS, &r->user0[cntr_user0_1]));
}
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user0_1, 0);
@@ -1631,10 +1631,10 @@ NTSTATUS ndr_pull_USER_INFO_1_CONTAINER(struct ndr_pull *ndr, int ndr_flags, str
NDR_PULL_ALLOC_N(ndr, r->user1, ndr_get_array_size(ndr, &r->user1));
_mem_save_user1_1 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->user1, 0);
- for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) {
+ for (cntr_user1_1 = 0; cntr_user1_1 < ndr_get_array_size(ndr, &r->user1); cntr_user1_1++) {
NDR_CHECK(ndr_pull_USER_INFO_1(ndr, NDR_SCALARS, &r->user1[cntr_user1_1]));
}
- for (cntr_user1_1 = 0; cntr_user1_1 < r->entries_read; cntr_user1_1++) {
+ for (cntr_user1_1 = 0; cntr_user1_1 < ndr_get_array_size(ndr, &r->user1); cntr_user1_1++) {
NDR_CHECK(ndr_pull_USER_INFO_1(ndr, NDR_BUFFERS, &r->user1[cntr_user1_1]));
}
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user1_1, 0);
@@ -1953,10 +1953,10 @@ NTSTATUS ndr_pull_wkssvc_NetWkstaTransportCtr0(struct ndr_pull *ndr, int ndr_fla
NDR_PULL_ALLOC_N(ndr, r->array, ndr_get_array_size(ndr, &r->array));
_mem_save_array_1 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, r->array, 0);
- for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
+ for (cntr_array_1 = 0; cntr_array_1 < ndr_get_array_size(ndr, &r->array); cntr_array_1++) {
NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_SCALARS, &r->array[cntr_array_1]));
}
- for (cntr_array_1 = 0; cntr_array_1 < r->count; cntr_array_1++) {
+ for (cntr_array_1 = 0; cntr_array_1 < ndr_get_array_size(ndr, &r->array); cntr_array_1++) {
NDR_CHECK(ndr_pull_wkssvc_NetWkstaTransportInfo0(ndr, NDR_BUFFERS, &r->array[cntr_array_1]));
}
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_array_1, 0);
--
1.7.4.1

View File

@@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=u-boot
PKG_VERSION:=2016.08
PKG_RELEASE:=2
PKG_SOURCE_URL:=http://public.inteno.se:/uboot
PKG_RELEASE:=1
PKG_SOURCE_URL:=git@private.inteno.se:uboot
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=fccb9d5ee720a9f60cba917ded83e5cebe221eef
PKG_SOURCE_VERSION:=08fb2b839326c3bc2a2a0472b5dae6ee0288e483
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
@@ -61,11 +61,6 @@ endif
define Build/Configure
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
$(UBOOT_CONFIG)_config
$(SED) "s,CONFIG_INTENO_MAJOR=\"0\",CONFIG_INTENO_MAJOR=\"$(PKG_RELEASE)\"," $(PKG_BUILD_DIR)/.config
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
oldconfig
endef
define Build/Compile
@@ -76,7 +71,6 @@ define Build/Compile
endef
define Package/uboot/install/default
$(CP) ./files/* $$(1)/
$(INSTALL_DIR) $(BIN_DIR)/$(TARGET)
$(INSTALL_DIR) $$(1)/boot
$(CP) \

View File

@@ -1,78 +0,0 @@
#!/bin/sh /etc/rc.common
START=50
. /usr/share/libubox/jshn.sh
sanity_check_env(){
# make sure iboot is used to start board, but only if verify_boot != 1
# that allows a person to change the bootcmd and not have it overwritten automatically
# but still force it to iboot for old boards.
vb=$(fw_printenv -n verify_boot 2>/dev/null)
if [ "1" != "$verify_boot" ]
then
if ! fw_printenv -n bootcmd 2>/dev/null| grep iboot >/dev/null
then
echo "update uboot boot command"
fw_setenv bootcmd "rescue;iboot"
fw_setenv verify_boot 1
fi
fi
# just set 115200 baudrate as it is really hardcoded in the binary blob
fw_setenv baudrate 115200
}
uboot_upgrade(){
echo "doing upgrade of u-boot old version $cur_Major.$cur_Minor new version $Major.$Minor"
mtd erase /dev/mtd0
mtd write /boot/uboot.img /dev/mtd0
sanity_check_env
}
start() {
iver=$(fw_printenv -n uboot_inteno_version 2>/dev/null)
if [ -z "$iver" ]
then
# if this variable is not set by u-boot the u-boot version is too old.
uboot_upgrade
return
fi
# read in current version into Major Minor variables
json_init
json_load $(echo $iver |sed -e 's/938f0820-2ffb-11e7-bbc9-2f21351ee6fb: //')
json_get_vars Major Minor
# echo "Major $Major"
# echo "Minor $Minor"
cur_Major=$Major
cur_Minor=$Minor
# read in new uboot version into Major Minor variables
json_load $(strings /boot/uboot.img | grep 938f0820-2ffb-11e7-bbc9-2f21351ee6fb |sed -e 's/938f0820-2ffb-11e7-bbc9-2f21351ee6fb: //')
json_get_vars Major Minor
# echo "Major $Major"
# echo "Minor $Minor"
if [ $Major -gt $cur_Major ]
then
uboot_upgrade
return
fi
if [ $Major -eq $cur_Major -a $Minor -gt $cur_Minor ]
then
uboot_upgrade
return
fi
}

View File

@@ -336,7 +336,6 @@ get_bindaddr() {
local bindaddr=""
[ -n "$intf" ] && network_get_ipaddr bindaddr "$intf"
[ -z "$bindaddr" ] && network_get_ipaddr6 bindaddr "$intf"
echo "${bindaddr:-0.0.0.0}"
}