Merge Lean's source

This commit is contained in:
CN_SZTL 2019-10-12 08:03:19 +08:00
commit fc184df3d4
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
90 changed files with 1547 additions and 838 deletions

View File

@ -302,7 +302,7 @@ menu "Target Images"
config TARGET_ROOTFS_PARTSIZE
int "Root filesystem partition size (in MB)"
depends on GRUB_IMAGES || EFI_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_mvebu || TARGET_rb532 || TARGET_sunxi || TARGET_uml
default 90
default 160
help
Select the root filesystem partition size.

View File

@ -6,6 +6,7 @@
config KERNEL_BUILD_USER
string "Custom Kernel Build User Name"
default "builder" if BUILDBOT
default ""
help
Sets the Kernel build user string, which for example will be returned
@ -14,6 +15,7 @@ config KERNEL_BUILD_USER
config KERNEL_BUILD_DOMAIN
string "Custom Kernel Build Domain Name"
default "buildhost" if BUILDBOT
default ""
help
Sets the Kernel build domain string, which for example will be
@ -44,7 +46,7 @@ config KERNEL_DEBUG_FS
config KERNEL_MIPS_FPU_EMULATOR
bool "Compile the kernel with MIPS FPU Emulator"
default y
default y if TARGET_pistachio
depends on (mips || mipsel || mips64 || mips64el)
config KERNEL_ARM_PMU
@ -52,6 +54,24 @@ config KERNEL_ARM_PMU
default n
depends on (arm || aarch64)
config KERNEL_X86_VSYSCALL_EMULATION
bool "Enable vsyscall emulation"
default n
depends on x86_64
help
This enables emulation of the legacy vsyscall page. Disabling
it is roughly equivalent to booting with vsyscall=none, except
that it will also disable the helpful warning if a program
tries to use a vsyscall. With this option set to N, offending
programs will just segfault, citing addresses of the form
0xffffffffff600?00.
This option is required by many programs built before 2013, and
care should be used even with newer programs if set to N.
Disabling this option saves about 7K of kernel size and
possibly 4K of additional runtime pagetable memory.
config KERNEL_PERF_EVENTS
bool "Compile the kernel with performance events and counters"
default n
@ -192,17 +212,21 @@ config KERNEL_KPROBE_EVENT
bool
default y if KERNEL_KPROBES
config KERNEL_KPROBE_EVENTS
bool
default y if KERNEL_KPROBES
config KERNEL_AIO
bool "Compile the kernel with asynchronous IO support"
default n
default y if !SMALL_FLASH
config KERNEL_FHANDLE
bool "Compile the kernel with support for fhandle syscalls"
default n
default y if !SMALL_FLASH
config KERNEL_FANOTIFY
bool "Compile the kernel with modern file notification support"
default n
default y if !SMALL_FLASH
config KERNEL_BLK_DEV_BSG
bool "Compile the kernel with SCSI generic v4 support for any block device"
@ -316,7 +340,7 @@ config KERNEL_ENCRYPTED_KEYS
config KERNEL_CGROUPS
bool "Enable kernel cgroups"
default n
default y if !SMALL_FLASH
if KERNEL_CGROUPS
@ -355,7 +379,7 @@ if KERNEL_CGROUPS
config KERNEL_CPUSETS
bool "Cpuset support"
default n
default y if !SMALL_FLASH
help
This option will let you create and manage CPUSETs which
allow dynamically partitioning a system into sets of CPUs and
@ -369,14 +393,14 @@ if KERNEL_CGROUPS
config KERNEL_CGROUP_CPUACCT
bool "Simple CPU accounting cgroup subsystem"
default n
default y if !SMALL_FLASH
help
Provides a simple Resource Controller for monitoring the
total CPU consumed by the tasks in a cgroup.
config KERNEL_RESOURCE_COUNTERS
bool "Resource counters"
default n
default y if !SMALL_FLASH
help
This option enables controller independent resource accounting
infrastructure that works with cgroups.
@ -387,7 +411,7 @@ if KERNEL_CGROUPS
config KERNEL_MEMCG
bool "Memory Resource Controller for Control Groups"
default n
default y if !SMALL_FLASH
depends on KERNEL_RESOURCE_COUNTERS || !LINUX_3_18
help
Provides a memory resource controller that manages both anonymous
@ -445,7 +469,7 @@ if KERNEL_CGROUPS
config KERNEL_MEMCG_KMEM
bool "Memory Resource Controller Kernel Memory accounting (EXPERIMENTAL)"
default n
default y if !SMALL_FLASH
depends on KERNEL_MEMCG
help
The Kernel Memory extension for Memory Resource Controller can limit
@ -466,7 +490,7 @@ if KERNEL_CGROUPS
menuconfig KERNEL_CGROUP_SCHED
bool "Group CPU scheduler"
default n
default y if !SMALL_FLASH
help
This feature lets CPU scheduler recognize task groups and control CPU
bandwidth allocation to such task groups. It uses cgroups to group
@ -476,7 +500,7 @@ if KERNEL_CGROUPS
config KERNEL_FAIR_GROUP_SCHED
bool "Group scheduling for SCHED_OTHER"
default n
default y if !SMALL_FLASH
config KERNEL_CFS_BANDWIDTH
bool "CPU bandwidth provisioning for FAIR_GROUP_SCHED"
@ -491,7 +515,7 @@ if KERNEL_CGROUPS
config KERNEL_RT_GROUP_SCHED
bool "Group scheduling for SCHED_RR/FIFO"
default n
default y if !SMALL_FLASH
help
This feature lets you explicitly allocate real CPU bandwidth
to task groups. If enabled, it will also make it impossible to
@ -519,6 +543,20 @@ if KERNEL_CGROUPS
CONFIG_CFQ_GROUP_IOSCHED=y; for enabling throttling policy, set
CONFIG_BLK_DEV_THROTTLING=y.
if KERNEL_BLK_CGROUP
config KERNEL_CFQ_GROUP_IOSCHED
bool "Proportional weight of disk bandwidth in CFQ"
config KERNEL_BLK_DEV_THROTTLING
bool "Enable throttling policy"
default y if TARGET_brcm2708
config KERNEL_BLK_DEV_THROTTLING_LOW
bool "Block throttling .low limit interface support (EXPERIMENTAL)"
depends on KERNEL_BLK_DEV_THROTTLING
endif
config KERNEL_DEBUG_BLK_CGROUP
bool "Enable Block IO controller debugging"
default n
@ -543,7 +581,7 @@ endif
config KERNEL_NAMESPACES
bool "Enable kernel namespaces"
default n
default y if !SMALL_FLASH
if KERNEL_NAMESPACES
@ -585,51 +623,40 @@ if KERNEL_NAMESPACES
endif
#
# LXC related symbols
#
config KERNEL_DEVPTS_MULTIPLE_INSTANCES
bool "Support multiple instances of devpts"
default y if !SMALL_FLASH
help
Enable support for multiple instances of devpts filesystem.
If you want to have isolated PTY namespaces (eg: in containers),
say Y here. Otherwise, say N. If enabled, each mount of devpts
filesystem with the '-o newinstance' option will create an
independent PTY namespace.
config KERNEL_LXC_MISC
bool "Enable miscellaneous LXC related options"
default n
config KERNEL_POSIX_MQUEUE
bool "POSIX Message Queues"
default y if !SMALL_FLASH
help
POSIX variant of message queues is a part of IPC. In POSIX message
queues every message has a priority which decides about succession
of receiving it by a process. If you want to compile and run
programs written e.g. for Solaris with use of its POSIX message
queues (functions mq_*) say Y here.
if KERNEL_LXC_MISC
POSIX message queues are visible as a filesystem called 'mqueue'
and can be mounted somewhere if you want to do filesystem
operations on message queues.
config KERNEL_DEVPTS_MULTIPLE_INSTANCES
bool "Support multiple instances of devpts"
default y
help
Enable support for multiple instances of devpts filesystem.
If you want to have isolated PTY namespaces (eg: in containers),
say Y here. Otherwise, say N. If enabled, each mount of devpts
filesystem with the '-o newinstance' option will create an
independent PTY namespace.
config KERNEL_POSIX_MQUEUE
bool "POSIX Message Queues"
default y
help
POSIX variant of message queues is a part of IPC. In POSIX message
queues every message has a priority which decides about succession
of receiving it by a process. If you want to compile and run
programs written e.g. for Solaris with use of its POSIX message
queues (functions mq_*) say Y here.
POSIX message queues are visible as a filesystem called 'mqueue'
and can be mounted somewhere if you want to do filesystem
operations on message queues.
endif
config KERNEL_SECCOMP_FILTER
bool
default n
default y if !SMALL_FLASH
config KERNEL_SECCOMP
bool "Enable seccomp support"
depends on !(TARGET_uml)
select KERNEL_SECCOMP_FILTER
default n
default y if !SMALL_FLASH
help
Build kernel with support for seccomp.

View File

@ -203,7 +203,7 @@ define Image/mkfs/squashfs
$(STAGING_DIR_HOST)/bin/mksquashfs4 $(call mkfs_target_dir,$(1)) $@ \
-nopad -noappend -root-owned \
-comp $(SQUASHFSCOMP) $(SQUASHFSOPT) \
-processors 1 \
-processors 16 \
$(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
endef

View File

@ -6,13 +6,13 @@ ifdef CONFIG_TESTING_KERNEL
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
endif
LINUX_VERSION-4.9 = .194
LINUX_VERSION-4.14 = .146
LINUX_VERSION-4.19 = .75
LINUX_VERSION-4.9 = .196
LINUX_VERSION-4.14 = .148
LINUX_VERSION-4.19 = .78
LINUX_KERNEL_HASH-4.9.194 = d5f4bb7584e461f1faa9a3f94c2ad292246fe692b0e992e072dac255f806c2e3
LINUX_KERNEL_HASH-4.14.146 = a3c54b887ea3e679382bd4c0536e6a281b071dab2258bd3ee8af75baef2023f5
LINUX_KERNEL_HASH-4.19.75 = dd5e7147e1e4501560fba5beb86dae6bf6ba843518ab3d4cad283de77b651b78
LINUX_KERNEL_HASH-4.9.196 = e0ab12b04a975630ece2142a1ac15cfe45140b8c3359226b035c15ca7c92c6ef
LINUX_KERNEL_HASH-4.14.148 = 12d2b74003e13a6c1956064754255249fbe5c7af6cbdfb2ddeba45b5ed7c0fad
LINUX_KERNEL_HASH-4.19.78 = df63ea77c6e28566102a33f503513bc6280f79b48c90921b39661d3ce6295049
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))

View File

@ -136,3 +136,12 @@ define Package/bnx2-firmware/install
$(1)/lib/firmware/bnx2/
endef
$(eval $(call BuildPackage,bnx2-firmware))
Package/bnx2x-firmware = $(call Package/firmware-default,=QLogic 5771x/578xx firmware)
define Package/bnx2x-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/bnx2x
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/bnx2x/* \
$(1)/lib/firmware/bnx2x/
endef
$(eval $(call BuildPackage,bnx2x-firmware))

View File

@ -1024,3 +1024,42 @@ define KernelPackage/bnx2/description
endef
$(eval $(call KernelPackage,bnx2))
define KernelPackage/bnx2x
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=QLogic 5771x/578xx 10/20-Gigabit ethernet adapter driver
DEPENDS:=@PCI_SUPPORT +bnx2x-firmware +kmod-lib-crc32c +kmod-mdio +kmod-ptp +kmod-lib-zlib-inflate
FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/bnx2x/bnx2x.ko
KCONFIG:= \
CONFIG_BNX2X \
CONFIG_BNX2X_SRIOV=y
AUTOLOAD:=$(call AutoProbe,bnx2x)
endef
define KernelPackage/bnx2x/description
QLogic BCM57710/57711/57711E/57712/57712_MF/57800/57800_MF/57810/57810_MF/57840/57840_MF Driver
endef
$(eval $(call KernelPackage,bnx2x))
define KernelPackage/be2net
SUBMENU:=$(NETWORK_DEVICES_MENU)
TITLE:=Broadcom Emulex OneConnect 10Gbps NIC
DEPENDS:=@PCI_SUPPORT +kmod-hwmon-core
FILES:=$(LINUX_DIR)/drivers/net/ethernet/emulex/benet/be2net.ko
KCONFIG:= \
CONFIG_BE2NET \
CONFIG_BE2NET_BE2=y \
CONFIG_BE2NET_BE3=y \
CONFIG_BE2NET_LANCER=y \
CONFIG_BE2NET_SKYHAWK=y \
CONFIG_BE2NET_HWMON=y
AUTOLOAD:=$(call AutoProbe,be2net)
endef
define KernelPackage/be2net/description
Broadcom Emulex OneConnect 10Gbit SFP+ support, OneConnect OCe10xxx OCe11xxx OCe14xxx, LightPulse LPe12xxx
endef
$(eval $(call KernelPackage,be2net))

View File

@ -11,14 +11,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=UnblockNeteaseMusic
PKG_VERSION:=0.19.2
PKG_VERSION:=0.20.0
PKG_RELEASE:=1
PKG_LICENSE:=MIT
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/nondanee/UnblockNeteaseMusic.git
PKG_SOURCE_VERSION:=245adf1953d9d1857f3f803b726588976c8ae739
PKG_SOURCE_VERSION:=3de1af9d4c9e32de70ed8abe7bf63a6f2275bea8
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_VERSION).tar.gz

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=autocore
PKG_VERSION:=1
PKG_RELEASE:=18
PKG_RELEASE:=19
include $(INCLUDE_DIR)/package.mk

View File

@ -55,7 +55,7 @@ sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh
wifi up
sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release
echo "DISTRIB_REVISION='R9.10.1 By Lean & CTCGFW'" >> /etc/openwrt_release
echo "DISTRIB_REVISION='R9.10.10 By Lean & CTCGFW'" >> /etc/openwrt_release
sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release
echo "DISTRIB_DESCRIPTION='OpenWrt '" >> /etc/openwrt_release

View File

@ -13,7 +13,7 @@ domain=`uci get dnspod.base_arg.main_domain 2>/dev/null`
#由于*linux会被脚本解析为当前目录下的所有文件所以请填写\*
# sub_domain='\*'
sub_domain=`uci get dnspod.base_arg.sub_domain 2>/dev/null`
if [ $sub_domain = "\*" ];then
if [ $sub_domain = "\*" ]; then
sub_domain="*"
fi
@ -24,6 +24,12 @@ if [[ $wait_second =~ ^[1-9][0-9]*$ ]]; then
wait=$wait_second
fi
#外网ip获取命令
command=`uci get dnspod.base_arg.command_to_get_ip 2>/dev/null`
if [ -z "$command" ]; then
command='curl -s whatismyip.akamai.com'
fi
#检查curl是否安装
curl_status=`which curl 2>/dev/null`
[ -n "$curl_status" ] || { echo "curl is not installed";exit 3; }
@ -32,7 +38,7 @@ os=$(uname -a | egrep -io 'openwrt' | tr [A-Z] [a-z])
API_url="https://dnsapi.cn"
LOG_FILE="/tmp/dnspod.log"
MAX_LOG_SIZE=1*1024*1024
MAX_LOG_SIZE=`expr 1 * 1024 * 1024` # 默认最大限制1M
PROGRAM=$(basename $0)
format='json'
@ -45,21 +51,22 @@ last_modified_ip=
getFileSize() {
local file=$1
wc -c $file
wc -c $file | awk '{print $1}'
}
clearLog() {
local file_size=$(getFileSize $LOG_FILE)
if [ $file_size -gt $MAX_LOG_SIZE ]; then
echo "" > $LOG_FILE
printMsg "Log file [$LOG_FILE], size: [$file_size bytes]."
printMsg "Exceeds max log size [$MAX_LOG_SIZE]. Clear the log."
fi
}
printMsg() {
local time=$(date "+%Y-%m-%d %H:%M:%S")
local msg="$1"
if [ $is_svc -eq 1 ];then
if [ $is_svc -eq 1 ]; then
echo "$time: $msg" >> $LOG_FILE
# logger -t ${PROGRAM} "${msg}"
else
@ -69,7 +76,7 @@ printMsg() {
getIp() {
# curl -s http://checkip.dyndns.com | sed -n 's/.*: \([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/p'
curl -s whatismyip.akamai.com
eval $command
}
execAPI() {
@ -107,7 +114,7 @@ updateRecord() {
checkip() {
local wan_ip=$1
printMsg "old ip: [$last_modified_ip], new ip: [$wan_ip]"
if [ "$wan_ip" != "$last_modified_ip" ];then
if [ "$wan_ip" != "$last_modified_ip" ]; then
return 8
else
return 3
@ -119,7 +126,7 @@ execSvc() {
#check that whether the network is ok
while [ 1 ];do
ip=$(getIp)
if [ -n "$ip" ];then
if [ -n "$ip" ]; then
printMsg "WAN IP: ${ip}"
break;
else
@ -132,7 +139,7 @@ execSvc() {
clearLog
ip=$(getIp)
checkip $ip
if [ $? -eq 8 ];then
if [ $? -eq 8 ]; then
updateRecord $ip
#updateTunnelBroker
fi
@ -142,6 +149,7 @@ execSvc() {
execUpdate() {
local ip=`getIp`
printMsg "WAN IP: ${ip}"
updateRecord $ip
}
@ -151,9 +159,11 @@ case $1 in
clearLog;
printMsg "Start in Service mode, check in every $wait seconds";
printMsg "domain: ${domain}, sub_domain: ${sub_domain}";
printMsg "Use command: [$command] to get wan ip";
execSvc;;
*)
is_svc=0;
printMsg "Start update record, domain: ${domain}, sub_domain: ${sub_domain}";
printMsg "Use command: [$command] to get wan ip";
execUpdate;;
esac

View File

@ -3,4 +3,5 @@ config base_arg "base_arg"
option sub_domain ''
option login_token ''
option wait_second ''
option command_to_get_ip 'curl -s whatismyip.akamai.com'

View File

@ -22,6 +22,7 @@ email = s:option(Value, "login_token", translate("DNSPOD Token"), "格式: ID,To
main = s:option(Value, "main_domain", translate("主域名"), "想要解析的主域名,例如:baidu.com")
sub = s:option(Value, "sub_domain", translate("子域名"), "想要解析的子域名,只允许填写一个。如果想解析*子域名,请填写 \\*")
wait = s:option(Value, "wait_second", translate("更新周期(s)"), "请填写数字默认为300s")
command = s:option(Value, "command_to_get_ip", translate("外网ip获取命令"), "默认为 curl -s whatismyip.akamai.com")
local apply = luci.http.formvalue("cbi.apply")
if apply then

View File

@ -0,0 +1,18 @@
#
# Copyright (C) 2008-2014 The LuCI Team <luci@lists.subsignal.org>
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=Luci for Docker-CE
LUCI_DEPENDS:=+docker-ce
LUCI_PKGARCH:=all
PKG_VERSION:=1
PKG_RELEASE:=6
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature

View File

@ -0,0 +1,17 @@
module("luci.controller.docker", package.seeall)
function index()
if not nixio.fs.access("/etc/config/docker") then
return
end
entry({"admin", "services", "docker"}, cbi("docker"), _("Docker CE Container"), 199).dependent = true
entry({"admin","services","docker","status"},call("act_status")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("pgrep /usr/bin/dockerd >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end

View File

@ -0,0 +1,46 @@
local running = (luci.sys.call("pidof portainer >/dev/null") == 0)
local button = ""
if running then
button = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><br /><input type=\"button\" value=\" " .. translate("Open Portainer Docker Admin") .. " \" onclick=\"window.open('http://'+window.location.hostname+':" .. 9999 .. "')\"/>"
end
m = Map("docker", "Docker CE", translate("Docker is a set of platform-as-a-service (PaaS) products that use OS-level virtualization to deliver software in packages called containers."))
m:section(SimpleSection).template = "docker/docker_status"
s = m:section(TypedSection, "docker")
s.anonymous = true
wan_mode = s:option(Flag, "enabled", translate("Enable WAN access Dokcer"))
wan_mode.default = 0
wan_mode.rmempty = false
wan_mode.description = translate(("!") .. button)
o = s:option(Button,"certificate",translate("Docker Readme First"))
o.inputtitle = translate("Download DockerReadme.pdf")
o.description = translate("Please download DockerReadme.pdf to read when first-running")
o.inputstyle = "reload"
o.write = function()
Download()
end
function Download()
local t,e
t=nixio.open("/www/DockerReadme.pdf","r")
luci.http.header('Content-Disposition','attachment; filename="DockerReadme.pdf"')
luci.http.prepare_content("application/octet-stream")
while true do
e=t:read(nixio.const.buffersize)
if(not e)or(#e==0)then
break
else
luci.http.write(e)
end
end
t:close()
luci.http.close()
end
return m

View File

@ -0,0 +1,22 @@
<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[services]], [[docker]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('docker_status');
if (data && tb) {
if (data.running) {
var links = '<em><b><font color=green>Docker CE <%:RUNNING%></font></b></em>';
tb.innerHTML = links;
} else {
tb.innerHTML = '<em><b><font color=red>Docker CE <%:NOT RUNNING%></font></b></em>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="docker_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>

View File

@ -0,0 +1,39 @@
msgid ""
msgstr ""
"Project-Id-Version: Luci ARP Bind\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-06-23 20:16+0800\n"
"PO-Revision-Date: 2015-06-23 20:17+0800\n"
"Last-Translator: 981213 <gch981213@gmail.com>\n"
"Language-Team: PandoraBox Team\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 1.8.1\n"
"X-Poedit-SourceCharset: UTF-8\n"
msgid "Docker CE Container"
msgstr "Docker CE 容器"
msgid "Open Portainer Docker Admin"
msgstr "打开 Portainer Docker 管理页面"
msgid "Docker is a set of platform-as-a-service (PaaS) products that use OS-level virtualization to deliver software in packages called containers."
msgstr "Docker是一组平台即服务platform-as-a-servicePaaS产品它使用操作系统级容器虚拟化来交付软件包。"
msgid "Enable WAN access Dokcer"
msgstr "允许 WAN 访问 Dokcer"
msgid "Enable WAN access docker mapped ports"
msgstr "允许 WAN 访问 Dokcer 映射后的端口(易受攻击,不推荐!)"
msgid "Docker Readme First"
msgstr "Docker 初始化无脑配置教程"
msgid "Download DockerReadme.pdf"
msgstr "下载 Docker 初始化无脑配置教程"
msgid "Please download DockerReadme.pdf to read when first-running"
msgstr "初次在OpenWrt中运行Docker必读只需执行一次流程"

View File

@ -0,0 +1,6 @@
config docker
option wan_mode '1'
option enable '1'
option enabled '0'

View File

@ -0,0 +1,13 @@
#!/bin/sh
sleep 10
docker_ok=$(iptables -t filter -L FORWARD | grep DOCKER)
while [ -z "$docker_ok" ]; do
echo "DOCKER Chain not ready" && sleep 10
docker_ok=$(iptables -t filter -L FORWARD | grep DOCKER)
done
iptables -D FORWARD -i pppoe-wan -o docker0 -j DROP 2>/dev/null
iptables -I FORWARD -i pppoe-wan -o docker0 -j DROP

View File

@ -0,0 +1,16 @@
#!/bin/sh /etc/rc.common
USE_PROCD=1
START=25
start_service() {
local nofile=$(cat /proc/sys/fs/nr_open)
procd_open_instance
procd_set_param stderr 1
procd_set_param command /usr/bin/dockerd
procd_set_param limits nofile="${nofile} ${nofile}"
procd_close_instance
/etc/docker-pppoe &>/dev/null &
}

View File

@ -0,0 +1,4 @@
#!/bin/sh
rm -f /tmp/luci-indexcache
exit 0

Binary file not shown.

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=1
PKG_RELEASE:=100
PKG_RELEASE:=103
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \

View File

@ -7,165 +7,186 @@ function index()
if not nixio.fs.access("/etc/config/shadowsocksr") then
return
end
if not ((nixio.fs).access)("/etc/config/google_fu_mode") then
return
end
if ((nixio.fs).readfile)("/etc/config/google_fu_mode") ~= "0xDEADBEEF\n" then
return
end
entry({"admin", "services", "shadowsocksr"},alias("admin", "services", "shadowsocksr", "client"),_("ShadowSocksR Plus+"), 10).dependent = true
entry({"admin", "services", "shadowsocksr", "client"},cbi("shadowsocksr/client"),_("SSR Client"), 10).leaf = true
entry({"admin", "services", "shadowsocksr"},alias("admin", "services", "shadowsocksr", "client"),_("ShadowSocksR Plus+"), 10).dependent = true
entry({"admin", "services", "shadowsocksr", "client"},cbi("shadowsocksr/client"),_("SSR Client"), 10).leaf = true
entry({"admin", "services", "shadowsocksr", "servers"}, arcombine(cbi("shadowsocksr/servers"), cbi("shadowsocksr/client-config")),_("Severs Nodes"), 20).leaf = true
entry({"admin", "services", "shadowsocksr", "control"},cbi("shadowsocksr/control"),_("Access Control"), 30).leaf = true
entry({"admin", "services", "shadowsocksr", "list"},form("shadowsocksr/list"),_("GFW List"), 40).leaf = true
entry({"admin", "services", "shadowsocksr", "advanced"},cbi("shadowsocksr/advanced"),_("Advanced Settings"), 50).leaf = true
if nixio.fs.access("/usr/bin/ssr-server") then
entry({"admin", "services", "shadowsocksr", "server"},arcombine(cbi("shadowsocksr/server"), cbi("shadowsocksr/server-config")),_("SSR Server"), 60).leaf = true
entry({"admin", "services", "shadowsocksr", "advanced"},cbi("shadowsocksr/advanced"),_("Advanced Settings"), 50).leaf = true
if nixio.fs.access("/usr/bin/ssr-server") then
entry({"admin", "services", "shadowsocksr", "server"},arcombine(cbi("shadowsocksr/server"), cbi("shadowsocksr/server-config")),_("SSR Server"), 60).leaf = true
end
entry({"admin", "services", "shadowsocksr", "status"},form("shadowsocksr/status"),_("Status"), 70).leaf = true
entry({"admin", "services", "shadowsocksr", "check"}, call("check_status"))
entry({"admin", "services", "shadowsocksr", "refresh"}, call("refresh_data"))
entry({"admin", "services", "shadowsocksr", "checkport"}, call("check_port"))
entry({"admin", "services", "shadowsocksr", "log"},form("shadowsocksr/log"),_("Log"), 80).leaf = true
entry({"admin", "services", "shadowsocksr","run"},call("act_status")).leaf=true
entry({"admin", "services", "shadowsocksr", "ping"}, call("act_ping")).leaf=true
end
function act_status()
local e={}
e.running=luci.sys.call("ps -w | grep ssr-retcp | grep -v grep >/dev/null")==0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function act_ping()
local e={}
e.running=luci.sys.call("ps -w | grep ssr-retcp | grep -v grep >/dev/null")==0
e.index=luci.http.formvalue("index")
e.ping=luci.sys.exec("ping -c 1 -W 1 %q 2>&1 | grep -o 'time=[0-9]*.[0-9]' | awk -F '=' '{print$2}'"%luci.http.formvalue("domain"))
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function check_status()
local set ="/usr/bin/ssr-check www." .. luci.http.formvalue("set") .. ".com 80 3 1"
sret=luci.sys.call(set)
if sret== 0 then
retstring ="0"
else
retstring ="1"
end
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring })
local set ="/usr/bin/ssr-check www." .. luci.http.formvalue("set") .. ".com 80 3 1"
sret=luci.sys.call(set)
if sret== 0 then
retstring ="0"
else
retstring ="1"
end
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring })
end
function refresh_data()
local set =luci.http.formvalue("set")
local icount =0
local set =luci.http.formvalue("set")
local icount =0
if set == "gfw_data" then
if nixio.fs.access("/usr/bin/wget-ssl") then
refresh_cmd="wget-ssl --no-check-certificate https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt -O /tmp/gfw.b64"
else
refresh_cmd="wget -O /tmp/gfw.b64 http://iytc.net/tools/list.b64"
end
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
luci.sys.call("/usr/bin/ssr-gfw")
icount = luci.sys.exec("cat /tmp/gfwnew.txt | wc -l")
if tonumber(icount)>1000 then
oldcount=luci.sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf")
retstring=tostring(math.ceil(tonumber(icount)/2))
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/gfwnew.txt")
else
retstring ="-1"
end
elseif set == "ip_data" then
refresh_cmd="wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' 2>/dev/null| awk -F\\| '/CN\\|ipv4/ { printf(\"%s/%d\\n\", $4, 32-log($5)/log(2)) }' > /tmp/china_ssr.txt"
sret=luci.sys.call(refresh_cmd)
icount = luci.sys.exec("cat /tmp/china_ssr.txt | wc -l")
if sret== 0 and tonumber(icount)>1000 then
oldcount=luci.sys.exec("cat /etc/china_ssr.txt | wc -l")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/china_ssr.txt /etc/china_ssr.txt")
retstring=tostring(tonumber(icount))
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/china_ssr.txt")
else
local need_process = 0
if nixio.fs.access("/usr/bin/wget-ssl") then
refresh_cmd="wget-ssl --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt > /tmp/adnew.conf"
need_process = 1
else
refresh_cmd="wget -O /tmp/ad.conf http://iytc.net/tools/ad.conf"
end
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
if need_process == 1 then
luci.sys.call("/usr/bin/ssr-ad")
end
icount = luci.sys.exec("cat /tmp/ad.conf | wc -l")
if tonumber(icount)>1000 then
if nixio.fs.access("/etc/dnsmasq.ssr/ad.conf") then
oldcount=luci.sys.exec("cat /etc/dnsmasq.ssr/ad.conf | wc -l")
else
oldcount=0
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/ad.conf /etc/dnsmasq.ssr/ad.conf")
retstring=tostring(math.ceil(tonumber(icount)))
if oldcount==0 then
luci.sys.call("/etc/init.d/dnsmasq restart")
end
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/ad.conf ")
else
retstring ="-1"
end
end
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring ,retcount=icount})
if set == "gfw_data" then
if nixio.fs.access("/usr/bin/wget-ssl") then
refresh_cmd="wget-ssl --no-check-certificate https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt -O /tmp/gfw.b64"
else
refresh_cmd="wget -O /tmp/gfw.b64 http://iytc.net/tools/list.b64"
end
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
luci.sys.call("/usr/bin/ssr-gfw")
icount = luci.sys.exec("cat /tmp/gfwnew.txt | wc -l")
if tonumber(icount)>1000 then
oldcount=luci.sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf")
retstring=tostring(math.ceil(tonumber(icount)/2))
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/gfwnew.txt ")
else
retstring ="-1"
end
elseif set == "ip_data" then
refresh_cmd="wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' 2>/dev/null| awk -F\\| '/CN\\|ipv4/ { printf(\"%s/%d\\n\", $4, 32-log($5)/log(2)) }' > /tmp/china_ssr.txt"
sret=luci.sys.call(refresh_cmd)
icount = luci.sys.exec("cat /tmp/china_ssr.txt | wc -l")
if sret== 0 and tonumber(icount)>1000 then
oldcount=luci.sys.exec("cat /etc/china_ssr.txt | wc -l")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/china_ssr.txt /etc/china_ssr.txt")
retstring=tostring(tonumber(icount))
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/china_ssr.txt ")
else
local need_process = 0
if nixio.fs.access("/usr/bin/wget-ssl") then
refresh_cmd="wget-ssl --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt > /tmp/adnew.conf"
need_process = 1
else
refresh_cmd="wget -O /tmp/ad.conf http://iytc.net/tools/ad.conf"
end
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
if need_process == 1 then
luci.sys.call("/usr/bin/ssr-ad")
end
icount = luci.sys.exec("cat /tmp/ad.conf | wc -l")
if tonumber(icount)>1000 then
if nixio.fs.access("/etc/dnsmasq.ssr/ad.conf") then
oldcount=luci.sys.exec("cat /etc/dnsmasq.ssr/ad.conf | wc -l")
else
oldcount=0
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/ad.conf /etc/dnsmasq.ssr/ad.conf")
retstring=tostring(math.ceil(tonumber(icount)))
if oldcount==0 then
luci.sys.call("/etc/init.d/dnsmasq restart")
end
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/ad.conf ")
else
retstring ="-1"
end
end
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring ,retcount=icount})
end
function check_port()
local set=""
local retstring="<br/><br/>"
local s
local server_name = ""
local shadowsocksr = "shadowsocksr"
local uci = luci.model.uci.cursor()
local iret=1
uci:foreach(shadowsocksr, "servers", function(s)
function check_port()
local set=""
local retstring="<br /><br />"
local s
local server_name = ""
local shadowsocksr = "shadowsocksr"
local uci = luci.model.uci.cursor()
local iret=1
uci:foreach(shadowsocksr, "servers", function(s)
if s.alias then
server_name=s.alias
elseif s.server and s.server_port then
server_name= "%s:%s" %{s.server, s.server_port}
end
iret=luci.sys.call("ipset add ss_spec_wan_ac " .. s.server .. " 2>/dev/null")
iret=luci.sys.call(" ipset add ss_spec_wan_ac " .. s.server .. " 2>/dev/null")
socket = nixio.socket("inet", "stream")
socket:setopt("socket", "rcvtimeo", 3)
socket:setopt("socket", "sndtimeo", 3)
ret=socket:connect(s.server,s.server_port)
if tostring(ret) == "true" then
socket:close()
retstring =retstring .. "<font color='green'>[" .. server_name .. "] OK.</font><br/>"
if tostring(ret) == "true" then
socket:close()
retstring =retstring .. "<font color='green'>[" .. server_name .. "] OK.</font><br />"
else
retstring =retstring .. "<font color='red'>[" .. server_name .. "] Error.</font><br/>"
retstring =retstring .. "<font color='red'>[" .. server_name .. "] Error.</font><br />"
end
if iret== 0 then
luci.sys.call("ipset del ss_spec_wan_ac " .. s.server)
if iret== 0 then
luci.sys.call(" ipset del ss_spec_wan_ac " .. s.server)
end
end)
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring })
end
end

View File

@ -115,11 +115,10 @@ s = m:section(NamedSection, sid, "servers")
s.anonymous = true
s.addremove = false
o = s:option(DummyValue,"ssr_url","SSR URL")
o = s:option(DummyValue,"ssr_url","SS/SSR/V2RAY URL")
o.rawhtml = true
o.template = "shadowsocksr/ssrurl"
o.value =sid
o:depends("type", "ssr")
o = s:option(ListValue, "type", translate("Server Node Type"))
o:value("ssr", translate("ShadowsocksR"))

View File

@ -101,4 +101,9 @@ function o.cfgvalue(...)
return Value.cfgvalue(...) or "0"
end
o = s:option(DummyValue,"server",translate("Ping Latency"))
o.template="shadowsocksr/ping"
o.width="10%"
m:append(Template("shadowsocksr/server_list"))
return m

View File

@ -0,0 +1,3 @@
<%+cbi/valueheader%>
<span class="pingtime" hint="<%=self:cfgvalue(section)%>">-- ms</span>
<%+cbi/valuefooter%>

View File

@ -0,0 +1,24 @@
<%#
Copyright 2018-2019 Lienol <lawlienol@gmail.com>
Licensed to the public under the Apache License 2.0.
-%>
<%
local dsp = require "luci.dispatcher"
-%>
<script type="text/javascript">
//<![CDATA[
var pings = document.getElementsByClassName('pingtime');
for(var i = 0; i < pings.length; i++) {
XHR.get('<%=dsp.build_url("admin/services/shadowsocksr/ping")%>', {
index: i,
domain: pings[i].getAttribute("hint")
},
function(x, result) {
pings[result.index].innerHTML = (result.ping ? result.ping : "--") + " ms";
}
);
}
//]]>
</script>

View File

@ -1,139 +1,202 @@
<%+cbi/valueheader%>
<script type="text/javascript">//<![CDATA[
function padright(str, cnt, pad){
return str + Array(cnt+1).join(pad);
}
function b64EncodeUnicode(str) {
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {
return String.fromCharCode('0x' + p1);
}));
}
function b64encutf8safe(str) {
return b64EncodeUnicode(str).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,'');
}
function b64DecodeUnicode(str) {
return decodeURIComponent(Array.prototype.map.call(atob(str), function(c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
}
function b64decutf8safe(str) {
var l;
str = str.replace(/-/g,"+").replace(/_/g,"/");
l = str.length;
l = (4 - l % 4)%4;
if( l )
str = padright(str,l,"=");
return b64DecodeUnicode(str);
}
function b64encsafe(str){
return btoa(str).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,'')
}
function b64decsafe(str){
var l;
str = str.replace(/-/g,"+").replace(/_/g,"/");
l = str.length;
l = (4 - l % 4)%4;
if( l )
str = padright(str,l,"=");
return atob(str);
}
function dictvalue(d,key) {
var v = d[key];
if( typeof(v)=='undefined' || v=='' )
return '';
return b64decsafe(v);
}
function export_ssr_url(btn,urlname,sid) {
var s = document.getElementById(urlname+'-status');
if(!s)
return false;
var v_server = document.getElementById('cbid.shadowsocksr.'+sid+'.server');
var v_port = document.getElementById('cbid.shadowsocksr.'+sid+'.server_port');
var v_protocol = document.getElementById('cbid.shadowsocksr.'+sid+'.protocol');
var v_method = document.getElementById('cbid.shadowsocksr.'+sid+'.encrypt_method');
var v_obfs = document.getElementById('cbid.shadowsocksr.'+sid+'.obfs');
var v_password = document.getElementById('cbid.shadowsocksr.'+sid+'.password');
var v_obfs_param = document.getElementById('cbid.shadowsocksr.'+sid+'.obfs_param');
var v_protocol_param = document.getElementById('cbid.shadowsocksr.'+sid+'.protocol_param');
var v_alias = document.getElementById('cbid.shadowsocksr.'+sid+'.alias');
function padright(str, cnt, pad) {
return str + Array(cnt + 1).join(pad);
}
function b64EncodeUnicode(str) {
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {
return String.fromCharCode('0x' + p1);
}));
}
function b64encutf8safe(str) {
return b64EncodeUnicode(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, '');
}
function b64DecodeUnicode(str) {
return decodeURIComponent(Array.prototype.map.call(atob(str), function (c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));
}
function b64decutf8safe(str) {
var l;
str = str.replace(/-/g, "+").replace(/_/g, "/");
l = str.length;
l = (4 - l % 4) % 4;
if (l)
str = padright(str, l, "=");
return b64DecodeUnicode(str);
}
function b64encsafe(str) {
return btoa(str).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, '')
}
function b64decsafe(str) {
var l;
str = str.replace(/-/g, "+").replace(/_/g, "/");
l = str.length;
l = (4 - l % 4) % 4;
if (l)
str = padright(str, l, "=");
return atob(str);
}
function dictvalue(d, key) {
var v = d[key];
if (typeof (v) == 'undefined' || v == '')
return '';
return b64decsafe(v);
}
function export_ssr_url(btn, urlname, sid) {
var s = document.getElementById(urlname + '-status');
if (!s)
return false;
var v_server = document.getElementById('cbid.shadowsocksr.' + sid + '.server');
var v_port = document.getElementById('cbid.shadowsocksr.' + sid + '.server_port');
var v_protocol = document.getElementById('cbid.shadowsocksr.' + sid + '.protocol');
var v_method = document.getElementById('cbid.shadowsocksr.' + sid + '.encrypt_method');
var v_obfs = document.getElementById('cbid.shadowsocksr.' + sid + '.obfs');
var v_password = document.getElementById('cbid.shadowsocksr.' + sid + '.password');
var v_obfs_param = document.getElementById('cbid.shadowsocksr.' + sid + '.obfs_param');
var v_protocol_param = document.getElementById('cbid.shadowsocksr.' + sid + '.protocol_param');
var v_alias = document.getElementById('cbid.shadowsocksr.' + sid + '.alias');
var ssr_str = v_server.value+":"+
v_port.value+":"+
v_protocol.value+":"+
v_method.value+":"+
v_obfs.value+":"+
b64encsafe(v_password.value)+
"/?obfsparam="+b64encsafe(v_obfs_param.value)+
"&protoparam="+b64encsafe(v_protocol_param.value)+
"&remarks="+b64encutf8safe(v_alias.value);
var textarea = document.createElement("textarea");
textarea.textContent = "ssr://"+b64encsafe(ssr_str);
textarea.style.position = "fixed";
document.body.appendChild(textarea);
textarea.select();
try {
document.execCommand("copy"); // Security exception may be thrown by some browsers.
s.innerHTML = "<font color='green'><%:Copy SSR to clipboard successfully.%></font>";
} catch (ex) {
s.innerHTML = "<font color='red'><%:Unable to copy SSR to clipboard.%></font>";
} finally {
document.body.removeChild(textarea);
}
return false;
}
function import_ssr_url(btn,urlname,sid) {
var s = document.getElementById(urlname+'-status');
if(!s)
return false;
var ssrurl = prompt("<%:Paste ssr url here%>", "ssr://");
if (ssrurl == null || ssrurl == "") {
s.innerHTML = "<font color='red'><%:User cancelled.%></font>";
return false;
}
s.innerHTML = "<font color='red'><%:Invalid SSR format.%></font>";
var ssu = ssrurl.match(/ssr:\/\/([A-Za-z0-9_-]+)/i);
if( !ssu || ssu.length<2 )
return false;
var sstr = b64decsafe(ssu[1]);
var ploc = sstr.indexOf("/?");
var url0, param="";
if( ploc>0 ) {
url0 = sstr.substr(0,ploc);
param = sstr.substr(ploc+2);
}
var ssm = url0.match(/^(.+):([^:]+):([^:]*):([^:]+):([^:]*):([^:]+)/);
if( !ssm || ssm.length<7 )
return false;
var pdict = {};
if( param.length>2 )
{
var a = param.split('&');
for( var i=0;i<a.length; i++ ) {
var b = a[i].split('=');
pdict[decodeURIComponent(b[0])] = decodeURIComponent(b[1] || '');
}
}
document.getElementById('cbid.shadowsocksr.'+sid+'.server').value = ssm[1];
document.getElementById('cbid.shadowsocksr.'+sid+'.server_port').value = ssm[2];
document.getElementById('cbid.shadowsocksr.'+sid+'.protocol').value = ssm[3];
document.getElementById('cbid.shadowsocksr.'+sid+'.encrypt_method').value = ssm[4];
document.getElementById('cbid.shadowsocksr.'+sid+'.obfs').value = ssm[5];
document.getElementById('cbid.shadowsocksr.'+sid+'.password').value = b64decsafe(ssm[6]);
document.getElementById('cbid.shadowsocksr.'+sid+'.obfs_param').value = dictvalue(pdict,'obfsparam');
document.getElementById('cbid.shadowsocksr.'+sid+'.protocol_param').value = dictvalue(pdict,'protoparam');
var ssr_str = v_server.value + ":" +
v_port.value + ":" +
v_protocol.value + ":" +
v_method.value + ":" +
v_obfs.value + ":" +
b64encsafe(v_password.value) +
"/?obfsparam=" + b64encsafe(v_obfs_param.value) +
"&protoparam=" + b64encsafe(v_protocol_param.value) +
"&remarks=" + b64encutf8safe(v_alias.value);
var textarea = document.createElement("textarea");
textarea.textContent = "ssr://" + b64encsafe(ssr_str);
textarea.style.position = "fixed";
document.body.appendChild(textarea);
textarea.select();
try {
document.execCommand("copy"); // Security exception may be thrown by some browsers.
s.innerHTML = "<font color='green'><%:Copy SSR to clipboard successfully.%></font>";
} catch (ex) {
s.innerHTML = "<font color='red'><%:Unable to copy SSR to clipboard.%></font>";
} finally {
document.body.removeChild(textarea);
}
return false;
}
var rem = pdict['remarks'];
if( typeof(rem)!='undefined' && rem!='' && rem.length>0 )
document.getElementById('cbid.shadowsocksr.'+sid+'.alias').value = b64decutf8safe(rem);
s.innerHTML = "<font color='green'><%:Import SSR successfully.%></font>";
return false;
}
function import_ssr_url(btn, urlname, sid) {
var s = document.getElementById(urlname + '-status');
if (!s)
return false;
var ssrurl = prompt("在这里黏贴配置链接 ssr:// | ss:// | vmess://", "");
if (ssrurl == null || ssrurl == "") {
s.innerHTML = "<font color='red'>用户取消</font>";
return false;
}
s.innerHTML = "";
//var ssu = ssrurl.match(/ssr:\/\/([A-Za-z0-9_-]+)/i);
var ssu = ssrurl.split('://');
console.log(ssu.length);
if ((ssu[0] != "ssr" && ssu[0] != "ss" && ssu[0] != "vmess") || ssu[1] == "") {
s.innerHTML = "<font color='red'>无效格式</font>";
return false;
}
var event = document.createEvent("HTMLEvents");
event.initEvent("change", true, true);
if (ssu[0] == "ssr") {
var sstr = b64decsafe(ssu[1]);
var ploc = sstr.indexOf("/?");
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "ssr";
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
var url0, param = "";
if (ploc > 0) {
url0 = sstr.substr(0, ploc);
param = sstr.substr(ploc + 2);
}
var ssm = url0.match(/^(.+):([^:]+):([^:]*):([^:]+):([^:]*):([^:]+)/);
if (!ssm || ssm.length < 7)
return false;
var pdict = {};
if (param.length > 2)
{
var a = param.split('&');
for (var i = 0; i < a.length; i++) {
var b = a[i].split('=');
pdict[decodeURIComponent(b[0])] = decodeURIComponent(b[1] || '');
}
}
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = ssm[1];
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = ssm[2];
document.getElementById('cbid.shadowsocksr.' + sid + '.protocol').value = ssm[3];
document.getElementById('cbid.shadowsocksr.' + sid + '.encrypt_method').value = ssm[4];
document.getElementById('cbid.shadowsocksr.' + sid + '.obfs').value = ssm[5];
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = b64decsafe(ssm[6]);
document.getElementById('cbid.shadowsocksr.' + sid + '.obfs_param').value = dictvalue(pdict, 'obfsparam');
document.getElementById('cbid.shadowsocksr.' + sid + '.protocol_param').value = dictvalue(pdict, 'protoparam');
var rem = pdict['remarks'];
if (typeof (rem) != 'undefined' && rem != '' && rem.length > 0)
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = b64decutf8safe(rem);
s.innerHTML = "<font color='green'>导入ShadowsocksR配置信息成功</font>";
return false;
} else if (ssu[0] == "ss") {
var ploc = ssu[1].indexOf("#");
if (ploc > 0) {
url0 = ssu[1].substr(0, ploc);
param = ssu[1].substr(ploc + 1);
} else {
url0 = ssu[1]
}
var sstr = b64decsafe(url0);
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "ss";
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
var team = sstr.split('@');
console.log(param);
var part1 = team[0].split(':');
var part2 = team[1].split(':');
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = part2[0];
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = part2[1];
document.getElementById('cbid.shadowsocksr.' + sid + '.password').value = part1[1];
document.getElementById('cbid.shadowsocksr.' + sid + '.encrypt_method_ss').value = part1[0];
if (param != undefined) {
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = decodeURI(param);
}
s.innerHTML = "<font color='green'>导入Shadowsocks配置信息成功</font>";
return false;
} else if (ssu[0] == "vmess") {
var sstr = b64DecodeUnicode(ssu[1]);
var ploc = sstr.indexOf("/?");
document.getElementById('cbid.shadowsocksr.' + sid + '.type').value = "v2ray";
document.getElementById('cbid.shadowsocksr.' + sid + '.type').dispatchEvent(event);
var url0, param = "";
if (ploc > 0) {
url0 = sstr.substr(0, ploc);
param = sstr.substr(ploc + 2);
}
var ssm = JSON.parse(sstr);
document.getElementById('cbid.shadowsocksr.' + sid + '.alias').value = ssm.ps;
document.getElementById('cbid.shadowsocksr.' + sid + '.server').value = ssm.add;
document.getElementById('cbid.shadowsocksr.' + sid + '.server_port').value = ssm.port;
document.getElementById('cbid.shadowsocksr.' + sid + '.alter_id').value = ssm.aid;
document.getElementById('cbid.shadowsocksr.' + sid + '.vmess_id').value = ssm.id;
document.getElementById('cbid.shadowsocksr.' + sid + '.security').value = ssm.type;
document.getElementById('cbid.shadowsocksr.' + sid + '.transport').value = ssm.net;
s.innerHTML = "<font color='green'>导入V2ray配置信息成功</font>";
return false;
}
}
//]]></script>
<input type="button" class="cbi-button cbi-button-apply" value="<%:Import SSR%>" onclick="return import_ssr_url(this,'<%=self.option%>','<%=self.value%>')" />
<input type="button" class="cbi-button cbi-button-apply" value="<%:Export SSR%>" onclick="return export_ssr_url(this,'<%=self.option%>','<%=self.value%>')" />
<span id="<%=self.option%>-status"><%:ssr://%></span>
<input type="button" class="cbi-button cbi-button-apply" value="导入配置信息" onclick="return import_ssr_url(this, '<%=self.option%>', '<%=self.value%>')" />
<span id="<%=self.option%>-status"></span>
<%+cbi/valuefooter%>

View File

@ -399,7 +399,7 @@ msgid "Auto Update Server subscription, GFW list and CHN route"
msgstr "自动更新服务器订阅、GFW列表和 CHN路由表"
msgid "Subscribe URL"
msgstr "SSR/V2RAY订阅URL地址"
msgstr "SS/SSR/V2RAY订阅URL地址"
msgid "Update"
msgstr "更新"
@ -511,3 +511,6 @@ msgstr "所有端口(默认)"
msgid "Only Common Ports"
msgstr "仅常用端口不走P2P流量到代理"
msgid "Ping Latency"
msgstr "Ping延迟"

View File

@ -192,7 +192,7 @@ start_rules() {
if [ $dports = "1" ] ;then
proxyport=" "
else
proxyport="-m multiport --dports 22,53,80,443 "
proxyport="-m multiport --dports 22,53,587,465,995,993,143,80,443 "
fi
/usr/bin/ssr-rules \

View File

@ -10,6 +10,8 @@ urlsafe_b64decode() {
echo $data | base64 -d
}
urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
echo_date(){
echo $(TZ=UTC-8 date -R +%Y-%m-%d\ %X):$1
}
@ -47,7 +49,14 @@ Server_Update() {
${uci_set}ws_path="$ssr_ws_path"
${uci_set}tls="$ssr_tls"
${uci_set}security="auto"
${uci_set}alias="$ssr_remarks"
fi
if [ "$ssr_type" = "ss" ]; then
${uci_set}encrypt_method_ss="$ss_method"
${uci_set}alias="$ssr_remarks"
fi
}
name=shadowsocksr
@ -92,6 +101,7 @@ do
subscribe_max=${#ssr_url[@]}
fi
echo_date "共计$subscribe_max个节点"
ssr_group=$(urlsafe_b64decode $(urlsafe_b64decode ${ssr_url[$((${#ssr_url[@]} - 1))]//ssr:\/\//} | sed 's/&/\n/g' | grep group= | awk -F = '{print $2}'))
if [ -z "$ssr_group" ]; then
ssr_group="default"
@ -102,124 +112,141 @@ do
subscribe_o=0
subscribe_x=""
temp_host_o=()
curr_ssr=$(uci show $name | grep @servers | grep -c server=)
for ((x=0;x<$curr_ssr;x++)) # 循环已有服务器信息,匹配当前订阅群组
do
temp_alias=$(uci -q get $name.@servers[$x].grouphashkey | grep "$ssr_grouphashkey")
[ -n "$temp_alias" ] && temp_host_o[${#temp_host_o[@]}]=$(uci get $name.@servers[$x].hashkey)
done
for ((x=0;x<$subscribe_max;x++)) # 循环链接
do
[ ${#subscribe_max_x[@]} -eq 0 ] && temp_x=$x || temp_x=${subscribe_max_x[x]}
result=$(echo ${ssr_url[temp_x]} | grep "ssr")
if [[ "$result" != "" ]]
then
temp_info=$(urlsafe_b64decode ${ssr_url[temp_x]//ssr:\/\//}) # 解码 SSR 链接
# 计算hashkey
ssr_hashkey=$(echo "$temp_info" | md5sum | cut -d ' ' -f1)
info=${temp_info///?*/}
temp_info_array=(${info//:/ })
ssr_type="ssr"
ssr_host=${temp_info_array[0]}
ssr_port=${temp_info_array[1]}
ssr_protocol=${temp_info_array[2]}
ssr_method=${temp_info_array[3]}
ssr_obfs=${temp_info_array[4]}
ssr_passwd=$(urlsafe_b64decode ${temp_info_array[5]})
info=${temp_info:$((${#info} + 2))}
info=(${info//&/ })
ssr_protoparam=""
ssr_obfsparam=""
ssr_remarks="$temp_x"
for ((i=0;i<${#info[@]};i++)) # 循环扩展信息
do
temp_info=($(echo ${info[i]} | sed 's/=/ /g'))
case "${temp_info[0]}" in
protoparam)
ssr_protoparam=$(urlsafe_b64decode ${temp_info[1]})
;;
obfsparam)
ssr_obfsparam=$(urlsafe_b64decode ${temp_info[1]})
;;
remarks)
ssr_remarks=$(urlsafe_b64decode ${temp_info[1]})
;;
esac
curr_ssr=$(uci show $name | grep @servers | grep -c server=)
for ((x=0;x<$curr_ssr;x++)) # 循环已有服务器信息,匹配当前订阅群组
do
temp_alias=$(uci -q get $name.@servers[$x].grouphashkey | grep "$ssr_grouphashkey")
[ -n "$temp_alias" ] && temp_host_o[${#temp_host_o[@]}]=$(uci get $name.@servers[$x].hashkey)
done
else
temp_info=$(urlsafe_b64decode ${ssr_url[temp_x]//vmess:\/\//}) # 解码 Vmess 链接
# 计算hashkey
ssr_hashkey=$(echo "$temp_info" | md5sum | cut -d ' ' -f1)
ssr_type="v2ray"
json_load "$temp_info"
json_get_var ssr_host add
json_get_var ssr_port port
json_get_var ssr_alter_id aid
json_get_var ssr_vmess_id id
json_get_var ssr_security auto
json_get_var ssr_transport net
json_get_var ssr_remarks ps
ssr_tcp_guise="none"
json_get_var ssr_ws_host host
json_get_var ssr_ws_path path
json_get_var ssr_tls tls
if [ "$ssr_tls" == "tls" -o "$ssr_tls" == "1" ]; then
ssr_tls="1"
else
ssr_tls="0"
fi
fi
for ((x=0;x<$subscribe_max;x++)) # 循环链接
do
[ ${#subscribe_max_x[@]} -eq 0 ] && temp_x=$x || temp_x=${subscribe_max_x[x]}
result=$(echo ${ssr_url[temp_x]} | grep "ss")
subscribe_url_type=$(echo "$ssr_url" | awk -F ':' '{print $1}')
if [ "$subscribe_url_type" = "ss" ]; then
temp_info=${ssr_url[temp_x]//ss:\/\//} # 解码 SS 链接
# 计算hashkey
ssr_hashkey=$(echo "$temp_info" | md5sum | cut -d ' ' -f1)
if [ -z "ssr_remarks" ]; then # 没有备注的话则生成一个
ssr_remarks="$ssr_host:$ssr_port";
fi
info=$(urlsafe_b64decode $(echo "$temp_info" | awk -F '@' '{print $1}'))
temp_info_array=(${info//:/ })
ssr_type="ss"
ss_method=${temp_info_array[0]}
ssr_passwd=${temp_info_array[1]}
info=$(echo "$temp_info" | awk -F '@' '{print $2}' | awk -F '#' '{print $1}')
temp_info_array=(${info//:/ })
ssr_host=${temp_info_array[0]}
ssr_port=${temp_info_array[1]}
ssr_remarks=$(urldecode $(echo "$temp_info" | awk -F '#' '{print $2}'))
fi
if [ "$subscribe_url_type" = "ssr" ]; then
temp_info=$(urlsafe_b64decode ${ssr_url[temp_x]//ssr:\/\//}) # 解码 SSR 链接
# 计算hashkey
ssr_hashkey=$(echo "$temp_info" | md5sum | cut -d ' ' -f1)
uci_name_tmp=$(uci show $name | grep -w "$ssr_hashkey" | awk -F . '{print $2}')
if [ -z "$uci_name_tmp" ]; then # 判断当前服务器信息是否存在
uci_name_tmp=$(uci add $name servers)
subscribe_n=$(($subscribe_n + 1))
fi
Server_Update $uci_name_tmp
subscribe_x=$subscribe_x$ssr_hashkey" "
ssrtype=$(echo $ssr_type | tr '[a-z]' '[A-Z]')
echo_date "$ssrtype节点:【$ssr_remarks"
# SSR
# echo "服务器地址: $ssr_host"
# echo "服务器端口 $ssr_port"
# echo "密码: $ssr_passwd"
# echo "加密: $ssr_method"
# echo "协议: $ssr_protocol"
# echo "协议参数: $ssr_protoparam"
# echo "混淆: $ssr_obfs"
# echo "混淆参数: $ssr_obfsparam"
# echo "备注: $ssr_remarks"
done
for ((x=0;x<${#temp_host_o[@]};x++)) # 新旧服务器信息匹配,如果旧服务器信息不存在于新服务器信息则删除
do
if [ -z "$(echo "$subscribe_x" | grep -w ${temp_host_o[x]})" ]; then
uci_name_tmp=$(uci show $name | grep ${temp_host_o[x]} | awk -F . '{print $2}')
uci delete $name.$uci_name_tmp
subscribe_o=$(($subscribe_o + 1))
fi
done
echo_date "本次更新订阅来源 【$ssr_group】 服务器数量: ${#ssr_url[@]} 新增服务器: $subscribe_n 删除服务器: $subscribe_o"
echo_date "在线订阅列表更新完成!请等待网页自动刷新!"
subscribe_log="$ssr_group 服务器订阅更新成功 服务器数量: ${#ssr_url[@]} 新增服务器: $subscribe_n 删除服务器: $subscribe_o"
logger -st $log_name[$$] -p6 "$subscribe_log"
uci commit $name
else
echo_date "${subscribe_url[$o]} 订阅数据解析失败 无法获取 Group"
logger -st $log_name[$$] -p3 "${subscribe_url[$o]} 订阅数据解析失败 无法获取 Group"
info=${temp_info///?*/}
temp_info_array=(${info//:/ })
ssr_type="ssr"
ssr_host=${temp_info_array[0]}
ssr_port=${temp_info_array[1]}
ssr_protocol=${temp_info_array[2]}
ssr_method=${temp_info_array[3]}
ssr_obfs=${temp_info_array[4]}
ssr_passwd=$(urlsafe_b64decode ${temp_info_array[5]})
info=${temp_info:$((${#info} + 2))}
info=(${info//&/ })
ssr_protoparam=""
ssr_obfsparam=""
ssr_remarks="$temp_x"
for ((i=0;i<${#info[@]};i++)) # 循环扩展信息
do
temp_info=($(echo ${info[i]} | sed 's/=/ /g'))
case "${temp_info[0]}" in
protoparam)
ssr_protoparam=$(urlsafe_b64decode ${temp_info[1]});;
obfsparam)
ssr_obfsparam=$(urlsafe_b64decode ${temp_info[1]});;
remarks)
ssr_remarks=$(urlsafe_b64decode ${temp_info[1]});;
esac
done
fi
if [ "$subscribe_url_type" = "vmess" ]; then
temp_info=$(urlsafe_b64decode ${ssr_url[temp_x]//vmess:\/\//}) # 解码 Vmess 链接
# 计算hashkey
ssr_hashkey=$(echo "$temp_info" | md5sum | cut -d ' ' -f1)
ssr_type="v2ray"
json_load "$temp_info"
json_get_var ssr_host add
json_get_var ssr_port port
json_get_var ssr_alter_id aid
json_get_var ssr_vmess_id id
json_get_var ssr_security type
json_get_var ssr_transport net
json_get_var ssr_remarks ps
ssr_tcp_guise="none"
json_get_var ssr_ws_host host
json_get_var ssr_ws_path path
json_get_var ssr_tls tls
if [ "$ssr_tls" == "tls" -o "$ssr_tls" == "1" ]; then
ssr_tls="1"
else
ssr_tls="0"
fi
fi
if [ -z "ssr_remarks" ]; then # 没有备注的话则生成一个
ssr_remarks="$ssr_host:$ssr_port";
fi
uci_name_tmp=$(uci show $name | grep -w "$ssr_hashkey" | awk -F . '{print $2}')
if [ -z "$uci_name_tmp" ]; then # 判断当前服务器信息是否存在
uci_name_tmp=$(uci add $name servers)
subscribe_n=$(($subscribe_n + 1))
fi
Server_Update $uci_name_tmp
subscribe_x=$subscribe_x$ssr_hashkey" "
ssrtype=$(echo $ssr_type | tr '[a-z]' '[A-Z]')
echo_date "$ssrtype节点:【$ssr_remarks"
# SSR
# echo "服务器地址: $ssr_host"
# echo "服务器端口 $ssr_port"
# echo "密码: $ssr_passwd"
# echo "SS加密: $ss_method"
# echo "加密: $ssr_method"
# echo "协议: $ssr_protocol"
# echo "协议参数: $ssr_protoparam"
# echo "混淆: $ssr_obfs"
# echo "混淆参数: $ssr_obfsparam"
# echo "备注: $ssr_remarks"
done
for ((x=0;x<${#temp_host_o[@]};x++)) # 新旧服务器信息匹配,如果旧服务器信息不存在于新服务器信息则删除
do
if [ -z "$(echo "$subscribe_x" | grep -w ${temp_host_o[x]})" ]; then
uci_name_tmp=$(uci show $name | grep ${temp_host_o[x]} | awk -F . '{print $2}')
uci delete $name.$uci_name_tmp
subscribe_o=$(($subscribe_o + 1))
fi
done
echo_date "本次更新订阅来源 【$ssr_group】 服务器数量: ${#ssr_url[@]} 新增服务器: $subscribe_n 删除服务器: $subscribe_o"
echo_date "在线订阅列表更新完成!请等待网页自动刷新!"
subscribe_log="$ssr_group 服务器订阅更新成功 服务器数量: ${#ssr_url[@]} 新增服务器: $subscribe_n 删除服务器: $subscribe_o"
logger -st $log_name[$$] -p6 "$subscribe_log"
uci commit $name
else
echo_date "${subscribe_url[$o]} 订阅数据解析失败 无法获取 Group"
logger -st $log_name[$$] -p3 "${subscribe_url[$o]} 订阅数据解析失败 无法获取 Group"
fi
else
echo_date "${subscribe_url[$o]} 订阅数据获取失败 错误代码: $curl_code"
logger -st $log_name[$$] -p3 "${subscribe_url[$o]} 订阅数据获取失败 错误代码: $curl_code"
fi
else
echo_date "${subscribe_url[$o]} 订阅数据获取失败 错误代码: $curl_code"
logger -st $log_name[$$] -p3 "${subscribe_url[$o]} 订阅数据获取失败 错误代码: $curl_code"
fi
done
/etc/init.d/$name restart >/dev/null 2>&1
/etc/init.d/$name restart >/dev/null 2>&1

View File

@ -10,8 +10,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-unblockmusic
PKG_VERSION:=v2.1.0
PKG_RELEASE:=8
PKG_VERSION:=2.2.0
PKG_RELEASE:=1
PKG_LICENSE:=Apache-2.0

View File

@ -1,3 +1,4 @@
#!/bin/sh
sleep 50 && /etc/init.d/unblockmusic restart
sleep 10
wget http://httpdns.n.netease.com/httpdns/v2/d?domain=music.163.com,interface.music.163.com,interface3.music.163.com,apm.music.163.com,apm3.music.163.com,clientlog.music.163.com,clientlog3.music.163.com -O- | grep -Eo '[0-9]+?\.[0-9]+?\.[0-9]+?\.[0-9]+?' | sort | uniq | awk '{print "ipset -! add music "$1}' | sh

View File

@ -15,7 +15,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=shortcut-fe
PKG_RELEASE:=5
PKG_RELEASE:=9
include $(INCLUDE_DIR)/package.mk

View File

@ -310,15 +310,8 @@ rx_exit:
* We look up the rtable entry for the address and, from its neighbour
* structure, obtain the hardware address. This means this function also
* works if the neighbours are routers too.
*
* 21/10/17, quarkysg
* - modified method signature to accept dst_entry from caller. It will be used in place of existing method logic to lookup
* destination routes, which fails when packets are policy routed.
*
* 22/12/17, quarkysg
* - changed method signature to accept sk_buff * instead, to make it more efficient.
*/
static bool fast_classifier_find_dev_and_mac_addr(struct sk_buff *skb, sfe_ip_addr_t *addr, struct net_device **dev, u8 *mac_addr, bool is_v4)
static bool fast_classifier_find_dev_and_mac_addr(sfe_ip_addr_t *addr, struct net_device **dev, u8 *mac_addr, bool is_v4)
{
struct neighbour *neigh;
struct rtable *rt;
@ -326,17 +319,6 @@ static bool fast_classifier_find_dev_and_mac_addr(struct sk_buff *skb, sfe_ip_ad
struct dst_entry *dst;
struct net_device *mac_dev;
/*
* If we have skb provided, use it as the original code is unable
* to lookup routes that are policy routed.
*
* quarkysg, 22/12/17
*/
if (unlikely(skb)) {
dst = skb_dst(skb);
goto skip_dst_lookup;
}
/*
* Look up the rtable entry for the IP address then get the hardware
* address from its neighbour structure. This means this works when the
@ -358,25 +340,18 @@ static bool fast_classifier_find_dev_and_mac_addr(struct sk_buff *skb, sfe_ip_ad
dst = (struct dst_entry *)rt6;
}
skip_dst_lookup: // quarkysg, 21/10/17
rcu_read_lock();
neigh = dst_neigh_lookup(dst, addr);
if (unlikely(!neigh)) {
rcu_read_unlock();
// only release dst_entry found in this method, quarkysg, 21/10/17
if (likely(!skb)) {
dst_release(dst);
}
dst_release(dst);
goto ret_fail;
}
if (unlikely(!(neigh->nud_state & NUD_VALID))) {
rcu_read_unlock();
neigh_release(neigh);
// only release dst_entry found in this method, quarkysg, 21/10/17
if (likely(!skb)) {
dst_release(dst);
}
dst_release(dst);
goto ret_fail;
}
@ -384,10 +359,7 @@ skip_dst_lookup: // quarkysg, 21/10/17
if (!mac_dev) {
rcu_read_unlock();
neigh_release(neigh);
// only release dst_entry found in this method, quarkysg, 21/10/17
if (likely(!skb)) {
dst_release(dst);
}
dst_release(dst);
goto ret_fail;
}
@ -397,10 +369,7 @@ skip_dst_lookup: // quarkysg, 21/10/17
*dev = mac_dev;
rcu_read_unlock();
neigh_release(neigh);
// only release dst_entry found in this method, quarkysg, 21/10/17
if (likely(!skb)) {
dst_release(dst);
}
dst_release(dst);
return true;
@ -1049,27 +1018,26 @@ static unsigned int fast_classifier_post_routing(struct sk_buff *skb, bool is_v4
* Get the net device and MAC addresses that correspond to the various source and
* destination host addresses.
*/
if (!fast_classifier_find_dev_and_mac_addr(NULL, &sic.src_ip, &src_dev, sic.src_mac, is_v4)) {
if (!fast_classifier_find_dev_and_mac_addr(&sic.src_ip, &src_dev, sic.src_mac, is_v4)) {
fast_classifier_incr_exceptions(FAST_CL_EXCEPTION_NO_SRC_DEV);
return NF_ACCEPT;
}
if (!fast_classifier_find_dev_and_mac_addr(NULL, &sic.src_ip_xlate, &dev, sic.src_mac_xlate, is_v4)) {
if (!fast_classifier_find_dev_and_mac_addr(&sic.src_ip_xlate, &dev, sic.src_mac_xlate, is_v4)) {
fast_classifier_incr_exceptions(FAST_CL_EXCEPTION_NO_SRC_XLATE_DEV);
goto done1;
}
dev_put(dev);
if (!fast_classifier_find_dev_and_mac_addr(NULL, &sic.dest_ip, &dev, sic.dest_mac, is_v4)) {
if (!fast_classifier_find_dev_and_mac_addr(&sic.dest_ip, &dev, sic.dest_mac, is_v4)) {
fast_classifier_incr_exceptions(FAST_CL_EXCEPTION_NO_DEST_DEV);
goto done1;
}
dev_put(dev);
// we pass in sk_buff(skb) to enable acceleration of policy routed packets, quarkysg, 22/12/17
if (!fast_classifier_find_dev_and_mac_addr(skb, &sic.dest_ip_xlate, &dest_dev, sic.dest_mac_xlate, is_v4)) {
if (!fast_classifier_find_dev_and_mac_addr(&sic.dest_ip_xlate, &dest_dev, sic.dest_mac_xlate, is_v4)) {
fast_classifier_incr_exceptions(FAST_CL_EXCEPTION_NO_DEST_XLATE_DEV);
goto done1;
}
@ -1722,7 +1690,7 @@ static int __init fast_classifier_init(void)
int result = -1;
size_t i, j;
printk(KERN_ALERT "fast-classifier (PBR safe v2.2): starting up\n");
printk(KERN_ALERT "fast-classifier: starting up\n");
DEBUG_INFO("SFE CM init\n");
hash_init(fc_conn_ht);
@ -1813,7 +1781,7 @@ static int __init fast_classifier_init(void)
}
#endif
printk(KERN_ALERT "fast-classifier (PBR safe v2.2): registered\n");
printk(KERN_ALERT "fast-classifier: registered\n");
spin_lock_init(&sc->lock);
@ -1867,7 +1835,7 @@ static void __exit fast_classifier_exit(void)
int result = -1;
DEBUG_INFO("SFE CM exit\n");
printk(KERN_ALERT "fast-classifier (PBR safe v2.2): shutting down\n");
printk(KERN_ALERT "fast-classifier: shutting down\n");
/*
* Unregister our sync callback.

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=vsftpd-alt
PKG_VERSION:=3.0.3
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_SOURCE:=vsftpd-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://security.appspot.com/downloads/

View File

@ -252,4 +252,6 @@ else
fi
fi
output_const "seccomp_sandbox" NO
exit 0

View File

@ -1,26 +1,24 @@
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1635,8 +1635,8 @@ static int __xipram do_write_oneword(str
break;
@@ -1641,7 +1641,7 @@ static int __xipram do_write_oneword(str
}
- if (chip_ready(map, adr))
if (chip_good(map, adr, datum))
- break;
+ if (chip_good(map, adr, datum))
+ goto enable_xip;
/* Latency issues. Drop the lock, wait a while and retry */
UDELAY(map, chip, adr, 1);
@@ -1652,6 +1652,8 @@ static int __xipram do_write_oneword(str
ret = -EIO;
@@ -1658,6 +1658,8 @@ static int __xipram do_write_oneword(str
goto retry;
}
}
+
+ enable_xip:
xip_enable(map, chip, adr);
op_done:
if (mode == FL_OTP_WRITE)
@@ -2230,7 +2232,6 @@ static int cfi_amdstd_panic_write(struct
@@ -2236,7 +2238,6 @@ static int cfi_amdstd_panic_write(struct
return 0;
}
@ -28,7 +26,7 @@
/*
* Handle devices with one erase region, that only implement
* the chip erase command.
@@ -2298,7 +2299,7 @@ static int __xipram do_erase_chip(struct
@@ -2304,7 +2305,7 @@ static int __xipram do_erase_chip(struct
}
if (chip_good(map, adr, map_word_ff(map)))
@ -37,7 +35,7 @@
if (time_after(jiffies, timeo)) {
printk(KERN_WARNING "MTD %s(): software timeout\n",
@@ -2322,6 +2323,7 @@ static int __xipram do_erase_chip(struct
@@ -2328,6 +2329,7 @@ static int __xipram do_erase_chip(struct
}
}
@ -45,7 +43,7 @@
chip->state = FL_READY;
xip_enable(map, chip, adr);
DISABLE_VPP(map);
@@ -2395,7 +2397,7 @@ static int __xipram do_erase_oneblock(st
@@ -2401,7 +2403,7 @@ static int __xipram do_erase_oneblock(st
if (chip_good(map, adr, map_word_ff(map))) {
xip_enable(map, chip, adr);
@ -54,7 +52,7 @@
}
if (time_after(jiffies, timeo)) {
@@ -2421,6 +2423,7 @@ static int __xipram do_erase_oneblock(st
@@ -2427,6 +2429,7 @@ static int __xipram do_erase_oneblock(st
}
}

View File

@ -35,7 +35,7 @@
/* Atmel chips don't use the same PRI format as AMD chips */
static void fixup_convert_atmel_pri(struct mtd_info *mtd)
@@ -1794,6 +1798,7 @@ static int cfi_amdstd_write_words(struct
@@ -1800,6 +1804,7 @@ static int cfi_amdstd_write_words(struct
/*
* FIXME: interleaved mode not tested, and probably not supported!
*/
@ -43,7 +43,7 @@
static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const u_char *buf,
int len)
@@ -1922,7 +1927,6 @@ static int __xipram do_write_buffer(stru
@@ -1928,7 +1933,6 @@ static int __xipram do_write_buffer(stru
return ret;
}
@ -51,7 +51,7 @@
static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
@@ -1997,6 +2001,7 @@ static int cfi_amdstd_write_buffers(stru
@@ -2003,6 +2007,7 @@ static int cfi_amdstd_write_buffers(stru
return 0;
}

View File

@ -1,26 +1,24 @@
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1631,8 +1631,8 @@ static int __xipram do_write_oneword(str
break;
@@ -1637,7 +1637,7 @@ static int __xipram do_write_oneword(str
}
- if (chip_ready(map, adr))
if (chip_good(map, adr, datum))
- break;
+ if (chip_good(map, adr, datum))
+ goto enable_xip;
/* Latency issues. Drop the lock, wait a while and retry */
UDELAY(map, chip, adr, 1);
@@ -1648,6 +1648,8 @@ static int __xipram do_write_oneword(str
ret = -EIO;
@@ -1654,6 +1654,8 @@ static int __xipram do_write_oneword(str
goto retry;
}
}
+
+ enable_xip:
xip_enable(map, chip, adr);
op_done:
if (mode == FL_OTP_WRITE)
@@ -2226,7 +2228,6 @@ static int cfi_amdstd_panic_write(struct
@@ -2232,7 +2234,6 @@ static int cfi_amdstd_panic_write(struct
return 0;
}
@ -28,7 +26,7 @@
/*
* Handle devices with one erase region, that only implement
* the chip erase command.
@@ -2294,7 +2295,7 @@ static int __xipram do_erase_chip(struct
@@ -2300,7 +2301,7 @@ static int __xipram do_erase_chip(struct
}
if (chip_good(map, adr, map_word_ff(map)))
@ -37,7 +35,7 @@
if (time_after(jiffies, timeo)) {
printk(KERN_WARNING "MTD %s(): software timeout\n",
@@ -2318,6 +2319,7 @@ static int __xipram do_erase_chip(struct
@@ -2324,6 +2325,7 @@ static int __xipram do_erase_chip(struct
}
}
@ -45,7 +43,7 @@
chip->state = FL_READY;
xip_enable(map, chip, adr);
DISABLE_VPP(map);
@@ -2391,7 +2393,7 @@ static int __xipram do_erase_oneblock(st
@@ -2397,7 +2399,7 @@ static int __xipram do_erase_oneblock(st
if (chip_good(map, adr, map_word_ff(map))) {
xip_enable(map, chip, adr);
@ -54,7 +52,7 @@
}
if (time_after(jiffies, timeo)) {
@@ -2417,6 +2419,7 @@ static int __xipram do_erase_oneblock(st
@@ -2423,6 +2425,7 @@ static int __xipram do_erase_oneblock(st
}
}

View File

@ -1,26 +1,24 @@
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1635,8 +1635,8 @@ static int __xipram do_write_oneword(str
break;
@@ -1641,7 +1641,7 @@ static int __xipram do_write_oneword(str
}
- if (chip_ready(map, adr))
if (chip_good(map, adr, datum))
- break;
+ if (chip_good(map, adr, datum))
+ goto enable_xip;
/* Latency issues. Drop the lock, wait a while and retry */
UDELAY(map, chip, adr, 1);
@@ -1652,6 +1652,8 @@ static int __xipram do_write_oneword(str
ret = -EIO;
@@ -1658,6 +1658,8 @@ static int __xipram do_write_oneword(str
goto retry;
}
}
+
+ enable_xip:
xip_enable(map, chip, adr);
op_done:
if (mode == FL_OTP_WRITE)
@@ -2230,7 +2232,6 @@ static int cfi_amdstd_panic_write(struct
@@ -2236,7 +2238,6 @@ static int cfi_amdstd_panic_write(struct
return 0;
}
@ -28,7 +26,7 @@
/*
* Handle devices with one erase region, that only implement
* the chip erase command.
@@ -2298,7 +2299,7 @@ static int __xipram do_erase_chip(struct
@@ -2304,7 +2305,7 @@ static int __xipram do_erase_chip(struct
}
if (chip_good(map, adr, map_word_ff(map)))
@ -37,7 +35,7 @@
if (time_after(jiffies, timeo)) {
printk(KERN_WARNING "MTD %s(): software timeout\n",
@@ -2322,6 +2323,7 @@ static int __xipram do_erase_chip(struct
@@ -2328,6 +2329,7 @@ static int __xipram do_erase_chip(struct
}
}
@ -45,7 +43,7 @@
chip->state = FL_READY;
xip_enable(map, chip, adr);
DISABLE_VPP(map);
@@ -2395,7 +2397,7 @@ static int __xipram do_erase_oneblock(st
@@ -2401,7 +2403,7 @@ static int __xipram do_erase_oneblock(st
if (chip_good(map, adr, map_word_ff(map))) {
xip_enable(map, chip, adr);
@ -54,7 +52,7 @@
}
if (time_after(jiffies, timeo)) {
@@ -2421,6 +2423,7 @@ static int __xipram do_erase_oneblock(st
@@ -2427,6 +2429,7 @@ static int __xipram do_erase_oneblock(st
}
}

View File

@ -1,26 +1,24 @@
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1634,8 +1634,8 @@ static int __xipram do_write_oneword(str
break;
@@ -1640,7 +1640,7 @@ static int __xipram do_write_oneword(str
}
- if (chip_ready(map, adr))
if (chip_good(map, adr, datum))
- break;
+ if (chip_good(map, adr, datum))
+ goto enable_xip;
/* Latency issues. Drop the lock, wait a while and retry */
UDELAY(map, chip, adr, 1);
@@ -1651,6 +1651,8 @@ static int __xipram do_write_oneword(str
ret = -EIO;
@@ -1657,6 +1657,8 @@ static int __xipram do_write_oneword(str
goto retry;
}
}
+
+ enable_xip:
xip_enable(map, chip, adr);
op_done:
if (mode == FL_OTP_WRITE)
@@ -2229,7 +2231,6 @@ static int cfi_amdstd_panic_write(struct
@@ -2235,7 +2237,6 @@ static int cfi_amdstd_panic_write(struct
return 0;
}
@ -28,7 +26,7 @@
/*
* Handle devices with one erase region, that only implement
* the chip erase command.
@@ -2297,7 +2298,7 @@ static int __xipram do_erase_chip(struct
@@ -2303,7 +2304,7 @@ static int __xipram do_erase_chip(struct
}
if (chip_good(map, adr, map_word_ff(map)))
@ -37,7 +35,7 @@
if (time_after(jiffies, timeo)) {
printk(KERN_WARNING "MTD %s(): software timeout\n",
@@ -2321,6 +2322,7 @@ static int __xipram do_erase_chip(struct
@@ -2327,6 +2328,7 @@ static int __xipram do_erase_chip(struct
}
}
@ -45,7 +43,7 @@
chip->state = FL_READY;
xip_enable(map, chip, adr);
DISABLE_VPP(map);
@@ -2393,7 +2395,7 @@ static int __xipram do_erase_oneblock(st
@@ -2399,7 +2401,7 @@ static int __xipram do_erase_oneblock(st
}
if (chip_good(map, adr, map_word_ff(map)))
@ -54,7 +52,7 @@
if (time_after(jiffies, timeo)) {
printk(KERN_WARNING "MTD %s(): software timeout\n",
@@ -2417,6 +2419,7 @@ static int __xipram do_erase_oneblock(st
@@ -2423,6 +2425,7 @@ static int __xipram do_erase_oneblock(st
}
}

View File

@ -47,7 +47,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
struct bcm2835_dmadev {
struct dma_device ddev;
@@ -912,6 +914,9 @@ static int bcm2835_dma_probe(struct plat
@@ -914,6 +916,9 @@ static int bcm2835_dma_probe(struct plat
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
@ -57,7 +57,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
od->base = base;
@@ -950,6 +955,9 @@ static int bcm2835_dma_probe(struct plat
@@ -952,6 +957,9 @@ static int bcm2835_dma_probe(struct plat
goto err_no_dma;
}
@ -67,7 +67,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
/* get irqs for each channel that we support */
for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) {
/* skip masked out channels */
@@ -1024,6 +1032,7 @@ static int bcm2835_dma_remove(struct pla
@@ -1026,6 +1034,7 @@ static int bcm2835_dma_remove(struct pla
{
struct bcm2835_dmadev *od = platform_get_drvdata(pdev);
@ -75,7 +75,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
dma_async_device_unregister(&od->ddev);
bcm2835_dma_free(od);
@@ -1039,7 +1048,22 @@ static struct platform_driver bcm2835_dm
@@ -1041,7 +1050,22 @@ static struct platform_driver bcm2835_dm
},
};

View File

@ -143,7 +143,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
static const struct of_device_id bcm2835_dma_of_match[] = {
{ .compatible = "brcm,bcm2835-dma", },
{},
@@ -964,6 +1064,13 @@ static int bcm2835_dma_probe(struct plat
@@ -966,6 +1066,13 @@ static int bcm2835_dma_probe(struct plat
/* Channel 0 is used by the legacy API */
chans_available &= ~BCM2835_DMA_BULK_MASK;

View File

@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2930,6 +2930,10 @@ static irqreturn_t sdhci_irq(int irq, vo
@@ -2932,6 +2932,10 @@ static irqreturn_t sdhci_irq(int irq, vo
result = IRQ_WAKE_THREAD;
}

View File

@ -713,7 +713,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
@@ -1020,9 +1206,13 @@ static int bcm2835_dma_probe(struct plat
@@ -1022,9 +1208,13 @@ static int bcm2835_dma_probe(struct plat
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
@ -730,7 +730,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
od->base = base;
@@ -1052,6 +1242,14 @@ static int bcm2835_dma_probe(struct plat
@@ -1054,6 +1244,14 @@ static int bcm2835_dma_probe(struct plat
platform_set_drvdata(pdev, od);
@ -745,7 +745,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
/* Request DMA channel mask from device tree */
if (of_property_read_u32(pdev->dev.of_node,
"brcm,dma-channel-mask",
@@ -1061,18 +1259,34 @@ static int bcm2835_dma_probe(struct plat
@@ -1063,18 +1261,34 @@ static int bcm2835_dma_probe(struct plat
goto err_no_dma;
}
@ -788,7 +788,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
/* skip masked out channels */
if (!(chans_available & (1 << i))) {
irq[i] = -1;
@@ -1095,13 +1309,17 @@ static int bcm2835_dma_probe(struct plat
@@ -1097,13 +1311,17 @@ static int bcm2835_dma_probe(struct plat
irq[i] = platform_get_irq(pdev, i < 11 ? i : 11);
}
@ -807,7 +807,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
irq_flags = 0;
for (j = 0; j <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; j++)
if ((i != j) && (irq[j] == irq[i])) {
@@ -1113,9 +1331,10 @@ static int bcm2835_dma_probe(struct plat
@@ -1115,9 +1333,10 @@ static int bcm2835_dma_probe(struct plat
rc = bcm2835_dma_chan_init(od, i, irq[i], irq_flags);
if (rc)
goto err_no_dma;
@ -819,7 +819,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
/* Device-tree DMA controller registration */
rc = of_dma_controller_register(pdev->dev.of_node,
@@ -1147,6 +1366,13 @@ static int bcm2835_dma_remove(struct pla
@@ -1149,6 +1368,13 @@ static int bcm2835_dma_remove(struct pla
bcm_dmaman_remove(pdev);
dma_async_device_unregister(&od->ddev);

View File

@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
#define USB_VENDOR_ID_BELKIN 0x050d
#define USB_DEVICE_ID_FLIP_KVM 0x3201
@@ -1188,6 +1191,9 @@
@@ -1189,6 +1192,9 @@
#define USB_VENDOR_ID_XAT 0x2505
#define USB_DEVICE_ID_XAT_CSR 0x0220
@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
@@ -173,6 +174,7 @@ static const struct hid_device_id hid_qu
@@ -174,6 +175,7 @@ static const struct hid_device_id hid_qu
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },

View File

@ -55,7 +55,7 @@ Cc: Kir Kolyshkin <kir@openvz.org>
rwlock_t sk_callback_lock;
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2740,6 +2740,7 @@ void sock_init_data(struct socket *sock,
@@ -2745,6 +2745,7 @@ void sock_init_data(struct socket *sock,
sk->sk_max_pacing_rate = ~0U;
sk->sk_pacing_rate = ~0U;

View File

@ -0,0 +1,63 @@
From 28b5c129ca6e585ec95c160ec4297bc6c6360b6f Mon Sep 17 00:00:00 2001
From: Minas Harutyunyan <minas.harutyunyan@synopsys.com>
Date: Mon, 4 Mar 2019 17:08:07 +0400
Subject: usb: dwc2: Set lpm mode parameters depend on HW configuration
If core not supported lpm, i.e. BCM2835 then confusing warnings seen
in log.
To avoid these warnings, added function dwc2_set_param_lpm() to set
lpm and other lpm related parameters based on lpm support by core.
Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
---
drivers/usb/dwc2/params.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -272,6 +272,23 @@ static void dwc2_set_param_power_down(st
hsotg->params.power_down = val;
}
+static void dwc2_set_param_lpm(struct dwc2_hsotg *hsotg)
+{
+ struct dwc2_core_params *p = &hsotg->params;
+
+ p->lpm = hsotg->hw_params.lpm_mode;
+ if (p->lpm) {
+ p->lpm_clock_gating = true;
+ p->besl = true;
+ p->hird_threshold_en = true;
+ p->hird_threshold = 4;
+ } else {
+ p->lpm_clock_gating = false;
+ p->besl = false;
+ p->hird_threshold_en = false;
+ }
+}
+
/**
* dwc2_set_default_params() - Set all core parameters to their
* auto-detected default values.
@@ -290,6 +307,7 @@ static void dwc2_set_default_params(stru
dwc2_set_param_speed(hsotg);
dwc2_set_param_phy_utmi_width(hsotg);
dwc2_set_param_power_down(hsotg);
+ dwc2_set_param_lpm(hsotg);
p->phy_ulpi_ddr = false;
p->phy_ulpi_ext_vbus = false;
@@ -302,11 +320,6 @@ static void dwc2_set_default_params(stru
p->reload_ctl = (hw->snpsid >= DWC2_CORE_REV_2_92a);
p->uframe_sched = true;
p->external_id_pin_ctl = false;
- p->lpm = true;
- p->lpm_clock_gating = true;
- p->besl = true;
- p->hird_threshold_en = true;
- p->hird_threshold = 4;
p->ipg_isoc_en = false;
p->max_packet_count = hw->max_packet_count;
p->max_transfer_size = hw->max_transfer_size;

View File

@ -555,7 +555,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
+{
+ struct tc_action_net *tn = net_generic(net, ctinfo_net_id);
+
+ return tc_action_net_init(tn, &act_ctinfo_ops);
+ return tc_action_net_init(net, tn, &act_ctinfo_ops);
+}
+
+static void __net_exit ctinfo_exit_net(struct list_head *net_list)

View File

@ -0,0 +1,25 @@
From 81554171373018b83f3554b9e725d2b5bf1844a5 Mon Sep 17 00:00:00 2001
From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Date: Fri, 13 Jul 2018 15:06:46 +0200
Subject: [PATCH] mtd: spi-nor: Add support for mx25u12835f
This chip supports dual and quad read and uniform 4K-byte erase.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
drivers/mtd/spi-nor/spi-nor.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1088,6 +1088,8 @@ static const struct flash_info spi_nor_i
{ "mx25u6435f", INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) },
{ "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) },
{ "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) },
+ { "mx25u12835f", INFO(0xc22538, 0, 64 * 1024, 256,
+ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
{ "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_OPCODES) },
{ "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) },

View File

@ -55,7 +55,7 @@ Cc: Kir Kolyshkin <kir@openvz.org>
rwlock_t sk_callback_lock;
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2479,6 +2479,7 @@ void sock_init_data(struct socket *sock,
@@ -2484,6 +2484,7 @@ void sock_init_data(struct socket *sock,
sk->sk_max_pacing_rate = ~0U;
sk->sk_pacing_rate = ~0U;

View File

@ -1379,7 +1379,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
*/
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1070,7 +1070,7 @@ err:
@@ -1071,7 +1071,7 @@ err:
if (work_done < budget) {
int more_to_do = 0;

View File

@ -505,6 +505,7 @@ CONFIG_BITREVERSE=y
# CONFIG_BLK_CMDLINE_PARSER is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CGROUP_IOLATENCY is not set
# CONFIG_BLK_DEBUG_FS is not set
CONFIG_BLK_DEV=y
# CONFIG_BLK_DEV_3W_XXXX_RAID is not set

View File

@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/Makefile
+++ b/Makefile
@@ -1241,7 +1241,6 @@ all: modules
@@ -1243,7 +1243,6 @@ all: modules
PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1270,7 +1269,6 @@ _modinst_:
@@ -1272,7 +1271,6 @@ _modinst_:
rm -f $(MODLIB)/build ; \
ln -s $(CURDIR) $(MODLIB)/build ; \
fi

View File

@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
device, it has to decide which ones to send first, which ones to
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -2028,7 +2028,7 @@ static int __init pktsched_init(void)
@@ -2029,7 +2029,7 @@ static int __init pktsched_init(void)
return err;
}

View File

@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = __sk_dst_get(sk);
@@ -1593,9 +1605,11 @@ void sk_destruct(struct sock *sk)
@@ -1598,9 +1610,11 @@ void sk_destruct(struct sock *sk)
static void __sk_free(struct sock *sk)
{

View File

@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3379,6 +3379,8 @@ static __net_initdata struct pernet_oper
@@ -3384,6 +3384,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{

View File

@ -1,79 +0,0 @@
From 38a3549ffc0033761063cc5c7b994ab075694db8 Mon Sep 17 00:00:00 2001
From: Christian Lamparter <chunkeey@gmail.com>
Date: Tue, 25 Dec 2018 21:11:08 +0100
Subject: [RFC PATCH] leds: fix regression in usbport led trigger
In the patch "usb: simplify usbport trigger" together with
"leds: triggers: add device attribute support" caused an
regression for the usbport trigger. it will no longer
enumerate any "ports" (i.e the sysfs directory stays empty)
if the usb host drivers are fully initialized before the
usbport trigger was loaded.
The reason is that the usbport driver registers the sysfs
entries in the ports subdirectory during the activate()
callback. Whereas the patch
"leds: triggers: add device attribute support" made it so
that the sysfs "ports" group was only being added after
the activate() callback succeeded.
This patch moves the device_add_groups() in front of the
call to the trigger's activate() function in order to
solve the problem.
Fixes: 6f7b0bad8839 ("usb: simplify usbport trigger")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
---
drivers/leds/led-triggers.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -134,6 +134,12 @@ int led_trigger_set(struct led_classdev
led_set_brightness(led_cdev, LED_OFF);
}
if (trig) {
+ ret = device_add_groups(led_cdev->dev, trig->groups);
+ if (ret) {
+ dev_err(led_cdev->dev, "Failed to add trigger attributes\n");
+ goto err_add_groups;
+ }
+
write_lock_irqsave(&trig->leddev_list_lock, flags);
list_add_tail(&led_cdev->trig_list, &trig->led_cdevs);
write_unlock_irqrestore(&trig->leddev_list_lock, flags);
@@ -146,12 +152,6 @@ int led_trigger_set(struct led_classdev
if (ret)
goto err_activate;
-
- ret = device_add_groups(led_cdev->dev, trig->groups);
- if (ret) {
- dev_err(led_cdev->dev, "Failed to add trigger attributes\n");
- goto err_add_groups;
- }
}
if (event) {
@@ -165,17 +165,18 @@ int led_trigger_set(struct led_classdev
return 0;
-err_add_groups:
-
+err_activate:
+ device_remove_groups(led_cdev->dev, trig->groups);
if (trig->deactivate)
trig->deactivate(led_cdev);
-err_activate:
led_cdev->trigger = NULL;
led_cdev->trigger_data = NULL;
write_lock_irqsave(&led_cdev->trigger->leddev_list_lock, flags);
list_del(&led_cdev->trig_list);
write_unlock_irqrestore(&led_cdev->trigger->leddev_list_lock, flags);
+
+err_add_groups:
led_set_brightness(led_cdev, LED_OFF);
return ret;

View File

@ -1,24 +0,0 @@
From fd66884da2f96d2a7ea73f58b1b86251b959a913 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 7 Jul 2017 16:56:19 +0200
Subject: kernel: strip unnecessary symbol table information from kernel modules
reduces default squashfs size on ar71xx by about 4k
lede-commit: 058d331a39077f159ca8922f1f422a1346d6aa67
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/Makefile
+++ b/Makefile
@@ -427,7 +427,7 @@ KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
-KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
+KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s)
KBUILD_LDFLAGS :=
GCC_PLUGINS_CFLAGS :=

View File

@ -1,40 +0,0 @@
From 7f698012384ccb1ed10cc758acfd085096fdb307 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 7 Jul 2017 17:02:03 +0200
Subject: kernel: fix linux 4.9 host tools portability issues
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
tools/build/Build.include | 2 +-
tools/perf/pmu-events/jevents.c | 1 +
tools/perf/pmu-events/json.c | 1 -
3 files changed, 2 insertions(+), 2 deletions(-)
--- a/tools/build/Build.include
+++ b/tools/build/Build.include
@@ -98,4 +98,4 @@ cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$
###
## HOSTCC C flags
-host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(KBUILD_HOSTCFLAGS) -D"BUILD_STR(s)=\#s" $(HOSTCFLAGS_$(basetarget).o) $(HOSTCFLAGS_$(obj))
+host_c_flags = -MD -MF $(depfile) -MT $@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj))
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <errno.h>
#include <string.h>
+#include <strings.h>
#include <ctype.h>
#include <unistd.h>
#include <stdarg.h>
--- a/tools/perf/pmu-events/json.c
+++ b/tools/perf/pmu-events/json.c
@@ -38,7 +38,6 @@
#include <unistd.h>
#include "jsmn.h"
#include "json.h"
-#include <linux/kernel.h>
static char *mapfile(const char *fn, size_t *size)

View File

@ -0,0 +1,164 @@
From: Evan Green <evgreen@chromium.org>
Subject: [PATCH v5 0/2] loop: Better discard for block devices
Date: Mon, 6 May 2019 11:27:35 -0700
Message-Id: <20190506182736.21064-2-evgreen@chromium.org>
This series addresses some errors seen when using the loop
device directly backed by a block device.
The first change titled "loop: Better discard for block devices"
plumbs out the correct error message, and the second change prevents
the error from occurring in many cases.
The errors look like this:
[ 90.880875] print_req_error: I/O error, dev loop5, sector 0
The errors occur when trying to do a discard or write zeroes operation
on a loop device backed by a block device that does not support write zeroes.
Firstly, the error itself is incorrectly reported as I/O error, but is
actually EOPNOTSUPP. The first patch plumbs out EOPNOTSUPP to properly
report the error.
The second patch called "loop: Better discard support for block devices"
prevents these errors from occurring by mirroring the zeroing capabilities
of the underlying block device into the loop device.
Before this change, discard was always reported as being supported, and
the loop device simply turns around and does an fallocate operation on the
backing device. After this change, backing block devices that do support
zeroing will continue to work as before, and continue to get all the
benefits of doing that. Backing devices that do not support zeroing will
fail earlier, avoiding hitting the loop device at all and ultimately
avoiding this error in the logs.
I can also confirm that this fixes test block/003 in the blktests, when
running blktests on a loop device backed by a block device.
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -416,19 +416,14 @@ out_free_page:
return ret;
}
-static int lo_discard(struct loop_device *lo, struct request *rq, loff_t pos)
+static int lo_discard(struct loop_device *lo, struct request *rq,
+ int mode, loff_t pos)
{
- /*
- * We use punch hole to reclaim the free space used by the
- * image a.k.a. discard. However we do not support discard if
- * encryption is enabled, because it may give an attacker
- * useful information.
- */
struct file *file = lo->lo_backing_file;
- int mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE;
+ struct request_queue *q = lo->lo_queue;
int ret;
- if ((!file->f_op->fallocate) || lo->lo_encrypt_key_size) {
+ if (!blk_queue_discard(q)) {
ret = -EOPNOTSUPP;
goto out;
}
@@ -457,7 +452,9 @@ static void lo_complete_rq(struct reques
if (!cmd->use_aio || cmd->ret < 0 || cmd->ret == blk_rq_bytes(rq) ||
req_op(rq) != REQ_OP_READ) {
- if (cmd->ret < 0)
+ if (cmd->ret == -EOPNOTSUPP)
+ ret = BLK_STS_NOTSUPP;
+ else if (cmd->ret < 0)
ret = BLK_STS_IOERR;
goto end_io;
}
@@ -597,8 +594,13 @@ static int do_req_filebacked(struct loop
case REQ_OP_FLUSH:
return lo_req_flush(lo, rq);
case REQ_OP_DISCARD:
+ return lo_discard(lo, rq,
+ FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, pos);
+
case REQ_OP_WRITE_ZEROES:
- return lo_discard(lo, rq, pos);
+ return lo_discard(lo, rq,
+ FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE, pos);
+
case REQ_OP_WRITE:
if (lo->transfer)
return lo_write_transfer(lo, rq, pos);
@@ -853,6 +855,21 @@ static void loop_config_discard(struct l
struct file *file = lo->lo_backing_file;
struct inode *inode = file->f_mapping->host;
struct request_queue *q = lo->lo_queue;
+ struct request_queue *backingq;
+
+ /*
+ * If the backing device is a block device, mirror its zeroing
+ * capability. REQ_OP_DISCARD translates to a zero-out even when backed
+ * by block devices to keep consistent behavior with file-backed loop
+ * devices.
+ */
+ if (S_ISBLK(inode->i_mode) && !lo->lo_encrypt_key_size) {
+ backingq = bdev_get_queue(inode->i_bdev);
+ blk_queue_max_discard_sectors(q,
+ backingq->limits.max_write_zeroes_sectors);
+
+ blk_queue_max_write_zeroes_sectors(q,
+ backingq->limits.max_write_zeroes_sectors);
/*
* We use punch hole to reclaim the free space used by the
@@ -860,22 +877,24 @@ static void loop_config_discard(struct l
* encryption is enabled, because it may give an attacker
* useful information.
*/
- if ((!file->f_op->fallocate) ||
- lo->lo_encrypt_key_size) {
+ } else if ((!file->f_op->fallocate) || lo->lo_encrypt_key_size) {
q->limits.discard_granularity = 0;
q->limits.discard_alignment = 0;
blk_queue_max_discard_sectors(q, 0);
blk_queue_max_write_zeroes_sectors(q, 0);
- blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
- return;
- }
- q->limits.discard_granularity = inode->i_sb->s_blocksize;
- q->limits.discard_alignment = 0;
+ } else {
+ q->limits.discard_granularity = inode->i_sb->s_blocksize;
+ q->limits.discard_alignment = 0;
- blk_queue_max_discard_sectors(q, UINT_MAX >> 9);
- blk_queue_max_write_zeroes_sectors(q, UINT_MAX >> 9);
- blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ blk_queue_max_discard_sectors(q, UINT_MAX >> 9);
+ blk_queue_max_write_zeroes_sectors(q, UINT_MAX >> 9);
+ }
+
+ if (q->limits.max_write_zeroes_sectors)
+ blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ else
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
}
static void loop_unprepare_queue(struct loop_device *lo)
@@ -1894,7 +1913,10 @@ static void loop_handle_cmd(struct loop_
failed:
/* complete non-aio request */
if (!cmd->use_aio || ret) {
- cmd->ret = ret ? -EIO : 0;
+ if (ret == -EOPNOTSUPP)
+ cmd->ret = ret;
+ else
+ cmd->ret = ret ? -EIO : 0;
blk_mq_complete_request(rq);
}
}

View File

@ -1,4 +1,3 @@
From c6905cfdeb31a5c049db3da434b10fa0d3e83569 Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@nbd.name>
Date: Fri, 7 Jul 2017 17:18:54 +0200
Subject: bridge: only accept EAP locally
@ -7,9 +6,9 @@ When bridging, do not forward EAP frames to other ports, only deliver
them locally, regardless of the state.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[add disable_eap_hack sysfs attribute]
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
---
net/bridge/br_input.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@ -19,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ BR_INPUT_SKB_CB(skb)->brdev = br->dev;
+
+ if (skb->protocol == htons(ETH_P_PAE))
+ if (skb->protocol == htons(ETH_P_PAE) && !br->disable_eap_hack)
+ return br_pass_frame_up(skb);
+
if (p->state == BR_STATE_LEARNING)
@ -29,3 +28,55 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
BR_INPUT_SKB_CB(skb)->src_port_isolated = !!(p->flags & BR_ISOLATED);
if (IS_ENABLED(CONFIG_INET) &&
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -337,6 +337,8 @@ struct net_bridge {
u16 group_fwd_mask;
u16 group_fwd_mask_required;
+ bool disable_eap_hack;
+
/* STP */
bridge_id designated_root;
bridge_id bridge_id;
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -170,6 +170,30 @@ static ssize_t group_fwd_mask_store(stru
}
static DEVICE_ATTR_RW(group_fwd_mask);
+static ssize_t disable_eap_hack_show(struct device *d,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct net_bridge *br = to_bridge(d);
+ return sprintf(buf, "%u\n", br->disable_eap_hack);
+}
+
+static int set_disable_eap_hack(struct net_bridge *br, unsigned long val)
+{
+ br->disable_eap_hack = !!val;
+
+ return 0;
+}
+
+static ssize_t disable_eap_hack_store(struct device *d,
+ struct device_attribute *attr,
+ const char *buf,
+ size_t len)
+{
+ return store_bridge_parm(d, buf, len, set_disable_eap_hack);
+}
+static DEVICE_ATTR_RW(disable_eap_hack);
+
static ssize_t priority_show(struct device *d, struct device_attribute *attr,
char *buf)
{
@@ -810,6 +834,7 @@ static struct attribute *bridge_attrs[]
&dev_attr_ageing_time.attr,
&dev_attr_stp_state.attr,
&dev_attr_group_fwd_mask.attr,
+ &dev_attr_disable_eap_hack.attr,
&dev_attr_priority.attr,
&dev_attr_bridge_id.attr,
&dev_attr_root_id.attr,

View File

@ -0,0 +1,135 @@
From f171924dcf1d0b31fb7bd1cff113d7a1f7f05ec2 Mon Sep 17 00:00:00 2001
From: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Date: Sat, 23 Mar 2019 09:29:49 +0000
Subject: [PATCH] netfilter: connmark: introduce savedscp
savedscp is a method of storing the DSCP of an ip packet into conntrack
mark. In combination with a suitable tc filter action (act_ctinfo) DSCP
values are able to be stored in the mark on egress and restored on
ingress across links that otherwise alter or bleach DSCP.
This is useful for qdiscs such as CAKE which are able to shape according
to policies based on DSCP.
Ingress classification is traditionally a challenging task since
iptables rules haven't yet run and tc filter/eBPF programs are pre-NAT
lookups, hence are unable to see internal IPv4 addresses as used on the
typical home masquerading gateway.
x_tables CONNMARK savedscp action solves the problem of storing the DSCP
to the conntrack mark in a way suitable for the new act_ctinfo tc action
to restore.
The savedsp option accepts 2 parameters, a 32bit 'dscpmask' and a 32bit
'statemask'. The dscp mask must be a minimum of 6 contiguous bits and
represents the area where the DSCP will be stored in the connmark. The
state mask is a minimum 1 bit length mask that must not overlap with the
dscpmask. It represents a flag which is set when the DSCP has been
stored in the conntrack mark. This is useful to implement a 'one shot'
iptables based classification where the 'complicated' iptables rules are
only run once to classify the connection on initial (egress) packet and
subsequent packets are all marked/restored with the same DSCP. A state
mask of zero disables the setting of a status bit/s.
example syntax with a suitably modified iptables user space application:
iptables -A QOS_MARK_eth0 -t mangle -j CONNMARK --savedscp-mark 0xfc000000/0x01000000
Would store the DSCP in the top 6 bits of the 32bit mark field, and use
the LSB of the top byte as the 'DSCP has been stored' marker.
|----0xFC----conntrack mark----000000---|
| Bits 31-26 | bit 25 | bit24 |~~~ Bit 0|
| DSCP | unused | flag |unused |
|-----------------------0x01---000000---|
^ ^
| |
---| Conditional flag
| set this when dscp
|-ip diffserv-| stored in mark
| 6 bits |
|-------------|
an identically configured tc action to restore looks like:
tc filter show dev eth0 ingress
filter parent ffff: protocol all pref 10 u32 chain 0
filter parent ffff: protocol all pref 10 u32 chain 0 fh 800: ht divisor 1
filter parent ffff: protocol all pref 10 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1 not_in_hw
match 00000000/00000000 at 0
action order 1: ctinfo zone 0 pipe
index 2 ref 1 bind 1 dscp 0xfc000000/0x1000000
action order 2: mirred (Egress Redirect to device ifb4eth0) stolen
index 1 ref 1 bind 1
|----0xFC----conntrack mark----000000---|
| Bits 31-26 | bit 25 | bit24 |~~~ Bit 0|
| DSCP | unused | flag |unused |
|-----------------------0x01---000000---|
| |
| |
---| Conditional flag
v only restore if set
|-ip diffserv-|
| 6 bits |
|-------------|
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
---
include/uapi/linux/netfilter/xt_connmark.h | 3 ++-
net/netfilter/xt_connmark.c | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
--- a/include/uapi/linux/netfilter/xt_connmark.h
+++ b/include/uapi/linux/netfilter/xt_connmark.h
@@ -16,7 +16,8 @@
enum {
XT_CONNMARK_SET = 0,
XT_CONNMARK_SAVE,
- XT_CONNMARK_RESTORE
+ XT_CONNMARK_RESTORE,
+ XT_CONNMARK_SAVEDSCP
};
enum {
--- a/net/netfilter/xt_connmark.c
+++ b/net/netfilter/xt_connmark.c
@@ -42,6 +42,7 @@ connmark_tg_shift(struct sk_buff *skb, c
u_int32_t new_targetmark;
struct nf_conn *ct;
u_int32_t newmark;
+ u_int8_t dscp;
ct = nf_ct_get(skb, &ctinfo);
if (ct == NULL)
@@ -74,6 +75,21 @@ connmark_tg_shift(struct sk_buff *skb, c
nf_conntrack_event_cache(IPCT_MARK, ct);
}
break;
+ case XT_CONNMARK_SAVEDSCP:
+ if (skb->protocol == htons(ETH_P_IP))
+ dscp = ipv4_get_dsfield(ip_hdr(skb)) >> 2;
+ else if (skb->protocol == htons(ETH_P_IPV6))
+ dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> 2;
+ else /* protocol doesn't have diffserv */
+ break;
+
+ newmark = (ct->mark & ~info->ctmark) |
+ (info->ctmask | (dscp << info->shift_bits));
+ if (ct->mark != newmark) {
+ ct->mark = newmark;
+ nf_conntrack_event_cache(IPCT_MARK, ct);
+ }
+ break;
case XT_CONNMARK_RESTORE:
new_targetmark = (ct->mark & info->ctmask);
if (info->shift_dir == D_SHIFT_RIGHT)
@@ -86,6 +102,7 @@ connmark_tg_shift(struct sk_buff *skb, c
skb->mark = newmark;
break;
}
+out:
return XT_CONTINUE;
}

View File

@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
device, it has to decide which ones to send first, which ones to
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -2157,7 +2157,7 @@ static int __init pktsched_init(void)
@@ -2160,7 +2160,7 @@ static int __init pktsched_init(void)
return err;
}

View File

@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = __sk_dst_get(sk);
@@ -1598,9 +1610,11 @@ static void __sk_free(struct sock *sk)
@@ -1603,9 +1615,11 @@ static void __sk_free(struct sock *sk)
if (likely(sk->sk_net_refcnt))
sock_inuse_add(sock_net(sk), -1);

View File

@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3480,6 +3480,8 @@ static __net_initdata struct pernet_oper
@@ -3485,6 +3485,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{

View File

@ -41,7 +41,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
obj-$(CONFIG_PROC_FS) += net-procfs.o
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1458,9 +1458,11 @@ void sk_destruct(struct sock *sk)
@@ -1463,9 +1463,11 @@ void sk_destruct(struct sock *sk)
static void __sk_free(struct sock *sk)
{

View File

@ -328,7 +328,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3088,6 +3088,8 @@ static __net_initdata struct pernet_oper
@@ -3093,6 +3093,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{

View File

@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -39,20 +39,22 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y)
@@ -42,20 +42,22 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y)
include $(obj)/$(datafile_d_y)
endif

View File

@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
1 file changed, 1 insertion(+)
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1833,6 +1833,7 @@ static int __xipram do_write_buffer(stru
@@ -1839,6 +1839,7 @@ static int __xipram do_write_buffer(stru
/* Write Buffer Load */
map_write(map, CMD(0x25), cmd_adr);

View File

@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -39,20 +39,22 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y)
@@ -42,20 +42,22 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y)
include $(obj)/$(datafile_d_y)
endif

View File

@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1455,7 +1455,7 @@ static int spi_nor_write(struct mtd_info
@@ -1457,7 +1457,7 @@ static int spi_nor_write(struct mtd_info
write_enable(nor);
ret = nor->write(nor, addr, page_remain, buf + i);
@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
goto write_err;
written = ret;
@@ -1464,13 +1464,6 @@ static int spi_nor_write(struct mtd_info
@@ -1466,13 +1466,6 @@ static int spi_nor_write(struct mtd_info
goto write_err;
*retlen += written;
i += written;

View File

@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
1 file changed, 1 insertion(+)
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1832,6 +1832,7 @@ static int __xipram do_write_buffer(stru
@@ -1838,6 +1838,7 @@ static int __xipram do_write_buffer(stru
/* Write Buffer Load */
map_write(map, CMD(0x25), cmd_adr);

View File

@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -2733,6 +2733,7 @@ static int spi_nor_init(struct spi_nor *
@@ -2735,6 +2735,7 @@ static int spi_nor_init(struct spi_nor *
*/
if (JEDEC_MFR(nor->info) == SNOR_MFR_ATMEL ||
JEDEC_MFR(nor->info) == SNOR_MFR_INTEL ||

View File

@ -17,7 +17,7 @@ Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -2735,6 +2735,7 @@ static int spi_nor_init(struct spi_nor *
@@ -2737,6 +2737,7 @@ static int spi_nor_init(struct spi_nor *
JEDEC_MFR(nor->info) == SNOR_MFR_INTEL ||
JEDEC_MFR(nor->info) == SNOR_MFR_MACRONIX ||
JEDEC_MFR(nor->info) == SNOR_MFR_SST ||
@ -25,7 +25,7 @@ Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
nor->info->flags & SPI_NOR_HAS_LOCK) {
write_enable(nor);
write_sr(nor, 0);
@@ -2871,7 +2872,8 @@ int spi_nor_scan(struct spi_nor *nor, co
@@ -2873,7 +2874,8 @@ int spi_nor_scan(struct spi_nor *nor, co
/* NOR protection support for STmicro/Micron chips and similar */
if (JEDEC_MFR(info) == SNOR_MFR_MICRON ||

View File

@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
depends on ARCH_AT91 || (ARM && COMPILE_TEST && !ARCH_EBSA110)
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -2647,10 +2647,12 @@ static int spi_nor_select_erase(struct s
@@ -2649,10 +2649,12 @@ static int spi_nor_select_erase(struct s
#ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
/* prefer "small sector" erase if possible */

View File

@ -20,7 +20,7 @@ Changes in v2:
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1239,6 +1239,11 @@ static const struct flash_info spi_nor_i
@@ -1241,6 +1241,11 @@ static const struct flash_info spi_nor_i
SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB)
},

View File

@ -1,95 +0,0 @@
From: John Crispin <john@phrozen.org>
Subject: net: phy: add phy_ethtool_ioctl()
Signed-off-by: John Crispin <john@phrozen.org>
---
drivers/net/phy/phy.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
include/linux/phy.h | 1 +
2 files changed, 45 insertions(+)
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -382,6 +382,73 @@ void phy_ethtool_ksettings_get(struct ph
}
EXPORT_SYMBOL(phy_ethtool_ksettings_get);
+static int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd)
+{
+ cmd->supported = phydev->supported;
+
+ cmd->advertising = phydev->advertising;
+ cmd->lp_advertising = phydev->lp_advertising;
+
+ ethtool_cmd_speed_set(cmd, phydev->speed);
+ cmd->duplex = phydev->duplex;
+ if (phydev->interface == PHY_INTERFACE_MODE_MOCA)
+ cmd->port = PORT_BNC;
+ else
+ cmd->port = PORT_MII;
+ cmd->phy_address = phydev->mdio.addr;
+ cmd->transceiver = phy_is_internal(phydev) ?
+ XCVR_INTERNAL : XCVR_EXTERNAL;
+ cmd->autoneg = phydev->autoneg;
+ cmd->eth_tp_mdix_ctrl = phydev->mdix_ctrl;
+ cmd->eth_tp_mdix = phydev->mdix;
+
+ return 0;
+}
+
+int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr)
+{
+ u32 cmd;
+ int tmp;
+ struct ethtool_cmd ecmd = { ETHTOOL_GSET };
+ struct ethtool_value edata = { ETHTOOL_GLINK };
+
+ if (get_user(cmd, (u32 *) useraddr))
+ return -EFAULT;
+
+ switch (cmd) {
+ case ETHTOOL_GSET:
+ phy_ethtool_gset(phydev, &ecmd);
+ if (copy_to_user(useraddr, &ecmd, sizeof(ecmd)))
+ return -EFAULT;
+ return 0;
+
+ case ETHTOOL_SSET:
+ if (copy_from_user(&ecmd, useraddr, sizeof(ecmd)))
+ return -EFAULT;
+ return phy_ethtool_sset(phydev, &ecmd);
+
+ case ETHTOOL_NWAY_RST:
+ /* if autoneg is off, it's an error */
+ tmp = phy_read(phydev, MII_BMCR);
+ if (tmp & BMCR_ANENABLE) {
+ tmp |= (BMCR_ANRESTART);
+ phy_write(phydev, MII_BMCR, tmp);
+ return 0;
+ }
+ return -EINVAL;
+
+ case ETHTOOL_GLINK:
+ edata.data = (phy_read(phydev,
+ MII_BMSR) & BMSR_LSTATUS) ? 1 : 0;
+ if (copy_to_user(useraddr, &edata, sizeof(edata)))
+ return -EFAULT;
+ return 0;
+ }
+
+ return -EOPNOTSUPP;
+}
+EXPORT_SYMBOL(phy_ethtool_ioctl);
+
/**
* phy_mii_ioctl - generic PHY MII ioctl interface
* @phydev: the phy_device struct
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1045,6 +1045,7 @@ void phy_ethtool_ksettings_get(struct ph
struct ethtool_link_ksettings *cmd);
int phy_ethtool_ksettings_set(struct phy_device *phydev,
const struct ethtool_link_ksettings *cmd);
+int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr);
int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
int phy_start_interrupts(struct phy_device *phydev);
void phy_print_status(struct phy_device *phydev);

View File

@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
1 file changed, 1 insertion(+)
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1829,6 +1829,7 @@ static int __xipram do_write_buffer(stru
@@ -1835,6 +1835,7 @@ static int __xipram do_write_buffer(stru
/* Write Buffer Load */
map_write(map, CMD(0x25), cmd_adr);

View File

@ -497,7 +497,7 @@ Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
.name = "sdhci-esdhc",
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2148,7 +2148,7 @@ static void sdhci_send_tuning(struct sdh
@@ -2150,7 +2150,7 @@ static void sdhci_send_tuning(struct sdh
}
@ -506,7 +506,7 @@ Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
{
int i;
@@ -2165,13 +2165,13 @@ static void __sdhci_execute_tuning(struc
@@ -2167,13 +2167,13 @@ static void __sdhci_execute_tuning(struc
pr_info("%s: Tuning timeout, falling back to fixed sampling clock\n",
mmc_hostname(host->mmc));
sdhci_abort_tuning(host, opcode);
@ -522,7 +522,7 @@ Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
break;
}
@@ -2183,6 +2183,7 @@ static void __sdhci_execute_tuning(struc
@@ -2185,6 +2185,7 @@ static void __sdhci_execute_tuning(struc
pr_info("%s: Tuning failed, falling back to fixed sampling clock\n",
mmc_hostname(host->mmc));
sdhci_reset_tuning(host);
@ -530,7 +530,7 @@ Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
}
int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
@@ -2244,7 +2245,7 @@ int sdhci_execute_tuning(struct mmc_host
@@ -2246,7 +2247,7 @@ int sdhci_execute_tuning(struct mmc_host
sdhci_start_tuning(host);

View File

@ -28,7 +28,7 @@ Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1925,6 +1925,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
@@ -1926,6 +1926,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
The command-line arguments provided by the boot loader will be
appended to the the device tree bootargs property.

View File

@ -16,11 +16,6 @@
led-upgrade = &led_blue;
};
memory@0 {
device_type = "memory";
reg = <0x0 0x8000000>;
};
chosen {
bootargs = "console=ttyS0,57600";
};

View File

@ -44,7 +44,7 @@ Subject: [PATCH 37/53] mtd: cfi cmdset 0002 force word write
/* Atmel chips don't use the same PRI format as AMD chips */
static void fixup_convert_atmel_pri(struct mtd_info *mtd)
@@ -1792,6 +1796,7 @@ static int cfi_amdstd_write_words(struct
@@ -1798,6 +1802,7 @@ static int cfi_amdstd_write_words(struct
/*
* FIXME: interleaved mode not tested, and probably not supported!
*/
@ -52,7 +52,7 @@ Subject: [PATCH 37/53] mtd: cfi cmdset 0002 force word write
static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const u_char *buf,
int len)
@@ -1920,7 +1925,6 @@ static int __xipram do_write_buffer(stru
@@ -1926,7 +1931,6 @@ static int __xipram do_write_buffer(stru
return ret;
}
@ -60,7 +60,7 @@ Subject: [PATCH 37/53] mtd: cfi cmdset 0002 force word write
static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
@@ -1995,6 +1999,7 @@ static int cfi_amdstd_write_buffers(stru
@@ -2001,6 +2005,7 @@ static int cfi_amdstd_write_buffers(stru
return 0;
}

View File

@ -0,0 +1,125 @@
From b5a52351a66f3c2a7a207548aa87d78ff2d336c0 Mon Sep 17 00:00:00 2001
From: Chuanhong Guo <gch981213@gmail.com>
Date: Wed, 10 Jul 2019 00:24:48 +0800
Subject: [PATCH] MIPS: ralink: mt7621: add memory detection support
mt7621 has the following memory map:
0x0-0x1c000000: lower 448m memory
0x1c000000-0x2000000: peripheral registers
0x20000000-0x2400000: higher 64m memory
detect_memory_region in arch/mips/kernel/setup.c only add the first
memory region and isn't suitable for 512m memory detection because
it may accidentally read the memory area for peripheral registers.
This commit adds memory detection capability for mt7621:
1. add the highmem area when 512m is detected.
2. guard memcmp from accessing peripheral registers:
This only happens when some weird user decided to change
kernel load address to 256m or higher address. Since this
is a quite unusual case, we just skip 512m testing and return
256m as memory size.
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
---
arch/mips/include/asm/mach-ralink/mt7621.h | 7 ++---
arch/mips/ralink/mt7621.c | 30 +++++++++++++++++++---
2 files changed, 30 insertions(+), 7 deletions(-)
--- a/arch/mips/include/asm/mach-ralink/mt7621.h
+++ b/arch/mips/include/asm/mach-ralink/mt7621.h
@@ -46,9 +46,10 @@
#define CPU_PLL_FBDIV_MASK 0x7f
#define CPU_PLL_FBDIV_SHIFT 4
-#define MT7621_DRAM_BASE 0x0
-#define MT7621_DDR2_SIZE_MIN 32
-#define MT7621_DDR2_SIZE_MAX 256
+#define MT7621_LOWMEM_BASE 0x0
+#define MT7621_LOWMEM_MAX_SIZE 0x1C000000
+#define MT7621_HIGHMEM_BASE 0x20000000
+#define MT7621_HIGHMEM_SIZE 0x4000000
#define MT7621_CHIP_NAME0 0x3637544D
#define MT7621_CHIP_NAME1 0x20203132
--- a/arch/mips/ralink/mt7621.c
+++ b/arch/mips/ralink/mt7621.c
@@ -15,6 +15,7 @@
#include <linux/clk-provider.h>
#include <dt-bindings/clock/mt7621-clk.h>
+#include <asm/bootinfo.h>
#include <asm/mipsregs.h>
#include <asm/smp-ops.h>
#include <asm/mips-cps.h>
@@ -57,6 +58,8 @@
#define MT7621_GPIO_MODE_SDHCI_SHIFT 18
#define MT7621_GPIO_MODE_SDHCI_GPIO 1
+static void *detect_magic __initdata = detect_memory_region;
+
static struct rt2880_pmx_func uart1_grp[] = { FUNC("uart1", 0, 1, 2) };
static struct rt2880_pmx_func i2c_grp[] = { FUNC("i2c", 0, 3, 2) };
static struct rt2880_pmx_func uart3_grp[] = {
@@ -141,6 +144,28 @@ static struct clk *__init mt7621_add_sys
return clk;
}
+void __init mt7621_memory_detect(void)
+{
+ void *dm = &detect_magic;
+ phys_addr_t size;
+
+ for (size = 32 * SZ_1M; size < 256 * SZ_1M; size <<= 1) {
+ if (!memcmp(dm, dm + size, sizeof(detect_magic)))
+ break;
+ }
+
+ if ((size == 256 * SZ_1M) &&
+ (CPHYSADDR(dm + size) < MT7621_LOWMEM_MAX_SIZE) &&
+ memcmp(dm, dm + size, sizeof(detect_magic))) {
+ add_memory_region(MT7621_LOWMEM_BASE, MT7621_LOWMEM_MAX_SIZE,
+ BOOT_MEM_RAM);
+ add_memory_region(MT7621_HIGHMEM_BASE, MT7621_HIGHMEM_SIZE,
+ BOOT_MEM_RAM);
+ } else {
+ add_memory_region(MT7621_LOWMEM_BASE, size, BOOT_MEM_RAM);
+ }
+}
+
void __init ralink_clk_init(void)
{
u32 syscfg, xtal_sel, clkcfg, clk_sel, curclk, ffiv, ffrac;
@@ -319,10 +344,7 @@ void prom_soc_init(struct ralink_soc_inf
(rev >> CHIP_REV_VER_SHIFT) & CHIP_REV_VER_MASK,
(rev & CHIP_REV_ECO_MASK));
- soc_info->mem_size_min = MT7621_DDR2_SIZE_MIN;
- soc_info->mem_size_max = MT7621_DDR2_SIZE_MAX;
- soc_info->mem_base = MT7621_DRAM_BASE;
-
+ soc_info->mem_detect = mt7621_memory_detect;
rt2880_pinmux_data = mt7621_pinmux_data;
--- a/arch/mips/ralink/common.h
+++ b/arch/mips/ralink/common.h
@@ -19,6 +19,7 @@ struct ralink_soc_info {
unsigned long mem_size;
unsigned long mem_size_min;
unsigned long mem_size_max;
+ void (*mem_detect)(void);
};
extern struct ralink_soc_info soc_info;
--- a/arch/mips/ralink/of.c
+++ b/arch/mips/ralink/of.c
@@ -89,6 +89,8 @@ void __init plat_mem_setup(void)
of_scan_flat_dt(early_init_dt_find_memory, NULL);
if (memory_dtb)
of_scan_flat_dt(early_init_dt_scan_memory, NULL);
+ else if (soc_info.mem_detect)
+ soc_info.mem_detect();
else if (soc_info.mem_size)
add_memory_region(soc_info.mem_base, soc_info.mem_size * SZ_1M,
BOOT_MEM_RAM);

View File

@ -13,19 +13,19 @@ FEATURES:=squashfs vdi vmdk pcmcia fpu
SUBTARGETS:=64 generic legacy geode
MAINTAINER:=Felix Fietkau <nbd@nbd.name>
KERNEL_PATCHVER:=4.19
KERNEL_PATCHVER:=4.9
KERNELNAME:=bzImage
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += partx-utils mkf2fs fdisk e2fsprogs wpad kmod-usb-hid \
kmod-ath5k kmod-ath9k kmod-ath9k-htc kmod-ath10k kmod-rt2800-usb kmod-e1000e kmod-igb kmod-igbvf kmod-ixgbe kmod-pcnet32 kmod-tulip kmod-vmxnet3 kmod-i40e kmod-i40evf \
htop lm-sensors autocore automount autosamba luci-app-zerotier luci-app-ipsec-vpnd luci-app-pptp-server luci-proto-bonding luci-app-zerotier \
kmod-ath5k kmod-ath9k kmod-ath9k-htc kmod-ath10k kmod-rt2800-usb kmod-e1000e kmod-igb kmod-igbvf kmod-ixgbe kmod-pcnet32 kmod-tulip kmod-vmxnet3 kmod-i40e kmod-i40evf kmod-fs-f2fs \
htop lm-sensors autocore automount autosamba luci-app-zerotier luci-app-ipsec-vpnd luci-app-pptp-server luci-proto-bonding luci-app-zerotier luci-app-unblockmusic luci-app-docker \
ath10k-firmware-qca988x ath10k-firmware-qca9888 ath10k-firmware-qca9984 brcmfmac-firmware-43602a1-pcie intel-microcode amd64-microcode\
alsa-utils kmod-ac97 kmod-sound-hda-core kmod-sound-hda-codec-realtek kmod-sound-hda-codec-via kmod-sound-via82xx kmod-usb-audio \
kmod-usb-net kmod-usb-net-asix kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8150 kmod-usb-net-rtl8152 \
shadowsocks-libev-ss-redir v2ray shadowsocksr-libev-server shadowsocksr-libev-ssr-local
shadowsocks-libev-ss-redir v2ray shadowsocksr-libev-server shadowsocksr-libev-ssr-local dsmboot cfdisk
$(eval $(call BuildTarget))

View File

@ -0,0 +1,9 @@
#!/bin/sh
echo "n
p
3
w
" | fdisk /dev/sda && mkfs.ext4 /dev/sda3

View File

@ -0,0 +1,3 @@
#!/bin/sh
docker run -d --restart=always --name="portainer" -p 9999:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

View File

@ -26,4 +26,4 @@ non Linux hosts.
+#endif
#define __packed __attribute__((packed))