Bpi-r4 compilation issue solution (基于官源编译问题解决)

BPI-R4 基于官源编译问题解决(BPI-R4 solves the problem based on official source compilation)

官源指【https://github.com/BPI-SINOVOIP/BPI-R4-MT76-OPENWRT-V21.02】

1.无法编译,删除或注释package目录下Markfile中

//$(curdir)/compile: $(curdir)/cryptsetup/host/compile

2.导致启动页面无法打开

删除/target/linux/mediatek/mt7988/base-files/etc/init.d/目录中的

将ltecalling中的脚本命令 放到本地启动脚本的启动(针对移远5G网卡):

/sbin/quectel-CM -4 &

3.增加linux系统的连接数

修改 package/kernel/linux/files 中的sysctl-nf-conntrack.conf

net.netfilter.nf_conntrack_max=65536增加连接数

4.增加硬件加速连接数(对应老驱动 或/immortalwrt称 offload entry num数)

修改/target/linux/mediatek/patches-5.4 目录中的

999-3001-mt7622-backport-nf-hw-offload-framework-and-upstream.patch

将 此文件中的781行

+#define MTK_PPE_ENTRIES_SHIFT 5 // 新的文件在这里增加的 默认是3 即8192, 5 就是32768即32K

999-3004-ethernet-update-ppe-from-netsys1-to-netsys2.patch

将此文件中的搜索到的 MTK_PPE_ENTRIES_SHIFT 3 修改中 5

5.刷机后重起问题

删除/target/linux/mediatek/mt7988/base-files/etc/init.d/目录中的

fanspeed文件

/sbin/fan-speed & 之后的代码

6.风扇转动

把代码fan-speed fan-speed (5.7 KB) 文件更新至/target/linux/mediatek/mt7988/base-files/sbin/替换原文件

7.更新国内源

src/gz openwrt_core http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/targets/mediatek/mt7988/packages

src/gz openwrt_base http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/base

src/gz openwrt_luci http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/luci

src/gz openwrt_mtk_openwrt_feed http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/mtk_openwrt_feed

src/gz openwrt_packages http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/packages

src/gz openwrt_routing http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/routing

src/gz openwrt_telephony http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/telephony

8.5G 获取 IPV6地址

/sbin/quectel-CM -6 -4

9.刷机后开箱即用配置

将路由器中配置文件/etc/init.d/部分文件 拷贝至/target/linux/mediatek/mt7988/base-files/etc/config中 如:

mwan3

frpc

upnpd

Translated:

BPI-R4 solves the problem based on official source compilation

Official source: https://github.com/BPI-SINOVOIP/BPI-R4-MT76-OPENWRT-V21.02

  1. Unable to compile: Delete or comment out the following line in the Makefile under the package directory:
//$(curdir)/compile: $(curdir)/cryptsetup/host/compile
  1. Inability to open the startup page: Delete the following from the directory /target/linux/mediatek/mt7988/base-files/etc/init.d/:

Move the script command from ltecalling to the local startup script (for Quectel 5G card):

/sbin/quectel-CM -4 &
  1. Increase the connection number in the Linux system: Modify the sysctl-nf-conntrack.conf in package/kernel/linux/files:

Increase the connection number

net.netfilter.nf_conntrack_max=65536
  1. Increase hardware-accelerated connections (for older drivers or offload entry numbers in immortalwrt): Modify the files in the directory /target/linux/mediatek/patches-5.4:
  • In 999-3001-mt7622-backport-nf-hw-offload-framework-and-upstream.patch, change line 781:
+#define MTK_PPE_ENTRIES_SHIFT 5 // The new file increases the default from 3 (8192) to 5 (32768 or 32K)
  • In 999-3004-ethernet-update-ppe-from-netsys1-to-netsys2.patch, change MTK_PPE_ENTRIES_SHIFT 3 to 5.
  1. Issue after flashing and rebooting: Delete the fanspeed file from /target/linux/mediatek/mt7988/base-files/etc/init.d/:

Remove the code after:

/sbin/fan-speed &
  1. Fan operation: Update the fan-speed file (5.7 KB) to /target/linux/mediatek/mt7988/base-files/sbin/, replacing the original file.

  2. Update domestic sources:

src/gz openwrt_core http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/targets/mediatek/mt7988/packages

src/gz openwrt_base http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/base

src/gz openwrt_luci http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/luci

src/gz openwrt_mtk_openwrt_feed http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/mtk_openwrt_feed

src/gz openwrt_packages http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/packages

src/gz openwrt_routing http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/routing

src/gz openwrt_telephony http://mirrors.ustc.edu.cn/openwrt/releases/21.02.7/packages/aarch64_cortex-a53/telephony

  1. Obtaining an IPV6 address for 5G:
/sbin/quectel-CM -6 -4
  1. Configuration after flashing: Copy the configuration files from /etc/init.d/ on the router to /target/linux/mediatek/mt7988/base-files/etc/config/, such as:
mwan3
frpc
upnpd

Hi , Thank for translate I’m new and using SD for boot can you explain for me how I can add this on SD or flashing it and adding it …

Should be similar to upstream openwrt

gunzip -c bin/targets/mediatek/filogic/openwrt-mediatek-filogic-bananapi_bpi-r4-sdcard.img.gz | sudo dd bs=1M status=progress conv=notrunc,fsync of=/dev/sdX