#!/bin/sh # Long list of all packages, should be taken from the manifest package_list=" RedHat Linux 7.2 UP Single Processor i386 Architecture NVIDIA_kernel-1.0-2313.rh72up.i386.rpm MD5SUM: a38bdd128596d3c7ff91642d754649d4 RedHat Linux 7.2 SMP Multiprocessor i686 Architecture NVIDIA_kernel-1.0-2313.rh72smp.i686.rpm MD5SUM: b8c1f22015bae9037dd66c49cb670e0c RedHat Linux 7.2 Enterprise i686 Architecture NVIDIA_kernel-1.0-2313.rh72enterprise.i686.rpm MD5SUM: 798d29fe219c24078f606991c8e039be RedHat Linux 7.2 UP Single Processor i686 Architecture NVIDIA_kernel-1.0-2313.rh72up.i686.rpm MD5SUM: 520c1cfa13edc9acf2cbd8e80f14ae12 RedHat Linux 7.2 UP Single Processor Athlon Architecture NVIDIA_kernel-1.0-2313.rh72up.athlon.rpm MD5SUM: a1020bb6846a0275dc7d53b17293b25d RedHat Linux 7.2 SMP Multiprocessor Athlon Architecture NVIDIA_kernel-1.0-2313.rh72smp.athlon.rpm MD5SUM: 457b117553219f400b5848a9d0f30984 RedHat Linux 7.2 updated to 2.4.9-13 UP Single Processor i386 Architecture NVIDIA_kernel-1.0-2313.rh72up_2.4.9_13.i386.rpm MD5SUM: d9ed693bb00eaaab5902281934548f9e RedHat Linux 7.2 updated to 2.4.9-13 SMP Multiprocessor i686 Architecture NVIDIA_kernel-1.0-2313.rh72smp_2.4.9_13.i686.rpm MD5SUM: 3a6aaa85dc9376551ca1ac3506e25468 RedHat Linux 7.2 updated to 2.4.9-13 Enterprise i686 Architecture NVIDIA_kernel-1.0-2313.rh72enterprise_2.4.9_13.i686.rpm MD5SUM: f5135b198babfec55a647dd8d4b6c381 RedHat Linux 7.2 updated to 2.4.9-13 UP Single Processor i686 Architecture NVIDIA_kernel-1.0-2313.rh72up_2.4.9_13.i686.rpm MD5SUM: d8d2f4b03127da30054c37547fd303bf RedHat Linux 7.2 updated to 2.4.9-13 UP Single Processor Athlon Architecture NVIDIA_kernel-1.0-2313.rh72up_2.4.9_13.athlon.rpm MD5SUM: 470ec40dbc34bdaf751c3f4600d316a3 RedHat Linux 7.2 updated to 2.4.9-13 SMP Multiprocessor Athlon Architecture NVIDIA_kernel-1.0-2313.rh72smp_2.4.9_13.athlon.rpm MD5SUM: 28c4d8595e48e34a001a7df96ad98293 RedHat Linux 7.1 UP Single Processor i386 Architecture NVIDIA_kernel-1.0-2313.rh71up.i386.rpm MD5SUM: 6a5df86ac79199c6891a796a934eb848 RedHat Linux 7.1 SMP Multiprocessor i386 Architecture NVIDIA_kernel-1.0-2313.rh71smp.i386.rpm MD5SUM: 6b1ce8b2a7caa0030449316dbdfd1545 RedHat Linux 7.1 Enterprise i686 Architecture NVIDIA_kernel-1.0-2313.rh71enterprise.i686.rpm MD5SUM: c7055918033b590a18c493bc5b91c76a RedHat Linux 7.0 UP Single Processor i386 Architecture NVIDIA_kernel-1.0-2313.rh70up.i386.rpm MD5SUM: 00b0d0af99d8e756c0fc8fd27d94658b RedHat Linux 7.0 SMP Multiprocessor i386 Architecture NVIDIA_kernel-1.0-2313.rh70smp.i386.rpm MD5SUM: 73551ec4d6bcc4e32b0640fd198c1f06 RedHat Linux 6.2 UP Single Processor i386 Architecture NVIDIA_kernel-1.0-2313.rh62up.i386.rpm MD5SUM: b99be54fbbbee5aaddc9513418a9e2f2 RedHat Linux 6.2 SMP Multiprocessor i386 Architecture NVIDIA_kernel-1.0-2313.rh62smp.i386.rpm MD5SUM: 197567ee3225cdbf645947166eeb49db RedHat Linux 6.1 UP Single Processor i386 Architecture NVIDIA_kernel-1.0-2313.rh61up.i386.rpm MD5SUM: 6ef6cfa022f4b6554b9e690c73dc86a6 RedHat Linux 6.1 SMP Multiprocessor i386 Architecture NVIDIA_kernel-1.0-2313.rh61smp.i386.rpm MD5SUM: ff3d89991c7dfc0f9aa1f0ba73e32b1f Mandrake Linux 8.1 UP Single Processor i686 Architecture NVIDIA_kernel-1.0-2313.mdk81up.i686.rpm MD5SUM: 2fc6d04017b81e14c1e95b899588e3ad Mandrake Linux 8.1 SMP Multiprocessor i686 Architecture NVIDIA_kernel-1.0-2313.mdk81smp.i686.rpm MD5SUM: 44cb06d3c0db8f92773648d646bf1366 Mandrake Linux 8.1 Enterprise i686 Architecture NVIDIA_kernel-1.0-2313.mdk81enterprise.i686.rpm MD5SUM: 35133f6f74f29ffe842009c76fbc9cfb Mandrake Linux 8.0 UP Single Processor i386 Architecture NVIDIA_kernel-1.0-2313.mdk80up.i386.rpm MD5SUM: cf458a1b805a473013ebd645b05e4846 Mandrake Linux 8.0 SMP Multiprocessor i386 Architecture NVIDIA_kernel-1.0-2313.mdk80smp.i386.rpm MD5SUM: e3bbe571b8b00172e13b694a719be7f9 Mandrake Linux 8.0 Enterprise i686 Architecture NVIDIA_kernel-1.0-2313.mdk80enterprise.i686.rpm MD5SUM: a56974901649f4f39116acaff03b094d Mandrake Linux 7.1 UP Single Processor i386 Architecture NVIDIA_kernel-1.0-2313.mdk71up.i386.rpm MD5SUM: c816bde63a0c8f3dcc1add28dec22855 Mandrake Linux 7.1 SMP Multiprocessor i386 Architecture NVIDIA_kernel-1.0-2313.mdk71smp.i386.rpm MD5SUM: a1b30df6e5b6d746f4a71d5070acb41c Kernel Source RPM NVIDIA_kernel-1.0-2313.src.rpm MD5SUM: 20f60c8234b6fecf21a0d05de4bcb78c Kernel Tar File NVIDIA_kernel-1.0-2313.tar.gz MD5SUM: af48b61f3a4d147b9f065a28c641b03c GLX Files NVIDIA_GLX-1.0-2313.i386.rpm MD5SUM: 70dbcbd5d893a2f89090968a3c340bc4 NVIDIA_GLX-1.0-2313.src.rpm MD5SUM: 125861b88870a38691705dd861cd3f2e NVIDIA_GLX-1.0-2313.tar.gz MD5SUM: c49dff33574e2f63fcad868c90a87185 " # Driver Version NVVERSION=1.0-2313 # Determine which distribution and version is running # Is it Red Hat? # Red Hat's issue looks like "Red Hat Linux release X.Y (codename) if ( grep "Red Hat" /etc/issue > /dev/null ); then distro="rh" version=`grep "Red Hat" /etc/issue | tr -d "a-zA-Z(). "` fi # Is it Mandrake? # Mandrake's issue has a big logo in it and then # "Mandrake Linux release X.Y (codename) for some_arch if ( grep "Mandrake" /etc/issue > /dev/null ); then distro="mdk" version=`grep "Mandrake" /etc/issue | sed -e "s/.*release \([0-9]\+\)\.\([0-9]\+\).*/\1\2/"` fi # Is it SuSE? # XXX What does SuSE Linux's issue look like? # XXX Detect Debian and recommend either the tarball or link to the # Debian contrib package. # XXX Other distros, recommend the tar ball if [ -z "$distro" ]; then echo "NVIDIA does not provide a prebuilt binary driver for your" echo "distribution at this time. Please download:" echo $package_list | tr " " "\n" | grep "tar.gz" | cut -f 1 -d " " fi # XXX Make this support command line options to specify a kernel that isn't # the running kernel. # Determine architecture (strip mdk out if its present) KERNEL_TYPE=`uname -r | tr -d "0-9.-" | sed -e "s/mdk//"` KERNEL_VERSION=`uname -r | tr -d "a-zA-Z"` KERNEL_PACKAGE=kernel if [ -n "$KERNEL_TYPE" ]; then KERNEL_PACKAGE=$KERNEL_PACKAGE-$KERNEL_TYPE fi if [ -n "$KERNEL_VERSION" ]; then KERNEL_PACKAGE=$KERNEL_PACKAGE-$KERNEL_VERSION # On mandrake we have to add mdk to the version (it was in the uname but # we stripped it out with tr above, we want to strip it out because # it has other stuff as well) if [ "$distro" == "mdk" ]; then KERNEL_PACKAGE=${KERNEL_PACKAGE}mdk fi fi # Which kernel, matching the above, is actually installed? Get the arch # from it. Default to something that can't match KERNEL_ARCH=`rpm -q --qf '%{ARCH}' $KERNEL_PACKAGE` if [ -z "$KERNEL_ARCH" ]; then # Err, take a guess, if its not a default kernel we will catch that # when we try to match against the file we have. KERNEL_ARCH=`uname -m` fi # Promote i585 arch to i686 as there is no difference and we don't always ship # i586 drivers. # Ok, lots of rules for patching up the ARCH # 1) We only have i386 builds for things that aren't one of # - RedHat 7.2 or later # - Mandrake 8.1 or later # - enterprise kernels # 2) We don't do i586 builds they get promoted to i686 if [ \( "$distro" == "rh" -a "$version" -ge 72 \) -o \ \( "$distro" == "mdk" -a "$version" -ge 81 \) -o \ \( "$KERNEL_TYPE" == "enterprise" \) ]; then # We have i686/athlon builds, promote i586 builds to i686 KERNEL_ARCH=`echo $KERNEL_ARCH | sed -e "s/i586/i686/"` else # We just have i386 builds KERNEL_ARCH="i386" fi # Two different naming styles, one for update kernels, one for standard # kernels. We append "up" if there is no type if [ -z "$KERNEL_TYPE" ]; then KERNEL_TYPE=up fi UPDATE_PACKAGE=NVIDIA_kernel-${NVVERSION}.${distro}${version}${KERNEL_TYPE}_${KERNEL_VERSION}.${KERNEL_ARCH}.rpm STANDARD_PACKAGE=NVIDIA_kernel-${NVVERSION}.${distro}${version}${KERNEL_TYPE}.${KERNEL_ARCH}.rpm GLX_PACKAGE=NVIDIA_GLX-${NVVERSION}.i386.rpm echo -e $package_list | tr " " "\n" | grep "$UPDATE_PACKAGE" echo "Please download and install the following files:" # First assume we have an update kernel and see if its in the list if echo -e $package_list | tr " " "\n" | grep "$UPDATE_PACKAGE" > /dev/null ; then echo $UPDATE_PACKAGE # If its not an update kernel then try it as a standard kernel elif echo -e $package_list | tr " " "\n" | grep "$STANDARD_PACKAGE" > /dev/null ; then echo $STANDARD_PACKAGE else # if its not a standard kernel or an update kernel then recommend the # src rpm echo $package_list | tr " " "\n" | grep "NVIDIA_kernel.*src\.rpm" | \ cut -f 1 -d " " fi echo $GLX_PACKAGE .