summaryrefslogtreecommitdiffstats
path: root/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d')
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K70sendsig1
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K80netfs1
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K85network11
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K90localfs1
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S00mountvirtfs76
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S01hotplug14
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S02hostname47
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S08syslog24
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S09klog16
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S10modules-init21
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S20network11
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S41inetd16
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S42httpd16
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S43ntp27
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S49netfs11
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S90firstboot21
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/rcK6
-rwxr-xr-xtarget/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/rcS11
18 files changed, 331 insertions, 0 deletions
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K70sendsig b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K70sendsig
new file mode 100755
index 000000000..1a2485251
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K70sendsig
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K80netfs b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K80netfs
new file mode 100755
index 000000000..1a2485251
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K80netfs
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K85network b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K85network
new file mode 100755
index 000000000..d4e8e6139
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K85network
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+IFDOWN=/sbin/ifdown
+
+echo -n "Stopping networking: "
+if ${IFDOWN} -a; then
+ echo "done"
+else
+ echo "failed"
+ exit 1
+fi
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K90localfs b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K90localfs
new file mode 100755
index 000000000..1a2485251
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/K90localfs
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S00mountvirtfs b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S00mountvirtfs
new file mode 100755
index 000000000..a5af059fc
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S00mountvirtfs
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+MOUNT=/bin/mount
+MKDIR=/bin/mkdir
+
+retval=0
+
+mount_fs()
+{
+ if [ "$1" = "" -o "$2" = "" -o "$3" = "" ]; then
+ return;
+ fi
+
+ if [ "$4" = "" ]; then
+ if ! ${MOUNT} -t $3 $1 $2; then
+ echo " mount $2 failed"
+ retval=1
+ return 1
+ else
+ echo " $2 mounted"
+ fi
+ else
+ if ! ${MOUNT} -t $3 -o $4 $1 $2; then
+ echo " mount $2 failed"
+ retval=1
+ return 1
+ else
+ echo " $2 mounted"
+ fi
+ fi
+
+ return 0
+}
+
+mkdir_fs()
+{
+ if [ "$1" = "" ]; then
+ return;
+ fi
+
+ if ! ${MKDIR} $1; then
+ echo " mkdir $1 failed"
+ retval=1
+ return 1
+ else
+ echo " $1 directory made"
+ fi
+
+ return 0
+}
+
+echo "Mounting virtual filesystems:"
+
+mount_fs proc /proc proc
+mount_fs sys /sys sysfs
+
+if mount_fs dev /dev tmpfs "size=512k,mode=0755"; then
+ mkdir_fs /dev/pts
+ mount_fs pts /dev/pts devpts
+ mkdir_fs /dev/shm
+ # g_serial is not detected by mdev.
+ mknod /dev/ttygserial c 127 0
+ mknod /dev/ttyS0 c 4 64
+ mknod /dev/null c 1 3
+fi
+
+mount_fs config /config configfs
+mount_fs tmp /tmp tmpfs
+mount_fs run /var/run tmpfs
+mount_fs log /var/log tmpfs
+
+if [ $retval -ne 0 ]; then
+ echo " WARNING: not able to mount all virtual file systems"
+fi
+
+exit $retval
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S01hotplug b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S01hotplug
new file mode 100755
index 000000000..a30f06a09
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S01hotplug
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+echo -n "Setting up mdev: "
+set -e
+trap 'echo "failed"' EXIT
+/bin/ln -s /proc/self/fd /dev/fd
+/bin/ln -s /proc/self/fd/0 /dev/stdin
+/bin/ln -s /proc/self/fd/1 /dev/stdout
+/bin/ln -s /proc/self/fd/2 /dev/stderr
+/bin/ln -s /proc/kcore /dev/core
+/bin/echo /sbin/mdev > /proc/sys/kernel/hotplug
+/sbin/mdev -s
+trap - EXIT
+echo "done"
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S02hostname b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S02hostname
new file mode 100755
index 000000000..083d41dc4
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S02hostname
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+PROGRAM=/bin/hostname
+
+echo -n "Setting hostname: "
+[ -x ${PROGRAM} ] || (echo "missing"; exit 0)
+
+if [ -f /etc/hostname ]; then
+ HOST="$(cat /etc/hostname)"
+else
+ HOST="localhost.localdomain"
+fi
+
+start() {
+ if ${PROGRAM} "${HOST}"; then
+ echo "'${HOST}'"
+ else
+ echo "failed"
+ exit 1
+ fi
+}
+
+stop() {
+ return 0
+}
+
+restart() {
+ stop
+ start
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ restart
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S08syslog b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S08syslog
new file mode 100755
index 000000000..58b05925d
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S08syslog
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+SYSLOGD=/sbin/syslogd
+
+echo -n "Starting syslogd: "
+if [ ! -x "${SYSLOGD}" ]; then
+ echo "missing"
+ exit 1
+fi
+
+if ${SYSLOGD}; then
+ echo "done"
+else
+ echo "failed"
+ exit 1
+fi
+
+echo -n "Log messages to syslog: "
+if echo 4 4 1 7 > /proc/sys/kernel/printk; then
+ echo "done"
+else
+ echo "failed"
+ exit 1
+fi
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S09klog b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S09klog
new file mode 100755
index 000000000..1b0028a08
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S09klog
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+KLOGD=/sbin/klogd
+
+echo -n "Starting klogd: "
+if [ ! -x "${KLOGD}" ]; then
+ echo "missing"
+ exit 1
+fi
+
+if ${KLOGD}; then
+ echo "done"
+else
+ echo "failed"
+ exit 1
+fi
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S10modules-init b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S10modules-init
new file mode 100755
index 000000000..e2cf4e303
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S10modules-init
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+MODPROBE=/sbin/modprobe
+
+echo -n "Probing modules: "
+if [ ! -x "${MODPROBE}" -o ! -f "/etc/modules" ]; then
+ echo "missing"
+ exit 1
+else
+ echo
+fi
+
+grep '^[^#]' "/etc/modules" | \
+while read module args; do
+ [ "$module" ] || continue
+ if ${MODPROBE} $module $args; then
+ echo " $module loaded"
+ else
+ echo " $module failed"
+ fi
+done
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S20network b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S20network
new file mode 100755
index 000000000..06cf8cb00
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S20network
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+IFUP=/sbin/ifup
+
+echo -n "Network interfaces: "
+if ${IFUP} -a; then
+ echo "done"
+else
+ echo "failed"
+ exit 1
+fi
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S41inetd b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S41inetd
new file mode 100755
index 000000000..e485dcc5b
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S41inetd
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+INETD=/usr/sbin/inetd
+
+echo -n "Starting inetd: "
+if [ ! -x "${INETD}" ]; then
+ echo "missing"
+ exit 1
+fi
+
+if ${INETD}; then
+ echo "done"
+else
+ echo "failed"
+ exit 1
+fi
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S42httpd b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S42httpd
new file mode 100755
index 000000000..f8e7813e6
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S42httpd
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+HTTPD=/usr/sbin/httpd
+
+echo -n "Starting httpd: "
+if [ ! -x "${HTTPD}" ]; then
+ echo "missing"
+ exit 1
+fi
+
+if ${HTTPD} -h /www; then
+ echo "done"
+else
+ echo "failed"
+ exit 1
+fi
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S43ntp b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S43ntp
new file mode 100755
index 000000000..69fa4c894
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S43ntp
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+NTPDATE=/usr/bin/ntpdate
+
+if [ -f /etc/default/ntpdate ]; then
+ . /etc/default/ntpdate
+else
+ echo "WARNING: missing /etc/default/ntpdate"
+ exit 1
+fi
+
+echo -n "Starting ntpdate: "
+if [ ! -x ${NTPDATE} ]; then
+ echo "missing"
+ echo -n " WARNING: could not syncronize clock, "
+ echo "edit NTPSERVERS in /etc/default/ntpdate."
+ exit 1
+fi
+
+if ${NTPDATE} $NTPOPTIONS $NTPSERVERS; then
+ echo "done"
+else
+ echo "failed"
+ echo -n " WARNING: could not syncronize clock, "
+ echo "edit NTPSERVERS in /etc/default/ntpdate."
+ exit 1
+fi
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S49netfs b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S49netfs
new file mode 100755
index 000000000..e1e0fbf4f
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S49netfs
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+MOUNT=/bin/mount
+
+echo -n "Mounting remote filesystems: "
+if ${MOUNT} -t nfs -a; then
+ echo "done"
+else
+ echo "failed"
+ exit 1
+fi
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S90firstboot b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S90firstboot
new file mode 100755
index 000000000..4ab20ba92
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/S90firstboot
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+if [ -e /etc/.firstboot ]; then
+ exit 0
+fi
+
+FC_CACHE=`which fc-cache`
+PANGO_QUERY_MODULES=`which pango-querymodules`
+GTK_QUERY_IMMODULES=`which gtk-query-immodules-2.0`
+GDK_PIXBUF_QUERYLOADERS=`which gdk-pixbuf-query-loaders`
+
+echo "Running first-boot configuration."
+echo "This may take a minute."
+
+
+${FC_CACHE} -v
+${PANGO_QUERY_MODULES} > /etc/pango/pango.modules
+${GTK_QUERY_IMMODULES} > /etc/gtk-2.0/gtk.immodules
+${GDK_PIXBUF_QUERYLOADERS} > /etc/gtk-2.0/gdk-pixbuf.loaders
+
+touch /etc/.firstboot \ No newline at end of file
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/rcK b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/rcK
new file mode 100755
index 000000000..1db1400fa
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/rcK
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+echo "Shutting down ..."
+for k in /etc/init.d/K*; do
+ $k stop
+done
diff --git a/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/rcS b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/rcS
new file mode 100755
index 000000000..4d80c251b
--- /dev/null
+++ b/target/device/Atmel/atngw100-expanded/target_skeleton/etc/init.d/rcS
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+for s in /etc/init.d/S*; do
+ if [ -x $s ]; then
+ $s start
+ fi
+done
+
+echo
+echo "NGW100 ready"
+echo