From 797c3ddca021b2c972215a0968bba94319c3cf1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Fri, 15 Mar 2024 21:55:46 +0100 Subject: [PATCH] Add support for Xiaomi Mi Router 4A (100m-intl) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The international variant of the Xiaomi Mi Router 4A (100m) has a different partition layout as the chinese version and was added to OpenWrt at a later time. Using the OpenWrt image for the international variant saves the extra step of flashing the chinese firmware variant via TFTP before OpenWrt itself. Signed-off-by: Fabian Bläse --- bsp/ramips-mt76x8.bsp | 1 + bsp/ramips-mt76x8/.config | 2 ++ .../fff/fff-network/files/lib/functions/fff/cpuport | 3 ++- .../fff/fff-network/files/lib/functions/fff/portorder | 3 ++- .../mipsel/network.xiaomi,mi-router-4a-100m-intl | 7 +++++++ 5 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 src/packages/fff/fff-network/mipsel/network.xiaomi,mi-router-4a-100m-intl diff --git a/bsp/ramips-mt76x8.bsp b/bsp/ramips-mt76x8.bsp index 682f8fdf..2e36d640 100644 --- a/bsp/ramips-mt76x8.bsp +++ b/bsp/ramips-mt76x8.bsp @@ -4,4 +4,5 @@ images=("openwrt-${chipset}-${subtarget}-tplink_archer-c50-v3-squashfs-*" "openwrt-${chipset}-${subtarget}-tplink_archer-c50-v4-squashfs-*" "openwrt-${chipset}-${subtarget}-tplink_tl-wr841n-v13-squashfs-*" "openwrt-${chipset}-${subtarget}-xiaomi_mi-router-4a-100m-squashfs-*" + "openwrt-${chipset}-${subtarget}-xiaomi_mi-router-4a-100m-intl-squashfs-*" ) diff --git a/bsp/ramips-mt76x8/.config b/bsp/ramips-mt76x8/.config index d2c3983c..c8bfe297 100644 --- a/bsp/ramips-mt76x8/.config +++ b/bsp/ramips-mt76x8/.config @@ -12,6 +12,8 @@ CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_tplink_tl-wr841n-v13=y CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_tplink_tl-wr841n-v13="" CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_xiaomi_mi-router-4a-100m=y CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_xiaomi_mi-router-4a-100m="" +CONFIG_TARGET_DEVICE_ramips_mt76x8_DEVICE_xiaomi_mi-router-4a-100m-intl=y +CONFIG_TARGET_DEVICE_PACKAGES_ramips_mt76x8_DEVICE_xiaomi_mi-router-4a-100m-intl="" CONFIG_BUSYBOX_CUSTOM=y CONFIG_TARGET_PER_DEVICE_ROOTFS=y # CONFIG_BUSYBOX_CONFIG_BRCTL is not set diff --git a/src/packages/fff/fff-network/files/lib/functions/fff/cpuport b/src/packages/fff/fff-network/files/lib/functions/fff/cpuport index 42a77c74..6acd2e5e 100644 --- a/src/packages/fff/fff-network/files/lib/functions/fff/cpuport +++ b/src/packages/fff/fff-network/files/lib/functions/fff/cpuport @@ -12,7 +12,8 @@ get_cpu_port() { tplink,tl-wr1043nd-v2|\ tplink,tl-wr1043nd-v3|\ tplink,tl-wr841n-v13|\ - xiaomi,mi-router-4a-100m) + xiaomi,mi-router-4a-100m|\ + xiaomi,mi-router-4a-100m-intl) CPUPORT="6t" ;; avm,fritzbox-4040|\ diff --git a/src/packages/fff/fff-network/files/lib/functions/fff/portorder b/src/packages/fff/fff-network/files/lib/functions/fff/portorder index 98dfc038..f2d5e165 100644 --- a/src/packages/fff/fff-network/files/lib/functions/fff/portorder +++ b/src/packages/fff/fff-network/files/lib/functions/fff/portorder @@ -36,7 +36,8 @@ get_port_order() { tplink,cpe510-v1) PORTORDER="5 4" ;; - xiaomi,mi-router-4a-100m) + xiaomi,mi-router-4a-100m|\ + xiaomi,mi-router-4a-100m-intl) PORTORDER="0 2 4" ;; esac diff --git a/src/packages/fff/fff-network/mipsel/network.xiaomi,mi-router-4a-100m-intl b/src/packages/fff/fff-network/mipsel/network.xiaomi,mi-router-4a-100m-intl new file mode 100644 index 00000000..54240e66 --- /dev/null +++ b/src/packages/fff/fff-network/mipsel/network.xiaomi,mi-router-4a-100m-intl @@ -0,0 +1,7 @@ +. /lib/functions/fff/network + +WANDEV=eth0 +SWITCHDEV=eth0 +CLIENT_PORTS="6t 4" +WAN_PORTS="6t 0" +BATMAN_PORTS="6t 2"