#!/bin/bash
# 2000-nvidia-generic.sh
# match old NVIDIA cards supported by Xorg nv driver

XORG_CONF="$1"

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

[ "$PCI_VENDOR_ID" = "10de" ] || exit 1

logger -t retrodebian-xorg-autoconfig "Configuring NVIDIA nv for $PCI_DEVICE_NAME [$PCI_DEVICE_ID]"

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

exit 0