[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg hardware detection - please test



Hi,

I've hacked together a script (attached) which parses prtconf output and outputs the name of corresponding xorg driver. I've only included the information which I could find on my own machines and prtconf examples.
Please test it on your box (you'll need prtconf from sparc-utils and awk).
If you will get no output (which means that the script failed to detect
any cards) or 'unknown' (found a card, but failed to map it to the driver), please submit output of prtconf -p -v on your machine as well as
information about which xorg driver is appropriate for it.

I would also appreciate information about which keyboard settings are appropriate for what keyboart types, so that we can implement it properly.

Best regards,

Jurij Smakov                                        jurij@wooyd.org
Key: http://www.wooyd.org/pgpkey/                   KeyID: C99E03CC
#!/bin/sh

pc=$(which prtconf)
if [ -z "${pc}" ]; then
    echo "prtconf binary missing (not in path)." >&2
    exit 1
fi

#
# Parse prtconf output
# 
result=$(${pc} -p -v | awk '
  BEGIN {
          display_node = 0; 
          model = ""; 
          name = ""; 
          final_model = ""; 
          final_name = ""
  }
  /Node/ {
           if(display_node == 1) {
             final_model = model;
             final_name = name;
             display_node = 0;
           };
           model = "";
           name = ""
  }
  /device_type:/ {
                   if(index($2, "display") != 0) {
                     display_node = 1
                   }
  }
  /model:/ { l=length($2); model = substr($2, 2, l-2) }
  /name:/  { l=length($2); name = substr($2, 2, l-2) }
  END{
       if(display_node == 1) {
         final_model = model; 
         final_name = name
       }; 
       printf "model=\"%s\" name=\"%s\"", final_model, final_name
  }')

eval "${result}"

#
# Match the name and the model to the driver. If name
# is blank, just assume that no displays are found.
#
test -z "${name}" && exit 0
case "${name}" in
	"cgsix"	) driver='suncg6' ;;
  	"SUNW,leo" ) driver='sunleo' ;;
	"SUNW,tcx" ) driver='suntcx' ;;
	"SUNW,m64B" ) driver='ati' ;;
	"SUNW,ffb" ) driver='sunffb' ;;
	* ) driver='unknown' ;;
esac

if [ "${1}" = "--full" ]; then
	echo "${name} ${model} ${driver}"
else
	echo "${driver}"
fi

exit 0


Reply to: