about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-x199
-rwxr-xr-x224
-rwxr-xr-x345
-rw-r--r--Makefile9
-rw-r--r--README.md3
-rwxr-xr-xctrlaltdel11
-rw-r--r--foo/etc/rc.conf22
-rwxr-xr-xfoo/etc/runit/199
-rwxr-xr-xfoo/etc/runit/224
-rwxr-xr-xfoo/etc/runit/345
-rwxr-xr-xfoo/etc/runit/ctrlaltdel11
l---------foo/etc/runit/runsvdir/current1
l---------foo/etc/runit/runsvdir/default/agetty-tty11
l---------foo/etc/runit/runsvdir/default/agetty-tty21
l---------foo/etc/runit/runsvdir/default/agetty-tty31
l---------foo/etc/runit/runsvdir/default/agetty-tty41
l---------foo/etc/runit/runsvdir/default/agetty-tty51
l---------foo/etc/runit/runsvdir/default/agetty-tty61
l---------foo/etc/runit/runsvdir/default/avahi-daemon1
l---------foo/etc/runit/runsvdir/default/dbus1
l---------foo/etc/runit/runsvdir/default/dcron1
l---------foo/etc/runit/runsvdir/default/dhcpcd1
l---------foo/etc/runit/runsvdir/single/sulogin1
-rwxr-xr-xfoo/etc/sv/agetty-generic/finish4
-rwxr-xr-xfoo/etc/sv/agetty-generic/run3
l---------foo/etc/sv/agetty-tty1/finish1
-rwxr-xr-xfoo/etc/sv/agetty-tty1/run3
l---------foo/etc/sv/agetty-tty1/supervise1
l---------foo/etc/sv/agetty-tty2/finish1
l---------foo/etc/sv/agetty-tty2/run1
l---------foo/etc/sv/agetty-tty2/supervise1
l---------foo/etc/sv/agetty-tty3/finish1
l---------foo/etc/sv/agetty-tty3/run1
l---------foo/etc/sv/agetty-tty3/supervise1
l---------foo/etc/sv/agetty-tty4/finish1
l---------foo/etc/sv/agetty-tty4/run1
l---------foo/etc/sv/agetty-tty4/supervise1
l---------foo/etc/sv/agetty-tty5/finish1
l---------foo/etc/sv/agetty-tty5/run1
l---------foo/etc/sv/agetty-tty5/supervise1
l---------foo/etc/sv/agetty-tty6/finish1
l---------foo/etc/sv/agetty-tty6/run1
l---------foo/etc/sv/agetty-tty6/supervise1
l---------foo/etc/sv/agetty-ttyS0/finish1
-rwxr-xr-xfoo/etc/sv/agetty-ttyS0/run3
l---------foo/etc/sv/agetty-ttyS0/supervise1
-rwxr-xr-xfoo/etc/sv/alsa/finish3
-rwxr-xr-xfoo/etc/sv/alsa/run4
l---------foo/etc/sv/alsa/supervise1
-rwxr-xr-xfoo/etc/sv/avahi-daemon/run4
l---------foo/etc/sv/avahi-daemon/supervise1
-rwxr-xr-xfoo/etc/sv/dbus/run4
l---------foo/etc/sv/dbus/supervise1
-rwxr-xr-xfoo/etc/sv/dcron/log/run2
l---------foo/etc/sv/dcron/log/supervise1
-rwxr-xr-xfoo/etc/sv/dcron/run3
l---------foo/etc/sv/dcron/supervise1
-rwxr-xr-xfoo/etc/sv/dhcpcd/run3
l---------foo/etc/sv/dhcpcd/supervise1
-rwxr-xr-xfoo/etc/sv/ntpd/log/run2
l---------foo/etc/sv/ntpd/log/supervise1
-rwxr-xr-xfoo/etc/sv/ntpd/run3
l---------foo/etc/sv/ntpd/supervise1
-rwxr-xr-xfoo/etc/sv/rsyslogd/run3
l---------foo/etc/sv/rsyslogd/supervise1
-rwxr-xr-xfoo/etc/sv/sshd/run5
l---------foo/etc/sv/sshd/supervise1
-rwxr-xr-xfoo/etc/sv/sulogin/run2
l---------foo/etc/sv/sulogin/supervise1
-rw-r--r--rc.conf22
l---------runsvdir/current1
l---------runsvdir/default/agetty-tty11
l---------runsvdir/default/agetty-tty21
l---------runsvdir/default/agetty-tty31
l---------runsvdir/default/agetty-tty41
l---------runsvdir/default/agetty-tty51
l---------runsvdir/default/agetty-tty61
l---------runsvdir/default/avahi-daemon1
l---------runsvdir/default/dbus1
l---------runsvdir/default/dcron1
l---------runsvdir/default/dhcpcd1
l---------runsvdir/single/sulogin1
-rwxr-xr-xservices/agetty-generic/finish4
-rwxr-xr-xservices/agetty-generic/run3
l---------services/agetty-tty1/finish1
-rwxr-xr-xservices/agetty-tty1/run3
l---------services/agetty-tty1/supervise1
l---------services/agetty-tty2/finish1
l---------services/agetty-tty2/run1
l---------services/agetty-tty2/supervise1
l---------services/agetty-tty3/finish1
l---------services/agetty-tty3/run1
l---------services/agetty-tty3/supervise1
l---------services/agetty-tty4/finish1
l---------services/agetty-tty4/run1
l---------services/agetty-tty4/supervise1
l---------services/agetty-tty5/finish1
l---------services/agetty-tty5/run1
l---------services/agetty-tty5/supervise1
l---------services/agetty-tty6/finish1
l---------services/agetty-tty6/run1
l---------services/agetty-tty6/supervise1
l---------services/agetty-ttyS0/finish1
-rwxr-xr-xservices/agetty-ttyS0/run3
l---------services/agetty-ttyS0/supervise1
-rwxr-xr-xservices/alsa/finish3
-rwxr-xr-xservices/alsa/run4
l---------services/alsa/supervise1
-rwxr-xr-xservices/avahi-daemon/run4
l---------services/avahi-daemon/supervise1
-rwxr-xr-xservices/dbus/run4
l---------services/dbus/supervise1
-rwxr-xr-xservices/dcron/log/run2
l---------services/dcron/log/supervise1
-rwxr-xr-xservices/dcron/run3
l---------services/dcron/supervise1
-rwxr-xr-xservices/dhcpcd/run3
l---------services/dhcpcd/supervise1
-rwxr-xr-xservices/ntpd/log/run2
l---------services/ntpd/log/supervise1
-rwxr-xr-xservices/ntpd/run3
l---------services/ntpd/supervise1
-rwxr-xr-xservices/rsyslogd/run3
l---------services/rsyslogd/supervise1
-rwxr-xr-xservices/sshd/run5
l---------services/sshd/supervise1
-rwxr-xr-xservices/sulogin/run2
l---------services/sulogin/supervise1
128 files changed, 600 insertions, 0 deletions
diff --git a/1 b/1
new file mode 100755
index 0000000..c498ac7
--- /dev/null
+++ b/1
@@ -0,0 +1,99 @@
+#!/bin/sh
+# vim: set ts=4 sw=4 et:
+
+PATH=/usr/bin:/usr/sbin
+
+echo "Welcome to Void!"
+
+. /etc/rc.conf
+
+echo "Mounting pseudo-filesystems..."
+
+mountpoint -q /proc || mount -t proc proc /proc -o nosuid,noexec,nodev
+mountpoint -q /sys || mount -t sysfs sys /sys -o nosuid,noexec,nodev
+mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev
+mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid
+
+mkdir -p -m0755 /run/runit /run/lvm /run/user /dev/pts /dev/shm
+mountpoint -q /dev/pts || mount -n -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec
+mountpoint -q /dev/shm || mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev
+
+echo "Remounting rootfs read-only..."
+mount -o remount,ro /
+
+echo "Setting up console fonts..."
+for i in /dev/tty[0-6]; do
+    unicode_start < $i
+    [ -n "$CONSOLEFONT" ] && setfont ${CONSOLEMAP:+-m $CONSOLEMAP} $CONSOLEFONT -C $i
+done
+
+echo "Loading keymap ${KEYMAP:-us}..."
+loadkeys -q -u ${KEYMAP:-us}
+
+if [ -n "$HARDWARECLOCK" ]; then
+    echo "Setting up RTC to ${HARDWARECLOCK}..."
+    TZ=$TIMEZONE hwclock --systz \
+        ${HARDWARECLOCK:+--$(echo $HARDWARECLOCK |tr A-Z a-z) --noadjfile}
+fi
+
+if [ -x /usr/lib/systemd/systemd-udevd ]; then
+    _udevd=/usr/lib/systemd/systemd-udevd
+elif [ -x /usr/sbin/udevd ]; then
+    _udevd=/usr/sbin/udevd
+else
+    echo "WARNING: cannot find udevd!"
+fi
+
+if [ -n "${_udevd}" ]; then
+    echo "Starting udevd and waiting for devices to settle..."
+    ${_udevd} --daemon
+    udevadm trigger --action=add --type=subsystems
+    udevadm trigger --action=add --type=devices
+    udevadm settle
+fi
+
+echo "Setting up loopback interface..."
+ip link set up dev lo
+
+echo "Setting up hostname..."
+if [ -n "$HOSTNAME" ]; then
+    echo "$HOSTNAME" > /proc/sys/kernel/hostname
+elif [ -r /etc/hostname ]; then
+    cat /etc/hostname > /proc/sys/kernel/hostname
+fi
+
+echo "Checking filesystems..."
+fsck -A -T -a -t noopts=_netdev
+
+echo "Mounting rootfs read-write..."
+mount -o remount,rw /
+
+echo "Mounting all non-network filesystems..."
+mount -a -t "nosysfs,nonfs,nonfs4,nosmbfs,nocifs" -O no_netdev
+
+echo "Initializing swap..."
+swapon -a
+
+if [ -n "$TIMEZONE" ]; then
+    echo "Setting up timezone to ${TIMEZONE}..."
+    ln -sf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
+fi
+
+echo "Initializing random seed..."
+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 )
+
+install -m0664 -o root -g utmp /dev/null /run/utmp
+rm -f /etc/nologin /forcefsck /forcequotacheck /fastboot
+
+if [ -n "$MODULES" ]; then
+    echo "Loading kernel modules..."
+    modprobe -ab ${MODULES}
+fi
+
+dmesg >/var/log/dmesg.log
+
+install -m0 /dev/null /etc/runit/reboot
+install -m0 /dev/null /etc/runit/stopit
+
+echo "Initialization complete, starting services..."
diff --git a/2 b/2
new file mode 100755
index 0000000..c793759
--- /dev/null
+++ b/2
@@ -0,0 +1,24 @@
+#!/bin/sh
+# vim: set ts=4 sw=4 et:
+
+PATH=/usr/bin:/usr/sbin
+
+runlevel=default
+for arg in $(cat /proc/cmdline); do
+    case $arg in
+        single) echo "Initializing single user mode..."; runlevel=single;;
+    esac
+done
+
+# Setup first tty as unicode again, stage1 does not work correctly for tty1.
+unicode_start
+
+# Create runlevel and then copy services.
+if [ -d /etc/runit/runsvdir/${runlevel} ]; then
+    mkdir -p /run/runit/runsvdir
+    cp -aP /etc/runit/runsvdir/${runlevel} /run/runit/runsvdir
+    ln -s /run/runit/runsvdir/${runlevel} /run/runit/runsvdir/current
+fi
+
+exec env - PATH=$PATH \
+    runsvdir -P /run/runit/runsvdir/current 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
diff --git a/3 b/3
new file mode 100755
index 0000000..577568d
--- /dev/null
+++ b/3
@@ -0,0 +1,45 @@
+#!/bin/sh
+# vim: set ts=4 sw=4 et:
+
+PATH=/usr/bin:/usr/sbin
+
+. /etc/rc.conf
+
+if [ -e /run/runit/reboot ]; then
+    touch /etc/runit/reboot
+    chmod 100 /etc/runit/reboot
+fi
+
+echo "Waiting for services to stop..."
+sv -w196 force-stop /var/service/*
+sv exit /var/service/*
+
+stty onlcr
+
+echo "Saving random seed..."
+dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=512 >/dev/null 2>&1
+
+if [ -n "$HARDWARECLOCK" ]; then
+    hwclock --systohc ${HARDWARECLOCK:+--$(echo $HARDWARECLOCK |tr A-Z a-z)}
+fi
+
+halt -w  # for utmp
+
+echo "Stopping udev..."
+udevadm control --exit
+
+echo "Sending TERM signal to processes..."
+pkill --inverse -s0,1 -TERM
+sleep 5
+echo "Sending KILL signal to processes..."
+pkill --inverse -s0,1 -KILL
+
+echo "Unmounting filesystems, disabling swap..."
+umount /tmp
+swapoff -a
+umount -r -a -t nosysfs,noproc,nodevtmpfs,notmpfs
+
+echo "Remounting rootfs read-only..."
+mount -o remount,ro /
+sleep 1
+sync
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..caabf57
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,9 @@
+SCRIPTS=	1 2 3 ctrlaltdel
+
+install:
+	install -d ${DESTDIR}/etc/sv
+	install -d ${DESTDIR}/etc/runit/runsvdir
+	install -m755 ${SCRIPTS} ${DESTDIR}/etc/runit
+	install -m644 rc.conf ${DESTDIR}/etc
+	cp -aP runsvdir/* ${DESTDIR}/etc/runit/runsvdir/
+	cp -aP services/* ${DESTDIR}/etc/sv/
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5b7bee9
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+## Runit init scripts for void
+
+This repository contains the runit init scripts for the Void Linux distribution.
diff --git a/ctrlaltdel b/ctrlaltdel
new file mode 100755
index 0000000..af70ed6
--- /dev/null
+++ b/ctrlaltdel
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+PATH=/usr/bin:/usr/sbin
+MSG="System is going down..."
+
+# We check for this file in stage3 to halt or reboot
+touch /run/runit/reboot
+
+# Proceed with shutdown process
+touch /etc/runit/stopit
+chmod 100 /etc/runit/stopit && echo "$MSG" | wall
diff --git a/foo/etc/rc.conf b/foo/etc/rc.conf
new file mode 100644
index 0000000..ac58608
--- /dev/null
+++ b/foo/etc/rc.conf
@@ -0,0 +1,22 @@
+# /etc/rc.conf - system configuration for void
+
+# Set RTC to UTC or local.
+HARDWARECLOCK="UTC"
+
+# Set timezone, availables timezones at /usr/share/zoneinfo.
+TIMEZONE="Europe/Madrid"
+
+# Keymap to load, see loadkeys(8).
+KEYMAP="es"
+
+# Console font to load, see setfont(8).
+CONSOLEFONT="lat9w-16"
+
+# Console map to load, see setfont(8).
+#CONSOLEMAP=
+
+# Font unimap to load, see setfont(8).
+#UNIMAP=
+
+# Kernel modules to load, delimited by blanks.
+#MODULES=""
diff --git a/foo/etc/runit/1 b/foo/etc/runit/1
new file mode 100755
index 0000000..c498ac7
--- /dev/null
+++ b/foo/etc/runit/1
@@ -0,0 +1,99 @@
+#!/bin/sh
+# vim: set ts=4 sw=4 et:
+
+PATH=/usr/bin:/usr/sbin
+
+echo "Welcome to Void!"
+
+. /etc/rc.conf
+
+echo "Mounting pseudo-filesystems..."
+
+mountpoint -q /proc || mount -t proc proc /proc -o nosuid,noexec,nodev
+mountpoint -q /sys || mount -t sysfs sys /sys -o nosuid,noexec,nodev
+mountpoint -q /run || mount -t tmpfs run /run -o mode=0755,nosuid,nodev
+mountpoint -q /dev || mount -t devtmpfs dev /dev -o mode=0755,nosuid
+
+mkdir -p -m0755 /run/runit /run/lvm /run/user /dev/pts /dev/shm
+mountpoint -q /dev/pts || mount -n -t devpts devpts /dev/pts -o mode=0620,gid=5,nosuid,noexec
+mountpoint -q /dev/shm || mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,nodev
+
+echo "Remounting rootfs read-only..."
+mount -o remount,ro /
+
+echo "Setting up console fonts..."
+for i in /dev/tty[0-6]; do
+    unicode_start < $i
+    [ -n "$CONSOLEFONT" ] && setfont ${CONSOLEMAP:+-m $CONSOLEMAP} $CONSOLEFONT -C $i
+done
+
+echo "Loading keymap ${KEYMAP:-us}..."
+loadkeys -q -u ${KEYMAP:-us}
+
+if [ -n "$HARDWARECLOCK" ]; then
+    echo "Setting up RTC to ${HARDWARECLOCK}..."
+    TZ=$TIMEZONE hwclock --systz \
+        ${HARDWARECLOCK:+--$(echo $HARDWARECLOCK |tr A-Z a-z) --noadjfile}
+fi
+
+if [ -x /usr/lib/systemd/systemd-udevd ]; then
+    _udevd=/usr/lib/systemd/systemd-udevd
+elif [ -x /usr/sbin/udevd ]; then
+    _udevd=/usr/sbin/udevd
+else
+    echo "WARNING: cannot find udevd!"
+fi
+
+if [ -n "${_udevd}" ]; then
+    echo "Starting udevd and waiting for devices to settle..."
+    ${_udevd} --daemon
+    udevadm trigger --action=add --type=subsystems
+    udevadm trigger --action=add --type=devices
+    udevadm settle
+fi
+
+echo "Setting up loopback interface..."
+ip link set up dev lo
+
+echo "Setting up hostname..."
+if [ -n "$HOSTNAME" ]; then
+    echo "$HOSTNAME" > /proc/sys/kernel/hostname
+elif [ -r /etc/hostname ]; then
+    cat /etc/hostname > /proc/sys/kernel/hostname
+fi
+
+echo "Checking filesystems..."
+fsck -A -T -a -t noopts=_netdev
+
+echo "Mounting rootfs read-write..."
+mount -o remount,rw /
+
+echo "Mounting all non-network filesystems..."
+mount -a -t "nosysfs,nonfs,nonfs4,nosmbfs,nocifs" -O no_netdev
+
+echo "Initializing swap..."
+swapon -a
+
+if [ -n "$TIMEZONE" ]; then
+    echo "Setting up timezone to ${TIMEZONE}..."
+    ln -sf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
+fi
+
+echo "Initializing random seed..."
+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 )
+
+install -m0664 -o root -g utmp /dev/null /run/utmp
+rm -f /etc/nologin /forcefsck /forcequotacheck /fastboot
+
+if [ -n "$MODULES" ]; then
+    echo "Loading kernel modules..."
+    modprobe -ab ${MODULES}
+fi
+
+dmesg >/var/log/dmesg.log
+
+install -m0 /dev/null /etc/runit/reboot
+install -m0 /dev/null /etc/runit/stopit
+
+echo "Initialization complete, starting services..."
diff --git a/foo/etc/runit/2 b/foo/etc/runit/2
new file mode 100755
index 0000000..c793759
--- /dev/null
+++ b/foo/etc/runit/2
@@ -0,0 +1,24 @@
+#!/bin/sh
+# vim: set ts=4 sw=4 et:
+
+PATH=/usr/bin:/usr/sbin
+
+runlevel=default
+for arg in $(cat /proc/cmdline); do
+    case $arg in
+        single) echo "Initializing single user mode..."; runlevel=single;;
+    esac
+done
+
+# Setup first tty as unicode again, stage1 does not work correctly for tty1.
+unicode_start
+
+# Create runlevel and then copy services.
+if [ -d /etc/runit/runsvdir/${runlevel} ]; then
+    mkdir -p /run/runit/runsvdir
+    cp -aP /etc/runit/runsvdir/${runlevel} /run/runit/runsvdir
+    ln -s /run/runit/runsvdir/${runlevel} /run/runit/runsvdir/current
+fi
+
+exec env - PATH=$PATH \
+    runsvdir -P /run/runit/runsvdir/current 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
diff --git a/foo/etc/runit/3 b/foo/etc/runit/3
new file mode 100755
index 0000000..577568d
--- /dev/null
+++ b/foo/etc/runit/3
@@ -0,0 +1,45 @@
+#!/bin/sh
+# vim: set ts=4 sw=4 et:
+
+PATH=/usr/bin:/usr/sbin
+
+. /etc/rc.conf
+
+if [ -e /run/runit/reboot ]; then
+    touch /etc/runit/reboot
+    chmod 100 /etc/runit/reboot
+fi
+
+echo "Waiting for services to stop..."
+sv -w196 force-stop /var/service/*
+sv exit /var/service/*
+
+stty onlcr
+
+echo "Saving random seed..."
+dd if=/dev/urandom of=/var/lib/random-seed count=1 bs=512 >/dev/null 2>&1
+
+if [ -n "$HARDWARECLOCK" ]; then
+    hwclock --systohc ${HARDWARECLOCK:+--$(echo $HARDWARECLOCK |tr A-Z a-z)}
+fi
+
+halt -w  # for utmp
+
+echo "Stopping udev..."
+udevadm control --exit
+
+echo "Sending TERM signal to processes..."
+pkill --inverse -s0,1 -TERM
+sleep 5
+echo "Sending KILL signal to processes..."
+pkill --inverse -s0,1 -KILL
+
+echo "Unmounting filesystems, disabling swap..."
+umount /tmp
+swapoff -a
+umount -r -a -t nosysfs,noproc,nodevtmpfs,notmpfs
+
+echo "Remounting rootfs read-only..."
+mount -o remount,ro /
+sleep 1
+sync
diff --git a/foo/etc/runit/ctrlaltdel b/foo/etc/runit/ctrlaltdel
new file mode 100755
index 0000000..af70ed6
--- /dev/null
+++ b/foo/etc/runit/ctrlaltdel
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+PATH=/usr/bin:/usr/sbin
+MSG="System is going down..."
+
+# We check for this file in stage3 to halt or reboot
+touch /run/runit/reboot
+
+# Proceed with shutdown process
+touch /etc/runit/stopit
+chmod 100 /etc/runit/stopit && echo "$MSG" | wall
diff --git a/foo/etc/runit/runsvdir/current b/foo/etc/runit/runsvdir/current
new file mode 120000
index 0000000..331d858
--- /dev/null
+++ b/foo/etc/runit/runsvdir/current
@@ -0,0 +1 @@
+default
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/default/agetty-tty1 b/foo/etc/runit/runsvdir/default/agetty-tty1
new file mode 120000
index 0000000..0c09cd8
--- /dev/null
+++ b/foo/etc/runit/runsvdir/default/agetty-tty1
@@ -0,0 +1 @@
+/etc/sv/agetty-tty1
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/default/agetty-tty2 b/foo/etc/runit/runsvdir/default/agetty-tty2
new file mode 120000
index 0000000..7c0c41b
--- /dev/null
+++ b/foo/etc/runit/runsvdir/default/agetty-tty2
@@ -0,0 +1 @@
+/etc/sv/agetty-tty2
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/default/agetty-tty3 b/foo/etc/runit/runsvdir/default/agetty-tty3
new file mode 120000
index 0000000..d6514b8
--- /dev/null
+++ b/foo/etc/runit/runsvdir/default/agetty-tty3
@@ -0,0 +1 @@
+/etc/sv/agetty-tty3
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/default/agetty-tty4 b/foo/etc/runit/runsvdir/default/agetty-tty4
new file mode 120000
index 0000000..b27438b
--- /dev/null
+++ b/foo/etc/runit/runsvdir/default/agetty-tty4
@@ -0,0 +1 @@
+/etc/sv/agetty-tty4
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/default/agetty-tty5 b/foo/etc/runit/runsvdir/default/agetty-tty5
new file mode 120000
index 0000000..311b9f7
--- /dev/null
+++ b/foo/etc/runit/runsvdir/default/agetty-tty5
@@ -0,0 +1 @@
+/etc/sv/agetty-tty5
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/default/agetty-tty6 b/foo/etc/runit/runsvdir/default/agetty-tty6
new file mode 120000
index 0000000..97ff268
--- /dev/null
+++ b/foo/etc/runit/runsvdir/default/agetty-tty6
@@ -0,0 +1 @@
+/etc/sv/agetty-tty6
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/default/avahi-daemon b/foo/etc/runit/runsvdir/default/avahi-daemon
new file mode 120000
index 0000000..95977b7
--- /dev/null
+++ b/foo/etc/runit/runsvdir/default/avahi-daemon
@@ -0,0 +1 @@
+/etc/sv/avahi-daemon
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/default/dbus b/foo/etc/runit/runsvdir/default/dbus
new file mode 120000
index 0000000..34c103f
--- /dev/null
+++ b/foo/etc/runit/runsvdir/default/dbus
@@ -0,0 +1 @@
+/etc/sv/dbus
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/default/dcron b/foo/etc/runit/runsvdir/default/dcron
new file mode 120000
index 0000000..5487a89
--- /dev/null
+++ b/foo/etc/runit/runsvdir/default/dcron
@@ -0,0 +1 @@
+/etc/sv/dcron
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/default/dhcpcd b/foo/etc/runit/runsvdir/default/dhcpcd
new file mode 120000
index 0000000..532d6ff
--- /dev/null
+++ b/foo/etc/runit/runsvdir/default/dhcpcd
@@ -0,0 +1 @@
+/etc/sv/dhcpcd
\ No newline at end of file
diff --git a/foo/etc/runit/runsvdir/single/sulogin b/foo/etc/runit/runsvdir/single/sulogin
new file mode 120000
index 0000000..1a52f41
--- /dev/null
+++ b/foo/etc/runit/runsvdir/single/sulogin
@@ -0,0 +1 @@
+/etc/sv/sulogin
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-generic/finish b/foo/etc/sv/agetty-generic/finish
new file mode 100755
index 0000000..dba0186
--- /dev/null
+++ b/foo/etc/sv/agetty-generic/finish
@@ -0,0 +1,4 @@
+#!/bin/sh
+service=$(basename $(pwd))
+tty=${service/*-}
+exec utmpset -w $tty
diff --git a/foo/etc/sv/agetty-generic/run b/foo/etc/sv/agetty-generic/run
new file mode 100755
index 0000000..a3e6d4b
--- /dev/null
+++ b/foo/etc/sv/agetty-generic/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+tty=${PWD##*-}
+exec setsid /sbin/agetty -8 -s 38400 $tty linux
diff --git a/foo/etc/sv/agetty-tty1/finish b/foo/etc/sv/agetty-tty1/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/foo/etc/sv/agetty-tty1/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty1/run b/foo/etc/sv/agetty-tty1/run
new file mode 100755
index 0000000..dfca715
--- /dev/null
+++ b/foo/etc/sv/agetty-tty1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+tty=${PWD##*-}
+exec setsid /sbin/agetty -8 -s 38400 $([ $tty = tty1 ] && echo --noclear) $tty linux
diff --git a/foo/etc/sv/agetty-tty1/supervise b/foo/etc/sv/agetty-tty1/supervise
new file mode 120000
index 0000000..a23f48f
--- /dev/null
+++ b/foo/etc/sv/agetty-tty1/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty1
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty2/finish b/foo/etc/sv/agetty-tty2/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/foo/etc/sv/agetty-tty2/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty2/run b/foo/etc/sv/agetty-tty2/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/foo/etc/sv/agetty-tty2/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty2/supervise b/foo/etc/sv/agetty-tty2/supervise
new file mode 120000
index 0000000..a3aee31
--- /dev/null
+++ b/foo/etc/sv/agetty-tty2/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty2
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty3/finish b/foo/etc/sv/agetty-tty3/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/foo/etc/sv/agetty-tty3/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty3/run b/foo/etc/sv/agetty-tty3/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/foo/etc/sv/agetty-tty3/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty3/supervise b/foo/etc/sv/agetty-tty3/supervise
new file mode 120000
index 0000000..06d8483
--- /dev/null
+++ b/foo/etc/sv/agetty-tty3/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty3
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty4/finish b/foo/etc/sv/agetty-tty4/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/foo/etc/sv/agetty-tty4/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty4/run b/foo/etc/sv/agetty-tty4/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/foo/etc/sv/agetty-tty4/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty4/supervise b/foo/etc/sv/agetty-tty4/supervise
new file mode 120000
index 0000000..1e70774
--- /dev/null
+++ b/foo/etc/sv/agetty-tty4/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty4
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty5/finish b/foo/etc/sv/agetty-tty5/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/foo/etc/sv/agetty-tty5/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty5/run b/foo/etc/sv/agetty-tty5/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/foo/etc/sv/agetty-tty5/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty5/supervise b/foo/etc/sv/agetty-tty5/supervise
new file mode 120000
index 0000000..a48f96b
--- /dev/null
+++ b/foo/etc/sv/agetty-tty5/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty5
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty6/finish b/foo/etc/sv/agetty-tty6/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/foo/etc/sv/agetty-tty6/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty6/run b/foo/etc/sv/agetty-tty6/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/foo/etc/sv/agetty-tty6/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-tty6/supervise b/foo/etc/sv/agetty-tty6/supervise
new file mode 120000
index 0000000..e9243a6
--- /dev/null
+++ b/foo/etc/sv/agetty-tty6/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty6
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-ttyS0/finish b/foo/etc/sv/agetty-ttyS0/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/foo/etc/sv/agetty-ttyS0/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/foo/etc/sv/agetty-ttyS0/run b/foo/etc/sv/agetty-ttyS0/run
new file mode 100755
index 0000000..0f60e37
--- /dev/null
+++ b/foo/etc/sv/agetty-ttyS0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+tty=${PWD##*-}
+exec setsid /sbin/agetty -8 -s 9600 --noclear $tty linux
diff --git a/foo/etc/sv/agetty-ttyS0/supervise b/foo/etc/sv/agetty-ttyS0/supervise
new file mode 120000
index 0000000..cd9e77f
--- /dev/null
+++ b/foo/etc/sv/agetty-ttyS0/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-ttyS0
\ No newline at end of file
diff --git a/foo/etc/sv/alsa/finish b/foo/etc/sv/alsa/finish
new file mode 100755
index 0000000..84e3f81
--- /dev/null
+++ b/foo/etc/sv/alsa/finish
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -e
+exec /usr/bin/alsactl store
diff --git a/foo/etc/sv/alsa/run b/foo/etc/sv/alsa/run
new file mode 100755
index 0000000..a376059
--- /dev/null
+++ b/foo/etc/sv/alsa/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+/usr/bin/alsactl restore
+exec chpst -b alsa pause
diff --git a/foo/etc/sv/alsa/supervise b/foo/etc/sv/alsa/supervise
new file mode 120000
index 0000000..30bed6b
--- /dev/null
+++ b/foo/etc/sv/alsa/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.alsa
\ No newline at end of file
diff --git a/foo/etc/sv/avahi-daemon/run b/foo/etc/sv/avahi-daemon/run
new file mode 100755
index 0000000..ba08e8e
--- /dev/null
+++ b/foo/etc/sv/avahi-daemon/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+echo "Starting avahi..."
+exec avahi-daemon -s
diff --git a/foo/etc/sv/avahi-daemon/supervise b/foo/etc/sv/avahi-daemon/supervise
new file mode 120000
index 0000000..9cd189b
--- /dev/null
+++ b/foo/etc/sv/avahi-daemon/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.avahi-daemon
\ No newline at end of file
diff --git a/foo/etc/sv/dbus/run b/foo/etc/sv/dbus/run
new file mode 100755
index 0000000..14da8d2
--- /dev/null
+++ b/foo/etc/sv/dbus/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+[ ! -d /run/dbus ] && install -m755 -g 22 -o 22 -d /run/dbus
+echo "Starting dbus..."
+exec dbus-daemon --system --nofork
diff --git a/foo/etc/sv/dbus/supervise b/foo/etc/sv/dbus/supervise
new file mode 120000
index 0000000..f086e0e
--- /dev/null
+++ b/foo/etc/sv/dbus/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dbus
\ No newline at end of file
diff --git a/foo/etc/sv/dcron/log/run b/foo/etc/sv/dcron/log/run
new file mode 100755
index 0000000..b36c4da
--- /dev/null
+++ b/foo/etc/sv/dcron/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice
diff --git a/foo/etc/sv/dcron/log/supervise b/foo/etc/sv/dcron/log/supervise
new file mode 120000
index 0000000..555fc30
--- /dev/null
+++ b/foo/etc/sv/dcron/log/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dcron-log
\ No newline at end of file
diff --git a/foo/etc/sv/dcron/run b/foo/etc/sv/dcron/run
new file mode 100755
index 0000000..bd889e7
--- /dev/null
+++ b/foo/etc/sv/dcron/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting dcron..."
+exec crond -f 2>&1
diff --git a/foo/etc/sv/dcron/supervise b/foo/etc/sv/dcron/supervise
new file mode 120000
index 0000000..99d3e2a
--- /dev/null
+++ b/foo/etc/sv/dcron/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dcron
\ No newline at end of file
diff --git a/foo/etc/sv/dhcpcd/run b/foo/etc/sv/dhcpcd/run
new file mode 100755
index 0000000..3949484
--- /dev/null
+++ b/foo/etc/sv/dhcpcd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting dhcpcd..."
+exec /usr/sbin/dhcpcd -q -B 2>&1
diff --git a/foo/etc/sv/dhcpcd/supervise b/foo/etc/sv/dhcpcd/supervise
new file mode 120000
index 0000000..4fe4a00
--- /dev/null
+++ b/foo/etc/sv/dhcpcd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dhcpcd
\ No newline at end of file
diff --git a/foo/etc/sv/ntpd/log/run b/foo/etc/sv/ntpd/log/run
new file mode 100755
index 0000000..b36c4da
--- /dev/null
+++ b/foo/etc/sv/ntpd/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice
diff --git a/foo/etc/sv/ntpd/log/supervise b/foo/etc/sv/ntpd/log/supervise
new file mode 120000
index 0000000..7071288
--- /dev/null
+++ b/foo/etc/sv/ntpd/log/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.ntpd-log
\ No newline at end of file
diff --git a/foo/etc/sv/ntpd/run b/foo/etc/sv/ntpd/run
new file mode 100755
index 0000000..35044d5
--- /dev/null
+++ b/foo/etc/sv/ntpd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting ntpd..."
+exec ntpd -g -u ntpd:ntpd -n
diff --git a/foo/etc/sv/ntpd/supervise b/foo/etc/sv/ntpd/supervise
new file mode 120000
index 0000000..77d9d0d
--- /dev/null
+++ b/foo/etc/sv/ntpd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.ntpd
\ No newline at end of file
diff --git a/foo/etc/sv/rsyslogd/run b/foo/etc/sv/rsyslogd/run
new file mode 100755
index 0000000..9ae41ef
--- /dev/null
+++ b/foo/etc/sv/rsyslogd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting rsyslogd..."
+exec rsyslogd -n
diff --git a/foo/etc/sv/rsyslogd/supervise b/foo/etc/sv/rsyslogd/supervise
new file mode 120000
index 0000000..1bba91f
--- /dev/null
+++ b/foo/etc/sv/rsyslogd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.rsyslogd
\ No newline at end of file
diff --git a/foo/etc/sv/sshd/run b/foo/etc/sv/sshd/run
new file mode 100755
index 0000000..06f36ea
--- /dev/null
+++ b/foo/etc/sv/sshd/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo "Starting sshd..."
+/usr/bin/ssh-keygen -A # Will generate host keys if they don't already exist
+exec /usr/sbin/sshd -D
diff --git a/foo/etc/sv/sshd/supervise b/foo/etc/sv/sshd/supervise
new file mode 120000
index 0000000..1ea2704
--- /dev/null
+++ b/foo/etc/sv/sshd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.sshd
\ No newline at end of file
diff --git a/foo/etc/sv/sulogin/run b/foo/etc/sv/sulogin/run
new file mode 100755
index 0000000..f9db040
--- /dev/null
+++ b/foo/etc/sv/sulogin/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec setsid /sbin/sulogin -p </dev/tty1 >/dev/tty1 2>&1
diff --git a/foo/etc/sv/sulogin/supervise b/foo/etc/sv/sulogin/supervise
new file mode 120000
index 0000000..5f3d912
--- /dev/null
+++ b/foo/etc/sv/sulogin/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.sulogin
\ No newline at end of file
diff --git a/rc.conf b/rc.conf
new file mode 100644
index 0000000..ac58608
--- /dev/null
+++ b/rc.conf
@@ -0,0 +1,22 @@
+# /etc/rc.conf - system configuration for void
+
+# Set RTC to UTC or local.
+HARDWARECLOCK="UTC"
+
+# Set timezone, availables timezones at /usr/share/zoneinfo.
+TIMEZONE="Europe/Madrid"
+
+# Keymap to load, see loadkeys(8).
+KEYMAP="es"
+
+# Console font to load, see setfont(8).
+CONSOLEFONT="lat9w-16"
+
+# Console map to load, see setfont(8).
+#CONSOLEMAP=
+
+# Font unimap to load, see setfont(8).
+#UNIMAP=
+
+# Kernel modules to load, delimited by blanks.
+#MODULES=""
diff --git a/runsvdir/current b/runsvdir/current
new file mode 120000
index 0000000..331d858
--- /dev/null
+++ b/runsvdir/current
@@ -0,0 +1 @@
+default
\ No newline at end of file
diff --git a/runsvdir/default/agetty-tty1 b/runsvdir/default/agetty-tty1
new file mode 120000
index 0000000..0c09cd8
--- /dev/null
+++ b/runsvdir/default/agetty-tty1
@@ -0,0 +1 @@
+/etc/sv/agetty-tty1
\ No newline at end of file
diff --git a/runsvdir/default/agetty-tty2 b/runsvdir/default/agetty-tty2
new file mode 120000
index 0000000..7c0c41b
--- /dev/null
+++ b/runsvdir/default/agetty-tty2
@@ -0,0 +1 @@
+/etc/sv/agetty-tty2
\ No newline at end of file
diff --git a/runsvdir/default/agetty-tty3 b/runsvdir/default/agetty-tty3
new file mode 120000
index 0000000..d6514b8
--- /dev/null
+++ b/runsvdir/default/agetty-tty3
@@ -0,0 +1 @@
+/etc/sv/agetty-tty3
\ No newline at end of file
diff --git a/runsvdir/default/agetty-tty4 b/runsvdir/default/agetty-tty4
new file mode 120000
index 0000000..b27438b
--- /dev/null
+++ b/runsvdir/default/agetty-tty4
@@ -0,0 +1 @@
+/etc/sv/agetty-tty4
\ No newline at end of file
diff --git a/runsvdir/default/agetty-tty5 b/runsvdir/default/agetty-tty5
new file mode 120000
index 0000000..311b9f7
--- /dev/null
+++ b/runsvdir/default/agetty-tty5
@@ -0,0 +1 @@
+/etc/sv/agetty-tty5
\ No newline at end of file
diff --git a/runsvdir/default/agetty-tty6 b/runsvdir/default/agetty-tty6
new file mode 120000
index 0000000..97ff268
--- /dev/null
+++ b/runsvdir/default/agetty-tty6
@@ -0,0 +1 @@
+/etc/sv/agetty-tty6
\ No newline at end of file
diff --git a/runsvdir/default/avahi-daemon b/runsvdir/default/avahi-daemon
new file mode 120000
index 0000000..95977b7
--- /dev/null
+++ b/runsvdir/default/avahi-daemon
@@ -0,0 +1 @@
+/etc/sv/avahi-daemon
\ No newline at end of file
diff --git a/runsvdir/default/dbus b/runsvdir/default/dbus
new file mode 120000
index 0000000..34c103f
--- /dev/null
+++ b/runsvdir/default/dbus
@@ -0,0 +1 @@
+/etc/sv/dbus
\ No newline at end of file
diff --git a/runsvdir/default/dcron b/runsvdir/default/dcron
new file mode 120000
index 0000000..5487a89
--- /dev/null
+++ b/runsvdir/default/dcron
@@ -0,0 +1 @@
+/etc/sv/dcron
\ No newline at end of file
diff --git a/runsvdir/default/dhcpcd b/runsvdir/default/dhcpcd
new file mode 120000
index 0000000..532d6ff
--- /dev/null
+++ b/runsvdir/default/dhcpcd
@@ -0,0 +1 @@
+/etc/sv/dhcpcd
\ No newline at end of file
diff --git a/runsvdir/single/sulogin b/runsvdir/single/sulogin
new file mode 120000
index 0000000..1a52f41
--- /dev/null
+++ b/runsvdir/single/sulogin
@@ -0,0 +1 @@
+/etc/sv/sulogin
\ No newline at end of file
diff --git a/services/agetty-generic/finish b/services/agetty-generic/finish
new file mode 100755
index 0000000..dba0186
--- /dev/null
+++ b/services/agetty-generic/finish
@@ -0,0 +1,4 @@
+#!/bin/sh
+service=$(basename $(pwd))
+tty=${service/*-}
+exec utmpset -w $tty
diff --git a/services/agetty-generic/run b/services/agetty-generic/run
new file mode 100755
index 0000000..a3e6d4b
--- /dev/null
+++ b/services/agetty-generic/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+tty=${PWD##*-}
+exec setsid /sbin/agetty -8 -s 38400 $tty linux
diff --git a/services/agetty-tty1/finish b/services/agetty-tty1/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty1/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty1/run b/services/agetty-tty1/run
new file mode 100755
index 0000000..dfca715
--- /dev/null
+++ b/services/agetty-tty1/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+tty=${PWD##*-}
+exec setsid /sbin/agetty -8 -s 38400 $([ $tty = tty1 ] && echo --noclear) $tty linux
diff --git a/services/agetty-tty1/supervise b/services/agetty-tty1/supervise
new file mode 120000
index 0000000..a23f48f
--- /dev/null
+++ b/services/agetty-tty1/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty1
\ No newline at end of file
diff --git a/services/agetty-tty2/finish b/services/agetty-tty2/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty2/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty2/run b/services/agetty-tty2/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/services/agetty-tty2/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty2/supervise b/services/agetty-tty2/supervise
new file mode 120000
index 0000000..a3aee31
--- /dev/null
+++ b/services/agetty-tty2/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty2
\ No newline at end of file
diff --git a/services/agetty-tty3/finish b/services/agetty-tty3/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty3/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty3/run b/services/agetty-tty3/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/services/agetty-tty3/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty3/supervise b/services/agetty-tty3/supervise
new file mode 120000
index 0000000..06d8483
--- /dev/null
+++ b/services/agetty-tty3/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty3
\ No newline at end of file
diff --git a/services/agetty-tty4/finish b/services/agetty-tty4/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty4/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty4/run b/services/agetty-tty4/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/services/agetty-tty4/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty4/supervise b/services/agetty-tty4/supervise
new file mode 120000
index 0000000..1e70774
--- /dev/null
+++ b/services/agetty-tty4/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty4
\ No newline at end of file
diff --git a/services/agetty-tty5/finish b/services/agetty-tty5/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty5/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty5/run b/services/agetty-tty5/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/services/agetty-tty5/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty5/supervise b/services/agetty-tty5/supervise
new file mode 120000
index 0000000..a48f96b
--- /dev/null
+++ b/services/agetty-tty5/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty5
\ No newline at end of file
diff --git a/services/agetty-tty6/finish b/services/agetty-tty6/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-tty6/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-tty6/run b/services/agetty-tty6/run
new file mode 120000
index 0000000..2ebc95f
--- /dev/null
+++ b/services/agetty-tty6/run
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/run
\ No newline at end of file
diff --git a/services/agetty-tty6/supervise b/services/agetty-tty6/supervise
new file mode 120000
index 0000000..e9243a6
--- /dev/null
+++ b/services/agetty-tty6/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-tty6
\ No newline at end of file
diff --git a/services/agetty-ttyS0/finish b/services/agetty-ttyS0/finish
new file mode 120000
index 0000000..fa7eecd
--- /dev/null
+++ b/services/agetty-ttyS0/finish
@@ -0,0 +1 @@
+/etc/sv/agetty-generic/finish
\ No newline at end of file
diff --git a/services/agetty-ttyS0/run b/services/agetty-ttyS0/run
new file mode 100755
index 0000000..0f60e37
--- /dev/null
+++ b/services/agetty-ttyS0/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+tty=${PWD##*-}
+exec setsid /sbin/agetty -8 -s 9600 --noclear $tty linux
diff --git a/services/agetty-ttyS0/supervise b/services/agetty-ttyS0/supervise
new file mode 120000
index 0000000..cd9e77f
--- /dev/null
+++ b/services/agetty-ttyS0/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.agetty-ttyS0
\ No newline at end of file
diff --git a/services/alsa/finish b/services/alsa/finish
new file mode 100755
index 0000000..84e3f81
--- /dev/null
+++ b/services/alsa/finish
@@ -0,0 +1,3 @@
+#!/bin/sh
+set -e
+exec /usr/bin/alsactl store
diff --git a/services/alsa/run b/services/alsa/run
new file mode 100755
index 0000000..a376059
--- /dev/null
+++ b/services/alsa/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+/usr/bin/alsactl restore
+exec chpst -b alsa pause
diff --git a/services/alsa/supervise b/services/alsa/supervise
new file mode 120000
index 0000000..30bed6b
--- /dev/null
+++ b/services/alsa/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.alsa
\ No newline at end of file
diff --git a/services/avahi-daemon/run b/services/avahi-daemon/run
new file mode 100755
index 0000000..ba08e8e
--- /dev/null
+++ b/services/avahi-daemon/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+sv check dbus >/dev/null || exit 1
+echo "Starting avahi..."
+exec avahi-daemon -s
diff --git a/services/avahi-daemon/supervise b/services/avahi-daemon/supervise
new file mode 120000
index 0000000..9cd189b
--- /dev/null
+++ b/services/avahi-daemon/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.avahi-daemon
\ No newline at end of file
diff --git a/services/dbus/run b/services/dbus/run
new file mode 100755
index 0000000..14da8d2
--- /dev/null
+++ b/services/dbus/run
@@ -0,0 +1,4 @@
+#!/bin/sh
+[ ! -d /run/dbus ] && install -m755 -g 22 -o 22 -d /run/dbus
+echo "Starting dbus..."
+exec dbus-daemon --system --nofork
diff --git a/services/dbus/supervise b/services/dbus/supervise
new file mode 120000
index 0000000..f086e0e
--- /dev/null
+++ b/services/dbus/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dbus
\ No newline at end of file
diff --git a/services/dcron/log/run b/services/dcron/log/run
new file mode 100755
index 0000000..b36c4da
--- /dev/null
+++ b/services/dcron/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice
diff --git a/services/dcron/log/supervise b/services/dcron/log/supervise
new file mode 120000
index 0000000..555fc30
--- /dev/null
+++ b/services/dcron/log/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dcron-log
\ No newline at end of file
diff --git a/services/dcron/run b/services/dcron/run
new file mode 100755
index 0000000..bd889e7
--- /dev/null
+++ b/services/dcron/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting dcron..."
+exec crond -f 2>&1
diff --git a/services/dcron/supervise b/services/dcron/supervise
new file mode 120000
index 0000000..99d3e2a
--- /dev/null
+++ b/services/dcron/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dcron
\ No newline at end of file
diff --git a/services/dhcpcd/run b/services/dhcpcd/run
new file mode 100755
index 0000000..3949484
--- /dev/null
+++ b/services/dhcpcd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting dhcpcd..."
+exec /usr/sbin/dhcpcd -q -B 2>&1
diff --git a/services/dhcpcd/supervise b/services/dhcpcd/supervise
new file mode 120000
index 0000000..4fe4a00
--- /dev/null
+++ b/services/dhcpcd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.dhcpcd
\ No newline at end of file
diff --git a/services/ntpd/log/run b/services/ntpd/log/run
new file mode 100755
index 0000000..b36c4da
--- /dev/null
+++ b/services/ntpd/log/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec logger -p daemon.notice
diff --git a/services/ntpd/log/supervise b/services/ntpd/log/supervise
new file mode 120000
index 0000000..7071288
--- /dev/null
+++ b/services/ntpd/log/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.ntpd-log
\ No newline at end of file
diff --git a/services/ntpd/run b/services/ntpd/run
new file mode 100755
index 0000000..35044d5
--- /dev/null
+++ b/services/ntpd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting ntpd..."
+exec ntpd -g -u ntpd:ntpd -n
diff --git a/services/ntpd/supervise b/services/ntpd/supervise
new file mode 120000
index 0000000..77d9d0d
--- /dev/null
+++ b/services/ntpd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.ntpd
\ No newline at end of file
diff --git a/services/rsyslogd/run b/services/rsyslogd/run
new file mode 100755
index 0000000..9ae41ef
--- /dev/null
+++ b/services/rsyslogd/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+echo "Starting rsyslogd..."
+exec rsyslogd -n
diff --git a/services/rsyslogd/supervise b/services/rsyslogd/supervise
new file mode 120000
index 0000000..1bba91f
--- /dev/null
+++ b/services/rsyslogd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.rsyslogd
\ No newline at end of file
diff --git a/services/sshd/run b/services/sshd/run
new file mode 100755
index 0000000..06f36ea
--- /dev/null
+++ b/services/sshd/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+echo "Starting sshd..."
+/usr/bin/ssh-keygen -A # Will generate host keys if they don't already exist
+exec /usr/sbin/sshd -D
diff --git a/services/sshd/supervise b/services/sshd/supervise
new file mode 120000
index 0000000..1ea2704
--- /dev/null
+++ b/services/sshd/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.sshd
\ No newline at end of file
diff --git a/services/sulogin/run b/services/sulogin/run
new file mode 100755
index 0000000..f9db040
--- /dev/null
+++ b/services/sulogin/run
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec setsid /sbin/sulogin -p </dev/tty1 >/dev/tty1 2>&1
diff --git a/services/sulogin/supervise b/services/sulogin/supervise
new file mode 120000
index 0000000..5f3d912
--- /dev/null
+++ b/services/sulogin/supervise
@@ -0,0 +1 @@
+/run/runit/supervise.sulogin
\ No newline at end of file