mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

  1. #!/bin/bash
  2. detect_card_old() {
  3. echo "Trying to autodetect Graphics card"
  4. echo -n "- nVidia ... "
  5. if [ `lspci | grep -ic nvidia` -gt 0 ] ; then
  6. echo "yes"
  7. driver="nv"
  8. return 0
  9. fi
  10. echo -en "no\n- 3Dfx ... "
  11. if [ `lspci | grep -ic 3Dfx` -gt 0 ] ; then
  12. echo "yes"
  13. driver="tdfx"
  14. return 0
  15. fi
  16. echo -en "no\n- Matrox ... "
  17. if [ `lspci | grep -ic Matrox` -gt 0 ] ; then
  18. echo "yes"
  19. driver="mga"
  20. return 0
  21. fi
  22. echo -en "no\n- VMware ... "
  23. if [ `lspci | grep -ic VMware` -gt 0 ] ; then
  24. echo "yes"
  25. driver="vmware"
  26. return 0
  27. fi
  28. echo -e "no\nUsing vesa-compatible."
  29. driver="vesa"
  30. return 0
  31. }
  32. xf86config_start(){
  33. if [ `grep -c oldxconfig /proc/cmdline` -eq 1 ] ; then
  34. echo "Running old X-Config"
  35. detect_card_old
  36. cat /etc/X11/XF86Config | sed "s,LVPDEVICE,${driver},g" >/tmp/XF86Config
  37. else
  38. echo -n "Running integrated XFree86-Autoconfiguration ... "
  39. HOME="/tmp" /usr/X11/bin/X -configure -logfile /dev/null >/dev/null 2>&1
  40. mv /tmp/XF86Config.new /tmp/XF86Config
  41. echo "done"
  42. fi
  43. }
  44. xf86config_stop(){
  45. echo -n
  46. }
  47. eval "xf86config_${1}"