[OpenWrt-Devel] Dynamically generate custom files before building?
nam228
nampt282 at gmail.com
Wed Mar 25 20:54:33 EDT 2015
Thank Jo-Philipp Wich for sharing your knowledge.
In my case I'm using Barrier Breaker.
I modified this file :
openwrt/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
Nam.
On 25/03/2015 19:36, Jo-Philipp Wich wrote:
> Hi,
>
> some architectures do not have any default files for wireless and
> network in the repository. Those files are generated by scripts on first
> boot.
>
> The question is raised over and over again in the forums and on the
> lists. The natural solution to your kind of objective is to write an
> (files/)etc/uci-defaults/99_mystuff script which amends/modifies the
> just generated files according to your needs.
>
> This way you also do not need to maintain complete configurations for
> each possible model you intend to cover, especially if the only actual
> delta is a different SSID and setting a PSK.
>
> Apart from that it is also possible to make a wireless config somewhat
> generic by replacing the "option path" or "option macaddr" phy
> identifier with "option phy phy0" - this way it would work across a
> range of different models, assuming they all use mac80211.
>
> The script approach would be something like that:
>
> $ cat files/etc/uci-defaults/99_mysettings
> #!/bin/sh
>
> uci set wireless.radio0.channel=3
> uci del wireless.radio0.disabled
>
> uci set wireless. at wifi-iface[0].ssid="Foo Bar"
> uci set wireless. at wifi-iface[0].encryption=psk2
> uci set wireless. at wifi-iface[0].key="secr3t123"
>
> # do we have a 5ghz radio?
> if uci -q get wireless.radio1 >/dev/null; then
> uci set wireless.radio1.channel=52
> uci del wireless.radio1.disabled
>
> uci set wireless. at wifi-iface[1].ssid="Foo Bar 5"
> uci set wireless. at wifi-iface[1].encryption=psk2
> uci set wireless. at wifi-iface[1].key="secr3t123"
> fi
>
> exit 0
>
>
> etc.
>
> HTH,
> Jow
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list