Pre-configure Wireless Configuration Into Firmware and Automatically Generate Path/Phy Option


One of the coolest features I like about compiling my own firmware is that you can include the configuration files in the firmware, so out of the box the router is setup for how you need it.

My friend and I have almost identical routers from Linksys WRT series and I was going to make a firmware image for them using my pre-configured wireless config. However, our routers have different 'path/phy' options so initially their router's wireless failed to work.

According to the documentation the Phy (path for Mac80211l) is autodetected. With some testing I removed that option from my wireless configuration on my working router and also left it in but with no value to see if it would fill it in for me automatically. Unfortunately it just created a new radio2 below the rest of the config.

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11a'
	option path ''

Is there a way to merge my predefined config leaving the path/phy option blank for it to be automatically generated?

Many thanks


You can try "option phy phy0" instead; that will make it attach to the first wifi radio seen by the system. Alternatively, if the radio macs have the same OUI prefix, you could use a wildcard MAC address instead of option phy / option path:

option macaddr 00:12:17:*:*:*

kind of related to this topic

why my #ls-l sys/class/net says:

lrwxrwxrwx    1 root     root             0 Jan  1  1970 eth0 -> ../../devices/platform/ag71xx.1/net/eth0
lrwxrwxrwx    1 root     root             0 Jan  1  1970 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx    1 root     root             0 Aug 16 07:53 wlan0 -> ../../devices/platform/ar933x_wmac/net/wlan0

while #wifi status

	"radio1": {
		"up": true,
		"pending": false,
		"autostart": true,
		"disabled": false,
		"retry_setup_failed": true,
		"config": {
			"channel": "11",
			"hwmode": "11g",
			"path": "platform\/ar933s_wmac",
			"htmode": "HT20",
			"disabled": false
		"interfaces": [
				"section": "default_radio1",
				"config": {
					"mode": "ap",
					"ssid": "OpenWrt",
					"encryption": "psk2",
					"key": 'XXXXXXXXXX",
					"network": [
					"mode": "ap"

like my etc/config/wireless

config wifi-device 'radio1'
        option type 'mac80211'
        option channel '11'
        option hwmode '11g'
        option path 'platform/ar933x_wmac'
        option htmode 'HT20'
        option disabled '0'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'psk2'
        option key 'XXXXXXXX'

I am referring to the device path


that in wireless config is just 'platform/ar933x_wmac'

any clue ?

openwrt 18.06.1