Cloning OpenWrt

OpenWrt is very versatile and very modular. For that reason, OpenWrt setups can be hard to replicate. While configurations are easy to export and import, the packages present on the source system may or may not be present on the targetĀ  system. To get around this, we can use a two-step process described below.

Step One: get a list of packages installed on the source system. Log in to the source system and run the following from the command line:

opkg list-installed | awk '{ printf "%s ",$1 }' && echo

This will generate a list of packages installed on the system in one big blob of text. The echo command will make sire that this blob ends in a line break (otherwise, the command prompt will appear right after the package list). Anyway, copy that blob into your computer’s clipboard or a text file

Step Two: get prepackaged firmware for the target system. Go to OpenWrt Firmware Selector:

Find your target system in the list (for example, if you need firmware for an x86 system, start typing x86 into the selection line and see what falls out). When you found your system, click on its name. In the window that opens, click on Customize installed packages. This will open a textbox with a list of packages in it. Replace that list with the oneĀ  you generated in Step One, click on Request Build, wait for the firmware to be compiled, and when it’s ready, download it and install it on your target system.

If the target system already has a base OpenWrt system running, you can do an alternative Step Two: simply feed the list of packages you generated in Step One to opkg on your target system:

opkg update && opkg install [paste the list here]

After that, you can import configuration exported from the source system.

Leave a Reply

Your email address will not be published. Required fields are marked *