From 5683b6cde92da030d22ee6c9747ffae032117160 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 21 May 2021 01:31:39 +0800 Subject: [PATCH 1/8] wireguard: bump to 1.0.20210424 Signed-off-by: Tianling Shen --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index 79a6335ca8..9e18fe46a8 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=1.0.20210219 +PKG_VERSION:=1.0.20210424 PKG_RELEASE:=1 PKG_SOURCE:=wireguard-linux-compat-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-linux-compat/snapshot/ -PKG_HASH:=99d35296b8d847a0d4db97a4dda96b464311a6354e75fe0bef6e7c4578690f00 +PKG_HASH:=8839139a53733bd20602e39cfc679a8176747dae8fe9f9c7fce28f8fba71abde PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From 4958940a43eb227656d9376cad901a25e08e4f19 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Fri, 21 May 2021 01:33:33 +0800 Subject: [PATCH 2/8] wireguard-tools: bump to 1.0.20210424 Signed-off-by: Tianling Shen --- package/network/utils/wireguard-tools/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/wireguard-tools/Makefile b/package/network/utils/wireguard-tools/Makefile index 77e2fbdc26..11372f2331 100644 --- a/package/network/utils/wireguard-tools/Makefile +++ b/package/network/utils/wireguard-tools/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard-tools -PKG_VERSION:=1.0.20210315 +PKG_VERSION:=1.0.20210424 PKG_RELEASE:=1 PKG_SOURCE:=wireguard-tools-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-tools/snapshot/ -PKG_HASH:=af001d5492be6bf58ef0bebe04b446b6f50eb53e1226fab679cc34af40733a22 +PKG_HASH:=b288b0c43871d919629d7e77846ef0b47f8eeaa9ebc9cedeee8233fc6cc376ad PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From d2d4fe2cbeb6fa42c0e7896c010bff6a0d3646c4 Mon Sep 17 00:00:00 2001 From: Dirk Neukirchen Date: Thu, 20 May 2021 10:39:35 +0200 Subject: [PATCH 3/8] grub2: disable liblzma dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Florian Ekert reported: "I have build a fresh master branch recently, Since your last change [1] on grub2, I have now a new dependency on liblzma for the install package grub2-editenv. root@st-dev-07 /usr/lib # ldd /root/grub-editenv /lib/ld-musl-x86_64.so.1 (0x7f684b088000) liblzma.so.5 => /usr/lib/liblzma.so.5 (0x7f684b06d000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7f684b059000) libc.so => /lib/ld-musl-x86_64.so.1 (0x7f684b088000) This was not the case before your update. root@st-dev-07 /usr/sbin # ldd /usr/sbin/grub-editenv /lib/ld-musl-x86_64.so.1 (0x7fd970176000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7fd970162000) libc.so => /lib/ld-musl-x86_64.so.1 (0x7fd970176000) My build complains that it cannot satisfy the runtime package dependency for grub2-editenv. install -d -m0755 /home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/ipkg-x86_64/grub2-editenv/usr/sbin install -m0755 /home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/grub-editenv /home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/ipkg-x86_64/grub2-editenv/usr/sbin/ find /home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/build_dir/target-x86_64_musl/linux-x86_64/grub-pc/grub-2.06~rc1/ipkg-x86_64/grub2-editenv -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf Package grub2-editenv is missing dependencies for the following libraries: liblzma.so.5 make[2]: *** [Makefile:166: /home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/bin/APOS/feckert/master/master-Maggie-455-ga5edc0e8e/x86_64/targets/x86/64/packages/grub2-editenv_2.06~rc1-1_x86_64.ipk] Error 1 make[2]: Leaving directory '/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/package/boot/grub2' time: package/boot/grub2/pc/compile#78.64#9.79#83.88 ERROR: package/boot/grub2 failed to build (build variant: pc). make[1]: *** [package/Makefile:116: package/boot/grub2/compile] Error 1 make[1]: Leaving directory '/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt' make: *** [/home/feckert/workspace/openwrt/LDM-master-x86_64/build/openwrt/include/toplevel.mk:230: package/boot/grub2/compile] Error 2 If I add the following changes to the package all works as expected. - DEPENDS:=@TARGET_x86 + DEPENDS:=@TARGET_x86 +liblzma VARIANT:=pc endef This is a hotfix but I dont´t think this is the final solution, because lzma is provided by the package xz. And This is maintained in the package feed [not the core]" Dirk stated & offered his patch to disable liblzma and thus resolve the 'out of core dependency' problem: "LZMA is used in mkimage.c disabling it prints Without liblzma (no support for XZ-compressed mips images) (explicitly disabled) (see configure.ac) liblzma is autodetected so this issue was present but hidden somehow [unsure: grep/image generation does not use grub with that option] OpenWrt does not use that feature currently [!] some scripts and examples use --compression=xz or -C xz and those will break grub has an internal xzlib for different "lzma" functionality (ext. LIBLZMA from XZ (GRUB_COMPRESSION_XZ) vs. GRUB_COMPRESSION_LZMA)" Hopefully fixes e74d81ece2e2932a4f370d8e6d180061a6a2c229 and doesn't break anything else. Signed-off-by: Dirk Neukirchen [include Florian's description of how problem 1st encountered] [bump package release] Signed-off-by: Kevin Darbyshire-Bryant --- package/boot/grub2/common.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/boot/grub2/common.mk b/package/boot/grub2/common.mk index dab0a4a8c3..115648a7f9 100644 --- a/package/boot/grub2/common.mk +++ b/package/boot/grub2/common.mk @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_CPE_ID:=cpe:/a:gnu:grub2 PKG_VERSION:=2.06~rc1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=grub-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://alpha.gnu.org/gnu/grub @@ -49,6 +49,7 @@ CONFIGURE_ARGS += \ --disable-nls \ --disable-device-mapper \ --disable-libzfs \ + --disable-liblzma \ --disable-grub-mkfont \ --with-platform=none From d06a10fcd7d78369ce37c4769bb1fb180566c157 Mon Sep 17 00:00:00 2001 From: Chen Minqiang Date: Thu, 20 May 2021 16:34:28 +0800 Subject: [PATCH 4/8] busybox: nslookup applet link with resolv if use glibc This fixed b36b8b6929c6d6b17edddfb4597cf6a26a991ed0 ("busybox: remove nslookup_lede/openwrt.patch") It is likely dropped by mistake, this add back the changes Signed-off-by: Chen Minqiang --- package/utils/busybox/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index e5e318471d..b60917dd50 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -98,6 +98,10 @@ endif LDLIBS += $(call BUSYBOX_IF_ENABLED,PAM,pam pam_misc pthread) +ifeq ($(CONFIG_USE_GLIBC),y) + LDLIBS += $(call BUSYBOX_IF_ENABLED,NSLOOKUP,resolv) +endif + ifeq ($(BUILD_VARIANT),selinux) LDLIBS += selinux sepol endif From 6b299c26b46c317a89da7cfdcd62de63dae86e99 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Thu, 6 May 2021 01:48:04 +0200 Subject: [PATCH 5/8] wolfssl: always export wc_ecc_set_rng Since commit 6467de5a8840 ("Randomize z ordinates in scalar mult when timing resistant") wolfssl requires a RNG for an EC key when the hardened built option is selected. wc_ecc_set_rng is only available when built hardened, so there is no safe way to install the RNG to the key regardless whether or not wolfssl is compiled hardened. Always export wc_ecc_set_rng so tools such as hostapd can install RNG regardless of the built settings for wolfssl. Signed-off-by: David Bauer Signed-off-by: Tianling Shen --- package/libs/wolfssl/Makefile | 2 +- .../libs/wolfssl/patches/200-ecc-rng.patch | 50 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 package/libs/wolfssl/patches/200-ecc-rng.patch diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index b09ee417bb..2487c5f817 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.7.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) diff --git a/package/libs/wolfssl/patches/200-ecc-rng.patch b/package/libs/wolfssl/patches/200-ecc-rng.patch new file mode 100644 index 0000000000..2d33c06209 --- /dev/null +++ b/package/libs/wolfssl/patches/200-ecc-rng.patch @@ -0,0 +1,50 @@ +Since commit 6467de5a8840 ("Randomize z ordinates in scalar +mult when timing resistant") wolfssl requires a RNG for an EC +key when the hardened built option is selected. + +wc_ecc_set_rng is only available when built hardened, so there +is no safe way to install the RNG to the key regardless whether +or not wolfssl is compiled hardened. + +Always export wc_ecc_set_rng so tools such as hostapd can install +RNG regardless of the built settings for wolfssl. + +--- a/wolfcrypt/src/ecc.c ++++ b/wolfcrypt/src/ecc.c +@@ -10293,21 +10293,21 @@ void wc_ecc_fp_free(void) + + #endif /* FP_ECC */ + +-#ifdef ECC_TIMING_RESISTANT + int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng) + { + int err = 0; + ++#ifdef ECC_TIMING_RESISTANT + if (key == NULL) { + err = BAD_FUNC_ARG; + } + else { + key->rng = rng; + } ++#endif + + return err; + } +-#endif + + #ifdef HAVE_ECC_ENCRYPT + +--- a/wolfssl/wolfcrypt/ecc.h ++++ b/wolfssl/wolfcrypt/ecc.h +@@ -584,10 +584,8 @@ WOLFSSL_API + void wc_ecc_fp_free(void); + WOLFSSL_LOCAL + void wc_ecc_fp_init(void); +-#ifdef ECC_TIMING_RESISTANT + WOLFSSL_API + int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng); +-#endif + + WOLFSSL_API + int wc_ecc_set_curve(ecc_key* key, int keysize, int curve_id); From 5bc0b94e96ac009237f12a9f023b25ee195eb3de Mon Sep 17 00:00:00 2001 From: David Bauer Date: Thu, 6 May 2021 01:53:49 +0200 Subject: [PATCH 6/8] hostapd: wolfssl: add RNG to EC key Since upstream commit 6467de5a8840 ("Randomize z ordinates in scalar mult when timing resistant") WolfSSL requires a RNG for the EC key when built hardened which is the default. Set the RNG for the EC key to fix connections for OWE clients. Signed-off-by: David Bauer Signed-off-by: Tianling Shen --- package/network/services/hostapd/Makefile | 2 +- .../0001-wolfssl-init-RNG-with-ECC-key.patch | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 package/network/services/hostapd/patches/0001-wolfssl-init-RNG-with-ECC-key.patch diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index bc7cb3c93c..efcd25fbc3 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/patches/0001-wolfssl-init-RNG-with-ECC-key.patch b/package/network/services/hostapd/patches/0001-wolfssl-init-RNG-with-ECC-key.patch new file mode 100644 index 0000000000..89d111e991 --- /dev/null +++ b/package/network/services/hostapd/patches/0001-wolfssl-init-RNG-with-ECC-key.patch @@ -0,0 +1,48 @@ +From 21ce83b4ae2b9563175fdb4fc4312096cc399cf8 Mon Sep 17 00:00:00 2001 +From: David Bauer +Date: Wed, 5 May 2021 00:44:34 +0200 +Subject: [PATCH] wolfssl: add RNG to EC key + +Since upstream commit 6467de5a8840 ("Randomize z ordinates in +scalar mult when timing resistant") WolfSSL requires a RNG for +the EC key when built hardened which is the default. + +Set the RNG for the EC key to fix connections for OWE clients. + +Signed-off-by: David Bauer +--- + src/crypto/crypto_wolfssl.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c +index 2e4bf8962..ed2528159 100644 +--- a/src/crypto/crypto_wolfssl.c ++++ b/src/crypto/crypto_wolfssl.c +@@ -1303,6 +1303,7 @@ int ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, + + struct crypto_ec { + ecc_key key; ++ WC_RNG rng; + mp_int a; + mp_int prime; + mp_int order; +@@ -1357,6 +1358,8 @@ struct crypto_ec * crypto_ec_init(int group) + return NULL; + + if (wc_ecc_init(&e->key) != 0 || ++ wc_InitRng(&e->rng) != 0 || ++ wc_ecc_set_rng(&e->key, &e->rng) != 0 || + wc_ecc_set_curve(&e->key, 0, curve_id) != 0 || + mp_init(&e->a) != MP_OKAY || + mp_init(&e->prime) != MP_OKAY || +@@ -1388,6 +1391,7 @@ void crypto_ec_deinit(struct crypto_ec* e) + mp_clear(&e->order); + mp_clear(&e->prime); + mp_clear(&e->a); ++ wc_FreeRng(&e->rng); + wc_ecc_free(&e->key); + os_free(e); + } +-- +2.31.1 + From c221fa3cea6e17078fb8ca677ee7f224ef7ee63e Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sun, 23 May 2021 01:48:17 +0800 Subject: [PATCH 7/8] r8152: enable multi-threads compilation Signed-off-by: Tianling Shen --- package/kernel/r8152/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/kernel/r8152/Makefile b/package/kernel/r8152/Makefile index 81153e4935..4a1a2d2525 100644 --- a/package/kernel/r8152/Makefile +++ b/package/kernel/r8152/Makefile @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=r8152 PKG_VERSION:=2.14 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/wget/realtek-r8152-linux/tar.gz/v$(PKG_VERSION)? @@ -17,6 +17,10 @@ PKG_HASH:=617c159eb72355c240be3f78971e5a01c9dffe5545a7ae76bb2bd87bb7a346ed PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/realtek-$(PKG_NAME)-linux-$(PKG_VERSION) +PKG_MAINTAINTER:=Tianling Shen + +PKG_BUILD_PARALLEL:=1 + include $(INCLUDE_DIR)/package.mk define KernelPackage/usb-net-rtl8152-vendor From 9e5ea394a7ab75d78565d099666a61ce63afeb13 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sun, 23 May 2021 22:34:32 +0800 Subject: [PATCH 8/8] default-settings: make chinese optimization parts optional Signed-off-by: Tianling Shen --- package/emortal/default-settings/Makefile | 22 ++++++++++++++----- .../files/zzz-default-settings | 5 ----- .../files/zzz-default-settings-chinese | 9 ++++++++ 3 files changed, 26 insertions(+), 10 deletions(-) create mode 100755 package/emortal/default-settings/files/zzz-default-settings-chinese diff --git a/package/emortal/default-settings/Makefile b/package/emortal/default-settings/Makefile index 38b122405d..1b1af7d0c3 100644 --- a/package/emortal/default-settings/Makefile +++ b/package/emortal/default-settings/Makefile @@ -12,9 +12,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=default-settings PKG_VERSION:=1.1 -PKG_RELEASE:=61 -PKG_LICENSE:=GPLv3 -PKG_LICENSE_FILES:=LICENSE +PKG_RELEASE:=$(COMMITCOUNT) + +PKG_LICENSE:=GPL-3.0 + +PKG_CONFIG_DEPENDS:=CONFIG_DEFAULT_SETTINGS_OPTIMIZE_FOR_CHINESE include $(INCLUDE_DIR)/package.mk @@ -23,7 +25,14 @@ define Package/default-settings CATEGORY:=LuCI TITLE:=LuCI support for Default Settings PKGARCH:=all - DEPENDS:=+luci-base +@LUCI_LANG_en +@LUCI_LANG_zh-cn + DEPENDS:=+luci-base +@LUCI_LANG_en +endef + +define Package/default-settings/config +config DEFAULT_SETTINGS_OPTIMIZE_FOR_CHINESE + bool "Optimize for mainland China users" + select LUCI_LANG_zh-cn + default y endef define Package/default-settings/description @@ -31,7 +40,6 @@ define Package/default-settings/description endef define Build/Compile - true endef define Package/default-settings/install @@ -41,9 +49,13 @@ define Package/default-settings/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) ./files/zzz-default-settings $(1)/etc/uci-defaults/99-default-settings +ifeq ($(CONFIG_DEFAULT_SETTINGS_OPTIMIZE_FOR_CHINESE),y) + $(INSTALL_BIN) ./files/zzz-default-settings-chinese $(1)/etc/uci-defaults/99-default-settings-chinese + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n po2lmo ./i18n/default.zh-cn.po $(1)/usr/lib/lua/luci/i18n/default.zh-cn.lmo po2lmo ./i18n/more.zh-cn.po $(1)/usr/lib/lua/luci/i18n/more.zh-cn.lmo +endif endef $(eval $(call BuildPackage,default-settings)) diff --git a/package/emortal/default-settings/files/zzz-default-settings b/package/emortal/default-settings/files/zzz-default-settings index 69387d3a4c..073f690cf7 100755 --- a/package/emortal/default-settings/files/zzz-default-settings +++ b/package/emortal/default-settings/files/zzz-default-settings @@ -3,10 +3,6 @@ uci set luci.main.lang=auto uci commit luci -uci set system.@system[0].timezone=CST-8 -uci set system.@system[0].zonename=Asia/Shanghai -uci commit system - uci set fstab.@global[0].anon_mount=1 uci commit fstab @@ -29,7 +25,6 @@ sed -i 's/services/nas/g' /usr/lib/lua/luci/view/minidlna_status.htm ln -sf /sbin/ip /usr/bin/ip -sed -i 's#https://downloads.openwrt.org#https://mirrors.tencent.com/lede#g' /etc/opkg/distfeeds.conf sed -i '/openwrt_luci/ { s/snapshots/releases\/18.06.9/g; }' /etc/opkg/distfeeds.conf sed -i "s/# //g" /etc/opkg/distfeeds.conf diff --git a/package/emortal/default-settings/files/zzz-default-settings-chinese b/package/emortal/default-settings/files/zzz-default-settings-chinese new file mode 100755 index 0000000000..0d9cb34bbf --- /dev/null +++ b/package/emortal/default-settings/files/zzz-default-settings-chinese @@ -0,0 +1,9 @@ +#!/bin/sh + +uci set system.@system[0].timezone=CST-8 +uci set system.@system[0].zonename=Asia/Shanghai +uci commit system + +sed -i 's#https://downloads.openwrt.org#https://mirrors.tencent.com/lede#g' /etc/opkg/distfeeds.conf + +exit 0