Hello
It is very common to reset a device and reconfigure it completely again.
I would like to know if it's possible to make a personalized configuration and then convert this configuration in the default configuration, so when I reset the device continue having my configuration. For example copying "network", "wireless" and other files to another directory, or puting the contents of these files in another files containing the real default configuration.
Or at least to save the personalized configuration on device as Mikrotik do.
Create a custom image either with Image Builder (very easy) or compile your own. I believe the network config is created on the first run (at least I don't see it in /rom/etc/config/ on my router), but you can use uci-defaults scripts as well to customize your image.
I created a script that performs this automatically for Ubuntu, however prior to compiling (either before running the script, or when menuconfig is ran), the user will need to add the buildroot toolchain to their PATH
Hi
Thank you all. I was thinking this was more easy. I'm not an expert on Linux to build my own images.
Anyway I can make a backup file from Luci for every device but... my idea was that when a user reset a router, the router read the default configuration from somewhere ( a file suppose), so if I change the parameters in the file that contains the default configuration, the new data introduced by me in that file will be the new default configuration, till I update the firmware again. I only want to know if this is possible, and how.
There is no file with defaults. OpenWrt has the concept of an overlay filesystem on top of a highly compressed read only filesystem image. There is no way to change this read only image without rebuilding it from scratch.
Compiling LEDE is one of the easiest things, especially if you utilize the script I referenced above.
Ubuntu does not need to be physically installed, but can be ran either as a Live Boot USB or within a VM
The only thing you will need to do is:
Place the toolchain path in your ~/.bashrc's PATH in Ubuntu once the buildroot has been installed
You can do this once the script loads menuconfig
I'm currently working on an improved version of my script which will automate this
Create a folder named files in your buildboot (directory is named source, and treat this (./source/files/) as if it's the root of your router's file system (i.e. /)
For example, your configs at /etc/config on your router will go in the same folder hierarchy within files (i.e. ./source/files/etc/config)
Depending on your processor, and how many packages you select to install within menuconfig, compiling could take an hour or two or half a day.
Package info can be obtained for some packages/options within menuconfig, else you can see details about a package via LEDE's Package Table