I want to modify the firstboot configuration, so that when I factory reset my device, my configuration prevails. Now, after some reading, it feels like uci-defaults is the way to go, however I got a bit confused as to how I may implemment this.
I have a script that turns my device into a dumb-ap, and this is what I want my firstboot config to be. The script is as follows:
#!/bin/sh
#dhcp settings
uci set dhcp.lan.ignore='1'
uci commit dhcp
#firewall settings
uci del firewall.cfg02dc81.network
uci add_list firewall.cfg02dc81.network='lan'
uci del firewall.cfg03dc81.network
uci add_list firewall.cfg03dc81.network='wan6'
uci commit firewall
#network settings
uci del network.wan
uci add_list network.cfg030f15.ports='eth0'
uci del network.lan.ipaddr
uci del network.lan.netmask
uci set network.lan.proto='dhcp'
uci commit network
/etc/init.d/network restart
exit0
My first question is, where do I place this script in order for it to be ran after every firstboot? is it in /rom/etc/uci-defaults? or /etc/uci-defaults?
The name of the file needs to be 99_whatever_i_want.sh right?
Am I missing anything else in order to obtain my desired result?
You can omit the uci commit commands since that will be done automatically at the end of the firstboot. Restarting the network is probably unnecessary at that point also.
Hey, I don't know if this is the default behavior, but every time i reboot my device, it returns to the configs set by the uci-default script we discussed previously...
Is this supposed to happen?