summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-04-26 20:20:19 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-04-26 20:20:19 (EDT)
commite4199494aeda5760d823e2e73ae7f6527b902096 (patch)
treefa6c5130f1aefb8af3d35df2c7d60b00c093ac03
parentf91e916cf044cb1d9512bf70dfa52b13145af666 (diff)
Write "networking", "mdev", and "sysfs" services.
-rwxr-xr-xbuild5
-rw-r--r--src/etc/init.d/mdev19
-rw-r--r--src/etc/init.d/networking24
-rw-r--r--src/etc/init.d/sysfs20
-rw-r--r--src/etc/network/interfaces10
5 files changed, 77 insertions, 1 deletions
diff --git a/build b/build
index c93e72d..177e6c0 100755
--- a/build
+++ b/build
@@ -37,7 +37,10 @@ basefiles.buildstamp:
mkdir etc/rc.d && \
ln -s rc etc/init.d/rcS && \
ln -s rc etc/init.d/rcK && \
- ln -s ../init.d/mountall etc/rc.d/S01mountall
+ ln -s ../init.d/sysfs etc/rc.d/S01sysfs && \
+ ln -s ../init.d/mdev etc/rc.d/S02mdev && \
+ ln -s ../init.d/mountall etc/rc.d/S03mountall && \
+ ln -s ../init.d/networking etc/rc.d/S04networking
oh-installfiles $(PKGS)
oh-installdocs basefiles
oh-gencontrol $(PKGS)
diff --git a/src/etc/init.d/mdev b/src/etc/init.d/mdev
new file mode 100644
index 0000000..66070f8
--- /dev/null
+++ b/src/etc/init.d/mdev
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+case "${1}" in
+ start)
+ printf 'Enabling device hotplugging... '
+ echo '/sbin/mdev' > /proc/sys/kernel/hotplug
+ mdev -s
+ printf 'done.\n'
+ ;;
+ stop)
+ printf 'Disabling device hotplugging... '
+ echo '' > /proc/sys/kernel/hotplug
+ printf 'done.\n'
+ ;;
+ *)
+ printf 'Usage: %s {start|stop}\n' "${0}" >&2
+ exit 1
+ ;;
+esac
diff --git a/src/etc/init.d/networking b/src/etc/init.d/networking
new file mode 100644
index 0000000..def938f
--- /dev/null
+++ b/src/etc/init.d/networking
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+case "${1}" in
+ start)
+ printf 'Configuring network interfaces... '
+ ifup -a
+ printf 'done.\n'
+ ;;
+ stop)
+ printf 'Deconfiguring network interfaces... '
+ ifdown -a
+ printf 'done.\n'
+ ;;
+ restart)
+ printf 'Reconfiguring network interfaces... '
+ ifdown -a
+ ifup -a
+ printf 'done.\n'
+ ;;
+ *)
+ printf 'Usage: %s {start|stop|restart}\n' "${0}" >&2
+ exit 1
+ ;;
+esac
diff --git a/src/etc/init.d/sysfs b/src/etc/init.d/sysfs
new file mode 100644
index 0000000..e5e9508
--- /dev/null
+++ b/src/etc/init.d/sysfs
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+case "${1}" in
+ start)
+ printf 'Mounting process and system filesystems... '
+ [ ! -e /proc/mounts ] && mount -t proc proc /proc
+ [ ! -e /sys/kernel ] && mount -t sysfs sysfs /sys
+ printf 'done.\n'
+ ;;
+ stop)
+ printf 'Unmounting process and system filesystems... '
+ [ -e /proc/mounts ] && umount /proc
+ [ -e /sys/kernel ] && umount /sys
+ printf 'done.\n'
+ ;;
+ *)
+ printf 'Usage: %s {start|stop}\n' "${0}" >&2
+ exit 1
+ ;;
+esac
diff --git a/src/etc/network/interfaces b/src/etc/network/interfaces
new file mode 100644
index 0000000..f2bbb79
--- /dev/null
+++ b/src/etc/network/interfaces
@@ -0,0 +1,10 @@
+# /etc/network/interfaces
+# Network interfaces configuration used by ifup(8) and ifdown(8).
+
+# Loopback interface.
+auto lo
+iface lo inet loopback
+
+# Ethernet interface.
+auto eth0
+iface eth0 inet dhcp