[OpenWrt-Devel] Setting uci defaults in trunk
micke.prag at telldus.se
micke.prag at telldus.se
Fri Feb 26 09:27:01 EST 2016
Hi
I have a board config for a device that I am about to commit to
OpenWRT. I am rebasing my work against trunk but some things have
changed since I made the config. My code was written against r46120 but
somethings doesn't work on r48800.
My question is how I should update my code to "proper OpenWRT
standard"?
First, network.
The board has only one network port (it is not a router). This should
be configured using DHCP. The board also has Wifi and should be
configured as a client but disabled as default.
In -r46120 I put this in /etc/uci-defaults/02_network:
ucidef_set_interface_raw "lan" "eth0" "dhcp"
ucidef_set_interface_raw "wlan" "wlan0" "dhcp"
uci batch <<EOF
set network.lan.hostname='TellStick-ZNet-Lite'
set wireless.radio0.disabled=0
set wireless. at wifi-iface[0].network='wlan'
set wireless. at wifi-iface[0].mode='sta'
set wireless. at wifi-iface[0].encryption=psk2
EOF
uci commit wireless
In r48800 this file seems to have been replaced by
/etc/board.d/02_network instead. Unfortunately "raw" uci commands does
not work since its generating /etc/board.json instead? Am I correct?
If I do this then "dhcp" is ignored and the interface is set to static
anyway:
ucidef_set_interface_lan "eth0" "dhcp"
How to convert the wireless and the hostname I have no idea?
Next is led. I had this in /etc/uci-defaults/02_network:
ucidef_set_led_netdev "lan_act" "LANACT" "tellstick:green:lan" "eth0"
ucidef_set_led_netdev "lan_link" "LANLINK" "tellstick:orange:lan"
"eth0"
uci set system.led_lan_act.mode='tx rx'
uci set system.led_lan_link.mode='link'
The first two lines work in r48800 but how do I convert the last two
lines? How do I set the mode?
The cpu is an AR9331 and the platform is ar71xx.
Regards
Micke
_______________________________________________
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