#!/bin/sh

. /ts7000.subr

TMP=`is_ts7390`
if test "$TMP" -eq "0"; then
  exit 0
fi

insmod /ts7370fb.ko
gunzip -c /splash.gz > /dev/fb0 
playsound /power.wav &

TMP=0
while test $TMP -lt 1000 -a -e /mnt/root/notrootfs; do
  TMP=$((TMP+1))
  usleep 10000
done
if [ ! -e /mnt/root/notrootfs ]; then
  modprobe evdev
  modprobe ts_lcd
  modprobe ohci-hcd
  modprobe usbhid
  modprobe mousedev
  mdev -s

  mkdir /dev/input
  ln -s /dev/mice /dev/input/mice
  ln -s /dev/event0 /dev/input/event0

  rm /tmp/.X0-lock
  Xorg &
  lcd_on
  speaker_on
  TMP=0
  while test $TMP -lt 1000 -a -ne /tmp/.X0-lock; do
    TMP=$((TMP+1))
    usleep 10000
  done
  icewm &
  xhost +
  modprobe fbcon
fi

