Index: clfs/rc.d/init.d/bcm47xx-switch
===================================================================
--- clfs/rc.d/init.d/bcm47xx-switch	(revision 73ee2a6d691c4c1c3cdb9e0cad82235e75ed7ab9)
+++ clfs/rc.d/init.d/bcm47xx-switch	(revision 73ee2a6d691c4c1c3cdb9e0cad82235e75ed7ab9)
@@ -0,0 +1,74 @@
+#!/bin/ash
+#
+# Broadcom 47xx vlan and switch configuration init script
+#
+# Config: uses the 'nvram' settings for setting up vlan devices
+
+. /etc/rc.d/init.d/functions
+
+if [ ! -x /sbin/robocfg ]; then
+	echo -n "Setting up vlan: /sbin/robocfg not found "
+	false
+	check_status
+fi
+
+if [ ! -x /sbin/vconfig ]; then
+	echo -n "Setting up vlan: /sbin/vconfig not found "
+	false
+	check_status
+fi
+
+if [ ! -x /sbin/nvram ]; then
+	echo -n "Setting up vlan: /sbin/nvram not found "
+	false
+	check_status
+fi
+
+case "$1" in
+start)
+
+	# Add a specific workaround for the case of weirdly set wireless mac address
+	# Do what openwrt is doing, and increment the last hex with 2
+	if [ "`nvram get il0macaddr`" = 00:90:4c:5f:00:2a ]; then
+		et0="$(nvram get et0macaddr)"
+		prefix="$(echo $et0 | sed -e 's/:..$//')"
+		addendum=$(( (0x$(echo $et0 | sed -e s/.*://g) + 2) % 256 ))
+		il0=$(printf %s:%02x $prefix $addendum)
+		echo -n "Fixing up wlan0 mac address: "
+		nvram set il0macaddr=$il0 && nvram commit
+		check_status
+		ifconfig wlan0 hw ether $il0 2>/dev/null
+	fi
+
+	# eth0 has to be up for this
+	ifconfig eth0 up
+
+	robocfg switch disable
+	robocfg vlans enable reset
+
+	nvram show | grep vlan[0-4]ports= | sed -e s/vlan// -e s/ports=/\ / |
+	  while read vlan ports; do
+		echo -n "Bringing up eth0.${vlan}: "
+		robocfg vlan ${vlan} ports "${ports}" &&
+		vconfig add eth0 $vlan
+		check_status
+	done
+	robocfg switch enable
+	exit 0
+	;;
+stop)
+	# FIXME: Should we really do something at shutdown?
+	exit 0
+	;;
+restart)
+	$0 stop
+	$0 start
+	;;
+status)
+	robocfg show
+	;;
+*)
+	echo "Usage: $0 {start|stop|restart|status}"
+	exit 1
+esac
+
Index: clfs/rc.d/init.d/bridge
===================================================================
--- clfs/rc.d/init.d/bridge	(revision 73ee2a6d691c4c1c3cdb9e0cad82235e75ed7ab9)
+++ clfs/rc.d/init.d/bridge	(revision 73ee2a6d691c4c1c3cdb9e0cad82235e75ed7ab9)
@@ -0,0 +1,59 @@
+#!/bin/ash
+#
+# Network interface(s) init script
+#
+# config: /etc/network.conf
+#	 /etc/network.d/interface.[devname]
+
+. /etc/rc.d/init.d/functions
+. /etc/network.conf
+
+if [ "$NETWORKING" != "yes" ] || [ "${BRIDGE_INTERFACES}" = "" ]; then
+	exit 0
+fi
+
+if [ ! -x /usr/sbin/brctl ]; then
+	echo -n "Setting up bridge: /usr/sbin/brctl not found "
+	false
+	check_status
+fi
+
+case "$1" in
+start)
+	echo -n "Adding bridge br0: "
+	brctl addbr br0
+	check_status
+
+	for n in ${BRIDGE_INTERFACES}; do
+		echo -n "Adding ${n} to bridge: "
+		brctl addif br0 ${n}
+		# Bring up the interface unless its wireless
+		# Wireless has to be configured before you can put it up
+		if [ $? = 0 ] && [ ${n} != wlan0 ]; then ifconfig ${n} up; fi
+		check_status
+	done
+	;;
+stop)
+	for n in ${BRIDGE_INTERFACES}; do
+		echo -n "Removing ${n} from bridge br0: "
+		ifconfig ${n} down 2>/dev/null
+		brctl delif br0 ${n}
+		check_status
+	done
+	echo -n "Removing bridge br0: "
+	ifconfig br0 down 2>/dev/null
+	brctl delbr br0
+	check_status
+	;;
+restart)
+	$0 stop
+	$0 start
+	;;
+status)
+	brctl show
+	;;
+*)
+	echo "Usage: $0 {start|stop|restart|status}"
+	exit 1
+esac
+
Index: clfs/rc.d/init.d/hostapd
===================================================================
--- clfs/rc.d/init.d/hostapd	(revision 73ee2a6d691c4c1c3cdb9e0cad82235e75ed7ab9)
+++ clfs/rc.d/init.d/hostapd	(revision 73ee2a6d691c4c1c3cdb9e0cad82235e75ed7ab9)
@@ -0,0 +1,53 @@
+#!/bin/ash
+
+# Hostapd Startup Script
+#
+
+. /etc/rc.d/init.d/functions
+
+PIDFILE=/var/run/hostapd.pid
+
+if [ ! -x /usr/sbin/hostapd ]; then
+	echo -n "Starting hostapd: /usr/sbin/hostapd not found "
+	false
+	check_status
+	exit 0
+fi
+
+if [ ! -f /etc/hostapd.conf ]; then
+	echo -n "Starting hostapd: /etc/hostapd.conf not found "
+	false
+	check_status
+	exit 0
+fi
+
+case "$1" in
+start)
+	echo -n "Starting hostapd: "
+	hostapd -P "$PIDFILE" -B /etc/hostapd.conf
+	check_status
+	;;
+stop)
+	if [ -r "$PIDFILE" ]; then
+		echo -n "Stopping hostapd: "
+		kill `cat "$PIDFILE"`
+		check_status
+	else
+		echo "Service hostapd not running."
+	fi
+	;;
+restart)
+	$0 stop
+	$0 start
+	;;
+status)
+	if [ -r "$PIDFILE" ]; then
+		echo "Service hostapd running (PID $(cat "$PIDFILE"))."
+	else
+		echo "Service hostapd not running."
+	fi
+	;;
+*)
+	echo "Usage: $0 {start|stop|restart|status}"
+	exit 1
+esac
