A new user interface for you! Read more...

File mesa-driver-install of Package mesa

#!/bin/bash
#
# Copyright 2005 by Red Hat, Inc.
# Author: Mike A. Harris <mharris@redhat.com>
#
# License: MIT/X11
# <FIXME: Insert legal terms here>

# redhat-mesa-driver-install:
#
# The purpose of this script is to address some inadequacies of the current
# Mesa 6.3.2 upstream install script.  We ship DRI on some OS/arch
# combinations, and disable it on other combinations, so we need a simple
# way to control wether or not DRI modules will get installed, and an easy
# way of specifying which drivers we'll ship on a particular OS/arch
# combination.

#---------------------------------------------------------------------
# NOTE: FC5's current kernel has the following DRM modules.  Some of them
# shouldn't be there at all (ppc64), some don't make much sense (via on
# ppc).  We'll have to talk to kernel folk to get the ones disabled that
# don't make sense, or which we don't want to ship for some reason or
# another.
#
# for a in i586 i686 ia64 ppc ppc64 s390x x86_64 ; do (echo -n "${a}:" \
# rpm -qlp <path to kernel src.rpm with all arch components replaced by $a) | \
# grep /drm/ | sed -e 's;.*/;;g' |xargs echo ) ;done
#
# i586:  drm.ko i810.ko i830.ko i915.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
# i686:  drm.ko i810.ko i830.ko i915.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
# ia64:  drm.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
# ppc:   drm.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
# ppc64: drm.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
# s390x:
# x86_64: drm.ko i810.ko i830.ko i915.ko mga.ko r128.ko radeon.ko savage.ko sis.ko tdfx.ko via.ko
#---------------------------------------------------------------------

# Define list of all of the DRI drivers Mesa builds by default.
DRI_DRIVERS_ALL="ffb i810 i830 i915 mach64 mga r128 r200 r300 radeon s3v savage sis tdfx trident unichrome"

# Current build architecture, passed by rpm spec
if [ $# -gt 0 ] ; then
    echo "Usage: ${0##*/}"
    echo "    Be sure to set 'DRIMODULE_SRCDIR=<libdir>' first"
    echo "    Be sure to set 'DRIMODULE_DESTDIR=<moduledir>' first"
    echo "    Be sure to set 'DRI_DRIVERS=<drivers>' first"
    exit 1
fi

if [ -z $DRIMODULE_SRCDIR ] ; then
    echo "Error: DRIMODULE_SRCDIR not set in environment"
    exit
fi
if [ -z $DRIMODULE_DESTDIR ] ; then
    echo "Error: DRIMODULE_DESTDIR not set in environment"
    exit
else
    [ ! -d $DRIMODULE_DESTDIR ] && mkdir -p $DRIMODULE_DESTDIR
fi

#DRIMODULE_DESTDIR=${1##DRIMODULE_DESTDIR=}
ARCH=$1

if [ -z "$DRI_DRIVERS" ]; then
  DRI_DRIVERS="$DRI_DRIVERS_ALL"
fi

# Install DRI drivers
for driver in $DRI_DRIVERS ; do
    set -vx
    install -m 0755 $DRIMODULE_SRCDIR/${driver}_dri.so $DRIMODULE_DESTDIR/
    set -
done