From 223cd2138374d9445c9a28613d716995d61f6296 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Wed, 16 Oct 2019 21:57:28 -0700 Subject: [PATCH 1/5] mbedtls: add support for x64 SSE2/AES-NI speedup --- package/libs/mbedtls/Makefile | 39 +++++++++++-- package/libs/mbedtls/patches/200-config.patch | 55 ++++++++----------- ...optimized-MULADDC-code-only-on-ARM-6.patch | 27 --------- 3 files changed, 57 insertions(+), 64 deletions(-) delete mode 100644 package/libs/mbedtls/patches/300-bn_mul.h-Use-optimized-MULADDC-code-only-on-ARM-6.patch diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index e265cac575..f03ae71d0c 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,18 +8,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.14.1 -PKG_RELEASE:=1 +PKG_VERSION:=2.16.3 +PKG_RELEASE:=2 PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz PKG_SOURCE_URL:=https://tls.mbed.org/download/ -PKG_HASH:=baa1121952786f5b2c66c52226a8ca0e05126de920d1756266551df677915b7e +PKG_HASH:=fd01fe4b289116df7781d05e1ef712b6c98823c5334f4a27404f13a8d066ef6a PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ PKG_CPE_ID:=cpe:/a:arm:mbed_tls +PKG_CONFIG_DEPENDS:=CONFIG_LIBMBEDTLS_HAVE_SSE2 + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -39,7 +41,23 @@ $(call Package/mbedtls/Default) CATEGORY:=Libraries SUBMENU:=SSL TITLE+= (library) - ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) + ABI_VERSION:=12 +endef + +define Package/libmbedtls/config +config LIBMBEDTLS_HAVE_SSE2 + depends on PACKAGE_libmbedtls + bool + default y if x86_64 + prompt "Enable use of x86 SSE2 instructions" + depends on x86_64 + help + Use of SSE2 instructions greatly increase performance (up to + 3x faster) with a minimum (~0.2%, or 23KB) increase in package + size, but it will bring no benefit if your hardware does not + support them, such as Geode GX and LX. In this case you may + save 23KB by saying yes here. AMD Geode NX, and Intel + Pentium 4 and above support SSE2. endef define Package/mbedtls-util @@ -71,6 +89,17 @@ CMAKE_OPTIONS += \ -DENABLE_TESTING:Bool=OFF \ -DENABLE_PROGRAMS:Bool=ON +define Build/Configure + $(Build/Configure/Default) + + awk 'BEGIN { rc = 1 } \ + /#define MBEDTLS_HAVE_SSE2/ { $$$$0 = "$(if $(CONFIG_LIBMBEDTLS_HAVE_SSE2),,// )#define MBEDTLS_HAVE_SSE2"; rc = 0 } \ + { print } \ + END { exit(rc) }' $(PKG_BUILD_DIR)/include/mbedtls/config.h \ + >$(PKG_BUILD_DIR)/include/mbedtls/config.h.new && \ + mv $(PKG_BUILD_DIR)/include/mbedtls/config.h.new $(PKG_BUILD_DIR)/include/mbedtls/config.h +endef + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/mbedtls $(1)/usr/include/ @@ -81,7 +110,7 @@ endef define Package/libmbedtls/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ endef define Package/mbedtls-util/install diff --git a/package/libs/mbedtls/patches/200-config.patch b/package/libs/mbedtls/patches/200-config.patch index 387d7ffc78..a09cf1f49b 100644 --- a/package/libs/mbedtls/patches/200-config.patch +++ b/package/libs/mbedtls/patches/200-config.patch @@ -1,6 +1,6 @@ --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h -@@ -557,14 +557,14 @@ +@@ -633,14 +633,14 @@ * * Enable Output Feedback mode (OFB) for symmetric ciphers. */ @@ -17,7 +17,7 @@ /** * \def MBEDTLS_CIPHER_NULL_CIPHER -@@ -654,19 +654,19 @@ +@@ -750,19 +750,19 @@ * * Comment macros to disable the curve and functions for it */ @@ -46,7 +46,7 @@ /** * \def MBEDTLS_ECP_NIST_OPTIM -@@ -768,7 +768,7 @@ +@@ -864,7 +864,7 @@ * See dhm.h for more details. * */ @@ -55,7 +55,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -@@ -788,7 +788,7 @@ +@@ -884,7 +884,7 @@ * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA */ @@ -64,7 +64,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -@@ -813,7 +813,7 @@ +@@ -909,7 +909,7 @@ * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA */ @@ -73,7 +73,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -@@ -947,7 +947,7 @@ +@@ -1043,7 +1043,7 @@ * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 */ @@ -82,7 +82,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -@@ -971,7 +971,7 @@ +@@ -1067,7 +1067,7 @@ * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 */ @@ -91,7 +91,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED -@@ -1075,7 +1075,7 @@ +@@ -1171,7 +1171,7 @@ * This option is only useful if both MBEDTLS_SHA256_C and * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. */ @@ -100,7 +100,7 @@ /** * \def MBEDTLS_ENTROPY_NV_SEED -@@ -1170,14 +1170,14 @@ +@@ -1266,14 +1266,14 @@ * Uncomment this macro to disable the use of CRT in RSA. * */ @@ -117,7 +117,7 @@ /** * \def MBEDTLS_SHA256_SMALLER -@@ -1331,7 +1331,7 @@ +@@ -1427,7 +1427,7 @@ * configuration of this extension). * */ @@ -126,7 +126,7 @@ /** * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO -@@ -1506,7 +1506,7 @@ +@@ -1602,7 +1602,7 @@ * * Comment this macro to disable support for SSL session tickets */ @@ -135,7 +135,7 @@ /** * \def MBEDTLS_SSL_EXPORT_KEYS -@@ -1536,7 +1536,7 @@ +@@ -1632,7 +1632,7 @@ * * Comment this macro to disable support for truncated HMAC in SSL */ @@ -144,7 +144,7 @@ /** * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT -@@ -1595,7 +1595,7 @@ +@@ -1691,7 +1691,7 @@ * * Comment this to disable run-time checking and save ROM space */ @@ -153,7 +153,7 @@ /** * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 -@@ -1925,7 +1925,7 @@ +@@ -2021,7 +2021,7 @@ * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 */ @@ -162,7 +162,7 @@ /** * \def MBEDTLS_ARIA_C -@@ -1991,7 +1991,7 @@ +@@ -2087,7 +2087,7 @@ * This module enables the AES-CCM ciphersuites, if other requisites are * enabled as well. */ @@ -171,7 +171,7 @@ /** * \def MBEDTLS_CERTS_C -@@ -2003,7 +2003,7 @@ +@@ -2099,7 +2099,7 @@ * * This module is used for testing (ssl_client/server). */ @@ -180,16 +180,7 @@ /** * \def MBEDTLS_CHACHA20_C -@@ -2078,7 +2078,7 @@ - * - * This module provides debugging functions. - */ --#define MBEDTLS_DEBUG_C -+//#define MBEDTLS_DEBUG_C - - /** - * \def MBEDTLS_DES_C -@@ -2107,7 +2107,7 @@ +@@ -2203,7 +2203,7 @@ * \warning DES is considered a weak cipher and its use constitutes a * security risk. We recommend considering stronger ciphers instead. */ @@ -198,7 +189,7 @@ /** * \def MBEDTLS_DHM_C -@@ -2270,7 +2270,7 @@ +@@ -2366,7 +2366,7 @@ * This module adds support for the Hashed Message Authentication Code * (HMAC)-based key derivation function (HKDF). */ @@ -207,7 +198,7 @@ /** * \def MBEDTLS_HMAC_DRBG_C -@@ -2580,7 +2580,7 @@ +@@ -2676,7 +2676,7 @@ * * This module enables abstraction of common (libc) functions. */ @@ -216,7 +207,7 @@ /** * \def MBEDTLS_POLY1305_C -@@ -2601,7 +2601,7 @@ +@@ -2697,7 +2697,7 @@ * Caller: library/md.c * */ @@ -225,7 +216,7 @@ /** * \def MBEDTLS_RSA_C -@@ -2708,7 +2708,7 @@ +@@ -2804,7 +2804,7 @@ * * Requires: MBEDTLS_CIPHER_C */ @@ -234,7 +225,7 @@ /** * \def MBEDTLS_SSL_CLI_C -@@ -2808,7 +2808,7 @@ +@@ -2904,7 +2904,7 @@ * * This module provides run-time version information. */ @@ -243,7 +234,7 @@ /** * \def MBEDTLS_X509_USE_C -@@ -2918,7 +2918,7 @@ +@@ -3014,7 +3014,7 @@ * Module: library/xtea.c * Caller: */ diff --git a/package/libs/mbedtls/patches/300-bn_mul.h-Use-optimized-MULADDC-code-only-on-ARM-6.patch b/package/libs/mbedtls/patches/300-bn_mul.h-Use-optimized-MULADDC-code-only-on-ARM-6.patch deleted file mode 100644 index b6c60f0019..0000000000 --- a/package/libs/mbedtls/patches/300-bn_mul.h-Use-optimized-MULADDC-code-only-on-ARM-6.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 7aff5a70f3580426865b6c86437a3e47546d13f7 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Sun, 16 Dec 2018 13:02:49 +0100 -Subject: [PATCH] bn_mul.h: Use optimized MULADDC code only on ARM >= 6 - -The optimized code uses umaal which was only introduced with ARMv6 and -is not available on older versions. -This broke compilation with arm926ej-s CPU for me. - -Fixes: 16b1bd89326 ("bn_mul.h: add ARM DSP optimized MULADDC code") -Signed-off-by: Hauke Mehrtens ---- - include/mbedtls/bn_mul.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/include/mbedtls/bn_mul.h -+++ b/include/mbedtls/bn_mul.h -@@ -638,7 +638,8 @@ - "r6", "r7", "r8", "r9", "cc" \ - ); - --#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) -+#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) && \ -+ __TARGET_ARCH_ARM >= 6 - - #define MULADDC_INIT \ - asm( From 88237cd41a46d833cf3ea69ccd444e7e6e72eb7f Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Wed, 16 Oct 2019 22:35:03 -0700 Subject: [PATCH 2/5] luci-app-unblockmusic: redir 443 ports for Windows 10 Neteaste Music --- package/lean/luci-app-unblockmusic/Makefile | 2 +- .../lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/lean/luci-app-unblockmusic/Makefile b/package/lean/luci-app-unblockmusic/Makefile index 444c83402b..2f6d1813d0 100644 --- a/package/lean/luci-app-unblockmusic/Makefile +++ b/package/lean/luci-app-unblockmusic/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-unblockmusic PKG_VERSION:=2.2.0 -PKG_RELEASE:=2 +PKG_RELEASE:=5 PKG_LICENSE:=Apache-2.0 diff --git a/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic b/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic index f9659e1d6b..a31bfaadf1 100755 --- a/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic +++ b/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic @@ -22,11 +22,11 @@ add_rule() $ipt_n -A cloud_music -d 224.0.0.0/4 -j RETURN $ipt_n -A cloud_music -d 240.0.0.0/4 -j RETURN $ipt_n -A cloud_music -p tcp -j REDIRECT --to-ports 5200 - $ipt_n -I PREROUTING -p tcp --dport 80 -m set --match-set music dst -j cloud_music + $ipt_n -I PREROUTING -p tcp -m multiport --dports 80,443 -m set --match-set music dst -j cloud_music } del_rule(){ - $ipt_n -D PREROUTING -p tcp --dport 80 -m set --match-set music dst -j cloud_music 2>/dev/null + $ipt_n -D PREROUTING -p tcp -m multiport --dports 80,443 -m set --match-set music dst -j cloud_music 2>/dev/null $ipt_n -F cloud_music 2>/dev/null $ipt_n -X cloud_music 2>/dev/null From 41d66b3864d1119b0e2a1381d792cc98881d8415 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Thu, 17 Oct 2019 01:39:57 -0700 Subject: [PATCH 3/5] Revert "luci-app-unblockmusic: redir 443 ports for Windows 10 Neteaste Music" This reverts commit 88237cd41a46d833cf3ea69ccd444e7e6e72eb7f. --- package/lean/luci-app-unblockmusic/Makefile | 2 +- .../lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/lean/luci-app-unblockmusic/Makefile b/package/lean/luci-app-unblockmusic/Makefile index 2f6d1813d0..444c83402b 100644 --- a/package/lean/luci-app-unblockmusic/Makefile +++ b/package/lean/luci-app-unblockmusic/Makefile @@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-unblockmusic PKG_VERSION:=2.2.0 -PKG_RELEASE:=5 +PKG_RELEASE:=2 PKG_LICENSE:=Apache-2.0 diff --git a/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic b/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic index a31bfaadf1..f9659e1d6b 100755 --- a/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic +++ b/package/lean/luci-app-unblockmusic/root/etc/init.d/unblockmusic @@ -22,11 +22,11 @@ add_rule() $ipt_n -A cloud_music -d 224.0.0.0/4 -j RETURN $ipt_n -A cloud_music -d 240.0.0.0/4 -j RETURN $ipt_n -A cloud_music -p tcp -j REDIRECT --to-ports 5200 - $ipt_n -I PREROUTING -p tcp -m multiport --dports 80,443 -m set --match-set music dst -j cloud_music + $ipt_n -I PREROUTING -p tcp --dport 80 -m set --match-set music dst -j cloud_music } del_rule(){ - $ipt_n -D PREROUTING -p tcp -m multiport --dports 80,443 -m set --match-set music dst -j cloud_music 2>/dev/null + $ipt_n -D PREROUTING -p tcp --dport 80 -m set --match-set music dst -j cloud_music 2>/dev/null $ipt_n -F cloud_music 2>/dev/null $ipt_n -X cloud_music 2>/dev/null From b2d1e25edb6bd76a229cbe11a657e5aae6929989 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Thu, 17 Oct 2019 02:14:00 -0700 Subject: [PATCH 4/5] luci-app-baidupcs-web: add packege --- package/lean/BaiduPCS-Web/Makefile | 77 +++++++++++++++++++ package/lean/luci-app-baidupcs-web/Makefile | 17 ++++ .../luasrc/controller/baidupcs-web.lua | 10 +++ .../luasrc/model/cbi/baidupcs-web.lua | 46 +++++++++++ .../root/etc/config/baidupcs-web | 6 ++ .../root/etc/init.d/baidupcs-web | 21 +++++ .../root/etc/uci-defaults/luci-baidupcs-web | 11 +++ 7 files changed, 188 insertions(+) create mode 100644 package/lean/BaiduPCS-Web/Makefile create mode 100644 package/lean/luci-app-baidupcs-web/Makefile create mode 100644 package/lean/luci-app-baidupcs-web/luasrc/controller/baidupcs-web.lua create mode 100644 package/lean/luci-app-baidupcs-web/luasrc/model/cbi/baidupcs-web.lua create mode 100644 package/lean/luci-app-baidupcs-web/root/etc/config/baidupcs-web create mode 100755 package/lean/luci-app-baidupcs-web/root/etc/init.d/baidupcs-web create mode 100755 package/lean/luci-app-baidupcs-web/root/etc/uci-defaults/luci-baidupcs-web diff --git a/package/lean/BaiduPCS-Web/Makefile b/package/lean/BaiduPCS-Web/Makefile new file mode 100644 index 0000000000..447238c69c --- /dev/null +++ b/package/lean/BaiduPCS-Web/Makefile @@ -0,0 +1,77 @@ +# +# Copyright (C) 2019 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v3. +# +# By https://github.com/KFERMercer/openwrt-baidupcs-web + +include $(TOPDIR)/rules.mk + +PKG_NAME:=BaiduPCS-Web +PKG_VERSION:=3.6.8 +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=net + CATEGORY:=Network + TITLE:=BaiduPCS-Web is a web controller for BaiduPCS-Go + URL:=https://github.com/liuzhuoling2011/baidupcs-web +endef + + +define Package/$(PKG_NAME)/description +BaiduPCS-Web is a web controller for BaiduPCS-Go +endef + +STRIP:=true + +ifeq ($(ARCH),x86_64) + PKG_ARCH_BAIDUPCS-WEB:=amd64 +endif + +ifeq ($(ARCH),mipsel) + PKG_ARCH_BAIDUPCS-WEB:=mipsle +endif + +ifeq ($(ARCH),i386) + PKG_ARCH_BAIDUPCS-WEB:=86 +endif + +ifeq ($(ARCH),arm) + PKG_ARCH_BAIDUPCS-WEB:=arm +endif + +ifeq ($(ARCH),arm64) + PKG_ARCH_BAIDUPCS-WEB:=arm64 +endif + +ifeq ($(ARCH),aarch64) + PKG_ARCH_BAIDUPCS-WEB:=arm64 +endif + +BAIDUPCS-WEB_ZIP_NAME:=BaiduPCS-Go-$(PKG_VERSION)-linux-$(PKG_ARCH_BAIDUPCS-WEB) +PKG_SOURCE:=$(BAIDUPCS-WEB_ZIP_NAME).zip +PKG_SOURCE_URL:=https://github.com/liuzhuoling2011/baidupcs-web/releases/download/$(PKG_VERSION)/ +UNZIP_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)-unzip/$(PKG_ARCH_BAIDUPCS-WEB) +PKG_HASH:=skip + +define Build/Prepare + mkdir -vp $(UNZIP_DIR) + unzip -od $(UNZIP_DIR) $(DL_DIR)/$(BAIDUPCS-WEB_ZIP_NAME).zip +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(UNZIP_DIR)/$(BAIDUPCS-WEB_ZIP_NAME)/BaiduPCS-Go $(1)/usr/bin/$(PKG_NAME) + chmod 755 $(1)/usr/bin/$(PKG_NAME) +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/lean/luci-app-baidupcs-web/Makefile b/package/lean/luci-app-baidupcs-web/Makefile new file mode 100644 index 0000000000..94a90f6619 --- /dev/null +++ b/package/lean/luci-app-baidupcs-web/Makefile @@ -0,0 +1,17 @@ +# Copyright (C) 2016 Openwrt.org +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=LuCI Support for BaiduPCS-Web +LUCI_DEPENDS:=+BaiduPCS-Web +wget +openssl-util +LUCI_PKGARCH:=all +PKG_VERSION:=1.0 +PKG_RELEASE:=1 + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature + diff --git a/package/lean/luci-app-baidupcs-web/luasrc/controller/baidupcs-web.lua b/package/lean/luci-app-baidupcs-web/luasrc/controller/baidupcs-web.lua new file mode 100644 index 0000000000..0851eba52f --- /dev/null +++ b/package/lean/luci-app-baidupcs-web/luasrc/controller/baidupcs-web.lua @@ -0,0 +1,10 @@ +module("luci.controller.baidupcs-web", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/baidupcs-web") then + return + end + local page + page = entry({"admin", "nas", "baidupcs-web"}, cbi("baidupcs-web"), _("BaiduPCS Web"), 300) + page.dependent = true +end diff --git a/package/lean/luci-app-baidupcs-web/luasrc/model/cbi/baidupcs-web.lua b/package/lean/luci-app-baidupcs-web/luasrc/model/cbi/baidupcs-web.lua new file mode 100644 index 0000000000..ca2aa3d4f0 --- /dev/null +++ b/package/lean/luci-app-baidupcs-web/luasrc/model/cbi/baidupcs-web.lua @@ -0,0 +1,46 @@ +require("luci.sys") +require("luci.util") + +local fs = require "nixio.fs" + +local uci = require "luci.model.uci".cursor() + +local m, s + +local running=(luci.sys.call("pidof BaiduPCS-Web > /dev/null") == 0) + +local button = "" +local state_msg = "" +local trport = uci:get("baidupcs-web", "config", "port") +if running then + button = "      " +end + +if running then + state_msg = "" .. translate("BaiduPCS-Web 运行中") .. "" +else + state_msg = "" .. translate("BaiduPCS-Web 未运行") .. "" +end + +m = Map("baidupcs-web", translate("百度网盘管理"), translate("基于BaiduPCS-Web,让你高效的使用百度云。") .. button + .. "

" .. translate("BaiduPCS-Web运行状态").. " : " .. state_msg .. "
") + +s = m:section(TypedSection, "baidupcs-web", "") +s.addremove = false +s.anonymous = true + +enable = s:option(Flag, "enabled", translate("启用")) +enable.rmempty = false + +o = s:option(Value, "port", translate("监听端口")) +o.placeholder = 5299 +o.default = 5299 +o.datatype = "port" +o.rmempty = false + +o = s:option(Value, "dl_dir", translate("下载目录")) +o.placeholder = "/opt/baidupcsweb-download" +o.default = "/opt/baidupcsweb-download" +o.rmempty = false + +return m diff --git a/package/lean/luci-app-baidupcs-web/root/etc/config/baidupcs-web b/package/lean/luci-app-baidupcs-web/root/etc/config/baidupcs-web new file mode 100644 index 0000000000..ef19f7ed2a --- /dev/null +++ b/package/lean/luci-app-baidupcs-web/root/etc/config/baidupcs-web @@ -0,0 +1,6 @@ + +config baidupcs-web 'config' + option port '5299' + option enabled '0' + option dl_dir '/opt/baidupcsweb-download' + diff --git a/package/lean/luci-app-baidupcs-web/root/etc/init.d/baidupcs-web b/package/lean/luci-app-baidupcs-web/root/etc/init.d/baidupcs-web new file mode 100755 index 0000000000..ff7c72f2ac --- /dev/null +++ b/package/lean/luci-app-baidupcs-web/root/etc/init.d/baidupcs-web @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2019 By [CTCGFW] Project OpenWRT + +START=90 +STOP=10 + +enabled="$(uci get baidupcs-web.config.enabled)" +port="$(uci get baidupcs-web.config.port)" +dl_dir="$(uci get baidupcs-web.config.dl_dir)" + +start() { + stop + [ "$enabled" == "1" ] || exit 0 + mkdir -p "${dl_dir}" + BaiduPCS-Web config set -savedir="${dl_dir}" >/dev/null 2>&1 + BaiduPCS-Web web --port "${port}" --access >/dev/null 2>&1 & +} + +stop() { + killall BaiduPCS-Web >/dev/null 2>&1 +} diff --git a/package/lean/luci-app-baidupcs-web/root/etc/uci-defaults/luci-baidupcs-web b/package/lean/luci-app-baidupcs-web/root/etc/uci-defaults/luci-baidupcs-web new file mode 100755 index 0000000000..e72523b798 --- /dev/null +++ b/package/lean/luci-app-baidupcs-web/root/etc/uci-defaults/luci-baidupcs-web @@ -0,0 +1,11 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@baidupcs-web[-1] + add ucitrack baidupcs-web + set ucitrack.@baidupcs-web[-1].init=baidupcs-web + commit ucitrack +EOF + +rm -f /tmp/luci-indexcache +exit 0 From 634ed26b5cb421954dd70695eadaeb17fcbaae62 Mon Sep 17 00:00:00 2001 From: LEAN-ESX Date: Thu, 17 Oct 2019 02:48:14 -0700 Subject: [PATCH 5/5] x64: build proper VMDK formats for ESXI 6.5+ --- target/linux/x86/image/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index 4936875cda..44013ccd4e 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -246,13 +246,13 @@ endif ifneq ($(CONFIG_VMDK_IMAGES),) define Image/Build/vmdk rm $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vmdk || true - qemu-img convert -f raw -O vmdk \ + /usr/bin/qemu-img convert -f raw -O vmdk -o adapter_type=lsilogic \ $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \ $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vmdk endef define Image/Build/vmdk_efi rm $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vmdk || true - qemu-img convert -f raw -O vmdk \ + /usr/bin/qemu-img convert -f raw -O vmdk -o adapter_type=lsilogic \ $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img \ $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vmdk endef