From 4904bf3f83c55275debf1cbcd1fcbc9e6cdc1c15 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 18 Feb 2025 14:06:57 +0100 Subject: [PATCH 1/4] Add BPI-R4 network config --- .../files/etc/uci-defaults/1920-omr-network | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/openmptcprouter/files/etc/uci-defaults/1920-omr-network b/openmptcprouter/files/etc/uci-defaults/1920-omr-network index 19cfe313e..e897371d0 100755 --- a/openmptcprouter/files/etc/uci-defaults/1920-omr-network +++ b/openmptcprouter/files/etc/uci-defaults/1920-omr-network @@ -106,6 +106,8 @@ fi lanif="eth0" if [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "friendlyarm,nanopi-r5c" ]; then lanif="eth0" +elif [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "bananapi,bpi-r4" ] || [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "bananapi,bpi-r4-poe" ]; then + lanif="wan" elif [ "$(grep rockchip /etc/os-release)" != "" ]; then lanif="eth1" elif [ "$(grep filogic /etc/os-release)" != "" ]; then @@ -259,6 +261,10 @@ if [ "$(uci -q show network.wan1 | grep multipath)" = "" ] && [ -z "$(uci -q get _setup_wan_interface wan2 eth1.2 on _setup_wan_interface wan3 eth1.3 on _setup_wan_interface wan4 eth1.4 on + elif [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "bananapi,bpi-r4" ] || [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "bananapi,bpi-r4-poe" ]; then + _setup_wan_interface wan1 lan1 master + _setup_wan_interface wan2 lan2 on + _setup_wan_interface wan3 lan3 on elif [ "$(cat /etc/board.json | jsonfilter -q -e '@.model.id' | tr -d '\n')" = "friendlyarm,nanopi-r5c" ]; then _setup_wan_interface wan1 eth1 master macvlan _setup_wan_interface wan2 eth1 on macvlan @@ -402,8 +408,8 @@ if [ "$(uci -q show network.wan1 | grep multipath)" = "" ] && [ -z "$(uci -q get _setup_wan_interface wan2 lan3 on _setup_wan_interface wan3 lan4 on if [ -d /sys/class/net/10g-1 ] && [ -d /sys/class/net/10g-2 ]; then - _setup_wan_interface wan3 10g-1 on - _setup_wan_interface wan3 10g-2 on + _setup_wan_interface wan4 10g-1 on + _setup_wan_interface wan5 10g-2 on fi else _setup_wan_interface wan1 eth0 master macvlan From 25ed9291916c8b96fb574feffbe2bc99ec7fc17f Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 18 Feb 2025 19:59:42 +0100 Subject: [PATCH 2/4] Set modem path on z810* only if modems use ModemManager --- .../files/usr/share/omr/post-tracking.d/001-initialize | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/omr-tracker/files/usr/share/omr/post-tracking.d/001-initialize b/omr-tracker/files/usr/share/omr/post-tracking.d/001-initialize index 6ce92dd52..c9ae16e11 100755 --- a/omr-tracker/files/usr/share/omr/post-tracking.d/001-initialize +++ b/omr-tracker/files/usr/share/omr/post-tracking.d/001-initialize @@ -28,7 +28,7 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && [ -n "$OMR_TRACKER_DEVICE" ] && [ "$OMR_TR fi fi -if [ -n "$(grep z8102ax /etc/board.json)" ]; then +if [ -n "$(grep z8102ax /etc/board.json)" ] && [ "$(uci -q get network.modem1.proto)" = "modemmanager" ]; then if [ -e /sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1 ]; then uci -q batch <<-EOF set network.modem1.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1' @@ -42,7 +42,7 @@ if [ -n "$(grep z8102ax /etc/board.json)" ]; then fi [ -n "$(uci -q changes network)" ] && uci -q commit network fi -if [ -n "$(grep z8109ax /etc/board.json)" ]; then +if [ -n "$(grep z8109ax /etc/board.json)" ] && [ "$(uci -q get network.modem1.proto)" = "modemmanager" ]; then if [ -e /sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1 ]; then uci -q batch <<-EOF set network.modem1.device='/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.1' From 4fbed72689fabc977e1f8d4f4454726de5bfe190 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 18 Feb 2025 20:00:23 +0100 Subject: [PATCH 3/4] Add lan5 in omr-network default script --- openmptcprouter/files/etc/uci-defaults/1920-omr-network | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openmptcprouter/files/etc/uci-defaults/1920-omr-network b/openmptcprouter/files/etc/uci-defaults/1920-omr-network index e897371d0..6572e6158 100755 --- a/openmptcprouter/files/etc/uci-defaults/1920-omr-network +++ b/openmptcprouter/files/etc/uci-defaults/1920-omr-network @@ -346,6 +346,10 @@ if [ "$(uci -q show network.wan1 | grep multipath)" = "" ] && [ -z "$(uci -q get _setup_wan_interface wan4 lan4 on _macaddr=$(uci -q get "network.lan4.macaddr") _setup_macaddr "wan4" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" + if [ -d /sys/class/net/lan5 -o -n "$(ip link | grep ' lan5')" ]; then + _macaddr=$(uci -q get "network.lan5.macaddr") + _setup_macaddr "wan5" "${_macaddr:-$(dd if=/dev/urandom bs=1024 count=1 2>/dev/null | md5sum | sed -e 's/^\(..\)\(..\)\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4:\5:\6/' -e 's/^\(.\)[13579bdf]/\10/')}" + fi elif [ -d /sys/class/net/wan1 ] || [ -n "$(ip link | grep ' wan1')" ]; then if [ -d /sys/class/net/wan2 ] || [ -n "$(ip link | grep ' wan2')" ]; then _setup_wan_interface wan1 wan1 master From 6b1c634a9fc33da53de160feded1149b3b4c4edd Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 18 Feb 2025 20:00:58 +0100 Subject: [PATCH 4/4] Add proper exit in firewall.*ray-rules --- v2ray-core/files/etc/firewall.v2ray-rules | 1 + xray-core/files/etc/firewall.xray-rules | 1 + 2 files changed, 2 insertions(+) diff --git a/v2ray-core/files/etc/firewall.v2ray-rules b/v2ray-core/files/etc/firewall.v2ray-rules index a76fa56c0..c31714bae 100644 --- a/v2ray-core/files/etc/firewall.v2ray-rules +++ b/v2ray-core/files/etc/firewall.v2ray-rules @@ -1,2 +1,3 @@ #!/bin/sh [ "$(uci -q get v2ray.main_dns.enabled)" = "1" ] && /etc/init.d/v2ray rules_up +exit 0 \ No newline at end of file diff --git a/xray-core/files/etc/firewall.xray-rules b/xray-core/files/etc/firewall.xray-rules index 2a82fba79..2d12daae6 100644 --- a/xray-core/files/etc/firewall.xray-rules +++ b/xray-core/files/etc/firewall.xray-rules @@ -1,2 +1,3 @@ #!/bin/sh [ "$(uci -q get xray.main_dns.enabled)" = "1" ] && /etc/init.d/xray rules_up +exit 0 \ No newline at end of file