Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Installation

lukasz1992 edited this page Nov 16, 2021 · 16 revisions

This page will describe how to install AsusWrt from various images.

Why is this not easy task

Xiaomi implements custom flash mapping for NAND, different than AsusWRT.

To complicate it more, both OpenWRT and Padavan firmwares have it different too.

Previously it was simpler

Yes, but it depended on custom code I decided to remove, as I want to keep AsusWRT unmodified as much as possible.

NAND flash - how to do it

One common thing is you have to upload firmware file (trx) to the router to file /tmp/firmware.trx.

Then follow the instructions below; please also reset to factory settings on AsusWRT after first flash.

Warning: Currently bad blocks on NAND makes image unbootable, please check if you have bad blocks (happen often in Toshiba NAND chips)

OpenWRT

You should flash it from failsafe - to be sure no process writes to flash.

cd /tmp
dd if=/tmp/firmware.trx of=data bs=4194304 count=1
mtd write data kernel
dd if=/tmp/firmware.trx of=data bs=4194304 skip=1
mtd -r write data ubi

OEM Xiaomi firmware

cd /tmp
nvram set flag_try_sys1_failed=1
nvram commit
dd if=/tmp/firmware.trx of=data bs=4194304 count=1
mtd write data kernel1
dd if=/tmp/firmware.trx of=data bs=4194304 skip=1
mtd -r write data rootfs0

Padavan

cd /tmp
nvram set flag_try_sys1_failed=1
nvram commit
mount /tmp -o remount,size=64M
dd if=/tmp/firmware.trx bs=65536 skip=400 of=data
mtd_write write data RWFS
dd if=/tmp/firmware.trx bs=65536 skip=336 count=64 of=data
mtd_write write data Storage
dd if=/tmp/firmware.trx bs=65536 skip=320 count=16 of=data
mtd_write write data Config
dd if=/tmp/firmware.trx bs=65536 count=320 of=data
mtd_write write data Firmware_Stub
reboot -f

You can ignore this error: Image file 'data' is empty!

SPI flash

Nobody reported a problem with SPI flash, so it is probably much easier.

Please open a ticket if you want to help me with that.