#!/bin/sh

if [ -e /etc/rc.d/rcS_custom ]; then
    /etc/rc.d/rcS_custom
    exit 0
fi

mount -a
mount -o remount +w /
mount -t tmpfs tmpfs /tmp -o size=128k
if [ -f /lib/modules/`uname -r`/net/ae531x.o ]; then
insmod ae531x
else
insmod acacia.o
fi

if [ -f /lib/modules/`uname -r`/misc/ar531xgpio.o ]; then
insmod ar531xgpio
fi

if [ -f /lib/modules/`uname -r`/misc/ar531x-wdt.o ]; then
insmod ar531x-wdt
if [ -x /sbin/watchdog ]; then
	/sbin/watchdog /dev/watchdog
fi
fi

if [ -x /etc/wlan/ap_service ]; then
	/etc/wlan/ap_service start
fi

telnetd

if [ -x /sbin/syslogd ]; then
	/sbin/syslogd
fi
