#!/bin/sh
#

# new header not using prereqs
if [ "$1" = "prereqs" ]; then
  echo ""
  exit 0
fi


quiet=n

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

test1=0
test1=$(get_vga_vendor 1106)


if [ "$test1" != "1" ]; then
   # not in client with chip VIA unichrome
   exit 0
fi

log_begin_msg "Loading Via Openchrome drivers"

  modprobe drm
  modprobe via

[ "$TCOS_XORG_VIDEO_DRIVER" = "fullauto" ] && exit 0

  if [ -f /usr/lib/xorg/modules/drivers/openchrome_drv.so ]; then
    configurexorg --newsettings --xdriver=openchrome --outputfile=/etc/X11/xorg.conf 2>> /tmp/initramfs.debug
  else
    configurexorg --newsettings --xdriver=via --outputfile=/etc/X11/xorg.conf 2>> /tmp/initramfs.debug
  fi

log_end_msg $?

