diff options
author | Bastian Wissler | 2008-08-25 19:36:43 +0200 |
---|---|---|
committer | Bastian Wissler | 2008-08-25 19:36:43 +0200 |
commit | ec54ff04cea01000475c3dd783a23f5176ffb42b (patch) | |
tree | dfc00b72e8a3ec8761f02c93f5c528f9ab91af5f /os-plugins | |
parent | Improved Synaptics Touchpad detection (via dmesg). (diff) | |
download | core-ec54ff04cea01000475c3dd783a23f5176ffb42b.tar.gz core-ec54ff04cea01000475c3dd783a23f5176ffb42b.tar.xz core-ec54ff04cea01000475c3dd783a23f5176ffb42b.zip |
changed nvidia-install.sh to support module compilation!
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2093 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rwxr-xr-x | os-plugins/plugins/xserver/files/nvidia-install.sh | 118 |
1 files changed, 67 insertions, 51 deletions
diff --git a/os-plugins/plugins/xserver/files/nvidia-install.sh b/os-plugins/plugins/xserver/files/nvidia-install.sh index 2d50bb1c..850015df 100755 --- a/os-plugins/plugins/xserver/files/nvidia-install.sh +++ b/os-plugins/plugins/xserver/files/nvidia-install.sh @@ -1,72 +1,88 @@ #!/bin/sh - +########################################################## +# Installs NVIDIA binary drivers into openslx plugin-repo +########################################################## +# +# $1 should be package folder +# $2 is temporary folder - defaults to /opt/openslx/plugin-repo/xserver/nvidia/tmp +# set -x +PLUGIN_PATH="/opt/openslx/plugin-repo/xserver" +TMP_FOLDER="$2" +PKG_FOLDER="$1" -# local path -FOLDER=$(pwd) - -# temp path -TEMP_FOLDER="$1" -if [ "${TEMP_FOLDER}" -eq "" ]; then - TEMP_FOLDER=${FOLDER} +if [ "${TMP_FOLDER}" -eq "" ]; then + TMP_FOLDER="${PLUGIN_PATH}/nvidia/tmp" fi +if [ ! -d ${TMP_FOLDER} ]; then + mkdir -p ${TMP_FOLDER} +fi +# change working directory to ${TMP_FOLDER} +pushd ${TMP_FOLDER} - -# file to call - should be replaced with argument -FILE=NVIDIA-Linux-*.run - -# kernel version (not really useful in this context - on a server) -# TODO: we need to fix this for stage1 chroot -KVERS=$(uname -r) - -# driver path - install modules in this path -DPATH=lib/modules/${KVERS}/kernel/drivers - -if [ ! -d $TEMP_FOLDER ]; then - mkdir -p ${TEMP_FOLDER} +if [ ! -d "${PKG_FOLDER}" || ! -f "${PKG_FOLDER}/NVIDIA-Linux-*.run" ]; then + echo "Can't find driver package from NVIDIA. Exiting!" + exit 1 fi -mkdir -p ${TEMP_FOLDER}/{usr/lib/xorg/modules,${DPATH}} +# file to call - binary driver package from vendor +FILE=${PKG_FOLDER}/NVIDIA-Linux-*.run +# extract to ${FILE/.run/} +./${FILE} -x -# extract contents - we need to fix some things -./${FILE} -x --target ${TEMP_FOLDER}/nvidia-files/ +# or do we need precompiled? I guess not +NVPATH=${FILE/.run/} +rm -rf "${NVPATH}/usr/src/nv/precompiled" +cp -R "${NVPATH}/usr" "${PLUGIN_PATH}/nvidia" +# kernel version - pick needed kernel version +UNAME_R=$(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1) +pushd ${PLUGIN_PATH}/nvidia/usr/src/nv/ -########################################## -# fix for: -# - module installation path -# - automatic module loading -########################################## +############## +# DON'T LOAD THIS MODULE ON SERVER OR WHATEVER SYSTEM THIS MAY BE sed \ - -e 's,\(^MODULE_ROOT\s*= \)\(/lib/modules\),\1${TEMP_FOLDER}\2,g'\ -e '/.* modprobe .*/d' \ - -i ${TEMP_FOLDER}/src/usr/src/nv/Makefile.kbuild + -i ${PLUGIN_PATH}/nvidia/usr/src/nv/Makefile.kbuild + -i ${PLUGIN_PATH}/nvidia/usr/src/nv/Makefile.nvidia + -i ${PLUGIN_PATH}/nvidia/usr/src/nv/makefile +############### -# TODO: perhaps we don't need this part! - it's very slow -/./${TEMP_FOLDER}/nvidia-files/nvidia-installer -s --x-prefix=${TEMP_FOLDER} \ - --no-runlevel-check --no-abi-note --no-x-check\ - --no-rpms --no-recursion \ - --x-module-path=${TEMP_FOLDER}/usr/lib/xorg/modules\ - --x-library-path=${TEMP_FOLDER}/usr/lib\ - --opengl-prefix=${TEMP_FOLDER}/usr\ - --opengl-libdir=lib\ - --utility-prefix=${TEMP_FOLDER}/usr\ - --utility-libdir=lib\ - --documentation-prefix=${TEMP_FOLDER}/usr\ - --no-kernel-module \ -# --kernel-install-path=${TEMP_FOLDER}/lib/modules/${KVERS}/video \ - 2>&1 > /dev/null - -mv ${TEMP_FOLDER}/src/usr/src ${TEMP_FOLDER}/usr/ -rm -rf ${TEMP_FOLDER}/usr/share ${TEMP_FOLDER}/src/ - ############################################ # build kernel modules ############################################ -pushd ${TEMP_FOLDER}/usr/src/nv/ -make -f Makefile.kbuild +# compile nvidia.ko module with selected kernel +make SYSSRC=/lib/modules/${UNAME_R}/build module > /dev/null 2&>1 +if [ $? -eq 0 ]; then + echo "Successfully built module nvidia.ko!" + mkdir -p /lib/modules/${UNAME_R}/video + cp ${PLUGIN_PATH}/nvidia/usr/src/nv/nvidia.ko /lib/modules/${UNAME_R}/video/ +else + echo "Something went wrong while building nvidia.ko module!" +fi popd + + +# TODO: perhaps we don't need this part! - it's very slow +#/./${TEMP_FOLDER}/nvidia-files/nvidia-installer -s --x-prefix=${TEMP_FOLDER} \ +# --no-runlevel-check --no-abi-note --no-x-check\ +# --no-rpms --no-recursion \ +# --x-module-path=${TEMP_FOLDER}/usr/lib/xorg/modules\ +# --x-library-path=${TEMP_FOLDER}/usr/lib\ +# --opengl-prefix=${TEMP_FOLDER}/usr\ +# --opengl-libdir=lib\ +# --utility-prefix=${TEMP_FOLDER}/usr\ +# --utility-libdir=lib\ +# --documentation-prefix=${TEMP_FOLDER}/usr\ +# --no-kernel-module \ +## --kernel-install-path=${TEMP_FOLDER}/lib/modules/${KVERS}/video \ +# 2>&1 > /dev/null + +#mv ${TEMP_FOLDER}/src/usr/src ${TEMP_FOLDER}/usr/ +#rm -rf ${TEMP_FOLDER}/usr/share ${TEMP_FOLDER}/src/ + + |