Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been playing with the OpenWRT Attitude Adjustment trunk on my TL-MR3020 lately, and since I'm modifying some of the included packages that get installed via feeds, I need to reflash the firmware a lot. And the problem here is that it's very time consuming. I'd like to optimize this process as much as possible, and the first optimization I can come up with is precluding any need for network reconfiguration after reflashing.

Currently, after I use mtd to reflash my firmware, I have to log in via the serial console and modify /etc/config/network to put the router on the right subnet, and to specify the gateway and dns. It sure would make a lot of sense if I could have this happen automatically every time.

I'm very new to Linux, so my first thought was to have a shell script run that edits /etc/config/wireless/ and then does a /etc/init.d/network restart to bring up the network interface(s). Then I thought that there must be a command-line equivalent to setting the gateway and dns, and then I could follow those commands up with /etc/init.d/network restart.

How would you all approach this problem? Am I on the right track?

share|improve this question

One possible answer that just dawned on me is that I could modify /etc/sysupgrade.conf' and enter in all of the files and directories that I want to preserve, and then use thesysupgrade` command to flash the sysupgrade-specific build.

That said, I would still like to have a way to flash a router from scratch and have the proper /etc/config/network settings, so my original question technically stands.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .