#! /bin/bash
. /etc/rc.conf
. /etc/rc.d/functions

# needed in rc.sysinit, no fstab used!
mkdir -p /dev/pts
mkdir -p /dev/shm
mount /dev/pts
mount /dev/shm

echo " "
printhl "Arch Linux\n"
printhl "${C_H2}http://www.archlinux.org"
printsep

run_hook sysinit_start

# anything more serious than KERN_WARNING goes to the console
# 'verbose' cmdline parameter enables more messages
if /bin/grep -q " verbose" /proc/cmdline; then
  /bin/dmesg -n 8
else
  /bin/dmesg -n 3
fi

# bring up the loopback interface
[[ -d /sys/class/net/lo ]] && \
    status "Bringing up loopback interface" /sbin/ifconfig lo 127.0.0.1 up

/bin/dmesg >| /var/log/dmesg.log

# Load sysctl variables if sysctl.conf is present
[[ -r /etc/sysctl.conf ]] && /sbin/sysctl -q -p &>/dev/null

# Start daemons
for daemon in "${DAEMONS[@]}"; do
    case ${daemon:0:1} in
        '!') continue;;     # Skip this daemon.
        '@') start_daemon_bkgd "${daemon#@}";;
        *)   start_daemon "$daemon";;
    esac
done

if [[ -x /etc/rc.local ]]; then
  /etc/rc.local
fi

run_hook sysinit_end
