#!/bin/sh
# 
if [ "$1" = "prereqs" ]; then
  exit 0
fi

quiet=n

. /scripts/functions
. /conf/tcos.conf
. /conf/tcos-run-functions

# if break=inittcos STOP here
maybe_break inittcos


# Loop over every line in /etc/modules.
# patch from Roberto Ibañez
grep '^[^#]' /etc/modules | \
while read module args; do
  [ "$module" ] || continue
  modprobe "$module" "$args" >> /tmp/initramfs.debug 2>&1
done


# load modules
if [ -x /usr/bin/pcimodules ]; then
    for mod in $(pcimodules) ; do
    modprobe -s -k "$mod" >> /tmp/initramfs.debug 2>&1 &
    done
fi
# detect Xorg kernel module and driver
# pcimodules --class 0x30000 --classmask 0xffff00 | grep -v fb$



if [ "$(which loadkeys)" ]; then
 _log "INITTCOS loading keymap"
 log_begin_msg "Loading default server keymap"
   [ -e /etc/console/boottime.kmap.gz ] && loadkeys -q /etc/console/boottime.kmap.gz >> /tmp/initramfs.debug 2>&1 &
   [ -e /etc/console-setup/cached.kmap.gz ] && loadkeys -q /etc/console-setup/cached.kmap.gz >> /tmp/initramfs.debug 2>&1 &
   [ -e /etc/console-setup/boottime.kmap.gz ] && loadkeys -q /etc/console-setup/boottime.kmap.gz >> /tmp/initramfs.debug 2>&1 &
 log_end_msg $?
else
 _log "INITTCOS not loading default keymap"
fi





exit 0
