4 echo "Mounting info file systems"
6 mkdir /proc > /dev/null 2>&1
7 mount -t proc proc /proc
8 mkdir /sys > /dev/null 2>&1
10 mount -t sysfs sys /sys
11 mkdir -p /dev/pts > /dev/null 2>&1
13 mount -t devpts devpts /dev/pts
15 mount /tmp > /dev/null 2>&1
18 # mount the config file system
19 mkdir /fs > /dev/null 2>&1
21 mount /dev/sda1 /fs > /dev/null 2>&1
23 echo "Looking for system config"
24 if [ -f /fs/config/system ]
26 echo ".... found - loading"
30 echo "Looking for dropbear config"
31 if [ -f /fs/config/dropbear.tar ]
35 echo ".... found - installing"
36 tar xf /fs/config/dropbear.tar > /dev/null 2>&1
40 # bring the interface up for a bit
43 # create the interfaces layout
44 echo "Setting up network interfaces configuration"
46 cat << EOF > /etc/network/interfaces
48 iface lo inet loopback
52 # create network interfaces bit
53 if [ "x$INTERFACE" == "xdhcp" ]
55 echo ".... eth0 - dhcp"
56 cat << EOF >> /etc/network/interfaces
62 # static network address
63 if [ "x$NET_ADDRESS" != "x" ]
66 echo ".... eth0 - static $NET_ADDRESS - $NET_MASK"
67 cat << EOF >> /etc/network/interfaces
69 iface eth0 inet static
76 if [ "x$NET_GW" != "x" ]
78 echo ".... eth0 - gateway $NET_GW"
79 cat << EOF >> /etc/network/interfaces
85 if [ "x$NET_SEARCH_DOMAIN" != "x" ]
87 echo ".... eth0 - search domain $NET_SEARCH_DOMAIN"
88 cat << EOF >> /etc/network/interfaces
89 dns-search $NET_SEARCH_DOMAIN
94 if [ "x$NET_DNS_SERVERS" != "x" ]
96 echo ".... eth0 - dns servers $NET_DNS_SERVERS"
97 cat << EOF >> /etc/network/interfaces
98 dns-nameservers $NET_DNS_SERVERS
105 echo "Creating serial devices"
107 ln -s /dev/ttyS0 /dev/gps0
110 # addatch the pps device
111 ldattach pps /dev/ttyS0
112 # find the minor/major numbers of the device and create
113 if [ -f /sys/class/pps/pps0/dev ]
115 PPSMAJOR=`cat /sys/class/pps/pps0/dev|cut -f1 -d:`
116 PPSMINOR=`cat /sys/class/pps/pps0/dev|cut -f2 -d:`
118 mknod -m 0664 /dev/pps0 c $PPSMAJOR $PPSMINOR
120 ln -s /dev/pps0 /dev/gpspps0
122 echo "Cant find pps device?"
125 if [ "x$SYSLOG_HOST" != "x" ]
127 syslogd -R $SYSLOG_HOST
130 # lastly, work around for thttpd problems
131 mv /var/www/thttpd_config /var/www/thttpd_config.orig
132 cat > /var/www/thttpd_config << EOF
135 pidfile=/var/run/thttpd.pid