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

quiet=n
. /conf/tcos-run-functions


# enable tcos-udev.sh events
mkdir -p /var/run/
touch /var/run/tcos-udev.run


nodevices=$(read_cmdline_var "nodevices" "0") 
if [ "${nodevices}" = "1" ]; then 
  _log "Devices disabled from cmdline" 
  exit 0 
fi

if [ "$(configctl.sh --get TCOS_DISABLE_USB)" = "1" ] || \
   [ "$(configctl.sh --get TCOS_DISABLE_IDE)" = "1" ]; then
  _log "Devices disabled"
  exit 0
fi

if [ -x /usr/sbin/listener-daemon.sh ]; then
   /usr/sbin/listener-daemon.sh > /var/log/listener-daemon.log 2>&1 &
fi


if [ -x /usr/sbin/cdrom-mount ]; then
   /usr/sbin/cdrom-mount > /var/log/cdrom-mount.log 2>&1 &
fi

exit 0
