Monday, July 18, 2011

Upgrade DD-WRT and Keep Installed Applications

The DD-WRT support for these new 11N Gigabit routers are still in early stage with new builds rolling out every one to two weeks. The old good "if its not broken then don't fix it" rule might not apply here and I suggest to stay with latest release if you have the time(and guts).
Upgrading a DD-WRT firmware with loaded software is pretty easy, considering the extra work we've done. Take the trouble not to mess with important system folders like /lib /usr and /bin and now its the reward time.

Once again, this is why I use OpenWRT. Flashing an update doesn't nuke your whole install or require extra steps. Just flash, and finished.

  1. Stop installed software
    Log in the router, rename the /mnt/optware.enable
    mv /mnt/optware.enable /mnt/optware.disable

    Then reboot the router.
    After rebooting, the router is back to standard DD-WRT with no extra load and ready for flashing.

  2. Upgrade firmware
    Get the new DD-WRT build, the name should be wzr-hp-g300nh-dd-wrt-webupgrade-MULTI.bin. Some suggests a hard reset before and after upgrading but I usually just select "Reset to Default Settings" during flash.

    firmware-reset-to-default

    After flashing, all settings will be erased and then you have to start over again.

  3. Set the router
    Set the router as usual. Here is a quick list for additional setup, all are covered in other posts, I just put these together for easy reference.

    Enable SSH and USB Support. Software Install, Step 2.
    Customized startup script. Software Install, Step 7.
    Disable built-in FTP server (should be off by default). FTP Server, Step 1.

    After that, reboot the router.

  4. Update writable /etc and re-enable installed apps
    After reboot, login the router and run:

    cp -a /etc/* /mnt/etc/
    mv /mnt/optware.disable  /mnt/optware.enable

    The first line is very important. It's for synchronizing our the customized /etc folder with the new firmware's /etc folder. Forget to do so will break the web management interface!

    Somewhat modified, the files in /etc folder are only added (like /etc/TZ) or dynamically updated (the adduser script), so it's safe to overwrite the /etc folder with new contents and all our work is kept intact. After that, reboot the router, and you should have a new DD-WRT with all previously installed software running.

  5. Fix the broken web interface
    You'll get this error ONLY if you forget to update the /etc folder, see Step 4 above. If this ever happens:

    SSH or telnet login the router, run

    mv /mnt/optware.enable /mnt/optware.disable
    reboot

    The web interface should be back after rebooting, then follow Step 4.

    If the web interface is messed and you can't login from PuTTY, unplug the USB disk and power cycle the router. Then manually mount the USB disk (software install post, steps 2 and 6) and update /etc folder following Step 4.

0 comments:

Post a Comment