Asus TUF AX4200 support


The changes in the repository are so ridiculous that there is no point in even creating a diff-file.

  1. change file {repo}/scripts/
if [ -n "${INITRD}" ]; then
			description = \"${ARCH_UPPER} OpenWrt ${DEVICE} initrd\";
			data = /incbin/(\"${INITRD}\");
			type = \"ramdisk\";
			load = <0x5f000000>;   <==== new line with load addr for initrd
			arch = \"${ARCH}\";
			os = \"linux\";
			hash${REFERENCE_CHAR}1 {
				algo = \"crc32\";
			hash${REFERENCE_CHAR}2 {
				algo = \"${HASH}\";
  1. change file {repo}/target/linux/mediatek/dts/mt7986a-asus-tuf-ax4200.dts
	chosen {
		stdout-path = "serial0:115200n8";
		bootargs-override = "ubi.mtd=UBI_DEV  root=/dev/ram0  rw  initrd=0x5f000000,8M";
  1. change file {repo}/target/linux/mediatek/image/
define Device/asus_tuf-ax4200
  DEVICE_DTS := mt7986a-asus-tuf-ax4200
  DEVICE_DTS_DIR := ../dts
# DEVICE_DTS_LOADADDR := 0x47000000
  DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware mt7986-wo-firmware
  IMAGES := sysupgrade.bin
  KERNEL := kernel-bin | lzma | \
        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
# KERNEL_INITRAMFS := kernel-bin | lzma | \
#       fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
  KERNEL_INITRAMFS := kernel-bin | lzma | \
        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | uImage none
  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
TARGET_DEVICES += asus_tuf-ax4200
  1. After making changes to the files, you need to run the build and wait for initramfs image to appear.
    From the resulting bin image, you need to use the mkasustrx utility to obtain the trx image:
mkasustrx.exe -n TUF-AX4200 -i openwrt-mediatek-filogic-asus_tuf-ax4200-initramfs-kernel.bin -o openwrt-mediatek-filogic-asus_tuf-ax4200-initramfs-kernel.trx
A More Correct Way

It is necessary to add support for the mkasustrx utility to the building scripts and change :

  KERNEL_INITRAMFS := kernel-bin | lzma | \
        fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | \
        uImage none | mkasustrx -n $$(DEVICE_MODEL) 

All the assembly changes described above are a terrible hack!

The correct solution is to integrate initrd into the kernel image. I don't know how to build OpenWRT initramfs images this way. But it seems that the kernel parameter CONFIG_INITRAMFS_SOURCE is responsible for this.

The mkits script has grown too many options, but this does look like something which probably should be supported somehow. E.g similar to how the DTB load address was added. Ref

No need to do this. You just need to convince the most important maintainers that you need to make it possible to build a second kernel, which will contain the initrd image.

Some things for this are already in the scripts:

OK. This is done by pull requests, not discussions.

Hmmmm. My 4 pull requests have been hanging unclosed for 1...2 years....


I can only see 3, and they're all waiting for you to implement requested changes

But whatever. Maybe your method works better than mine.

Thank You very much, It worked very good.
I had working openwrt in 3 minutes without nedd of opening housing. Simply GREAT !!!


good job :wink: i will try for see :slight_smile:

for install via oem and we are OpenWrt ? what is the first file ?

asus mk

This is a utility for creating an trx-image compatible with AsusWRT installer.

1 Like

ok it's just a bonus that you've added since you've already created the image below, then all I have to do is upgrade the firmware right?

1: I install your image via the software update
2: I update via sysupgrade?

1 Like

Yes, thats it from asus firmware trx file then log in into luci and make sysupgrade with asus 4200 23.05 sysupgrade image

1 Like

is there a point in setting on hardware flow offload ? is this feature implemented in this soc?

ok thanks for response


you can see software accelleration in network--> firewall

but i do'nt need me

1 Like

any idea if the initram file posted above will work the same for ASUS TUF-AX5400?

i receve my router tommorow i will test again big thanks for your work :slight_smile:

juste a question a flash is like usually router just connect to lan 1 and go :stuck_out_tongue:

Isn’t that router built on a Broadcom SoC (comparing to Mediatek)?

1 Like

Hi, probably no because of platform "Broadcom BCM6750 1.5Ghz Triple-Core with 512MB RAM". But this solution should be common for TUF ax4200 and TUF ax6000.

1 Like

I updated the trx-image, which is located at the link provided.
Now creating this image is fully automated.
To get this trx-image, just run the following commands:

git clone -b v23 openwrt-v23
cd openwrt-v23

./ -v xq-23.05.0
cd xq-23.05.0

./ -f

./ -f -t tuf_ax4200_initramfs

After the build is completed, in the ./xq-23.05.0/bin/targets/mediatek/filogic directory should appear file openwrt-mediatek-filogic-asus_tuf-ax4200-initramfs.trx

File changes

New image tool mkasustrx for creating Asus trx-image:

Downloading and compile new image tool mkasustrx:

Using new image tool mkasustrx:

Forced change of the main options responsible for assembling images:


Feature separate_ramdisk

The method of building images that I described cannot be added to the official OpenWRT repository, because there, for mtk/filogic devices, they completely abandoned the integration of initramfs into the kernel:
Feature separate_ramdisk blocks the ability to insert initrams into the kernel!

1 Like

what is the rapport between writed
asus new image
below and this files

i have my asus in one hour i will test