head 1.14; access; symbols libdrm-1_0_4:1.7 snapshots-20031203-import:1.1.1.1 snapshots:1.1.1; locks; strict; comment @# @; 1.14 date 2006.03.16.05.00.07; author fxkuehl; state Exp; branches; next 1.13; 1.13 date 2006.03.06.19.54.12; author fxkuehl; state Exp; branches; next 1.12; 1.12 date 2006.03.04.22.32.52; author fxkuehl; state Exp; branches; next 1.11; 1.11 date 2006.03.02.02.33.14; author fxkuehl; state Exp; branches; next 1.10; 1.10 date 2005.11.04.05.01.40; author fxkuehl; state Exp; branches; next 1.9; commitid 405b436ae9d84567; 1.9 date 2005.11.04.03.45.17; author fxkuehl; state Exp; branches; next 1.8; commitid 2c7d436ad94d4567; 1.8 date 2005.11.02.16.21.14; author fxkuehl; state Exp; branches; next 1.7; commitid 634b4368e6f14567; 1.7 date 2005.06.01.23.10.51; author fxkuehl; state Exp; branches; next 1.6; commitid 141b429e407b4567; 1.6 date 2005.01.31.22.38.29; author fxkuehl; state Exp; branches; next 1.5; 1.5 date 2004.10.03.22.41.05; author fxkuehl; state Exp; branches; next 1.4; 1.4 date 2004.10.03.11.25.11; author fxkuehl; state Exp; branches; next 1.3; 1.3 date 2004.04.19.22.42.20; author fxkuehl; state Exp; branches; next 1.2; 1.2 date 2004.03.22.14.27.23; author fxkuehl; state Exp; branches; next 1.1; 1.1 date 2003.12.03.15.37.55; author fxkuehl; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2003.12.03.15.37.55; author fxkuehl; state Exp; branches; next ; desc @@ 1.14 log @Include libexa.so in the common package as it's ABI has changed since the Xorg 6.9/7 releases. @ text @#!/bin/bash ####################################################################### # This is the DRI installation script. It compiles the kernel modules # and installs the kernel, DRI and libGL modules. # # Frank Worsley # Alan Hourihane # Felix Kuehling # ####################################################################### ########################################################### # VARIABLE DEFINITIONS ########################################################### LOGFILE="dri.log" LOGFILE_TMP="tmp.log" # Defaults XF86_DIR="/usr/X11R6" KERNEL_VER=`uname -r` KERNEL_LIB_DIR="/lib/modules/$KERNEL_VER" OPTION=$1 # Kernel version and module filename extension KERNEL_MAJOR=${KERNEL_VER%%.*} KERNEL_TAIL=${KERNEL_VER#*.} KERNEL_MINOR=${KERNEL_TAIL%%.*} KERNEL_PATCH=${KERNEL_TAIL#.*} if [ $KERNEL_MAJOR -eq 2 -a $KERNEL_MINOR -le 4 ]; then KERNEL_MOD_EXT=o else # This may be incorrect for early 2.5 kernels. # Anyone still using one, add an extra check. ;-) KERNEL_MOD_EXT=ko fi ########################################################### # FUNCTION DECLARATIONS ########################################################### print_logo() { ################################################################ # This function prints a DRI logo and a general text header. ################################################################ clear echo "" echo "DIRECT RENDERING OPEN SOURCE PROJECT - DRIVER INSTALLATION SCRIPT" echo "" echo "[ http://dri.freedesktop.org ]" echo "" echo "==========================================================================" echo "" } detect_xorg() { ##################################################################### # Detects Xorg 7 or uses X11R6 defaults ##################################################################### X_VERSION=6 XF86_DIR="/usr/X11R6" XF86_MODULES_DIR="$XF86_DIR/lib/modules" XF86_GL_DIR="$XF86_DIR/lib" if which pkg-config > /dev/null 2>&1 && pkg-config xorg-server; then X_VERSION=7 XORG_DIR=`pkg-config --variable=prefix xorg-server` XORG_MODULES_DIR=`pkg-config --variable=moduledir xorg-server` XORG_GL_DIR=`pkg-config --variable=libdir xorg-server` if [ -n "$XORG_DIR" ]; then XF86_DIR=$XORG_DIR fi if [ -n "$XORG_MODULES_DIR" ]; then XF86_MODULES_DIR=$XORG_MODULES_DIR else XF86_MODULES_DIR="$XF86_DIR/lib/xorg/modules" fi if [ -n "$XORG_GL_DIR" ]; then XF86_GL_DIR=$XORG_GL_DIR else XF86_GL_DIR="$XF86_DIR/lib" fi fi } set_values() { ##################################################################### # Sets up default values. ##################################################################### # Determine driver to be installed DRV_NAME=`sed -n '1p' pkginfo` DRV_DESC=`sed -n '2p' pkginfo` DRV_ARCH=`sed -n '3p' pkginfo` DRV_DATE=`sed -n '4p' pkginfo` DRV_MODULE=`sed -n '5p' pkginfo` DRV_VERSION=`sed -n '6p' pkginfo` DRV_BUILD_DESC=`sed -n '7p' pkginfo` # Determine directories from default or user values XF86_DRI_DIR="$XF86_MODULES_DIR/dri" XF86_DRV_DIR="$XF86_MODULES_DIR/drivers" XF86_EXT_DIR="$XF86_MODULES_DIR/extensions" XF86_OS_DIR="$XF86_MODULES_DIR/linux" KERNEL_DRM_DIR="$KERNEL_LIB_DIR/kernel/drivers/char/drm" } check_values() { ##################################################################### # Checks if default/user given values are correct. ##################################################################### # Check if installation directories exist MSG=$'The following problems have occured:\n' FATAL=0 ERR=0 if [ \( -d $DRV_NAME -o -d core \) -a ! -d "$XF86_DIR" ]; then MSG="$MSG"$'\n - Xorg directory does not exist' ERR="1" FATAL="1"; fi if [ -d drm -a ! -d "$KERNEL_LIB_DIR" ]; then MSG="$MSG"$'\n - Kernel module directory does not exist' ERR="1" FATAL="1"; fi if [ -d drm -a ! -d "$KERNEL_DRM_DIR" ]; then MSG="$MSG"$'\n - Kernel DRM directory does not exist' ERR="1"; fi if [ -d GL -a ! -d "$XF86_GL_DIR" ]; then MSG="$MSG"$'\n - Xorg library directory does not exist' ERR="1"; fi if [ -d $DRV_NAME -a ! -d "$XF86_DRI_DIR" ]; then MSG="$MSG"$'\n - Xorg DRI directory does not exist' ERR="1"; fi if [ -d $DRV_NAME -a ! -d "$XF86_DRV_DIR" ]; then MSG="$MSG"$'\n - Xorg driver directory does not exist' ERR="1"; fi if [ -d core -a ! -d "$XF86_MODULES_DIR" ]; then MSG="$MSG"$'\n - Xorg module directory does not exist' ERR="1"; fi if [ -d core -a ! -d "$XF86_EXT_DIR" ]; then MSG="$MSG"$'\n - Xorg extensions directory does not exist' ERR="1"; fi if [ -d core -a ! -d "$XF86_OS_DIR" ]; then MSG="$MSG"$'\n - Xorg Linux OS directory does not exist' ERR="1"; fi # No error so return if [ "$ERR" == "0" ]; then return 0; fi # Get out if we have a fatal error that requires user to re-enter values if [ "$FATAL" == "1" ]; then MSG="$MSG"$'\n\nPlease make sure you have entered all information correctly.\n\nPress ENTER to review the information.' print_logo echo "$MSG" read KEY return -1; fi #Fix what we can MSG="$MSG"$'\n\nThe script can create these directories for you.\n\nPress ENTER to continue or CTRL-C to abort.' print_logo echo "$MSG" read KEY # Now we just create all directories no matter what ... mkdir -p $XF86_GL_DIR mkdir -p $XF86_MODULES_DIR mkdir -p $XF86_DRI_DIR mkdir -p $XF86_DRV_DIR mkdir -p $XF86_EXT_DIR mkdir -p $XF86_OS_DIR mkdir -p $KERNEL_DRM_DIR return 0; } copy_files() { ##################################################################### # This function copies files to their destination directories. ##################################################################### echo "Installing files:" if [ -d $DRV_NAME ]; then echo -n " DRI Xorg modules..." cd $DRV_NAME ls -1 *drv.so | while read FILE do mv -f $XF86_DRV_DIR/$FILE $XF86_DRV_DIR/dri-old.$FILE >& $LOGFILE_TMP; done ls -1 *dri.so | while read FILE do mv -f $XF86_DRI_DIR/$FILE $XF86_DRI_DIR/dri-old.$FILE >& $LOGFILE_TMP; done cd .. cp -f $DRV_NAME/*drv.so $XF86_DRV_DIR cp -f $DRV_NAME/*dri.so $XF86_DRI_DIR echo "done" fi if [ -d drm ]; then echo -n " kernel modules..." cd drm UP=.. if [ -d linux -a -d linux-core ]; then if [ $KERNEL_MINOR == 6 ]; then cd linux-core else cd linux fi UP=../.. fi mkdir -p $KERNEL_DRM_DIR ls -1 $DRV_MODULE.$KERNEL_MOD_EXT drm.$KERNEL_MOD_EXT \ 2> /dev/null | while read FILE do mv -f $KERNEL_DRM_DIR/$FILE $KERNEL_DRM_DIR/dri-old.$FILE >& $LOGFILE_TMP; cp -f $FILE $KERNEL_DRM_DIR done cd $UP unset UP /sbin/depmod -a echo "done" fi if [ -d GL ]; then echo -n " GL & GLU libraries..." cd GL ls -1 | while read FILE do mv -f $XF86_GL_DIR/$FILE $XF86_GL_DIR/dri-old.$FILE >& $LOGFILE_TMP; cp -f $FILE $XF86_GL_DIR done cd .. echo "done" fi if [ -d core ]; then echo -n " core libraries..." cd core for FILE in libdri.so libglx.so libGLcore.so; do if [ -e $FILE ]; then mv -f $XF86_EXT_DIR/$FILE $XF86_EXT_DIR/dri-old.$FILE >& $LOGFILE_TMP cp -f $FILE $XF86_EXT_DIR; fi; done for FILE in libdrm.so; do if [ -e $FILE ]; then mv -f $XF86_OS_DIR/$FILE $XF86_OS_DIR/dri-old.$FILE >& $LOGFILE_TMP; cp -f $FILE $XF86_OS_DIR fi; done for FILE in libshadow.so libexa.so; do if [ -e $FILE ]; then mv -f $XF86_MODULES_DIR/$FILE $XF86_MODULES_DIR/dri-old.$FILE >& $LOGFILE_TMP; cp -f $FILE $XF86_MODULES_DIR fi; done cd .. echo "done" fi if [ -e extras/extras.sh ]; then echo -n " Copying extra files..." extras/extras.sh $XF86_DIR echo "done" fi } restore_files () { print_logo echo "Restoring files..." if [ -d $DRV_NAME ]; then echo -n " Xorg modules..." cd $DRV_NAME ls -1 *drv.so | while read FILE do mv -f $XF86_DRV_DIR/dri-old.$FILE $XF86_DRV_DIR/$FILE >& $LOGFILE_TMP; done for FILE in *dri.so do mv -f $XF86_DRI_DIR/dri-old.$FILE $XF86_DRI_DIR/$FILE >& $LOGFILE_TMP; done cd .. echo "done" fi if [ -d drm ]; then echo -n " kernel modules..." cd drm ls -1 *.$KERNEL_MOD_EXT | while read FILE do mv -f $KERNEL_DRM_DIR/dri-old.$FILE $KERNEL_DRM_DIR/$FILE >& $LOGFILE_TMP; done cd .. /sbin/depmod -a echo "done" fi if [ -d GL ]; then echo -n " system libraries..." cd GL ls -1 * | while read FILE do mv -f $XF86_GL_DIR/dri-old.$FILE $XF86_GL_DIR/$FILE >& $LOGFILE_TMP; done cd .. echo "done" fi if [ -d core ]; then echo -n " core libraries..." mv -f $XF86_EXT_DIR/dri-old.libdri.so $XF86_EXT_DIR/libdri.so >& $LOGFILE_TMP; mv -f $XF86_EXT_DIR/dri-old.libglx.so $XF86_EXT_DIR/libglx.so >& $LOGFILE_TMP; mv -f $XF86_EXT_DIR/dri-old.libGLcore.so $XF86_EXT_DIR/libGLcore.so >& $LOGFILE_TMP; mv -f $XF86_OS_DIR/dri-old.libdrm.so $XF86_OS_DIR/libdrm.so >& $LOGFILE_TMP; mv -f $XF86_MODULES_DIR/dri-old.libshadow.so $XF86_MODULES_DIR/libshadow.so >& $LOGFILE_TMP; mv -f $XF86_MODULES_DIR/dri-old.libexa.so $XF86_MODULES_DIR/libexa.so >& $LOGFILE_TMP; echo "done" fi echo "" echo "Completed restoring files." } update_config() { ##################################################################### # This function updates the system configuration. ##################################################################### echo "" echo "Updating configuration:" if [ -d GL ]; then echo -n " Running ldconfig..." grep "$XF86_DIR" /etc/ld.so.conf >& $LOGFILE_TMP if [ $? != 0 ]; then echo "$XF86_DIR/lib" >> /etc/ld.so.conf /sbin/ldconfig >& $LOGFILE_TMP if [ $? != 0 ]; then echo "ERROR"; ERR=1 else echo "done"; fi fi cat $LOGFILE_TMP >> $LOGFILE fi if [ -d drm -a ! "$X_RUNNING" == "1" ]; then # Only try and update kernel modules if X server is not running for MOD in $DRV_MODULE do echo -n " Removing old kernel module \"$MOD\"..." /sbin/modprobe -r $MOD >& $LOGFILE_TMP if [ $? != 0 ]; then echo "ERROR" ERR=1; else echo "done"; fi cat $LOGFILE_TMP >> $LOGFILE echo -n " Inserting new kernel module \"$MOD\"..." /sbin/modprobe agpgart >& $LOGFILE_TMP /sbin/modprobe $MOD >& $LOGFILE_TMP if [ $? != 0 ]; then echo "ERROR" ERR=1; else echo "done"; fi cat $LOGFILE_TMP >> $LOGFILE; done; fi if [ "$ERR" == "1" ]; then echo "" echo "There were errors updating the system configuration." echo "See the $LOGFILE file for more information."; fi rm $LOGFILE_TMP } check_config() { ##################################################################### # This function checks the system configuration. ##################################################################### echo "" echo -n "Checking configuration..." if [ -d GL ]; then # Fix potential libGL problems GLXINFO="" [ -x $XF86_DIR/bin/glxinfo ] && GLXINFO=$XF86_DIR/bin/glxinfo \ || which glxinfo > /dev/null 2>&1 && GLXINFO=`which glxinfo` LIBGL1=`ldd $GLXINFO 2> /dev/null | grep libGL.so.1 | awk -F" " '{ printf "%s",$3 }'` LIBGL=`echo $LIBGL1 | sed -e 's/\.1//'` if [ -n "$LIBGL" -a "$LIBGL" != "$XF86_GL_DIR/libGL.so" ]; then SEC_GL_DIR=`echo $LIBGL1 | sed -e 's/libGL.so.1//'` echo "" echo -n " second copy of DRI libraries found in " echo $SEC_GL_DIR echo -n " libraries have been backed up to dri-old.* in " echo $SEC_GL_DIR echo "" for FILE in libGL.so libGL.so.1 libGL.so.1.2 do mv -f $SEC_GL_DIR/$FILE $SEC_GL_DIR/dri-old.$FILE ln -s $XF86_GL_DIR/$FILE $SEC_GL_DIR/$FILE done fi # Make sure libGL and have correct links rm -f $XF86_GL_DIR/libGL.so rm -f $XF86_GL_DIR/libGL.so.1 ln -s $XF86_GL_DIR/libGL.so.1.2 $XF86_GL_DIR/libGL.so ln -s $XF86_GL_DIR/libGL.so.1.2 $XF86_GL_DIR/libGL.so.1 fi echo "done" } ########################################################### # MAIN SCRIPT ########################################################### # Check if pkginfo file exists if [ ! -e "pkginfo" ]; then echo "Could not locate 'pkginfo' file. Aborting." exit 127; fi # Check if we are running as root if [ `whoami` != "root" ] && [ `whoami` != "ROOT" ]; then echo "You must be root to install the DRI drivers." exit 127; fi # Check if sed is installed which sed &> /dev/null if [ "$?" != "0" ]; then echo "Could not located 'sed' editor. Aborting." exit 127; fi ### FIXME: We should check for matching architectures here!!! ### # Figure out if we should restore files if [ "$OPTION" == "restore" ]; then print_logo detect_xorg echo "This will restore your previous files." echo "" echo "Xorg Dir : $XF86_DIR" echo "Xorg Modules Dir : $XF86_MODULES_DIR" echo "Xorg Library Dir : $XF86_GL_DIR" echo "Kernel Module Dir : $KERNEL_LIB_DIR" echo "" echo "Press ENTER to restore files or C to change defaults." read KEY if [ "$KEY" == "C" ] || [ "$KEY" == "c" ]; then print_logo echo "Enter new values and then press ENTER." echo "" echo -n "Xorg Dir : " read XF86_DIR echo -n "Xorg Modules Dir : " read XF86_MODULES_DIR echo -n "Xorg Library Dir : " read XF86_GL_DIR echo -n "Kernel Module Dir : " read KERNEL_LIB_DIR echo "" echo "Press ENTER to restore files." read KEY; fi set_values restore_files echo ""; exit 0; fi # Print X is running message if [ -d drm ]; then ps -C X > /dev/null if [ $? == 0 ]; then X_RUNNING=1 print_logo echo "WARNING: YOUR X SERVER SEEMS TO BE RUNNING!" echo "" echo "The script can not update your kernel modules while the X server is running." echo "" echo "You can do one of the following:" echo "" echo "1. Log out of your X session now and then run this script." echo "" echo "2. Run the script now and restart your computer after the installation." echo " If you exit your X session now you will not have to restart." echo "" echo "Press ENTER to continue or CTRL-C to exit." read KEY ; else X_RUNNING=0; fi fi # Do misc stuff rm $LOGFILE touch $LOGFILE # Setup the defaults values detect_xorg set_values # Print a welcome message print_logo echo "Welcome to the DRI Driver Installation Script" echo "" echo "The package you downloaded is for the following driver: " echo "" echo "Driver Name : $DRV_NAME" echo "Description : $DRV_DESC" echo "Architecture : $DRV_ARCH" echo "Build Date : $DRV_DATE" echo "Kernel Module : $DRV_MODULE" echo "" echo "Optional Information" echo "" echo "Driver Version : $DRV_VERSION" echo "Special Description : $DRV_BUILD_DESC" echo "" echo "Press ENTER to continue or CTRL-C to exit." read KEY # Determine Xorg Directory and Kernel Module directory from user input ERR=-1; while [ "$ERR" == "-1" ]; do # Determine Xorg directory if [ -d $DRV_NAME -o -d core ]; then print_logo echo "The script will need to copy the DRI Xorg driver modules to" echo "your Xorg directories." echo "" echo "The script will use the following Xorg directories:" echo "" echo "Xorg Dir : $XF86_DIR" echo "Xorg Modules Dir : $XF86_MODULES_DIR" echo "Xorg Library Dir : $XF86_GL_DIR" echo "" echo "If this is correct press ENTER, press C to change or CTRL-C to exit." read KEY if [ "$KEY" == "C" ] || [ "$KEY" == "c" ]; then print_logo echo "Please enter the Xorg directories you would like to use." echo "" echo "Press ENTER when done or CTRL-C to abort." echo "" echo -n "Xorg Dir : " read XF86_DIR ; echo -n "Xorg Modules Dir : " read XF86_MODULES_DIR ; echo -n "Xorg Library Dir : " read XF86_GL_DIR ; fi fi # Determine Kernel module directory if [ -d drm ]; then print_logo echo "The script also needs to copy the DRM kernel modules to your" echo "kernel module directory." echo "" echo "This version of the script supports 2.4.x and 2.6.x kernels." echo "" echo "Kernel Version : $KERNEL_VER" echo "Module Directory : $KERNEL_LIB_DIR" echo "" echo "If this is correct press ENTER, press C to change or CTRL-C to exit." read KEY if [ "$KEY" == "C" ] || [ "$KEY" == "c" ]; then print_logo echo "Please enter your kernel module directory." echo "" echo "Press ENTER when done or CTRL-C to abort." echo "" echo -n "Directory: " read KERNEL_LIB_DIR ; fi fi # Determine paths from user input or defaults set_values # Check if values are good check_values ERR="$?"; done # Compile the kernel modules if [ -d drm ]; then print_logo echo "The script will now compile the DRM kernel modules for your machine." echo "" echo "Press ENTER to continue or CTRL-C to exit." read KEY echo "" echo -n "Compiling..." cd drm UP=.. if [ -d linux -a -d linux-core ]; then if [ $KERNEL_MINOR == 6 ]; then cd linux-core else cd linux fi UP=../.. fi if [ -e Makefile.linux ]; then MAKEFILE=Makefile.linux else MAKEFILE=Makefile fi # Makefile.linux doesn't have a rule to build .ko-files for 2.6 kernels. # They are somehow created automagically after $DRV_MODULE.o is built. make -f $MAKEFILE $DRV_MODULE.o >& $UP/$LOGFILE_TMP if [ $? != 0 ]; then cd $UP cat $LOGFILE_TMP >> $LOGFILE echo "" echo "ERROR: Kernel modules did not compile" echo "" echo "The DRI drivers can not be installed without the latest kernel modules." echo "Installation will be aborted. See the $LOGFILE file for information on" echo "what went wrong." echo "" exit 127; else echo "done"; fi cd $UP unset UP cat $LOGFILE_TMP >> $LOGFILE fi # Print a last message print_logo echo "The script is now ready to complete the installation." echo "" echo "Press ENTER to continue or CTRL-C to exit." read KEY # Copy files, update config, check config and fix problems print_logo copy_files update_config check_config echo "" echo "Press ENTER to continue." read KEY # Print last message print_logo echo "The DRI installation is complete." echo "" if [ -d drm -a "$X_RUNNING" == "1" ]; then echo "Stop your X server, reload the drm module and restart the X server" echo "to try the new DRI drivers." echo "" elif [ -d $DRV_NAME -o -d core ]; then echo "Restart your X server to try the new DRI drivers." echo "" fi echo "If you have problems with the DRI after upgrading your drivers" echo "please visit the DRI website and read the Help and FAQ section." echo "The FAQ contains solutions to many common problems." echo "" echo "Report any bugs, problems and comments on the dri-devel mailing list." echo "" echo "Thank you for using the DRI." echo "" @ 1.13 log @Fix screw-up in install.sh. @ text @d284 1 a284 1 for FILE in libshadow.so; do d351 1 @ 1.12 log @Package and install libshadow.so in the common snapshots. Needed by the latest i810/i915 drivers. Cleanup inst/ after packaging. @ text @d437 1 a437 1 [ -x $XF86_DIR/bin/glxinfo ] && GLXINFO=ldd $XF86_DIR/bin/glxinfo \ @ 1.11 log @Snapshot installer changes: - Automatically detect Xorg 7 directories using pkg-config. If that fails fall back to default X11R6 directories. - Be smarter about finding glxinfo and other libGL versions. - Replace all references to XFree86 with Xorg in printed strings. - Replace dri.sourceforge.net with dri.freedesktop.org in print_logo. @ text @d160 5 d197 1 d284 6 d350 1 @ 1.10 log @Changes in packager and installer: - package and install .so instead of .a modules in the common snapshots - pack snapshots in unique directories - remove some backwards-compatibility cruft @ text @d54 1 a54 1 echo "[ http://dri.sourceforge.net ]" d60 34 d110 4 a113 5 XF86_DRI_DIR="$XF86_DIR/lib/modules/dri" XF86_DRV_DIR="$XF86_DIR/lib/modules/drivers" XF86_GL_DIR="$XF86_DIR/lib" XF86_EXT_DIR="$XF86_DIR/lib/modules/extensions" XF86_OS_DIR="$XF86_DIR/lib/modules/linux" d129 1 a129 1 MSG="$MSG"$'\n - XFree86 directory does not exist' d146 1 a146 1 MSG="$MSG"$'\n - XFree86 GL library directory does not exist' d151 1 a151 1 MSG="$MSG"$'\n - XFree86 DRI directory does not exist' d156 1 a156 1 MSG="$MSG"$'\n - XFree86 driver directory does not exist' d161 1 a161 1 MSG="$MSG"$'\n - XFree86 extensions directory does not exist' d166 1 a166 1 MSG="$MSG"$'\n - XFree86 Linux OS directory does not exist' d210 1 a210 1 echo -n " DRI XFree86 modules..." d295 1 a295 1 echo -n " XFree86 modules..." d423 4 a426 1 LIBGL1=`ldd $XF86_DIR/bin/glxinfo | grep libGL.so.1 | awk -F" " '{ printf "%s",$3 }'` d428 1 a428 1 if [ "$LIBGL" != "$XF86_GL_DIR/libGL.so" ]; then d484 1 d487 3 a489 1 echo "XFree86 Dir : $XF86_DIR" d499 1 a499 1 echo -n "XFree86 Dir : " d501 4 d547 1 d570 1 a570 1 # Determine XFree86 Directory and Kernel Module directory from user input d574 1 a574 1 # Determine XFree86 directory d577 2 a578 2 echo "The script will need to copy the DRI XFree86 driver modules to" echo "your XFree86 directory." d580 1 a580 1 echo "The script will use the following XFree86 directory:" d582 3 a584 1 echo " $XF86_DIR" d591 1 a591 1 echo "Please enter the XFree86 directory you would like to use." d595 1 a595 1 echo -n "Directory: " d597 4 @ 1.9 log @Fix a spurious error message during installation. @ text @d179 1 a179 1 ls -1 *drv.*o | while read FILE d188 1 a188 1 cp -f $DRV_NAME/*drv.*o $XF86_DRV_DIR d233 1 a233 1 for FILE in libdri.a libglx.a libGLcore.a; do d239 1 a239 1 for FILE in libdrm.a; do d264 1 a264 1 ls -1 *drv.o | while read FILE d301 4 a304 4 mv -f $XF86_EXT_DIR/dri-old.libdri.a $XF86_EXT_DIR/libdri.a >& $LOGFILE_TMP; mv -f $XF86_EXT_DIR/dri-old.libglx.a $XF86_EXT_DIR/libglx.a >& $LOGFILE_TMP; mv -f $XF86_EXT_DIR/dri-old.libGLcore.a $XF86_EXT_DIR/libGLcore.a >& $LOGFILE_TMP; mv -f $XF86_OS_DIR/dri-old.libdrm.a $XF86_OS_DIR/libdrm.a >& $LOGFILE_TMP; @ 1.8 log @- build and install DDX drivers for the DLLoader now that a very recent Xorg 6.9 server is required due to ABI issues - fixes for linking libdrm statically (--whole-archive) @ text @d179 1 a179 5 ls -1 *drv.o | while read FILE do mv -f $XF86_DRV_DIR/$FILE $XF86_DRV_DIR/dri-old.$FILE >& $LOGFILE_TMP; done ls -1 *drv.so | while read FILE @ 1.7 log @Remove dependency on 'ed' from install.sh. Use sed instead. (Roy Marples) Also check if sed is present in install.sh. @ text @d183 4 d192 1 a192 1 cp -f $DRV_NAME/*drv.o $XF86_DRV_DIR @ 1.6 log @Updates for building snapshots on marx. Remote upload and download. Include linux-core instead of linux-2.6. Build with ELF loader for compatibility with released Xorg versions. @ text @d67 7 a73 7 DRV_NAME=`echo "1 p" | ed -s pkginfo` DRV_DESC=`echo "2 p" | ed -s pkginfo` DRV_ARCH=`echo "3 p" | ed -s pkginfo` DRV_DATE=`echo "4 p" | ed -s pkginfo` DRV_MODULE=`echo "5 p" | ed -s pkginfo` DRV_VERSION=`echo "6 p" | ed -s pkginfo` DRV_BUILD_DESC=`echo "7 p" | ed -s pkginfo` d435 2 a436 2 # Check if ed is installed which ed &> /dev/null d438 1 a438 1 echo "Could not located 'ed' editor. Aborting." @ 1.5 log @Major reorganization of snapshot builds. Now uses Xorg CVS instead of a XFree86 tarball + DRI CVS. Copes better with multiple CVS repositories providing different parts of the source. Moves all branch-specific knowledge from the scripts to config.sh. Adds a new abstraction called "configuration" that defines which branch from each repository is combined into a set of snapshots. Drivers to build and package and compiler options are selected per-configuration in config.sh. Right now there is only one configuration "HEAD". @ text @d197 1 a197 1 if [ -d linux -a -d linux-2.6 ]; then d199 1 a199 1 cd linux-2.6 d206 2 a207 1 ls -1 $DRV_MODULE.$KERNEL_MOD_EXT | while read FILE d210 1 a211 1 cp -f $DRV_MODULE.$KERNEL_MOD_EXT $KERNEL_DRM_DIR d599 1 a599 1 if [ -d linux -a -d linux-2.6 ]; then d601 1 a601 1 cd linux-2.6 @ 1.4 log @Package shared, linux and linux-2.6 DRM components. install.sh picks the right directory based on uname -r. @ text @d9 1 @ 1.3 log @Split snapshots into a driver-specific and a common part. Check whether to use Makefile.linux or Makefile to build the drm. The new install.sh is untested. Please report any problems. @ text @d195 9 d209 3 a211 2 cd .. cp -f drm/$DRV_MODULE.$KERNEL_MOD_EXT $KERNEL_DRM_DIR d596 9 d612 1 a612 1 make -f $MAKEFILE $DRV_MODULE.o >& ../$LOGFILE_TMP d614 2 a615 2 cat ../$LOGFILE_TMP >> ../$LOGFILE cd .. d627 3 a629 2 cat ../$LOGFILE_TMP >> ../$LOGFILE cd .. @ 1.2 log @Updated install.sh: - works with 2.6 kernels - improved quirk to detect and replace libGLs in non-standard locations. @ text @d94 1 a94 1 if [ ! -d "$XF86_DIR" ]; then d100 1 a100 1 if [ ! -d "$KERNEL_LIB_DIR" ]; then d106 1 a106 1 if [ ! -d "$KERNEL_DRM_DIR" ]; then d111 1 a111 1 if [ ! -d "$XF86_GL_DIR" ]; then d116 1 a116 1 if [ ! -d "$XF86_DRI_DIR" ]; then d121 1 a121 1 if [ ! -d "$XF86_DRV_DIR" ]; then d126 1 a126 1 if [ ! -d "$XF86_EXT_DIR" ]; then d131 1 a131 1 if [ ! -d "$XF86_OS_DIR" ]; then d175 30 a204 14 echo -n " DRI XFree86 modules..." cd $DRV_NAME ls -1 *drv.o | while read FILE do mv -f $XF86_DRV_DIR/$FILE $XF86_DRV_DIR/dri-old.$FILE >& $LOGFILE_TMP; done ls -1 *dri.so | while read FILE do mv -f $XF86_DRI_DIR/$FILE $XF86_DRI_DIR/dri-old.$FILE >& $LOGFILE_TMP; done cd .. cp -f $DRV_NAME/*drv.o $XF86_DRV_DIR cp -f $DRV_NAME/*dri.so $XF86_DRI_DIR echo "done" d206 11 a216 11 echo -n " kernel modules..." cd drm mkdir -p $KERNEL_DRM_DIR ls -1 $DRV_MODULE.$KERNEL_MOD_EXT | while read FILE do mv -f $KERNEL_DRM_DIR/$FILE $KERNEL_DRM_DIR/dri-old.$FILE >& $LOGFILE_TMP; done cd .. cp -f drm/$DRV_MODULE.$KERNEL_MOD_EXT $KERNEL_DRM_DIR /sbin/depmod -a echo "done" d218 18 a235 26 echo -n " GL & GLU libraries..." cd GL ls -1 | while read FILE do mv -f $XF86_GL_DIR/$FILE $XF86_GL_DIR/dri-old.$FILE >& $LOGFILE_TMP; cp -f $FILE $XF86_GL_DIR done cd .. echo "done" echo -n " core libraries..." cd core for FILE in libdri.a libglx.a libGLcore.a; do if [ -e $FILE ]; then mv -f $XF86_EXT_DIR/$FILE $XF86_EXT_DIR/dri-old.$FILE >& $LOGFILE_TMP cp -f $FILE $XF86_EXT_DIR; fi; done for FILE in libdrm.a; do if [ -e $FILE ]; then mv -f $XF86_OS_DIR/$FILE $XF86_OS_DIR/dri-old.$FILE >& $LOGFILE_TMP; cp -f $FILE $XF86_OS_DIR fi; done cd .. echo "done" d249 14 a262 12 echo -n " XFree86 modules..." cd $DRV_NAME ls -1 *drv.o | while read FILE do mv -f $XF86_DRV_DIR/dri-old.$FILE $XF86_DRV_DIR/$FILE >& $LOGFILE_TMP; done for FILE in *dri.so do mv -f $XF86_DRI_DIR/dri-old.$FILE $XF86_DRI_DIR/$FILE >& $LOGFILE_TMP; done cd .. echo "done" d264 11 a274 9 echo -n " kernel modules..." cd drm ls -1 *.$KERNEL_MOD_EXT | while read FILE do mv -f $KERNEL_DRM_DIR/dri-old.$FILE $KERNEL_DRM_DIR/$FILE >& $LOGFILE_TMP; done cd .. /sbin/depmod -a echo "done" d276 10 a285 8 echo -n " system libraries..." cd GL ls -1 * | while read FILE do mv -f $XF86_GL_DIR/dri-old.$FILE $XF86_GL_DIR/$FILE >& $LOGFILE_TMP; done cd .. echo "done" d287 8 a294 6 echo -n " core libraries..." mv -f $XF86_EXT_DIR/dri-old.libdri.a $XF86_EXT_DIR/libdri.a >& $LOGFILE_TMP; mv -f $XF86_EXT_DIR/dri-old.libglx.a $XF86_EXT_DIR/libglx.a >& $LOGFILE_TMP; mv -f $XF86_EXT_DIR/dri-old.libGLcore.a $XF86_EXT_DIR/libGLcore.a >& $LOGFILE_TMP; mv -f $XF86_OS_DIR/dri-old.libdrm.a $XF86_OS_DIR/libdrm.a >& $LOGFILE_TMP; echo "done" d309 3 a311 5 echo -n " Running ldconfig..." grep "$XF86_DIR" /etc/ld.so.conf >& $LOGFILE_TMP if [ $? != 0 ]; then echo "$XF86_DIR/lib" >> /etc/ld.so.conf /sbin/ldconfig >& $LOGFILE_TMP d313 8 a320 4 echo "ERROR"; ERR=1 else echo "done"; d322 1 a323 1 cat $LOGFILE_TMP >> $LOGFILE d325 1 a325 1 if [ ! "$X_RUNNING" == "1" ]; then d376 9 a384 8 # Fix potential libGL problems LIBGL1=`ldd $XF86_DIR/bin/glxinfo | grep libGL.so.1 | awk -F" " '{ printf "%s",$3 }'` LIBGL=`echo $LIBGL1 | sed -e 's/\.1//'` if [ "$LIBGL" != "$XF86_GL_DIR/libGL.so" ]; then SEC_GL_DIR=`echo $LIBGL1 | sed -e 's/libGL.so.1//'` echo "" echo -n " second copy of DRI libraries found in " echo $SEC_GL_DIR d386 10 a395 3 echo -n " libraries have been backed up to dri-old.* in " echo $SEC_GL_DIR echo "" d397 5 a401 5 for FILE in libGL.so libGL.so.1 libGL.so.1.2 do mv -f $SEC_GL_DIR/$FILE $SEC_GL_DIR/dri-old.$FILE ln -s $XF86_GL_DIR/$FILE $SEC_GL_DIR/$FILE done a403 6 # Make sure libGL and have correct links rm -f $XF86_GL_DIR/libGL.so rm -f $XF86_GL_DIR/libGL.so.1 ln -s $XF86_GL_DIR/libGL.so.1.2 $XF86_GL_DIR/libGL.so ln -s $XF86_GL_DIR/libGL.so.1.2 $XF86_GL_DIR/libGL.so.1 d464 21 a484 19 ps -C X > /dev/null if [ $? == 0 ]; then X_RUNNING=1 print_logo echo "WARNING: YOUR X SERVER SEEMS TO BE RUNNING!" echo "" echo "The script can not update your kernel modules while the X server is running." echo "" echo "You can do one of the following:" echo "" echo "1. Log out of your X session now and then run this script." echo "" echo "2. Run the script now and restart your computer after the installation." echo " If you exit your X session now you will not have to restart." echo "" echo "Press ENTER to continue or CTRL-C to exit." read KEY ; else X_RUNNING=0; d519 1 a519 12 print_logo echo "The script will need to copy the DRI XFree86 driver modules to" echo "your XFree86 directory." echo "" echo "The script will use the following XFree86 directory:" echo "" echo " $XF86_DIR" echo "" echo "If this is correct press ENTER, press C to change or CTRL-C to exit." read KEY if [ "$KEY" == "C" ] || [ "$KEY" == "c" ]; then d521 2 a522 1 echo "Please enter the XFree86 directory you would like to use." d524 1 a524 1 echo "Press ENTER when done or CTRL-C to abort." d526 14 a539 2 echo -n "Directory: " read XF86_DIR ; d543 1 a543 13 print_logo echo "The script also needs to copy the DRM kernel modules to your" echo "kernel module directory." echo "" echo "This version of the script supports 2.4.x and 2.6.x kernels." echo "" echo "Kernel Version : $KERNEL_VER" echo "Module Directory : $KERNEL_LIB_DIR" echo "" echo "If this is correct press ENTER, press C to change or CTRL-C to exit." read KEY if [ "$KEY" == "C" ] || [ "$KEY" == "c" ]; then d545 2 a546 1 echo "Please enter your kernel module directory." d548 1 a548 1 echo "Press ENTER when done or CTRL-C to abort." d550 15 a564 2 echo -n "Directory: " read KERNEL_LIB_DIR ; d576 6 a581 5 print_logo echo "The script will now compile the DRM kernel modules for your machine." echo "" echo "Press ENTER to continue or CTRL-C to exit." read KEY d583 25 a607 7 echo "" echo -n "Compiling..." cd drm # Makefile.linux doesn't have a rule to build .ko-files for 2.6 kernels. # They are somehow created automagically after $DRV_MODULE.o is built. make -f Makefile.linux $DRV_MODULE.o >& ../$LOGFILE_TMP if [ $? != 0 ]; then a609 10 echo "" echo "ERROR: Kernel modules did not compile" echo "" echo "The DRI drivers can not be installed without the latest kernel modules." echo "Installation will be aborted. See the $LOGFILE file for information on" echo "what went wrong." echo "" exit 127; else echo "done"; a610 2 cat ../$LOGFILE_TMP >> ../$LOGFILE cd .. d634 8 a641 2 echo "Restart your X server to try the new DRI drivers." echo "" @ 1.1 log @Initial revision @ text @d25 14 d193 1 a193 1 ls -1 *.o | while read FILE d198 1 a198 1 cp -f drm/$DRV_MODULE.o $KERNEL_DRM_DIR d256 1 a256 1 ls -1 *o | while read FILE d362 1 d365 1 a365 1 echo `echo $LIBGL1 | sed -e 's/libGL.so.1//'` d367 2 a368 2 echo -n " libraries have been backed up to old.* in " echo `echo $LIBGL1 | sed -e 's/libGL.so.1//'` d370 6 a375 5 mv $LIBGL1 `echo $LIBGL1 | sed -e 's/libGL.so.1/old.libGL.so.1/'` mv $LIBGL `echo $LIBGL | sed -e 's/libGL.so/old.libGL.so/'` ln -s $XF86_GL_DIR/libGL.so.1 $LIBGL1; ln -s $XF86_GL_DIR/libGL.so $LIBGL; d523 1 a523 1 echo "Please note that only 2.4.x kernels are supported right now." d559 2 @ 1.1.1.1 log @Imported snapshot build scripts. @ text @@