[Zrouter-src] ZRouter.org: push to ZRouter boards/D-Link/DAP-1350/files/etc/rc...

zrouter-src at zrouter.org zrouter-src at zrouter.org
Thu Sep 20 12:54:16 UTC 2012


details:   http://zrouter.org/hg/zrouter//rev/04d9060b8b40
changeset: 451:04d9060b8b40
user:      Aleksandr Rybalko <ray at ddteam.net>
date:      Thu Sep 20 15:48:00 2012 +0300
description:
Add DAP-1350 ADAPTATION script.

diffstat:

 boards/D-Link/DAP-1350/files/etc/rc.d/ADAPTATION |  75 ++++++++++++++++++++++++
 1 files changed, 75 insertions(+), 0 deletions(-)

diffs (80 lines):

diff -r 6d906a5894cb -r 04d9060b8b40 boards/D-Link/DAP-1350/files/etc/rc.d/ADAPTATION
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/boards/D-Link/DAP-1350/files/etc/rc.d/ADAPTATION	Thu Sep 20 15:48:00 2012 +0300
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+# PROVIDE: ADAPTATION
+
+. /etc/rc.subr
+. /etc/network.subr
+
+name="ADAPTATION"
+start_cmd="adapt_start"
+start_precmd="adapt_prestart"
+start_postcmd="adapt_poststart"
+stop_cmd="adapt_stop"
+
+adapt_prestart()
+{
+	switchctl /dev/switch0 set vlan 0 vid 1
+	switchctl /dev/switch0 set vlan 0 add 0 u
+	switchctl /dev/switch0 set vlan 0 add 1 u
+	switchctl /dev/switch0 set vlan 0 add 2 u
+	switchctl /dev/switch0 set vlan 0 add 3 u
+	switchctl /dev/switch0 set vlan 0 del 4
+	switchctl /dev/switch0 set vlan 0 add 5 t
+	switchctl /dev/switch0 set vlan 0 add 6 t
+
+	switchctl /dev/switch0 set vlan 1 vid 2
+	switchctl /dev/switch0 set vlan 1 del 0
+	switchctl /dev/switch0 set vlan 1 del 1
+	switchctl /dev/switch0 set vlan 1 del 2
+	switchctl /dev/switch0 set vlan 1 del 3
+	switchctl /dev/switch0 set vlan 1 add 4 u
+	switchctl /dev/switch0 set vlan 1 add 5 t
+	switchctl /dev/switch0 set vlan 1 add 6 t
+
+	switchctl /dev/switch0 set port 0 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 1 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 2 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 3 pvid 1 flags Untag
+	switchctl /dev/switch0 set port 4 pvid 2 flags Untag
+	switchctl /dev/switch0 set port 5 pvid 1 flags Tag
+	switchctl /dev/switch0 set port 6 pvid 1 flags Tag
+
+	gpioctl -f /dev/gpioc0 -c 10 IN II PU INT
+
+	# Import MAC addresses with known names
+	kenv LAN_MAC_ADDR=`kenv ethaddr`
+	kenv WAN_MAC_ADDR=`kenv wanmac`
+
+	ifconfig rt0 up
+	ifconfig vlan1 create vlan 1 vlandev rt0
+	ifconfig vlan1 name lan0
+	ifconfig vlan2 create vlan 2 vlandev rt0
+	ifconfig vlan2 name wan0
+
+	ifconfig lan0 ether `kenv LAN_MAC_ADDR`
+	ifconfig wan0 ether `kenv WAN_MAC_ADDR`
+
+	hostname `kenv HostName`
+
+}
+
+adapt_start()
+{
+}
+
+adapt_poststart()
+{
+}
+
+adapt_stop()
+{
+}
+
+load_rc_config $name
+
+run_rc_command $*
\ No newline at end of file


More information about the Zrouter-src mailing list