OpenWrt Forum Archive

Topic: Build OpenWRT image with predefined config files

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.

First of all sorry for possible mistakes in my English. It's not a native language for me smile

Every time I flash new router I have to configure all the applications I install in it. I would like to have a firmware which includes my custom config files in /etc folder.
How can I build such an OpenWRT image? Approach to copy config files via ssh to each router is too effortful for me in this case.

Thanks in advance.

The answer should be in the wiki (it definitely is in this forum)

Just place the required files at <buildroot>/files directory, and they will get copied to the router firmware. E.g. config files to be placed in /etc/config need to be located at <buildroot>/files/etc/config

http://wiki.openwrt.org/doc/howto/build#custom.files

hnyman wrote:

Just place the required files at <buildroot>/files directory, and they will get copied to the router firmware. E.g. config files to be placed in /etc/config need to be located at <buildroot>/files/etc/config

http://wiki.openwrt.org/doc/howto/build#custom.files

Thanks for quick and object answer!

Maybe you can use block-extroot to mount your usb device as /.
Sorry for my poor English too.HAHA

Hi, this thread is very interesting. I have a more challenging goal. I want to build an image with a custom package made by me. The package is basically a program which is waiting by some specific requests. Thus, I need to configure in some way the OpenWRT to automatically run the program at the boot process.

How can I build a custom image with a configuration to run a scritp/program at the boot process?

is it possible to pivot root or is it possible to setup a script to run the first time thge system is booted to accomplish this?

is it possible to load a list of packages instead of adding them manually in menuconifg?

If you use Image Builder instead of compiling you can list the packages you want installed (or removed) in the command line (or shell script).

Awesome ... ended up scripting it so it would read from a file for the package names ... compiling now crossing fingers lOL

The discussion might have continued from here.