aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm53xx
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@openwrt.org>2014-04-23 22:02:18 +0000
committerHauke Mehrtens <hauke@openwrt.org>2014-04-23 22:02:18 +0000
commitdd1c8926c78f75926754b011f328e85dd4fc4e1f (patch)
tree229850f2609605d23e13373731fb6c07f5b287d6 /target/linux/bcm53xx
parent311a83d87982163a818607b64a3f9e225cb3e13d (diff)
downloadupstream-dd1c8926c78f75926754b011f328e85dd4fc4e1f.tar.gz
upstream-dd1c8926c78f75926754b011f328e85dd4fc4e1f.tar.bz2
upstream-dd1c8926c78f75926754b011f328e85dd4fc4e1f.zip
bcm53xx: add default config for switch
This scripts adds a default config for the switch. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40565 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/bcm53xx')
-rw-r--r--target/linux/bcm53xx/base-files.mk3
-rw-r--r--target/linux/bcm53xx/base-files/etc/uci-defaults/02_network21
2 files changed, 24 insertions, 0 deletions
diff --git a/target/linux/bcm53xx/base-files.mk b/target/linux/bcm53xx/base-files.mk
new file mode 100644
index 0000000000..fdd2c714b2
--- /dev/null
+++ b/target/linux/bcm53xx/base-files.mk
@@ -0,0 +1,3 @@
+define Package/base-files/install-target
+ rm -f $(1)/etc/config/network
+endef
diff --git a/target/linux/bcm53xx/base-files/etc/uci-defaults/02_network b/target/linux/bcm53xx/base-files/etc/uci-defaults/02_network
new file mode 100644
index 0000000000..7517d071bb
--- /dev/null
+++ b/target/linux/bcm53xx/base-files/etc/uci-defaults/02_network
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+
+[ -e /etc/config/network ] && exit 0
+
+touch /etc/config/network
+
+. /lib/functions/uci-defaults.sh
+
+ucidef_set_interface_loopback
+
+ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+ucidef_add_switch "switch0" "1" "1"
+ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 5t"
+ucidef_add_switch_vlan "switch0" "2" "4 5t"
+
+uci commit network
+
+exit 0