From 56ae997a7a9540c4d59ad5ea45ef5fb2e27450b5 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 1 Aug 2020 17:45:59 +0800 Subject: [PATCH 01/17] luci-app-oled: sync with upstream source --- .../luasrc/model/cbi/oled/setting.lua | 17 ++++++ package/ctcgfw/luci-app-oled/po/zh-cn/oled.po | 9 ++++ .../ctcgfw/luci-app-oled/root/etc/config/oled | 4 +- .../ctcgfw/luci-app-oled/root/etc/init.d/oled | 52 ++++++++++++++++--- 4 files changed, 74 insertions(+), 8 deletions(-) diff --git a/package/ctcgfw/luci-app-oled/luasrc/model/cbi/oled/setting.lua b/package/ctcgfw/luci-app-oled/luasrc/model/cbi/oled/setting.lua index 2b622c7086..7bc8fbf05f 100644 --- a/package/ctcgfw/luci-app-oled/luasrc/model/cbi/oled/setting.lua +++ b/package/ctcgfw/luci-app-oled/luasrc/model/cbi/oled/setting.lua @@ -14,6 +14,23 @@ s:tab("screensaver", translate("screensaver")) o = s:taboption("info", Flag, "enable", translate("Enable")) o.default=0 +o = s:taboption("info", Flag, "autoswitch", translate("Enable Auto switch")) +o.default=0 +from = s:taboption("info", ListValue, "from", translate("From")) +to = s:taboption("info", ListValue, "to", translate("To")) +for i=0,23 do + for j=0,30,30 do + from:value(i*60+j,string.format("%02d:%02d",i,j)) + to:value(i*60+j,string.format("%02d:%02d",i,j)) + end +end +from:value(1440,"24:00") +to:value(1440,"24:00") +from:depends("autoswitch",'1') +to:depends("autoswitch",'1') +from.default=0 +to.default=1440 + --informtion options---- o = s:taboption("info", Flag, "date", translate("Date"), translate('Format YYYY-MM-DD HH:MM:SS')) o.default=0 diff --git a/package/ctcgfw/luci-app-oled/po/zh-cn/oled.po b/package/ctcgfw/luci-app-oled/po/zh-cn/oled.po index 5432ea5604..bc3f8b056a 100644 --- a/package/ctcgfw/luci-app-oled/po/zh-cn/oled.po +++ b/package/ctcgfw/luci-app-oled/po/zh-cn/oled.po @@ -18,6 +18,15 @@ msgstr "CPU温度" msgid "Scroll Text" msgstr "文字滚动" +msgid "Enable Auto switch" +msgstr "启用定时开关" + +msgid "From" +msgstr "起始时间" + +msgid "To" +msgstr "结束时间" + msgid "Text you want to scroll" msgstr "你想要显示的文字" diff --git a/package/ctcgfw/luci-app-oled/root/etc/config/oled b/package/ctcgfw/luci-app-oled/root/etc/config/oled index 25f5208d7f..fd5b0daa68 100644 --- a/package/ctcgfw/luci-app-oled/root/etc/config/oled +++ b/package/ctcgfw/luci-app-oled/root/etc/config/oled @@ -17,4 +17,6 @@ config oled option cputemp '1' option time '60' option enable '0' - + option from '0' + option to '1440' + option autoswitch '0' diff --git a/package/ctcgfw/luci-app-oled/root/etc/init.d/oled b/package/ctcgfw/luci-app-oled/root/etc/init.d/oled index 7beda6f8d5..018962edaf 100755 --- a/package/ctcgfw/luci-app-oled/root/etc/init.d/oled +++ b/package/ctcgfw/luci-app-oled/root/etc/init.d/oled @@ -3,11 +3,34 @@ START=1OO PROG=/usr/bin/oled +stop() { + kill -2 $(pgrep /usr/bin/oled) + kill -9 $(pgrep -f /usr/sbin/netspeed) + echo "oled exit..." +} + start() { enabled=$(uci get oled.@oled[0].enable) if [ $enabled -eq 0 ]; then exit 0 fi + + autoswitch=$(uci get oled.@oled[0].autoswitch) + from=$(uci get oled.@oled[0].from) + to=$(uci get oled.@oled[0].to) + + if [ ${autoswitch} -eq 1 ]; then + hour=$(date +"%H") + min=$(date +"%M") + ihour=`expr $hour + 0` + imin=`expr $min + 0` + now=$(($ihour*60+$imin)) + if [[ $now -lt $from || $now -gt $to ]]; then + stop + exit 0 + fi + fi + #crontab daemon if ! grep "/etc/init.d/oled \+restart" /etc/crontabs/root >/dev/null 2>&1; then echo "*/5 * * * * /etc/init.d/oled restart >/dev/null 2>&1" >> /etc/crontabs/root @@ -33,6 +56,8 @@ start() { scroll=$(uci get oled.@oled[0].scroll) text=$(uci get oled.@oled[0].text) netsource=$(uci get oled.@oled[0].netsource) + + if [ ${netspeed} -eq 1 ]; then nohup /usr/sbin/netspeed ${netsource} >/dev/null 2>&1 & else @@ -43,19 +68,27 @@ start() { } -stop() { - kill -2 $(pgrep /usr/bin/oled) - kill -9 $(pgrep -f /usr/sbin/netspeed) - echo "oled exit..." -} + restart(){ enabled=$(uci get oled.@oled[0].enable) pgrep -f ${PROG} >/dev/null if [ $? -eq 0 ]; then if [ $enabled -eq 1 ]; then - kill -9 $(pgrep /usr/bin/oled) - kill -9 $(pgrep -f /usr/sbin/netspeed) + autoswitch=$(uci get oled.@oled[0].autoswitch) + from=$(uci get oled.@oled[0].from) + to=$(uci get oled.@oled[0].to) + if [ ${autoswitch} -eq 1 ]; then + hour=$(date +"%H") + min=$(date +"%M") + ihour=`expr $hour + 0` + imin=`expr $min + 0` + now=$(($ihour*60+$imin)) + if [[ $now -lt $from || $now -gt $to ]]; then + stop + exit 0 + fi + fi date=$(uci get oled.@oled[0].date) lanip=$(uci get oled.@oled[0].lanip) @@ -77,6 +110,11 @@ restart(){ scroll=$(uci get oled.@oled[0].scroll) text=$(uci get oled.@oled[0].text) netsource=$(uci get oled.@oled[0].netsource) + + + kill -9 $(pgrep /usr/bin/oled) + kill -9 $(pgrep -f /usr/sbin/netspeed) + if [ ${netspeed} -eq 1 ]; then nohup /usr/sbin/netspeed ${netsource} >/dev/null 2>&1 & else From 7aacd4fb65586584162c429f3dda32811df5212f Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 1 Aug 2020 17:47:29 +0800 Subject: [PATCH 02/17] luci-app-passwall: sync with upstream source --- package/lienol/luci-app-passwall/Makefile | 4 ++-- .../luci-app-passwall/root/usr/share/passwall/subscribe.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile index 19952d4a76..daa176f1dd 100644 --- a/package/lienol/luci-app-passwall/Makefile +++ b/package/lienol/luci-app-passwall/Makefile @@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=3.9 -PKG_RELEASE:=27 -PKG_DATE:=20200730 +PKG_RELEASE:=28 +PKG_DATE:=20200801 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/lienol/luci-app-passwall/root/usr/share/passwall/subscribe.lua b/package/lienol/luci-app-passwall/root/usr/share/passwall/subscribe.lua index b9da53d90d..e2e2d320fe 100644 --- a/package/lienol/luci-app-passwall/root/usr/share/passwall/subscribe.lua +++ b/package/lienol/luci-app-passwall/root/usr/share/passwall/subscribe.lua @@ -753,7 +753,7 @@ local function update_node(manual) if next(CONFIG) then local nodes = {} - local ucic3 = uci.cursor() + local ucic3 = luci.model.uci.cursor() ucic3:foreach(application, uciType, function(node) nodes[node['.name']] = node end) From 35bfeba3aabfb88c1478f2337a80e39b5bb28563 Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sat, 1 Aug 2020 19:30:37 +0800 Subject: [PATCH 03/17] autocore-arm: simplify script --- package/lean/autocore/Makefile | 6 +----- package/lean/autocore/files/arm/sbin/cpuinfo | 6 +++++- package/lean/autocore/files/arm/sbin/cpuinfo-ipq40xx | 9 --------- 3 files changed, 6 insertions(+), 15 deletions(-) delete mode 100755 package/lean/autocore/files/arm/sbin/cpuinfo-ipq40xx diff --git a/package/lean/autocore/Makefile b/package/lean/autocore/Makefile index 6052e05a66..905e44b581 100644 --- a/package/lean/autocore/Makefile +++ b/package/lean/autocore/Makefile @@ -44,11 +44,7 @@ define Package/autocore-arm/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) ./files/arm/090-cover-index_htm $(1)/etc/uci-defaults/090-cover-index_htm $(INSTALL_DIR) $(1)/sbin -ifneq ($(BOARD),ipq40xx) - $(CP) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo -else - $(CP) ./files/arm/sbin/cpuinfo-ipq40xx $(1)/sbin/cpuinfo -endif + $(INSTALL_BIN) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo endef define Package/autocore-x86/install diff --git a/package/lean/autocore/files/arm/sbin/cpuinfo b/package/lean/autocore/files/arm/sbin/cpuinfo index ff2691ecc2..88cf35d430 100755 --- a/package/lean/autocore/files/arm/sbin/cpuinfo +++ b/package/lean/autocore/files/arm/sbin/cpuinfo @@ -5,6 +5,10 @@ cpu_arch="$(cat "/proc/cpuinfo" | grep "model name" | sed -n "1p" | awk -F ': ' cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)" cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz" -sys_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C" +if grep -q "ipq40xx" "/etc/openwrt_release"; then + sys_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')" +else + sys_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C" +fi echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq}, ${sys_temp})" diff --git a/package/lean/autocore/files/arm/sbin/cpuinfo-ipq40xx b/package/lean/autocore/files/arm/sbin/cpuinfo-ipq40xx deleted file mode 100755 index 329675b81c..0000000000 --- a/package/lean/autocore/files/arm/sbin/cpuinfo-ipq40xx +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -cpu_arch="$(cat "/proc/cpuinfo" | grep "model name" | sed -n "1p" | awk -F ': ' '{print $2}')" -cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)" - -cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz" -sys_temp="$(sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g')" - -echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq}, ${sys_temp})" From 94e4e23a86e689b8a6f805434702d79066a26890 Mon Sep 17 00:00:00 2001 From: Alexey Dobrovolsky Date: Sat, 11 Apr 2020 01:37:09 +0300 Subject: [PATCH 04/17] ramips: remove patches for USB-dwc2 In FS#2738 we can see that patch first introduced in e8ebcff ("ramips: add a explicit reset to dwc2") breaks USB functionality since 18.06. Thus, this patch should be removed. Removed: - 0032-USB-dwc2-add-device_reset.patch Fixes: FS#2738 Fixes: FS#2964 Signed-off-by: Alexey Dobrovolsky (cherry picked from commit ab841b4393a4077a5819da1da040ab9a89e3b69d) --- .../0032-USB-dwc2-add-device_reset.patch | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 target/linux/ramips/patches-4.14/0032-USB-dwc2-add-device_reset.patch diff --git a/target/linux/ramips/patches-4.14/0032-USB-dwc2-add-device_reset.patch b/target/linux/ramips/patches-4.14/0032-USB-dwc2-add-device_reset.patch deleted file mode 100644 index c04e2db661..0000000000 --- a/target/linux/ramips/patches-4.14/0032-USB-dwc2-add-device_reset.patch +++ /dev/null @@ -1,29 +0,0 @@ -From a758e0870c6d1e4b0272f6e7f9efa9face5534bb Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Sun, 27 Jul 2014 09:49:07 +0100 -Subject: [PATCH 32/53] USB: dwc2: add device_reset() - -Signed-off-by: John Crispin ---- - drivers/usb/dwc2/hcd.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/usb/dwc2/hcd.c -+++ b/drivers/usb/dwc2/hcd.c -@@ -48,6 +48,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -5215,6 +5216,8 @@ int dwc2_hcd_init(struct dwc2_hsotg *hso - - retval = -ENOMEM; - -+ device_reset(hsotg->dev); -+ - hcfg = dwc2_readl(hsotg->regs + HCFG); - dev_dbg(hsotg->dev, "hcfg=%08x\n", hcfg); - From dda249ace487adc63a43c82520ae28f0d88945d7 Mon Sep 17 00:00:00 2001 From: Alexey Dobrovolsky Date: Sat, 9 May 2020 21:10:44 +0300 Subject: [PATCH 05/17] ramips: add kmod-usb-dwc2 to ZyXEL Keenetic image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ZyXEL Keenetic has a USB port. Thus, DWC2 USB controller driver should be in the default image for this device. Fixes: a7cbf59e0e04 ("ramips: add new device ZyXEL Keenetic as kn") Signed-off-by: Alexey Dobrovolsky [fixed whitespace issue] Signed-off-by: Petr Štetiar (backported from commit 0a182fcba6d9cb2cf74cae9114ea4770ef928f75) Signed-off-by: Adrian Schmutzler --- target/linux/ramips/image/rt305x.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk index 75e9de5694..2654918abb 100644 --- a/target/linux/ramips/image/rt305x.mk +++ b/target/linux/ramips/image/rt305x.mk @@ -1152,7 +1152,8 @@ define Device/zyxel_keenetic IMAGE_SIZE := 7872k DEVICE_VENDOR := ZyXEL DEVICE_MODEL := Keenetic - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ehci kmod-usb-ledtrig-usbport + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ehci \ + kmod-usb-ledtrig-usbport kmod-usb-dwc2 SUPPORTED_DEVICES += kn endef TARGET_DEVICES += zyxel_keenetic From c6f8a71b00c9df7d5b6946eea19d414f2f2ed0e9 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Fri, 17 Jul 2020 17:01:00 +0200 Subject: [PATCH 06/17] gemini: Add swap partition to DNS-313 Sometimes when using the DNS-313 memory usage can peak and with a simple swap partition we can avoid running into the roof and invoking the OOM killer. Set this partition to 128MB (twice the size of the memory of the DNS-313). Signed-off-by: Linus Walleij --- .../linux/gemini/image/dns313_gen_hdd_img.sh | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/target/linux/gemini/image/dns313_gen_hdd_img.sh b/target/linux/gemini/image/dns313_gen_hdd_img.sh index 6e899ec840..1991af71fb 100755 --- a/target/linux/gemini/image/dns313_gen_hdd_img.sh +++ b/target/linux/gemini/image/dns313_gen_hdd_img.sh @@ -15,14 +15,20 @@ ROOTFSSIZE="$5" head=4 sect=63 -# Create two empty partitions followed by the boot partition with -# the ./boot/zImage and then the rootfs partition. -set $(ptgen -o $OUTPUT -h $head -s $sect -t 83 -n -p 0 -p 0 -p ${BOOTFSSIZE}M -p ${ROOTFSSIZE}M) +# Create one empty partitions followed by the swap partition, then the +# boot partition with the ./boot/zImage and then the rootfs partition. +# The swap partition with type 82 is 128 MB since the DNS-313 has 64 MB of +# memory so we assign twice of that as swap. +# The boot partition must always be the third partition. +# The user should use the first (blank) partition for user data storage, +# this will typically be named /dev/sda1 +set $(ptgen -o $OUTPUT -h $head -s $sect -n -t 83 -p 0 -t 82 -p 128M -t 83 -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M) -BOOTOFFSET="$(($1 / 512))" -BOOTSIZE="$(($2 / 512))" -ROOTFSOFFSET="$(($3 / 512))" -ROOTFSSIZE="$(($4 / 512))" +# Swapoffset and swapsize will be $1 and $2 +BOOTOFFSET="$(($3 / 512))" +BOOTSIZE="$(($4 / 512))" +ROOTFSOFFSET="$(($5 / 512))" +ROOTFSSIZE="$(($6 / 512))" dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc From 34e28b29a08ac33f3fa9f6ce900b0fa538ffe2a9 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 30 Jul 2020 16:24:19 +0100 Subject: [PATCH 07/17] kernel: clean-up build-configurable kernel config symbols Don't explicitely disable options in target/linux/generic/config-* if they are already controlled in config/Config-kernel.in. Add a bunch of new symbols and prepare defaults for using only unified hierarchy (ie. cgroup2). Update symbol dependencies while at it Signed-off-by: Daniel Golle --- config/Config-kernel.in | 49 +++++++++++++++++++++++++------- target/linux/generic/config-4.14 | 9 ------ target/linux/generic/config-4.19 | 8 ------ target/linux/generic/config-4.9 | 6 ---- 4 files changed, 39 insertions(+), 33 deletions(-) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 97fff6d0c1..56b9a07269 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -232,6 +232,18 @@ config KERNEL_BLK_DEV_BSG bool "Compile the kernel with SCSI generic v4 support for any block device" default n +config KERNEL_TRANSPARENT_HUGEPAGE + bool + +config KERNEL_HUGETLBFS + bool + +config KERNEL_HUGETLB_PAGE + bool "Compile the kernel with HugeTLB support" + select KERNEL_TRANSPARENT_HUGEPAGE + select KERNEL_HUGETLBFS + default n + config KERNEL_MAGIC_SYSRQ bool "Compile the kernel with SysRq support" default y @@ -369,21 +381,29 @@ if KERNEL_CGROUPS config KERNEL_FREEZER bool - default y if KERNEL_CGROUP_FREEZER config KERNEL_CGROUP_FREEZER - bool "Freezer cgroup subsystem" - default y + bool "legacy Freezer cgroup subsystem" + default n + select KERNEL_FREEZER help Provides a way to freeze and unfreeze all tasks in a cgroup. + (legacy cgroup1-only controller, in cgroup2 freezer + is integrated in the Memory controller) config KERNEL_CGROUP_DEVICE - bool "Device controller for cgroups" - default y + bool "legacy Device controller for cgroups" + default n help Provides a cgroup implementing whitelists for devices which a process in the cgroup can mknod or open. + (legacy cgroup1-only controller) + + config KERNEL_CGROUP_HUGETLB + bool "HugeTLB controller" + default y if KERNEL_HUGETLB_PAGE + depends on KERNEL_HUGETLB_PAGE config KERNEL_CGROUP_PIDS bool "PIDs cgroup subsystem" @@ -392,6 +412,14 @@ if KERNEL_CGROUPS Provides enforcement of process number limits in the scope of a cgroup. + config KERNEL_CGROUP_RDMA + bool "RDMA controller for cgroups" + default y + + config KERNEL_CGROUP_BPF + bool "Support for eBPF programs attached to cgroups" + default y + config KERNEL_CPUSETS bool "Cpuset support" default y if !SMALL_FLASH @@ -427,6 +455,7 @@ if KERNEL_CGROUPS config KERNEL_MEMCG bool "Memory Resource Controller for Control Groups" default y if !SMALL_FLASH + select KERNEL_FREEZER depends on KERNEL_RESOURCE_COUNTERS || !LINUX_3_18 help Provides a memory resource controller that manages both anonymous @@ -449,7 +478,7 @@ if KERNEL_CGROUPS config KERNEL_MEMCG_SWAP bool "Memory Resource Controller Swap Extension" - default n + default y if !SMALL_FLASH depends on KERNEL_MEMCG help Add swap management feature to memory resource controller. When you @@ -581,12 +610,12 @@ if KERNEL_CGROUPS files in a cgroup which can be useful for debugging. config KERNEL_NET_CLS_CGROUP - bool "Control Group Classifier" - default y + bool "legacy Control Group Classifier" + default n config KERNEL_CGROUP_NET_PRIO - bool "Network priority cgroup" - default y + bool "legacy Network priority cgroup" + default n endif diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index dc24d05a72..6a56fd0e4c 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -733,13 +733,6 @@ CONFIG_CC_STACKPROTECTOR_NONE=y # CONFIG_CFG80211 is not set # CONFIG_CFG80211_CERTIFICATION_ONUS is not set # CONFIG_CFQ_GROUP_IOSCHED is not set -# CONFIG_CGROUPS is not set -# CONFIG_CGROUP_BPF is not set -# CONFIG_CGROUP_DEBUG is not set -# CONFIG_CGROUP_HUGETLB is not set -# CONFIG_CGROUP_NET_CLASSID is not set -# CONFIG_CGROUP_NET_PRIO is not set -# CONFIG_CGROUP_RDMA is not set # CONFIG_CHARGER_BQ2415X is not set # CONFIG_CHARGER_BQ24190 is not set # CONFIG_CHARGER_BQ24257 is not set @@ -1768,7 +1761,6 @@ CONFIG_HPET_MMAP_DEFAULT=y # CONFIG_HTC_PASIC3 is not set # CONFIG_HTS221 is not set # CONFIG_HTU21 is not set -# CONFIG_HUGETLB_PAGE is not set # CONFIG_HVC_DCC is not set # CONFIG_HVC_UDBG is not set # CONFIG_HWLAT_TRACER is not set @@ -5155,7 +5147,6 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y # CONFIG_TRACING_EVENTS_GPIO is not set CONFIG_TRACING_SUPPORT=y CONFIG_TRAD_SIGNALS=y -# CONFIG_TRANSPARENT_HUGEPAGE is not set # CONFIG_TREE_RCU is not set # CONFIG_TREE_RCU_TRACE is not set # CONFIG_TRIM_UNUSED_KSYMS is not set diff --git a/target/linux/generic/config-4.19 b/target/linux/generic/config-4.19 index aec1b2e78f..3960a826b0 100644 --- a/target/linux/generic/config-4.19 +++ b/target/linux/generic/config-4.19 @@ -762,12 +762,6 @@ CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CEPH_LIB is not set # CONFIG_CFG80211 is not set # CONFIG_CFG80211_CERTIFICATION_ONUS is not set -# CONFIG_CGROUPS is not set -# CONFIG_CGROUP_BPF is not set -# CONFIG_CGROUP_DEBUG is not set -# CONFIG_CGROUP_NET_CLASSID is not set -# CONFIG_CGROUP_NET_PRIO is not set -# CONFIG_CGROUP_RDMA is not set # CONFIG_CHARGER_ADP5061 is not set # CONFIG_CHARGER_BQ2415X is not set # CONFIG_CHARGER_BQ24190 is not set @@ -1886,7 +1880,6 @@ CONFIG_HPET_MMAP_DEFAULT=y # CONFIG_HTC_PASIC3 is not set # CONFIG_HTS221 is not set # CONFIG_HTU21 is not set -# CONFIG_HUGETLB_PAGE is not set # CONFIG_HVC_DCC is not set # CONFIG_HVC_UDBG is not set # CONFIG_HWLAT_TRACER is not set @@ -5434,7 +5427,6 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y # CONFIG_TRACING_EVENTS_GPIO is not set CONFIG_TRACING_SUPPORT=y CONFIG_TRAD_SIGNALS=y -# CONFIG_TRANSPARENT_HUGEPAGE is not set # CONFIG_TREE_RCU is not set # CONFIG_TREE_RCU_TRACE is not set # CONFIG_TRIM_UNUSED_KSYMS is not set diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index de009509ee..fe7241908c 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -689,10 +689,6 @@ CONFIG_CC_STACKPROTECTOR_NONE=y # CONFIG_CEPH_LIB is not set # CONFIG_CFG80211 is not set # CONFIG_CFG80211_CERTIFICATION_ONUS is not set -# CONFIG_CGROUPS is not set -# CONFIG_CGROUP_DEBUG is not set -# CONFIG_CGROUP_NET_CLASSID is not set -# CONFIG_CGROUP_NET_PRIO is not set # CONFIG_CHARGER_BQ2415X is not set # CONFIG_CHARGER_BQ24190 is not set # CONFIG_CHARGER_BQ24257 is not set @@ -1581,7 +1577,6 @@ CONFIG_HPET_MMAP_DEFAULT=y # CONFIG_HTC_I2CPLD is not set # CONFIG_HTC_PASIC3 is not set # CONFIG_HTU21 is not set -# CONFIG_HUGETLB_PAGE is not set # CONFIG_HVC_DCC is not set # CONFIG_HVC_UDBG is not set # CONFIG_HWLAT_TRACER is not set @@ -4684,7 +4679,6 @@ CONFIG_TRACE_IRQFLAGS_SUPPORT=y # CONFIG_TRACING_EVENTS_GPIO is not set CONFIG_TRACING_SUPPORT=y CONFIG_TRAD_SIGNALS=y -# CONFIG_TRANSPARENT_HUGEPAGE is not set # CONFIG_TREE_RCU is not set # CONFIG_TREE_RCU_TRACE is not set # CONFIG_TRIM_UNUSED_KSYMS is not set From b076023aed005c9341e6a265e06c13f58ed762d6 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 31 Jul 2020 22:48:49 +0100 Subject: [PATCH 08/17] kernel: add menuconfig entry for kernel CONFIG_CGROUP_NET_CLASSID It was removed from target defaults though it didn't exist in the build-systems kernel configuration options. Add it there. Fixes: d1a8217d87 ("kernel: clean-up build-configurable kernel config symbols") Signed-off-by: Daniel Golle --- config/Config-kernel.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 56b9a07269..7c34de0bc4 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -613,6 +613,10 @@ if KERNEL_CGROUPS bool "legacy Control Group Classifier" default n + config KERNEL_CGROUP_NET_CLASSID + bool "legacy Network classid cgroup" + default n + config KERNEL_CGROUP_NET_PRIO bool "legacy Network priority cgroup" default n From 8ba47b7699a581e40760a0d4b7dee65a4a57eb20 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Wed, 29 Jul 2020 23:57:41 +0300 Subject: [PATCH 09/17] kernel: add missing config symbol This symbol is exposed on ARM64 with EFI enabled in the kernel config. Currently this happens only on ipq807x, but as there might be new ARM64 targets with EFI in the future it is better to add the symbol to the generic config. Signed-off-by: Stijn Tintel Acked-by: Jo-Philipp Wich --- target/linux/generic/config-4.14 | 1 + target/linux/generic/config-4.19 | 1 + target/linux/generic/config-4.9 | 1 + 3 files changed, 3 insertions(+) diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index 6a56fd0e4c..59ac87d5f9 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -1027,6 +1027,7 @@ CONFIG_CRYPTO_PCRYPT=y # CONFIG_DEBUG_CREDENTIALS is not set # CONFIG_DEBUG_DEVRES is not set # CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_EFI is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set CONFIG_DEBUG_FS=y # CONFIG_DEBUG_GPIO is not set diff --git a/target/linux/generic/config-4.19 b/target/linux/generic/config-4.19 index 3960a826b0..ad20bfa8e6 100644 --- a/target/linux/generic/config-4.19 +++ b/target/linux/generic/config-4.19 @@ -1086,6 +1086,7 @@ CONFIG_CRYPTO_PCRYPT=y # CONFIG_DEBUG_CREDENTIALS is not set # CONFIG_DEBUG_DEVRES is not set # CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_EFI is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set CONFIG_DEBUG_FS=y # CONFIG_DEBUG_GPIO is not set diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index fe7241908c..7985f1d9be 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -945,6 +945,7 @@ CONFIG_CRYPTO_PCRYPT=y # CONFIG_DEBUG_CREDENTIALS is not set # CONFIG_DEBUG_DEVRES is not set # CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_EFI is not set # CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set CONFIG_DEBUG_FS=y # CONFIG_DEBUG_GPIO is not set From 5a62b7af32343851bef4a0995c2238c9328d921a Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Sat, 1 Aug 2020 16:29:24 +0300 Subject: [PATCH 10/17] kernel: fix missing TRANSPARENT_HUGEPAGE symbols Enabling KERNEL_TRANSPARENT_HUGEPAGE exposes 2 missing symbols: * CONFIG_READ_ONLY_THP_FOR_FS * TRANSPARENT_HUGEPAGE_ALWAYS * TRANSPARENT_HUGEPAGE_MADVISE The first one was added in 5.4, and is marked experimental there so just disable it in the generic config. For the latter two, we should not force the user to use either of them, so add them as build-configurable kernel options. Fixes: d1a8217d87bf ("kernel: clean-up build-configurable kernel config symbols") Signed-off-by: Stijn Tintel --- config/Config-kernel.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 7c34de0bc4..c99894161d 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -235,6 +235,18 @@ config KERNEL_BLK_DEV_BSG config KERNEL_TRANSPARENT_HUGEPAGE bool +choice + prompt "Transparent Hugepage Support sysfs defaults" + depends on KERNEL_TRANSPARENT_HUGEPAGE + default KERNEL_TRANSPARENT_HUGEPAGE_ALWAYS + + config KERNEL_TRANSPARENT_HUGEPAGE_ALWAYS + bool "always" + + config KERNEL_TRANSPARENT_HUGEPAGE_MADVISE + bool "madvise" +endchoice + config KERNEL_HUGETLBFS bool From aef321a5e0a0981e9d4427284f77d713763d3247 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 18 Jul 2020 21:29:58 -0700 Subject: [PATCH 11/17] exfat: add out of tree module >From an email conversation with the person responsible for upstreaming the exFAT driver, it seems the staging one in kernel 5.4 is not so good. Excerpts below. Namjae Jeon: Hm... exfat in 5.4 kernel that we did crap shit long time ago is contributed by someone who we don't know. This version is unstable and low quality code. We have been improving it continuously. and staging version exfat is removed from linux 5.7 kernel. linux exfat oot version is a backport of exfat in linux 5.7 kernel to support lower version kernel, and it is a real. You can see the patch history fro linux-exfat-oot. this version support timezone and boot sector verification feature newly. and better filesystem structure and much clean code quality that reviewed by high profile kernel developers. and add many bug fixes. And this version is officially maintained by me and kernel guys. I would not recommend to use staging exfat version. Signed-off-by: Rosen Penev --- package/kernel/exfat/Makefile | 55 +++++++++++++++++++ .../kernel/exfat/patches/010-fstream.patch | 23 ++++++++ 2 files changed, 78 insertions(+) create mode 100644 package/kernel/exfat/Makefile create mode 100644 package/kernel/exfat/patches/010-fstream.patch diff --git a/package/kernel/exfat/Makefile b/package/kernel/exfat/Makefile new file mode 100644 index 0000000000..f129da9410 --- /dev/null +++ b/package/kernel/exfat/Makefile @@ -0,0 +1,55 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=exfat +PKG_VERSION:=5.8.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/namjaejeon/linux-exfat-oot/tar.gz/$(PKG_VERSION)? +PKG_HASH:=47162495bdf9a7e02d6142dfcd4364d7325a4cf75a0439926cf9e8a9d959627b + +PKG_MAINTAINER:= +PKG_LICENSE:=GPL-2.0-only + +#PKG_BUILD_PARALLEL:=1 +#PKG_USE_MIPS16:=0 + +# exfat-oot's makefile needs this to know where to build the kernel module +#export KERNELDIR:=$(LINUX_DIR) + +include $(INCLUDE_DIR)/package.mk +#include $(INCLUDE_DIR)/kernel-defaults.mk + +TAR_OPTIONS+= --strip-components 1 +TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS) + +define KernelPackage/fs-exfat + SECTION:=kernel + CATEGORY:=Kernel modules + SUBMENU:=Filesystems + TITLE:=exFAT kernel module + FILES:=$(PKG_BUILD_DIR)/exfat.ko + AUTOLOAD:=$(call AutoProbe,exfat) + DEPENDS:=+kmod-nls-base +endef + +define KernelPackage/exfat/description + This package provides the kernel module for exfat. +endef + +define Build/Compile + $(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + $(PKG_EXTRA_KCONFIG) \ + CONFIG_EXFAT_FS=m \ + modules +# $(MAKE) -C $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) M="$(PKG_BUILD_DIR)" modules +endef + +$(eval $(call KernelPackage,fs-exfat)) diff --git a/package/kernel/exfat/patches/010-fstream.patch b/package/kernel/exfat/patches/010-fstream.patch new file mode 100644 index 0000000000..dc1221c611 --- /dev/null +++ b/package/kernel/exfat/patches/010-fstream.patch @@ -0,0 +1,23 @@ +--- a/super.c ++++ b/super.c +@@ -292,14 +292,14 @@ static const struct fs_parameter_spec exfat_param_specs[] = { + #endif + fsparam_flag("discard", Opt_discard), + fsparam_s32("time_offset", Opt_time_offset), +- __fsparam(NULL, "utf8", Opt_utf8, fs_param_deprecated, +- NULL), +- __fsparam(NULL, "debug", Opt_debug, fs_param_deprecated, +- NULL), ++ __fsparam(NULL, "utf8", Opt_utf8, fs_param_deprecated ++ ), ++ __fsparam(NULL, "debug", Opt_debug, fs_param_deprecated ++ ), + __fsparam(fs_param_is_u32, "namecase", Opt_namecase, +- fs_param_deprecated, NULL), ++ fs_param_deprecated), + __fsparam(fs_param_is_u32, "codepage", Opt_codepage, +- fs_param_deprecated, NULL), ++ fs_param_deprecated), + {} + }; + From 9bd4d1b093109a9862361fa1a40e877b07cdaa83 Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Fri, 24 Jul 2020 09:02:55 +0100 Subject: [PATCH 12/17] wireguard-tools: allow compiling with MIPS16 instructions The wg utility compiles and runs without issues in MIPS16 mode, despite setting PKG_USE_MIPS16:=0 in the makefile. Let's remove this, allowing for a substantial size reduction of the wg executable. Since wg is a just a configuration utility, it shouldn't be performance-critical, as the crypto heavy-lifting is done on the kernel side. wg sizes for both modes: MIPS32: 64309 bytes MIPS16: 42501 bytes Signed-off-by: Rui Salvaterra --- package/network/utils/wireguard-tools/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/package/network/utils/wireguard-tools/Makefile b/package/network/utils/wireguard-tools/Makefile index 3232060bd1..2137a8b4a1 100644 --- a/package/network/utils/wireguard-tools/Makefile +++ b/package/network/utils/wireguard-tools/Makefile @@ -22,7 +22,6 @@ PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING PKG_BUILD_PARALLEL:=1 -PKG_USE_MIPS16:=0 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package-defaults.mk From c9f4e3c652468dd04d6f4a49e9c833d8bcbd7a40 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Sun, 2 Aug 2020 15:51:39 +0200 Subject: [PATCH 13/17] scripts/checkpatch.pl: fix README.md file name after rename checkpatch.pl uses a list of files to detect the root OpenWrt directory. This includes README, which has been renamed to README.md in the previous commit. Update the file name in checkpatch.pl to prevent errors like the following when running the script: Must be run from the top-level dir. of a OpenWrt tree Signed-off-by: Adrian Schmutzler --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5224ea49c3..24793e19d8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -391,7 +391,7 @@ sub top_of_openwrt_tree { my ($root) = @_; my @tree_check = ( - "BSDmakefile", "Config.in", "LICENSE", "Makefile", "README", + "BSDmakefile", "Config.in", "LICENSE", "Makefile", "README.md", "feeds.conf.default", "include", "package", "rules.mk", "scripts", "target", "toolchain", "tools" ); From d9dd4ef806dfc7fff015e9c70ff8771436346064 Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Wed, 29 Jul 2020 21:00:11 +0200 Subject: [PATCH 14/17] build: image: drop unused check-kernel-size recipe The recipe check-kernel-size is not used in the entire tree. Instead, we already check the size of the kernel image in Device/Build/kernel in image.mk via check-size function if KERNEL_SIZE is defined. Therefore, drop the function. Using it would be redundant anyway. Signed-off-by: Adrian Schmutzler --- include/image-commands.mk | 7 ------- 1 file changed, 7 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index a168af4bd9..76fe2dfb55 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -275,13 +275,6 @@ define Build/check-size } endef -define Build/check-kernel-size - @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $(IMAGE_KERNEL))" ] || { \ - echo "WARNING: Kernel for $@ is too big > $(1)" >&2; \ - rm -f $@; \ - } -endef - define Build/combined-image -sh $(TOPDIR)/scripts/combined-image.sh \ "$(IMAGE_KERNEL)" \ From fc0c6c9c1ffa819f83034ee25721820647e9fa65 Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Sun, 12 Jan 2020 21:35:00 +0900 Subject: [PATCH 15/17] ar71xx: fix sysupgrade for Arduino Yun Commit bb46b635df48 changed its partition scheme, but sysupgrade image validation still uses the old format. This commit fixes it so that force flag is not needed for sysupgrade. Fixes: bb46b635df48 ("ar71xx: move Arduino Yun to generic building code") Signed-off-by: Sungbo Eo --- target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 0f5a5df181..6c7c0e429b 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -217,6 +217,7 @@ platform_check_image() { archer-c60-v2|\ archer-c7-v4|\ archer-c7-v5|\ + arduino-yun|\ bullet-m|\ c-55|\ carambola2|\ @@ -345,7 +346,6 @@ platform_check_image() { ap152|\ ap91-5g|\ ap96|\ - arduino-yun|\ bhr-4grv2|\ bxu2000n-2-a1|\ db120|\ From 73056522d33b00f18c67432fd866221df60e4b80 Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Sun, 12 Jan 2020 21:35:00 +0900 Subject: [PATCH 16/17] ar71xx: enable ethernet LED of Arduino Yun Commit 05d73a2a7379 enabled GPIO on ethernet LED, but proper LED setup was not added then. This commit fixes it by reverting the change on the LED. Fixes: 05d73a2a7379 ("ar71xx: Arduino Yun board 'WLAN RST' button support") Signed-off-by: Sungbo Eo --- target/linux/ar71xx/files/arch/mips/ath79/mach-arduino-yun.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-arduino-yun.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-arduino-yun.c index 5873248edf..8ab07d514b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-arduino-yun.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-arduino-yun.c @@ -117,8 +117,7 @@ static void __init ds_setup(void) ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN | AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN | AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN | - AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN | - AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN); + AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN); //Disable the Function for some pins to have GPIO functionality active // GPIO6-7-8 and GPIO11 From 88785ccaadf6e191e718155e1c5e84cb1feac5af Mon Sep 17 00:00:00 2001 From: Sungbo Eo Date: Sun, 12 Jan 2020 21:35:00 +0900 Subject: [PATCH 17/17] ar71xx: restore support for boot console with arbitrary baud rates Commit 1bfbf2de6df9 ("ar71xx: serial: core: add support for boot console with arbitrary baud rates") added support for arbitrary baud rates which enabled 250000 baud rate for Yun. But the patch was not ported to kernel 4.9, and since then the kernel set its baud rate to 9600. This commit ports the patch to kernel 4.14, thereby restoring the serial console of Yun. Cc: Hauke Mehrtens Signed-off-by: Sungbo Eo --- ...support-for-boot-console-with-arbitr.patch | 54 +++++++++++++++++++ ...support-for-boot-console-with-arbitr.patch | 54 +++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 target/linux/ar71xx/patches-4.14/821-serial-core-add-support-for-boot-console-with-arbitr.patch create mode 100644 target/linux/ar71xx/patches-4.9/821-serial-core-add-support-for-boot-console-with-arbitr.patch diff --git a/target/linux/ar71xx/patches-4.14/821-serial-core-add-support-for-boot-console-with-arbitr.patch b/target/linux/ar71xx/patches-4.14/821-serial-core-add-support-for-boot-console-with-arbitr.patch new file mode 100644 index 0000000000..23b6d73959 --- /dev/null +++ b/target/linux/ar71xx/patches-4.14/821-serial-core-add-support-for-boot-console-with-arbitr.patch @@ -0,0 +1,54 @@ +From 4d3c17975c7814884a721fe693b3adf5c426d759 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 10 Nov 2015 22:18:39 +0100 +Subject: [RFC] serial: core: add support for boot console with arbitrary + baud rates + +The Arduino Yun uses a baud rate of 250000 by default. The serial is +going over the Atmel ATmega and is used to connect to this chip. +Without this patch Linux wants to switch the console to 9600 Baud. + +With this patch Linux will use the configured baud rate and not a +default one specified in uart_register_driver(). + +Signed-off-by: Hauke Mehrtens +[rebased to 4.14, slightly reworded commit message] +Signed-off-by: Sungbo Eo +--- + drivers/tty/serial/serial_core.c | 6 +++++- + include/linux/console.h | 1 + + 2 files changed, 6 insertions(+), 1 deletions(-) + +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -232,6 +232,8 @@ static int uart_port_startup(struct tty_ + if (retval == 0) { + if (uart_console(uport) && uport->cons->cflag) { + tty->termios.c_cflag = uport->cons->cflag; ++ tty->termios.c_ospeed = uport->cons->baud; ++ tty->termios.c_ispeed = uport->cons->baud; + uport->cons->cflag = 0; + } + /* +@@ -2072,8 +2074,10 @@ uart_set_options(struct uart_port *port, + * Allow the setting of the UART parameters with a NULL console + * too: + */ +- if (co) ++ if (co) { + co->cflag = termios.c_cflag; ++ co->baud = baud; ++ } + + return 0; + } +--- a/include/linux/console.h ++++ b/include/linux/console.h +@@ -145,6 +145,7 @@ struct console { + short flags; + short index; + int cflag; ++ int baud; + void *data; + struct console *next; + }; diff --git a/target/linux/ar71xx/patches-4.9/821-serial-core-add-support-for-boot-console-with-arbitr.patch b/target/linux/ar71xx/patches-4.9/821-serial-core-add-support-for-boot-console-with-arbitr.patch new file mode 100644 index 0000000000..23b6d73959 --- /dev/null +++ b/target/linux/ar71xx/patches-4.9/821-serial-core-add-support-for-boot-console-with-arbitr.patch @@ -0,0 +1,54 @@ +From 4d3c17975c7814884a721fe693b3adf5c426d759 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 10 Nov 2015 22:18:39 +0100 +Subject: [RFC] serial: core: add support for boot console with arbitrary + baud rates + +The Arduino Yun uses a baud rate of 250000 by default. The serial is +going over the Atmel ATmega and is used to connect to this chip. +Without this patch Linux wants to switch the console to 9600 Baud. + +With this patch Linux will use the configured baud rate and not a +default one specified in uart_register_driver(). + +Signed-off-by: Hauke Mehrtens +[rebased to 4.14, slightly reworded commit message] +Signed-off-by: Sungbo Eo +--- + drivers/tty/serial/serial_core.c | 6 +++++- + include/linux/console.h | 1 + + 2 files changed, 6 insertions(+), 1 deletions(-) + +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -232,6 +232,8 @@ static int uart_port_startup(struct tty_ + if (retval == 0) { + if (uart_console(uport) && uport->cons->cflag) { + tty->termios.c_cflag = uport->cons->cflag; ++ tty->termios.c_ospeed = uport->cons->baud; ++ tty->termios.c_ispeed = uport->cons->baud; + uport->cons->cflag = 0; + } + /* +@@ -2072,8 +2074,10 @@ uart_set_options(struct uart_port *port, + * Allow the setting of the UART parameters with a NULL console + * too: + */ +- if (co) ++ if (co) { + co->cflag = termios.c_cflag; ++ co->baud = baud; ++ } + + return 0; + } +--- a/include/linux/console.h ++++ b/include/linux/console.h +@@ -145,6 +145,7 @@ struct console { + short flags; + short index; + int cflag; ++ int baud; + void *data; + struct console *next; + };