From 9d72d3bdc2ff58370a7918bf9c8c3f8703cd2a0f Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Tue, 20 Jan 2009 15:54:56 +0000 Subject: * dkms+fglrx on ubuntu 8.10 * minor changes to nvidia stuff git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2507 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/plugins/xserver/files/ati-install.sh | 6 +- os-plugins/plugins/xserver/files/nvidia-install.sh | 6 +- .../xserver/files/ubuntu-8.10-gfx-install.sh | 97 ++++++++++++++++------ 3 files changed, 78 insertions(+), 31 deletions(-) (limited to 'os-plugins') diff --git a/os-plugins/plugins/xserver/files/ati-install.sh b/os-plugins/plugins/xserver/files/ati-install.sh index 67f261b8..9c5a0139 100755 --- a/os-plugins/plugins/xserver/files/ati-install.sh +++ b/os-plugins/plugins/xserver/files/ati-install.sh @@ -8,8 +8,8 @@ RELEASE=$(lsb_release -r) if [ "1" -eq "$(echo ${DISTRO} | grep 'Ubuntu' | wc -l)" ]; then # we have Ubuntu - run ubuntu-gfx-install - echo "* Using Ubuntu packages to install modules and libs" - if [ "8.10" = $(echo ${DISTRO} | awk '{print $2}' ) ]; then + echo "* Using Ubuntu packages to install ati modules and libs" + if [ "8.10" = "$(echo ${RELEASE} | awk '{print $2}' )" ]; then ./ubuntu-8.10-gfx-install.sh ati else ./ubuntu-gfx-install.sh ati @@ -21,7 +21,7 @@ fi # SUSE gfx-install.sh skript if [ "1" -eq "$(lsb_release -i | grep 'SUSE' | wc -l)" ]; then # we have SuSE - run ubuntu-gfx-install - echo "* Using SuSE packages to install modules and libs" + echo "* Using SuSE packages to install ati modules and libs" ./suse-gfx-install.sh ati exit fi diff --git a/os-plugins/plugins/xserver/files/nvidia-install.sh b/os-plugins/plugins/xserver/files/nvidia-install.sh index 7e52cea6..218020d5 100755 --- a/os-plugins/plugins/xserver/files/nvidia-install.sh +++ b/os-plugins/plugins/xserver/files/nvidia-install.sh @@ -19,8 +19,8 @@ cd ${PLUGIN_PATH} # Ubuntu gfx-install.sh skript if [ "1" -eq "$(echo ${DISTRO} | grep 'Ubuntu' | wc -l)" ]; then # we have Ubuntu - run ubuntu-gfx-install - echo "* Using Ubuntu packages to install modules and libs" - if [ "8.10" = $(echo ${RELEASE}| awk '{print $2}') ]; then + echo "* Using Ubuntu packages to install nvidia modules and libs" + if [ "8.10" = "$(echo ${RELEASE}| awk '{print $2}')" ]; then ./ubuntu-8.10-gfx-install.sh nvidia else ./ubuntu-gfx-install.sh nvidia @@ -33,7 +33,7 @@ fi # SUSE gfx-install.sh skript if [ "1" -eq "$(lsb_release -i | grep 'SUSE' | wc -l)" ]; then # we have SUSE - run ubuntu-gfx-install - echo "* Using SuSE packages to install modules and libs" + echo "* Using SuSE packages to install nvidia modules and libs" ./suse-gfx-install.sh nvidia exit fi diff --git a/os-plugins/plugins/xserver/files/ubuntu-8.10-gfx-install.sh b/os-plugins/plugins/xserver/files/ubuntu-8.10-gfx-install.sh index 0bdeb90f..68212ecf 100755 --- a/os-plugins/plugins/xserver/files/ubuntu-8.10-gfx-install.sh +++ b/os-plugins/plugins/xserver/files/ubuntu-8.10-gfx-install.sh @@ -29,9 +29,7 @@ case ${TARGET} in if [ $? -eq 1 ]; then echo "fail" echo " * Didn't get package xorg-driver-fglrx! Exit now!" - #TODO: remove sh when development is finished - sh - exit + exit 1 else echo "ok" fi @@ -39,21 +37,66 @@ case ${TARGET} in # extract $DEB dpkg-deb -x ${FGLRX_DEB} ${PLUGIN_FOLDER}/ati - echo -n " * downloading fglrx kernel package..." + 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 + exit 1 else echo "ok" fi - FGLRX_KERNEL_DEB=$(ls fglrx-kernel-sources*.deb | tail -n1) + FGLRX_KERNEL_DEB=$(ls fglrx-kernel-source*.deb | tail -n1) dpkg-deb -x ${FGLRX_KERNEL_DEB} / - bash + 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 + echo "fail" + echo "------ dkms.log -----" + cat /tmp/dkms.log + echo "---------------------" + rm /tmp/dkms.log + exit 1 + fi + + FGLRX_MODULE_PATH=$(find ${FGLRX_DKMS_DIR}/${KVER}/ -name fglrx.ko) + + 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 @@ -64,6 +107,7 @@ case ${TARGET} in /usr/lib/dri/fglrx_dri.so # cleanup + rm /tmp/dkms.log cd ${PLUGIN_FOLDER}/ati ;; @@ -79,17 +123,17 @@ case ${TARGET} in if [ $? -eq 1 ]; then echo "fail" echo " * Didn't get package nvidia-glx-${NVIDIA_DRIVER_VERSION}!" - exit + exit 1 else echo "ok" fi - echo -n " * downloading nvidia kernel package..." + 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 + exit 1 else echo "ok" fi @@ -109,43 +153,46 @@ case ${TARGET} in NVIDIA_DKMS_DIR="/var/lib/dkms/nvidia/${NVIDIA_FULL_VERSION}/" if [ -d /var/lib/dkms/nvidia/${NVIDIA_FULL_VERSION} ]; then - if [ ! -L ${NVIDI_DKMS_DIR}/source ]; 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 - bash - - ###### build kernel module ###### - echo -n " * Building nvidia Kernel Module for Kernel ${KVER} .. " + 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 \ - > /dev/null 2>&1 + > /tmp/dkms.log 2>&1 if [ $? -eq 0 ]; then echo "ok" else echo "fail" - exit + echo "------ dkms.log -----" + cat /tmp/dkms.log + echo "---------------------" + rm /tmp/dkms.log + exit 1 fi NVIDIA_MODULE_PATH=$(find ${NVIDIA_DKMS_DIR}/${KVER}/ -name nvidia.ko) - #module is now under /var/lib/dkms/nvidia/${NVIDIA_DRIVER_VERSION}./${KVER}/iX86/module/nvidia.ko - # TODO: rest & cleanup :) - ln -sf ${NVIDIA_MODULE_PATH} ${PLUGIN_FOLDER}/nvidia/modules/nvidia.ko - - # 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/* + 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! -- cgit v1.2.3-55-g7522