Good day folks!
I have quite of a dilemma in creating custom configuration when compiling or generating a custom image for OpenWrt. What I want to do is customize the default '/etc/config/wireless' file during the building process, and from the docs, this is done by adding the custom wireless config to 'files/etc/config/wireless', no problems there, it works.
Here's the problem, when I create the wireless config, say with the following in it:
config wifi-device radio0
option type mac80211
option channel 11
option macaddr [b]00:11:22:33:44:55[/b]
option hwmode 11ng
option htmode HT20
config wifi-iface
option device radio0
option network wifi
option mode ap
option ssid 'MySSID'
option encryption none
then compile/build/generate the image, and flash it to a router whose MAC address is 00:00:00:00:00:11 (i.e its different from the mac addr in the config file) things get messy, after flashing, and checking on the '/etc/config/wireless' file, this is what it would have:
config wifi-device radio0
option type mac80211
option channel 11
option macaddr [b]00:11:22:33:44:55[/b]
option hwmode 11ng
option htmode HT20
config wifi-iface
option device radio0
option network wifi
option mode ap
option ssid 'MySSID'
option encryption none
config wifi-device radio1
option type mac80211
option channel 11
option macaddr [b]00:00:00:00:00:11[/b]
option hwmode 11ng
option htmode HT20
# REMOVE THIS LINE TO ENABLE WIFI:
option disabled 0
config wifi-iface
option device [b]radio1[/b]
option network lan
option mode ap
option ssid 'OpenWrt'
option encryption none
If you notice, what happens is that, the installation appends the correct and default configuration for wireless. And this messes up the configuration, which would need me to ssh the router and manually edit the config (or thru LuCI) w/c is time consuming.
My ultimate goal is to set the ssid (to my own, say 'MySSID') and have the wireless enabled directly after flashing. Is there any other way to set the default template for the generation of the wireless config? (I was thinking that there was a template in the source code, that the compiler would consult).
Thanks!