diff options
author | Bastian Wissler | 2009-02-24 17:54:10 +0100 |
---|---|---|
committer | Bastian Wissler | 2009-02-24 17:54:10 +0100 |
commit | 1c1c67a23ba9056188715138170df8fe0fa76564 (patch) | |
tree | 75ff1bfc187c33e760188e194936a0da644d32e4 /os-plugins | |
parent | More sensible module loading for qemu/kvm ... (diff) | |
download | core-1c1c67a23ba9056188715138170df8fe0fa76564.tar.gz core-1c1c67a23ba9056188715138170df8fe0fa76564.tar.xz core-1c1c67a23ba9056188715138170df8fe0fa76564.zip |
xserver plugin:
* fixed suse-10.2 yet again (nvidia and fglrx-driver should work now)
* sanity check for ati Xorg-module existence
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2634 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r-- | os-plugins/plugins/xserver/XX_xserver.sh | 37 | ||||
-rwxr-xr-x | os-plugins/plugins/xserver/files/nvidia-install.sh | 2 | ||||
-rwxr-xr-x | os-plugins/plugins/xserver/files/suse-gfx-install.sh | 116 |
3 files changed, 125 insertions, 30 deletions
diff --git a/os-plugins/plugins/xserver/XX_xserver.sh b/os-plugins/plugins/xserver/XX_xserver.sh index fbbd21f0..18c671c3 100644 --- a/os-plugins/plugins/xserver/XX_xserver.sh +++ b/os-plugins/plugins/xserver/XX_xserver.sh @@ -52,27 +52,30 @@ if [ -e /initramfs/plugin-conf/xserver.conf -a \ waitfor /etc/hwinfo.data 10000 if [ $(grep -i -m 1 'Module: fglrx' \ - /etc/hwinfo.data | wc -l) -ge "1" -a $xserver_prefnongpl -eq 1 ] + /etc/hwinfo.gfxcard | wc -l) -ge "1" -a $xserver_prefnongpl -eq 1 ] then # we have an ati card here - ATI=1 PLUGIN_ROOTFS="/opt/openslx/plugin-repo/xserver/ati" + if [ -f /mnt${PLUGIN_ROOTFS}/usr/X11R6/lib/dri/fglrx_dri.so -o \ + -f /mnt${PLUGIN_ROOTFS}/usr/lib/dri/fglrx_dri.so ]; then - # this will be written before standard module path into xorg.conf - MODULE_PATH="${PLUGIN_ROOTFS}/usr/lib/xorg/modules/\,\ -${PLUGIN_ROOTFS}/usr/X11R6/lib/modules/\," - xmodule="fglrx" - PLUGIN_PATH="/mnt/${PLUGIN_ROOTFS}" - - # we need some database for driver initialization - cp -r ${PLUGIN_PATH}/etc/* /mnt/etc - - # if fglrx_dri.so is linked wrong -> we have to link it here - if [ "1" -eq "$( ls -l /usr/lib/dri/fglrx_dri.so \ - | grep -o "/var/X11R6.*so$" | wc -l )" ]; then - ln -s ${PLUGIN_ROOTFS}/usr/lib/dri/fglrx_dri.so \ - ${glliblinks}dri/fglrx_dri.so - fi + # this will be written before standard module path into xorg.conf + MODULE_PATH="${PLUGIN_ROOTFS}/usr/lib/xorg/modules/\,\ + ${PLUGIN_ROOTFS}/usr/X11R6/lib/modules/\," + xmodule="fglrx" + PLUGIN_PATH="/mnt/${PLUGIN_ROOTFS}" + + # we need some database for driver initialization + cp -r ${PLUGIN_PATH}/etc/* /mnt/etc + + # if fglrx_dri.so is linked wrong -> we have to link it here + if [ "1" -eq "$( ls -l /usr/lib/dri/fglrx_dri.so \ + | grep -o "/var/X11R6.*so$" | wc -l )" ]; then + ln -s ${PLUGIN_ROOTFS}/usr/lib/dri/fglrx_dri.so \ + ${glliblinks}dri/fglrx_dri.so + fi + ATI=1 + fi elif [ $(grep -i -m 1 'Module: nvidia' \ /etc/hwinfo.gfxcard | wc -l) -ge "1" -a $xserver_prefnongpl -eq 1 ] then diff --git a/os-plugins/plugins/xserver/files/nvidia-install.sh b/os-plugins/plugins/xserver/files/nvidia-install.sh index 4a82e123..86ecaf94 100755 --- a/os-plugins/plugins/xserver/files/nvidia-install.sh +++ b/os-plugins/plugins/xserver/files/nvidia-install.sh @@ -28,7 +28,7 @@ case ${DISTRO} in ubuntu*) ./ubuntu-gfx-install.sh nvidia ${DISTRO} ;; - suse-11.*) + suse-1*) ./suse-gfx-install.sh nvidia ${DISTRO} ;; # general purpose nvidia installer script diff --git a/os-plugins/plugins/xserver/files/suse-gfx-install.sh b/os-plugins/plugins/xserver/files/suse-gfx-install.sh index 3a36a3dc..eb985f47 100755 --- a/os-plugins/plugins/xserver/files/suse-gfx-install.sh +++ b/os-plugins/plugins/xserver/files/suse-gfx-install.sh @@ -1,11 +1,11 @@ -#!/bin/sh +#!/bin/bash # # supported: # nvidia: # * 10.2 (pkg-installer) # * 11.0 (zypper rpm packages) -# * not yet - soon - 11.1 +# * 11.1 (zypper rpm packages) # # ati: # * 10.2 (pkg-installer) @@ -34,9 +34,6 @@ 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 -#else -# echo -e "Kernel-Suffix: ${KSUFFIX}" -# echo -e "Kernel-version:${KVERS}" fi @@ -58,31 +55,123 @@ buildfglrx() { # 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 - if [ -e nvidia/usr/lib/libGL.so.1 ]; then - exit - fi ############################################################ ## SUSE 11.0 Section ## ############################################################ 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 + elif [ -f ${bkpprfx}/../../../X11R6 ]; then + cp ${bkpprfx}/../../../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 + ;; suse-11.*) echo "* Downloading nvidia rpm packages... this could take some time..." # add repository for nvidia drivers case ${DISTRO} in suse-11.0*) - zypper --no-gpg-checks addrepo http://download.nvidia.com/opensuse/11.0/ NVIDIA > /dev/null 2>&1 + REPO=http://download.nvidia.com/opensuse/11.0/ ;; suse-11.1*) - zypper --no-gpg-checks addrepo http://download.nvidia.com/opensuse/11.1/ NVIDIA > /dev/null 2>&1 + REPO=http://download.nvidia.com/opensuse/11.1/ ;; esac - # get URLs by virtually installing nvidia-OpenGL driver + 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 @@ -147,6 +236,9 @@ if [ "$1" = "ati" ]; then mv ./usr/X11R6/lib/* ./usr/lib/ + if [ -d etc ]; then + cp -r etc/* /etc/ + fi # cleanup rm -rf ${RPM} @@ -197,7 +289,7 @@ if [ "$1" = "ati" ]; then find lib/ -name "*.ko" -exec mv {} ../modules \; >/dev/null 2>&1 if [ $? -ne 0 ]; then - echo "Could not find kernel module nvidia.ko!"; + echo "Could not find kernel module fglrx.ko!"; fi ;; |