summary refs log tree commit diff
path: root/core-services/05-misc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'core-services/05-misc.sh')
-rwxr-xr-xcore-services/05-misc.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/core-services/05-misc.sh b/core-services/05-misc.sh
new file mode 100755
index 0000000..fba6d2a
--- /dev/null
+++ b/core-services/05-misc.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# vim: set ts=4 sw=4 et:
+
+. /etc/runit/functions
+[ -r /etc/rc.conf ] && . /etc/rc.conf
+
+msg "Setting up loopback interface...\n"
+ip link set up dev lo
+
+if [ -n "$HOSTNAME" ]; then
+    echo "$HOSTNAME" > /proc/sys/kernel/hostname
+elif [ -r /etc/hostname ]; then
+    HOSTNAME=$(cat /etc/hostname)
+    echo "$HOSTNAME" > /proc/sys/kernel/hostname
+fi
+msg "Setting up hostname to '${HOSTNAME}'...\n"
+
+if [ -n "$TIMEZONE" ]; then
+    msg "Setting up timezone to '${TIMEZONE}'...\n"
+    ln -sf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
+fi
+
+msg "Initializing random seed...\n"
+cp /var/lib/random-seed /dev/urandom >/dev/null 2>&1 || true
+( umask 077; dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=512 >/dev/null 2>&1 )