diff --git a/README.md b/README.md index 91bbc33594..71cb7eb0a4 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Has access to both ChinaNet & Internet ```bash sudo apt-get update -y sudo apt-get full-upgrade -y -sudo apt-get install -y build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libreadline-dev libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint ccache curl wget vim nano python python3 python-pip python3-pip python-ply python3-ply haveged lrzsz device-tree-compiler scons antlr3 gperf ecj fastjar +sudo apt-get install -y build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libreadline-dev libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint ccache curl wget vim nano python python3 python-pip python3-pip python-ply python3-ply haveged lrzsz device-tree-compiler scons antlr3 gperf intltool ``` #### For mainland China & Ubuntu(16.04+) user, you may run the following command to setup quickly: ```bash @@ -24,7 +24,7 @@ sudo bash -c "bash <(curl -s https://build-scripts.project-openwrt.eu.org/init_b ## Clone the source ```bash -git clone -b openwrt-18.06 --single-branch https://github.com/project-openwrt/openwrt && cd openwrt +git clone -b 18.06-kernel5.4 --single-branch https://github.com/project-openwrt/openwrt && cd openwrt ./scripts/feeds update -a && ./scripts/feeds install -a ``` #### For developer, you may use `openwrt-18.06-dev` branch instead of `openwrt-18.06`. diff --git a/include/download.mk b/include/download.mk index 14d68bf8f5..9c8ada052b 100644 --- a/include/download.mk +++ b/include/download.mk @@ -50,6 +50,7 @@ endef dl_pack/bz2=bzip2 -c > $(1) dl_pack/gz=gzip -nc > $(1) dl_pack/xz=xz -zc -7e > $(1) +dl_pack/zst=zstd -T0 --ultra -20 -c > $(1) dl_pack/unknown=$(error ERROR: Unknown pack format for file $(1)) define dl_pack $(if $(dl_pack/$(call ext,$(1))),$(dl_pack/$(call ext,$(1))),$(dl_pack/unknown)) diff --git a/include/kernel-build.mk b/include/kernel-build.mk index b1d3fc07fd..7108ee10f1 100644 --- a/include/kernel-build.mk +++ b/include/kernel-build.mk @@ -70,7 +70,7 @@ ifdef CONFIG_COLLECT_KERNEL_DEBUG $(FIND) $(KERNEL_BUILD_DIR)/debug -type f | $(XARGS) $(KERNEL_CROSS)strip --only-keep-debug $(TAR) c -C $(KERNEL_BUILD_DIR) debug \ $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \ - | bzip2 -c -9 > $(BIN_DIR)/kernel-debug.tar.bz2 + | zstd -T0 -f -o $(BIN_DIR)/kernel-debug.tar.zst endef endif diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 5579d49515..92342cb131 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,14 +6,14 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-4.9 = .224 -LINUX_VERSION-4.14 = .181 -LINUX_VERSION-4.19 = .124 +LINUX_VERSION-4.9 = .225 +LINUX_VERSION-4.14 = .182 +LINUX_VERSION-4.19 = .125 LINUX_VERSION-5.4 = .43 -LINUX_KERNEL_HASH-4.9.224 = df6d07e99513f9afadd7d44c471f44c56fccc9e4c984a1ba4b988f053a13c949 -LINUX_KERNEL_HASH-4.14.181 = ab9bea577cfe59fb2f502ce4d6130bfb49163ef969364adc3d36a65721d64a4d -LINUX_KERNEL_HASH-4.19.124 = d5d9001879d7a77309dca203656490326d26b068b7b0b9d8003548dba8fdad00 +LINUX_KERNEL_HASH-4.9.225 = e547748c548b0f55f665bc78cfec322e7b96f41527b5e4b5d79430fdaa57c3e8 +LINUX_KERNEL_HASH-4.14.182 = 671d1f1d5ad0ae74fb21ee70a5544400e7d6270098d3f8b134484ded2c3e5b90 +LINUX_KERNEL_HASH-4.19.125 = 9843f40efb37491770688810d153d0779daed8eb097773a0de5abf2cb0d1bd7e LINUX_KERNEL_HASH-5.4.43 = 2667b90a42d42557aca9e3d37bba1b4e71809b9523958e6870ada311c4790744 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 885ed77250..6bdc869394 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -51,10 +51,12 @@ $(eval $(call TestHostCommand,working-g++, \ g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \ $(TMP_DIR)/a.out)) +ifndef IB $(eval $(call TestHostCommand,ncurses, \ Please install ncurses. (Missing libncurses.so or ncurses.h), \ echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \ gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses)) +endif ifeq ($(HOST_OS),Linux) zlib_link_flags := -Wl,-Bstatic -lz -Wl,-Bdynamic @@ -62,6 +64,10 @@ else zlib_link_flags := -lz endif +$(eval $(call TestHostCommand,perl-data-dumper, \ + Please install the Perl Data::Dumper module, \ + perl -MData::Dumper -e 1)) + $(eval $(call TestHostCommand,perl-thread-queue, \ Please install the Perl Thread::Queue module, \ perl -MThread::Queue -e 1)) diff --git a/include/unpack.mk b/include/unpack.mk index 6141b1c722..5bb27d41c9 100644 --- a/include/unpack.mk +++ b/include/unpack.mk @@ -31,6 +31,10 @@ ifeq ($(strip $(UNPACK_CMD)),) EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=)) DECOMPRESS_CMD:=xzcat $(DL_DIR)/$(PKG_SOURCE) | endif + ifeq (zst,$(EXT)) + EXT:=$(call ext,$(PKG_SOURCE:.$(EXT)=)) + DECOMPRESS_CMD:=zstdcat $(DL_DIR)/$(PKG_SOURCE) | + endif ifeq ($(filter tgz tbz tbz2 txz,$(EXT1)),$(EXT1)) EXT:=tar endif diff --git a/package/ctcgfw/openwrt-v2ray-plugin/Makefile b/package/ctcgfw/openwrt-v2ray-plugin/Makefile index 5506183e17..8111b4e335 100644 --- a/package/ctcgfw/openwrt-v2ray-plugin/Makefile +++ b/package/ctcgfw/openwrt-v2ray-plugin/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray-plugin -PKG_VERSION:=1.3.0 +PKG_VERSION:=1.3.1 PKG_RELEASE:=2 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/shadowsocks/v2ray-plugin/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=dfb86cd8d9be86e665c4b86b68cd7037e4310de001656eef01ec9aeea71edd10 +PKG_HASH:=86d37a8ecef82457b4750a1af9e8d093b25ae0d32ea7dcc2ad5c0068fe2d3d74 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 1c045b1791..15712534f3 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -299,6 +299,24 @@ endef $(eval $(call KernelPackage,gpio-pcf857x)) +define KernelPackage/gpio-it87 + SUBMENU:=$(OTHER_MENU) + DEPENDS:=@GPIO_SUPPORT @TARGET_x86 + TITLE:=GPIO support for IT87xx Super I/O chips + KCONFIG:=CONFIG_GPIO_IT87 + FILES:=$(LINUX_DIR)/drivers/gpio/gpio-it87.ko + AUTOLOAD:=$(call AutoLoad,25,gpio-it87,1) +endef + +define KernelPackage/gpio-it87/description + This driver is tested with ITE IT8728 and IT8732 Super I/O chips, and + supports the IT8761E, IT8613, IT8620E, and IT8628E Super I/O chips as + well. +endef + +$(eval $(call KernelPackage,gpio-it87)) + + define KernelPackage/ppdev SUBMENU:=$(OTHER_MENU) TITLE:=Parallel port support diff --git a/package/lean/UnblockNeteaseMusic-Go/files/server.crt b/package/lean/UnblockNeteaseMusic-Go/files/server.crt index b58111aee7..b9025514d2 100644 --- a/package/lean/UnblockNeteaseMusic-Go/files/server.crt +++ b/package/lean/UnblockNeteaseMusic-Go/files/server.crt @@ -1,8 +1,8 @@ -----BEGIN CERTIFICATE----- -MIIDfTCCAmWgAwIBAgIJAKTlW9B59i1HMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV +MIIDkjCCAnqgAwIBAgIJAK/bIUIlE36LMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV BAYTAkNOMSQwIgYDVQQDDBtVbmJsb2NrTmV0ZWFzZU11c2ljIFJvb3QgQ0ExHTAb -BgNVBAoMFEdpdEh1Yi5jb20gQG5vbmRhbmVlMB4XDTE5MDUxODE2MDYxOFoXDTIw -MDUxNzE2MDYxOFowezELMAkGA1UEBhMCQ04xETAPBgNVBAcMCEhhbmd6aG91MSww +BgNVBAoMFEdpdEh1Yi5jb20gQG5vbmRhbmVlMB4XDTIwMDUxNjE3MTIxM1oXDTIx +MDUxNjE3MTIxM1owezELMAkGA1UEBhMCQ04xETAPBgNVBAcMCEhhbmd6aG91MSww KgYDVQQKDCNOZXRFYXNlIChIYW5nemhvdSkgTmV0d29yayBDby4sIEx0ZDERMA8G A1UECwwISVQgRGVwdC4xGDAWBgNVBAMMDyoubXVzaWMuMTYzLmNvbTCCASIwDQYJ KoZIhvcNAQEBBQADggEPADCCAQoCggEBALobECypwEoe8VqM/FJvBRR3p2T+ZWdi @@ -10,12 +10,13 @@ MSPrwfiRJr5p7OMtWBlLveCBV85+R3feidYbQTXlvVTdToY+GN6mFE1x6zG2dvLD s4UuRnipmvGcFYhIRTX8J4AJiN8VMtW0TNXscRMudpz/FAVtsRrggRaThYg4f/rI oAPMqKMsS4JoYhxs9ED6E6/tpj3XmSg1ekaXhgacYSYHeyxizZwoOFVCLH3TG5sF sD6CYNnukYol8bR+VRpvHftIYss5Yz+DyyhYEAMJm1CfQo+xoGR3D0ozbT3hUnzm -fEoOhmSp3sALrFVE4iJSuajoh2/3xhmcyi3xZdWyq4F8hpb+URyaoW0CAwEAAaMt -MCswKQYDVR0RBCIwIIINbXVzaWMuMTYzLmNvbYIPKi5tdXNpYy4xNjMuY29tMA0G -CSqGSIb3DQEBCwUAA4IBAQB32SVz5jHUYv3ZG7SNF/LFJ904/LI8QlTe9R+Abb9z -bpXmQeo4pvNNOk3LgcTyuSIPQSHEFn32hk/MedB6Q2cKaGVKQq7Usne1jsV0JirG -wMx3PTcKPnX+XexRY8s6v6cNKSx5YlMQNFeH7p8MgKqdM/UX/dNCxT04X/ClmP1K -/rKqonXn4i3wmWprl7Q7Z1wqt0ygQRkNJKqdYKTu4oQcPON8/dRcseYdJzSoK2/G -H6cOJwKrRLzuUqQlphe6wyUsyTIbIJiFu1a1Gml6zB4lhLZhL89H2lYwdS8wWlc+ -M+wYi+XTM/ylNHEIoKsOe2nscnwi/hTfHJOPPchHbEuM +fEoOhmSp3sALrFVE4iJSuajoh2/3xhmcyi3xZdWyq4F8hpb+URyaoW0CAwEAAaNC +MEAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwKQYDVR0RBCIwIIINbXVzaWMuMTYzLmNv +bYIPKi5tdXNpYy4xNjMuY29tMA0GCSqGSIb3DQEBCwUAA4IBAQB+zW0o1169aGQI +7GA/8BQ769svpkpdy/lfvkokapFjzoxLTBQhjMo9rqzmGOwr9ksePwQqSDXn685W +mKnEl0CzhBrKnL5x3gHus8bg591xpW+01xAFXSyLITOfMJqMEdY7ylymkm0XZ3aN +vm+yFdP1fr/bZNw6Wrprg3i7eGhj7TdBXRA96usVgBcnCkC1SzEZfnDZsKl9o8Xx +TSOpvzIMSaD7++Bp7BdzA5oCCydv2c++zV/sgCPIr26Jq8UQac+qQP5SMlYyGbAl +vIQRRZyfQ4fPonYDnEPHWFCMyBkQIN39LMhDRsUgn8bT0rnP91xkNAd9S4VWbNDA +5TMiQy3F -----END CERTIFICATE----- diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index 36023155c3..49a7444df4 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -9,31 +9,50 @@ include $(TOPDIR)/rules.mk PKG_NAME:=autocore PKG_VERSION:=1 -PKG_RELEASE:=31 +PKG_RELEASE:=32 include $(INCLUDE_DIR)/package.mk -define Package/autocore +define Package/autocore-raspberrypi + TITLE:=RaspberryPi auto core loadbalance script. + MAINTAINER:=CN_SZTL + DEPENDS:=@TARGET_bcm27xx +bcm27xx-userland +endef + +define Package/autocore-x86 TITLE:=x86/x64 auto core loadbalance script. MAINTAINER:=Lean DEPENDS:=@TARGET_x86 +bc +lm-sensors +ethtool endef define Package/autocore/description -A usb autoconfig hotplug script. + A usb autoconfig hotplug script. endef +Package/autocore-x86/description = $(call Package/autocore/description) +Package/autocore-raspberrypi/description = $(call Package/autocore/description) + define Build/Compile endef -define Package/autocore/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/autocore $(1)/etc/init.d/autocore +define Package/autocore-raspberrypi/install $(INSTALL_DIR) $(1)/etc - $(INSTALL_DATA) ./files/index.htm $(1)/etc/index.htm + $(INSTALL_DATA) ./files/raspberrypi/index.htm $(1)/etc/index.htm + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/raspberrypi/090-cover-index_htm $(1)/etc/uci-defaults/090-cover-index_htm $(INSTALL_DIR) $(1)/sbin - $(CP) ./files/sbin/* $(1)/sbin + $(CP) ./files/raspberrypi/sbin/* $(1)/sbin endef -$(eval $(call BuildPackage,autocore)) +define Package/autocore-x86/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/x86/autocore $(1)/etc/init.d/autocore + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) ./files/x86/index.htm $(1)/etc/index.htm + $(INSTALL_DIR) $(1)/sbin + $(CP) ./files/x86/sbin/* $(1)/sbin +endef + +$(eval $(call BuildPackage,autocore-raspberrypi)) +$(eval $(call BuildPackage,autocore-x86)) diff --git a/package/lean/autocore/files/raspberrypi/090-cover-index_htm b/package/lean/autocore/files/raspberrypi/090-cover-index_htm new file mode 100755 index 0000000000..9aee5eb548 --- /dev/null +++ b/package/lean/autocore/files/raspberrypi/090-cover-index_htm @@ -0,0 +1,5 @@ +#!/bin/sh + +[ -f /etc/index.htm ] && mv /etc/index.htm /usr/lib/lua/luci/view/admin_status/index.htm + +exit 0 diff --git a/package/lean/autocore/files/raspberrypi/index.htm b/package/lean/autocore/files/raspberrypi/index.htm new file mode 100644 index 0000000000..f77f4ed44f --- /dev/null +++ b/package/lean/autocore/files/raspberrypi/index.htm @@ -0,0 +1,811 @@ +<%# + Copyright 2008 Steven Barth + Copyright 2008-2011 Jo-Philipp Wich + Licensed to the public under the Apache License 2.0. +-%> + +<% + local fs = require "nixio.fs" + local util = require "luci.util" + local stat = require "luci.tools.status" + local ver = require "luci.version" + + local has_ipv6 = fs.access("/usr/sbin/ip6tables") + local has_dhcp = fs.access("/etc/config/dhcp") + local has_wifi = ((fs.stat("/etc/config/wireless", "size") or 0) > 0) + + local sysinfo = luci.util.ubus("system", "info") or { } + local boardinfo = luci.util.ubus("system", "board") or { } + local unameinfo = nixio.uname() or { } + + local meminfo = sysinfo.memory or { + total = 0, + free = 0, + buffered = 0, + shared = 0 + } + + local mem_cached = luci.sys.exec("sed -e '/^Cached: /!d; s#Cached: *##; s# kB##g' /proc/meminfo") + + local swapinfo = sysinfo.swap or { + total = 0, + free = 0 + } + + local has_dsl = fs.access("/etc/init.d/dsl_control") + + if luci.http.formvalue("status") == "1" then + local ntm = require "luci.model.network".init() + local wan = ntm:get_wannet() + local wan6 = ntm:get_wan6net() + + local conn_count = tonumber( + fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0 + + local conn_max = tonumber(luci.sys.exec( + "sysctl -n -e net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max" + ):match("%d+")) or 4096 + + local user_info = luci.sys.exec("cat /proc/net/arp | grep 'br-lan' | grep '0x2' | wc -l") + + local cpu_usage = (luci.sys.exec("expr 100 - $(top -n 1 | grep 'CPU:' | awk -F '%' '{print$4}' | awk -F ' ' '{print$2}')") or "6") .. "%" + + local rv = { + cpuusage = cpu_usage, + userinfo = user_info, + systemp = sys_temp, + uptime = sysinfo.uptime or 0, + localtime = os.date(), + loadavg = sysinfo.load or { 0, 0, 0 }, + memory = meminfo, + memcached = mem_cached, + swap = swapinfo, + connmax = conn_max, + conncount = conn_count, + leases = stat.dhcp_leases(), + leases6 = stat.dhcp6_leases(), + wifinets = stat.wifi_networks() + } + + if wan then + rv.wan = { + ipaddr = wan:ipaddr(), + gwaddr = wan:gwaddr(), + netmask = wan:netmask(), + dns = wan:dnsaddrs(), + expires = wan:expires(), + uptime = wan:uptime(), + proto = wan:proto(), + ifname = wan:ifname(), + link = wan:adminlink() + } + end + + if wan6 then + rv.wan6 = { + ip6addr = wan6:ip6addr(), + gw6addr = wan6:gw6addr(), + dns = wan6:dns6addrs(), + ip6prefix = wan6:ip6prefix(), + uptime = wan6:uptime(), + proto = wan6:proto(), + ifname = wan6:ifname(), + link = wan6:adminlink() + } + end + + if has_dsl then + local dsl_stat = luci.sys.exec("/etc/init.d/dsl_control lucistat") + local dsl_func = loadstring(dsl_stat) + if dsl_func then + rv.dsl = dsl_func() + end + end + + luci.http.prepare_content("application/json") + luci.http.write_json(rv) + + return + elseif luci.http.formvalue("hosts") == "1" then + luci.http.prepare_content("application/json") + luci.http.write_json(luci.sys.net.host_hints()) + + return + end +-%> + +<%+header%> + + + + +

<%:Status%>

+ +
+ <%:System%> + + + + + + + + + + + +
<%:Hostname%><%=luci.sys.hostname() or "?"%>
<%:Model%><%=pcdata(boardinfo.model or "?")%> <%=luci.sys.exec("cat /etc/bench.log") or ""%>
<%:Architecture%><%=pcdata(boardinfo.system or "ARMv8 Processor")%> x <%=luci.sys.exec("cat /proc/cpuinfo | grep 'processor' | wc -l") or "1"%> <%=luci.sys.exec("cpuinfo") or ""%>
<%:Firmware Version%> + <%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> +
<%:Kernel Version%><%=unameinfo.release or "?"%>
<%:Local Time%>-
<%:Uptime%>-
<%:Load Average%>-
<%:CPU usage (%)%>-
+
+ +
+ <%:Memory%> + + + + +
<%:Total Available%>-
<%:Buffered%>-
+
+ +<% if swapinfo.total > 0 then %> +
+ <%:Swap%> + + + + +
<%:Total Available%>-
<%:Free%>-
+
+<% end %> + +
+ <%:Network%> + + + + <% if has_ipv6 then %> + + <% end %> + + +
<%:IPv4 WAN Status%> + + + +

?
<%:Collecting data...%>
+
<%:IPv6 WAN Status%> + + + +

?
<%:Collecting data...%>
+
<%:Online Users%>0
<%:Active Connections%>-
+
+ +<% if has_dhcp then %> +
+ <%:DHCP Leases%> + + + + + + + + + + + +
<%:Hostname%><%:IPv4-Address%><%:MAC-Address%><%:Leasetime remaining%>

<%:Collecting data...%>
+
+ +<% if has_ipv6 then %> + +<% end %> +<% end %> + +<% if has_dsl then %> +
+ <%:DSL%> + + +
<%:DSL Status%> + + + +

?
<%:Collecting data...%>
+
+
+<% end %> + +<% if has_wifi then %> +
+ <%:Wireless%> + + + +
<%:Collecting data...%>
+
+<% end %> + +<%+footer%> diff --git a/package/lean/autocore/files/raspberrypi/sbin/cpuinfo b/package/lean/autocore/files/raspberrypi/sbin/cpuinfo new file mode 100755 index 0000000000..c79f937869 --- /dev/null +++ b/package/lean/autocore/files/raspberrypi/sbin/cpuinfo @@ -0,0 +1,11 @@ +#!/bin/sh + +if command -v vcgencmd >/dev/null; then + cpu_freq="$(vcgencmd get_config arm_freq | awk -F '=' '{print $2}')Mhz" + sys_temp="$(vcgencmd measure_temp | grep -Eo '[0-9.]+')°C" +else + cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq) / 1000)Mhz" + sys_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C" +fi + +echo -n "(${cpu_freq}, ${sys_temp})" diff --git a/package/lean/autocore/files/autocore b/package/lean/autocore/files/x86/autocore similarity index 100% rename from package/lean/autocore/files/autocore rename to package/lean/autocore/files/x86/autocore diff --git a/package/lean/autocore/files/index.htm b/package/lean/autocore/files/x86/index.htm similarity index 100% rename from package/lean/autocore/files/index.htm rename to package/lean/autocore/files/x86/index.htm diff --git a/package/lean/autocore/files/sbin/cpuinfo b/package/lean/autocore/files/x86/sbin/cpuinfo similarity index 100% rename from package/lean/autocore/files/sbin/cpuinfo rename to package/lean/autocore/files/x86/sbin/cpuinfo diff --git a/package/lean/autocore/files/sbin/ethinfo b/package/lean/autocore/files/x86/sbin/ethinfo similarity index 100% rename from package/lean/autocore/files/sbin/ethinfo rename to package/lean/autocore/files/x86/sbin/ethinfo diff --git a/package/lean/autocore/files/sbin/getcpu b/package/lean/autocore/files/x86/sbin/getcpu similarity index 100% rename from package/lean/autocore/files/sbin/getcpu rename to package/lean/autocore/files/x86/sbin/getcpu diff --git a/package/lean/luci-app-frpc/luasrc/i18n/frp.zh-cn.lmo b/package/lean/luci-app-frpc/luasrc/i18n/frp.zh-cn.lmo deleted file mode 100644 index 9e48c9b3fa..0000000000 Binary files a/package/lean/luci-app-frpc/luasrc/i18n/frp.zh-cn.lmo and /dev/null differ diff --git a/package/lean/luci-app-frpc/po/zh-cn/frp.po b/package/lean/luci-app-frpc/po/zh-cn/frp.po new file mode 100644 index 0000000000..7bbedc80f3 --- /dev/null +++ b/package/lean/luci-app-frpc/po/zh-cn/frp.po @@ -0,0 +1,255 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + + +msgid "Frp Setting" +msgstr "Frp 内网穿透" + +msgid "Frp Status" +msgstr "Frp状态" + +msgid "The Frp service is not running." +msgstr "Frp服务未运行" + +msgid "The Frp service is running." +msgstr "Frp服务正在运行" + +msgid "Frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet." +msgstr "Frp 是一个可用于内网穿透的高性能的反向代理应用。" + +msgid "Global Setting" +msgstr "全局设置" + +msgid "Basic Settings" +msgstr "基本设置" + +msgid "Other Settings" +msgstr "其他设置" + +msgid "Client Log" +msgstr "日志" + +msgid "Enabled" +msgstr "启用" + +msgid "Server" +msgstr "服务器" + +msgid "Port" +msgstr "端口" + +msgid "Token" +msgstr "令牌" + +msgid "Time duration between server of frpc and frps mustn't exceed 15 minutes." +msgstr "frpc服务器与frps之间的时间间隔不得超过15分钟" + +msgid "Vhost HTTP Port" +msgstr "HTTP穿透服务端口" + +msgid "Vhost HTTPS Port" +msgstr "HTTPS穿透服务端口" + +msgid "Exit program when first login failed" +msgstr "初始登录失败即退出程序" + +msgid "TCP Stream Multiplexing" +msgstr "TCP端口复用" + +msgid "decide if exit program when first login failed, otherwise continuous relogin to frps." +msgstr "第一次登录失败就退出程序,否则将持续尝试登陆 Frp 服务器。" + +msgid "Default is Ture. This feature in frps.ini and frpc.ini must be same." +msgstr "该功能默认启用,该配置项在服务端和客户端必须保持一致。" + +msgid "Protocol Type" +msgstr "协议类型" + +msgid "Frp support kcp protocol since v0.12.0" +msgstr "从 v0.12.0 版本开始,底层通信协议支持选择 kcp 协议加速。" + +msgid "TCP Protocol" +msgstr "TCP协议" + +msgid "KCP Protocol" +msgstr "KCP协议" + +msgid "Connect frps by HTTP PROXY" +msgstr "通过代理连接 frps" + +msgid "frpc can connect frps using HTTP PROXY" +msgstr "frpc 支持通过 HTTP PROXY 和 frps 进行通信" + +msgid "HTTP PROXY" +msgstr "HTTP代理" + +msgid "Enable Connection Pool" +msgstr "启用连接池功能" + +msgid "This feature is fit for a large number of short connections." +msgstr "适合有大量短连接请求时开启" + +msgid "Connection Pool" +msgstr "指定预创建连接的数量" + +msgid "Connections will be established in advance." +msgstr "frpc 会预先和服务端建立起指定数量的连接。" + +msgid "Service registration interval" +msgstr "服务注册间隔" + +msgid "0 means disable this feature, unit: min" +msgstr "0表示禁用定时注册功能,单位:分钟" + +msgid "Log Level" +msgstr "日志记录等级" + +msgid "Trace" +msgstr "追踪" + +msgid "Debug" +msgstr "调试" + +msgid "Info" +msgstr "信息" + +msgid "Warning" +msgstr "警告" + +msgid "Error" +msgstr "错误" + +msgid "Log Keepd Max Days" +msgstr "日志记录天数" + +msgid "Services List" +msgstr "服务列表" + +msgid "Service Remark Name" +msgstr "服务备注名" + +msgid "Domain/Subdomain" +msgstr "域名/子域名" + +msgid "Remote Port" +msgstr "远程主机端口" + +msgid "Local Host Address" +msgstr "内网主机地址" + +msgid "Local Host Port" +msgstr "内网主机端口" + +msgid "Use Encryption" +msgstr "开启数据加密" + +msgid "Use Compression" +msgstr "使用压缩" + +msgid "Enable State" +msgstr "开启状态" + +msgid "Frp Domain Config" +msgstr "Frp域名配置" + +msgid "Config Frp Protocol" +msgstr "配置 Frp 协议参数" + +msgid "Disable" +msgstr "关闭" + +msgid "Frp Protocol Type" +msgstr "Frp 协议类型" + +msgid "Domain Type" +msgstr "域名类型" + +msgid "Custom Domains" +msgstr "自定义域名" + +msgid "SubDomain" +msgstr "子域名" + +msgid "Both the above two Domain types" +msgstr "同时使用2种域名" + +msgid "If SubDomain is used, Custom Domains couldn't be subdomain or wildcard domain of the maindomain(subdomain_host)." +msgstr "如果服务端配置了主域名(subdomain_host),则自定义域名不能是属于主域名(subdomain_host) 的子域名或者泛域名。" + +msgid "subdomain_host must be configured in server: frps in advance." +msgstr "使用子域名时,必须预先在服务端配置主域名(subdomain_host)参数。" + +msgid "STCP Role" +msgstr "SFTP服务类型" + +msgid "Use Plugin" +msgstr "使用插件" + +msgid "If plugin is defined, local_ip and local_port is useless, plugin will handle connections got from frps." +msgstr "使用插件使用插件模式时,本地 IP 地址和端口无需配置,插件将会处理来自服务端的链接请求。" + +msgid "STCP Screct Key" +msgstr "SFTP密钥" + +msgid "STCP Server Name" +msgstr "SFTP服务名称" + +msgid "Enable URL routing" +msgstr "启用 URL 路由" + +msgid "Frp support forward http requests to different backward web services by url routing." +msgstr "Frp支持通过url路由将http请求转发到不同的反向web服务。" + +msgid "Choose Plugin" +msgstr "选择插件" + +msgid "Proxy Authentication" +msgstr "代理认证" + +msgid "Other PCs could access the Internet through frpc's network by using http_proxy plugin." +msgstr "http proxy 插件,可以使其他机器通过 frpc 的网络访问互联网;开启身份验证之后需要用户名、密码才能连接到 HTTP 代理。" + +msgid "HTTP Proxy UserName" +msgstr "HTTP 代理用户名" + +msgid "HTTP Proxy Password" +msgstr "HTTP 代理密码" + +msgid "Plugin Unix Sock Path" +msgstr "Unix Sock 插件路径" + +msgid "Password protecting your web service" +msgstr "密码保护您的web服务" + +msgid "HTTP UserName" +msgstr "HTTP 用户名" + +msgid "HTTP PassWord" +msgstr "HTTP 密码" + +msgid "Rewriting the Host Header" +msgstr "修改 Host Header" + +msgid "Frp can rewrite http requests with a modified Host header." +msgstr "Frp可以用修改后的主机头重写http请求。" + +msgid "Proxy-Protocol Version" +msgstr "Proxy-Protocol 版本" + +msgid "Encrypted the communication between frpc and frps, will effectively prevent the traffic intercepted." +msgstr "将 frpc 与 frps 之间的通信内容加密传输,将会有效防止流量被拦截。" + +msgid "The contents will be compressed to speed up the traffic forwarding speed, but this will consume some additional cpu resources." +msgstr "对传输内容进行压缩,加快流量转发速度,但是会额外消耗一些 cpu 资源。" + +msgid "Http username and password are safety certification for http protocol." +msgstr "Http用户名和密码是Http协议的安全认证。" + +msgid "Proxy Protocol to send user's real IP to local services." +msgstr "将用户的真实IP发送到本地服务的代理协议。" + +msgid "STCP Server Name is Service Remark Name of STCP Server" +msgstr "STCP服务器别名" + +msgid "Please ensure the remark name is unique." +msgstr "确保备注名唯一" diff --git a/package/lean/ps3netsrv/Makefile b/package/lean/ps3netsrv/Makefile new file mode 100644 index 0000000000..ab81de49a5 --- /dev/null +++ b/package/lean/ps3netsrv/Makefile @@ -0,0 +1,55 @@ +# +# Copyright (C) 2012-2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=ps3netsrv +PKG_VERSION:=20190630 +PKG_GIT_COMMIT:=3107bba17870657c5bb3f7830657838d766a296c +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_GIT_COMMIT).tar.gz +PKG_SOURCE_URL:=https://github.com/jhonathanc/ps3netsrv/releases/download/$(PKG_VERSION) +PKG_HASH:=b1df52bab6496d3008019ff76660436c4b24d05c84fc71f293719dbd608f1511 +PKG_INSTALL:=1 + +PKG_MAINTAINER:=JCorrea +PKG_LICENSE:=GPLv3 +PKG_LICENSE_FILES:=COPYING +PKG_BUILD_DEPENDS:=mbedtls + +include $(INCLUDE_DIR)/package.mk + +define Package/ps3netsrv + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=PS3 Game Server + URL:=https://github.com/jhonathanc/ps3netsrv-openwrt/ + DEPENDS:=+libpthread +libstdcpp +endef + +define Package/ps3netsrv/description +ps3netsrv allows you to stream games and ISOs over the network to your CFW PlayStation(R) 3 system. +This may be useful if you have a modified PS3, and your router has storage options. +endef + +define Build/Install + # Do nothing +endef + +define Package/ps3netsrv/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ps3netsrv $(1)/usr/bin + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/ps3netsrv.init $(1)/etc/init.d/ps3netsrv + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/ps3netsrv.config $(1)/etc/config/ps3netsrv +endef + +$(eval $(call BuildPackage,ps3netsrv)) diff --git a/package/lean/ps3netsrv/files/ps3netsrv.config b/package/lean/ps3netsrv/files/ps3netsrv.config new file mode 100644 index 0000000000..d03ae2b094 --- /dev/null +++ b/package/lean/ps3netsrv/files/ps3netsrv.config @@ -0,0 +1,5 @@ +config ps3netsrv 'main' + option enabled '0' + option user 'root' + option dir '/root' + option port '38008' diff --git a/package/lean/ps3netsrv/files/ps3netsrv.init b/package/lean/ps3netsrv/files/ps3netsrv.init new file mode 100644 index 0000000000..8565dbb74a --- /dev/null +++ b/package/lean/ps3netsrv/files/ps3netsrv.init @@ -0,0 +1,83 @@ +#!/bin/sh /etc/rc.common + +START=99 +USE_PROCD=1 + +NAME=ps3netsrv +PROG=/usr/bin/ps3netsrv + +_info() { + logger -p daemon.info -t "$NAME" "$*" +} + +_err() { + logger -p daemon.err -t "$NAME" "$*" +} + +_change_owner() { + local u="$1"; shift + + local d + for d in "$@"; do + if [ -f "$d" ]; then + chown "$u" "$d" 2>/dev/null || return 1 + elif [ -d "$d" ]; then + chown -R "$u" "$d" 2>/dev/null || return 1 + fi + done + + return 0 +} + +ps3netsrv_validate() { + uci_validate_section "$NAME" ps3netsrv "$1" \ + 'enabled:bool:0' \ + 'dir:string:/root' \ + 'user:string' \ + 'port:range(1024,65535)' +} + +ps3netsrv_start() { + local section="$1" + ps3netsrv_validate "$section" || { _err "Validation failed."; return 1; } + + [ "$enabled" = "1" ] || { _info "Instance \"${section}\" disabled."; return 1; } + [ -n "$dir" ] || { _err "Please set PS3 Game dir."; return 1; } + [ -n "$port" ] || { _err "Please set bind port."; return 1; } + [ -d "$dir" ] || { _err "Please create PS3 Game dir first."; return 1; } + + if [ -n "$user" ]; then + if ( user_exists "$user" && _change_owner "$user" "$log" ); then + _info "ps3netsrv will run as user '${user}'." + if [ "$user" != "root" ]; then + _info "Please make sure user '${user}' has read access to directory: ${dir}" + fi + else + _info "Set run user to '${user}' failed, default user will be used." + user= + fi + fi + + procd_open_instance "${NAME}.${section}" + procd_set_param command "$PROG" "$dir" "$port" + + procd_set_param respawn + procd_set_param stdout 1 + procd_set_param stderr 1 + + [ -n "$user" ] && \ + procd_set_param user "$user" + + procd_add_jail "${NAME}.${section}" log + procd_add_jail_mount "$dir" + procd_close_instance +} + +service_triggers() { + procd_add_reload_trigger "$NAME" +} + +start_service() { + config_load "$NAME" + config_foreach ps3netsrv_start "ps3netsrv" +} diff --git a/package/lean/ps3netsrv/patches/001-include.common.h.patch b/package/lean/ps3netsrv/patches/001-include.common.h.patch new file mode 100644 index 0000000000..17fa47f6ec --- /dev/null +++ b/package/lean/ps3netsrv/patches/001-include.common.h.patch @@ -0,0 +1,20 @@ +diff -Naur a/include/common.h b/include/common.h +--- a/include/common.h 2019-08-03 10:48:42.000000000 -0700 ++++ b/include/common.h 2020-03-01 19:26:14.000000000 -0800 +@@ -2,6 +2,7 @@ + #define __COMMON_H__ + + #include ++#include + + #ifdef DEBUG + #include +@@ -10,7 +11,7 @@ + #define DPRINTF(...) + #endif + +-#ifdef __BIG_ENDIAN__ ++#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + + static inline uint16_t BE16(uint16_t x) + { diff --git a/package/lean/ps3netsrv/patches/002-include.compat.h.patch b/package/lean/ps3netsrv/patches/002-include.compat.h.patch new file mode 100644 index 0000000000..517a116428 --- /dev/null +++ b/package/lean/ps3netsrv/patches/002-include.compat.h.patch @@ -0,0 +1,12 @@ +diff -Naur a/include/compat.h b/include/compat.h +--- a/include/compat.h 2019-08-03 10:48:42.000000000 -0700 ++++ b/include/compat.h 2020-03-01 19:26:14.000000000 -0800 +@@ -57,7 +57,7 @@ typedef int socklen_t; + + #else + +-#include ++#include + #include + #include + #include diff --git a/package/lean/ps3netsrv/patches/003-makefile.patch b/package/lean/ps3netsrv/patches/003-makefile.patch new file mode 100644 index 0000000000..c9e0c90640 --- /dev/null +++ b/package/lean/ps3netsrv/patches/003-makefile.patch @@ -0,0 +1,114 @@ +diff -Naur a/Makefile b/Makefile +--- a/Makefile 2019-08-03 10:48:42.000000000 -0700 ++++ b/Makefile 2020-03-01 19:26:14.000000000 -0800 +@@ -1,21 +1,17 @@ +-OS = windows ++OS = linux + BUILD_TYPE = release_static + + OUTPUT := ps3netsrv + OBJS = src/main.o src/compat.o src/File.o src/VIsoFile.o + +-CFLAGS = -Wall -I./include -I./polarssl-1.3.2/include -std=gnu99 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL +-CPPFLAGS += -Wall -I./include -I./polarssl-1.3.2/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DPOLARSSL +- +-#CFLAGS += -DNOSSL +-#CPPFLAGS +=-DNOSSL +- +-LDFLAGS = -L. -L./polarssl-1.3.2/library +-LIBS = -lstdc++ -lpolarssl ++CFLAGS = -Wall -I./include -std=gnu99 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ++CPPFLAGS = -Wall -I./include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 + ++LDFLAGS = -L. ++LIBS = -lstdc++ + + ifeq ($(OS), linux) +-LIBS += -lpthread ++LIBS += -lpthread -lgcc_eh + endif + + ifeq ($(OS), windows) +@@ -37,28 +33,82 @@ endif + ifeq ($(BUILD_TYPE), debug) + CFLAGS += -O0 -g3 -DDEBUG + CPPFLAGS += -O0 -g3 -DDEBUG ++LIBS += -lmbedtls -lmbedx509 -lmbedcrypto ++endif ++ ++ifeq ($(BUILD_TYPE), debug_nossl) ++CFLAGS += -O0 -g3 -DDEBUG -DNOSSL ++CPPFLAGS += -O0 -g3 -DDEBUG -DNOSSL ++endif ++ ++ifeq ($(BUILD_TYPE), debug_polar) ++CFLAGS += -O0 -g3 -DDEBUG -I./polarssl-1.3.2/include -DPOLARSSL ++CPPFLAGS += -O0 -g3 -DDEBUG -I./polarssl-1.3.2/include -DPOLARSSL ++LDFLAGS += -L./polarssl-1.3.2/library ++LIBS += -lpolarssl + endif + + ifeq ($(BUILD_TYPE), debug_static) + CFLAGS += -O0 -static -g3 -DDEBUG + CPPFLAGS += -O0 -static -g3 -DDEBUG ++LIBS += -lmbedtls -lmbedx509 -lmbedcrypto ++endif ++ ++ifeq ($(BUILD_TYPE), debug_static_nossl) ++CFLAGS += -O0 -static -g3 -DDEBUG -DNOSSL ++CPPFLAGS += -O0 -static -g3 -DDEBUG -DNOSSL ++endif ++ ++ifeq ($(BUILD_TYPE), debug_static_polar) ++CFLAGS += -O0 -static -g3 -DDEBUG -I./polarssl-1.3.2/include -DPOLARSSL ++CPPFLAGS += -O0 -static -g3 -DDEBUG -I./polarssl-1.3.2/include -DPOLARSSL ++LDFLAGS += -L./polarssl-1.3.2/library ++LIBS += -lpolarssl + endif + + ifeq ($(BUILD_TYPE), release) + CFLAGS += -O3 -s -DNDEBUG + CPPFLAGS += -O3 -s -DNDEBUG ++LIBS += -lmbedtls -lmbedx509 -lmbedcrypto ++endif ++ ++ifeq ($(BUILD_TYPE), release_nossl) ++CFLAGS += -O3 -s -DNDEBUG -DNOSSL ++CPPFLAGS += -O3 -s -DNDEBUG -DNOSSL ++endif ++ ++ifeq ($(BUILD_TYPE), release_polar) ++CFLAGS += -O3 -s -DNDEBUG -I./polarssl-1.3.2/include -DPOLARSSL ++CPPFLAGS += -O3 -s -DNDEBUG -I./polarssl-1.3.2/include -DPOLARSSL ++LDFLAGS += -L./polarssl-1.3.2/library ++LIBS += -lpolarssl + endif + + ifeq ($(BUILD_TYPE), release_static) + CFLAGS += -static -O3 -s -DNDEBUG + CPPFLAGS += -static -O3 -s -DNDEBUG ++LIBS += -lmbedtls -lmbedx509 -lmbedcrypto ++endif ++ ++ifeq ($(BUILD_TYPE), release_static_nossl) ++CFLAGS += -static -O3 -s -DNDEBUG -DNOSSL ++CPPFLAGS += -static -O3 -s -DNDEBUG -DNOSSL ++endif ++ ++ifeq ($(BUILD_TYPE), release_static_polar) ++CFLAGS += -static -O3 -s -DNDEBUG -I./polarssl-1.3.2/include -DPOLARSSL ++CPPFLAGS += -static -O3 -s -DNDEBUG -I./polarssl-1.3.2/include -DPOLARSSL ++LDFLAGS += -L./polarssl-1.3.2/library ++LIBS += -lpolarssl + endif + + all: $(OUTPUT) + rm -r -f src/*.o ++ rm -r -f polarssl-1.3.2/library/*.o + + clean: + rm -r -f $(OUTPUT) src/*.o ++ rm -r -f polarssl-1.3.2/library/*.o + + $(OUTPUT): $(OBJS) + $(LINK.c) $(LDFLAGS) -o $@ $^ $(LIBS) diff --git a/package/lean/v2ray/Makefile b/package/lean/v2ray/Makefile index 9fcdf9e6f3..b330e93e79 100644 --- a/package/lean/v2ray/Makefile +++ b/package/lean/v2ray/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=v2ray -PKG_VERSION:=4.23.1 +PKG_VERSION:=4.23.4 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/v2ray-core-$(PKG_VERSION) PKG_SOURCE:=v2ray-core-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/v2ray/v2ray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=474b3aeed069d9867f7603a0544abcc0f31386cef9254423577ab752fc8d4dcc +PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=726dd98d674bd73150158b1d4c8bc0d59dbb672ba10096ac61548d6278213c78 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index b186a087e7..159cfbc53f 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl PKG_VERSION:=4.4.0-stable -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) @@ -56,7 +56,7 @@ define Package/libwolfssl/config source "$(SOURCE)/Config.in" endef -TARGET_CFLAGS += $(FPIC) -DFP_MAX_BITS=8192 +TARGET_CFLAGS += $(FPIC) -DFP_MAX_BITS=8192 -fomit-frame-pointer # --enable-stunnel needed for OpenSSL API compatibility bits CONFIGURE_ARGS += \ diff --git a/package/ntlf9t/luci-app-clash/luasrc/controller/clash.lua b/package/ntlf9t/luci-app-clash/luasrc/controller/clash.lua index 85cce4b312..0d1b042521 100644 --- a/package/ntlf9t/luci-app-clash/luasrc/controller/clash.lua +++ b/package/ntlf9t/luci-app-clash/luasrc/controller/clash.lua @@ -13,7 +13,7 @@ function index() local page = entry({"admin", "services", "clash"},alias("admin", "services", "clash", "overview"), _("Clash"), 5) page.dependent = true - page.acl_depends = { "luci-app-oclash" } + page.acl_depends = { "luci-app-clash" } entry({"admin", "services", "clash", "overview"},cbi("clash/overview"),_("Overview"), 10).leaf = true entry({"admin", "services", "clash", "client"},cbi("clash/client"),_("Client"), 20).leaf = true diff --git a/package/system/mtd/Makefile b/package/system/mtd/Makefile index f31a34a612..166bb33281 100644 --- a/package/system/mtd/Makefile +++ b/package/system/mtd/Makefile @@ -3,13 +3,13 @@ # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. -# +# include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mtd -PKG_RELEASE:=23 +PKG_RELEASE:=25 PKG_BUILD_DIR := $(KERNEL_BUILD_DIR)/$(PKG_NAME) STAMP_PREPARED := $(STAMP_PREPARED)_$(call confvar,CONFIG_MTD_REDBOOT_PARTS) diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile index 4fd17b0dc7..e504a04478 100644 --- a/package/system/mtd/src/Makefile +++ b/package/system/mtd/src/Makefile @@ -6,12 +6,15 @@ obj = mtd.o jffs2.o crc32.o md5.o obj.seama = seama.o md5.o obj.wrg = wrg.o md5.o obj.wrgg = wrgg.o md5.o +obj.tpl = tpl_ramips_recoveryflag.o obj.ar71xx = trx.o $(obj.seama) $(obj.wrgg) +obj.ath79 = $(obj.seama) +obj.gemini = $(obj.wrgg) obj.brcm = trx.o obj.bcm47xx = $(obj.brcm) obj.bcm53xx = $(obj.brcm) $(obj.seama) obj.bcm63xx = imagetag.o -obj.ramips = $(obj.seama) $(obj.wrg) linksys_bootcount.o +obj.ramips = $(obj.seama) $(obj.tpl) $(obj.wrg) linksys_bootcount.o obj.mvebu = linksys_bootcount.o obj.kirkwood = linksys_bootcount.o obj.ipq806x = linksys_bootcount.o diff --git a/package/system/mtd/src/fis.c b/package/system/mtd/src/fis.c index b50411cfeb..8bde9af6dc 100644 --- a/package/system/mtd/src/fis.c +++ b/package/system/mtd/src/fis.c @@ -139,8 +139,6 @@ done: int fis_remap(struct fis_part *old, int n_old, struct fis_part *new, int n_new) { - struct fis_image_desc *fisdir = NULL; - struct fis_image_desc *redboot = NULL; struct fis_image_desc *first = NULL; struct fis_image_desc *last = NULL; struct fis_image_desc *first_fb = NULL; @@ -164,12 +162,6 @@ fis_remap(struct fis_part *old, int n_old, struct fis_part *new, int n_new) if (!desc->hdr.name[0] || (desc->hdr.name[0] == 0xff)) break; - if (!strcmp((char *) desc->hdr.name, "FIS directory")) - fisdir = desc; - - if (!strcmp((char *) desc->hdr.name, "RedBoot")) - redboot = desc; - /* update max offset */ if (offset < desc->hdr.flash_base) offset = desc->hdr.flash_base; @@ -210,18 +202,6 @@ fis_remap(struct fis_part *old, int n_old, struct fis_part *new, int n_new) size = offset - first_fb->hdr.flash_base; -#ifdef notyet - desc = first - 1; - if (redboot && (desc >= redboot)) { - if (first->hdr.flash_base - desc->hdr.size > desc->hdr.flash_base) { - int delta = first->hdr.flash_base - desc->hdr.size - desc->hdr.flash_base; - - offset -= delta; - size += delta; - } - } -#endif - last++; desc = first + n_new; offset = first_fb->hdr.flash_base; @@ -243,14 +223,14 @@ fis_remap(struct fis_part *old, int n_old, struct fis_part *new, int n_new) memset(desc, 0, sizeof(struct fis_image_desc)); memcpy(desc->hdr.name, part->name, sizeof(desc->hdr.name)); desc->crc.desc = 0; - desc->crc.file = 0; + desc->crc.file = part->crc; desc->hdr.flash_base = offset; desc->hdr.mem_base = part->loadaddr; desc->hdr.entry_point = part->loadaddr; desc->hdr.size = (part->size > 0) ? part->size : size; - desc->hdr.data_length = desc->hdr.size; - + desc->hdr.data_length = (part->length > 0) ? part->length : + desc->hdr.size; offset += desc->hdr.size; size -= desc->hdr.size; } diff --git a/package/system/mtd/src/fis.h b/package/system/mtd/src/fis.h index bdf1103d8a..2be2cb1f04 100644 --- a/package/system/mtd/src/fis.h +++ b/package/system/mtd/src/fis.h @@ -6,6 +6,8 @@ struct fis_part { uint32_t offset; uint32_t loadaddr; uint32_t size; + uint32_t length; + uint32_t crc; }; int fis_validate(struct fis_part *old, int n_old, struct fis_part *new, int n_new); diff --git a/package/system/mtd/src/linksys_bootcount.c b/package/system/mtd/src/linksys_bootcount.c index 500ede4972..bd06728696 100644 --- a/package/system/mtd/src/linksys_bootcount.c +++ b/package/system/mtd/src/linksys_bootcount.c @@ -2,6 +2,7 @@ * Linksys boot counter reset code for mtd * * Copyright (C) 2013 Jonas Gorski + * Portions Copyright (c) 2019, Jeff Kletsky * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License v2 @@ -29,6 +30,7 @@ #include #include #include +#include #include #include @@ -37,6 +39,30 @@ #define BOOTCOUNT_MAGIC 0x20110811 +/* + * EA6350v3, and potentially other NOR-boot devices, + * use an offset increment of 16 between records, + * not mtd_info_user.writesize (often 1 on NOR devices). + */ + +#define BC_OFFSET_INCREMENT_MIN 16 + + + +#define DLOG_OPEN() + +#define DLOG_ERR(...) do { \ + fprintf(stderr, "ERROR: " __VA_ARGS__); fprintf(stderr, "\n"); \ + } while (0) + +#define DLOG_NOTICE(...) do { \ + fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n"); \ + } while (0) + +#define DLOG_DEBUG(...) + + + struct bootcounter { uint32_t magic; uint32_t count; @@ -50,25 +76,50 @@ int mtd_resetbc(const char *mtd) struct mtd_info_user mtd_info; struct bootcounter *curr = (struct bootcounter *)page; unsigned int i; + unsigned int bc_offset_increment; int last_count = 0; int num_bc; int fd; int ret; + int retval = 0; + + DLOG_OPEN(); fd = mtd_check_open(mtd); if (ioctl(fd, MEMGETINFO, &mtd_info) < 0) { - fprintf(stderr, "failed to get mtd info!\n"); - return -1; + DLOG_ERR("Unable to obtain mtd_info for given partition name."); + + retval = -1; + goto out; } - num_bc = mtd_info.size / mtd_info.writesize; + + /* Detect need to override increment (for EA6350v3) */ + + if (mtd_info.writesize < BC_OFFSET_INCREMENT_MIN) { + + bc_offset_increment = BC_OFFSET_INCREMENT_MIN; + DLOG_DEBUG("Offset increment set to %i for writesize of %i", + bc_offset_increment, mtd_info.writesize); + } else { + + bc_offset_increment = mtd_info.writesize; + } + + num_bc = mtd_info.size / bc_offset_increment; for (i = 0; i < num_bc; i++) { - pread(fd, curr, sizeof(*curr), i * mtd_info.writesize); + pread(fd, curr, sizeof(*curr), i * bc_offset_increment); - if (curr->magic != BOOTCOUNT_MAGIC && curr->magic != 0xffffffff) { - fprintf(stderr, "unexpected magic %08x, bailing out\n", curr->magic); + /* Existing code assumes erase is to 0xff; left as-is (2019) */ + + if (curr->magic != BOOTCOUNT_MAGIC && + curr->magic != 0xffffffff) { + DLOG_ERR("Unexpected magic %08x at offset %08x; aborting.", + curr->magic, i * bc_offset_increment); + + retval = -2; goto out; } @@ -78,38 +129,59 @@ int mtd_resetbc(const char *mtd) last_count = curr->count; } - /* no need to do writes when last boot count is already 0 */ - if (last_count == 0) + + if (last_count == 0) { /* bootcount is already 0 */ + + retval = 0; goto out; + } if (i == num_bc) { + DLOG_NOTICE("Boot-count log full with %i entries; erasing (expected occasionally).", + i); + struct erase_info_user erase_info; erase_info.start = 0; erase_info.length = mtd_info.size; - /* erase block */ ret = ioctl(fd, MEMERASE, &erase_info); if (ret < 0) { - fprintf(stderr, "failed to erase block: %i\n", ret); - return -1; + DLOG_ERR("Failed to erase boot-count log MTD; ioctl() MEMERASE returned %i", + ret); + + retval = -3; + goto out; } i = 0; } - memset(curr, 0xff, mtd_info.writesize); + memset(curr, 0xff, bc_offset_increment); curr->magic = BOOTCOUNT_MAGIC; curr->count = 0; curr->checksum = BOOTCOUNT_MAGIC; - ret = pwrite(fd, curr, mtd_info.writesize, i * mtd_info.writesize); - if (ret < 0) - fprintf(stderr, "failed to write: %i\n", ret); - sync(); + /* Assumes bc_offset_increment is a multiple of mtd_info.writesize */ + + ret = pwrite(fd, curr, bc_offset_increment, i * bc_offset_increment); + if (ret < 0) { + DLOG_ERR("Failed to write boot-count log entry; pwrite() returned %i", + errno); + retval = -4; + goto out; + + } else { + sync(); + + DLOG_NOTICE("Boot count sucessfully reset to zero."); + + retval = 0; + goto out; + } + out: close(fd); - - return 0; + return retval; } diff --git a/package/system/mtd/src/mtd.c b/package/system/mtd/src/mtd.c index fa04c0f95b..9baed3fd5e 100644 --- a/package/system/mtd/src/mtd.c +++ b/package/system/mtd/src/mtd.c @@ -44,6 +44,7 @@ #include #include #include +#include "crc32.h" #include "fis.h" #include "mtd.h" @@ -85,6 +86,7 @@ static char *buf = NULL; static char *imagefile = NULL; static enum mtd_image_format imageformat = MTD_IMAGE_FORMAT_UNKNOWN; static char *jffs2file = NULL, *jffs2dir = JFFS2_DEFAULT_DIR; +static char *tpl_uboot_args_part; static int buflen = 0; int quiet; int no_erase; @@ -472,12 +474,14 @@ mtd_write(int imagefd, const char *mtd, char *fis_layout, size_t part_offset) ssize_t r, w, e; ssize_t skip = 0; uint32_t offset = 0; + int buflen_raw = 0; int jffs2_replaced = 0; int skip_bad_blocks = 0; #ifdef FIS_SUPPORT static struct fis_part new_parts[MAX_ARGS]; static struct fis_part old_parts[MAX_ARGS]; + struct fis_part *cur_part = NULL; int n_new = 0, n_old = 0; if (fis_layout) { @@ -487,6 +491,8 @@ mtd_write(int imagefd, const char *mtd, char *fis_layout, size_t part_offset) memset(&old_parts, 0, sizeof(old_parts)); memset(&new_parts, 0, sizeof(new_parts)); + if (!part_offset) + cur_part = new_parts; do { next = strchr(tmp, ':'); @@ -554,6 +560,17 @@ resume: lseek(fd, part_offset, SEEK_SET); } + /* Write TP-Link recovery flag */ + if (tpl_uboot_args_part && mtd_tpl_recoverflag_write) { + if (quiet < 2) + fprintf(stderr, "Writing recovery flag to %s\n", tpl_uboot_args_part); + result = mtd_tpl_recoverflag_write(tpl_uboot_args_part, true); + if (result < 0) { + fprintf(stderr, "Could not write TP-Link recovery flag to %s: %i", mtd, result); + exit(1); + } + } + indicate_writing(mtd); w = e = 0; @@ -576,6 +593,9 @@ resume: buflen += r; } + if (buflen_raw == 0) + buflen_raw = buflen; + if (buflen == 0) break; @@ -587,6 +607,7 @@ resume: if (skip > 0) { skip -= buflen; + buflen_raw = 0; buflen = 0; if (skip <= 0) indicate_writing(mtd); @@ -610,6 +631,7 @@ resume: w += skip; e += skip; skip -= buflen; + buflen_raw = 0; buflen = 0; offset = 0; continue; @@ -675,6 +697,17 @@ resume: } w += buflen; +#ifdef FIS_SUPPORT + if (cur_part && cur_part->size + && cur_part < &new_parts[MAX_ARGS - 1] + && cur_part->length + buflen_raw > cur_part->size) + cur_part++; + if (cur_part) { + cur_part->length += buflen_raw; + cur_part->crc = crc32(cur_part->crc, buf, buflen_raw); + } +#endif + buflen_raw = 0; buflen = 0; offset = 0; } @@ -716,6 +749,18 @@ resume: #endif close(fd); + + /* Clear TP-Link recovery flag */ + if (tpl_uboot_args_part && mtd_tpl_recoverflag_write) { + if (quiet < 2) + fprintf(stderr, "Removing recovery flag from %s\n", tpl_uboot_args_part); + result = mtd_tpl_recoverflag_write(tpl_uboot_args_part, false); + if (result < 0) { + fprintf(stderr, "Could not clear TP-Link recovery flag to %s: %i", mtd, result); + exit(1); + } + } + return 0; } @@ -771,6 +816,10 @@ static void usage(void) fprintf(stderr, " -c datasize amount of data to be used for checksum calculation (for fixtrx / fixseama / fixwrg / fixwrgg)\n"); } + if (mtd_tpl_recoverflag_write) { + fprintf(stderr, + " -t write TP-Link recovery-flag to (for write)\n"); + } fprintf(stderr, #ifdef FIS_SUPPORT " -F [:[:]][,...]\n" @@ -828,7 +877,7 @@ int main (int argc, char **argv) #ifdef FIS_SUPPORT "F:" #endif - "frnqe:d:s:j:p:o:c:l:")) != -1) + "frnqe:d:s:j:p:o:c:t:l:")) != -1) switch (ch) { case 'f': force = 1; @@ -896,6 +945,9 @@ int main (int argc, char **argv) usage(); } break; + case 't': + tpl_uboot_args_part = optarg; + break; #ifdef FIS_SUPPORT case 'F': fis_layout = optarg; diff --git a/package/system/mtd/src/mtd.h b/package/system/mtd/src/mtd.h index aac98e74b7..fe716b7150 100644 --- a/package/system/mtd/src/mtd.h +++ b/package/system/mtd/src/mtd.h @@ -30,4 +30,5 @@ extern int mtd_fixseama(const char *mtd, size_t offset, size_t data_size) __attr extern int mtd_fixwrg(const char *mtd, size_t offset, size_t data_size) __attribute__ ((weak)); extern int mtd_fixwrgg(const char *mtd, size_t offset, size_t data_size) __attribute__ ((weak)); extern int mtd_resetbc(const char *mtd) __attribute__ ((weak)); +extern int mtd_tpl_recoverflag_write(const char *mtd, const bool recovery_active) __attribute__ ((weak)); #endif /* __mtd_h */ diff --git a/package/system/mtd/src/tpl_ramips_recoveryflag.c b/package/system/mtd/src/tpl_ramips_recoveryflag.c new file mode 100644 index 0000000000..3711e01317 --- /dev/null +++ b/package/system/mtd/src/tpl_ramips_recoveryflag.c @@ -0,0 +1,94 @@ +/* + * TP-Link recovery flag set and unset code for ramips target + * + * Copyright (C) 2018 David Bauer + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License v2 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "mtd.h" + + +#define TPL_RECOVER_MAGIC 0x89abcdef +#define TPL_NO_RECOVER_MAGIC 0x00000000 + + +struct uboot_args { + uint32_t magic; +}; + +int mtd_tpl_recoverflag_write(const char *mtd, const bool recovery_active) +{ + struct erase_info_user erase_info; + struct uboot_args *args; + uint32_t magic; + int ret = 0; + int fd; + + args = malloc(erasesize); + if (!args) { + fprintf(stderr, "Could not allocate memory!\n"); + return -1; + } + + fd = mtd_check_open(mtd); + if (fd < 0) { + fprintf(stderr, "Could not open mtd device: %s\n", mtd); + ret = -1; + goto out; + } + + /* read first block (containing the magic) */ + pread(fd, args, erasesize, 0); + + /* set magic to desired value */ + magic = TPL_RECOVER_MAGIC; + if (!recovery_active) + magic = TPL_NO_RECOVER_MAGIC; + + /* no need to write when magic is already set correctly */ + if (magic == args->magic) + goto out; + + /* erase first block (containing the magic) */ + erase_info.start = 0; + erase_info.length = erasesize; + + ret = ioctl(fd, MEMERASE, &erase_info); + if (ret < 0) { + fprintf(stderr, "failed to erase block: %i\n", ret); + goto out; + } + + /* write magic to flash */ + args->magic = magic; + + ret = pwrite(fd, args, erasesize, 0); + if (ret < 0) + fprintf(stderr, "failed to write: %i\n", ret); + + sync(); +out: + free(args); + close(fd); + + return ret; +} diff --git a/package/system/mtd/src/wrgg.c b/package/system/mtd/src/wrgg.c index e0b5ca172d..c62f9f5507 100644 --- a/package/system/mtd/src/wrgg.c +++ b/package/system/mtd/src/wrgg.c @@ -39,13 +39,10 @@ #include "wrgg.h" #include "md5.h" -#if __BYTE_ORDER == __BIG_ENDIAN -#define STORE32_LE(X) ((((X) & 0x000000FF) << 24) | (((X) & 0x0000FF00) << 8) | (((X) & 0x00FF0000) >> 8) | (((X) & 0xFF000000) >> 24)) -#elif __BYTE_ORDER == __LITTLE_ENDIAN -#define STORE32_LE(X) (X) -#else -#error unknown endianness! -#endif +static inline uint32_t le32_to_cpu(uint8_t *buf) +{ + return buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24; +} ssize_t pread(int fd, void *buf, size_t count, off_t offset); ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); @@ -94,7 +91,7 @@ wrgg_fix_md5(struct wrgg03_header *shdr, int fd, size_t data_offset, size_t data } /* update the size in the image */ - shdr->size = htonl(data_size); + shdr->size = data_size; /* update the checksum in the image */ memcpy(shdr->digest, digest, sizeof(digest)); @@ -147,12 +144,14 @@ mtd_fixwrgg(const char *mtd, size_t offset, size_t data_size) } shdr = (struct wrgg03_header *)(first_block + offset); - if (shdr->magic1 != htonl(STORE32_LE(WRGG03_MAGIC))) { - fprintf(stderr, "magic1 %x\n", shdr->magic1); - fprintf(stderr, "htonl(WRGG03_MAGIC) %x\n", WRGG03_MAGIC); + + /* The magic is always stored in little-endian byte order */ + if (le32_to_cpu((uint8_t *)&shdr->magic1) != WRGG03_MAGIC) { + fprintf(stderr, "magic1 = %x\n", shdr->magic1); + fprintf(stderr, "WRGG03_MAGIC = %x\n", WRGG03_MAGIC); fprintf(stderr, "No WRGG header found\n"); exit(1); - } else if (!ntohl(shdr->size)) { + } else if (!shdr->size) { fprintf(stderr, "WRGG entity with empty image\n"); exit(1); } @@ -160,8 +159,8 @@ mtd_fixwrgg(const char *mtd, size_t offset, size_t data_size) data_offset = offset + sizeof(struct wrgg03_header); if (!data_size) data_size = mtdsize - data_offset; - if (data_size > ntohl(shdr->size)) - data_size = ntohl(shdr->size); + if (data_size > shdr->size) + data_size = shdr->size; if (wrgg_fix_md5(shdr, fd, data_offset, data_size)) goto out; diff --git a/package/utils/exfat-utils/Makefile b/package/utils/exfat-utils/Makefile new file mode 100644 index 0000000000..ef2b59606d --- /dev/null +++ b/package/utils/exfat-utils/Makefile @@ -0,0 +1,69 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=exfat-utils +PKG_VERSION:=1.0.1 +PKG_RELEASE:=1 + +PKG_LICENSE:=GPL-2.0 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/$(PKG_NAME)/$(PKG_NAME)/tar.gz/$(PKG_VERSION)? +PKG_HASH:=7d4e95c3042b58601a581dc02f55eb4a726a2fb8db2e74a9619dbf3083997e06 + +PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +PKG_MAINTAINER:=Daniel Golle + +include $(INCLUDE_DIR)/package.mk + +CONFIGURE_ARGS += \ + --enable-shared \ + --disable-static + +define Package/exfat-utils/Default + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Filesystem + DEPENDS:=+libexfat + URL:=https://github.com/exfat-utils/exfat-utils +endef + +define Package/exfat-mkfs + $(Package/exfat-utils/Default) + TITLE:=Utility for creating an exFAT File System +endef + +define Package/exfat-fsck + $(Package/exfat-utils/Default) + TITLE:=Utility for checking/repairing an exFAT File System +endef + +define Package/libexfat + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Library for exFAT File System tools + DEPENDS:=+libuuid + ABI_VERSION:=1 +endef + +define Package/libexfat/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libexfat.so.* $(1)/usr/lib/ +endef + +define Package/exfat-mkfs/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.exfat $(1)/usr/sbin +endef + +define Package/exfat-fsck/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.exfat $(1)/usr/sbin +endef + +$(eval $(call BuildPackage,libexfat)) +$(eval $(call BuildPackage,exfat-mkfs)) +$(eval $(call BuildPackage,exfat-fsck)) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr3020.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr3020.c index 0a9dfbc8a0..e3b4087eff 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr3020.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr3020.c @@ -79,7 +79,7 @@ static struct gpio_keys_button tl_mr3020_gpio_keys[] __initdata = { }, { .desc = "sw1", - .type = EV_KEY, + .type = EV_SW, .code = BTN_0, .debounce_interval = TL_MR3020_KEYS_DEBOUNCE_INTERVAL, .gpio = TL_MR3020_GPIO_BTN_SW1, @@ -87,7 +87,7 @@ static struct gpio_keys_button tl_mr3020_gpio_keys[] __initdata = { }, { .desc = "sw2", - .type = EV_KEY, + .type = EV_SW, .code = BTN_1, .debounce_interval = TL_MR3020_KEYS_DEBOUNCE_INTERVAL, .gpio = TL_MR3020_GPIO_BTN_SW2, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c index ece38f900f..514529ca18 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c @@ -24,7 +24,7 @@ #include "machtypes.h" #define TL_WR802N_GPIO_LED_SYSTEM 13 -#define TL_WR802N_GPIO_BTN_RESET 11 +#define TL_WR802N_GPIO_BTN_RESET 12 #define TL_WR802N_KEYS_POLL_INTERVAL 20 /* msecs */ #define TL_WR802N_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR802N_KEYS_POLL_INTERVAL) @@ -61,7 +61,7 @@ static struct gpio_keys_button tl_wr802n_gpio_keys[] __initdata = { .code = KEY_RESTART, .debounce_interval = TL_WR802N_KEYS_DEBOUNCE_INTERVAL, .gpio = TL_WR802N_GPIO_BTN_RESET, - .active_low = 0, + .active_low = 1, } }; diff --git a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts index 68e1995c76..d81d477227 100644 --- a/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts +++ b/target/linux/ath79/dts/ar9330_glinet_gl-ar150.dts @@ -12,29 +12,31 @@ aliases { serial0 = &uart; - led-boot = &led_wlan; - led-failsafe = &led_wlan; - led-upgrade = &led_wlan; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; label-mac-device = ð0; }; leds { compatible = "gpio-leds"; - led_wlan: wlan { + wlan { label = "gl-ar150:orange:wlan"; gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0tpt"; }; - lan { - label = "gl-ar150:green:lan"; + configurable { + label = "gl-ar150:green:configurable"; gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; }; - wan { - label = "gl-ar150:green:wan"; + led_power: power { + label = "gl-ar150:green:power"; gpios = <&gpio 15 GPIO_ACTIVE_HIGH>; + default-state = "on"; }; }; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 3b433b2123..c4534386cd 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -116,10 +116,6 @@ glinet,6408|\ glinet,6416) ucidef_set_led_netdev "lan" "LAN" "gl-inet:green:lan" "eth0" ;; -glinet,gl-ar150) - ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1" - ucidef_set_led_switch "lan" "LAN" "$boardname:green:lan" "switch0" "0x02" - ;; glinet,gl-ar300m-lite) ucidef_set_led_netdev "lan" "LAN" "gl-ar300m-lite:green:lan" "eth0" ;; diff --git a/target/linux/bcm27xx/Makefile b/target/linux/bcm27xx/Makefile index 030e7d31fd..09f47c79be 100644 --- a/target/linux/bcm27xx/Makefile +++ b/target/linux/bcm27xx/Makefile @@ -27,7 +27,8 @@ DEFAULT_PACKAGES += \ kmod-usb-hid \ kmod-sound-core kmod-sound-arm-bcm2835 \ kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \ - partx-utils mkf2fs e2fsprogs + partx-utils mkf2fs e2fsprogs \ + htop autocore-raspberrypi KERNELNAME:=Image dtbs diff --git a/target/linux/bcm27xx/bcm2711/config-5.4 b/target/linux/bcm27xx/bcm2711/config-5.4 index 0463dcdebf..6b5f544a38 100644 --- a/target/linux/bcm27xx/bcm2711/config-5.4 +++ b/target/linux/bcm27xx/bcm2711/config-5.4 @@ -533,6 +533,7 @@ CONFIG_RESET_CONTROLLER=y CONFIG_RESET_SIMPLE=y CONFIG_RFS_ACCEL=y CONFIG_RODATA_FULL_DEFAULT_ENABLED=y +# CONFIG_RPI_AXIPERF is not set # CONFIG_RPIVID_MEM is not set CONFIG_RPS=y CONFIG_RWSEM_SPIN_ON_OWNER=y diff --git a/target/linux/bcm27xx/image/config.txt b/target/linux/bcm27xx/image/config.txt index f8ca1bf2d4..73d2a7d7ea 100644 --- a/target/linux/bcm27xx/image/config.txt +++ b/target/linux/bcm27xx/image/config.txt @@ -10,5 +10,14 @@ # OpenWrt config include distroconfig.txt +[pi2] +dtparam=i2c_arm=on,audio=on + +[pi3] +dtparam=i2c_arm=on,audio=on + +[pi4] +dtparam=i2c_arm=on,audio=on + [all] # Place your custom settings here. diff --git a/target/linux/bcm27xx/patches-4.19/950-0636-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-4.19/950-0636-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index 465697b912..2839cdb9d6 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0636-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0636-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1197,6 +1200,9 @@ +@@ -1202,6 +1205,9 @@ #define USB_VENDOR_ID_XAT 0x2505 #define USB_DEVICE_ID_XAT_CSR 0x0220 @@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell { 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 }, -@@ -175,6 +176,7 @@ static const struct hid_device_id hid_qu +@@ -176,6 +177,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 }, diff --git a/target/linux/generic/config-4.19 b/target/linux/generic/config-4.19 index a9ea57e5b2..5d0d0742ce 100644 --- a/target/linux/generic/config-4.19 +++ b/target/linux/generic/config-4.19 @@ -286,6 +286,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARC_IRQ_NO_AUTOSAVE is not set # CONFIG_ARM64_ERRATUM_1024718 is not set # CONFIG_ARM64_ERRATUM_1463225 is not set +# CONFIG_ARM64_ERRATUM_1542419 is not set # CONFIG_ARM64_ERRATUM_819472 is not set # CONFIG_ARM64_ERRATUM_824069 is not set # CONFIG_ARM64_ERRATUM_826319 is not set diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch index 3fa872a2fd..8da4a36205 100644 --- a/target/linux/generic/hack-4.9/220-gc_sections.patch +++ b/target/linux/generic/hack-4.9/220-gc_sections.patch @@ -21,7 +21,7 @@ Signed-off-by: Gabor Juhos --- a/Makefile +++ b/Makefile -@@ -402,6 +402,11 @@ KBUILD_LDFLAGS_MODULE := -T $(srctree)/s +@@ -402,6 +402,11 @@ KBUILD_LDFLAGS_MODULE = -T $(srctree)/sc GCC_PLUGINS_CFLAGS := CLANG_FLAGS := diff --git a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 0f6ce1f802..56b70697ee 100644 --- a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -5924,7 +5924,7 @@ static void __ref alloc_node_mem_map(str +@@ -5925,7 +5925,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/ramips/patches-4.14/0200-linkit_bootstrap.patch b/target/linux/ramips/patches-4.14/0200-linkit_bootstrap.patch index cd1462fbcf..865ae79f43 100644 --- a/target/linux/ramips/patches-4.14/0200-linkit_bootstrap.patch +++ b/target/linux/ramips/patches-4.14/0200-linkit_bootstrap.patch @@ -1,6 +1,6 @@ --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile -@@ -56,6 +56,7 @@ obj-$(CONFIG_CXL_BASE) += cxl/ +@@ -57,6 +57,7 @@ obj-$(CONFIG_CXL_BASE) += cxl/ obj-$(CONFIG_ASPEED_LPC_CTRL) += aspeed-lpc-ctrl.o obj-$(CONFIG_ASPEED_LPC_SNOOP) += aspeed-lpc-snoop.o obj-$(CONFIG_PCI_ENDPOINT_TEST) += pci_endpoint_test.o diff --git a/target/linux/x86/64/config-4.14 b/target/linux/x86/64/config-4.14 index 0d61df9824..f8c109442a 100644 --- a/target/linux/x86/64/config-4.14 +++ b/target/linux/x86/64/config-4.14 @@ -148,7 +148,7 @@ CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_ACPI=y CONFIG_GPIO_ICH=y -CONFIG_GPIO_IT87=y +# CONFIG_GPIO_IT87 is not set CONFIG_GPIO_LYNXPOINT=y CONFIG_GPIO_SCH=y CONFIG_GPIO_SYSFS=y diff --git a/target/linux/x86/64/config-4.19 b/target/linux/x86/64/config-4.19 index ba86d9d506..70e7e2f3a0 100644 --- a/target/linux/x86/64/config-4.19 +++ b/target/linux/x86/64/config-4.19 @@ -154,7 +154,7 @@ CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_ACPI=y CONFIG_GPIO_ICH=y -CONFIG_GPIO_IT87=y +# CONFIG_GPIO_IT87 is not set CONFIG_GPIO_LYNXPOINT=y CONFIG_GPIO_SCH=y CONFIG_GPIO_SYSFS=y diff --git a/target/linux/x86/64/config-4.9 b/target/linux/x86/64/config-4.9 index c69a15bfe9..1e31d8ce98 100644 --- a/target/linux/x86/64/config-4.9 +++ b/target/linux/x86/64/config-4.9 @@ -149,7 +149,7 @@ CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_ACPI=y CONFIG_GPIO_ICH=y -CONFIG_GPIO_IT87=y +# CONFIG_GPIO_IT87 is not set CONFIG_GPIO_LYNXPOINT=y CONFIG_GPIO_SCH=y CONFIG_GPIO_SYSFS=y diff --git a/target/linux/x86/64/config-5.4 b/target/linux/x86/64/config-5.4 index 5cae74061f..e466771df3 100644 --- a/target/linux/x86/64/config-5.4 +++ b/target/linux/x86/64/config-5.4 @@ -192,7 +192,7 @@ CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_ACPI=y CONFIG_GPIO_ICH=y -CONFIG_GPIO_IT87=y +# CONFIG_GPIO_IT87 is not set CONFIG_GPIO_LYNXPOINT=y CONFIG_GPIO_SCH=y CONFIG_GPIO_SYSFS=y diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index 6acefb2078..998c0f834d 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -21,7 +21,7 @@ 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 kmod-r8125 kmod-8139cp kmod-8139too kmod-fs-f2fs \ -htop lm-sensors autocore automount autosamba luci-app-ipsec-vpnd luci-proto-bonding luci-app-unblockmusic luci-app-zerotier luci-app-xlnetacc ddns-scripts_aliyun ddns-scripts_dnspod ca-certificates \ +htop lm-sensors autocore-x86 automount autosamba luci-app-ipsec-vpnd luci-proto-bonding luci-app-unblockmusic luci-app-zerotier luci-app-xlnetacc ddns-scripts_aliyun ddns-scripts_dnspod ca-certificates \ luci-app-airplay2 luci-app-music-remote-center luci-app-qbittorrent luci-app-amule luci-app-openvpn-server \ ath10k-firmware-qca988x ath10k-firmware-qca9888 ath10k-firmware-qca9984 brcmfmac-firmware-43602a1-pcie \ kmod-sound-hda-core kmod-sound-hda-codec-realtek kmod-sound-hda-codec-via kmod-sound-via82xx kmod-sound-hda-intel kmod-sound-hda-codec-hdmi kmod-sound-i8x0 kmod-usb-audio \ diff --git a/tools/Makefile b/tools/Makefile index ea76abd1d7..6f808d26d1 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -34,7 +34,7 @@ tools-$(CONFIG_TARGET_mxs) += elftosb sdimage tools-$(CONFIG_TARGET_ar71xx) += lzma-old tools-$(CONFIG_TARGET_ar71xx)$(CONFIG_TARGET_ath79) += squashfs tools-$(CONFIG_USES_MINOR) += kernel2minor -tools-y += lzma squashfskit4 zip +tools-y += lzma squashfskit4 zip zstd tools-$(BUILD_B43_TOOLS) += b43-tools tools-$(BUILD_ISL) += isl tools-$(CONFIG_USE_SPARSE) += sparse diff --git a/tools/firmware-utils/src/mkfwimage.c b/tools/firmware-utils/src/mkfwimage.c index 9e6d8f5b9a..ff9011a0c4 100644 --- a/tools/firmware-utils/src/mkfwimage.c +++ b/tools/firmware-utils/src/mkfwimage.c @@ -137,6 +137,15 @@ struct fw_info fw_info[] = { }, .sign = true, }, + { + .name = "XC", + .fw_layout = { + .kern_start = 0x9f050000, + .kern_entry = 0x80002000, + .firmware_max_length= 0x00F60000, + }, + .sign = true, + }, { .name = "ACB-ISP", .fw_layout = { diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile new file mode 100644 index 0000000000..7459725e8e --- /dev/null +++ b/tools/zstd/Makefile @@ -0,0 +1,20 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=zstd +PKG_VERSION:=1.4.4 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GITHUB/facebook/zstd/releases/download/v$(PKG_VERSION) +PKG_HASH:=a364f5162c7d1a455cc915e8e3cf5f4bd8b75d09bc0f53965b0c9ca1383c52c8 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:facebook:zstandard + +HOST_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/host-build.mk + +HOST_MAKE_FLAGS = PREFIX=$(HOST_BUILD_PREFIX) HAVE_ZLIB=0 HAVE_LZMA=0 HAVE_LZ4=0 + +$(eval $(call HostBuild)) diff --git a/tools/zstd/patches/0001-build-issue-More-portable-header-prefix-usage-1987.patch b/tools/zstd/patches/0001-build-issue-More-portable-header-prefix-usage-1987.patch new file mode 100644 index 0000000000..6d743aa385 --- /dev/null +++ b/tools/zstd/patches/0001-build-issue-More-portable-header-prefix-usage-1987.patch @@ -0,0 +1,61 @@ +From 06a57cf57e3c4e887cadcf688e3081154f3f6db4 Mon Sep 17 00:00:00 2001 +Message-Id: <06a57cf57e3c4e887cadcf688e3081154f3f6db4.1589392463.git.mschiffer@universe-factory.net> +From: Bimba Shrestha +Date: Thu, 6 Feb 2020 14:10:51 -0800 +Subject: [PATCH] [build-issue] More portable header prefix usage (#) (#1987) + +* make 4.3 build issue fix + +* Changing header name and adding comment +--- + programs/Makefile | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/programs/Makefile b/programs/Makefile +index b75314a83f43..a9ee3cb5311b 100644 +--- a/programs/Makefile ++++ b/programs/Makefile +@@ -94,9 +94,12 @@ endif + + VOID = /dev/null + ++# Make 4.3 doesn't support '\#' anymore (https://lwn.net/Articles/810071/) ++NUM_SYMBOL := \# ++ + # thread detection + NO_THREAD_MSG := ==> no threads, building without multithreading support +-HAVE_PTHREAD := $(shell printf '\#include \nint main(void) { return 0; }' > have_pthread.c && $(CC) $(FLAGS) -o have_pthread$(EXT) have_pthread.c -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0; rm have_pthread.c) ++HAVE_PTHREAD := $(shell printf '$(NUM_SYMBOL)include \nint main(void) { return 0; }' > have_pthread.c && $(CC) $(FLAGS) -o have_pthread$(EXT) have_pthread.c -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0; rm have_pthread.c) + HAVE_THREAD := $(shell [ "$(HAVE_PTHREAD)" -eq "1" -o -n "$(filter Windows%,$(OS))" ] && echo 1 || echo 0) + ifeq ($(HAVE_THREAD), 1) + THREAD_MSG := ==> building with threading support +@@ -108,7 +111,7 @@ endif + + # zlib detection + NO_ZLIB_MSG := ==> no zlib, building zstd without .gz support +-HAVE_ZLIB := $(shell printf '\#include \nint main(void) { return 0; }' > have_zlib.c && $(CC) $(FLAGS) -o have_zlib$(EXT) have_zlib.c -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0; rm have_zlib.c) ++HAVE_ZLIB := $(shell printf '$(NUM_SYMBOL)include \nint main(void) { return 0; }' > have_zlib.c && $(CC) $(FLAGS) -o have_zlib$(EXT) have_zlib.c -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0; rm have_zlib.c) + ifeq ($(HAVE_ZLIB), 1) + ZLIB_MSG := ==> building zstd with .gz compression support + ZLIBCPP = -DZSTD_GZCOMPRESS -DZSTD_GZDECOMPRESS +@@ -119,7 +122,7 @@ endif + + # lzma detection + NO_LZMA_MSG := ==> no liblzma, building zstd without .xz/.lzma support +-HAVE_LZMA := $(shell printf '\#include \nint main(void) { return 0; }' > have_lzma.c && $(CC) $(FLAGS) -o have_lzma$(EXT) have_lzma.c -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0; rm have_lzma.c) ++HAVE_LZMA := $(shell printf '$(NUM_SYMBOL)include \nint main(void) { return 0; }' > have_lzma.c && $(CC) $(FLAGS) -o have_lzma$(EXT) have_lzma.c -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0; rm have_lzma.c) + ifeq ($(HAVE_LZMA), 1) + LZMA_MSG := ==> building zstd with .xz/.lzma compression support + LZMACPP = -DZSTD_LZMACOMPRESS -DZSTD_LZMADECOMPRESS +@@ -130,7 +133,7 @@ endif + + # lz4 detection + NO_LZ4_MSG := ==> no liblz4, building zstd without .lz4 support +-HAVE_LZ4 := $(shell printf '\#include \n\#include \nint main(void) { return 0; }' > have_lz4.c && $(CC) $(FLAGS) -o have_lz4$(EXT) have_lz4.c -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0; rm have_lz4.c) ++HAVE_LZ4 := $(shell printf '$(NUM_SYMBOL)include \n\#include \nint main(void) { return 0; }' > have_lz4.c && $(CC) $(FLAGS) -o have_lz4$(EXT) have_lz4.c -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0; rm have_lz4.c) + ifeq ($(HAVE_LZ4), 1) + LZ4_MSG := ==> building zstd with .lz4 compression support + LZ4CPP = -DZSTD_LZ4COMPRESS -DZSTD_LZ4DECOMPRESS +-- +2.26.2 +