diff options
Diffstat (limited to 'src/os-plugins/plugins/xserver/files')
-rw-r--r-- | src/os-plugins/plugins/xserver/files/README | 77 | ||||
-rwxr-xr-x | src/os-plugins/plugins/xserver/files/ati-install.sh | 24 | ||||
-rwxr-xr-x | src/os-plugins/plugins/xserver/files/nvidia-install.sh | 138 | ||||
-rwxr-xr-x | src/os-plugins/plugins/xserver/files/suse-gfx-install.sh | 330 | ||||
-rwxr-xr-x | src/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh | 124 | ||||
-rwxr-xr-x | src/os-plugins/plugins/xserver/files/ubuntu-ng-gfx-install.sh | 236 |
6 files changed, 929 insertions, 0 deletions
diff --git a/src/os-plugins/plugins/xserver/files/README b/src/os-plugins/plugins/xserver/files/README new file mode 100644 index 00000000..c13d9570 --- /dev/null +++ b/src/os-plugins/plugins/xserver/files/README @@ -0,0 +1,77 @@ +Some development notes +====================== + + +Infos about ati-packages: +Most are identical, even when 64bit packages have a different name +Only a couple of cards have its own special package. We need to +investigate, if they are different or one package works for all. + +It seems - only for the FireMV 2200 PCI graphics card, they offer an older +version (8.25) of the unified fglrx-driver. For the FirMV PCIE-Card they +offer a more recent Version (8.5). +By the time of writing the drivers were at version 8.7 + +From the ATI-FAQ: + +Q2: Which ATI graphics cards can use this driver? +A2: The ATI Proprietary Linux driver currently supports Radeon 8500 and +later AGP or PCI Express graphics products, as well as ATI FireGL 8700 +and later products. We do not currently plan to include support for any +products earlier than this. + +Support for earlier graphics card can be achieved by "radeon" or "ati" drivers! + +=============================================================================== + +Infos about nvidia packages: +they seem to differ much more as ati if you search directly for a +specific graphic card. But if you take a look on +http://www.nvidia.com/object/unix.html there seem to be just 3 different +ersions - all for different architectures (ia32, ia64, amd64) + + + +Supported graphics cards can be read from the nvidia-documentation + +For the 173.14.12-NVIDIA-Driver go to +http://www.nvidia.com/object/linux_display_ia32_173.14.12.html +and click on "Supported Products List" on the right side + +(below each unified driver a line to symbolize the evolution of + drivers - correct me if I'm wrong) + +173.14.12 driver: GeForce FX 5100 & all newer supported + |----------------------------------> + 71.86.06 driver: Riva TNT - GeForce 6800 Ultra +|---------------| + 96.43.07 driver: some GeForce3 - GeForce 7900 ?? + |---------------| + +The Question is, wether we need to support older graphics cards. +Probably we don't need to bother because the user can download right +driver package for his needs - almost the same interfaces for the installer... + + + +=============================================================================== +Taken from the readme on +http://us.download.nvidia.com/XFree86/Linux-x86/96.43.07/README/README.txt + +since 96.43.07 no longer supported in the unified driver: + + NVIDIA chip name Device PCI ID + ---------------------------------- ---------------------------------- + RIVA TNT 0x0020 + RIVA TNT2/TNT2 Pro 0x0028 + RIVA TNT2 Ultra 0x0029 + Vanta/Vanta LT 0x002C + RIVA TNT2 Model 64/Model 64 Pro 0x002D + Aladdin TNT2 0x00A0 + GeForce 256 0x0100 + GeForce DDR 0x0101 + Quadro 0x0103 + GeForce2 GTS/GeForce2 Pro 0x0150 + GeForce2 Ti 0x0151 + GeForce2 Ultra 0x0152 + Quadro2 Pro 0x0153 diff --git a/src/os-plugins/plugins/xserver/files/ati-install.sh b/src/os-plugins/plugins/xserver/files/ati-install.sh new file mode 100755 index 00000000..662b96bf --- /dev/null +++ b/src/os-plugins/plugins/xserver/files/ati-install.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +cd /opt/openslx/plugin-repo/xserver + +DISTRO=$1 +case $DISTRO in + + ubuntu-9.10*) + ./ubuntu-ng-gfx-install.sh ati ${DISTRO} + ;; + ubuntu-9.04*) + ./ubuntu-ng-gfx-install.sh ati ${DISTRO} + ;; + ubuntu-8.10*) + ./ubuntu-ng-gfx-install.sh ati ${DISTRO} + ;; + ubuntu-*) + ./ubuntu-gfx-install.sh ati ${DISTRO} + ;; + + suse-*) + ./suse-gfx-install.sh ati ${DISTRO} + ;; +esac diff --git a/src/os-plugins/plugins/xserver/files/nvidia-install.sh b/src/os-plugins/plugins/xserver/files/nvidia-install.sh new file mode 100755 index 00000000..aa2b2269 --- /dev/null +++ b/src/os-plugins/plugins/xserver/files/nvidia-install.sh @@ -0,0 +1,138 @@ +#!/bin/bash + +########################################################## +# Installs NVIDIA binary drivers into openslx plugin-repo +########################################################## +PLUGIN_PATH="/opt/openslx/plugin-repo/xserver" + +# we could easily pass this information via calling stage1 script and do not +# need to find it our here ... +DISTRO=$1 + + +# for development we take the only kernel version from normal systems +if [ -L /boot/vmlinuz ]; then + KVERS=$(ls -l /boot/vmlinuz | awk -F "->" '{print $2}'| grep -P -o "2.6.*") +else + KVERS=$(ls /boot/vmlinuz-* | head -n1 | awk -F "->" '{print $2}' | grep -P -o "2.6.*" ) +fi + + +#change to plugin path +cd ${PLUGIN_PATH} + +case ${DISTRO} in + ubuntu-9.10*) + ./ubuntu-ng-gfx-install.sh nvidia ${DISTRO} + ;; + ubuntu-9.04*) + ./ubuntu-ng-gfx-install.sh nvidia ${DISTRO} + ;; + ubuntu-8.10*) + ./ubuntu-ng-gfx-install.sh nvidia ${DISTRO} + ;; + ubuntu*) + ./ubuntu-gfx-install.sh nvidia ${DISTRO} + ;; + suse-1*) + ./suse-gfx-install.sh nvidia ${DISTRO} + ;; + # general purpose nvidia installer script + *) + echo "* Running general NVidia installer (expected in xserver::pkgpath)" + # unpack the nvidia installer; quickhack - expects just one package + echo " * Unpacking installer" + sh packages/NVIDIA-Linux-*.run -a -x >>nvidia-inst.log 2>&1 + # prefix and paths should be matched more closely to each distro + # just demo at the moment ... but working at the moment + # without the kernel module + stdprfx=/opt/openslx/plugin-repo/xserver/nvidia + + # backing up libglx.so and libGLcore.so + BACKUP_PATH=${stdprfx}/../mesa/usr/lib/xorg/modules/extensions + mkdir -p ${BACKUP_PATH} + if [ -f /usr/lib/xorg/modules/extensions/libglx.so ]; then + cp /usr/lib/xorg/modules/extensions/libGLcore.so ${BACKUP_PATH} + cp /usr/lib/xorg/modules/extensions/libglx.so ${BACKUP_PATH} + elif [ -f /usr/X11R6/lib/xorg/modules/extensions/libglx.so ]; then + cp /usr/X11R6/lib/xorg/modules/extensions/libglx.so ${BACKUP_PATH} + cp /usr/X11R6/lib/xorg/modules/extensions/libGLcore.so ${BACKUP_PATH} + touch ${BACKUP_PATH}/X11R6 + fi + if [ -f /usr/lib/libGL.so.1.2 ]; then + cp /usr/lib/libGL.so.1.2 ${BACKUP_PATH}/../../.. + elif [ -f /usr/X11R6/lib/libGL.so.1.2 ]; then + cp /usr/X11R6/lib/libGL.so.1.2 ${BACKUP_PATH}/../../.. + touch ${BACKUP_PATH}/../../../X11R6 + fi + + + # run the lib installer + echo " * Starting the library installer" + echo "Starting the lib installer" >>nvidia-inst.log + $(ls -d NVIDIA-Linux-*)/nvidia-installer -s -q -N --no-abi-note \ + --x-prefix=${stdprfx}/usr --x-library-path=${stdprfx}/usr/lib \ + --x-module-path=${stdprfx}/usr/lib/xorg/modules \ + --opengl-prefix=${stdprfx}/usr --utility-prefix=${stdprfx}/usr \ + --documentation-prefix=${stdprfx}/usr --no-runlevel-check \ + --no-rpms --no-x-check --no-kernel-module \ + --log-file-name=nvidia-lib.log >>nvidia-inst.log 2>&1 + # how to get an idea of the installed kernel? + # run the kernel module creator (should be done for every kernel!?) + kernel=${KVERS} + echo " * Trying to compile a kernel module for $kernel" + echo "Starting the kernel $kernel installer" >>nvidia-inst.log + # we need the .config file in /usr/src/linux or where ever! + # we need scripts/genksyms/genksyms compiled via make scripts in /usr/src/linux + # option available in newer nvidia packages + cd /usr/src/linux-${kernel%-*} + # in suse we have the config file lying there + cp /boot/config-${kernel} .config + ARCH=$(cat .config| grep -o CONFIG_M.86=y |tail -n1|grep -o "[0-9]86") + SUFFIX=${kernel##*-} + #cp -r /usr/src/linux-${kernel%-*}-obj/i${ARCH}/${SUFFIX}/ \ + # /usr/src/linux-${kernel%-*} + make oldconfig >/dev/null 2>&1 + make prepare >/dev/null 2>&1 + cd - >/dev/null 2>&1 + #/usr/src/linux-${kernel%-*} + addopts="--no-cc-version-check" + $(ls -d NVIDIA-Linux-*)/nvidia-installer -s -q -N -K --no-abi-note \ + --kernel-source-path=/usr/src/linux-${kernel%-*} \ + --kernel-include-path=/usr/src/linux-${kernel%-*}-obj/i${ARCH}/${SUFFIX}/include \ + -k ${kernel} \ + --kernel-install-path=/opt/openslx/plugin-repo/xserver/nvidia/modules \ + --no-runlevel-check --no-abi-note --no-rpms ${addopts} \ + --log-file-name=nvidia-kernel.log >>nvidia-inst.log 2>&1 + if [ $? -gt 0 ];then + echo "* kernel module built failed!" + fi + echo " * Have a look into the several *.log files in " + echo " stage1/${DISTRO}/plugin-repo/xserver" + + + # redo some unwanted changes of nvidia-installer + if [ -f ${BACKUP_PATH}/libglx.so ]; then + cp ${BACKUP_PATH}/libGLcore.so /usr/lib/xorg/modules/extensions + cp ${BACKUP_PATH}/libglx.so /usr/lib/xorg/modules/extensions + if [ -f ${BACKUP_PATH}/X11R6 ]; then + cp ${BACKUP_PATH}/libGLcore.so /usr/X11R6/lib/xorg/modules/extensions + cp ${BACKUP_PATH}/libglx.so /usr/X11R6/lib/xorg/modules/extensions + fi + fi + if [ -f ${BACKUP_PATH}/../../../libGL.so.1.2 ]; then + cp ${BACKUP_PATH}/../../../libGL.so.1.2 /usr/lib + ln -sf /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1 + ln -sf /usr/lib/libGL.so.1.2 /usr/lib/libGL.so + elif [ -f ${BACKUP_PATH}/../../../X11R6 ]; then + cp ${BACKUP_PATH}/../../../libGL.so.1.2 /usr/X11R6/lib/ + ln -sf /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1 + ln -sf /usr/lib/libGL.so.1.2 /usr/lib/libGL.so + fi + + + ;; +esac + +# set a proper return value to evaluate it in the calling script +exit 0 diff --git a/src/os-plugins/plugins/xserver/files/suse-gfx-install.sh b/src/os-plugins/plugins/xserver/files/suse-gfx-install.sh new file mode 100755 index 00000000..ac6713fb --- /dev/null +++ b/src/os-plugins/plugins/xserver/files/suse-gfx-install.sh @@ -0,0 +1,330 @@ +#!/bin/bash + +# +# supported: +# nvidia: +# * 10.2 (pkg-installer) +# * 11.0 (zypper rpm packages) +# * 11.1 (zypper rpm packages) +# +# ati: +# * 10.2 (pkg-installer) +# * 11.0 (zypper rpm packages) +# * 11.1 (zypper rpm packages) +# + +# not right any more - removed from script +# is there any busybox in this environment +#BUSYBOX="/mnt/opt/openslx//busybox/busybox" + +BASE=/opt/openslx/plugin-repo/xserver +DISTRO=$2 +cd ${BASE} + +if [ -L /boot/vmlinuz ]; then + KSUFFIX=$(ls -l /boot/vmlinuz | grep -P -o -e "-[a-z]*$" ) + KVERS=$(ls -l /boot/vmlinuz | awk -F "->" '{print $2}'| grep -P -o "2.6.*") +else + KSUFFIX=$(ls /boot/vmlinuz-* | head -n1 | grep -P -o -e "-[a-z]*$" ) + KVERS=$(ls /boot/vmlinuz-* | head -n1 | awk -F "->" '{print $2}' | grep -P -o "2.6.*" ) + +fi + +if [ -z "${KSUFFIX}" ]; then + echo "Could not determine proper local kernel suffix!" + echo "This is needed to install kernel modules for graphics drivers!" + exit 1 +fi + + +buildfglrx() { + # build ATI kernel module + cd ${BASE}/ati/usr/src/kernel-modules/fglrx + rm -rf fglrx.ko >/dev/null 2>&1 + make KVER=${1} >/dev/null 2>&1 + if [ "$?" -eq "0" ]; then + cp fglrx.ko ../../../../modules + else + echo -e "Kernel module for kernel ${1} could not be built!" + fi + cd - >/dev/null 2>&1 +} + + +########################################################################## +# NVidia section +########################################################################## +if [ "$1" = "nvidia" ]; then + if [ -e nvidia/usr/lib/libGL.so.1 ]; then + exit + fi + if [ ! -d nvidia ]; then + mkdir -p nvidia/{modules,usr,temp} + fi + cd nvidia/temp + + case ${DISTRO} in + suse-10.2*) + echo "* Running general NVidia installer (expected in xserver::pkgpath)" + # unpack the nvidia installer; quickhack - expects just one package + echo " * Unpacking installer" + sh ../../packages/NVIDIA-Linux-*.run -a -x >>nvidia-inst.log 2>&1 + # prefix and paths should be matched more closely to each distro + # just demo at the moment ... but working at the moment + # without the kernel module + stdprfx=/opt/openslx/plugin-repo/xserver/nvidia + + # backing up libglx.so and libGLcore.so + bkpprfx=${stdprfx}/../mesa/lib/xorg/modules/extensions + mkdir -p ${bkpprfx} + if [ -f /usr/lib/xorg/modules/extensions/libglx.so ]; then + cp /usr/lib/xorg/modules/extensions/libGLcore.so ${bkpprfx} + cp /usr/lib/xorg/modules/extensions/libglx.so ${bkpprfx} + elif [ -f /usr/X11R6/lib/xorg/modules/extensions/libglx.so ]; then + cp /usr/X11R6/lib/xorg/modules/extensions/libglx.so ${bkpprfx} + cp /usr/X11R6/lib/xorg/modules/extensions/libGLcore.so ${bkpprfx} + touch ${bkpprfx}/../../../../X11R6 + fi + if [ -f /usr/lib/libGL.so.1.2 ]; then + cp /usr/lib/libGL.so.1.2 ${bkpprfx}/../../.. + elif [ -f /usr/X11R6/lib/libGL.so.1.2 ]; then + cp /usr/X11R6/lib/libGL.so.1.2 ${bkpprfx}/../../.. + touch ${bkpprfx}/../../../X11R6 + fi + + + # run the lib installer + echo " * Starting the library installer" + echo "Starting the lib installer" >>nvidia-inst.log + $(ls -d NVIDIA-Linux-*)/nvidia-installer -s -q -N --no-abi-note \ + --x-prefix=${stdprfx}/usr --x-library-path=${stdprfx}/usr/lib \ + --x-module-path=${stdprfx}/usr/lib/xorg/modules \ + --opengl-prefix=${stdprfx}/usr --utility-prefix=${stdprfx}/usr \ + --documentation-prefix=${stdprfx}/usr --no-runlevel-check \ + --no-rpms --no-x-check --no-kernel-module \ + --log-file-name=nvidia-lib.log >>nvidia-inst.log 2>&1 + # how to get an idea of the installed kernel? + # run the kernel module creator (should be done for every kernel!?) + kernel=${KVERS} + echo " * Trying to compile a kernel module for $kernel" + echo "Starting the kernel module installer for $kernel" >>nvidia-inst.log + # we need the .config file in /usr/src/linux or where ever! + # we need scripts/genksyms/genksyms compiled via make scripts in /usr/src/linux + # option available in newer nvidia packages + cd /usr/src/linux-${kernel%-*} + # in suse we have the config file lying there + cp /boot/config-${kernel} .config + ARCH=$(cat .config| grep -o CONFIG_M.86=y |tail -n1|grep -o "[0-9]86") + SUFFIX=${kernel##*-} + cp -r /usr/src/linux-${kernel%-*}-obj/i${ARCH}/${SUFFIX}/ \ + /usr/src/linux-${kernel%-*} + make scripts >/dev/null 2>&1 + make prepare >/dev/null 2>&1 + cd - >/dev/null 2>&1 + #/usr/src/linux-${kernel%-*} + addopts="--no-cc-version-check" + $(ls -d NVIDIA-Linux-*)/nvidia-installer -s -q -N -K --no-abi-note \ + --kernel-source-path=/usr/src/linux-${kernel%-*} \ + -k ${kernel} \ + --kernel-install-path=/opt/openslx/plugin-repo/xserver/nvidia/modules \ + --no-runlevel-check --no-abi-note --no-rpms ${addopts} \ + --log-file-name=nvidia-kernel.log >>nvidia-inst.log 2>&1 + if [ $? -gt 0 ];then + echo "* kernel module built failed!" + echo "* Have a look into the several log files in " + echo " stage1/${DISTRO}/plugin-repo/xserver" + fi + + + # redo some unwanted changes of nvidia-installer + if [ -f ${bkpprfx}/libglx.so ]; then + cp ${bkpprfx}/libGLcore.so /usr/lib/xorg/modules/extensions + cp ${bkpprfx}/libglx.so /usr/lib/xorg/modules/extensions + if [ -f ${bkpprfx}/X11R6 ]; then + cp ${bkpprfx}/libGLcore.so /usr/X11R6/lib/xorg/modules/extensions + cp ${bkpprfx}/libglx.so /usr/X11R6/lib/xorg/modules/extensions + fi + fi + if [ -f ${bkpprfx}/../../../libGL.so.1.2 ]; then + cp ${bkpprfx}/../../../libGL.so.1.2 /usr/lib + ln -sf /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1 + ln -sf /usr/lib/libGL.so.1.2 /usr/lib/libGL.so + fi + ;; + suse-11.*) + echo "* Downloading nvidia rpm packages... this could take some time..." + # add repository for nvidia drivers + case ${DISTRO} in + suse-11.0*) + REPO=http://download.nvidia.com/opensuse/11.0/ + ;; + suse-11.1*) + REPO=http://download.nvidia.com/opensuse/11.1/ + ;; + esac + zypper --no-gpg-checks addrepo ${REPO} NVIDIA > /dev/null 2>&1 + # get URLs by virtually installing nvidia-OpenGL driver + zypper --no-gpg-checks -n -vv install -D \ + nvidia-gfxG01-kmp${KSUFFIX} > logfile 2>&1 + + # zypper refresh is requested if something is not found + if [ "1" -le "$(cat logfile | grep -o "zypper refresh"| wc -l)" ]; then + zypper --no-gpg-checks refresh >/dev/null 2>&1 + fi + + # take unique urls from logfile + URLS=$(cat logfile | grep -P -o "http://.*?rpm " | sort -u | xargs) + for RPM in $URLS; do + RNAME=$(echo ${RPM} | sed -e 's,^.*/\(.*\)$,\1,g') + if [ ! -e ${RNAME} ]; then + wget ${RPM} > /dev/null 2>&1 + fi + # We use rpm2cpio from suse to extract + if [ -f ${RNAME} ]; then + rpm2cpio ${RNAME} | cpio -id > /dev/null 2>&1 + fi + done + if [ -d ./usr/X11R6/lib ]; then + mv ./usr/X11R6/lib/* ./usr/lib/ + fi + if [ $(find ./usr/ -name *.so* 2>/dev/null | wc -l ) -eq 0 ]; then + echo " NVIDIA files failed to install via zypper!!" + exit + fi + + rm -rf ../usr + if [ -d ./usr ]; then + mv ./usr .. + fi + find lib/ -name "*.ko" -exec mv '{}' ../modules \; > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo " Could not find kernel module nvidia.ko!"; + fi + + cd .. + ;; + esac + + rm -rf temp/ + cd .. + +fi + + +############################################################################ +# ATI section +############################################################################ +if [ "$1" = "ati" ]; then + if [ -e ati/usr/lib/libGL.so.1.2 ]; then + exit + fi + + mkdir -p ati/modules ati/temp + + case ${DISTRO} in + suse-10.2*) + ### SUSE 10.2 section ### + echo "* Extracting ATI package (expected in xserver::pkgpath) ... this could take some time..." + + PKG=`find packages/ -name ati-driver*\.run | tail -n1` + PKG_VERSION=`head ${PKG} | grep -P -o "[0-9]\.[0-9]{3}"` + + chmod +x ${PKG} + + ${PKG} --extract ati/temp >/dev/null 2>&1 + + cd ati/temp/ + RPM=`./ati-installer.sh ${PKG_VERSION} --buildpkg SuSE/SUSE102-IA32 2>&1 | grep Package | awk '{print $2}' | tail -n1` + + cd .. + rpm2cpio ${RPM} 2>/dev/null | cpio -id >/dev/null 2>&1 + + + if [ -d ./usr/X11R6/lib ]; then + mv ./usr/X11R6/lib/* ./usr/lib/ + fi + if [ -d etc ]; then + cp -r etc/* /etc/ + fi + + # cleanup + rm -rf ${RPM} + cd .. + rm -rf ${PKG} + + + buildfglrx ${KVERS} + + ;; + suse-11.*) + ### SUSE 11.0 Section ### + + echo "* Downloading ati rpm packages... this could take some time..." + cd ati/temp + + # add repository for ATI drivers + case ${DISTRO} in + suse-11.0*) + zypper --no-gpg-checks addrepo http://www2.ati.com/suse/11.0/ ATI > /dev/null 2>&1 + ;; + suse-11.1*) + zypper --no-gpg-checks addrepo http://www2.ati.com/suse/11.1/ ATI > /dev/null 2>&1 + ;; + esac + # get URLs by virtually installing fglrx-OpenGL driver + zypper --no-gpg-checks -n -vv install -D ati-fglrxG01-kmp${KSUFFIX} \ + x11-video-fglrxG01 > logfile 2>&1 + + # zypper refresh is requested if something is not found + if [ "1" -le "$(cat logfile | grep -o "zypper refresh" | wc -l)" ]; then + zypper --no-gpg-check refresh >/dev/null 2>&1 + fi + + # take unique urls from logfile + URLS=$(cat logfile | grep -P -o "http://.*?rpm " | grep fglrx | sort -u | xargs) + for RPM in $URLS; do + RNAME=$(echo ${RPM} | sed -e 's,^.*/\(.*\)$,\1,g') + if [ ! -e ${RNAME} ]; then + wget ${RPM} > /dev/null 2>&1 + fi + # We use rpm2cpio from suse to extract -> propably new rpm version + if [ -f ${RNAME} ]; then + rpm2cpio ${RNAME} | cpio -id > /dev/null 2>&1 + fi + done + + if [ -d ./usr/X11R6/lib ]; then + mv ./usr/X11R6/lib/* ./usr/lib/ > /dev/null 2>&1 + fi + if [ $(find ./usr/ -name *.so* 2>/dev/null | wc -l ) -eq 0 ]; then + echo " ATI files failed to install via zypper!!" + exit + fi + + mv ./usr .. + mv ./etc .. + + find lib/ -name "*.ko" -exec mv {} ../modules \; >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo " Could not find kernel module fglrx.ko!"; + fi + + ;; + esac + cd .. + + # OpenGl implementation (libGL?) expect fglrx_dri.so in /usr/X11R6/lib/dri/ + if [ ! -f /usr/X11R6/lib/modules/dri/fglrx_dri.so -a \ + ! -f usr/X11R6/lib/modules/dri/fglrx_dri.so ]; then + if [ ! -d /usr/X11R6/lib/modules/dri ]; then + mkdir -p /usr/X11R6/lib/modules/dri + fi + if [ -f usr/lib/dri/fglrx_dri.so ]; then + ln -s ${BASE}/ati/usr/lib/dri/fglrx_dri.so \ + /usr/X11R6/lib/modules/dri/fglrx_dri.so + fi + fi + + rm -rf temp/ +fi + diff --git a/src/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh b/src/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh new file mode 100755 index 00000000..c6ac17c9 --- /dev/null +++ b/src/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh @@ -0,0 +1,124 @@ +#!/bin/sh + +# gets needed packages for ubuntu nvidia/ati drivers +# $1 = nvidia | ati +PLUGIN_FOLDER="/opt/openslx/plugin-repo/xserver" +TMP_FOLDER="/tmp/slx-plugin/xserver" +TARGET="$1" +DISTRO="$2" + +if [ ! -d "${PLUGIN_FOLDER}" ]; then + mkdir -p "${PLUGIN_FOLDER}/modules" +fi + +# change into temp +cd ${TMP_FOLDER} > /dev/null + +if [ -e "/boot/vmlinuz" ]; then + KVER=$(ls -ahl '/boot/vmlinuz' | sed -e 's,^.*vmlinuz-,,g') +else + KVER=$(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1) +fi + + +echo " * downloading restricted modules... this may take a while" +# TODO: remove commented out "> /dev/null ..." later... multiple times +# in this script! check all comments! +aptitude download linux-restricted-modules-${KVER} #> /dev/null 2&>1 +if [ $? -eq 1 ]; then + echo " * Didn't get restricted modules. Exit now!" + #TODO: remove sh when development is finished + sh + exit +fi +MODULE_DEB=$(ls linux-restricted-modules-*.deb | tail -n1) +dpkg-deb -x ${MODULE_DEB} ${TMP_FOLDER}/modules + +case ${TARGET} in + ati) + mkdir -p ${PLUGIN_FOLDER}/ati + mkdir -p ${PLUGIN_FOLDER}/ati/modules + + echo " * downloading fglrx xorg package... this may take a while" + aptitude download xorg-driver-fglrx #> /dev/null 2&>1 + if [ $? -eq 1 ]; then + echo " * Didn't get package xorg-driver-fglrx! Exit now!" + #TODO: remove sh when development is finished + sh + exit + fi + FGLRX_DEB=$(ls xorg-driver-fglrx_*.deb | tail -n1) + # extract $DEB + dpkg-deb -x ${FGLRX_DEB} ${PLUGIN_FOLDER}/ati + + # assemble module + cd modules/lib/linux-restricted-modules/${KVER}/ + ld_static -d -r -o ${PLUGIN_FOLDER}/ati/modules/fglrx.ko fglrx/* + + if [ -f /usr/lib/dri/fglrx_dri.so ]; then + mv /usr/lib/dri/fglrx_dri.so /usr/lib/dri/fglrx_dri.so.slx + else + # remove link + rm -rf /usr/lib/dri/fglrx_dri.so + fi + ln -s ${PLUGIN_FOLDER}/ati/usr/lib/dri/fglrx_dri.so \ + /usr/lib/dri/fglrx_dri.so + + # Recent ATI drivers expect the driver link in /xyz + if [ ! -d /usr/X11R6/lib/modules/dri ]; then + mkdir -p /usr/X11R6/lib/modules/dri + fi + ln -s ${PLUGIN_FOLDER}/ati/usr/lib/dri/fglrx_dri.so \ + /usr/X11R6/lib/modules/dri/fglrx_dri.so + + # cleanup + cd ${PLUGIN_FOLDER}/ati + + #@Volker: We need /etc-files - there is a database + # file for the fglrx-driver in stage3 !!! + #rm -rf ./etc + #TODO: check for more cleanups when the main part works! + + ;; + + + nvidia) + mkdir -p ${PLUGIN_FOLDER}/nvidia + mkdir -p ${PLUGIN_FOLDER}/nvidia/modules + + echo " * downloading fglrx xorg package... this may take a while" + aptitude download nvidia-glx-new #> /dev/null 2&>1 + if [ $? -eq 1 ]; then + echo " * Didn't get package nvidia-glx-new!" + #TODO: remove sh when development is finished + sh + exit + fi + #Bastian: what is this? please explain + #aptitude download nvidia-glx + NVIDIA_DEB=$(ls nvidia-glx*.deb | tail -n1) + # extract $DEB + dpkg-deb -x ${NVIDIA_DEB} ${PLUGIN_FOLDER}/nvidia + + # assemble module - we just need the new one here + # TODO: modules for older graphics hardware can be found here + cd modules/lib/linux-restricted-modules/${KVER}/ + ld_static -d -r -o ${PLUGIN_FOLDER}/nvidia/modules/nvidia.ko nvidia_new/* + + #TODO: if we use this part, we need to copy the check from ati, too! + #if [ -f /usr/lib/dri/fglrx_dri.so ]; then + # mv /usr/lib/dri/fglrx_dri.so /usr/lib/dri/fglrx_dri.so.slx + #else + # # remove link + # rm -rf /usr/lib/dri/fglrx_dri.so + #fi + #ln -s ${PLUGIN_FOLDER}/nvidia/nvroot/usr/lib/dri/nvidia_dri.so \ + # /usr/lib/dri/fglrx_dri.so + + # cleanup + cd ${PLUGIN_FOLDER}/nvidia + rm -rf ./etc + #TODO: check for more cleanups when the main part works! + ;; +esac + diff --git a/src/os-plugins/plugins/xserver/files/ubuntu-ng-gfx-install.sh b/src/os-plugins/plugins/xserver/files/ubuntu-ng-gfx-install.sh new file mode 100755 index 00000000..259f2650 --- /dev/null +++ b/src/os-plugins/plugins/xserver/files/ubuntu-ng-gfx-install.sh @@ -0,0 +1,236 @@ +#!/bin/sh + +# gets needed packages for ubuntu nvidia/ati drivers +# $1 = nvidia | ati +PLUGIN_FOLDER="/opt/openslx/plugin-repo/xserver" +TMP_FOLDER="/tmp/slx-plugin/xserver" +TARGET="$1" + +if [ ! -d "${PLUGIN_FOLDER}" ]; then + mkdir -p "${PLUGIN_FOLDER}/modules" +fi + +# change into temp +cd ${TMP_FOLDER} > /dev/null + +if [ -e "/boot/vmlinuz" ]; then + KVER=$(ls -ahl '/boot/vmlinuz' | sed -e 's,^.*vmlinuz-,,g') +else + KVER=$(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1) +fi + +# TODO: check for build-essential !! + +if [ ! -e "/usr/sbin/dkms" ]; then + echo -n " * DKMS not found: installing .." + aptitude -y install dkms > /dev/null 2>&1 + if [ $? -eq 1 ]; then + echo "fail" + echo " * Didn't get package dkms! Exit now!" + exit 1 + else + echo "ok" + fi +fi + +# TODO: find a more clean way for this workaround +# the current dkms script included in ubuntu is trying to compile +# kernel modules under the user nobody using "su" which is not +# working in the installation phase of the plugin. + +if [ $(grep -c "getent passwd nobody" /usr/sbin/dkms) -ne 0 ]; then + echo -n " * Patch DKMS not to run under user nobody .." + sed -i "s/getent passwd nobody/getent passwd N0/" \ + /usr/sbin/dkms + echo "ok" +fi + +case ${TARGET} in + ati) + mkdir -p ${PLUGIN_FOLDER}/ati/modules + + echo -n " * downloading fglrx xorg package... " + aptitude download xorg-driver-fglrx > /dev/null 2>&1 + if [ $? -eq 1 ]; then + echo "fail" + echo " * Didn't get package xorg-driver-fglrx! Exit now!" + exit 1 + else + echo "ok" + fi + FGLRX_DEB=$(ls xorg-driver-fglrx_*.deb | tail -n1) + # extract $DEB + dpkg-deb -x ${FGLRX_DEB} ${PLUGIN_FOLDER}/ati + + echo -n " * downloading fglrx kernel package... " + aptitude download fglrx-kernel-source >/dev/null 2>&1 + if [ $? -eq 1 ]; then + echo "fail" + echo " * Didn't get package fglrx-kernel-source!" + exit 1 + else + echo "ok" + fi + + FGLRX_KERNEL_DEB=$(ls fglrx-kernel-source*.deb | tail -n1) + dpkg-deb -x ${FGLRX_KERNEL_DEB} / + + FGLRX_SOURCE_DIR=$(find /usr/src/fglrx-${FGLRX_DRIVER_VERSION}* \ + -maxdepth 0 -type d) + FGLRX_FULL_VERSION=$(echo ${FGLRX_SOURCE_DIR} | \ + sed -e 's/\/usr\/src\/fglrx-//') + + FGLRX_DKMS_DIR="/var/lib/dkms/fglrx/${FGLRX_FULL_VERSION}" + + if [ -d /var/lib/dkms/fglrx/${FGLRX_FULL_VERSION} ]; then + if [ ! -L ${FGLRX_DKMS_DIR}/source ]; then + ln -sf ${FGLRX_SOURCE_DIR} ${FGLRX_DKMS_DIR}/source + fi + else + echo -n " * Add fglrx kernel module to dkms tree... " + dkms add -m fglrx -v ${FGLRX_FULL_VERSION} >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok" + else + echo "fail" + exit 1 + fi + fi + + ###### build kernel module ###### + echo -n " * Building fglrx kernel module for kernel ${KVER}... " + dkms -m fglrx -v ${FGLRX_FULL_VERSION} \ + -k ${KVER} \ + --kernelsourcedir /usr/src/linux-headers-${KVER}/ \ + --no-prepare-kernel \ + --no-clean-kernel \ + build \ + > /tmp/dkms.log 2>&1 + if [ $? -eq 0 ]; then + echo "ok" + else + if $(cat /tmp/dkms.log | grep -q "has already"); then + echo "--- fglrx module already built ---" + else + echo "fail" + echo "------ dkms.log -----" + cat /tmp/dkms.log + echo "---------------------" + rm /tmp/dkms.log + exit 1 + fi + fi + + FGLRX_MODULE_PATH=$(find ${FGLRX_DKMS_DIR}/${KVER}/ -name fglrx.ko \ + | tail -n1 ) + + cp ${FGLRX_MODULE_PATH} ${PLUGIN_FOLDER}/ati/modules/fglrx.ko + + # cleanup + if [ -f /usr/lib/dri/fglrx_dri.so ]; then + mv /usr/lib/dri/fglrx_dri.so /usr/lib/dri/fglrx_dri.so.slx + else + # remove link + rm -rf /usr/lib/dri/fglrx_dri.so + fi + ln -s ${PLUGIN_FOLDER}/ati/usr/lib/dri/fglrx_dri.so \ + /usr/lib/dri/fglrx_dri.so + + # cleanup + rm /tmp/dkms.log + cd ${PLUGIN_FOLDER}/ati + + ;; + + + nvidia) + mkdir -p ${PLUGIN_FOLDER}/nvidia/modules + + NVIDIA_DRIVER_VERSION=173 + + echo -n " * downloading nvidia xorg package... " + aptitude download nvidia-glx-${NVIDIA_DRIVER_VERSION} > /dev/null 2>&1 + if [ $? -eq 1 ]; then + echo "fail" + echo " * Didn't get package nvidia-glx-${NVIDIA_DRIVER_VERSION}!" + exit 1 + else + echo "ok" + fi + + echo -n " * downloading nvidia kernel package... " + aptitude download nvidia-${NVIDIA_DRIVER_VERSION}-kernel-source >/dev/null 2>&1 + if [ $? -eq 1 ]; then + echo "fail" + echo " * Didn't get package nvidia-${NVIDIA_DRIVER_VERSION}-kernel-source!" + exit 1 + else + echo "ok" + fi + + NVIDIA_DEB=$(ls -1 nvidia-glx*.deb | tail -n1) + NVIDIA_KERNEL_DEB=$(ls -1 nvidia-${NVIDIA_DRIVER_VERSION}-kernel-source*.deb | tail -n1) + # extract $DEB + dpkg-deb -x ${NVIDIA_DEB} ${PLUGIN_FOLDER}/nvidia + # extract the sources deb to root + dpkg-deb -x ${NVIDIA_KERNEL_DEB} / + + NVIDIA_SOURCE_DIR=$(find /usr/src/nvidia-${NVIDIA_DRIVER_VERSION}* \ + -maxdepth 0 -type d) + NVIDIA_FULL_VERSION=$(echo ${NVIDIA_SOURCE_DIR} | \ + sed -e 's/\/usr\/src\/nvidia-//') + + NVIDIA_DKMS_DIR="/var/lib/dkms/nvidia/${NVIDIA_FULL_VERSION}" + + if [ -d /var/lib/dkms/nvidia/${NVIDIA_FULL_VERSION} ]; then + if [ ! -L ${NVIDIA_DKMS_DIR}/source ]; then + ln -sf ${NVIDIA_SOURCE_DIR} ${NVIDIA_DKMS_DIR}/source + fi + else + echo -n " * Add nvidia kernel module to dkms tree... " + dkms add -m nvidia -v ${NVIDIA_FULL_VERSION} >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo "ok" + else + echo "fail" + exit 1 + fi + fi + + ###### build kernel module ###### + echo -n " * Building nvidia kernel module for kernel ${KVER}... " + dkms -m nvidia -v ${NVIDIA_FULL_VERSION} \ + -k ${KVER} \ + --kernelsourcedir /usr/src/linux-headers-${KVER}/ \ + --no-prepare-kernel \ + --no-clean-kernel \ + build \ + > /tmp/dkms.log 2>&1 + if [ $? -eq 0 ]; then + echo "ok" + else + if $(cat /tmp/dkms.log | grep -q "has already"); then + echo "--- nvidia module already built ---" + else + echo "fail" + echo "------ dkms.log -----" + cat /tmp/dkms.log + echo "---------------------" + rm /tmp/dkms.log + exit 1 + fi + fi + + NVIDIA_MODULE_PATH=$(find ${NVIDIA_DKMS_DIR}/${KVER}/ -name \ + nvidia.ko | tail -n 1) + + cp ${NVIDIA_MODULE_PATH} ${PLUGIN_FOLDER}/nvidia/modules/nvidia.ko + + # cleanup + rm /tmp/dkms.log + cd ${PLUGIN_FOLDER}/nvidia + rm -rf ./etc + #TODO: check for more cleanups when the main part works! + ;; +esac + |