Re: [OpenWrt-Devel] [PATCH] base-files: add function ucidef_set_interface_raw

2016-03-01 Thread John Crispin


On 29/02/2016 17:25, micke.p...@telldus.se wrote:
> This function can be used to configure default configuration on
> interfaces other
> than lan and wan, such as wlan or other custom interfaces.
> 

Ok in general, but it would be nice if you also sent a patch that adds a
user for the function. could you do that ?

John



> Signed-off-by: Micke Prag 
> ---
>  package/base-files/files/lib/functions/uci-defaults.sh | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/package/base-files/files/lib/functions/uci-defaults.sh
> b/package/base-files/files/lib/functions/uci-defaults.sh
> index 512e0ed..d36ead2 100755
> --- a/package/base-files/files/lib/functions/uci-defaults.sh
> +++ b/package/base-files/files/lib/functions/uci-defaults.sh
> @@ -89,6 +89,12 @@ ucidef_set_interfaces_lan_wan() {
>  json_select ..
>  }
> 
> +ucidef_set_interface_raw() {
> +json_select_object network
> +_ucidef_set_interface "$@"
> +json_select ..
> +}
> +
>  _ucidef_add_switch_port() {
>  # inherited: $num $device $need_tag $role $index $prev_role
>  # inherited: $n_cpu $n_ports $n_vlan $cpu0 $cpu1 $cpu2 $cpu3 $cpu4
> $cpu5
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] base-files: add function ucidef_set_interface_raw

2016-02-29 Thread micke . prag
This function can be used to configure default configuration on 
interfaces other

than lan and wan, such as wlan or other custom interfaces.

Signed-off-by: Micke Prag 
---
 package/base-files/files/lib/functions/uci-defaults.sh | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/package/base-files/files/lib/functions/uci-defaults.sh 
b/package/base-files/files/lib/functions/uci-defaults.sh

index 512e0ed..d36ead2 100755
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -89,6 +89,12 @@ ucidef_set_interfaces_lan_wan() {
json_select ..
 }

+ucidef_set_interface_raw() {
+   json_select_object network
+   _ucidef_set_interface "$@"
+   json_select ..
+}
+
 _ucidef_add_switch_port() {
# inherited: $num $device $need_tag $role $index $prev_role
 	# inherited: $n_cpu $n_ports $n_vlan $cpu0 $cpu1 $cpu2 $cpu3 $cpu4 
$cpu5

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel