slitaz-tools rev 924

tazx: autoselect_driver(): use busybox lspci.
Also should work for two graphic cards installed at a time from two different vendors.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Nov 15 05:37:54 2014 +0200 (2014-11-15)
parents 86a2c7735907
children a37f6f8dda42
files tinyutils/tazx
line diff
     1.1 --- a/tinyutils/tazx	Fri Nov 14 23:58:52 2014 +0200
     1.2 +++ b/tinyutils/tazx	Sat Nov 15 05:37:54 2014 +0200
     1.3 @@ -170,22 +170,19 @@
     1.4  }
     1.5  
     1.6  autoselect_driver() {
     1.7 -	inst_pkg pciutils
     1.8 -for v in AMD ATI Intel NVIDIA SiS VMware; do
     1.9 -	hw=$(echo $(lspci | grep VGA | grep $v |LC_ALL=C sed 's/[^aA-zZ]//g')--)
    1.10 -	if [ ! $hw = -- ]; then case $v in
    1.11 -		AMD|ATI)d=ati;;
    1.12 -		Intel)	d=intel;;
    1.13 -		NVIDIA)	d=nouveau;;
    1.14 -		SiS)	d=sis;;
    1.15 -		VMware)	d=vmware;;
    1.16 -	esac ; fi
    1.17 -done
    1.18 -	DEVICE=$(_ 'driver')
    1.19 -	[ ! $(echo $d | wc -w) = 0 ] || \
    1.20 -	$DIALOG --colors --msgbox "\Z1 $(_n 'Failed to setup $DEVICE') \Zn (unknown hardware)" 5 68
    1.21 -
    1.22 +	DEVICE="$(_ 'driver')"
    1.23 +	for VID in $(busybox lspci | grep 'Class 03' | cut -c21-24 | sort -u); do
    1.24 +		case $VID in
    1.25 +			1022|1002) d=ati ;;
    1.26 +			8086) d=intel ;;
    1.27 +			10de) d=nouveau ;;
    1.28 +			1039) d=sis ;;
    1.29 +			15ad) d=vmware ;;
    1.30 +			*) $DIALOG --colors --msgbox \
    1.31 +				"\Z1 $(_n 'Failed to setup $DEVICE') \Zn (unknown hardware)" 5 68 ;;
    1.32 +		esac
    1.33  	[ $1 = sh ] || install_xorg $d
    1.34 +	done
    1.35  }
    1.36  
    1.37  inst_pkg() {