#!/bin/bash
# 5000-sis-generic.sh
# match common SiS families supported by Xorg sis driver

XORG_CONF="$1"

[ -n "$XORG_CONF" ] || exit 2
[ -f "$XORG_CONF" ] || exit 2

[ "$PCI_VENDOR_ID" = "1039" ] || exit 1

case "$PCI_DEVICE_ID" in
    0200|0300|0310|0325|0330|6306|6325|6326)
        ;;
    *)
        exit 1
        ;;
esac

logger -t retrodebian-xorg-autoconfig "Configuring SiS sis for $PCI_DEVICE_NAME [$PCI_DEVICE_ID]"

sed -i \
    -e "s|{DeviceDriver}|sis|g" \
    "$XORG_CONF" || exit 2

exit 0