aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2014-01-23 11:33:41 +0000
committerLuka Perkov <luka@openwrt.org>2014-01-23 11:33:41 +0000
commit79679bce5328df10c1fb01b9f4ef67e3ad565afb (patch)
tree83d4ac603d0b39f2a0bd5e91750cd59d8c374347
parent52fafbe70bb329cb3a7a4d74646145f81e032814 (diff)
downloadmaster-187ad058-79679bce5328df10c1fb01b9f4ef67e3ad565afb.tar.gz
master-187ad058-79679bce5328df10c1fb01b9f4ef67e3ad565afb.tar.bz2
master-187ad058-79679bce5328df10c1fb01b9f4ef67e3ad565afb.zip
[package] base-files: add ucidef_add_switch_port function
Signed-off-by: Luka Perkov <luka@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39372 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/base-files/Makefile2
-rw-r--r--package/base-files/files/lib/functions/uci-defaults.sh10
2 files changed, 11 insertions, 1 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index d6c59384ee..33c0c5b24d 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk
PKG_NAME:=base-files
-PKG_RELEASE:=150
+PKG_RELEASE:=151
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_BUILD_DEPENDS:=opkg/host
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh
index bf6fe1e305..da2093bbb7 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -234,3 +234,13 @@ set network.@switch_vlan[-1].ports='$ports'
EOF
}
+ucidef_add_switch_port() {
+ local device=$1
+ local port=$2
+ uci batch <<EOF
+add network switch_port
+set network.@switch_port[-1].device='$device'
+set network.@switch_port[-1].port='$port'
+EOF
+}
+