Adding OpenWrt support for Xiaomi "Redmi Router AX6S"/"Xiaomi Router AX3200"

Hi,
I'm experiencing weird latency peaks on while connected to the 5Ghz
as demonstrated in the ping below, above 100ms pretty frequently,
it really messes my online warzone gaming experience (it used to be messed only by my skills :sweat_smile: )

Any idea what to look for? how to debug?

I'm using SQM to improve the latency with common/default settings and getting A+ results on LAN,
Fiber 1G/100M,
It does not happens when connected via lan cable (Don't as why I'm not connected via cable, apparently there is some PS5 lan cable bug that I've started to experience: https://www.reddit.com/r/PS5/comments/kk3ypn/ps5_download_speed_significantly_slower_when/ )

PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=116 time=10.481 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=55.852 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=99.772 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=116 time=142.897 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=116 time=188.003 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=116 time=3.568 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=116 time=3.156 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=116 time=5.386 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=116 time=3.777 ms
64 bytes from 8.8.8.8: icmp_seq=9 ttl=116 time=3.595 ms
64 bytes from 8.8.8.8: icmp_seq=10 ttl=116 time=3.690 ms
64 bytes from 8.8.8.8: icmp_seq=11 ttl=116 time=8.944 ms
64 bytes from 8.8.8.8: icmp_seq=12 ttl=116 time=24.533 ms
64 bytes from 8.8.8.8: icmp_seq=13 ttl=116 time=68.534 ms
64 bytes from 8.8.8.8: icmp_seq=14 ttl=116 time=112.993 ms
64 bytes from 8.8.8.8: icmp_seq=15 ttl=116 time=3.508 ms
64 bytes from 8.8.8.8: icmp_seq=16 ttl=116 time=3.047 ms
64 bytes from 8.8.8.8: icmp_seq=17 ttl=116 time=4.571 ms
64 bytes from 8.8.8.8: icmp_seq=18 ttl=116 time=4.668 ms
64 bytes from 8.8.8.8: icmp_seq=19 ttl=116 time=3.196 ms
64 bytes from 8.8.8.8: icmp_seq=20 ttl=116 time=3.500 ms
64 bytes from 8.8.8.8: icmp_seq=21 ttl=116 time=3.910 ms
64 bytes from 8.8.8.8: icmp_seq=22 ttl=116 time=3.327 ms
64 bytes from 8.8.8.8: icmp_seq=23 ttl=116 time=3.150 ms
64 bytes from 8.8.8.8: icmp_seq=24 ttl=116 time=40.503 ms
64 bytes from 8.8.8.8: icmp_seq=25 ttl=116 time=84.444 ms
64 bytes from 8.8.8.8: icmp_seq=26 ttl=116 time=6.154 ms
64 bytes from 8.8.8.8: icmp_seq=27 ttl=116 time=46.855 ms
64 bytes from 8.8.8.8: icmp_seq=28 ttl=116 time=88.794 ms
64 bytes from 8.8.8.8: icmp_seq=29 ttl=116 time=4.658 ms
64 bytes from 8.8.8.8: icmp_seq=30 ttl=116 time=2.973 ms
64 bytes from 8.8.8.8: icmp_seq=31 ttl=116 time=2.945 ms
64 bytes from 8.8.8.8: icmp_seq=32 ttl=116 time=68.870 ms
64 bytes from 8.8.8.8: icmp_seq=33 ttl=116 time=19.055 ms
64 bytes from 8.8.8.8: icmp_seq=34 ttl=116 time=30.951 ms
64 bytes from 8.8.8.8: icmp_seq=35 ttl=116 time=6.829 ms
64 bytes from 8.8.8.8: icmp_seq=36 ttl=116 time=51.814 ms
64 bytes from 8.8.8.8: icmp_seq=37 ttl=116 time=94.186 ms
64 bytes from 8.8.8.8: icmp_seq=38 ttl=116 time=139.528 ms
64 bytes from 8.8.8.8: icmp_seq=39 ttl=116 time=3.055 ms
64 bytes from 8.8.8.8: icmp_seq=40 ttl=116 time=2.965 ms
64 bytes from 8.8.8.8: icmp_seq=41 ttl=116 time=3.115 ms
64 bytes from 8.8.8.8: icmp_seq=42 ttl=116 time=21.960 ms
64 bytes from 8.8.8.8: icmp_seq=43 ttl=116 time=4.321 ms
64 bytes from 8.8.8.8: icmp_seq=44 ttl=116 time=3.143 ms
64 bytes from 8.8.8.8: icmp_seq=45 ttl=116 time=3.778 ms
64 bytes from 8.8.8.8: icmp_seq=46 ttl=116 time=4.654 ms
64 bytes from 8.8.8.8: icmp_seq=47 ttl=116 time=15.667 ms
64 bytes from 8.8.8.8: icmp_seq=48 ttl=116 time=60.119 ms
64 bytes from 8.8.8.8: icmp_seq=49 ttl=116 time=111.565 ms
64 bytes from 8.8.8.8: icmp_seq=50 ttl=116 time=150.171 ms
64 bytes from 8.8.8.8: icmp_seq=51 ttl=116 time=8.578 ms
64 bytes from 8.8.8.8: icmp_seq=52 ttl=116 time=3.133 ms
64 bytes from 8.8.8.8: icmp_seq=53 ttl=116 time=3.381 ms
64 bytes from 8.8.8.8: icmp_seq=54 ttl=116 time=3.703 ms
64 bytes from 8.8.8.8: icmp_seq=55 ttl=116 time=3.439 ms
64 bytes from 8.8.8.8: icmp_seq=56 ttl=116 time=4.031 ms
64 bytes from 8.8.8.8: icmp_seq=57 ttl=116 time=3.571 ms
64 bytes from 8.8.8.8: icmp_seq=58 ttl=116 time=4.072 ms
64 bytes from 8.8.8.8: icmp_seq=59 ttl=116 time=39.333 ms
64 bytes from 8.8.8.8: icmp_seq=60 ttl=116 time=79.364 ms
64 bytes from 8.8.8.8: icmp_seq=61 ttl=116 time=3.721 ms
64 bytes from 8.8.8.8: icmp_seq=62 ttl=116 time=4.331 ms
64 bytes from 8.8.8.8: icmp_seq=63 ttl=116 time=3.148 ms
64 bytes from 8.8.8.8: icmp_seq=64 ttl=116 time=3.517 ms
64 bytes from 8.8.8.8: icmp_seq=65 ttl=116 time=2.874 ms
64 bytes from 8.8.8.8: icmp_seq=66 ttl=116 time=3.476 ms
64 bytes from 8.8.8.8: icmp_seq=67 ttl=116 time=3.357 ms
64 bytes from 8.8.8.8: icmp_seq=68 ttl=116 time=3.352 ms
64 bytes from 8.8.8.8: icmp_seq=69 ttl=116 time=4.208 ms
64 bytes from 8.8.8.8: icmp_seq=70 ttl=116 time=4.047 ms
64 bytes from 8.8.8.8: icmp_seq=71 ttl=116 time=45.297 ms
64 bytes from 8.8.8.8: icmp_seq=72 ttl=116 time=92.409 ms
64 bytes from 8.8.8.8: icmp_seq=73 ttl=116 time=138.184 ms
64 bytes from 8.8.8.8: icmp_seq=74 ttl=116 time=182.080 ms
64 bytes from 8.8.8.8: icmp_seq=75 ttl=116 time=418.868 ms
64 bytes from 8.8.8.8: icmp_seq=76 ttl=116 time=6.183 ms
64 bytes from 8.8.8.8: icmp_seq=77 ttl=116 time=4.073 ms
64 bytes from 8.8.8.8: icmp_seq=78 ttl=116 time=28.641 ms
64 bytes from 8.8.8.8: icmp_seq=79 ttl=116 time=73.186 ms
64 bytes from 8.8.8.8: icmp_seq=80 ttl=116 time=128.472 ms
64 bytes from 8.8.8.8: icmp_seq=81 ttl=116 time=163.271 ms
64 bytes from 8.8.8.8: icmp_seq=82 ttl=116 time=16.470 ms
64 bytes from 8.8.8.8: icmp_seq=83 ttl=116 time=65.216 ms
64 bytes from 8.8.8.8: icmp_seq=84 ttl=116 time=106.739 ms
64 bytes from 8.8.8.8: icmp_seq=85 ttl=116 time=152.933 ms
64 bytes from 8.8.8.8: icmp_seq=86 ttl=116 time=3.294 ms
64 bytes from 8.8.8.8: icmp_seq=87 ttl=116 time=4.128 ms
64 bytes from 8.8.8.8: icmp_seq=88 ttl=116 time=20.699 ms
64 bytes from 8.8.8.8: icmp_seq=89 ttl=116 time=3.805 ms
64 bytes from 8.8.8.8: icmp_seq=90 ttl=116 time=3.958 ms
64 bytes from 8.8.8.8: icmp_seq=91 ttl=116 time=8.199 ms

I've tried different settings for 5GHz (channel, country, AC/AX), but eventaully had to disable 5GHz because it's a pain. Constant "No response" when pinging. Haven't tried alternative power adapter though.

is the firmware selector broken or am I missing anything in the package list? I keep getting dependency errors

Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency ubox for fstools
 * pkg_hash_fetch_best_installation_candidate: Packages for fstools found, but incompatible with the architectures configured
 * pkg_hash_check_unresolved: cannot find dependency netifd for base-files
 * pkg_hash_check_unresolved: cannot find dependency jsonfilter for base-files
 * pkg_hash_check_unresolved: cannot find dependency usign for base-files
 * pkg_hash_check_unresolved: cannot find dependency openwrt-keyring for base-files
 * pkg_hash_fetch_best_installation_candidate: Packages for base-files found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package base-files.
 * opkg_install_cmd: Cannot install package busybox.
 * opkg_install_cmd: Cannot install package byobu.
 * opkg_install_cmd: Cannot install package ca-bundle.
 * opkg_install_cmd: Cannot install package dnsmasq.
 * opkg_install_cmd: Cannot install package firewall4.
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for fstools:
 * 	ubox
 * opkg_install_cmd: Cannot install package fstools.
 * opkg_install_cmd: Cannot install package iperf3.
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-gpio-button-hotplug
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-leds-gpio
 * pkg_hash_check_unresolved: cannot find dependency iw for kmod-cfg80211
 * pkg_hash_check_unresolved: cannot find dependency iwinfo for kmod-cfg80211
 * pkg_hash_check_unresolved: cannot find dependency wireless-regdb for kmod-cfg80211
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-crypto-aead
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-crypto-sha512
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-crypto-rng
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-crypto-gf128
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-mac80211
 * pkg_hash_check_unresolved: cannot find dependency hostapd-common for kmod-mac80211
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-hwmon-core
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-mt7615-common
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-mt7622-firmware
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-mt7622-firmware:
 * 	kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f)
 * 	iw
 * 	iwinfo
 * 	wifi-scripts
 * 	wireless-regdb
 * 	kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f)
 * 	hostapd-common
 * 	kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f)
 * opkg_install_cmd: Cannot install package kmod-mt7622-firmware.
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-thermal
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-mt7915e
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-mt7915-firmware
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-mt7915-firmware:
 * 	kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f)
 * opkg_install_cmd: Cannot install package kmod-mt7915-firmware.
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-nf-reject
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-nf-reject6
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-nf-log
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-nf-log6
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-crypto-crc32c
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-nft-core
 * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f) for kmod-nft-offload
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nft-offload:
 * 	kernel (= 5.15.148-1-e19324f8c49d26f8d0b5cf04066dd13f)
 * opkg_install_cmd: Cannot install package kmod-nft-offload.
 * opkg_install_cmd: Cannot install package libustream-mbedtls.
 * opkg_install_cmd: Cannot install package logd.
 * opkg_install_cmd: Cannot install package luci.
 * opkg_install_cmd: Cannot install package luci-app-ddns.
 * pkg_hash_check_unresolved: cannot find dependency libubox20240126 for mtd
 * pkg_hash_fetch_best_installation_candidate: Packages for mtd found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package mtd.
 * opkg_install_cmd: Cannot install package nano-plus.
 * opkg_install_cmd: Cannot install package netifd.
 * opkg_install_cmd: Cannot install package nftables.
 * opkg_install_cmd: Cannot install package odhcp6c.
 * opkg_install_cmd: Cannot install package odhcpd-ipv6only.
 * opkg_install_cmd: Cannot install package opkg.
 * opkg_install_cmd: Cannot install package ppp.
 * opkg_install_cmd: Cannot install package ppp-mod-pppoe.
 * opkg_install_cmd: Cannot install package procd.
 * opkg_install_cmd: Cannot install package procd-seccomp.
 * opkg_install_cmd: Cannot install package procd-ujail.
 * opkg_install_cmd: Cannot install package tmux.
 * opkg_install_cmd: Cannot install package uci.
 * opkg_install_cmd: Cannot install package uclient-fetch.
 * opkg_install_cmd: Cannot install package urandom-seed.
 * opkg_install_cmd: Cannot install package urngd.
 * opkg_install_cmd: Cannot install package wpad-mbedtls.
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for base-files:
 * 	netifd
 * 	jsonfilter
 * 	usign
 * 	openwrt-keyring
 * opkg_install_cmd: Cannot install package base-files.
 * opkg_install_cmd: Cannot install package busybox.
 * opkg_install_cmd: Cannot install package ca-bundle.
 * opkg_install_cmd: Cannot install package dnsmasq.
 * opkg_install_cmd: Cannot install package firewall4.
 * opkg_install_cmd: Cannot install package libustream-mbedtls.
 * opkg_install_cmd: Cannot install package logd.
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for mtd:
 * 	libubox20240126
 * opkg_install_cmd: Cannot install package mtd.
 * opkg_install_cmd: Cannot install package netifd.
 * opkg_install_cmd: Cannot install package nftables.
 * opkg_install_cmd: Cannot install package odhcp6c.
 * opkg_install_cmd: Cannot install package odhcpd-ipv6only.
 * opkg_install_cmd: Cannot install package opkg.
 * opkg_install_cmd: Cannot install package ppp.
 * opkg_install_cmd: Cannot install package ppp-mod-pppoe.
 * opkg_install_cmd: Cannot install package procd.
 * opkg_install_cmd: Cannot install package procd-seccomp.
 * opkg_install_cmd: Cannot install package procd-ujail.
 * opkg_install_cmd: Cannot install package uci.
 * opkg_install_cmd: Cannot install package uclient-fetch.
 * opkg_install_cmd: Cannot install package urandom-seed.
 * opkg_install_cmd: Cannot install package urngd.
make[2]: *** [Makefile:189: package_install] Error 255
make[1]: *** [Makefile:154: _call_manifest] Error 2
make: *** [Makefile:274: manifest] Error 2

What temperatures are you guys getting on AX3200?
Dumb AP, ambient temp is 24 °C, router is idling at around 52 °C, after one station transferred a couple of GB it immediately jumps to 56.
Just for stability test I run stress-ng + speedtest on one AC client and after 2min router got to 63 °C. Outside of case is slightly warm to the touch.
I guess this is OK for dumb AP that does no routing and extra processing?

I don't have fancy graphs, but idle temperature is quite the same as yours here, my cat /sys/class/thermal/thermal_zone0/temp returns ~48 °C in idle, where my "idle" is running snowflake proxy making ~1TB traffic monthly in each direction, but I have in the room with router only ~19-20 °C, uptime returns 11:19:30 up 20 days, 11:27, load average: 0.87, 0.73, 0.77. I tried to stress cpu also with dd if=/dev/urandom of=/dev/null bs=1M count=1000; cat /sys/class/thermal/thermal_zone0/temp &\ dd if=/dev/urandom of=/dev/null bs=1M count=1000; cat /sys/class/thermal/thermal_zone0/temp & so it run in 2 threads and got up to ~54 °C, router is slightly warm to the touch, mikrotik hap ac2 was more hot and less performant.

I find wifi very stable, I use 5GHz (HE80) where I have one tp link archer c7 in wds and 2 phones and 1 PC in non wds on 5GHz, kids play online games on it and no problems with pings around the house here. I also use 2.4GHz (HT40), one legacy 1024nd in wds still connected to it and some phones, everything looks fine here.

Some people reported in this thread it may help to lower the tx power by 1, try it, I'm not experiencing it, so I have not tested.

Ok, so the same temps if we take into account higher ambient temp.
hap ac2?
I also have one of those, it's quite warm on the outside, 50+ C measured with IR thermometer. Inside probably runs like a little furnace but no problems in the last 3+ years :slight_smile:
In what aspect do you find it less performant than AX3200, routing?
Wireless is not so good on that mikrotik.

On what aspect? On every I can think of :slight_smile: Mainly the cpu, it has 4 cores, runs very hot and is very slow compared to ax3200. Also mikrotik has half the ram, little flash, worse wifi and is more expensive. If you don't need usb and 5 lan ports, ax3200 is a clear winner. I use several hap ac2 as dumb ap and managed switches, but as router is not very performant, it has problem to route 250mbit pppoe line without anything else. So if you need pppoe and something else, you run into cpu bottleneck very soon. This is not a serious benchmark, but you can clearly see the (single thread) difference:

root@hapac2:~# time dd if=/dev/zero bs=1M count=200 | sha256sum
200+0 records in
200+0 records out
real   0m 14.49s
user   0m 0.00s
sys    0m 1.17s

root@ax3200:~# time dd if=/dev/zero bs=1M count=200 | sha256sum
200+0 records in
200+0 records out
real    0m 5.77s
user    0m 0.00s
sys     0m 0.34s

Does openwrt on hap ac2 not support any kind of software offloading?
Never tried it but I guess openwrt on hap ac2 is not so good as routeros :slight_smile:
On stock routeros 6 hap ac2 is routing fine 1000/500 fiber with pppoe and fasttrack enabled. No wlan, just routing.
With fasttrack (mtik version of software offloading) ookla speedtest maxes out at eth port max at some 930 Mbps with 50% CPU usage of one core. Without offloading, around 400Mbps, 100% one core. With some simple queue for qos it is 300Mbps max last time I tried it, but that was before ROS 7 which has cake. I'm lucky that my ISP has little problems with bufferbloat so don't really need any qos on the wan side.
Wlan on that mikrotik with stock OS is just atrocious, had all kind of problems, usually solved by googling for a week and than clicking some deep hidden settings in ROS :slight_smile:
But now I'm intrigued how would ax3200 + openwrt perform as a router on the same line. Hmm... that is going to be a nice weekend project :smiley:
I'm surprised how AX3200 as dumb AP outperforms Mi4a giga with AC clients. Yesterday just got 604/646 Mbps UL/DL on my kids windows machine about 10m (30+ feet?) from AP through one brick wall - with a shitty rtl8822bu tp-link usb wifi AC adapter (locally hosted openspeedtest). With old MT7621 4a giga about half of that. Signal was good but for some reason it never could get higher speeds.

Yes, with stock routeros the hardware offloading works fine on hap ac2, but it is non functional on openwrt. On the very same line hap ac2 had been quite fully utilized even on such slow line. Packet steering improved the situation a bit, hap ac2 managed to go up to ~230/25 pppoe on another place (with stock it worked full 250/25). AX3200 has no problems in default config without any acceleration, I read some topic hardware offloading should work on mt7622, whis is present in ax3200. The CPU is that performant I have no need to test it, I have it right now only on pppoe 180/25, on other places I need 5 ports. I think CPUs has problems with pppoe, my old single core Archer AC7 managed to do nat 500/250 without problems, when it was only routing and no pppoe was needed. When I put it on pppoe it maxed at 150/25 and with wifi it was even worse.

1 Like

Probably that patch should be applied to get offloading work again (https://github.com/openwrt/openwrt/commit/869df9ecdf0aeaa0fe1c97c1a1801340086f9ab3). From the other side, this https://github.com/openwrt/openwrt/commit/dadad6bb731ff1025125c619da7ccc196ad6ea01 disable snapshot builds for this router, so we need to be patient and wait for new builds.

It seems that the AX6S snapshot builds have been disabled:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=dadad6bb731ff1025125c619da7ccc196ad6ea01

Kernel 5.15 size: 3 785 976 bytes
Kernel 6.1 size: over 4MiB

1 Like

Original nvram options:

  boot_auto=bootxq
  boot_fw0=run boot_rd_img;bootm
  boot_fw1=run boot_rd_img2;bootm
  boot_rd_img=nand read ${loadaddr} 0x2C0000 2000;image_blks 2048;nand read ${loadaddr} 0x2C0000 ${img_align_size}
  boot_rd_img2=nand read ${loadaddr} 0x20C0000 2000;image_blks 2048;nand read ${loadaddr} 0x20C0000 ${img_align_size}

I think that to support kernel 6.x we will change this:

And add similar patch: https://github.com/openwrt/openwrt/commit/e8646f5b3d050d61084b4cf373f8f64507ced8a6

And to switch from OpenWRT 23.x to OpenWRT 24.x, the user must run the following commands:

dd if=factory.bin bs=1M count=4 | mtd write - kernel
dd if=factory.bin bs=1M skip=4 count=2 | mtd write - ubi
dd if=factory.bin bs=1M skip=6  | mtd -p 2097152 write - ubi
reboot -f
1 Like

As Daniel mention in the comment: https://github.com/openwrt/openwrt/commit/dadad6bb731ff1025125c619da7ccc196ad6ea01#commitcomment-138769341 - All it takes is replacing bl2 and then we can have the same flash layout as on Linksys E8450/Belkin RT3200., but he don't have hardware to test. So far, if someone want to create a snapshot build, just set CONFIG_ALL_KMODS=n in .config file.

I think that you need to do 2 different firmware methods!
You should always be allowed to keep the stock bootloader!

1 Like

Agree. I just quote Daniel's words. For my own needs, I do image with disabled CONFIG_ALL_KMODS and there are working well.

When moving to kernel 6.7, this may no longer help!

1 Like

My patch: https://github.com/openwrt-xiaomi/openwrt/commit/975ae07f6462f2326aee4d91d27dae3f61071786

Flashing from stock firmware using XMiR-Patcher was successful!

2 Likes

Should the factory.bin file in the above commands be the one with the bigger kernel partition (your patch above), right?

So, if one already has OpenWrt 23.x running, then the steps to upgrade to newer snapshots or 24.x would be:

  1. Apply the patch to increase kernel partition size
  2. Build (snapshot after Feb 19, 2024 or future 24.x branch)
  3. Use "factory.bin" from step 2 above and run the following commands to upgrade to new image:
dd if=factory.bin bs=1M count=4 | mtd write - kernel
dd if=factory.bin bs=1M skip=4 count=2 | mtd write - ubi
dd if=factory.bin bs=1M skip=6  | mtd -p 2097152 write - ubi
reboot -f

Is this correct?