#!/bin/sh
# deal with our mounts
-echo "Mounting normal file systems"
+echo "Mounting info file systems"
echo ".... proc"
mkdir /proc > /dev/null 2>&1
mount -t proc proc /proc
mount /tmp > /dev/null 2>&1
-# create out gps0
-echo "Creating serial devices"
-echo ".... gps0"
-ln -s /dev/ttyS0 /dev/gps0
-echo ".... gpspps0"
-mknod -m 0664 /dev/pps0 c 252 0
-ln -s /dev/pps0 /dev/gpspps0
-
# mount the config file system
mkdir /fs > /dev/null 2>&1
echo "Mounting /fs"
cd $RD
fi
+# bring the interface up for a bit
+ifconfig eth0 up
+
# create the interfaces layout
echo "Setting up network interfaces configuration"
echo ".... loopback"
then
echo ".... eth0 - search domain $NET_SEARCH_DOMAIN"
cat << EOF >> /etc/network/interfaces
-gateway $NET_SEARCH_DOMAIN
+dns-search $NET_SEARCH_DOMAIN
EOF
fi
then
echo ".... eth0 - dns servers $NET_DNS_SERVERS"
cat << EOF >> /etc/network/interfaces
-gateway $NET_DNS_SERVERS
+dns-nameservers $NET_DNS_SERVERS
EOF
fi
fi
+
+# create out gps0
+echo "Creating serial devices"
+echo ".... gps0"
+ln -s /dev/ttyS0 /dev/gps0
+
+
+# addatch the pps device
+ldattach pps /dev/ttyS0
+# find the minor/major numbers of the device and create
+if [ -f /sys/class/pps/pps0/dev ]
+then
+ PPSMAJOR=`cat /sys/class/pps/pps0/dev|cut -f1 -d:`
+ PPSMINOR=`cat /sys/class/pps/pps0/dev|cut -f2 -d:`
+ echo ".... pps0"
+ mknod -m 0664 /dev/pps0 c $PPSMAJOR $PPSMINOR
+ echo ".... gpspps0"
+ ln -s /dev/pps0 /dev/gpspps0
+else
+ echo "Cant find pps device?"
+fi
+
+if [ "x$SYSLOG_HOST" != "x" ]
+then
+ syslogd -R $SYSLOG_HOST
+fi
+
+# lastly, work around for thttpd problems
+mv /var/www/thttpd_config /var/www/thttpd_config.orig
+cat > /var/www/thttpd_config << EOF
+dir=/var/www/data
+cgipat=**.cgi
+pidfile=/var/run/thttpd.pid
+logfile=/dev/null
+EOF