Reply
isg
Posts: 9
Registered: ‎01-23-2018

Success in installing DD-WRT or OpenWRT to WRT32X without using a USB to TTY cable

Background on Discovery Process

I spent some time trying to install DD-WRT and the most current version of Open-WRT but was not having luck.  Like most everyone else, I opted for not opening my WRT32X unit and use the USB to TTL cable.  Like others, I ran into similar problems where I would receive an "invalid firmware" type of message while upgrading from GUI or using the sysupgrade command from a secure shell session.  

 

Next, I took the plunge to open up my unit and started to tinker around with upgrading using a USB to TTL cable.  This resulted in a little progress where I TFTP’d a factory-to-ddwrt.bin image to one of the boot partitions while in the stock U-Boot (Venom).  However, like other’s I found my unit stuck at booting to the dd-wrt partition.  The console session using my USB to TTL cable showed no progress after [    1.452727] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.  So I decided to put away my little pet project for a couple of months until I had some more free time and desire to pursue it again.

 

Subsequently, after I picked it back up and read through boards where there was some progress made by individuals, I decided to dig back into it.  I even nand erased my chip and tested older versions of U-Boot.  During this time, while using an older version of U-Boot (boot logo showing Marvell), I successfully managed to TFTP from U-Boot a DD-WRT factory image that booted without any issues.  Frustrated at this whole process and discovery, I diff’d the older Marvell U-Boot and stock Venom U-Boot environment variables and noted one significant difference.  It appears that the stock uboot209.bin has an environment variable "silent=1" that prevents the Linux kernel from continuing to load.  You get stuck at VFS: Mounted root (squashfs filesystem) readonly on device 254:0. 

 

After removing the "silent" environment variable altogether, the WRT32X will now boot successfully into DD-WRT.  I believe there is a bug with Venom version of U-Boot that prevents Linux kernel from completing the boot process.  The "silent" environment variable is used to suppress console messages after the initial bootstrap takes place.  Interestingly, in my testing using some stock Rango images with no "silent" environment variable set, you are automatically logged directly into the Rango’s version of Open-WRT as root (no password appears to be set and thus a security risk).

 

Coincidentally, during the months that had passed since my original attempts to upgrade, I believe the DD-WRT team has been releasing factory-to-ddwrt.bin images that can successfully be installed using secure shell to WRT32X units with stock Rango images.  The benefit is that there is now no need to manually modify partition tables in the U-Boot environment variables in order to upgrade to DD-WRT or OpenWRT.  Here is the process:  

 

Prerequisites Files

    1.    https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html (download to Windows Putty SSH client)

    2.    https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2018/05-23-2018-r36006/linksys-wrt32x/FW_WRT32... (factory to DD-WRT image)

    3.    https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa9/openwrt-mvebu-cortexa9-linksys-wrt32x... (factory to OpenWRT image)

 

High Level Upgrade Process

    1.    SSH/Putty into stock WRT32X unit

    2.    Remove the "silent" environment variable 

    3.    SCP the current factory-to-ddwrt.bin to the WRT32x

    4.    Optional: Select boot_partition that you want to perform the upgrade to

    5.    Issue sysupgrade command

    6.    Reboot

 

Sample Commands to Upgrade

    1.    ssh root@192.168.1.1 (router’s ip address)

    2.    cd  (change working directory to root’s home directory)

    3.    fw_printenv silent (view current setting of silent environment variable)

    4.    fw_setenv silent (remove value from silent environment variable)

    5.    fw_printenv silent (validate current setting of silent environment variable is not set)

    6.    scp XXXXX@192.168.1.254:/private/tftpboot/FW_WRT32X_1.0.666_DDWRT.img FW_WRT32X_1.0.666_DDWRT.img (copy a current factory-to-ddwrt.bin; note this is the correct .IMG file that sysupgrade requires)

    7.    fw_printenv boot_part (validate the partition you want to upgrade; if boot_part=1 dd-wrt will install on boot_part=2; if boot_part=2 dd-wrt will install on boot_part=1) 

    8.    Optional: fw_setenv boot_part 2 (this will allow sysupgrade to install dd-wrt on the primary partition boot_part=1)

    9.    sysupgrade -i -n -v FW_WRT32X_1.0.666_DDWRT.img (-i is interactive; -n is do not save current configuration; -v is verbose mode)

    10.    Reboot when prompted

 

This same process can be used to upgrade to OpenWRT 18.06. I haven’t had any success in performing a clean sysupgrade from stock Rango to OpenWRT 17.01.  I haven’t tried to downgrade from 18.06 to 17.01 since 18.06 has been remarkably stable for me. 

 

I have successfully installed DD-WRT and OpenWRT 18.06 on separate partitions and am switching back and forth using "ubootenv set boot_part" (dd-wrt) and "fw_setenv boot_part" (OpenWRT).  I have successfully been able to go back to the Rango stock firmware as well. 

 

Good luck if you decide to try this out.

 

Sample Output of Upgrade Proces

macbook:~ XXXXX$ ssh root@192.168.1.1

The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.

RSA key fingerprint is SHA256:/s/2f/C/Qju32c2/V8QEm3qNPxWEkQ4UjCUUdqIY2dE.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.1.1' (RSA) to the list of known hosts.

root@192.168.1.1's password: 

 

 

BusyBox v1.24.2 () built-in shell (ash)

 

  _______                     ________        __

 |       |.-----.-----.-----.|  |  |  |.----.|  |_

 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|

 |_______||   __|_____|__|__||________||__|  |____|

          |__| W I R E L E S S   F R E E D O M

 -----------------------------------------------------

 DESIGNATED DRIVER (Bleeding Edge, 50108)

 -----------------------------------------------------

  * 2 oz. Orange Juice         Combine all juices in a

  * 2 oz. Pineapple Juice      tall glass filled with

  * 2 oz. Grapefruit Juice     ice, stir well.

  * 2 oz. Cranberry Juice

 -----------------------------------------------------

root@OpenWrt:~# cd 

root@OpenWrt:~# pwd

/root

root@OpenWrt:~# fw_printenv silent

silent=1

root@OpenWrt:~# fw_setenv silent

root@OpenWrt:~# fw_printenv silent

## Error: "silent" not defined

root@OpenWrt:~# scp XXXXX@192.168.1.254:/private/tftpboot/FW_WRT32X_1.0.666_DDWRT.img FW_WRT32X_1.0.666_DDWRT.img

 

Host '192.168.1.254' is not in the trusted hosts file.

(ssh-rsa fingerprint md5 92:82:67:3d:3a:f7:7a:ea:39:ec:84:79:08:61:33:84)

Do you want to continue connecting? (y/n) y

XXXXX@192.168.1.254's password: 

FW_WRT32X_1.0.666_DDWRT.img                                   100%   30MB  15.0MB/s   00:02    

root@OpenWrt:~# fw_printenv boot_part

boot_part=1

root@OpenWrt:~# sysupgrade -i -n -v FW_WRT32X_1.0.666_DDWRT.img 

Keep config files over reflash (y/N): N

killall: watchdog: no process killed

Sending TERM to remaining processes ... logd rpcd netifd odhcpd crond siproxd uhttpd dnsmasq S80pppoe-detect pppoe-discovery ubusd 

Sending KILL to remaining processes ... 

Switching to ramdisk...

Performing system upgrade...

Unlocking kernel2 ...

 

Writing from <stdin> to kernel2 ...     

UBI device number 1, total 960 LEBs (121896960 bytes, 116.2 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)

Volume ID 0, size 231 LEBs (29331456 bytes, 28.0 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs", alignment 1

Set volume size to 86978560

Volume ID 1, size 685 LEBs (86978560 bytes, 82.9 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs_data", alignment 1

sysupgrade successful

isg
Posts: 9
Registered: ‎01-23-2018

Re: Success in installing DD-WRT or OpenWRT to WRT32X without using a USB to TTY cable

Quick note: I mistakenly wrote Rango rather than Venom. In all my testing I used the stock WRT32X Venom image directly from Linksys, not the WRT3200ACM Rango stock image.
Posts: 7
Registered: ‎10-08-2017

Re: Success in installing DD-WRT or OpenWRT to WRT32X without using a USB to TTY cable

i can assert tthat this process works for dd-wrt.

 

question for linksys and anyone else: is there a factory image that can be flashed to mtd ?

 

once on dd-wrt, i cannot get back to factory firmware. dd-wrt only takes a hdr0 image. the 'factory' image downloadable from the linksys product page is an openwrt sysupgrade image. -t is rejected by dd-wrt, and when flashed to mtd5 or mtd7, it is not recognized as a valid kernel (which it's not).

 

 

Expert
Posts: 14,387
Registered: ‎01-18-2013

Re: Success in installing DD-WRT or OpenWRT to WRT32X without using a USB to TTY cable


@ghoffman1 wrote:

i can assert tthat this process works for dd-wrt.

 

question for linksys and anyone else: is there a factory image that can be flashed to mtd ?

 

once on dd-wrt, i cannot get back to factory firmware. dd-wrt only takes a hdr0 image. the 'factory' image downloadable from the linksys product page is an openwrt sysupgrade image. -t is rejected by dd-wrt, and when flashed to mtd5 or mtd7, it is not recognized as a valid kernel (which it's not).

 

 


Sorry there is no publicly available WRT32x firmware that can be loaded via u-boot or direct mtd flash.


Smiley Wink Please remember to Kudo those that help you.

Linksys
Communities Technical Support
isg
Posts: 9
Registered: ‎01-23-2018

Re: Success in installing DD-WRT or OpenWRT to WRT32X without using a USB to TTY cable

[ Edited ]

I have been successfully using the following Linksys firmware to tftp flash from U-boot.   1.0.170919.nonjenkins-inteliboy-1619  

I believe this was posted in one of the January threads and since has been taken down.  This is the only Linksys released firmware that seems to work in this capacity, which is why I've been keeping a copy of it.  From this firmware it is possible to upgrade or downgrade to any of the other stock WRT32X images.

 

Posts: 7
Registered: ‎10-08-2017

Re: Success in installing DD-WRT or OpenWRT to WRT32X without using a USB to TTY cable

[ Edited ]

@isg - thank you.

gotta love serial. i'll search my collection. 

Posts: 1
Registered: ‎06-14-2018

Re: Success in installing DD-WRT or OpenWRT to WRT32X without using a USB to TTY cable

will this process work for WRT3200ACM-RM2?

Posts: 1
Registered: ‎07-05-2018

Re: Success in installing DD-WRT or OpenWRT to WRT32X without using a USB to TTY cable

Does someone have a solution for my problem?

 

key.PNG

isg
Posts: 9
Registered: ‎01-23-2018

Re: Success in installing DD-WRT or OpenWRT to WRT32X without using a USB to TTY cable

Hi,

 

A couple of better options for you are available.  

  1. Instead of using SCP to copy the file from your computer to your WRT32X. While you are in an SSH session on your WRT32X download the file directly to the WRT32X using this WGET.  The command is
    wget https://downloads.openwrt.org/snapshots/targets/mvebu/cortexa9/openwrt-mvebu-cortexa9-linksys-wrt32x...
  2. If I'm not mistaken, but I believe default Venom GUI will allow you to directly upgrade your unit using factory.img file listed above.  Since the last several weeks there has been significant upgrades both on the OpenWRT and DD-WRT side regarding the initial upgrade process through the GUI.  I believe I was successful in my latest attempt.  Perhaps someone else could verify this.

 

Posts: 15
Registered: ‎07-06-2018

Re: Success in installing DD-WRT or OpenWRT to WRT32X without using a USB to TTY cable

None of this is needed anymore just flash OpenWrt 18.06 right from the WRT32X web page with davidc502's build:

https://davidc502sis.dynamic-dns.net/releases/