OpenWrt Forum Archive

Topic: dump a firmware image

The content of this topic has been archived on 29 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

hi,
I want to dump my Asus WL 500 G premium firmware but I don't find documentation about this.
The firmware in the router is an openwrt-brcm47xx-2.6-squashfs.trx with customs packages and configurations and I want to clone my router in another one.

is it possible ?

There is a manual on WIKI, but it's for fonera and it's doesn't say how to restore those files.

After gaining the SSH access use these commands:

cd /dev/mtdblock
httpd -p 9090

Connect to the Fonera through the private network. Now you can download the mtd partiotions using the addresses:

http://192.168.10.1:9090/0ro
http://192.168.10.1:9090/1ro
http://192.168.10.1:9090/2ro
http://192.168.10.1:9090/3ro
http://192.168.10.1:9090/4ro
http://192.168.10.1:9090/5ro
http://192.168.10.1:9090/6ro
http://192.168.10.1:9090/7ro


dev:     name
mtd0: "RedBoot"
mtd1: "rootfs"
mtd2:  "rootfs1"
mtd3:  "config"
mtd4:  "vmlinux.bin.l7"
mtd5:  "FIS directory"
mtd6:  "RedBoot config"
mtd7:  "board_config"

You probably need to backup Mtd1, Mdt2, mdt4


Dmitry

thanks Dmitry,
but i use the 2.6 version of openwrt and this release don't have /dev/mtdblock directory :S

root@OpenWrt:~# uname -a
Linux OpenWrt 2.6.22 #4 Sat Jul 5 20:57:15 CEST 2008 mips unknown

root@OpenWrt:~# cd /dev

root@OpenWrt:/dev# ls -ial
    174 drwxrwxrwt    4 root     root          720 Jan  1  2000 .
    26 drwxr-xr-x        5 root     root            0 Jul 10 08:02 ..
    176 crw-r--r--        1 root     root       5,   1 Jan  1  2000 console
    311 crw-rw-rw-     1 root     root       1,   7 Jan  1  2000 full
    312 crw-r--r--        1 root     root       1,   2 Jan  1  2000 kmem
    313 crw-r--r--        1 root     root       1,  11 Jan  1  2000 kmsg
    479 srw-rw-rw-     1 root     root            0 Jan  1  2000 log
    314 crw-r--r--        1 root     root       1,   1 Jan  1  2000 mem
    298 crw-r--r--        1 root     root      90,   0 Jan  1  2000 mtd0
    299 crw-r--r--        1 root     root      90,   1 Jan  1  2000 mtd0ro
    300 crw-r--r--        1 root     root      90,   2 Jan  1  2000 mtd1
    301 crw-r--r--        1 root     root      90,   3 Jan  1  2000 mtd1ro
    302 crw-r--r--        1 root     root      90,   4 Jan  1  2000 mtd2
    304 crw-r--r--        1 root     root      90,   5 Jan  1  2000 mtd2ro
    305 crw-r--r--        1 root     root      90,   6 Jan  1  2000 mtd3
    306 crw-r--r--        1 root     root      90,   7 Jan  1  2000 mtd3ro
    307 crw-r--r--        1 root     root      90,   8 Jan  1  2000 mtd4
    308 crw-r--r--        1 root     root      90,   9 Jan  1  2000 mtd4ro
    293 brw-r--r--        1 root     root      31,   0 Jan  1  2000 mtdblock0
    294 brw-r--r--        1 root     root      31,   1 Jan  1  2000 mtdblock1
    295 brw-r--r--        1 root     root      31,   2 Jan  1  2000 mtdblock2
    296 brw-r--r--        1 root     root      31,   3 Jan  1  2000 mtdblock3
    297 brw-r--r--        1 root     root      31,   4 Jan  1  2000 mtdblock4
    315 crw-rw-rw-     1 root     root       1,   3 Jan  1  2000 null
    316 crw-r--r--        1 root     root       1,   4 Jan  1  2000 port
    667 crw-------        1 root     root     108,   0 Jan  1  2000 ppp
    320 crw-rw-rw-     1 root     root       5,   2 Jul 10 08:04 ptmx
      1 drwxr-xr-x        2 root     root            0 Jan  1  2000 pts
    317 crw-r--r--        1 root     root       1,   8 Jan  1  2000 random
    568 lrwxrwxrwx    1 root     root           14 Jan  1  2000 root -> /dev/mtdblock2
    178 drwxr-xr-x     2 root     root           40 Jan  1  2000 shm
    321 crw-rw-rw-    1 root     root       5,   0 Jan  1  2000 tty
    309 crw-rw-rw-    1 root     root       4,  64 Jan  1  2000 ttyS0
    310 crw-rw-rw-    1 root     root       4,  65 Jan  1  2000 ttyS1
    318 crw-r--r--       1 root     root       1,   9 Jan  1  2000 urandom
    319 crw-rw-rw-    1 root     root       1,   5 Jan  1  2000 zero

I found a command to dump the JFFS2 filesystem – basically everything except the bootloader and NVRAM

dd if=/dev/mtdblock/1 of=/tmp/firmware.trx

is it a good solution with an openwrt-brcm47xx-2.6-squashfs.trx firmware without nvran?


so is it possible to dump my image in trx format with bootloader and nvran?

The discussion might have continued from here.