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 # create the interfaces layout
41 echo "Setting up network interfaces configuration"
43 cat << EOF > /etc/network/interfaces
45 iface lo inet loopback
49 # create network interfaces bit
50 if [ "x$INTERFACE" == "xdhcp" ]
52 echo ".... eth0 - dhcp"
53 cat << EOF >> /etc/network/interfaces
59 # static network address
60 if [ "x$NET_ADDRESS" != "x" ]
63 echo ".... eth0 - static $NET_ADDRESS - $NET_MASK"
64 cat << EOF >> /etc/network/interfaces
66 iface eth0 inet static
73 if [ "x$NET_GW" != "x" ]
75 echo ".... eth0 - gateway $NET_GW"
76 cat << EOF >> /etc/network/interfaces
82 if [ "x$NET_SEARCH_DOMAIN" != "x" ]
84 echo ".... eth0 - search domain $NET_SEARCH_DOMAIN"
85 cat << EOF >> /etc/network/interfaces
86 gateway $NET_SEARCH_DOMAIN
91 if [ "x$NET_DNS_SERVERS" != "x" ]
93 echo ".... eth0 - dns servers $NET_DNS_SERVERS"
94 cat << EOF >> /etc/network/interfaces
95 gateway $NET_DNS_SERVERS
102 echo "Creating serial devices"
104 ln -s /dev/ttyS0 /dev/gps0
107 # addatch the pps device
108 ldattach pps /dev/ttyS0
109 # find the minor/major numbers of the device and create
110 if [ -f /sys/class/pps/pps*/dev ]
112 PPSMAJOR=`cat /sys/class/pps/pps*/dev|cut -f1 -d:`
113 PPSMINOR=`cat /sys/class/pps/pps*/dev|cut -f2 -d:`
115 mknod -m 0664 /dev/pps0 c $PPSMAJOR $PPSMINOR
117 ln -s /dev/pps0 /dev/gpspps0
119 echo "Cant find pps device?"
122 if [ "x$SYSLOG_HOST" != "x" ]
124 syslogd -R $SYSLOG_HOST
127 # lastly, work around for thttpd problems
128 mv /var/www/thttpd_config /var/www/thttpd_config.orig
129 cat > /var/www/thttpd_config << EOF
132 pidfile=/var/run/thttpd.pid