OpenWrt Forum Archive

Topic: How to go from OpenWRT to DD-WRT (or stock) on WZR-HP-G300NH?

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

Hi guys,

I went from stock to dd-wrt to openwrt, but lately my wifi has been crashing a lot. So I'd like to go back to DD-WRT but I'm really afraid of bricking my router.

Can I just use the mtd linux command on the wiki? Because the DD-WRT image file isn't a .trx but a .bin. Do I have to strip the header and then rename to .trx? Do I need to use tftp?

Not sure what to do here and I have read documentation but it is a bit lacking in detail. I've never used TFTP before so if that's necessary, I'd greatly appreciate some clear detailed instructions on how to do so.

Thanks!

UberB wrote:

I went from stock to dd-wrt to openwrt, ...

I am just curious and would appreciate if you can provide information on how did you flash your router from DD-WRT to OpenWRT. Currently, I have an old Linksys WRT54GS v3.1 flashed with DD-WRT Mega firmware and am would like to flash it with a self-built OpenWRT firmware. Since you had done that, it will be easier just to ask how you did it. Thanks.

mazilo wrote:
UberB wrote:

I went from stock to dd-wrt to openwrt, ...

I am just curious and would appreciate if you can provide information on how did you flash your router from DD-WRT to OpenWRT. Currently, I have an old Linksys WRT54GS v3.1 flashed with DD-WRT Mega firmware and am would like to flash it with a self-built OpenWRT firmware. Since you had done that, it will be easier just to ask how you did it. Thanks.

Check the instructions under the WZR-HP-G300NH wiki; I followed them to the letter. Basically you just use SSH and mtd linux.


OK i can give it a try but how would I flash it? I can just use the GUI for this one right? I assume I use the sysupgrade file.

Unfortunately I forgot whether I flashed the squashfs or jffs2 image last time. Is there any way for me to find out which version I have?

(Last edited by UberB on 21 May 2011, 02:18)

UberB wrote:
mazilo wrote:
UberB wrote:

I went from stock to dd-wrt to openwrt, ...

I am just curious and would appreciate if you can provide information on how did you flash your router from DD-WRT to OpenWRT. Currently, I have an old Linksys WRT54GS v3.1 flashed with DD-WRT Mega firmware and am would like to flash it with a self-built OpenWRT firmware. Since you had done that, it will be easier just to ask how you did it. Thanks.

Check the instructions under the WZR-HP-G300NH wiki; I followed them to the letter. Basically you just use SSH and mtd linux.

Thanks.

Update: I think I have found a way to go from OpenWRT to DD-WRT by googling around:

1. Simply download the proper DD-WRT file, i.e. wzr-hp-g300nh-dd-wrt-webupgrade-MULTI.bin
2. Using a hex editor, strip the first 28 bytes so that the file begins with 27 05 19 56
3. Flash using web GUI

Can anyone confirm if this would work? For the record, I downloaded the latest openwrt rc5 bin file and compared the headers; both begin with 27 05 19 56.

UberB wrote:

OK i can give it a try but how would I flash it? I can just use the GUI for this one right? I assume I use the sysupgrade file.

Unfortunately I forgot whether I flashed the squashfs or jffs2 image last time. Is there any way for me to find out which version I have?

It doesn't matter which image you had installed but I suggest that you'd better install the squashfs rootfs. In that case you can always restore default settings by erasing rootfs_data if you mess it up.

sysupgrade -n openwrt-xxxxxxxx-sysupgrade.bin
mtd -r write openwrt-xxxxxxxx-sysupgrade.bin firmware

If you'd like to revert to DD-WRT, just strip 28 bytes DD-WRT header off from wzr-hp-g300nh-dd-wrt-webupgrade-MULTI.bin and override the "firmware" partition.

dd bs=28 skip=1 if=/tmp/wzr-hp-g300nh-dd-wrt-webupgrade-MULTI.bin of=/tmp/firmware.bin
mtd -r write /tmp/firmware.bin firmware

OpenWrt / [HELP needed] WZR-HP-G300NH back to original firmware

fyi wrote:
UberB wrote:

OK i can give it a try but how would I flash it? I can just use the GUI for this one right? I assume I use the sysupgrade file.

Unfortunately I forgot whether I flashed the squashfs or jffs2 image last time. Is there any way for me to find out which version I have?

If you'd like to revert to DD-WRT, just strip 28 bytes DD-WRT header off from wzr-hp-g300nh-dd-wrt-webupgrade-MULTI.bin and override the "firmware" partition.

dd bs=28 skip=1 if=/tmp/wzr-hp-g300nh-dd-wrt-webupgrade-MULTI.bin of=/tmp/firmware.bin
mtd -r write /tmp/firmware.bin firmware

OpenWrt / [HELP needed] WZR-HP-G300NH back to original firmware

I've already done this if you see my post above. Now, is it better for me to use the LuCI GUI or SSH client to flash the firmware?

It depends on where you edit the DD-WRT binary. LuCI GUI calls sysupgrade internally and I think sysupgrade will check the firmware integrity.

dd bs=28 skip=1 if=/tmp/wzr-hp-g300nh-dd-wrt-webupgrade-MULTI.bin of=/tmp/firmware.bin
sysupgrade -n /tmp/firmware.bin

I do not think sysupgrade was meant to write other OS. sysupgrade is shell script, read it to understand what it does and does not.

Read the "Buffalo WZR-HP-G300NH - OpenWrt Wiki" for yourself.

mtd -r write openwrt-ar71xx-wzr-hp-g300nh-squashfs-sysupgrade.bin linux

Why do you think you can directly write OpenWrt sysupgrade binary over DD-WRT linux partition?

OpenWrt / MZK-W04NU with 10.03

(Last edited by fyi on 21 May 2011, 17:47)

fyi wrote:

It depends on where you edit the DD-WRT binary. LuCI GUI calls sysupgrade internally and I think sysupgrade will check the firmware integrity.

dd bs=28 skip=1 if=/tmp/wzr-hp-g300nh-dd-wrt-webupgrade-MULTI.bin of=/tmp/firmware.bin
sysupgrade -n /tmp/firmware.bin

Sorry I don't really understand what you mean by this post. I am certain that I hex edited properly because the dd-wrt bin file now begins with the exact same header as the openwrt image. So now, it should be safe for me to flash via GUI yes?

Yes. In case it doesn't work (I doubt it), the mtd method should work. Something I learn from sysupgrade for Atheros platform is that it switches to ramfs before the upgrade so I think it's safer to upgrade with LuCI GUI or sysupgrade than running the mtd utility directly.

The discussion might have continued from here.