From cbc194df8f9eba8eb36abb8b407a73fc0398ce27 Mon Sep 17 00:00:00 2001 From: Chen Minqiang Date: Thu, 5 Aug 2021 09:17:15 +0800 Subject: [PATCH 01/38] ethtool: fix depends Fixes: #430 --- package/network/utils/ethtool/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile index a82e5c92fa..16b3c4e46f 100644 --- a/package/network/utils/ethtool/Makefile +++ b/package/network/utils/ethtool/Makefile @@ -38,7 +38,6 @@ define Package/ethtool-full TITLE += (full) VARIANT:=full PROVIDES:=ethtool - CONFLICTS:=ethtool DEPENDS:=+libmnl endef From a4066f2815f3f302dff79db3ef118dea514469a8 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 11 Aug 2021 17:32:21 +0800 Subject: [PATCH 02/38] automount: mark as nonshared Signed-off-by: Tianling Shen (cherry picked from commit 2008dea56aadf7e65c85c7c2762a14ef154ef3ad) --- package/emortal/automount/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/emortal/automount/Makefile b/package/emortal/automount/Makefile index 766f82b046..44afa7587f 100644 --- a/package/emortal/automount/Makefile +++ b/package/emortal/automount/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=automount -PKG_VERSION:=1 -PKG_RELEASE:=33 +PKG_FLAGS:=nonshared +PKG_RELEASE:=$(COMMITCOUNT) include $(INCLUDE_DIR)/package.mk From b1c576dadb1ef1e3d3a34c3999358bc999ddcb7e Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Mon, 2 Aug 2021 13:41:21 +0200 Subject: [PATCH 03/38] 6in4: delete tunnel on interface teardown Delete tunnel on 6in4 interface teardown. Should solve problem related to tunnel stuck on restart loop with "Unknown Command" on tunnel restart due to wan connection drop. Fixes: FS#3690 Signed-off-by: Ansuel Smith --- package/network/ipv6/6in4/Makefile | 2 +- package/network/ipv6/6in4/files/6in4.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package/network/ipv6/6in4/Makefile b/package/network/ipv6/6in4/Makefile index 08696ef7a8..331295ba7a 100644 --- a/package/network/ipv6/6in4/Makefile +++ b/package/network/ipv6/6in4/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6in4 -PKG_RELEASE:=26 +PKG_RELEASE:=27 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh index 5b5c7b36af..d0904952fd 100755 --- a/package/network/ipv6/6in4/files/6in4.sh +++ b/package/network/ipv6/6in4/files/6in4.sh @@ -138,6 +138,8 @@ proto_6in4_setup() { proto_6in4_teardown() { local cfg="$1" + local link="6in4-$cfg" + ip link del $link } proto_6in4_init_config() { From 9bfc21a8d34ebfffe493a4b18c35c3255b5d3340 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 17 Aug 2021 19:38:52 +0800 Subject: [PATCH 04/38] kernel: bump to 4.9.280, 4.14.244, 4.19.204 Refreshed all patches. Signed-off-by: Tianling Shen --- include/kernel-version.mk | 12 ++++++------ ...-0059-Added-Device-IDs-for-August-DVB-T-205.patch | 2 +- ...ideobuf2-Allow-exporting-of-a-struct-dmabuf.patch | 4 ++-- ...erial-option-fix-dwm-158-3g-modem-interface.patch | 2 +- .../090-net-generalize-napi_complete_done.patch | 4 ++-- .../650-netfilter-add-xt_OFFLOAD-target.patch | 4 ++-- .../hack-4.14/998-usb-serial-option-add-u9300.patch | 2 +- .../hack-4.19/998-usb-serial-option-add-u9300.patch | 2 +- .../pending-4.14/601-add-kernel-imq-support.patch | 2 +- ...t-pppoe-support-hardware-flow-table-offload.patch | 2 +- .../pending-4.19/601-add-kernel-imq-support.patch | 2 +- ...t-pppoe-support-hardware-flow-table-offload.patch | 2 +- .../pending-4.9/601-add-kernel-imq-support.patch | 2 +- .../ixp4xx/patches-4.9/160-delayed_uart_io.patch | 10 +++++----- .../patches-4.19/0900-bt-mtk-serial-fix.patch | 2 +- ...net-usb-r8152-add-LED-configuration-from-OF.patch | 8 ++++---- 16 files changed, 31 insertions(+), 31 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 862af46c01..07818622f4 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -6,13 +6,13 @@ ifdef CONFIG_TESTING_KERNEL KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER) endif -LINUX_VERSION-4.9 = .278 -LINUX_VERSION-4.14 = .242 -LINUX_VERSION-4.19 = .201 +LINUX_VERSION-4.9 = .280 +LINUX_VERSION-4.14 = .244 +LINUX_VERSION-4.19 = .204 -LINUX_KERNEL_HASH-4.9.278 = e73781c4d45488cc615ed0f4ed3b213bb571e42ff5f97b279643bdc5cc567e11 -LINUX_KERNEL_HASH-4.14.242 = 3e3d1c42a44d22e968a31a6136165b7d70ea703683ff669d5045e8891a4c1a5c -LINUX_KERNEL_HASH-4.19.201 = 8235dfa7188246ee64a247b70bcf2508b15bf5af07fb1fe817d96cf962e1dcd0 +LINUX_KERNEL_HASH-4.9.280 = 43d9fcaff6854d083b8c940b436f18b7a158c10b7399f80b7344a220d3c3a92a +LINUX_KERNEL_HASH-4.14.244 = b6e0bfa171959aef36817e28f9010f5a949488db122a6ea7a4e8b8325923a574 +LINUX_KERNEL_HASH-4.19.204 = c4e3410762a62c591ff71da2a2fdc3965eb7056f2245344213f939f2754a9de5 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/bcm27xx/patches-4.19/950-0059-Added-Device-IDs-for-August-DVB-T-205.patch b/target/linux/bcm27xx/patches-4.19/950-0059-Added-Device-IDs-for-August-DVB-T-205.patch index 409b289416..cf04f14566 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0059-Added-Device-IDs-for-August-DVB-T-205.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0059-Added-Device-IDs-for-August-DVB-T-205.patch @@ -9,7 +9,7 @@ Subject: [PATCH] Added Device IDs for August DVB-T 205 --- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c +++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c -@@ -1917,6 +1917,10 @@ static const struct usb_device_id rtl28x +@@ -1926,6 +1926,10 @@ static const struct usb_device_id rtl28x &rtl28xxu_props, "Compro VideoMate U650F", NULL) }, { DVB_USB_DEVICE(USB_VID_KWORLD_2, 0xd394, &rtl28xxu_props, "MaxMedia HU394-T", NULL) }, diff --git a/target/linux/bcm27xx/patches-4.19/950-0243-media-videobuf2-Allow-exporting-of-a-struct-dmabuf.patch b/target/linux/bcm27xx/patches-4.19/950-0243-media-videobuf2-Allow-exporting-of-a-struct-dmabuf.patch index fbaa3c2d40..ea5fa26755 100644 --- a/target/linux/bcm27xx/patches-4.19/950-0243-media-videobuf2-Allow-exporting-of-a-struct-dmabuf.patch +++ b/target/linux/bcm27xx/patches-4.19/950-0243-media-videobuf2-Allow-exporting-of-a-struct-dmabuf.patch @@ -19,7 +19,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c -@@ -1851,12 +1851,12 @@ static int __find_plane_by_offset(struct +@@ -1862,12 +1862,12 @@ static int __find_plane_by_offset(struct return -EINVAL; } @@ -35,7 +35,7 @@ Signed-off-by: Dave Stevenson struct dma_buf *dbuf; if (q->memory != VB2_MEMORY_MMAP) { -@@ -1906,6 +1906,21 @@ int vb2_core_expbuf(struct vb2_queue *q, +@@ -1917,6 +1917,21 @@ int vb2_core_expbuf(struct vb2_queue *q, return -EINVAL; } diff --git a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch index 4ebcc115cd..7fc129bb9a 100644 --- a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch +++ b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch @@ -30,7 +30,7 @@ Signed-off-by: Johan Hovold --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -2031,7 +2031,8 @@ static const struct usb_device_id option +@@ -2033,7 +2033,8 @@ static const struct usb_device_id option { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d01, 0xff) }, /* D-Link DWM-156 (variant) */ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d02, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d03, 0xff) }, diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index e6f2580c43..30567886a5 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -388,7 +388,7 @@ Signed-off-by: David S. Miller BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c -@@ -3240,7 +3240,7 @@ static int bnx2x_poll(struct napi_struct +@@ -3241,7 +3241,7 @@ static int bnx2x_poll(struct napi_struct * has been updated when NAPI was scheduled. */ if (IS_FCOE_FP(fp)) { @@ -863,7 +863,7 @@ Signed-off-by: David S. Miller return work_done; --- a/drivers/net/ethernet/natsemi/natsemi.c +++ b/drivers/net/ethernet/natsemi/natsemi.c -@@ -2261,7 +2261,7 @@ static int natsemi_poll(struct napi_stru +@@ -2258,7 +2258,7 @@ static int natsemi_poll(struct napi_stru np->intr_status = readl(ioaddr + IntrStatus); } while (np->intr_status); diff --git a/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch b/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch index 7c93feccdc..01a9290242 100644 --- a/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch +++ b/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau help This option adds the flow table core infrastructure. -@@ -974,6 +973,15 @@ config NETFILTER_XT_TARGET_NOTRACK +@@ -986,6 +985,15 @@ config NETFILTER_XT_TARGET_NOTRACK depends on NETFILTER_ADVANCED select NETFILTER_XT_TARGET_CT @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau +obj-$(CONFIG_NETFILTER_XT_TARGET_FLOWOFFLOAD) += xt_FLOWOFFLOAD.o obj-$(CONFIG_NETFILTER_XT_TARGET_HL) += xt_HL.o obj-$(CONFIG_NETFILTER_XT_TARGET_HMARK) += xt_HMARK.o - obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o + obj-$(CONFIG_NETFILTER_XT_TARGET_IMQ) += xt_IMQ.o --- /dev/null +++ b/net/netfilter/xt_FLOWOFFLOAD.c @@ -0,0 +1,422 @@ diff --git a/target/linux/generic/hack-4.14/998-usb-serial-option-add-u9300.patch b/target/linux/generic/hack-4.14/998-usb-serial-option-add-u9300.patch index a03f3576d7..99bf37802b 100644 --- a/target/linux/generic/hack-4.14/998-usb-serial-option-add-u9300.patch +++ b/target/linux/generic/hack-4.14/998-usb-serial-option-add-u9300.patch @@ -1,6 +1,6 @@ --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -1285,6 +1285,7 @@ static const struct usb_device_id produc +@@ -1351,6 +1351,7 @@ static const struct usb_device_id produc {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */ {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */ {QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */ diff --git a/target/linux/generic/hack-4.19/998-usb-serial-option-add-u9300.patch b/target/linux/generic/hack-4.19/998-usb-serial-option-add-u9300.patch index 6ed75e5ac1..c3d5840034 100644 --- a/target/linux/generic/hack-4.19/998-usb-serial-option-add-u9300.patch +++ b/target/linux/generic/hack-4.19/998-usb-serial-option-add-u9300.patch @@ -1,6 +1,6 @@ --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -1296,6 +1296,7 @@ static const struct usb_device_id produc +@@ -1362,6 +1362,7 @@ static const struct usb_device_id produc {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */ {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */ {QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */ diff --git a/target/linux/generic/pending-4.14/601-add-kernel-imq-support.patch b/target/linux/generic/pending-4.14/601-add-kernel-imq-support.patch index 16f77d33f4..c1c20e903f 100644 --- a/target/linux/generic/pending-4.14/601-add-kernel-imq-support.patch +++ b/target/linux/generic/pending-4.14/601-add-kernel-imq-support.patch @@ -1801,7 +1801,7 @@ /* Note : this field could be in headers_start/headers_end section * It is not yet because we do not want to have a 16 bit hole -@@ -3970,6 +4077,13 @@ void __init skb_init(void) +@@ -3973,6 +4080,13 @@ void __init skb_init(void) 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); diff --git a/target/linux/generic/pending-4.14/644-net-pppoe-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-4.14/644-net-pppoe-support-hardware-flow-table-offload.patch index 191cbcfb82..c7aa998517 100644 --- a/target/linux/generic/pending-4.14/644-net-pppoe-support-hardware-flow-table-offload.patch +++ b/target/linux/generic/pending-4.14/644-net-pppoe-support-hardware-flow-table-offload.patch @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau #define PPP_VERSION "2.4.2" /* -@@ -1382,12 +1387,37 @@ static void ppp_dev_priv_destructor(stru +@@ -1393,12 +1398,37 @@ static void ppp_dev_priv_destructor(stru ppp_destroy_interface(ppp); } diff --git a/target/linux/generic/pending-4.19/601-add-kernel-imq-support.patch b/target/linux/generic/pending-4.19/601-add-kernel-imq-support.patch index f1062b5894..520c7bd371 100644 --- a/target/linux/generic/pending-4.19/601-add-kernel-imq-support.patch +++ b/target/linux/generic/pending-4.19/601-add-kernel-imq-support.patch @@ -1466,7 +1466,7 @@ /* Note : this field could be in headers_start/headers_end section * It is not yet because we do not want to have a 16 bit hole -@@ -3996,6 +4073,13 @@ void __init skb_init(void) +@@ -3999,6 +4076,13 @@ void __init skb_init(void) 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); diff --git a/target/linux/generic/pending-4.19/644-net-pppoe-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-4.19/644-net-pppoe-support-hardware-flow-table-offload.patch index 89fa863aab..b4f060e6f9 100644 --- a/target/linux/generic/pending-4.19/644-net-pppoe-support-hardware-flow-table-offload.patch +++ b/target/linux/generic/pending-4.19/644-net-pppoe-support-hardware-flow-table-offload.patch @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau #define PPP_VERSION "2.4.2" /* -@@ -1368,12 +1373,37 @@ static void ppp_dev_priv_destructor(stru +@@ -1379,12 +1384,37 @@ static void ppp_dev_priv_destructor(stru ppp_destroy_interface(ppp); } diff --git a/target/linux/generic/pending-4.9/601-add-kernel-imq-support.patch b/target/linux/generic/pending-4.9/601-add-kernel-imq-support.patch index 911e27046d..84a4682dcb 100644 --- a/target/linux/generic/pending-4.9/601-add-kernel-imq-support.patch +++ b/target/linux/generic/pending-4.9/601-add-kernel-imq-support.patch @@ -1754,7 +1754,7 @@ /* Note : this field could be in headers_start/headers_end section * It is not yet because we do not want to have a 16 bit hole -@@ -3548,6 +3655,13 @@ void __init skb_init(void) +@@ -3551,6 +3658,13 @@ void __init skb_init(void) 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); diff --git a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch index 9241f633f8..5c5e2cff86 100644 --- a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch +++ b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch @@ -64,7 +64,7 @@ unsigned int custom_divisor; --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c -@@ -383,6 +383,20 @@ static unsigned int mem16_serial_in(stru +@@ -387,6 +387,20 @@ static unsigned int mem16_serial_in(stru return readw(p->membase + offset); } @@ -85,7 +85,7 @@ static void mem32_serial_out(struct uart_port *p, int offset, int value) { offset = offset << p->regshift; -@@ -455,6 +469,11 @@ static void set_io_from_upio(struct uart +@@ -459,6 +473,11 @@ static void set_io_from_upio(struct uart p->serial_out = mem32be_serial_out; break; @@ -97,7 +97,7 @@ #ifdef CONFIG_SERIAL_8250_RT288X case UPIO_AU: p->serial_in = au_serial_in; -@@ -482,6 +501,7 @@ serial_port_out_sync(struct uart_port *p +@@ -486,6 +505,7 @@ serial_port_out_sync(struct uart_port *p case UPIO_MEM16: case UPIO_MEM32: case UPIO_MEM32BE: @@ -105,7 +105,7 @@ case UPIO_AU: p->serial_out(p, offset, value); p->serial_in(p, UART_LCR); /* safe, no side-effects */ -@@ -2780,6 +2800,7 @@ static int serial8250_request_std_resour +@@ -2786,6 +2806,7 @@ static int serial8250_request_std_resour case UPIO_MEM32BE: case UPIO_MEM16: case UPIO_MEM: @@ -113,7 +113,7 @@ if (!port->mapbase) break; -@@ -2818,6 +2839,7 @@ static void serial8250_release_std_resou +@@ -2824,6 +2845,7 @@ static void serial8250_release_std_resou case UPIO_MEM32BE: case UPIO_MEM16: case UPIO_MEM: diff --git a/target/linux/mediatek/patches-4.19/0900-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-4.19/0900-bt-mtk-serial-fix.patch index d95f1dde65..a4918fa9f5 100644 --- a/target/linux/mediatek/patches-4.19/0900-bt-mtk-serial-fix.patch +++ b/target/linux/mediatek/patches-4.19/0900-bt-mtk-serial-fix.patch @@ -19,7 +19,7 @@ }, [PORT_NPCM] = { .name = "Nuvoton 16550", -@@ -2680,6 +2680,11 @@ serial8250_do_set_termios(struct uart_po +@@ -2686,6 +2686,11 @@ serial8250_do_set_termios(struct uart_po unsigned long flags; unsigned int baud, quot, frac = 0; diff --git a/target/linux/sunxi/patches-4.19/022-net-usb-r8152-add-LED-configuration-from-OF.patch b/target/linux/sunxi/patches-4.19/022-net-usb-r8152-add-LED-configuration-from-OF.patch index 54b70982c5..1d57624110 100644 --- a/target/linux/sunxi/patches-4.19/022-net-usb-r8152-add-LED-configuration-from-OF.patch +++ b/target/linux/sunxi/patches-4.19/022-net-usb-r8152-add-LED-configuration-from-OF.patch @@ -22,7 +22,7 @@ Signed-off-by: David Bauer #include #include #include -@@ -3978,6 +3979,22 @@ static void rtl_tally_reset(struct r8152 +@@ -3979,6 +3980,22 @@ static void rtl_tally_reset(struct r8152 ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data); } @@ -45,7 +45,7 @@ Signed-off-by: David Bauer static void r8152b_init(struct r8152 *tp) { u32 ocp_data; -@@ -4019,6 +4036,8 @@ static void r8152b_init(struct r8152 *tp +@@ -4020,6 +4037,8 @@ static void r8152b_init(struct r8152 *tp ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); @@ -54,7 +54,7 @@ Signed-off-by: David Bauer } static void r8153_init(struct r8152 *tp) -@@ -4145,6 +4164,8 @@ static void r8153_init(struct r8152 *tp) +@@ -4146,6 +4165,8 @@ static void r8153_init(struct r8152 *tp) tp->coalesce = COALESCE_SLOW; break; } @@ -63,7 +63,7 @@ Signed-off-by: David Bauer } static void r8153b_init(struct r8152 *tp) -@@ -4208,6 +4229,8 @@ static void r8153b_init(struct r8152 *tp +@@ -4209,6 +4230,8 @@ static void r8153b_init(struct r8152 *tp rtl_tally_reset(tp); tp->coalesce = 15000; /* 15 us */ From df1300ab1236bbef65b819e1292349a07ae8efef Mon Sep 17 00:00:00 2001 From: ElonH Date: Wed, 18 Aug 2021 22:02:40 +0800 Subject: [PATCH 05/38] sdk: replace LICENSE file as LICENSES dir --- target/sdk/Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/sdk/Makefile b/target/sdk/Makefile index 8fc2ba1cf9..b63493de1f 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -136,7 +136,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean $(SDK_BUILD_DIR)/target/linux/*/patches* ./convert-config.pl $(TOPDIR)/.config > $(SDK_BUILD_DIR)/Config-build.in $(CP) -L \ - $(TOPDIR)/LICENSE \ + $(TOPDIR)/LICENSES \ $(TOPDIR)/rules.mk \ ./files/Config.in \ ./files/Makefile \ @@ -156,11 +156,11 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean -rm -f $(SDK_BUILD_DIR)/feeds.conf.default $(if $(BASE_FEED),echo "$(BASE_FEED)" > $(SDK_BUILD_DIR)/feeds.conf.default) - if [ -f $(TOPDIR)/feeds.conf ]; then \ - cat $(TOPDIR)/feeds.conf >> $(SDK_BUILD_DIR)/feeds.conf.default; \ - else \ - cat $(TOPDIR)/feeds.conf.default >> $(SDK_BUILD_DIR)/feeds.conf.default; \ - fi + cat $(TOPDIR)/feeds.conf.default >> $(SDK_BUILD_DIR)/feeds.conf.default + $(if $(OPDE_PYTHON), \ + LC_ALL=C.UTF-8 LANG=C.UTF-8 $(OPDE_PYTHON) $(OPDE_BUILDER) -s $(TOPDIR) @hack-sdk $(SDK_BUILD_DIR), \ + echo "env 'OPDE_PYTHON' missing... skip to hack sdk" \ + ) $(SED) 's,^# REVISION:=.*,REVISION:=$(REVISION),g' $(SDK_BUILD_DIR)/include/version.mk $(SED) 's,^# SOURCE_DATE_EPOCH:=.*,SOURCE_DATE_EPOCH:=$(SOURCE_DATE_EPOCH),g' $(SDK_BUILD_DIR)/include/version.mk $(SED) '/LINUX_VERMAGIC:=/ { s,unknown,$(LINUX_VERMAGIC),g }' $(SDK_BUILD_DIR)/include/kernel.mk From 1fe42b3bbe8fd2ec87f55a5daf93cb6d9e5704a0 Mon Sep 17 00:00:00 2001 From: ElonH Date: Wed, 18 Aug 2021 22:13:40 +0800 Subject: [PATCH 06/38] kmod-qlcnic: add missing deps --- package/kernel/linux/modules/netdevices.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index b619327176..8d0811f496 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1145,7 +1145,7 @@ $(eval $(call KernelPackage,mlx5-core)) define KernelPackage/qlcnic SUBMENU:=$(NETWORK_DEVICES_MENU) - DEPENDS:=@PCI_SUPPORT + DEPENDS:=@PCI_SUPPORT +kmod-hwmon-core TITLE:=QLogic QLE8240 and QLE8242 device support KCONFIG:=CONFIG_QLCNIC FILES:=$(LINUX_DIR)/drivers/net/ethernet/qlogic/qlcnic/qlcnic.ko From 6baa1838d300bac4f9b3e578b47edd71e073ee07 Mon Sep 17 00:00:00 2001 From: ElonH Date: Wed, 18 Aug 2021 23:01:20 +0800 Subject: [PATCH 07/38] sdk: revert opde patch --- target/sdk/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/sdk/Makefile b/target/sdk/Makefile index b63493de1f..6caddaf046 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -156,11 +156,11 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean -rm -f $(SDK_BUILD_DIR)/feeds.conf.default $(if $(BASE_FEED),echo "$(BASE_FEED)" > $(SDK_BUILD_DIR)/feeds.conf.default) - cat $(TOPDIR)/feeds.conf.default >> $(SDK_BUILD_DIR)/feeds.conf.default - $(if $(OPDE_PYTHON), \ - LC_ALL=C.UTF-8 LANG=C.UTF-8 $(OPDE_PYTHON) $(OPDE_BUILDER) -s $(TOPDIR) @hack-sdk $(SDK_BUILD_DIR), \ - echo "env 'OPDE_PYTHON' missing... skip to hack sdk" \ - ) + if [ -f $(TOPDIR)/feeds.conf ]; then \ + cat $(TOPDIR)/feeds.conf >> $(SDK_BUILD_DIR)/feeds.conf.default; \ + else \ + cat $(TOPDIR)/feeds.conf.default >> $(SDK_BUILD_DIR)/feeds.conf.default; \ + fi $(SED) 's,^# REVISION:=.*,REVISION:=$(REVISION),g' $(SDK_BUILD_DIR)/include/version.mk $(SED) 's,^# SOURCE_DATE_EPOCH:=.*,SOURCE_DATE_EPOCH:=$(SOURCE_DATE_EPOCH),g' $(SDK_BUILD_DIR)/include/version.mk $(SED) '/LINUX_VERMAGIC:=/ { s,unknown,$(LINUX_VERMAGIC),g }' $(SDK_BUILD_DIR)/include/kernel.mk From 4d0613353f3c3504e8ce78f7d2e084880ab1c5ad Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Thu, 13 May 2021 16:23:26 +0300 Subject: [PATCH 08/38] busybox: fix compilation with GCC 10 When compiling busybox with GCC 10 and CONFIG_PKG_ASLR_PIE_ALL=y, there are hundreds of errors like: relocation R_MIPS16_26 against `xzalloc' cannot be used when making a shared object; recompile with -fPIC Simply solve this by no longer disabling PKG_ASLR_PIE, so that $(FPIC) is properly added to the CFLAGS and LDFLAGS. Signed-off-by: Stijn Tintel Acked-by: Hauke Mehrtens --- package/utils/busybox/Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index b60917dd50..d36bde3cbc 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -18,9 +18,6 @@ PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam PKG_BUILD_PARALLEL:=1 PKG_CHECK_FORMAT_SECURITY:=0 -#Busybox use it's own PIE config flag and LDFLAGS are used with ld, not gcc. -PKG_ASLR_PIE:=0 - PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE PKG_CPE_ID:=cpe:/a:busybox:busybox From 2d504e55bc4123313e023e06ae7197545d9cec94 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Wed, 18 Aug 2021 20:45:14 +0300 Subject: [PATCH 09/38] umbim: bump to git HEAD de56231 umbim: fix compilation with GCC 10 Signed-off-by: Stijn Tintel Acked-by: Hauke Mehrtens --- package/network/utils/umbim/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile index 8f4d2608ae..50ee81abb6 100644 --- a/package/network/utils/umbim/Makefile +++ b/package/network/utils/umbim/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/umbim.git -PKG_SOURCE_DATE:=2019-09-11 -PKG_SOURCE_VERSION:=184b707ddaa0acee84d02e0ffe599cb8b67782bd -PKG_MIRROR_HASH:=482ff69144f81fafed99035840f5a24e772472f2df2f3ac0219d6de791ac5835 +PKG_SOURCE_DATE:=2021-08-18 +PKG_SOURCE_VERSION:=de5623104baee6e0c13c92f05c15bf4b4145c0b1 +PKG_MIRROR_HASH:=2d4a75d2b53c8413521a2fd138895e327bff3f4b4d29a540342b2d2e1e009852 PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0 From cdea9c5d9d000b2019cea6cb30bd708630724535 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 19 Aug 2021 01:23:41 +0100 Subject: [PATCH 10/38] image: fix build with SELinux The option '-xattr' for mksquashfs4 should be '-xattrs' which lead to build failure with SELinux enabled. Add the missing 's'. Fixes: 4baf47b9a8 ("images: squashfs: xattrs should not depend on buld host") Signed-off-by: Daniel Golle --- include/image.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/image.mk b/include/image.mk index db9c1e621e..af020f9d56 100644 --- a/include/image.mk +++ b/include/image.mk @@ -76,7 +76,7 @@ JFFS2OPTS += $(MKFS_DEVTABLE_OPT) SQUASHFS_BLOCKSIZE := $(CONFIG_TARGET_SQUASHFS_BLOCK_SIZE)k SQUASHFSOPT := -b $(SQUASHFS_BLOCKSIZE) SQUASHFSOPT += -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1' -SQUASHFSOPT += $(if $(CONFIG_SELINUX),-xattr,-no-xattrs) +SQUASHFSOPT += $(if $(CONFIG_SELINUX),-xattrs,-no-xattrs) SQUASHFSCOMP := gzip LZMA_XZ_OPTIONS := -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2 ifeq ($(CONFIG_SQUASHFS_XZ),y) From a5ba541bc22ca85d3fbc4aa621a26bd3a4325915 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 20 Aug 2021 01:46:14 +0100 Subject: [PATCH 11/38] selinux-policy: update to version 0.9 592ac0f add a note 4bacd14 sslcertfile: list /etc/ssl 7bdefa4 example: indicate that skip is an option d1e9a85 wifi: sys pipe usage eb903e1 README: add note about policycoreutils-setfiles weak dependency 762e011 ttyd: signull all subjects fbfc079 acme: add basic support for acme_cleanup.sh and acme_setup.sh 9ac7592 acme: transition to sys.subj on generic initscript execution f3dd1ba acme: missing rules related to sys.subj trans on file.initscriptfile ae273fa odhcp6c/netifd: support drop-in directories 5fa9b41 subj: do not encourage misconfiguration 44722b6 blockd, logd, odhcpc6, ubiutil, mtdstordev a775d93 21.02 related a473691 rcboot runs rcuhttpd which creates /tmp/etc for /tmp/etc/uhttpd 290e9fb rcuhttpd: related to rcboot and uci-defaults 3fc0d8b rcuhttpd: lists /etc/uci-defaults 1f5ef48 removes ubvol.lock policy and adds move mtd/ubi partitions Signed-off-by: Daniel Golle --- package/system/selinux-policy/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/system/selinux-policy/Makefile b/package/system/selinux-policy/Makefile index 4980ed6f21..219ebc7995 100644 --- a/package/system/selinux-policy/Makefile +++ b/package/system/selinux-policy/Makefile @@ -8,8 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=selinux-policy PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.defensec.nl/selinux-policy.git -PKG_VERSION:=0.8 -PKG_MIRROR_HASH:=3b58f751a21394e3aef47fd6c9fe9430fadde6427deb5c79f08478904837ec91 +PKG_VERSION:=0.9 +PKG_MIRROR_HASH:=f1a37a4fc104fbacde3012178fc117b473899360f26a8735156394288441d99c PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_BUILD_DEPENDS:=secilc/host policycoreutils/host From 1ab7f30ede2d0254ce16a5eab0fad066baf52a31 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Fri, 20 Aug 2021 23:45:20 +0300 Subject: [PATCH 12/38] wolfssl: fix build with GCC 10 on 32 x86 targets Backport upstream patch to fix build with GCC 10 on 32 x86 targets. Signed-off-by: Stijn Tintel --- ...change-asm-snippets-to-get-compiling.patch | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch diff --git a/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch b/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch new file mode 100644 index 0000000000..091b241285 --- /dev/null +++ b/package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch @@ -0,0 +1,123 @@ +From fa8f23284d4689c2a737204b337b58d966dcbd8c Mon Sep 17 00:00:00 2001 +From: Sean Parkinson +Date: Fri, 20 Aug 2021 10:23:38 +1000 +Subject: [PATCH] Maths x86 asm: change asm snippets to get compiling + +TFM: + Use register or memory for c0, c1, c2 in SQRADD and SQRADD2. +SP: + Use register or memory for vl, vh, vo in SP_ASM_MUL_ADD, +SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD. +--- + wolfcrypt/src/asm.c | 29 ++++++++++++++++++++--------- + wolfcrypt/src/sp_int.c | 6 +++--- + 2 files changed, 23 insertions(+), 12 deletions(-) + +diff --git a/wolfcrypt/src/asm.c b/wolfcrypt/src/asm.c +index b7f53d073..a37e75e02 100644 +--- a/wolfcrypt/src/asm.c ++++ b/wolfcrypt/src/asm.c +@@ -698,33 +698,39 @@ __asm__( \ + + #define SQRADD(i, j) \ + __asm__( \ +- "movl %6,%%eax \n\t" \ ++ "movl %3,%%eax \n\t" \ + "mull %%eax \n\t" \ + "addl %%eax,%0 \n\t" \ + "adcl %%edx,%1 \n\t" \ + "adcl $0,%2 \n\t" \ +- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","cc"); ++ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \ ++ : "m"(i) \ ++ :"%eax","%edx","cc"); + + #define SQRADD2(i, j) \ + __asm__( \ +- "movl %6,%%eax \n\t" \ +- "mull %7 \n\t" \ ++ "movl %3,%%eax \n\t" \ ++ "mull %4 \n\t" \ + "addl %%eax,%0 \n\t" \ + "adcl %%edx,%1 \n\t" \ + "adcl $0,%2 \n\t" \ + "addl %%eax,%0 \n\t" \ + "adcl %%edx,%1 \n\t" \ + "adcl $0,%2 \n\t" \ +- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx", "cc"); ++ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \ ++ : "m"(i), "m"(j) \ ++ :"%eax","%edx", "cc"); + + #define SQRADDSC(i, j) \ +-__asm__( \ ++__asm__( \ + "movl %3,%%eax \n\t" \ + "mull %4 \n\t" \ + "movl %%eax,%0 \n\t" \ + "movl %%edx,%1 \n\t" \ + "xorl %2,%2 \n\t" \ +- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","cc"); ++ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \ ++ : "g"(i), "g"(j) \ ++ :"%eax","%edx","cc"); + + #define SQRADDAC(i, j) \ + __asm__( \ +@@ -733,7 +739,9 @@ __asm__( \ + "addl %%eax,%0 \n\t" \ + "adcl %%edx,%1 \n\t" \ + "adcl $0,%2 \n\t" \ +- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","cc"); ++ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \ ++ : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \ ++ :"%eax","%edx","cc"); + + #define SQRADDDB \ + __asm__( \ +@@ -743,7 +751,10 @@ __asm__( \ + "addl %6,%0 \n\t" \ + "adcl %7,%1 \n\t" \ + "adcl %8,%2 \n\t" \ +- :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc"); ++ :"=r"(c0), "=r"(c1), "=r"(c2) \ ++ : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), \ ++ "r"(sc2) \ ++ : "cc"); + + #elif defined(TFM_X86_64) + /* x86-64 optimized */ +diff --git a/wolfcrypt/src/sp_int.c b/wolfcrypt/src/sp_int.c +index 6070faaa9..d26702e47 100644 +--- a/wolfcrypt/src/sp_int.c ++++ b/wolfcrypt/src/sp_int.c +@@ -477,7 +477,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, + "addl %%eax, %[l] \n\t" \ + "adcl %%edx, %[h] \n\t" \ + "adcl $0 , %[o] \n\t" \ +- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \ ++ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \ + : [a] "r" (va), [b] "r" (vb) \ + : "eax", "edx", "cc" \ + ) +@@ -503,7 +503,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, + "addl %%eax, %[l] \n\t" \ + "adcl %%edx, %[h] \n\t" \ + "adcl $0 , %[o] \n\t" \ +- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \ ++ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \ + : [a] "r" (va), [b] "r" (vb) \ + : "eax", "edx", "cc" \ + ) +@@ -542,7 +542,7 @@ static WC_INLINE sp_int_digit sp_div_word(sp_int_digit hi, sp_int_digit lo, + "addl %%eax, %[l] \n\t" \ + "adcl %%edx, %[h] \n\t" \ + "adcl $0 , %[o] \n\t" \ +- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \ ++ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \ + : [a] "m" (va) \ + : "eax", "edx", "cc" \ + ) +-- +2.31.1 + From 378c7aee4443fba97c14e607e8b167607cfeffac Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 28 Mar 2020 16:55:45 -0700 Subject: [PATCH 13/38] gdb: update to 10.2 Replace some OpenWrt patches with openembedded ones for easier maintainability. Remove several outdated ones as well. Replace PKG_RELEASE with AUTORELEASE to avoid manual bumps. Remove !arc dependency as it is supported upstream now. Signed-off-by: Rosen Penev --- package/devel/gdb/Makefile | 7 ++- .../gdb/patches/010-aarch64-headers.patch | 38 ------------- package/devel/gdb/patches/100-musl_fix.patch | 53 ------------------- .../devel/gdb/patches/130-gdb-ctrl-c.patch | 35 ++++++++++++ .../devel/gdb/patches/130-uclibc-fix.patch | 11 ---- package/devel/gdb/patches/140-sgidefs.patch | 30 +++++++++++ package/devel/gdb/patches/150-mips64.patch | 32 +++++++++++ 7 files changed, 100 insertions(+), 106 deletions(-) delete mode 100644 package/devel/gdb/patches/010-aarch64-headers.patch delete mode 100644 package/devel/gdb/patches/100-musl_fix.patch create mode 100644 package/devel/gdb/patches/130-gdb-ctrl-c.patch delete mode 100644 package/devel/gdb/patches/130-uclibc-fix.patch create mode 100644 package/devel/gdb/patches/140-sgidefs.patch create mode 100644 package/devel/gdb/patches/150-mips64.patch diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 17b2bb8481..a357996991 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb -PKG_VERSION:=10.1 -PKG_RELEASE:=1 +PKG_VERSION:=10.2 +PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0 +PKG_HASH:=aaa1223d534c9b700a8bec952d9748ee1977513f178727e1bee520ee000b4f29 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 @@ -45,7 +45,6 @@ endef define Package/gdbserver $(call Package/gdb/Default) TITLE:=Remote server for GNU Debugger - DEPENDS+=@!arc endef define Package/gdbserver/description diff --git a/package/devel/gdb/patches/010-aarch64-headers.patch b/package/devel/gdb/patches/010-aarch64-headers.patch deleted file mode 100644 index 8f05738298..0000000000 --- a/package/devel/gdb/patches/010-aarch64-headers.patch +++ /dev/null @@ -1,38 +0,0 @@ -The signal definitions of musl and gdb collide - -The kernel defines "struct sigcontext" in asm/sigcontext.h and musl libc -defines it in signal.h which collides. -Kernel 4.14 misses the definitions of struct user_sve_header so we still -have to use the aarch64-sve-linux-sigcontext.h header file which also -provides that and make sure aarch64-sve-linux-sigcontext.h does not -provide the same headers as the kernel or musl. - ---- a/gdb/nat/aarch64-sve-linux-ptrace.h -+++ b/gdb/nat/aarch64-sve-linux-ptrace.h -@@ -25,7 +25,7 @@ - #include - #include - --#ifndef SVE_SIG_ZREGS_SIZE -+#ifndef SVE_PT_REGS_SVE - #include "aarch64-sve-linux-sigcontext.h" - #endif - ---- a/gdb/nat/aarch64-sve-linux-sigcontext.h -+++ b/gdb/nat/aarch64-sve-linux-sigcontext.h -@@ -19,6 +19,7 @@ - #ifndef NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H - #define NAT_AARCH64_SVE_LINUX_SIGCONTEXT_H - -+#ifndef SVE_MAGIC - #define SVE_MAGIC 0x53564501 - - struct sve_context { -@@ -128,6 +129,7 @@ struct sve_context { - (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET) - - #define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq)) -+#endif - - /* SVE/FP/SIMD state (NT_ARM_SVE) */ - diff --git a/package/devel/gdb/patches/100-musl_fix.patch b/package/devel/gdb/patches/100-musl_fix.patch deleted file mode 100644 index e0d871d291..0000000000 --- a/package/devel/gdb/patches/100-musl_fix.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- a/gdb/linux-nat.c -+++ b/gdb/linux-nat.c -@@ -17,6 +17,7 @@ - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -+#include "stopcode.h" - #include "defs.h" - #include "inferior.h" - #include "infrun.h" -@@ -70,6 +71,10 @@ - #include "gdbsupport/gdb-sigmask.h" - #include "debug.h" - -+#ifndef __SIGRTMIN -+#define __SIGRTMIN SIGRTMIN -+#endif -+ - /* This comment documents high-level logic of this file. - - Waiting for events in sync mode ---- /dev/null -+++ b/gdb/stopcode.h -@@ -0,0 +1,4 @@ -+#ifndef W_STOPCODE -+#define W_STOPCODE(sig) ((sig) << 8 | 0x7f) -+#endif -+ ---- a/gdb/nat/ppc-linux.h -+++ b/gdb/nat/ppc-linux.h -@@ -18,7 +18,10 @@ - #ifndef NAT_PPC_LINUX_H - #define NAT_PPC_LINUX_H - -+#define pt_regs __pt_regs - #include -+#undef pt_regs -+ - #include - - /* This sometimes isn't defined. */ ---- a/gdbserver/linux-ppc-low.cc -+++ b/gdbserver/linux-ppc-low.cc -@@ -23,7 +23,9 @@ - #include "elf/common.h" - #include - #include -+#define pt_regs __pt_regs - #include -+#undef pt_regs - - #include "arch/ppc-linux-common.h" - #include "arch/ppc-linux-tdesc.h" diff --git a/package/devel/gdb/patches/130-gdb-ctrl-c.patch b/package/devel/gdb/patches/130-gdb-ctrl-c.patch new file mode 100644 index 0000000000..88b5de9d8c --- /dev/null +++ b/package/devel/gdb/patches/130-gdb-ctrl-c.patch @@ -0,0 +1,35 @@ +From 63df98fa78c8a6e12b40ebdc5c155838d2bf8b5f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Thu, 29 Nov 2018 18:00:23 -0800 +Subject: [PATCH 11/11] gdbserver ctrl-c handling + +This problem was created by the upstream commit 78708b7c8c +After applying the commit, it will send SIGINT to the process +group(-signal_pid). +But if we use gdbserver send SIGINT, and the attached process is not a +process +group leader, then the "kill (-signal_pid, SIGINT)" returns error and +fails to +interrupt the attached process. + +Upstream-Status: Submitted +[https://sourceware.org/bugzilla/show_bug.cgi?id=18945] + +Author: Josh Gao +Signed-off-by: Zhixiong Chi +Signed-off-by: Khem Raj +--- + gdbserver/linux-low.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/gdbserver/linux-low.cc ++++ b/gdbserver/linux-low.cc +@@ -5714,7 +5714,7 @@ linux_process_target::request_interrupt + { + /* Send a SIGINT to the process group. This acts just like the user + typed a ^C on the controlling terminal. */ +- ::kill (-signal_pid, SIGINT); ++ ::kill (signal_pid, SIGINT); + } + + bool diff --git a/package/devel/gdb/patches/130-uclibc-fix.patch b/package/devel/gdb/patches/130-uclibc-fix.patch deleted file mode 100644 index a4c339ebe0..0000000000 --- a/package/devel/gdb/patches/130-uclibc-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gdb/dwarf2/index-write.c -+++ b/gdb/dwarf2/index-write.c -@@ -777,7 +777,7 @@ public: - gdb_assert (m_abbrev_table.empty ()); - const size_t name_count = m_name_to_value_set.size (); - m_bucket_table.resize -- (std::pow (2, std::ceil (std::log2 (name_count * 4 / 3)))); -+ (std::pow (2, std::ceil (log2 (name_count * 4 / 3)))); - m_hash_table.reserve (name_count); - m_name_table_string_offs.reserve (name_count); - m_name_table_entry_offs.reserve (name_count); diff --git a/package/devel/gdb/patches/140-sgidefs.patch b/package/devel/gdb/patches/140-sgidefs.patch new file mode 100644 index 0000000000..05b30f5242 --- /dev/null +++ b/package/devel/gdb/patches/140-sgidefs.patch @@ -0,0 +1,30 @@ +From 677b5b56135141c0d259e370aacd0e11c810aa15 Mon Sep 17 00:00:00 2001 +From: Andre McCurdy +Date: Fri, 5 Feb 2016 14:00:00 -0800 +Subject: [PATCH] use + +Build fix for MIPS with musl libc + +The MIPS specific header is provided by glibc and uclibc +but not by musl. Regardless of the libc, the kernel headers provide + which provides the same definitions, so use that +instead. + +Upstream-Status: Pending + +Signed-off-by: Andre McCurdy +--- + gdb/mips-linux-nat.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/gdb/mips-linux-nat.c ++++ b/gdb/mips-linux-nat.c +@@ -31,7 +31,7 @@ + #include "gdb_proc_service.h" + #include "gregset.h" + +-#include ++#include + #include "nat/gdb_ptrace.h" + #include + #include "inf-ptrace.h" diff --git a/package/devel/gdb/patches/150-mips64.patch b/package/devel/gdb/patches/150-mips64.patch new file mode 100644 index 0000000000..65418fd290 --- /dev/null +++ b/package/devel/gdb/patches/150-mips64.patch @@ -0,0 +1,32 @@ +From e92f8932ef488de2a56db4299131ce6a4eb170bd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 23 Mar 2016 06:30:09 +0000 +Subject: [PATCH] mips-linux-nat: Define _ABIO32 if not defined + +This helps building gdb on mips64 on musl, since +musl does not provide sgidefs.h this define is +only defined when GCC is using o32 ABI, in that +case gcc emits it as built-in define and hence +it works ok for mips32 + +Signed-off-by: Khem Raj +--- +Upstream-Status: Pending + + gdb/mips-linux-nat.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/gdb/mips-linux-nat.c ++++ b/gdb/mips-linux-nat.c +@@ -42,6 +42,11 @@ + #define PTRACE_GET_THREAD_AREA 25 + #endif + ++/* musl does not define and relies on compiler built-in macros for it */ ++#ifndef _ABIO32 ++#define _ABIO32 1 ++#endif ++ + class mips_linux_nat_target final : public linux_nat_trad_target + { + public: From ca2e7ef60bc23611867ff4b09d1ebca0f6504be4 Mon Sep 17 00:00:00 2001 From: "Fritz D. Ansel" Date: Mon, 2 Aug 2021 20:38:31 +0200 Subject: [PATCH 14/38] dropbear: allow to use with xinetd with xinetd allowed+blocked (ipv6) hosts could be set what is not possible with stock dropbear package The file size increased 12 Bytes, so this "opimisation" did not really helped. Within a compressed storage format it is 0.. ipk: 111.171 -> 111.361 = 190 bytes bin: 215.128 -> 215.140 = 12 bytes Signed-off-by: Fritz D. Ansel --- package/network/services/dropbear/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 77887f39db..7fb4b7f123 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -106,14 +106,12 @@ CONFIGURE_ARGS += \ # remove protocol idented software version number: # - LOCAL_IDENT # disable legacy/unsafe methods and unused functionality: -# - INETD_MODE # - DROPBEAR_CLI_NETCAT # - DROPBEAR_DSS # - DO_MOTD DB_OPT_COMMON = \ DEFAULT_PATH|"$(TARGET_INIT_PATH)" \ !!LOCAL_IDENT|"SSH-2.0-dropbear" \ - INETD_MODE|0 \ DROPBEAR_CLI_NETCAT|0 \ DROPBEAR_DSS|0 \ DO_MOTD|0 \ From a5e9b976114f9996908d008fde93e693a679661a Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Tue, 10 Aug 2021 12:22:17 +0200 Subject: [PATCH 15/38] prereq-build: require python3-distutils Debian and Ubuntu ship a python3-minimal package which does not include the distutils module. This is not supported by upstream and can be considered a broken python distribution. In practice, many scripts depend on said module, and this is a reoccuring pain point for building various OpenWrt packages. Require and check for said module, enough time has been wasted on this. Signed-off-by: Andre Heider --- include/prereq-build.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 8fbf6f22c4..922e7c544b 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -170,6 +170,10 @@ $(eval $(call SetupHostCommand,python3,Please install Python >= 3.6, \ python3.6 -V 2>&1 | grep 'Python 3', \ python3 -V 2>&1 | grep -E 'Python 3\.[6-9]\.?')) +$(eval $(call TestHostCommand,python3-distutils, \ + Please install the Python3 distutils module, \ + $(STAGING_DIR_HOST)/bin/python3 -c 'import distutils')) + $(eval $(call SetupHostCommand,git,Please install Git (git-core) >= 1.7.12.2, \ git --exec-path | xargs -I % -- grep -q -- --recursive %/git-submodule)) From 88d6f4e433f377be2678930dea70c3749fb50e3e Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Sun, 22 Aug 2021 17:57:39 +0300 Subject: [PATCH 16/38] lldpd: bump to 1.0.12 Signed-off-by: Stijn Tintel --- package/network/services/lldpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/lldpd/Makefile b/package/network/services/lldpd/Makefile index 920e113e66..9acc721b99 100644 --- a/package/network/services/lldpd/Makefile +++ b/package/network/services/lldpd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lldpd -PKG_VERSION:=1.0.9 -PKG_RELEASE:=3 +PKG_VERSION:=1.0.12 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://media.luffy.cx/files/lldpd -PKG_HASH:=6b64eb3125952b1e33472198b054e8aa0dee45f45d3d4be22789090a474949f5 +PKG_HASH:=d194c65b5b9c98d194a2842ddc75ba17ebdee7ebd5499f81a98d24031628daf1 PKG_MAINTAINER:=Stijn Tintel PKG_LICENSE:=ISC From 0ade17301610ce1d9efb56bd271fbcc9f90ea5a6 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 25 Feb 2019 15:05:07 +0200 Subject: [PATCH 17/38] base-files: add option to make /var persistent In OpenWrt, /var is symlinked to /tmp by default. This is done to reduce the amount of writes to the flash chip, which often have not the greatest durability. As a result, things like DHCP or UPnP lease files, are not persistent across reboots. Since OpenWrt can run on devices with more durable storage, it makes sense to have an option for a persistent /var. Add an option to make /var persistent. When enabled, /var will no longer be symlinked to /tmp, but /var/run will be symlink to /tmp/run, as it should contains only files that should not be kept during reboot. The option is off by default, to maintain the current behaviour. Signed-off-by: Stijn Tintel --- config/Config-images.in | 8 ++++++++ package/base-files/Makefile | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/config/Config-images.in b/config/Config-images.in index c6d82da97e..9ac09b1602 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -303,4 +303,12 @@ menu "Target Images" it will be mounted by PARTUUID which makes the kernel find the appropriate disk automatically. + config TARGET_ROOTFS_PERSIST_VAR + bool "Make /var persistent" + default n + help + Do not symlink /var to /tmp, so that its content will persist + across reboots. When enabled, /var/run will still be linked + to /tmp/run. + endmenu diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 89a8551ccd..da36421b5a 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -170,8 +170,13 @@ define Package/base-files/install mkdir -p $(1)/www mkdir -p $(1)/root $(LN) /proc/mounts $(1)/etc/mtab +ifeq ($(CONFIG_TARGET_ROOTFS_PERSIST_VAR),n) rm -f $(1)/var $(LN) tmp $(1)/var +else + mkdir -p $(1)/var + $(LN) /tmp/run $(1)/var/run +endif mkdir -p $(1)/etc $(LN) /tmp/resolv.conf /tmp/TZ /tmp/localtime $(1)/etc/ From f89a70fef328f70c4bf330fac2af237ccb202fce Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 23 Aug 2021 10:09:48 +0800 Subject: [PATCH 18/38] README: rewrite based on OpenWrt Signed-off-by: Tianling Shen (cherry picked from commit 56a0a12e171fbe4ae1af3fc799487305c3945f76) --- README.md | 169 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 127 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 0dfa74e525..6d391e924c 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,135 @@ -# PROJECT IMMORTALWRT -## The Core Source Code of ImmortalWrt -### Welcome to our Telegram Group: [@ctcgfw\_openwrt\_discuss](https://t.me/ctcgfw_openwrt_discuss). -- - - +logo -# How to make it -## Minimum requirements -Linux with case sensitive
-2G DDR2 RAM
-2 CPU Cores (AMD64, 1.4Ghz)
-25G disk space left
-Has access to both ChinaNet & Internet +# Project ImmortalWrt -## Install the necessary packages (for Ubuntu user) -```bash -sudo apt-get update -y -sudo apt-get full-upgrade -y -sudo apt-get install -y build-essential cmake 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 python2.7 python3 python3-pip python3-ply haveged lrzsz device-tree-compiler scons antlr3 gperf intltool mkisofs rsync -``` -#### For mainland China & Ubuntu(16.04+) user, you may run the following command to setup quickly: -```bash -sudo bash -c "bash <(curl -s https://build-scripts.project-openwrt.eu.org/init_build_environment.sh)" -``` +This project is a fork of [OpenWrt](https://openwrt.org), with more packages ported, more device supported, better performance, and special optimizations for mainland China users.
+Compared the official one, we allow to use hacks or non-upstreamable patches / modifications to achieve our purpose. Source from anywhere. -## Clone the source -```bash -git clone -b openwrt-18.06 --single-branch https://github.com/immortalwrt/immortalwrt && cd immortalwrt -./scripts/feeds update -a && ./scripts/feeds install -a -``` -#### For developer, you may use `openwrt-18.06-dev` branch instead of `openwrt-18.06`. +Default login address: http://192.168.1.1 or http://immortalwrt.lan, username: __root__, password: __password__. -## Configure your firmware -```bash -make menuconfig -``` +## Development +To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sensitive filesystem required). Cygwin is unsupported because of the lack of a case sensitive file system.
-## Make it -```bash -make -j$(nproc) V=s -``` + ### Requirements + To build with is project, Ubuntu 18.04 LTS is preferred. And you need use the CPU based on AMD64 architecture, with at least 4GB RAM and 25 GB available disk space. Make sure the __Internet__ is accessible. -## Tips -You'd better not use **root** to make it, or you may be not able to use.
-Default login address: 192.168.1.1, username is **root** and password is **password**. + The following tools are needed to compile ImmortalWrt, the package names vary between distributions. -# Contributed -### See [CONTRIBUTED.md](https://github.com/immortalwrt/immortalwrt/blob/openwrt-18.06/CONTRIBUTED.md). + - Here is an example for Ubuntu users:
+ - Method 1: +
+ Setup dependencies via APT -# License -### [GNU General Public License v3.0](https://github.com/immortalwrt/immortalwrt/blob/openwrt-18.06/LICENSES/GPL-3.0). + ```bash + sudo apt-get update -y + sudo apt-get full-upgrade -y + sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ + bzip2 ccache cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext git git-core gperf haveged \ + help2man intltool lib32gcc1 libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev \ + libmpfr-dev libncurses5-dev libncurses5-dev libreadline-dev libssl-dev libtool libz-dev lrzsz mkisofs msmtp \ + nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3 python3-pip python3-ply python-docutils \ + qemu-utils re2c rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto \ + xxd zlib1g-dev + ``` +
+ - Method 2: + ```bash + curl -s https://build-scripts.project-openwrt.eu.org/init_build_environment.sh | sudo bash + ``` + + - You can also download and use prebuilt container directly: + ```bash + docker pull immortalwrt/opde:base + # docker run --rm -it immortalwrt/opde:base + ``` + + Note: + - For the for love of god please do __not__ use ROOT user to build your image. + - You must __not__ have spaces in PATH or in the work folders on the drive. + - If you're using Windows Subsystem for Linux (or WSL), removing Windows folders from PATH are required, please see [Build system setup WSL](https://openwrt.org/docs/guide-developer/build-system/wsl) documentation. + - Using macOS as the host build OS is __not__ recommended. No warranty at all. You can get tips from [Build system setup macOS](https://openwrt.org/docs/guide-developer/build-system/buildroot.exigence.macosx) documentation. + - As you're building ImmortalWrt, patching or disabling UPX tools is also required. + - For more details, please see [Build system setup](https://openwrt.org/docs/guide-developer/build-system/install-buildsystem) documentation. + + ### Quickstart + - Method 1: + 1. Run `git clone -b --single-branch https://github.com/immortalwrt/immortalwrt` to clone the source code. + 2. Run `cd immortalwrt` to enter source directory. + 3. Run `./scripts/feeds update -a` to obtain all the latest package definitions defined in feeds.conf / feeds.conf.default + 4. Run `./scripts/feeds install -a` to install symlinks for all obtained packages into package/feeds/ + 5. Run `make menuconfig` to select your preferred configuration for the toolchain, target system & firmware packages. + 6. Run `make` to build your firmware. This will download all sources, build the cross-compile toolchain and then cross-compile the GNU/Linux kernel & all chosen applications for your target system. + + - Method 2: +
+ Build image via OPDE + + - For Linux User: + ```bash + git clone -b master --single-branch https://github.com/immortalwrt/immortalwrt && cd immortalwrt + docker run --rm -it \ + -v $PWD:/openwrt \ + immortalwrt/opde:base zsh + ./scripts/feeds update -a && ./scripts/feeds install -a + ``` + + - For Windows User: + 1. Create a volume 'immortalwrt' and clone ImmortalWrt source into volume. + ```bash + docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base git clone -b master --single-branch https://github.com/immortalwrt/immortalwrt . + ``` + 2. Enter docker container and update feeds. + ```bash + docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base + ./scripts/feeds update -a && ./scripts/feeds install -a + ``` + - Tips: ImmortalWrt source code can not be cloned into NTFS filesystem (symbol link problem during compilation), but docker volume is fine. + + - Proxy Support: + ```bash + docker run --rm -it \ + -e all_proxy=http://example.com:1081 \ + -e http_proxy=http://example.com:1081 \ + -e https_proxy=http://example.com:1081 \ + -e ALL_PROXY=http://example.com:1081 \ + -e HTTP_PROXY=http://example.com:1081 \ + -e HTTPS_PROXY=http://example.com:1081 \ + -v $PWD:/openwrt \ + immortalwrt/opde:base zsh + ``` + + > Recommand `http` rather `socks5` protocol + > + > IP can not be `localhost` or `127.0.0.1` + + - For Windows User, binary is still in volume. It can be copied to outside via followed command: + ```bash + docker run --rm -v :/dst -v openwrt:/openwrt -w /dst immortalwrt:base cp /openwrt/bin /dst + ``` + > Make sure `D:\path]to\dir` has been appended in [File Sharing](https://docs.docker.com/docker-for-windows/#file-sharing). + +
+ + ### Related Repositories + The main repository uses multiple sub-repositories to manage packages of different categories. All packages are installed via the ImmortalWrt package manager called opkg. If you're looking to develop the web interface or port packages to ImmortalWrt, please find the fitting repository below. + - [LuCI Web Interface](https://github.com/immortalwrt/luci): Modern and modular interface to control the device via a web browser. + - [ImmortalWrt Packages](https://github.com/immortalwrt/packages): Community repository of ported packages. + - [OpenWrt Routing](https://github.com/openwrt/routing): Packages specifically focused on (mesh) routing. + - [CONTRIBUTED.md](https://github.com/immortalwrt/immortalwrt/blob/master/CONTRIBUTED.md): the 3rd-party packages we introduced. + +## Support Information +For a list of supported devices see the [OpenWrt Hardware Database](https://openwrt.org/supported_devices) + ### Documentation + - [Quick Start Guide](https://openwrt.org/docs/guide-quick-start/start) + - [User Guide](https://openwrt.org/docs/guide-user/start) + - [Developer Documentation](https://openwrt.org/docs/guide-developer/start) + - [Technical Reference](https://openwrt.org/docs/techref/start) + + ### Support Community + - Support Chat: group [@ctcgfw_openwrt_discuss](https://t.me/ctcgfw_openwrt_discuss) on [Telegram](https://telegram.org/). + +## Sponsors +[![Dler Cloud](https://user-images.githubusercontent.com/22235437/111103249-f9ec6e00-8588-11eb-9bfc-67cc55574555.png)](https://dlercloud.com/) + +## License +ImmortalWrt is licensed under [GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html). From 8c72d84c84413658ce74a28e6fc7fc11f090d5df Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 23 Aug 2021 10:19:17 +0800 Subject: [PATCH 19/38] README: minor typo fixes Signed-off-by: Tianling Shen (cherry picked from commit 75300e5ca1da4b7a7369f1d5f2a42460d414f362) --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 6d391e924c..13f4a9c5c6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Project ImmortalWrt -This project is a fork of [OpenWrt](https://openwrt.org), with more packages ported, more device supported, better performance, and special optimizations for mainland China users.
+ImmortalWrt is a fork of [OpenWrt](https://openwrt.org), with more packages ported, more device supported, better performance, and special optimizations for mainland China users.
Compared the official one, we allow to use hacks or non-upstreamable patches / modifications to achieve our purpose. Source from anywhere. Default login address: http://192.168.1.1 or http://immortalwrt.lan, username: __root__, password: __password__. @@ -11,7 +11,7 @@ Default login address: http://192.168.1.1 or http://immortalwrt.lan, username: _ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sensitive filesystem required). Cygwin is unsupported because of the lack of a case sensitive file system.
### Requirements - To build with is project, Ubuntu 18.04 LTS is preferred. And you need use the CPU based on AMD64 architecture, with at least 4GB RAM and 25 GB available disk space. Make sure the __Internet__ is accessible. + To build with this project, Ubuntu 18.04 LTS is preferred. And you need use the CPU based on AMD64 architecture, with at least 4GB RAM and 25 GB available disk space. Make sure the __Internet__ is accessible. The following tools are needed to compile ImmortalWrt, the package names vary between distributions. @@ -21,8 +21,8 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens Setup dependencies via APT ```bash - sudo apt-get update -y - sudo apt-get full-upgrade -y + sudo apt update -y + sudo apt full-upgrade -y sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ bzip2 ccache cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext git git-core gperf haveged \ help2man intltool lib32gcc1 libc6-dev-i386 libelf-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev \ @@ -45,6 +45,7 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens Note: - For the for love of god please do __not__ use ROOT user to build your image. + - Using CPUs based on other architectures should be fine to compile ImmortalWrt, but more hacks are needed - No warranty at all. - You must __not__ have spaces in PATH or in the work folders on the drive. - If you're using Windows Subsystem for Linux (or WSL), removing Windows folders from PATH are required, please see [Build system setup WSL](https://openwrt.org/docs/guide-developer/build-system/wsl) documentation. - Using macOS as the host build OS is __not__ recommended. No warranty at all. You can get tips from [Build system setup macOS](https://openwrt.org/docs/guide-developer/build-system/buildroot.exigence.macosx) documentation. @@ -53,12 +54,12 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens ### Quickstart - Method 1: - 1. Run `git clone -b --single-branch https://github.com/immortalwrt/immortalwrt` to clone the source code. - 2. Run `cd immortalwrt` to enter source directory. - 3. Run `./scripts/feeds update -a` to obtain all the latest package definitions defined in feeds.conf / feeds.conf.default - 4. Run `./scripts/feeds install -a` to install symlinks for all obtained packages into package/feeds/ - 5. Run `make menuconfig` to select your preferred configuration for the toolchain, target system & firmware packages. - 6. Run `make` to build your firmware. This will download all sources, build the cross-compile toolchain and then cross-compile the GNU/Linux kernel & all chosen applications for your target system. + 1. Run `git clone -b --single-branch https://github.com/immortalwrt/immortalwrt` to clone the source code. + 2. Run `cd immortalwrt` to enter source directory. + 3. Run `./scripts/feeds update -a` to obtain all the latest package definitions defined in feeds.conf / feeds.conf.default + 4. Run `./scripts/feeds install -a` to install symlinks for all obtained packages into package/feeds/ + 5. Run `make menuconfig` to select your preferred configuration for the toolchain, target system & firmware packages. + 6. Run `make` to build your firmware. This will download all sources, build the cross-compile toolchain and then cross-compile the GNU/Linux kernel & all chosen applications for your target system. - Method 2:
@@ -66,7 +67,7 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens - For Linux User: ```bash - git clone -b master --single-branch https://github.com/immortalwrt/immortalwrt && cd immortalwrt + git clone -b --single-branch https://github.com/immortalwrt/immortalwrt && cd immortalwrt docker run --rm -it \ -v $PWD:/openwrt \ immortalwrt/opde:base zsh @@ -76,7 +77,7 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens - For Windows User: 1. Create a volume 'immortalwrt' and clone ImmortalWrt source into volume. ```bash - docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base git clone -b master --single-branch https://github.com/immortalwrt/immortalwrt . + docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base git clone -b --single-branch https://github.com/immortalwrt/immortalwrt . ``` 2. Enter docker container and update feeds. ```bash From 0dcfb69eb9065d7f407def9fca8e6948474ae4a6 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 23 Aug 2021 11:04:42 +0800 Subject: [PATCH 20/38] README: futher style fixes Signed-off-by: Tianling Shen (cherry picked from commit 70c1b0e2f63a6f88ab6267e71bdbf8bf8944cd27) --- README.md | 65 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 13f4a9c5c6..d6095793cd 100644 --- a/README.md +++ b/README.md @@ -37,17 +37,14 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens curl -s https://build-scripts.project-openwrt.eu.org/init_build_environment.sh | sudo bash ``` - - You can also download and use prebuilt container directly: - ```bash - docker pull immortalwrt/opde:base - # docker run --rm -it immortalwrt/opde:base - ``` + - You can also download and use prebuilt container directly:
+ See #Quickstart - Build image via OPDE Note: - For the for love of god please do __not__ use ROOT user to build your image. - Using CPUs based on other architectures should be fine to compile ImmortalWrt, but more hacks are needed - No warranty at all. - You must __not__ have spaces in PATH or in the work folders on the drive. - - If you're using Windows Subsystem for Linux (or WSL), removing Windows folders from PATH are required, please see [Build system setup WSL](https://openwrt.org/docs/guide-developer/build-system/wsl) documentation. + - If you're using Windows Subsystem for Linux (or WSL), removing Windows folders from PATH is required, please see [Build system setup WSL](https://openwrt.org/docs/guide-developer/build-system/wsl) documentation. - Using macOS as the host build OS is __not__ recommended. No warranty at all. You can get tips from [Build system setup macOS](https://openwrt.org/docs/guide-developer/build-system/buildroot.exigence.macosx) documentation. - As you're building ImmortalWrt, patching or disabling UPX tools is also required. - For more details, please see [Build system setup](https://openwrt.org/docs/guide-developer/build-system/install-buildsystem) documentation. @@ -65,14 +62,20 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens
Build image via OPDE + - Pull the prebuilt container: + ```bash + docker pull immortalwrt/opde:base + # docker run --rm -it immortalwrt/opde:base + ``` + - For Linux User: - ```bash - git clone -b --single-branch https://github.com/immortalwrt/immortalwrt && cd immortalwrt - docker run --rm -it \ - -v $PWD:/openwrt \ - immortalwrt/opde:base zsh - ./scripts/feeds update -a && ./scripts/feeds install -a - ``` + ```bash + git clone -b --single-branch https://github.com/immortalwrt/immortalwrt && cd immortalwrt + docker run --rm -it \ + -v $PWD:/openwrt \ + immortalwrt/opde:base zsh + ./scripts/feeds update -a && ./scripts/feeds install -a + ``` - For Windows User: 1. Create a volume 'immortalwrt' and clone ImmortalWrt source into volume. @@ -87,27 +90,27 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens - Tips: ImmortalWrt source code can not be cloned into NTFS filesystem (symbol link problem during compilation), but docker volume is fine. - Proxy Support: - ```bash - docker run --rm -it \ - -e all_proxy=http://example.com:1081 \ - -e http_proxy=http://example.com:1081 \ - -e https_proxy=http://example.com:1081 \ - -e ALL_PROXY=http://example.com:1081 \ - -e HTTP_PROXY=http://example.com:1081 \ - -e HTTPS_PROXY=http://example.com:1081 \ - -v $PWD:/openwrt \ - immortalwrt/opde:base zsh - ``` + ```bash + docker run --rm -it \ + -e all_proxy=http://example.com:1081 \ + -e http_proxy=http://example.com:1081 \ + -e https_proxy=http://example.com:1081 \ + -e ALL_PROXY=http://example.com:1081 \ + -e HTTP_PROXY=http://example.com:1081 \ + -e HTTPS_PROXY=http://example.com:1081 \ + -v $PWD:/openwrt \ + immortalwrt/opde:base zsh + ``` - > Recommand `http` rather `socks5` protocol - > - > IP can not be `localhost` or `127.0.0.1` + > Recommand `http` rather `socks5` protocol + > + > IP can not be `localhost` or `127.0.0.1` - For Windows User, binary is still in volume. It can be copied to outside via followed command: - ```bash - docker run --rm -v :/dst -v openwrt:/openwrt -w /dst immortalwrt:base cp /openwrt/bin /dst - ``` - > Make sure `D:\path]to\dir` has been appended in [File Sharing](https://docs.docker.com/docker-for-windows/#file-sharing). + ```bash + docker run --rm -v :/dst -v openwrt:/openwrt -w /dst immortalwrt:base cp /openwrt/bin /dst + ``` + > Make sure `D:\path\to\dir` has been appended in [File Sharing](https://docs.docker.com/docker-for-windows/#file-sharing).
From e603d84f73a951f518cc4120f57a64833bb80cc9 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 23 Aug 2021 20:35:02 +0800 Subject: [PATCH 21/38] README: fix indent Signed-off-by: Tianling Shen (cherry picked from commit f134c62bf7953aaa5cc4d8042a86db031e868614) --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d6095793cd..7573a90f3d 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,9 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens ```
- Method 2: - ```bash - curl -s https://build-scripts.project-openwrt.eu.org/init_build_environment.sh | sudo bash - ``` + ```bash + curl -s https://build-scripts.project-openwrt.eu.org/init_build_environment.sh | sudo bash + ``` - You can also download and use prebuilt container directly:
See #Quickstart - Build image via OPDE @@ -79,14 +79,14 @@ To build your own firmware you need a GNU/Linux, BSD or MacOSX system (case sens - For Windows User: 1. Create a volume 'immortalwrt' and clone ImmortalWrt source into volume. - ```bash - docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base git clone -b --single-branch https://github.com/immortalwrt/immortalwrt . - ``` + ```bash + docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base git clone -b --single-branch https://github.com/immortalwrt/immortalwrt . + ``` 2. Enter docker container and update feeds. - ```bash - docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base - ./scripts/feeds update -a && ./scripts/feeds install -a - ``` + ```bash + docker run --rm -it -v immortalwrt:/openwrt immortalwrt/opde:base + ./scripts/feeds update -a && ./scripts/feeds install -a + ``` - Tips: ImmortalWrt source code can not be cloned into NTFS filesystem (symbol link problem during compilation), but docker volume is fine. - Proxy Support: From ed70f9d796a672bd5a637d6dea7d489162054561 Mon Sep 17 00:00:00 2001 From: ElonH Date: Mon, 23 Aug 2021 22:51:02 +0800 Subject: [PATCH 22/38] kernel-4.14: add missing kconf --- target/linux/generic/config-4.14 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index 2a2603ba6e..81e0467129 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -2236,6 +2236,9 @@ CONFIG_IP_ROUTE_VERBOSE=y # CONFIG_IRQ_POLL is not set # CONFIG_IRQ_TIME_ACCOUNTING is not set # CONFIG_IR_GPIO_CIR is not set +# CONFIG_IR_GPIO_TX is not set +# CONFIG_IR_SERIAL is not set +# CONFIG_IR_SIR is not set # CONFIG_IR_HIX5HD2 is not set # CONFIG_IR_IGORPLUGUSB is not set # CONFIG_IR_IGUANA is not set @@ -2248,7 +2251,12 @@ CONFIG_IP_ROUTE_VERBOSE=y # CONFIG_IR_RC5_DECODER is not set # CONFIG_IR_RC6_DECODER is not set # CONFIG_IR_REDRAT3 is not set +# CONFIG_IR_SPI is not set # CONFIG_IR_SONY_DECODER is not set +# CONFIG_IR_SANYO_DECODER is not set +# CONFIG_IR_SHARP_DECODER is not set +# CONFIG_IR_MCE_KBD_DECODER is not set +# CONFIG_IR_XMP_DECODER is not set # CONFIG_IR_STREAMZAP is not set # CONFIG_IR_TTUSBIR is not set # CONFIG_ISA_BUS is not set @@ -3758,6 +3766,7 @@ CONFIG_PWRSEQ_SIMPLE=y # CONFIG_QED is not set # CONFIG_QLA3XXX is not set # CONFIG_QLCNIC is not set +# CONFIG_QLCNIC_HWMON is not set # CONFIG_QLGE is not set # CONFIG_QNX4FS_FS is not set # CONFIG_QNX6FS_FS is not set @@ -5621,6 +5630,7 @@ CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y # CONFIG_VFAT_FS is not set # CONFIG_VGASTATE is not set # CONFIG_VGA_ARB is not set +# CONFIG_VGA_CONSOLE is not set # CONFIG_VGA_SWITCHEROO is not set # CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set # CONFIG_VHOST_NET is not set From 56be2fe6ace0c7629dbf86d8b3ce0395d010172d Mon Sep 17 00:00:00 2001 From: ElonH Date: Mon, 23 Aug 2021 23:16:12 +0800 Subject: [PATCH 23/38] kerner-4.9: add missing kconf --- target/linux/generic/config-4.9 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 6a1baf8746..e7d26acf7e 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -421,6 +421,7 @@ CONFIG_BASE_SMALL=0 # CONFIG_BATTERY_DS2781 is not set # CONFIG_BATTERY_DS2782 is not set # CONFIG_BATTERY_GAUGE_LTC2941 is not set +# CONFIG_BATTERY_RT5033 is not set # CONFIG_BATTERY_GOLDFISH is not set # CONFIG_BATTERY_MAX17040 is not set # CONFIG_BATTERY_MAX17042 is not set @@ -1073,11 +1074,15 @@ CONFIG_DQL=y # CONFIG_DRAGONRISE_FF is not set # CONFIG_DRM is not set # CONFIG_DRM_AMDGPU is not set +# CONFIG_DRM_AMDGPU_USERPTR is not set +# CONFIG_DRM_AMDGPU_GART_DEBUGFS is not set +# CONFIG_DRM_AMD_ACP is not set # CONFIG_DRM_ANALOGIX_ANX78XX is not set # CONFIG_DRM_ARCPGU is not set # CONFIG_DRM_ARMADA is not set # CONFIG_DRM_AST is not set # CONFIG_DRM_BOCHS is not set +# CONFIG_DRM_VIRTIO_GPU is not set # CONFIG_DRM_CIRRUS_QEMU is not set # CONFIG_DRM_DP_AUX_CHARDEV is not set # CONFIG_DRM_DUMB_VGA_DAC is not set @@ -1096,6 +1101,7 @@ CONFIG_DQL=y # CONFIG_DRM_MALI_DISPLAY is not set # CONFIG_DRM_MGAG200 is not set # CONFIG_DRM_NOUVEAU is not set +# CONFIG_DRM_I915 is not set # CONFIG_DRM_NXP_PTN3460 is not set # CONFIG_DRM_OMAP is not set # CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set @@ -1109,12 +1115,15 @@ CONFIG_DQL=y # CONFIG_DRM_PARADE_PS8622 is not set # CONFIG_DRM_QXL is not set # CONFIG_DRM_RADEON is not set +# CONFIG_DRM_RADEON_USERPTR is not set # CONFIG_DRM_SII902X is not set # CONFIG_DRM_STI is not set # CONFIG_DRM_TILCDC is not set # CONFIG_DRM_TOSHIBA_TC358767 is not set # CONFIG_DRM_UDL is not set # CONFIG_DRM_VGEM is not set +# CONFIG_DRM_VMWGFX is not set +# CONFIG_DRM_GMA500 is not set # CONFIG_DS1682 is not set # CONFIG_DS1803 is not set # CONFIG_DST_CACHE is not set @@ -3321,6 +3330,18 @@ CONFIG_PINMUX=y # CONFIG_PLX_HERMES is not set # CONFIG_PM is not set # CONFIG_PMBUS is not set +# CONFIG_SENSORS_PMBUS is not set +# CONFIG_SENSORS_ADM1275 is not set +# CONFIG_SENSORS_LM25066 is not set +# CONFIG_SENSORS_LTC2978 is not set +# CONFIG_SENSORS_LTC3815 is not set +# CONFIG_SENSORS_MAX16064 is not set +# CONFIG_SENSORS_MAX20751 is not set +# CONFIG_SENSORS_MAX34440 is not set +# CONFIG_SENSORS_MAX8688 is not set +# CONFIG_SENSORS_TPS40422 is not set +# CONFIG_SENSORS_UCD9000 is not set +# CONFIG_SENSORS_UCD9200 is not set # CONFIG_PMC_MSP is not set # CONFIG_PMIC_ADP5520 is not set # CONFIG_PMIC_DA903X is not set @@ -3415,6 +3436,7 @@ CONFIG_PWRSEQ_SIMPLE=y # CONFIG_QED is not set # CONFIG_QLA3XXX is not set # CONFIG_QLCNIC is not set +# CONFIG_QLCNIC_HWMON is not set # CONFIG_QLGE is not set # CONFIG_QNX4FS_FS is not set # CONFIG_QNX6FS_FS is not set From d91803a08dacbd6b015f81fb368ce04fccf0183b Mon Sep 17 00:00:00 2001 From: ElonH Date: Mon, 23 Aug 2021 23:24:45 +0800 Subject: [PATCH 24/38] kernel-4.19: add missing kconf --- target/linux/generic/config-4.19 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/target/linux/generic/config-4.19 b/target/linux/generic/config-4.19 index 2791a2ade2..1163d21c55 100644 --- a/target/linux/generic/config-4.19 +++ b/target/linux/generic/config-4.19 @@ -2340,20 +2340,34 @@ CONFIG_IP_VS_MH_TAB_INDEX=10 # CONFIG_IRQ_DOMAIN_DEBUG is not set # CONFIG_IRQ_POLL is not set # CONFIG_IRQ_TIME_ACCOUNTING is not set +# CONFIG_IR_ENE is not set +# CONFIG_IR_FINTEK is not set # CONFIG_IR_GPIO_CIR is not set # CONFIG_IR_HIX5HD2 is not set # CONFIG_IR_IGORPLUGUSB is not set # CONFIG_IR_IGUANA is not set # CONFIG_IR_IMG is not set # CONFIG_IR_IMON is not set +# CONFIG_IR_IMON_DECODER is not set +# CONFIG_IR_IMON_RAW is not set +# CONFIG_IR_ITE_CIR is not set # CONFIG_IR_JVC_DECODER is not set # CONFIG_IR_LIRC_CODEC is not set # CONFIG_IR_MCEUSB is not set +# CONFIG_IR_MCE_KBD_DECODER is not set +# CONFIG_IR_NUVOTON is not set # CONFIG_IR_NEC_DECODER is not set # CONFIG_IR_RC5_DECODER is not set # CONFIG_IR_RC6_DECODER is not set # CONFIG_IR_REDRAT3 is not set +# CONFIG_IR_SERIAL is not set +# CONFIG_IR_SIR is not set +# CONFIG_IR_SPI is not set # CONFIG_IR_SONY_DECODER is not set +# CONFIG_IR_SANYO_DECODER is not set +# CONFIG_IR_SHARP_DECODER is not set +# CONFIG_IR_WINBOND_CIR is not set +# CONFIG_IR_XMP_DECODER is not set # CONFIG_IR_STREAMZAP is not set # CONFIG_IR_TTUSBIR is not set # CONFIG_ISA_BUS is not set @@ -3941,6 +3955,7 @@ CONFIG_PWRSEQ_SIMPLE=y # CONFIG_QED is not set # CONFIG_QLA3XXX is not set # CONFIG_QLCNIC is not set +# CONFIG_QLCNIC_HWMON is not set # CONFIG_QLGE is not set # CONFIG_QNX4FS_FS is not set # CONFIG_QNX6FS_FS is not set From ae1a7f8dbf08732df78727dc25c4c70080eabab1 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 23 Aug 2021 14:06:35 +0300 Subject: [PATCH 25/38] base-files: fix option to make /var persistent The option was initially named TARGET_ROOTFS_LN_VAR_TMP, and the check was correct. When renaming the option to something more suitable, the check was changed to check for n, but when an option is not set, it's not n but empty. This results in the check always evaluating to false. Fix the check by checking for y with ifneq. Fixes: 57807f50ded6 ("base-files: add option to make /var persistent") Signed-off-by: Stijn Tintel --- package/base-files/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index da36421b5a..bae49d3e69 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -170,7 +170,7 @@ define Package/base-files/install mkdir -p $(1)/www mkdir -p $(1)/root $(LN) /proc/mounts $(1)/etc/mtab -ifeq ($(CONFIG_TARGET_ROOTFS_PERSIST_VAR),n) +ifneq ($(CONFIG_TARGET_ROOTFS_PERSIST_VAR),y) rm -f $(1)/var $(LN) tmp $(1)/var else From f9e9f43d8914a3d3db89f61e0ae6d855498cf505 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Fri, 20 Aug 2021 14:33:51 +0300 Subject: [PATCH 26/38] uhttpd: add config option for json_script Add a config option for json_script instead of unconditionally including all json files in /etc/uhttpd in every uhttpd instance. This makes it possible to configure a single instance with an unconditional redirect, which currently renders all other uhttpd instances unusable. Signed-off-by: Stijn Tintel Acked-by: Felix Fietkau --- package/network/services/uhttpd/Makefile | 2 +- package/network/services/uhttpd/files/uhttpd.init | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index f41cbe9436..9c944ed05f 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uhttpd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index dc496b3e28..d86be41b9c 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -187,7 +187,8 @@ start_instance() append_bool "$cfg" redirect_https "-q" 0 } - for file in /etc/uhttpd/*.json; do + config_get json_script "$cfg" json_script + for file in $json_script; do [ -s "$file" ] && procd_append_param command -H "$file" done From e8d4bf9c5242f0ae8c55456702746a39c7106049 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Wed, 25 Aug 2021 18:09:02 +0800 Subject: [PATCH 27/38] openssl: bump to 1.1.1l This version fixes 2 security vulnerabilities: - CVE-2021-3711 - CVE-2021-3712 --- package/libs/openssl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index e3d1c3c601..f01b50e5bc 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_BASE:=1.1.1 -PKG_BUGFIX:=k +PKG_BUGFIX:=l PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) PKG_RELEASE:=1 PKG_USE_MIPS16:=0 @@ -28,7 +28,7 @@ PKG_SOURCE_URL:= \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/ -PKG_HASH:=892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5 +PKG_HASH:=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1 PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE From 477a813a3649213aef8b6f90f72841c7ebff2e55 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 24 Aug 2021 17:40:28 +0200 Subject: [PATCH 28/38] ustp: add OpenWrt STP/RSTP daemon This integrates with netifd in order to provide STP/RSTP protocol support in user space. It defaults to using RSTP for bridges with stp enabled. This daemon has no config files, it uses the configuration passed from netifd via ubus Signed-off-by: Felix Fietkau --- package/network/services/ustp/Makefile | 41 +++++++++++++++++++ .../network/services/ustp/files/ustpd.init | 14 +++++++ 2 files changed, 55 insertions(+) create mode 100644 package/network/services/ustp/Makefile create mode 100644 package/network/services/ustp/files/ustpd.init diff --git a/package/network/services/ustp/Makefile b/package/network/services/ustp/Makefile new file mode 100644 index 0000000000..682bd9f350 --- /dev/null +++ b/package/network/services/ustp/Makefile @@ -0,0 +1,41 @@ +# +# Copyright (C) 2021 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ustp +PKG_RELEASE:=1 + +PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustp.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2021-08-25 +PKG_SOURCE_VERSION:=9622264cf92691f18ae9222b0a4c9db95af5d80d +PKG_MIRROR_HASH:=de4ed29eee21192b60e8683633d916d251bcccd5701bdac83b5ba435189297f1 + +PKG_MAINTAINER:=Felix Fietkau +PKG_LICENSE:=GPL-2.0 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/ustp + SECTION:=net + CATEGORY:=Network + TITLE:=OpenWrt STP/RSTP daemon + DEPENDS:=+libubox +libubus +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -flto +TARGET_LDFLAGS += -flto -fuse-linker-plugin + +define Package/ustp/install + $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ipkg-install/sbin/* $(1)/sbin/ + $(INSTALL_BIN) ./files/ustpd.init $(1)/etc/init.d/ustpd +endef + +$(eval $(call BuildPackage,ustp)) diff --git a/package/network/services/ustp/files/ustpd.init b/package/network/services/ustp/files/ustpd.init new file mode 100644 index 0000000000..9b741fec78 --- /dev/null +++ b/package/network/services/ustp/files/ustpd.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (c) 2021 OpenWrt.org + +START=50 + +USE_PROCD=1 +PROG=/sbin/ustpd + +start_service() { + procd_open_instance + procd_set_param command "$PROG" + procd_set_param respawn + procd_close_instance +} From 3089ff4e46409c4ad05a7a9dec18956ed2ae0e14 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 26 Aug 2021 14:34:28 -0300 Subject: [PATCH 29/38] openssl: bump to 1.1.1l This version fixes two vulnerabilities: - SM2 Decryption Buffer Overflow (CVE-2021-3711) Severity: High - Read buffer overruns processing ASN.1 strings (CVE-2021-3712) Severity: Medium Signed-off-by: Eneas U de Queiroz --- .../410-eng_devcrypto-add-configuration-options.patch | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package/libs/openssl/patches/410-eng_devcrypto-add-configuration-options.patch b/package/libs/openssl/patches/410-eng_devcrypto-add-configuration-options.patch index 8745364cf2..6d0fbfc982 100644 --- a/package/libs/openssl/patches/410-eng_devcrypto-add-configuration-options.patch +++ b/package/libs/openssl/patches/410-eng_devcrypto-add-configuration-options.patch @@ -1,4 +1,4 @@ -From 1c2fabcdb34e436286b4a8760cfbfbff11ea551a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Sat, 3 Nov 2018 15:41:10 -0300 Subject: eng_devcrypto: add configuration options @@ -14,7 +14,6 @@ Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/7585) diff --git a/crypto/engine/eng_devcrypto.c b/crypto/engine/eng_devcrypto.c -index a2c9a966f7..5ec38ca8f3 100644 --- a/crypto/engine/eng_devcrypto.c +++ b/crypto/engine/eng_devcrypto.c @@ -16,6 +16,7 @@ @@ -558,7 +557,7 @@ index a2c9a966f7..5ec38ca8f3 100644 /****************************************************************************** * * LOAD / UNLOAD -@@ -793,6 +1109,8 @@ void engine_load_devcrypto_int() +@@ -806,6 +1122,8 @@ void engine_load_devcrypto_int() if (!ENGINE_set_id(e, "devcrypto") || !ENGINE_set_name(e, "/dev/crypto engine") From 1cadb448f920ac941bc6c1d5ba833a48e0aaefe5 Mon Sep 17 00:00:00 2001 From: Alan Swanson Date: Wed, 29 May 2019 11:39:30 +0100 Subject: [PATCH 30/38] gpio-button-hotplug: add KEY_POWER2 handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For devices such as BTHOMEHUBV5A with both reset and restart buttons, its easily accessible restart button has been assigned to KEY_POWER power script to poweroff preventing accidental (or malicious) factory resets by KEY_RESTART reset script. However an easily accessible button immediately powering off the device is also undesirable. As KEY_RESTART is already used for reset script (and there's no KEY_REBOOT in Linux input events), use KEY_POWER2 for rebooting via new reboot script with 5 second seen delay. Fixes: FS#1965 Signed-off-by: Alan Swanson Signed-off-by: Petr Štetiar [long line wrap] --- package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index 1aef23e876..8e0a21a80b 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -100,6 +100,7 @@ static struct bh_map button_map[] = { BH_MAP(KEY_LIGHTS_TOGGLE, "lights_toggle"), BH_MAP(KEY_PHONE, "phone"), BH_MAP(KEY_POWER, "power"), + BH_MAP(KEY_POWER2, "reboot"), BH_MAP(KEY_RESTART, "reset"), BH_MAP(KEY_RFKILL, "rfkill"), BH_MAP(KEY_VIDEO, "video"), From 26a8d4f516ae61f4c08ca15a33addf93a43f75b7 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sun, 19 May 2019 16:06:34 +0200 Subject: [PATCH 31/38] gpio-button-hotplug: support interrupt properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upstream Linux's input gpio-keys driver supports specifying a external interrupt for a gpio via the 'interrupts' properties as well as having support for software debounce. This patch ports these features to OpenWrt's event version. Only the "pure" interrupt-driven support is left behind, since this goes a bit against the "gpio" in the "gpio-keys" and I don't have a real device to test this with. This patch also silences the generated warnings showing up since 4.14 due to the 'constification' of the struct gpio_keys_button *buttons variable in the upstream struct gpio_keys_platform_data declaration. gpio-button-hotplug.c: In function 'gpio_keys_get_devtree_pdata': gpio-button-hotplug.c:392:10: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] button = &pdata->buttons[i++]; ^ gpio-button-hotplug.c: In function 'gpio_keys_button_probe': gpio-button-hotplug.c:537:12: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] bdata->b = &pdata->buttons[i]; ^ gpio-button-hotplug.c: In function 'gpio_keys_probe': gpio-button-hotplug.c:563:37: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] struct gpio_keys_button *button = &pdata->buttons[i]; ^ Acked-by: Petr Štetiar Signed-off-by: Christian Lamparter --- .../src/gpio-button-hotplug.c | 114 ++++++++++++++---- 1 file changed, 93 insertions(+), 21 deletions(-) diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index 8e0a21a80b..11c914d4ef 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #define DRV_NAME "gpio-keys" @@ -70,7 +71,10 @@ struct gpio_keys_button_data { int count; int threshold; int can_sleep; - struct gpio_keys_button *b; + int irq; + unsigned int software_debounce; + struct gpio_desc *gpiod; + const struct gpio_keys_button *b; }; extern u64 uevent_next_seqnum(void); @@ -298,7 +302,7 @@ static void gpio_keys_polled_check_state(struct gpio_keys_button_data *bdata) return; } - if ((bdata->last_state != -1) || (type == EV_SW)) + if (bdata->last_state != -1 || type == EV_SW) button_hotplug_event(bdata, type, state); bdata->last_state = state; @@ -340,11 +344,29 @@ static void gpio_keys_polled_close(struct gpio_keys_button_dev *bdev) pdata->disable(bdev->dev); } +static void gpio_keys_irq_work_func(struct work_struct *work) +{ + struct gpio_keys_button_data *bdata = container_of(work, + struct gpio_keys_button_data, work.work); + int state = gpio_button_get_value(bdata); + + if (state != bdata->last_state) { + unsigned int type = bdata->b->type ?: EV_KEY; + + if (bdata->last_state != -1 || type == EV_SW) + button_hotplug_event(bdata, type, state); + + bdata->last_state = state; + } +} + static irqreturn_t button_handle_irq(int irq, void *_bdata) { - struct gpio_keys_button_data *bdata = (struct gpio_keys_button_data *) _bdata; + struct gpio_keys_button_data *bdata = + (struct gpio_keys_button_data *) _bdata; - button_hotplug_event(bdata, bdata->b->type ?: EV_KEY, gpio_button_get_value(bdata)); + schedule_delayed_work(&bdata->work, + msecs_to_jiffies(bdata->software_debounce)); return IRQ_HANDLED; } @@ -390,7 +412,9 @@ gpio_keys_get_devtree_pdata(struct device *dev) continue; } - button = &pdata->buttons[i++]; + button = (struct gpio_keys_button *)(&pdata->buttons[i++]); + + button->irq = irq_of_parse_and_map(pp, 0); button->gpio = of_get_gpio_flags(pp, 0, &flags); if (button->gpio < 0) { @@ -517,6 +541,9 @@ static int gpio_keys_button_probe(struct platform_device *pdev, gpio, error); return error; } + bdata->gpiod = gpio_to_desc(gpio); + if (!bdata->gpiod) + return -EINVAL; error = gpio_direction_input(gpio); if (error) { @@ -529,12 +556,26 @@ static int gpio_keys_button_probe(struct platform_device *pdev, bdata->can_sleep = gpio_cansleep(gpio); bdata->last_state = -1; - if (bdev->polled) + if (bdev->polled) { bdata->threshold = DIV_ROUND_UP(button->debounce_interval, - pdata->poll_interval); - else + pdata->poll_interval); + } else { bdata->threshold = 1; + if (button->debounce_interval) { + error = gpiod_set_debounce(bdata->gpiod, + button->debounce_interval * 1000); + /* + * use timer if gpiolib doesn't provide + * debounce. + */ + if (error < 0) { + bdata->software_debounce = + button->debounce_interval; + } + } + } + bdata->b = &pdata->buttons[i]; } @@ -561,23 +602,39 @@ static int gpio_keys_probe(struct platform_device *pdev) pdata = bdev->pdata; for (i = 0; i < pdata->nbuttons; i++) { - struct gpio_keys_button *button = &pdata->buttons[i]; + const struct gpio_keys_button *button = &pdata->buttons[i]; struct gpio_keys_button_data *bdata = &bdev->data[i]; + unsigned long irqflags = IRQF_ONESHOT; - if (!button->irq) - button->irq = gpio_to_irq(button->gpio); - if (button->irq < 0) { - dev_err(&pdev->dev, "failed to get irq for gpio:%d\n", button->gpio); - continue; + if (!button->irq) { + bdata->irq = gpio_to_irq(button->gpio); + + if (bdata->irq < 0) { + dev_err(&pdev->dev, "failed to get irq for gpio:%d\n", + button->gpio); + continue; + } + + irqflags |= IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING; + } else { + bdata->irq = button->irq; } - ret = devm_request_threaded_irq(&pdev->dev, button->irq, NULL, button_handle_irq, - IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, - dev_name(&pdev->dev), bdata); - if (ret < 0) - dev_err(&pdev->dev, "failed to request irq:%d for gpio:%d\n", button->irq, button->gpio); - else - dev_dbg(&pdev->dev, "gpio:%d has irq:%d\n", button->gpio, button->irq); + INIT_DELAYED_WORK(&bdata->work, gpio_keys_irq_work_func); + + ret = devm_request_threaded_irq(&pdev->dev, + bdata->irq, NULL, button_handle_irq, + irqflags, dev_name(&pdev->dev), bdata); + + if (ret < 0) { + bdata->irq = 0; + dev_err(&pdev->dev, "failed to request irq:%d for gpio:%d\n", + bdata->irq, button->gpio); + continue; + } else { + dev_dbg(&pdev->dev, "gpio:%d has irq:%d\n", + button->gpio, bdata->irq); + } if (bdata->b->type == EV_SW) button_hotplug_event(bdata, EV_SW, gpio_button_get_value(bdata)); @@ -613,6 +670,19 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) return ret; } +static void gpio_keys_irq_close(struct gpio_keys_button_dev *bdev) +{ + struct gpio_keys_platform_data *pdata = bdev->pdata; + size_t i; + + for (i = 0; i < pdata->nbuttons; i++) { + struct gpio_keys_button_data *bdata = &bdev->data[i]; + + disable_irq(bdata->irq); + cancel_delayed_work_sync(&bdata->work); + } +} + static int gpio_keys_remove(struct platform_device *pdev) { struct gpio_keys_button_dev *bdev = platform_get_drvdata(pdev); @@ -621,6 +691,8 @@ static int gpio_keys_remove(struct platform_device *pdev) if (bdev->polled) gpio_keys_polled_close(bdev); + else + gpio_keys_irq_close(bdev); return 0; } From eadfebdef1e6d56f74a94ab9b82dfc573a50e9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 3 Jun 2019 22:05:41 +0200 Subject: [PATCH 32/38] gpio-button-hotplug: use pr_debug and pr_err MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pr_debug can be used with dynamic debugging. Tested-by: Kuan-Yi Li Signed-off-by: Petr Štetiar --- .../src/gpio-button-hotplug.c | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index 11c914d4ef..d81898f932 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -29,22 +29,11 @@ #include #include -#define DRV_NAME "gpio-keys" - #define BH_SKB_SIZE 2048 +#define DRV_NAME "gpio-keys" #define PFX DRV_NAME ": " -#undef BH_DEBUG - -#ifdef BH_DEBUG -#define BH_DBG(fmt, args...) printk(KERN_DEBUG "%s: " fmt, DRV_NAME, ##args ) -#else -#define BH_DBG(fmt, args...) do {} while (0) -#endif - -#define BH_ERR(fmt, args...) printk(KERN_ERR "%s: " fmt, DRV_NAME, ##args ) - struct bh_priv { unsigned long seen; }; @@ -138,7 +127,7 @@ int bh_event_add_var(struct bh_event *event, int argv, const char *format, ...) s = skb_put(event->skb, len + 1); strcpy(s, buf); - BH_DBG("added variable '%s'\n", s); + pr_debug(PFX "added variable '%s'\n", s); return 0; } @@ -205,7 +194,7 @@ static void button_hotplug_work(struct work_struct *work) out_free_skb: if (ret) { - BH_ERR("work error %d\n", ret); + pr_err(PFX "work error %d\n", ret); kfree_skb(event->skb); } out_free_event: @@ -217,8 +206,8 @@ static int button_hotplug_create_event(const char *name, unsigned int type, { struct bh_event *event; - BH_DBG("create event, name=%s, seen=%lu, pressed=%d\n", - name, seen, pressed); + pr_debug(PFX "create event, name=%s, seen=%lu, pressed=%d\n", + name, seen, pressed); event = kzalloc(sizeof(*event), GFP_KERNEL); if (!event) @@ -255,7 +244,7 @@ static void button_hotplug_event(struct gpio_keys_button_data *data, unsigned long seen = jiffies; int btn; - BH_DBG("event type=%u, code=%u, value=%d\n", type, data->b->code, value); + pr_debug(PFX "event type=%u, code=%u, value=%d\n", type, data->b->code, value); if ((type != EV_KEY) && (type != EV_SW)) return; From 2f51547027691fab4721b144d80de8cbcf9e366f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Mon, 3 Jun 2019 23:08:01 +0200 Subject: [PATCH 33/38] gpio-button-hotplug: fix wrong initial seen value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the generated event contains wrong seen value, when the button is pressed for the first time: rmmod gpio_button_hotplug; modprobe gpio_button_hotplug [ pressing the wps key immediately after modprobe ] gpio-keys: create event, name=wps, seen=1088, pressed=1 So this patch adds a check for this corner case and makes seen=0 if the button is pressed for the first time. Tested-by: Kuan-Yi Li Signed-off-by: Petr Štetiar --- package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index d81898f932..f429f8c027 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -253,6 +253,9 @@ static void button_hotplug_event(struct gpio_keys_button_data *data, if (btn < 0) return; + if (priv->seen == 0) + priv->seen = seen; + button_hotplug_create_event(button_map[btn].name, type, (seen - priv->seen) / HZ, value); priv->seen = seen; From 03410673fba815e3ff7ac8b2e4e65b6f729a0547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Tue, 4 Jun 2019 13:14:41 +0200 Subject: [PATCH 34/38] gpio-button-hotplug: gpio-keys: fix always missing first event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit afc056d7dc83 ("gpio-button-hotplug: support interrupt properties") changed the gpio-keys interrupt handling logic in a way, that it always misses first event, which causes issues with rc.button scripts, so this patch restores the previous behaviour. Fixes: afc056d7dc83 ("gpio-button-hotplug: support interrupt properties") Reported-by: Kristian Evensen Tested-by: Kuan-Yi Li Signed-off-by: Petr Štetiar Signed-off-by: Christian Lamparter [drop state check] --- .../gpio-button-hotplug/src/gpio-button-hotplug.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index f429f8c027..daa4b2a4f7 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -340,16 +340,9 @@ static void gpio_keys_irq_work_func(struct work_struct *work) { struct gpio_keys_button_data *bdata = container_of(work, struct gpio_keys_button_data, work.work); - int state = gpio_button_get_value(bdata); - if (state != bdata->last_state) { - unsigned int type = bdata->b->type ?: EV_KEY; - - if (bdata->last_state != -1 || type == EV_SW) - button_hotplug_event(bdata, type, state); - - bdata->last_state = state; - } + button_hotplug_event(bdata, bdata->b->type ?: EV_KEY, + gpio_button_get_value(bdata)); } static irqreturn_t button_handle_irq(int irq, void *_bdata) From 53d9afc41a9c20b670e7d6e1f0caec284303114b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sat, 15 Jun 2019 09:28:05 +0000 Subject: [PATCH 35/38] gpio-button-hotplug: fix 4.19 build breakage on malta/be64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While testing 4.19 build on malta/be64, I've encountered following error: gpio-button-hotplug/gpio-button-hotplug.c:529:18: error: implicit declaration of function 'gpio_to_desc' which is caused by the missing include fixed by this patch. Signed-off-by: Petr Štetiar --- package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index daa4b2a4f7..e63d414284 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -28,6 +28,7 @@ #include #include #include +#include #define BH_SKB_SIZE 2048 From 9cf12ba1d3b13809b2a61dd7afec22c5918c1c79 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Tue, 2 Jul 2019 23:57:18 +0200 Subject: [PATCH 36/38] gpio-button-hotplug: unify polled and interrupt code This patch unifies the polled and interrupt-driven gpio_keys code paths as well implements consistent handling of the debounce interval set for the GPIO buttons and switches. Hotplug events will only be fired if 1. The input changes its state and remains stable for the duration of the debounce interval (default is 5 ms). 2. In the initial stable (no state-change for duration of the debounce interval) state once the driver module gets loaded. Switch type inputs will always report their stable state. Unpressed buttons will not trigger an event for the initial stable state. Whereas pressed buttons will trigger an event. This is consistent with upstream's gpio-key driver that uses the input subsystem (and dont use autorepeat). Prior to this patch, this was handled inconsistently for interrupt-based an polled gpio-keys. Hence this patch unifies the shared logic into the gpio_keys_handle_button() function and modify both implementations to handle the initial state properly. The changes described in 2. ) . can have an impact on the failsafe trigger. Up until now, the script checked for button state changes. On the down side, this allowed to trigger the failsafe by releasing a held button at the right time. On the plus side, the button's polarity setting didn't matter. Now, the failsafe will only engage when a button was pressed at the right moment (same as before), but now it can theoretically also trigger when the button was pressed the whole time the kernel booted and well into the fast-blinking preinit phase. However, the chances that this can happen are really small. This is because the gpio-button module is usually up and ready even before the preinit state is entered. So, the initial pressed button event gets lost and most devices behave as before. Bisectors: If this patch causes a device to permanently go into failsafe or experience weird behavior due to inputs, please check the following: - the GPIO polarity setting for the button - the software-debounce value Run-tested for 'gpio-keys' and 'gpio-keys-polled' on - devolo WiFi pro 1200e - devolo WiFi pro 1750c - devolo WiFi pro 1750x - Netgear WNDR4700 - Meraki MR24 - RT-AC58U Signed-off-by: David Bauer Signed-off-by: Christian Lamparter [further cleanups, simplification and unification] --- .../src/gpio-button-hotplug.c | 143 ++++++++++-------- 1 file changed, 77 insertions(+), 66 deletions(-) diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index e63d414284..edd03d2b62 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -35,10 +35,6 @@ #define DRV_NAME "gpio-keys" #define PFX DRV_NAME ": " -struct bh_priv { - unsigned long seen; -}; - struct bh_event { const char *name; unsigned int type; @@ -56,7 +52,8 @@ struct bh_map { struct gpio_keys_button_data { struct delayed_work work; - struct bh_priv bh; + unsigned long seen; + int map_entry; int last_state; int count; int threshold; @@ -238,39 +235,6 @@ static int button_get_index(unsigned int code) return -1; } -static void button_hotplug_event(struct gpio_keys_button_data *data, - unsigned int type, int value) -{ - struct bh_priv *priv = &data->bh; - unsigned long seen = jiffies; - int btn; - - pr_debug(PFX "event type=%u, code=%u, value=%d\n", type, data->b->code, value); - - if ((type != EV_KEY) && (type != EV_SW)) - return; - - btn = button_get_index(data->b->code); - if (btn < 0) - return; - - if (priv->seen == 0) - priv->seen = seen; - - button_hotplug_create_event(button_map[btn].name, type, - (seen - priv->seen) / HZ, value); - priv->seen = seen; -} - -struct gpio_keys_button_dev { - int polled; - struct delayed_work work; - - struct device *dev; - struct gpio_keys_platform_data *pdata; - struct gpio_keys_button_data data[0]; -}; - static int gpio_button_get_value(struct gpio_keys_button_data *bdata) { int val; @@ -283,27 +247,61 @@ static int gpio_button_get_value(struct gpio_keys_button_data *bdata) return val ^ bdata->b->active_low; } -static void gpio_keys_polled_check_state(struct gpio_keys_button_data *bdata) +static void gpio_keys_handle_button(struct gpio_keys_button_data *bdata) { + unsigned int type = bdata->b->type ?: EV_KEY; int state = gpio_button_get_value(bdata); + unsigned long seen = jiffies; - if (state != bdata->last_state) { - unsigned int type = bdata->b->type ?: EV_KEY; + pr_debug(PFX "event type=%u, code=%u, pressed=%d\n", + type, bdata->b->code, state); - if (bdata->count < bdata->threshold) { - bdata->count++; - return; - } - - if (bdata->last_state != -1 || type == EV_SW) - button_hotplug_event(bdata, type, state); - - bdata->last_state = state; + /* is this the initialization state? */ + if (bdata->last_state == -1) { + /* + * Don't advertise unpressed buttons on initialization. + * Just save their state and continue otherwise this + * can cause OpenWrt to enter failsafe. + */ + if (type == EV_KEY && state == 0) + goto set_state; + /* + * But we are very interested in pressed buttons and + * initial switch state. These will be reported to + * userland. + */ + } else if (bdata->last_state == state) { + /* reset asserted counter (only relevant for polled keys) */ + bdata->count = 0; + return; } + if (bdata->count < bdata->threshold) { + bdata->count++; + return; + } + + if (bdata->seen == 0) + bdata->seen = seen; + + button_hotplug_create_event(button_map[bdata->map_entry].name, type, + (seen - bdata->seen) / HZ, state); + bdata->seen = seen; + +set_state: + bdata->last_state = state; bdata->count = 0; } +struct gpio_keys_button_dev { + int polled; + struct delayed_work work; + + struct device *dev; + struct gpio_keys_platform_data *pdata; + struct gpio_keys_button_data data[0]; +}; + static void gpio_keys_polled_queue_work(struct gpio_keys_button_dev *bdev) { struct gpio_keys_platform_data *pdata = bdev->pdata; @@ -322,7 +320,9 @@ static void gpio_keys_polled_poll(struct work_struct *work) for (i = 0; i < bdev->pdata->nbuttons; i++) { struct gpio_keys_button_data *bdata = &bdev->data[i]; - gpio_keys_polled_check_state(bdata); + + if (bdata->gpiod) + gpio_keys_handle_button(bdata); } gpio_keys_polled_queue_work(bdev); } @@ -342,8 +342,7 @@ static void gpio_keys_irq_work_func(struct work_struct *work) struct gpio_keys_button_data *bdata = container_of(work, struct gpio_keys_button_data, work.work); - button_hotplug_event(bdata, bdata->b->type ?: EV_KEY, - gpio_button_get_value(bdata)); + gpio_keys_handle_button(bdata); } static irqreturn_t button_handle_irq(int irq, void *_bdata) @@ -351,8 +350,8 @@ static irqreturn_t button_handle_irq(int irq, void *_bdata) struct gpio_keys_button_data *bdata = (struct gpio_keys_button_data *) _bdata; - schedule_delayed_work(&bdata->work, - msecs_to_jiffies(bdata->software_debounce)); + mod_delayed_work(system_wq, &bdata->work, + msecs_to_jiffies(bdata->software_debounce)); return IRQ_HANDLED; } @@ -413,7 +412,7 @@ gpio_keys_get_devtree_pdata(struct device *dev) return ERR_PTR(error); } } else { - button->active_low = flags & OF_GPIO_ACTIVE_LOW; + button->active_low = !!(flags & OF_GPIO_ACTIVE_LOW); } if (of_property_read_u32(pp, "linux,code", &button->code)) { @@ -520,6 +519,19 @@ static int gpio_keys_button_probe(struct platform_device *pdev, return -EINVAL; } + bdata->map_entry = button_get_index(button->code); + if (bdata->map_entry < 0) { + dev_warn(dev, DRV_NAME "does not support key code:%u\n", + button->code); + continue; + } + + if (!(button->type == 0 || button->type == EV_KEY || + button->type == EV_SW)) { + dev_warn(dev, DRV_NAME "only supports buttons or switches\n"); + continue; + } + error = devm_gpio_request(dev, gpio, button->desc ? button->desc : DRV_NAME); if (error) { @@ -540,13 +552,13 @@ static int gpio_keys_button_probe(struct platform_device *pdev, } bdata->can_sleep = gpio_cansleep(gpio); - bdata->last_state = -1; + bdata->last_state = -1; /* Unknown state on boot */ if (bdev->polled) { bdata->threshold = DIV_ROUND_UP(button->debounce_interval, pdata->poll_interval); } else { - bdata->threshold = 1; + /* bdata->threshold = 0; already initialized */ if (button->debounce_interval) { error = gpiod_set_debounce(bdata->gpiod, @@ -592,6 +604,11 @@ static int gpio_keys_probe(struct platform_device *pdev) struct gpio_keys_button_data *bdata = &bdev->data[i]; unsigned long irqflags = IRQF_ONESHOT; + INIT_DELAYED_WORK(&bdata->work, gpio_keys_irq_work_func); + + if (!bdata->gpiod) + continue; + if (!button->irq) { bdata->irq = gpio_to_irq(button->gpio); @@ -606,7 +623,8 @@ static int gpio_keys_probe(struct platform_device *pdev) bdata->irq = button->irq; } - INIT_DELAYED_WORK(&bdata->work, gpio_keys_irq_work_func); + schedule_delayed_work(&bdata->work, + msecs_to_jiffies(bdata->software_debounce)); ret = devm_request_threaded_irq(&pdev->dev, bdata->irq, NULL, button_handle_irq, @@ -621,9 +639,6 @@ static int gpio_keys_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "gpio:%d has irq:%d\n", button->gpio, bdata->irq); } - - if (bdata->b->type == EV_SW) - button_hotplug_event(bdata, EV_SW, gpio_button_get_value(bdata)); } return 0; @@ -634,7 +649,6 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) struct gpio_keys_platform_data *pdata; struct gpio_keys_button_dev *bdev; int ret; - int i; ret = gpio_keys_button_probe(pdev, &bdev, 1); @@ -648,9 +662,6 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) if (pdata->enable) pdata->enable(bdev->dev); - for (i = 0; i < pdata->nbuttons; i++) - gpio_keys_polled_check_state(&bdev->data[i]); - gpio_keys_polled_queue_work(bdev); return ret; From e0ffeee9475e79716a32398216dbc21cfe33e3fb Mon Sep 17 00:00:00 2001 From: Chuanhong Guo Date: Sun, 4 Aug 2019 16:29:39 +0800 Subject: [PATCH 37/38] gpio-button-hotplug: add volume button handling This is used by PISEN WMB001N. Signed-off-by: Chuanhong Guo --- package/kernel/gpio-button-hotplug/Makefile | 2 +- package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package/kernel/gpio-button-hotplug/Makefile b/package/kernel/gpio-button-hotplug/Makefile index 216d23b76d..ffbc19756c 100644 --- a/package/kernel/gpio-button-hotplug/Makefile +++ b/package/kernel/gpio-button-hotplug/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=gpio-button-hotplug -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index edd03d2b62..3e8e0ea268 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -95,6 +95,8 @@ static struct bh_map button_map[] = { BH_MAP(KEY_RESTART, "reset"), BH_MAP(KEY_RFKILL, "rfkill"), BH_MAP(KEY_VIDEO, "video"), + BH_MAP(KEY_VOLUMEDOWN, "volume_down"), + BH_MAP(KEY_VOLUMEUP, "volume_up"), BH_MAP(KEY_WIMAX, "wwan"), BH_MAP(KEY_WLAN, "wlan"), BH_MAP(KEY_WPS_BUTTON, "wps"), From b0f313aa6fd7566804eead40fc4c6f8ba8c1bdd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Tue, 3 Mar 2020 12:13:29 +0100 Subject: [PATCH 38/38] gpio-button-hotplug: remove duplicate logging text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes one of the duplicate `gpio-keys` words found in the logs: gpio-keys gpio-keys: gpio-keysdoes not support key code:143 Signed-off-by: Petr Štetiar --- .../kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c index 3e8e0ea268..9575c6245b 100644 --- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c +++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c @@ -517,20 +517,20 @@ static int gpio_keys_button_probe(struct platform_device *pdev, unsigned int gpio = button->gpio; if (button->wakeup) { - dev_err(dev, DRV_NAME "does not support wakeup\n"); + dev_err(dev, "does not support wakeup\n"); return -EINVAL; } bdata->map_entry = button_get_index(button->code); if (bdata->map_entry < 0) { - dev_warn(dev, DRV_NAME "does not support key code:%u\n", + dev_warn(dev, "does not support key code:%u\n", button->code); continue; } if (!(button->type == 0 || button->type == EV_KEY || button->type == EV_SW)) { - dev_warn(dev, DRV_NAME "only supports buttons or switches\n"); + dev_warn(dev, "only supports buttons or switches\n"); continue; }