Merge Upstream

This commit is contained in:
CN_SZTL 2020-07-16 20:36:17 +08:00
commit dc78a80d9f
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
47 changed files with 580 additions and 99 deletions

View File

@ -8,12 +8,12 @@ endif
LINUX_VERSION-4.9 = .230
LINUX_VERSION-4.14 = .188
LINUX_VERSION-4.19 = .132
LINUX_VERSION-4.19 = .133
LINUX_VERSION-5.4 = .52
LINUX_KERNEL_HASH-4.9.230 = d5ba9256e3ebf1cead127f323acc8124965d89cc88e75eca377fcca3bd6c037c
LINUX_KERNEL_HASH-4.14.188 = 766fe01387b1d1b7bd37ca45a5048cdad13e3a51c6c43746dbb657a0ba67064b
LINUX_KERNEL_HASH-4.19.132 = d7d7ee94962ce4cc070e8db7f7f3755cbef122a3fd77c436d5381a61819a7d44
LINUX_KERNEL_HASH-4.19.133 = b933e5fe7d09af623809b96fd26119381e71c8994af5f9f7a644b78ede77dbc4
LINUX_KERNEL_HASH-5.4.52 = 037efa531120b1c20ff55e78cd3e17288b1804b3a57dc31de760837b3bea5d3a
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))

View File

@ -231,7 +231,7 @@ nand_upgrade_ubinized() {
# Write the UBIFS image to UBI volume
nand_upgrade_ubifs() {
local rootfs_length=`(cat $1 | wc -c) 2> /dev/null`
local rootfs_length=$( (cat $1 | wc -c) 2> /dev/null)
nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0"
@ -249,8 +249,8 @@ nand_upgrade_tar() {
local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
board_dir=${board_dir%/}
local kernel_length=`(tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null`
local rootfs_length=`(tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null`
local kernel_length=$( (tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null)
local rootfs_length=$( (tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null)
local rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)"
@ -320,7 +320,7 @@ nand_do_upgrade() {
nand_do_platform_check() {
local board_name="$1"
local tar_file="$2"
local control_length=`(tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null`
local control_length=$( (tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null)
local file_type="$(identify $2)"
[ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" ] && {

View File

@ -9,7 +9,6 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=om-watchdog
PKG_RELEASE:=2
PKG_VERSION:=1
include $(INCLUDE_DIR)/package.mk

View File

@ -9,7 +9,6 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=trelay
PKG_VERSION:=0.1
PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk

View File

@ -1,5 +1,8 @@
#!/bin/sh
openvpn_port="$(uci -q get openvpn.myvpn.port)"
[ -z "$openvpn_port" ] && openvpn_port=1194
uci -q batch <<-EOF >/dev/null
delete network.vpn0
set network.vpn0=interface
@ -14,7 +17,7 @@ uci -q batch <<-EOF >/dev/null
set firewall.openvpn.target='ACCEPT'
set firewall.openvpn.src='wan'
set firewall.openvpn.proto='tcp udp'
set firewall.openvpn.dest_port='1194'
set firewall.openvpn.dest_port="$openvpn_port"
delete firewall.vpn
set firewall.vpn=zone

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=vlmcsd
PKG_VERSION:=svn1112
PKG_VERSION:=svn1113
PKG_RELEASE:=1
PKG_MAINTAINER:=fuyumi <280604399@qq.com>
@ -10,7 +10,7 @@ PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/Wind4/vlmcsd.git
PKG_SOURCE_VERSION:=cd488aeb85aedefe1cb4db02c632397d78a9de88
PKG_SOURCE_VERSION:=e599080486478e219cd065e141d6de050a450c27
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_VERSION).tar.gz

View File

@ -8,8 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gre
PKG_VERSION:=1
PKG_RELEASE:=9
PKG_RELEASE:=12
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
@ -24,6 +23,7 @@ define Package/gre
TITLE:=Generic Routing Encapsulation config support
DEPENDS:=+kmod-gre +IPV6:kmod-gre6 +resolveip
PROVIDES:=grev4 grev6
PKGARCH:=all
endef
define Package/gre/description

View File

@ -13,10 +13,9 @@ gre_generic_setup() {
local local="$3"
local remote="$4"
local link="$5"
local mtu ttl tos zone ikey okey icsum ocsum iseqno oseqno multicast
json_get_vars mtu ttl tos zone ikey okey icsum ocsum iseqno oseqno multicast
local mtu ipv6 ttl tos zone ikey okey icsum ocsum iseqno oseqno multicast
json_get_vars mtu ipv6 ttl tos zone ikey okey icsum ocsum iseqno oseqno multicast
[ -z "$zone" ] && zone="wan"
[ -z "$multicast" ] && multicast=1
proto_init_update "$link" 1
@ -24,6 +23,7 @@ gre_generic_setup() {
proto_add_tunnel
json_add_string mode "$mode"
json_add_int mtu "${mtu:-1280}"
json_add_boolean ipv6 "${ipv6:-1}"
[ -n "$df" ] && json_add_boolean df "$df"
[ -n "$ttl" ] && json_add_int ttl "$ttl"
[ -n "$tos" ] && json_add_string tos "$tos"
@ -57,7 +57,7 @@ gre_setup() {
local remoteip
local ipaddr peeraddr
json_get_vars df ipaddr peeraddr tunlink
json_get_vars df ipaddr peeraddr tunlink nohostroute
[ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_PEER_ADDRESS"
@ -77,7 +77,9 @@ gre_setup() {
break
done
( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
if [ "${nohostroute}" != "1" ]; then
( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
fi
[ -z "$ipaddr" ] && {
local wanif="$tunlink"
@ -134,7 +136,7 @@ grev6_setup() {
local remoteip6
local ip6addr peer6addr weakif
json_get_vars ip6addr peer6addr tunlink weakif encaplimit
json_get_vars ip6addr peer6addr tunlink weakif encaplimit nohostroute
[ -z "$peer6addr" ] && {
proto_notify_error "$cfg" "MISSING_PEER_ADDRESS"
@ -154,7 +156,9 @@ grev6_setup() {
break
done
( proto_add_host_dependency "$cfg" "$peer6addr" "$tunlink" )
if [ "${nohostroute}" != "1" ]; then
( proto_add_host_dependency "$cfg" "$peer6addr" "$tunlink" )
fi
[ -z "$ip6addr" ] && {
local wanif="$tunlink"
@ -245,6 +249,7 @@ gre_generic_init_config() {
available=1
proto_config_add_int "mtu"
proto_config_add_boolean "ipv6"
proto_config_add_int "ttl"
proto_config_add_string "tos"
proto_config_add_string "tunlink"
@ -263,6 +268,7 @@ proto_gre_init_config() {
proto_config_add_string "ipaddr"
proto_config_add_string "peeraddr"
proto_config_add_boolean "df"
proto_config_add_boolean "nohostroute"
}
proto_gretap_init_config() {
@ -276,6 +282,7 @@ proto_grev6_init_config() {
proto_config_add_string "peer6addr"
proto_config_add_string "weakif"
proto_config_add_string "encaplimit"
proto_config_add_boolean "nohostroute"
}
proto_grev6tap_init_config() {

View File

@ -8,8 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ipip
PKG_VERSION:=1
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
@ -20,6 +19,7 @@ define Package/ipip
MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>
TITLE:=IP in IP Tunnel config support
DEPENDS:= +kmod-ipip +resolveip
PKGARCH:=all
endef
define Package/ipip/description

View File

@ -47,8 +47,6 @@ proto_ipip_setup() {
fi
}
[ -z "$zone" ] && zone="wan"
proto_init_update "ipip-$cfg" 1
proto_add_tunnel

View File

@ -8,8 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=vti
PKG_VERSION:=1
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
@ -18,6 +17,7 @@ define Package/vti/Default
SECTION:=net
CATEGORY:=Network
MAINTAINER:=Andre Valentin <avalentin@marcant.net>
PKGARCH:=all
endef
define Package/vti

View File

@ -16,8 +16,6 @@ vti_generic_setup() {
local mtu zone ikey
json_get_vars mtu zone ikey okey
[ -z "$zone" ] && zone="wan"
proto_init_update "$link" 1
proto_add_tunnel

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=vxlan
PKG_VERSION:=2
PKG_RELEASE:=3
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk

View File

@ -129,6 +129,8 @@ vxlan_generic_init_config() {
proto_config_add_int "ttl"
proto_config_add_int "tos"
proto_config_add_int "mtu"
proto_config_add_boolean "rxcsum"
proto_config_add_boolean "txcsum"
proto_config_add_string "macaddr"
}

View File

@ -0,0 +1,38 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=xfrm
PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
define Package/xfrm/Default
SECTION:=net
CATEGORY:=Network
MAINTAINER:=Andre Valentin <avalentin@marcant.net>
PKGARCH:=all
endef
define Package/xfrm
$(call Package/xfrm/Default)
TITLE:=XFRM IPsec Tunnel Interface config support
DEPENDS:=+kmod-xfrm-interface
endef
define Package/xfrm/description
XFRM IPsec Tunnel Interface config support (IPv4 and IPv6) in /etc/config/network.
endef
define Build/Compile
endef
define Build/Configure
endef
define Package/xfrm/install
$(INSTALL_DIR) $(1)/lib/netifd/proto
$(INSTALL_BIN) ./files/xfrm.sh $(1)/lib/netifd/proto/xfrm.sh
endef
$(eval $(call BuildPackage,xfrm))

View File

@ -0,0 +1,69 @@
#!/bin/sh
[ -n "$INCLUDE_ONLY" ] || {
. /lib/functions.sh
. /lib/functions/network.sh
. ../netifd-proto.sh
init_proto "$@"
}
proto_xfrm_setup() {
local cfg="$1"
local mode="xfrm"
local tunlink ifid mtu zone
json_get_vars tunlink ifid mtu zone
[ -z "$tunlink" ] && {
proto_notify_error "$cfg" NO_TUNLINK
proto_block_restart "$cfg"
exit
}
[ -z "$ifid" ] && {
proto_notify_error "$cfg" NO_IFID
proto_block_restart "$cfg"
exit
}
( proto_add_host_dependency "$cfg" '' "$tunlink" )
proto_init_update "$cfg" 1
proto_add_tunnel
json_add_string mode "$mode"
json_add_int mtu "${mtu:-1280}"
json_add_string link "$tunlink"
json_add_object 'data'
[ -n "$ifid" ] && json_add_int ifid "$ifid"
json_close_object
proto_close_tunnel
proto_add_data
[ -n "$zone" ] && json_add_string zone "$zone"
proto_close_data
proto_send_update "$cfg"
}
proto_xfrm_teardown() {
local cfg="$1"
}
proto_xfrm_init_config() {
no_device=1
available=1
proto_config_add_int "mtu"
proto_config_add_string "tunlink"
proto_config_add_string "zone"
proto_config_add_int "ifid"
}
[ -n "$INCLUDE_ONLY" ] || {
[ -f /lib/modules/$(uname -r)/xfrm_interface.ko -o -d /sys/module/xfrm_interface ] && add_protocol xfrm
}

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=464xlat
PKG_VERSION:=12
PKG_RELEASE:=12
PKG_SOURCE_DATE:=2018-01-16
PKG_MAINTAINER:=Hans Dedecker <dedeckeh@gmail.com>

View File

@ -8,8 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=6in4
PKG_VERSION:=25
PKG_RELEASE:=1
PKG_RELEASE:=26
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk

View File

@ -8,8 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=6rd
PKG_VERSION:=9
PKG_RELEASE:=4
PKG_RELEASE:=10
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk

View File

@ -8,8 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=6to4
PKG_VERSION:=12
PKG_RELEASE:=2
PKG_RELEASE:=13
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk

View File

@ -8,8 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ds-lite
PKG_VERSION:=7
PKG_RELEASE:=4
PKG_RELEASE:=8
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk

View File

@ -8,8 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map
PKG_VERSION:=4
PKG_RELEASE:=13
PKG_RELEASE:=5
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk

View File

@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=wireguard
PKG_VERSION:=1.0.20200623
PKG_VERSION:=1.0.20200712
PKG_RELEASE:=1
PKG_SOURCE:=wireguard-linux-compat-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-linux-compat/snapshot/
PKG_HASH:=130937724515799edf05ff8216bc837df8acda879428f3a7f96a3287758f9445
PKG_HASH:=e15b3d4eb2cf186920a6ed13685187d6b846e59eb383c291913628682965ac95
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=iproute2
PKG_VERSION:=5.7.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2

View File

@ -0,0 +1,32 @@
From 650591a7a70cd79d826fcdc579a20c168c987cf2 Mon Sep 17 00:00:00 2001
From: Tony Ambardar <tony.ambardar@gmail.com>
Date: Tue, 7 Jul 2020 00:58:33 -0700
Subject: [PATCH] configure: support ipset version 7 with kernel version 5
The configure script checks for ipset v6 availability but doesn't test
for v7, which is backward compatible and used on kernel v5.x systems.
Update the script to test for both ipset versions. Without this change,
the tc ematch function em_ipset will be disabled.
Signed-off-by: Tony Ambardar <Tony.Ambardar@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index f415bf49..307912aa 100755
--- a/configure
+++ b/configure
@@ -208,7 +208,7 @@ typedef unsigned short ip_set_id_t;
#include <linux/netfilter/xt_set.h>
struct xt_set_info info;
-#if IPSET_PROTOCOL == 6
+#if IPSET_PROTOCOL == 6 || IPSET_PROTOCOL == 7
int main(void)
{
return IPSET_MAXNAMELEN;
--
2.17.1

View File

@ -39,6 +39,6 @@
+ for s in `grep -B 3 '\<dlsym' $$files | sed -n '/snprintf/{s:.*"\([^"]*\)".*:\1:;s:%s::;p}'` ; do \
+ sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:\1;:;p}' $$files ; \
+ done >> $@ ; \
+ echo "show_stats; print_tm; parse_rtattr; get_u32; matches; addattr_l; addattr_nest; addattr_nest_end; };" >> $@
+ echo "show_stats; print_nl; print_tm; parse_rtattr; parse_rtattr_flags; get_u32; matches; addattr_l; addattr_nest; addattr_nest_end; };" >> $@
+
endif

View File

@ -8,8 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=rssileds
PKG_VERSION:=0.2
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_LICNESE:=GPL-2.0+
include $(INCLUDE_DIR)/package.mk

View File

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=procd
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git
PKG_SOURCE_DATE:=2020-05-28
PKG_SOURCE_VERSION:=b9b39e2061d7035a9d84eecbb4a4613deaf6d03f
PKG_MIRROR_HASH:=0d6a96a2fb38f72c72b457a2a8638bee22f91009f9686152fcf4aee97846fc84
PKG_SOURCE_DATE:=2020-07-14
PKG_SOURCE_VERSION:=b2230e4ff28b29472d0a232fee5d9f4168390b52
PKG_MIRROR_HASH:=67dd91d469a2e996a6b350575cfc0accedcf9ac948feaeee0d665199820bb6b0
CMAKE_INSTALL:=1
PKG_LICENSE:=GPL-2.0
@ -70,6 +70,14 @@ define Package/procd-seccomp
TITLE:=OpenWrt process seccomp helper + utrace
endef
define Package/uxc
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json
TITLE:=OpenWrt container management
MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
endef
define Package/procd/config
menu "Configuration"
depends on PACKAGE_procd
@ -130,7 +138,19 @@ define Package/procd-seccomp/install
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib
endef
define Package/uxc/conffiles
/etc/uxc
endef
define Package/uxc/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/uxc $(1)/sbin/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/uxc.init $(1)/etc/init.d/uxc
endef
$(eval $(call BuildPackage,procd))
$(eval $(call BuildPackage,procd-ujail))
$(eval $(call BuildPackage,procd-ujail-console))
$(eval $(call BuildPackage,procd-seccomp))
$(eval $(call BuildPackage,uxc))

View File

@ -48,6 +48,15 @@ _PROCD_SERVICE=
procd_lock() {
local basescript=$(readlink "$initscript")
local service_name="$(basename ${basescript:-$initscript})"
flock -n 1000 &> /dev/null
if [ "$?" != "0" ]; then
exec 1000>"$IPKG_INSTROOT/var/lock/procd_${service_name}.lock"
flock 1000
if [ "$?" != "0" ]; then
logger "warning: procd flock for $service_name failed"
fi
fi
}
_procd_call() {
@ -238,7 +247,7 @@ _procd_set_param() {
env|data|limits)
_procd_add_table "$type" "$@"
;;
command|netdev|file|respawn|watch)
command|netdev|file|respawn|watch|watchdog)
_procd_add_array "$type" "$@"
;;
error)
@ -369,7 +378,7 @@ _procd_append_param() {
env|data|limits)
_procd_add_table_data "$@"
;;
command|netdev|file|respawn|watch)
command|netdev|file|respawn|watch|watchdog)
_procd_add_array_data "$@"
;;
error)

View File

@ -0,0 +1,18 @@
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
NAME=uxc
PROG=/sbin/uxc
start_service() {
[ "${__BOOT_UXC}" = "1" ] || return 0
procd_open_instance "uxc"
procd_set_param command "$PROG" boot
procd_close_instance
}
boot() {
__BOOT_UXC=1
start
}

View File

@ -1,20 +1,17 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=urandom-seed
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0-only
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
define Package/urandom-seed
SECTION:=base
CATEGORY:=Base system
DEPENDS:=+getrandom
TITLE:=/etc/urandom.seed handling for OpenWrt
URL:=http://openwrt.org/
URL:=https://openwrt.org/
endef
define Build/Prepare
@ -25,7 +22,7 @@ define Build/Compile/Default
endef
Build/Compile = $(Build/Compile/Default)
define Package/$(PKG_NAME)/install
define Package/urandom-seed/install
$(CP) ./files/* $(1)/
endef

View File

View File

@ -8,8 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=zram-swap
PKG_VERSION:=1.1
PKG_RELEASE:=2
PKG_RELEASE:=5
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

View File

@ -2,17 +2,21 @@
START=15
ram_size()
EXTRA_COMMANDS="compact status"
EXTRA_HELP=" compact trigger compaction for all Z-RAM swap dev's
status print out status information & statistics about Z-RAM swap devices"
ram_getsize()
{
local line
while read line; do case "$line" in MemTotal:*) set $line; echo "$2"; break ;; esac; done </proc/meminfo
}
zram_size() # in megabytes
zram_getsize() # in megabytes
{
local zram_size="$( uci -q get system.@system[0].zram_size_mb )"
local ram_size="$( ram_size )"
local ram_size="$( ram_getsize )"
if [ -z "$zram_size" ]; then
# e.g. 6mb for 16mb-routers or 61mb for 128mb-routers
@ -106,18 +110,70 @@ zram_comp_streams()
fi
}
#print various stats info about zram swap device
zram_stats()
{
local zdev="/sys/block/$( basename "$1" )"
printf "\nGathering stats info for zram device \"$( basename "$1" )\"\n\n"
printf "Z-RAM\n-----\n"
printf "%-25s - %s\n" "Block device" $zdev
awk '{ printf "%-25s - %d MiB\n", "Device size", $1/1024/1024 }' <$zdev/disksize
printf "%-25s - %s\n" "Compression algo" "$(cat $zdev/comp_algorithm)"
printf "%-25s - %s\n" "Compression streams" "$( cat $zdev/max_comp_streams)"
awk 'BEGIN { fmt = "%-25s - %.2f %s\n"
fmt2 = "%-25s - %d\n"
print "\nDATA\n----" }
{ printf fmt, "Original data size", $1/1024/1024, "MiB"
printf fmt, "Compressed data size", $2/1024/1024, "MiB"
printf fmt, "Compress ratio", $1/$2, ""
print "\nMEMORY\n------"
printf fmt, "Memory used, total", $3/1024/1024, "MiB"
printf fmt, "Allocator overhead", ($3-$2)/1024/1024, "MiB"
printf fmt, "Allocator efficiency", $2/$3*100, "%"
printf fmt, "Maximum memory ever used", $5/1024/1024, "MiB"
printf fmt, "Memory limit", $4/1024/1024, "MiB"
print "\nPAGES\n-----"
printf fmt2, "Same pages count", $6
printf fmt2, "Pages compacted", $7 }' <$zdev/mm_stat
awk '{ printf "%-25s - %d\n", "Free pages discarded", $4 }' <$zdev/io_stat
}
zram_compact()
{
# compact zram device (reduce memory allocation overhead)
local zdev="/sys/block/$( basename "$1" )"
local old_mem_used=$(awk '{print $3}' <$zdev/mm_stat)
local old_overhead=$(awk '{print $3-$2}' <$zdev/mm_stat)
echo 1 > $zdev/compact
# If not running interactively, than just return
[ -z "$PS1" ] && return 0
echo ""
echo "Compacting zram device $zdev"
awk -v old_mem="$old_mem_used" -v ovr="$old_overhead" 'BEGIN { fmt = "%-25s - %.1f %s\n" }
{ printf fmt, "Memory usage reduced by ", (old_mem-$3)/1024/1024, "MiB"
printf fmt, "Overhead reduced by", (ovr-($3-$2))/ovr*100, "%" }' <$zdev/mm_stat
}
start()
{
local zram_size="$( zram_size )"
local zram_dev
if [ $( grep -cs zram /proc/swaps ) -ne 0 ]; then
logger -s -t zram_start -p daemon.notice "[OK] zram swap is already mounted"
return 1
fi
zram_dev="$( zram_getdev )"
local zram_size="$( zram_getsize )"
local zram_dev="$( zram_getdev )"
zram_applicable "$zram_dev" || return 1
local zram_priority="$( uci -q get system.@system[0].zram_priority )"
zram_priority=${zram_priority:+-p $zram_priority}
logger -s -t zram_start -p daemon.debug "activating '$zram_dev' for swapping ($zram_size MegaBytes)"
@ -144,3 +200,18 @@ stop()
} done
}
# show memory stats for all zram swaps
status()
{
for zram_dev in $( grep zram /proc/swaps |awk '{print $1}' ); do {
zram_stats "$zram_dev"
} done
}
# trigger compaction for all zram swaps
compact()
{
for zram_dev in $( grep zram /proc/swaps |awk '{print $1}' ); do {
zram_compact "$zram_dev"
} done
}

View File

@ -0,0 +1,34 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ravpower-mcu
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/blocktrron/ravpower-mcu.git
PKG_MIRROR_HASH:=edde0fda3fc708eac65baff46b5b6f1290ab733d3f4bd7fc027ef45c3d1b5814
PKG_SOURCE_DATE:=2020-06-19
PKG_SOURCE_VERSION:=1665d9e9212dcd118629a74fbe658841f81036f7
PKG_MAINTAINER:=David Bauer <mail@david-bauer.net>
PKG_LICENSE:=GPL-2.0-or-later
include $(INCLUDE_DIR)/package.mk
define Package/ravpower-mcu
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Utility to control the RAVPower RP-WD009 PMIC
URL:=https://github.com/blocktrron/ravpower-mcu/
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS) -Wall"
endef
define Package/ravpower-mcu/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/out/ravpower-mcu $(1)/usr/bin/
endef
$(eval $(call BuildPackage,ravpower-mcu))

View File

@ -42,9 +42,10 @@ GO_PKG_LDFLAGS_X:= \
github.com/syncthing/syncthing/lib/build.User=ctcgfw \
github.com/syncthing/syncthing/lib/build.Host=project-openwrt \
github.com/syncthing/syncthing/lib/build.Program=syncthing
GO_PKG_TAGS:=noupgrade
define Build/Compile
$(call GoPackage/Build/Compile,-tags noupgrade)
$(call GoPackage/Build/Compile)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/syncthing
endef

View File

@ -25,7 +25,7 @@ Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
u32 *data, int in_pm)
{
@@ -1972,7 +1976,8 @@ static int smsc95xx_rx_fixup(struct usbn
@@ -1979,7 +1983,8 @@ static int smsc95xx_rx_fixup(struct usbn
if (dev->net->features & NETIF_F_RXCSUM)
smsc95xx_rx_csum_offload(skb);
skb_trim(skb, skb->len - 4); /* remove fcs */
@ -35,7 +35,7 @@ Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
return 1;
}
@@ -1990,7 +1995,8 @@ static int smsc95xx_rx_fixup(struct usbn
@@ -1997,7 +2002,8 @@ static int smsc95xx_rx_fixup(struct usbn
if (dev->net->features & NETIF_F_RXCSUM)
smsc95xx_rx_csum_offload(ax_skb);
skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */

View File

@ -114,7 +114,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
config MODULES_TREE_LOOKUP
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3028,9 +3028,11 @@ static int setup_load_info(struct load_i
@@ -3030,9 +3030,11 @@ static int setup_load_info(struct load_i
static int check_modinfo(struct module *mod, struct load_info *info, int flags)
{
@ -127,7 +127,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (flags & MODULE_INIT_IGNORE_VERMAGIC)
modmagic = NULL;
@@ -3051,6 +3053,7 @@ static int check_modinfo(struct module *
@@ -3053,6 +3055,7 @@ static int check_modinfo(struct module *
mod->name);
add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
}

View File

@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <linux/mutex.h>
#include <linux/err.h>
#include <linux/of.h>
@@ -3040,3 +3041,5 @@ static int __init regmap_initcall(void)
@@ -3032,3 +3033,5 @@ static int __init regmap_initcall(void)
return 0;
}
postcore_initcall(regmap_initcall);

View File

@ -0,0 +1,193 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Wed, 8 Feb 2017 16:26:00 +0100
Subject: [PATCH] ipq40xx: Fix ar40xx port separation
It is currently not possible to submit (or receive) VLAN tagged frames over
the ar40xx PHY switch and the edma ethernet device.
This can be worked around by disabling enable_vlan. The separation of the
eth0 and eth1 ports is then done by the vlan_tag information from the
device tree. But the ar40xx PHY switch then also has to parse the word3
port bitmap (word3) from the TDP when data was received from the CPU port
(0).
IssueID: #2857
Forwarded: no
The ar40xx.c change was forwarded to Xiaofei Shen <xiaofeis@codeaurora.org>
(QCA). But John Crispin will rewrite the driver anyway and we have to check
later if this change is required in his driver too.
---
drivers/net/phy/ar40xx.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/ar40xx.c b/drivers/net/phy/ar40xx.c
index e408e8f7312f749aeb29c73a589047856e9479c7..421399b9b33e6f42d4e38db3f90b0c1d514a0b79 100644
--- a/drivers/net/phy/ar40xx.c
+++ b/drivers/net/phy/ar40xx.c
@@ -1200,7 +1200,11 @@ ar40xx_init_port(struct ar40xx_priv *priv, int port)
ar40xx_rmw(priv, AR40XX_REG_PORT_STATUS(port),
AR40XX_PORT_AUTO_LINK_EN, 0);
- ar40xx_write(priv, AR40XX_REG_PORT_HEADER(port), 0);
+ /* CPU port is setting headers to limit output ports */
+ if (port == 0)
+ ar40xx_write(priv, AR40XX_REG_PORT_HEADER(port), 0x8);
+ else
+ ar40xx_write(priv, AR40XX_REG_PORT_HEADER(port), 0);
ar40xx_write(priv, AR40XX_REG_PORT_VLAN0(port), 0);
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 17 Mar 2017 11:00:40 +0100
Subject: [PATCH] ipq40xx: Disable CTAG TX VLAN offloading
The driver requires the offloading to set the VLAN specific header for the
port selection. It can therefore not be used at the same time to offload
the setting of the VLAN header on top of essedma interface.
Forwarded: no
---
drivers/net/ethernet/qualcomm/essedma/edma_axi.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/qualcomm/essedma/edma_axi.c b/drivers/net/ethernet/qualcomm/essedma/edma_axi.c
index 81fc1e1b64daa41b15f21634ac1f08de0f5822a7..db184b82769f53e1554a1c51c53414ef7cadd7f6 100644
--- a/drivers/net/ethernet/qualcomm/essedma/edma_axi.c
+++ b/drivers/net/ethernet/qualcomm/essedma/edma_axi.c
@@ -970,7 +970,6 @@ static int edma_axi_probe(struct platform_device *pdev)
edma_netdev[i]->netdev_ops = &edma_axi_netdev_ops;
edma_netdev[i]->max_mtu = 9000;
edma_netdev[i]->features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM
- | NETIF_F_HW_VLAN_CTAG_TX
| NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_SG |
NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_GRO;
edma_netdev[i]->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM |
From: Sven Eckelmann <sven@narfation.org>
Date: Fri, 17 Mar 2017 11:04:50 +0100
Subject: [PATCH] ar40xx: Enable QinQ on the switch
The switch used in by IPQ40xx is using VLANs by default to select the
outgoing port. It was therefore not possible to sent or receive 802.1q
tagged frames over the CPU port. This can be allowed by changing the port
configuration and lookup configuration.
The resulting VLAN-tagged frames send or received by the CPU will therefore
look like QinQ frames. The outer VLAN tag is the port-VLAN of the port from
which the data was received or towards which the data has to be sent. The
inner VLAN tag (when it exists) is the VLAN which was configrued on top of
the ethernet device.
Forwarded: no
---
drivers/net/phy/ar40xx.c | 23 ++++++++++++++++++++---
drivers/net/phy/ar40xx.h | 5 +++++
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/ar40xx.c b/drivers/net/phy/ar40xx.c
index 421399b9b33e6f42d4e38db3f90b0c1d514a0b79..4af26638d542a9ab5ca27454ce557233bcb64575 100644
--- a/drivers/net/phy/ar40xx.c
+++ b/drivers/net/phy/ar40xx.c
@@ -1247,6 +1247,10 @@ ar40xx_init_globals(struct ar40xx_priv *priv)
t = (AR40XX_PORT0_FC_THRESH_ON_DFLT << 16) |
AR40XX_PORT0_FC_THRESH_OFF_DFLT;
ar40xx_write(priv, AR40XX_REG_PORT_FLOWCTRL_THRESH(0), t);
+
+ /* set service tag to 802.1q */
+ t = ETH_P_8021Q | AR40XX_ESS_SERVICE_TAG_STAG;
+ ar40xx_write(priv, AR40XX_ESS_SERVICE_TAG, t);
}
static void
@@ -1572,7 +1576,11 @@ ar40xx_setup_port(struct ar40xx_priv *priv, int port, u32 members)
u32 pvid = priv->vlan_id[priv->pvid[port]];
if (priv->vlan) {
- egress = AR40XX_PORT_VLAN1_OUT_MODE_UNMOD;
+ if (priv->vlan_tagged & BIT(port))
+ egress = AR40XX_PORT_VLAN1_OUT_MODE_TAG;
+ else
+ egress = AR40XX_PORT_VLAN1_OUT_MODE_UNMOD;
+
ingress = AR40XX_IN_SECURE;
} else {
egress = AR40XX_PORT_VLAN1_OUT_MODE_UNTOUCH;
@@ -1583,8 +1591,17 @@ ar40xx_setup_port(struct ar40xx_priv *priv, int port, u32 members)
t |= pvid << AR40XX_PORT_VLAN0_DEF_CVID_S;
ar40xx_write(priv, AR40XX_REG_PORT_VLAN0(port), t);
- t = AR40XX_PORT_VLAN1_PORT_VLAN_PROP;
- t |= egress << AR40XX_PORT_VLAN1_OUT_MODE_S;
+ t = egress << AR40XX_PORT_VLAN1_OUT_MODE_S;
+
+ /* set CPU port to core port */
+ if (port == 0)
+ t |= AR40XX_PORT_VLAN1_CORE_PORT;
+
+ if (priv->vlan_tagged & BIT(port))
+ t |= AR40XX_PORT_VLAN1_PORT_VLAN_PROP;
+ else
+ t |= AR40XX_PORT_VLAN1_PORT_TLS_MODE;
+
ar40xx_write(priv, AR40XX_REG_PORT_VLAN1(port), t);
t = members;
diff --git a/drivers/net/phy/ar40xx.h b/drivers/net/phy/ar40xx.h
index 722bf6ae4b32fcefa33e007ae34a3202315a3fe1..7ba40ccf753fe833e6a01b32cfe1407a317d92ee 100644
--- a/drivers/net/phy/ar40xx.h
+++ b/drivers/net/phy/ar40xx.h
@@ -151,6 +151,9 @@ struct ar40xx_mib_desc {
#define AR40XX_MIB_FUNC_NO_OP 0x0
#define AR40XX_MIB_FUNC_FLUSH 0x1
+#define AR40XX_ESS_SERVICE_TAG 0x48
+#define AR40XX_ESS_SERVICE_TAG_STAG BIT(17)
+
#define AR40XX_REG_PORT_STATUS(_i) (0x07c + (_i) * 4)
#define AR40XX_PORT_SPEED BITS(0, 2)
#define AR40XX_PORT_STATUS_SPEED_S 0
@@ -179,6 +182,8 @@ struct ar40xx_mib_desc {
#define AR40XX_PORT_VLAN0_DEF_CVID_S 16
#define AR40XX_REG_PORT_VLAN1(_i) (0x424 + (_i) * 0x8)
+#define AR40XX_PORT_VLAN1_CORE_PORT BIT(9)
+#define AR40XX_PORT_VLAN1_PORT_TLS_MODE BIT(7)
#define AR40XX_PORT_VLAN1_PORT_VLAN_PROP BIT(6)
#define AR40XX_PORT_VLAN1_OUT_MODE BITS(12, 2)
#define AR40XX_PORT_VLAN1_OUT_MODE_S 12
From: Sven Eckelmann <sven@narfation.org>
Date: Wed, 29 Mar 2017 16:05:26 +0200
Subject: [PATCH] ipq40xx: Disable NETIF_F_RXHASH support in essedma
The NETIF_F_RXHASH requires that each skb set the hash correctly with
skb_set_hash. essedma tries to do that but the set hash always results in
only used CPU when RPS is allowed for all CPUs.
Disabling RXHASH works around this problem for now.
IssueID: #5477
Forwarded: no
Upstream author was informed via e-mail about the problem
---
drivers/net/ethernet/qualcomm/essedma/edma_axi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/qualcomm/essedma/edma_axi.c b/drivers/net/ethernet/qualcomm/essedma/edma_axi.c
index db184b82769f53e1554a1c51c53414ef7cadd7f6..975e119cfe6f1a8cfe54ac0eb8f8752aa4bf22af 100644
--- a/drivers/net/ethernet/qualcomm/essedma/edma_axi.c
+++ b/drivers/net/ethernet/qualcomm/essedma/edma_axi.c
@@ -984,10 +984,10 @@ static int edma_axi_probe(struct platform_device *pdev)
NETIF_F_GRO;
#ifdef CONFIG_RFS_ACCEL
- edma_netdev[i]->features |= NETIF_F_RXHASH | NETIF_F_NTUPLE;
- edma_netdev[i]->hw_features |= NETIF_F_RXHASH | NETIF_F_NTUPLE;
- edma_netdev[i]->vlan_features |= NETIF_F_RXHASH | NETIF_F_NTUPLE;
- edma_netdev[i]->wanted_features |= NETIF_F_RXHASH | NETIF_F_NTUPLE;
+ edma_netdev[i]->features |= NETIF_F_NTUPLE;
+ edma_netdev[i]->hw_features |= NETIF_F_NTUPLE;
+ edma_netdev[i]->vlan_features |= NETIF_F_NTUPLE;
+ edma_netdev[i]->wanted_features |= NETIF_F_NTUPLE;
#endif
edma_set_ethtool_ops(edma_netdev[i]);

View File

@ -4,6 +4,10 @@
model = "Qualcomm IPQ8064/DB149";
compatible = "qcom,ipq8064-db149", "qcom,ipq8064";
aliases {
serial0 = &gsbi2_serial;
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
@ -14,11 +18,6 @@
};
};
alias {
serial0 = &uart2;
mdio-gpio0 = &mdio0;
};
chosen {
stdout-path = "serial0:115200n8";
};
@ -61,7 +60,7 @@
gsbi2: gsbi@12480000 {
qcom,mode = <GSBI_PROT_I2C_UART>;
status = "ok";
uart2: serial@12490000 {
gsbi2_serial: serial@12490000 {
status = "ok";
};
};

View File

@ -734,7 +734,7 @@
syscon-tcsr = <&tcsr>;
uart2: serial@12490000 {
gsbi2_serial: serial@12490000 {
compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
reg = <0x12490000 0x1000>,
<0x12480000 0x1000>;
@ -809,7 +809,7 @@
syscon-tcsr = <&tcsr>;
uart5: serial@1a240000 {
gsbi5_serial: serial@1a240000 {
compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
reg = <0x1a240000 0x1000>,
<0x1a200000 0x1000>;

View File

@ -4,6 +4,10 @@
model = "Qualcomm IPQ8064/DB149";
compatible = "qcom,ipq8064-db149", "qcom,ipq8064";
aliases {
serial0 = &gsbi2_serial;
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
@ -14,11 +18,6 @@
};
};
alias {
serial0 = &uart2;
mdio-gpio0 = &mdio0;
};
chosen {
stdout-path = "serial0:115200n8";
};
@ -61,7 +60,8 @@
gsbi2: gsbi@12480000 {
qcom,mode = <GSBI_PROT_I2C_UART>;
status = "okay";
uart2: serial@12490000 {
gsbi2_serial: serial@12490000 {
status = "okay";
};
};

View File

@ -818,7 +818,7 @@
syscon-tcsr = <&tcsr>;
uart2: serial@12490000 {
gsbi2_serial: serial@12490000 {
compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
reg = <0x12490000 0x1000>,
<0x12480000 0x1000>;
@ -893,7 +893,7 @@
syscon-tcsr = <&tcsr>;
uart5: serial@1a240000 {
gsbi5_serial: serial@1a240000 {
compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
reg = <0x1a240000 0x1000>,
<0x1a200000 0x1000>;

View File

@ -4,6 +4,10 @@
model = "Qualcomm IPQ8064/DB149";
compatible = "qcom,ipq8064-db149", "qcom,ipq8064";
aliases {
serial0 = &gsbi2_serial;
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
@ -14,10 +18,6 @@
};
};
alias {
serial0 = &uart2;
mdio-gpio0 = &mdio0;
};
};
&qcom_pinmux {
@ -33,7 +33,8 @@
&gsbi2 {
qcom,mode = <GSBI_PROT_I2C_UART>;
status = "okay";
uart2: serial@12490000 {
gsbi2_serial: serial@12490000 {
status = "okay";
};
};

View File

@ -876,7 +876,7 @@
syscon-tcsr = <&tcsr>;
uart2: serial@12490000 {
gsbi2_serial: serial@12490000 {
compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
reg = <0x12490000 0x1000>,
<0x12480000 0x1000>;

View File

@ -11,8 +11,8 @@ PKG_VERSION:=2.31
PKG_SOURCE_PROTO:=git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=3a44844c97a8ca1d0798c45b5252e6a49f9cf8e1
PKG_MIRROR_HASH:=d7206510e494b3c723173d8ec0dd2e41314da59075871c5642324688001b3f6e
PKG_SOURCE_VERSION:=4e8a33a9590edc5c3a2cc5e726a3f2a73b66cdc0
PKG_MIRROR_HASH:=41f678661dd1ee644dfae9734e27b47877ed7dee87c27eaddd9055394d36fe6a
PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz