From 2969ff63f85173d7a046cae1a43b37a1f6f14025 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 12 Jul 2020 23:03:03 +0800 Subject: [PATCH 1/7] toolchain: improve gcc 10.1.0 support --- .../patches/10.1.0/002-case_insensitive.patch | 2 +- .../patches/10.1.0/010-documentation.patch | 2 +- .../10.1.0/110-Fix-MIPS-PR-84790.patch | 2 +- .../gcc/patches/10.1.0/230-musl_libssp.patch | 2 +- .../300-mips_Os_cpu_rtx_cost_model.patch | 2 +- .../gcc/patches/10.1.0/820-libgcc_pic.patch | 6 ++--- .../840-armv4_pass_fix-v4bx_to_ld.patch | 2 +- .../10.1.0/850-use_shared_libgcc.patch | 2 +- .../patches/10.1.0/870-ppc_no_crtsavres.patch | 11 ++++++++++ .../patches/10.1.0/881-no_tm_section.patch | 4 ++-- .../gcc/patches/10.1.0/910-mbsd_multi.patch | 14 ++++++------ .../10.1.0/920-specs_nonfatal_getenv.patch | 2 +- .../10.1.0/930-fix-mips-noexecstack.patch | 22 +++++++++---------- 13 files changed, 42 insertions(+), 31 deletions(-) create mode 100644 toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch diff --git a/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch b/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch index 3442076d7d..409497e5a3 100644 --- a/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch +++ b/toolchain/gcc/patches/10.1.0/002-case_insensitive.patch @@ -10,7 +10,7 @@ Date: Sun Oct 19 21:45:51 2014 +0000 --- a/include/filenames.h +++ b/include/filenames.h -@@ -43,11 +43,6 @@ extern "C" { +@@ -44,11 +44,6 @@ extern "C" { # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) #else /* not DOSish */ diff --git a/toolchain/gcc/patches/10.1.0/010-documentation.patch b/toolchain/gcc/patches/10.1.0/010-documentation.patch index c3a6a15901..9783ff1ef0 100644 --- a/toolchain/gcc/patches/10.1.0/010-documentation.patch +++ b/toolchain/gcc/patches/10.1.0/010-documentation.patch @@ -12,7 +12,7 @@ Date: Tue Feb 26 16:16:33 2013 +0000 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in -@@ -3203,18 +3203,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) +@@ -3283,18 +3283,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) doc/gccint.info: $(TEXI_GCCINT_FILES) doc/cppinternals.info: $(TEXI_CPPINT_FILES) diff --git a/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch b/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch index c7e60e3157..82ac013d30 100644 --- a/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch +++ b/toolchain/gcc/patches/10.1.0/110-Fix-MIPS-PR-84790.patch @@ -5,7 +5,7 @@ instructions. --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c -@@ -3131,6 +3131,12 @@ mips_emit_call_insn (rtx pattern, rtx or +@@ -3132,6 +3132,12 @@ mips_emit_call_insn (rtx pattern, rtx or emit_insn (gen_update_got_version ()); } diff --git a/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch b/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch index 41d75b0206..63f37662f4 100644 --- a/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch +++ b/toolchain/gcc/patches/10.1.0/230-musl_libssp.patch @@ -1,6 +1,6 @@ --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -876,7 +876,9 @@ proper position among the other output f +@@ -875,7 +875,9 @@ proper position among the other output f #endif #ifndef LINK_SSP_SPEC diff --git a/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch index 5caa852a16..8c4a5fce19 100644 --- a/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch +++ b/toolchain/gcc/patches/10.1.0/300-mips_Os_cpu_rtx_cost_model.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c -@@ -19994,7 +19994,7 @@ mips_option_override (void) +@@ -20041,7 +20041,7 @@ mips_option_override (void) flag_pcc_struct_return = 0; /* Decide which rtx_costs structure to use. */ diff --git a/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch b/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch index 0a316d35bf..ddd6cf8732 100644 --- a/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch +++ b/toolchain/gcc/patches/10.1.0/820-libgcc_pic.patch @@ -8,7 +8,7 @@ Date: Mon Oct 19 23:26:09 2009 +0000 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in -@@ -927,11 +927,12 @@ $(libgcov-driver-objects): %$(objext): $ +@@ -929,11 +929,12 @@ $(libgcov-driver-objects): %$(objext): $ # Static libraries. libgcc.a: $(libgcc-objects) @@ -22,7 +22,7 @@ Date: Mon Oct 19 23:26:09 2009 +0000 -rm -f $@ objects="$(objects)"; \ -@@ -955,7 +956,7 @@ all: libunwind.a +@@ -957,7 +958,7 @@ all: libunwind.a endif ifeq ($(enable_shared),yes) @@ -31,7 +31,7 @@ Date: Mon Oct 19 23:26:09 2009 +0000 ifneq ($(LIBUNWIND),) all: libunwind$(SHLIB_EXT) libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1161,6 +1162,10 @@ install-shared: +@@ -1163,6 +1164,10 @@ install-shared: chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a diff --git a/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch index 18aa021b93..e3cb616c4e 100644 --- a/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch +++ b/toolchain/gcc/patches/10.1.0/840-armv4_pass_fix-v4bx_to_ld.patch @@ -11,7 +11,7 @@ Date: Wed Feb 2 19:34:36 2011 +0000 +++ b/gcc/config/arm/linux-eabi.h @@ -91,10 +91,15 @@ #define MUSL_DYNAMIC_LINKER \ - "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}%{mfdpic:-fdpic}.so.1" +/* For armv4 we pass --fix-v4bx to linker to support EABI */ +#undef TARGET_FIX_V4BX_SPEC diff --git a/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch index a765e55a46..8b17f1374f 100644 --- a/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch +++ b/toolchain/gcc/patches/10.1.0/850-use_shared_libgcc.patch @@ -7,7 +7,7 @@ Date: Sun Feb 12 20:25:47 2012 +0000 SVN-Revision: 30486 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h -@@ -129,10 +129,6 @@ +@@ -132,10 +132,6 @@ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) diff --git a/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch new file mode 100644 index 0000000000..bc182f0cec --- /dev/null +++ b/toolchain/gcc/patches/10.1.0/870-ppc_no_crtsavres.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/rs6000/rs6000-logue.c ++++ b/gcc/config/rs6000/rs6000-logue.c +@@ -348,7 +348,7 @@ rs6000_savres_strategy (rs6000_stack_t * + /* Define cutoff for using out-of-line functions to save registers. */ + if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) + { +- if (!optimize_size) ++ if (1) + { + strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; + strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch b/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch index 6df06e0974..2029910fd0 100644 --- a/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch +++ b/toolchain/gcc/patches/10.1.0/881-no_tm_section.patch @@ -1,8 +1,8 @@ --- a/libgcc/crtstuff.c +++ b/libgcc/crtstuff.c -@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ +@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ #endif - + #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) -# define USE_TM_CLONE_REGISTRY 1 +# define USE_TM_CLONE_REGISTRY 0 diff --git a/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch b/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch index 8908e7bfcf..452cc1cb4e 100644 --- a/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch +++ b/toolchain/gcc/patches/10.1.0/910-mbsd_multi.patch @@ -27,7 +27,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 static void handle_OPT_d (const char *); static void set_std_cxx98 (int); static void set_std_cxx11 (int); -@@ -452,6 +455,12 @@ c_common_handle_option (size_t scode, co +@@ -455,6 +458,12 @@ c_common_handle_option (size_t scode, co flag_no_builtin = !value; break; @@ -40,7 +40,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 case OPT_fconstant_string_class_: constant_string_class_name = arg; break; -@@ -1138,6 +1147,47 @@ c_common_init (void) +@@ -1168,6 +1177,47 @@ c_common_init (void) return false; } @@ -90,9 +90,9 @@ Date: Tue Jul 31 00:52:27 2007 +0000 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt -@@ -1521,6 +1521,9 @@ C++ ObjC++ Optimization Alias(fexception +@@ -1590,6 +1590,9 @@ C++ ObjC++ Optimization Alias(fexception fhonor-std - C++ ObjC++ Deprecated + C++ ObjC++ WarnRemoved +fhonour-copts +C ObjC C++ ObjC++ RejectNegative @@ -102,7 +102,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 Assume normal C execution environment. --- a/gcc/common.opt +++ b/gcc/common.opt -@@ -1589,6 +1589,9 @@ fguess-branch-probability +@@ -1657,6 +1657,9 @@ fguess-branch-probability Common Report Var(flag_guess_branch_prob) Optimization Enable guessing of branch probabilities. @@ -114,7 +114,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 ; On SVR4 targets, it also controls whether or not to emit a --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi -@@ -7666,6 +7666,17 @@ This option is only supported for C and +@@ -8169,6 +8169,17 @@ This option is only supported for C and @option{-Wall} and by @option{-Wpedantic}, which can be disabled with @option{-Wno-pointer-sign}. @@ -134,7 +134,7 @@ Date: Tue Jul 31 00:52:27 2007 +0000 @opindex Wno-stack-protector --- a/gcc/opts.c +++ b/gcc/opts.c -@@ -2314,6 +2314,9 @@ common_handle_option (struct gcc_options +@@ -2308,6 +2308,9 @@ common_handle_option (struct gcc_options /* Currently handled in a prescan. */ break; diff --git a/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch index db27950de8..487b9e47cb 100644 --- a/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch +++ b/toolchain/gcc/patches/10.1.0/920-specs_nonfatal_getenv.patch @@ -7,7 +7,7 @@ Date: Sat Apr 21 03:02:39 2012 +0000 --- a/gcc/gcc.c +++ b/gcc/gcc.c -@@ -9318,8 +9318,10 @@ getenv_spec_function (int argc, const ch +@@ -9396,8 +9396,10 @@ getenv_spec_function (int argc, const ch } if (!value) diff --git a/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch index 95d13abad0..e795acd1de 100644 --- a/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch +++ b/toolchain/gcc/patches/10.1.0/930-fix-mips-noexecstack.patch @@ -48,9 +48,9 @@ sellcey@mips.com --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c -@@ -22822,6 +22822,9 @@ mips_starting_frame_offset (void) - #undef TARGET_STARTING_FRAME_OFFSET - #define TARGET_STARTING_FRAME_OFFSET mips_starting_frame_offset +@@ -22881,6 +22881,9 @@ mips_asm_file_end (void) + #define TARGET_ASM_FILE_END mips_asm_file_end + +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack @@ -60,9 +60,9 @@ sellcey@mips.com #include "gt-mips.h" --- a/libgcc/config/mips/crti.S +++ b/libgcc/config/mips/crti.S -@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ +@@ -24,6 +24,10 @@ see the files COPYING3 and COPYING.RUNTI + /* An executable stack is *not* required for these functions. */ + #include "gnustack.h" + +/* An executable stack is *not* required for these functions. */ @@ -73,9 +73,9 @@ sellcey@mips.com --- a/libgcc/config/mips/crtn.S +++ b/libgcc/config/mips/crtn.S -@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ +@@ -24,6 +24,9 @@ see the files COPYING3 and COPYING.RUNTI + /* An executable stack is *not* required for these functions. */ + #include "gnustack.h" +/* An executable stack is *not* required for these functions. */ + .section .note.GNU-stack,"",%progbits @@ -85,7 +85,7 @@ sellcey@mips.com --- a/libgcc/config/mips/mips16.S +++ b/libgcc/config/mips/mips16.S -@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI +@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI values using the soft-float calling convention, but do the actual operation using the hard floating point instructions. */ @@ -98,7 +98,7 @@ sellcey@mips.com /* This file contains 32-bit assembly code. */ --- a/libgcc/config/mips/vr4120-div.S +++ b/libgcc/config/mips/vr4120-div.S -@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI +@@ -29,6 +29,10 @@ see the files COPYING3 and COPYING.RUNTI -mfix-vr4120. div and ddiv do not give the correct result when one of the operands is negative. */ From 407c2c8e7557eebdeb0c845ed4b5199f015fbaeb Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Sun, 12 Jul 2020 13:25:39 +0100 Subject: [PATCH 2/7] scripts/env: Fix 56f813674a scripts/env: use command -v instead of which We don't need to see how git will be executed and it produces non silent output on 'scripts/env diff' commands when there are no differences unlike before. Re-introduce original silent behaviour. Signed-off-by: Kevin Darbyshire-Bryant --- scripts/env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/env b/scripts/env index 726a354b57..df8b486bfe 100755 --- a/scripts/env +++ b/scripts/env @@ -57,7 +57,7 @@ env_init() { if [ -z "$CREATE" ]; then [ -d "$ENVDIR" ] || exit 0 fi - command -v git || error "Git is not installed" + command -v git >/dev/null || error "Git is not installed" mkdir -p "$ENVDIR" || error "Failed to create the environment directory" cd "$ENVDIR" || error "Failed to switch to the environment directory" [ -d .git ] || { From 8ea5db15197484c00f68f202a5ceb903cc581c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 20 Jan 2020 16:22:07 +0100 Subject: [PATCH 3/7] libubox: update to version 2020-07-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit f4e9bf73ac5c examples/lua: attempt to highlight some traps 53b9a2123fc6 lua/uloop: fd_add: use absolute indices for arguments c0941d3289fc lua/uloop: make get_sock_fd capable of absolute addresses 161c25960ba2 lua/uloop: fd_add() better args checking Signed-off-by: Petr Štetiar --- package/libs/libubox/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 49bf583742..025f6489e7 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git -PKG_MIRROR_HASH:=3d58def8e415ceda8aacfd8453813d8bf2a05991c0df0c074744639ab04321ba -PKG_SOURCE_DATE:=2020-05-25 -PKG_SOURCE_VERSION:=66195aee50424cbda0c2d858014e4cc58a2dc029 +PKG_MIRROR_HASH:=cb941cd33f43b38ef1a1f2b4fd212e0bb21c100dcdd2ab1976f8cc2071566d32 +PKG_SOURCE_DATE:=2020-07-11 +PKG_SOURCE_VERSION:=f4e9bf73ac5c0ee6b8f240e2a2100e70ca56d705 CMAKE_INSTALL:=1 PKG_LICENSE:=ISC From 2ec9e53ffbb1f10c97aee25cfa431ca0bb7a93a6 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 12 Jul 2020 23:57:25 +0800 Subject: [PATCH 4/7] luci-app-flowoffload: fix kernel limitation --- package/lean/luci-app-flowoffload/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/lean/luci-app-flowoffload/Makefile b/package/lean/luci-app-flowoffload/Makefile index a58f5c106a..bd05b0828d 100644 --- a/package/lean/luci-app-flowoffload/Makefile +++ b/package/lean/luci-app-flowoffload/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI support for Flow Offload -LUCI_DEPENDS:=+kmod-ipt-offload +pdnsd-alt +kmod-tcp-bbr @LINUX_5_4 +LUCI_DEPENDS:=@!LINUX_4_9 +kmod-ipt-offload +pdnsd-alt +kmod-tcp-bbr LUCI_PKGARCH:=all PKG_VERSION:=1.0 PKG_RELEASE:=19 From 4f5d7e452c40a57a1a492a5ed6357f5cf3e637f8 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Mon, 13 Jul 2020 00:24:51 +0800 Subject: [PATCH 5/7] target: use shortcut-fe by default --- include/target.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/target.mk b/include/target.mk index 07749962eb..4cef8f8771 100644 --- a/include/target.mk +++ b/include/target.mk @@ -18,12 +18,12 @@ block-mount kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw wget libustre default-settings luci luci-app-ddns luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \ luci-app-filetransfer luci-app-vsftpd luci-app-ssr-plus luci-app-unblockmusic \ luci-app-arpbind luci-app-vlmcsd luci-app-wol luci-app-ramfree \ -luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-accesscontrol luci-app-cpufreq \ +luci-app-sfe luci-app-nlbwmon luci-app-accesscontrol luci-app-cpufreq \ ddns-scripts_aliyun ddns-scripts_dnspod # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets -DEFAULT_PACKAGES.router:=dnsmasq-full iptables ppp ppp-mod-pppoe firewall kmod-ipt-offload kmod-tcp-bbr +DEFAULT_PACKAGES.router:=dnsmasq-full iptables ppp ppp-mod-pppoe firewall DEFAULT_PACKAGES.bootloader:= ifneq ($(DUMP),) From af30aab7f2d152569d81165af4d18bec2426dc8a Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Mon, 13 Jul 2020 00:36:15 +0800 Subject: [PATCH 6/7] gost: init: convert to procd --- package/ctcgfw/gost/Makefile | 4 +++ .../config/gost => gost/files/gost.config} | 0 package/ctcgfw/gost/files/gost.init | 36 +++++++++++++++++++ .../ctcgfw/luci-app-gost/root/etc/init.d/gost | 22 ------------ 4 files changed, 40 insertions(+), 22 deletions(-) rename package/ctcgfw/{luci-app-gost/root/etc/config/gost => gost/files/gost.config} (100%) create mode 100644 package/ctcgfw/gost/files/gost.init delete mode 100755 package/ctcgfw/luci-app-gost/root/etc/init.d/gost diff --git a/package/ctcgfw/gost/Makefile b/package/ctcgfw/gost/Makefile index e62371d51c..b60d34545c 100644 --- a/package/ctcgfw/gost/Makefile +++ b/package/ctcgfw/gost/Makefile @@ -52,6 +52,10 @@ endef define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/gost $(1)/usr/bin/gost + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) $(CURDIR)/files/gost.config $(1)/etc/config/gost + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(CURDIR)/files/gost.init $(1)/etc/init.d/gost endef $(eval $(call GoBinPackage,$(PKG_NAME))) diff --git a/package/ctcgfw/luci-app-gost/root/etc/config/gost b/package/ctcgfw/gost/files/gost.config similarity index 100% rename from package/ctcgfw/luci-app-gost/root/etc/config/gost rename to package/ctcgfw/gost/files/gost.config diff --git a/package/ctcgfw/gost/files/gost.init b/package/ctcgfw/gost/files/gost.init new file mode 100644 index 0000000000..bdf00b4eb7 --- /dev/null +++ b/package/ctcgfw/gost/files/gost.init @@ -0,0 +1,36 @@ +#!/bin/sh /etc/rc.common +# Created By [CTCGFW]Project OpenWRT +# https://github.com/project-openwrt + +START=99 +STOP=10 + +USE_PROCD=1 + +enable="$(uci get gost.@gost[0].enable)" +run_command="$(uci get gost.@gost[0].run_command)" + +start_service() { + [ "${enable}" -ne "1" ] && exit 0 + procd_open_instance gost + procd_set_param command /usr/bin/gost + procd_append_param command ${run_command} + + procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5} + + procd_set_param limits core="unlimited" + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_close_instance +} + +reload_service() +{ + stop + start +} + +service_triggers() +{ + procd_add_reload_trigger "gost" +} diff --git a/package/ctcgfw/luci-app-gost/root/etc/init.d/gost b/package/ctcgfw/luci-app-gost/root/etc/init.d/gost deleted file mode 100755 index 423673e839..0000000000 --- a/package/ctcgfw/luci-app-gost/root/etc/init.d/gost +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh /etc/rc.common -# Created By [CTCGFW]Project OpenWRT -# https://github.com/project-openwrt - -START=90 -STOP=10 - -enable="$(uci get gost.@gost[0].enable)" -run_command="$(uci get gost.@gost[0].run_command)" - -start() -{ - stop - - [ "${enable}" -ne "1" ] && exit 0 - /usr/bin/gost ${run_command} & -} - -stop() -{ - killall -9 "gost" > "/dev/null" 2>&1 -} From d6684f658bb22b3fba9db72e0996176ddc133f16 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Mon, 13 Jul 2020 20:41:32 +0800 Subject: [PATCH 7/7] luci-app-passwall: fix typo error of kcptun --- .../luci-app-passwall/luasrc/model/cbi/passwall/global.lua | 2 +- .../luci-app-passwall/luasrc/model/cbi/passwall/other.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua index 676abb630e..b199d13d9e 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua @@ -20,7 +20,7 @@ uci:foreach(appname, "nodes", function(e) remarks = "%s:[%s] " % {translatef(e.type .. e.v2ray_protocol), e.remarks} else if e.use_kcp and e.use_kcp == "1" then - remarks = "%s+%s:[%s] %s" % {e.type, "Kcptun", e.remarks, address} + remarks = "%s+%s:[%s] %s" % {e.type, "Kcptun", e.remarks, e.address} else remarks = "%s:[%s] %s:%s" % {e.type, e.remarks, e.address, e.port} end diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua index d83b546173..e13c578110 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua @@ -169,7 +169,7 @@ uci:foreach(appname, "nodes", function(e) remarks = "%s:[%s] " % {translatef(e.type .. e.v2ray_protocol), e.remarks} else if e.use_kcp and e.use_kcp == "1" then - remarks = "%s+%s:[%s] %s" % {e.type, "Kcptun", e.remarks, address} + remarks = "%s+%s:[%s] %s" % {e.type, "Kcptun", e.remarks, e.address} else remarks = "%s:[%s] %s:%s" % {e.type, e.remarks, e.address, e.port} end