Asus TUF AX4200 support

ok thanks for response

yes

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 https://github.com/openwrt-xiaomi/builder -b v23 openwrt-v23
cd openwrt-v23

./xcreate.sh -v xq-23.05.0
cd xq-23.05.0

./xupdate.sh -f

./xmake.sh -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:
https://github.com/openwrt-xiaomi/firmware-utils/commit/1d44ff4c26d79c5755ddf5107a83f5bf202f4cae

Downloading and compile new image tool mkasustrx:
https://github.com/openwrt-xiaomi/openwrt/commit/f282f8ef3e5e688884a5f62429a46ddafb9b933f

Using new image tool mkasustrx:
https://github.com/openwrt-xiaomi/openwrt/commit/61d5891f8c7d1d6ddbf9675d3d84edfd368eefca

Forced change of the main options responsible for assembling images:
https://github.com/openwrt-xiaomi/builder/commit/975cc0efb3dea0f551cdc82ce819fd74a0d6045f#diff-c5024fd0171059d662ead280421311d0a4a825381fcec2f2bc58baaa40d21198R61-R65

.

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:
https://github.com/openwrt/openwrt/blob/eacc885816fb46bf4054b0c3dd2cd1513322ad09/target/linux/mediatek/Makefile#L9
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

thanks

@daniel , @patrykk

After install my biggest sysupgrade image (more 50 MB) i saw the following:

root@OpenWrt:/# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                50.8M     50.8M         0 100% /rom
tmpfs                   243.4M      5.4M    238.1M   2% /tmp
/dev/ubi0_7              12.5M    216.0K     11.7M   2% /overlay
overlayfs:/overlay       12.5M    216.0K     11.7M   2% /
tmpfs                   512.0K         0    512.0K   0% /dev

Only 11 megabytes available))

ubinfo
root@OpenWrt:/# ubinfo /dev/ubi0 -a
ubi0
Volumes count:                           8
Logical eraseblock size:                 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks:     2016 (255983616 bytes, 244.1 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  40
Current maximum erase counter value:     9
Minimum input/output unit size:          2048 bytes
Character device major/minor:            249:0
Present volumes:                         0, 1, 2, 3, 4, 5, 6, 7

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        1 LEBs (126976 bytes, 124.0 KiB)
State:       OK
Name:        nvram
Character device major/minor: 249:1
-----------------------------------
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        8 LEBs (1015808 bytes, 992.0 KiB)
State:       OK
Name:        Factory
Character device major/minor: 249:2
-----------------------------------
Volume ID:   2 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        8 LEBs (1015808 bytes, 992.0 KiB)
State:       OK
Name:        Factory2
Character device major/minor: 249:3
-----------------------------------
Volume ID:   3 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        30 LEBs (3809280 bytes, 3.6 MiB)
State:       OK
Name:        linux
Character device major/minor: 249:4
-----------------------------------
Volume ID:   4 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        578 LEBs (73392128 bytes, 69.9 MiB)
State:       OK
Name:        linux2
Character device major/minor: 249:5
-----------------------------------
Volume ID:   5 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        799 LEBs (101453824 bytes, 96.7 MiB)
State:       OK
Name:        jffs2
Character device major/minor: 249:6
-----------------------------------
Volume ID:   6 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        418 LEBs (53075968 bytes, 50.6 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 249:7
-----------------------------------
Volume ID:   7 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        128 LEBs (16252928 bytes, 15.5 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 249:8

It seems to me that the file system should be pre-prepared.
Something similar has already been done for Xiaomi routers:

1 Like

then you should have ~50MB available post install using a vanilla openwrt image, what's the problem ?

As a developer, this doesn't matter to me.
But many users will soon notice this and will ask why they have volume jffs2 on flash memory, which takes up 90 MiB.

1 Like

(don't own the device, just guessing ... )

openwrt avoids modifying the flash layout, if the volume was there when the Asus fw was used, then it'll usually remain post openwrt install.

So this volume (and others) are deleted when returning to stock:

I ran the following commands in the console:

ubirename /dev/ubi0 rootfs_data rootfs__d
ubirename /dev/ubi0 jffs2 rootfs_data
reboot

After reboot I saw:

root@OpenWrt:/# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                50.8M     50.8M         0 100% /rom
tmpfs                   243.4M      4.8M    238.7M   2% /tmp
/dev/ubi0_5              87.6M    284.0K     87.3M   0% /overlay
overlayfs:/overlay       87.6M    284.0K     87.3M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev

Everything turned out to be quite simple.


The bootloader was not happy about this and created a new volume jffs2:

UBI:        4            242          1         0   dynamic            1f000       242     45fe000         1f000          0           0         6  linux2
UBI:        5            31f          1         0   dynamic            1f000       31f     60c1000         1f000          0           0         b  rootfs_data
UBI:        6            1a2          1         0   dynamic            1f000       1a2     329e000         1f000          0           0         6  rootfs
UBI:        7             80          1         0   dynamic            1f000        80      f80000         1f000          0           0         9  rootfs__d
UBI: 7fffefff              2          1         0   dynamic            1f000         2       3e000             2          0           0         d  layout volume
UBI volume [linux] size 3a2000 smaller than 45fe000!
No size specified -> Using max size (0x3e000)
Creating dynamic volume jffs2 of size 0x3e000
ubinfo
root@OpenWrt:/# ubinfo /dev/ubi0 -a
ubi0
Volumes count:                           9
Logical eraseblock size:                 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks:     2016 (255983616 bytes, 244.1 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  38
Current maximum erase counter value:     9
Minimum input/output unit size:          2048 bytes
Character device major/minor:            249:0
Present volumes:                         0, 1, 2, 3, 4, 5, 6, 7, 8

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        1 LEBs (126976 bytes, 124.0 KiB)
State:       OK
Name:        nvram
Character device major/minor: 249:1
-----------------------------------
Volume ID:   1 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        8 LEBs (1015808 bytes, 992.0 KiB)
State:       OK
Name:        Factory
Character device major/minor: 249:2
-----------------------------------
Volume ID:   2 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        8 LEBs (1015808 bytes, 992.0 KiB)
State:       OK
Name:        Factory2
Character device major/minor: 249:3
-----------------------------------
Volume ID:   3 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        30 LEBs (3809280 bytes, 3.6 MiB)
State:       OK
Name:        linux
Character device major/minor: 249:4
-----------------------------------
Volume ID:   4 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        578 LEBs (73392128 bytes, 69.9 MiB)
State:       OK
Name:        linux2
Character device major/minor: 249:5
-----------------------------------
Volume ID:   5 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        799 LEBs (101453824 bytes, 96.7 MiB)
State:       OK
Name:        rootfs_data
Character device major/minor: 249:6
-----------------------------------
Volume ID:   6 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        418 LEBs (53075968 bytes, 50.6 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 249:7
-----------------------------------
Volume ID:   7 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        128 LEBs (16252928 bytes, 15.5 MiB)
State:       OK
Name:        rootfs__d
Character device major/minor: 249:8
-----------------------------------
Volume ID:   8 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        2 LEBs (253952 bytes, 248.0 KiB)
State:       OK
Name:        jffs2
Character device major/minor: 249:9
1 Like

asus has 128mb of flash i think, it must keep a partition of its firmware, i know that with the rt3200 ubi i had quite a lot of space to install packages in software

The Xiaomi AX6000 got ~120MB, with uboot-mod, but 50MB ain't bad.

1 Like

Tell me, plz, how many free flash I will get after complete basic OpenWRT 23.05 installation? The router has 256M flash, so I hope to have at least 170-180M of flash free. Am I wrong?

Scroll back 3 posts ?

1 Like

70 MB (linux) - 4 MB (kernel) - 8 MB (rootfs) = 58 MB free space

I'm currently working on increasing the available space.
It is very strange that the OpenWRT maintainer @blocktrron did not immediately attend to this point...

Where is all other flash space :woozy_face: ? Are there any hope to recover it?

I just tried using OpenWRT LUCI (WEB) to install initramfs image (not trx) on the linux volume (forced mode). And the image was successfully flashed and started successfully.
And in initramfs-mode we can do whatever we want with ubi volumes.
This is how you can return to stock firmware.

I also need to publish this initramfs image....


Restoring the stock AsusWRT from initramfs-mode:

ubirmvol /dev/ubi0 -N rootfs
ubirmvol /dev/ubi0 -N rootfs_data
ubirmvol /dev/ubi0 -N jffs2
ubirmvol /dev/ubi0 -N linux
ubimkvol /dev/ubi0 -N linux -s 0x45fe000
dd if=/tmp/tufax4200.trx bs=64 skip=1 > /tmp/tufax4200.fit
linux_num=$( ubinfo -d 0 -N linux | awk 'NR==1 {print $3}' )
ubiupdatevol /dev/ubi0_$linux_num /tmp/tufax4200.fit
reboot
2 Likes