summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Uhrig2008-08-11 20:42:12 +0200
committerVolker Uhrig2008-08-11 20:42:12 +0200
commitd313efa0006260dd6582532c9aa08282ec8a22cf (patch)
treed68e244e2bd864a757d9c3df68c2709145f48c87
parentBug in the desktop plugin fixed (#260). (diff)
downloadcore-d313efa0006260dd6582532c9aa08282ec8a22cf.tar.gz
core-d313efa0006260dd6582532c9aa08282ec8a22cf.tar.xz
core-d313efa0006260dd6582532c9aa08282ec8a22cf.zip
* added scripts from bastian
* currently in development state and not usable * currently not included into the plugin git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2025 95ad53e4-c205-0410-b2fa-d234c58c8868
-rw-r--r--os-plugins/plugins/xserver/files/README4
-rwxr-xr-xos-plugins/plugins/xserver/files/ati-install.sh159
-rwxr-xr-xos-plugins/plugins/xserver/files/nvidia-install.sh68
3 files changed, 231 insertions, 0 deletions
diff --git a/os-plugins/plugins/xserver/files/README b/os-plugins/plugins/xserver/files/README
new file mode 100644
index 00000000..e96b728b
--- /dev/null
+++ b/os-plugins/plugins/xserver/files/README
@@ -0,0 +1,4 @@
+ati-install.sh: Installer for ATI drivers
+nvidia-install.sh: Installer for NVIDIA drivers
+
+Currently in development and not useable!
diff --git a/os-plugins/plugins/xserver/files/ati-install.sh b/os-plugins/plugins/xserver/files/ati-install.sh
new file mode 100755
index 00000000..2dc6e991
--- /dev/null
+++ b/os-plugins/plugins/xserver/files/ati-install.sh
@@ -0,0 +1,159 @@
+#!/bin/bash
+
+##########################################################
+# This file is responsible to extract system packages
+# out of corresponding driver archives
+#
+# Arguments:
+# 1: temporary folder, where we put all the extracted files in.
+# 2: your system name (will come from OpenSLX' vendorOS)
+# 3: ati | nvidia [nothing to extract both]
+#
+# CHECK: No need for NVIDIA to extract?
+##########################################################
+
+#set -x
+
+DEBUG=false
+
+TMP_FOLDER="$1"
+SYSNAME="$2"
+WHAT="$3"
+
+FOLDER=`pwd`/..
+FILE_ATI=$FOLDER/ati-driver-installer*.run
+FILE_NVIDIA=$FOLDER/NVIDIA-Linux*.run
+
+
+##########################################################
+# function ati_extract: Extract files from ATI-Package
+#--------------------------------------------------------
+#
+# This function extracts the package for the right system
+# from the driver archive of ATI.
+#
+##########################################################
+function ati_extract {
+ INSTFOLDER=$1
+
+
+ if [ -f ${FILE_ATI} ]; then
+ chmod +x ${FILE_ATI}
+ ${FILE_ATI} --extract ${TMP_FOLDER}/ati-files 2>&1 > /dev/null
+ else
+ echo "Could not extract ATI driver files!\n Please make sure that archive is not located in /tmp"
+ exit
+ fi
+
+
+ VERSION=`head ${FILE_ATI} | grep "label=" | sed -e 's,.*Driver-\(.*\)",\1,g'`
+
+ PKGNAME=""
+ case "$SYSNAME" in
+ "suse-10.2")
+ PKGNAME="SuSE/SUSE102-IA32"
+ ;;
+ "ubuntu")
+ PKGNAME="Ubuntu/7.10"
+ ;;
+ *)
+ PKGNAME="Debian/etch"
+ ;;
+ esac
+
+
+ pushd ${TMP_FOLDER}/ati-files
+ ./ati-installer.sh $VERSION --buildpkg ${PKGNAME} 2>&1 > out.txt
+
+ if [ `grep "successfully generated" out.txt | wc -l` -eq 1 ]; then
+ echo "System package extracted from driver archive..."
+
+ if [ ! -d $INSTFOLDER ]; then
+ mkdir -p $INSTFOLDER
+ fi
+ PKG=`grep "successfully generated" out.txt | cut -d' ' -f2 `
+
+ pushd $INSTFOLDER
+
+ # look for the last three letters in $PKG
+ case ${PKG: -3} in
+ rpm)
+ rpm2cpio ${PKG} | cpio -i --make-directories 2>&1 > /dev/null
+ ;;
+ deb)
+ # Do something
+ ;;
+ tgz|.gz)
+ tar -zxf ${PKG} 2>&1 > /dev/null
+ ;;
+ *)
+ # Do something as default
+ echo "System Package format not recognized!"
+ exit 1
+ ;;
+ esac
+ popd
+
+ fi
+}
+
+
+
+##########################################################
+# function nvidia_extract: Extract files from
+# nvidia-package
+#--------------------------------------------------------
+#
+# This function extracts the package for the right system
+# from the driver archive of NVIDIA.
+#
+##########################################################
+function nvidia_extract {
+ INSTFOLDER=$1
+ WORKFOLDER=${TMP_FOLDER}/nvidia-files
+
+
+ if [ -f ${FILE_NVIDIA} ]; then
+ chmod +x ${FILE_NVIDIA}
+ ${FILE_NVIDIA} --extract ${WORKFOLDER} 2>&1 > /dev/null
+ else
+ echo "Could not extract NVIDIA driver files!\n Please make sure that archive is not located in /tmp"
+ exit
+ fi
+
+}
+
+
+
+
+
+
+
+
+
+##############################################
+# Here main script starts
+##############################################
+
+case $WHAT in
+ nvidia)
+ nvidia_extract $FOLDER/nvidia-package
+ ;;
+ ati)
+ ati_extract $FOLDER/ati-package
+ ;;
+ *)
+ nvidia_extract $FOLDER/nvidia-package
+ ati_extract $FOLDER/ati-package
+ exit 1
+ ;;
+esac
+
+
+if [ $DEBUG == "true" ]
+then
+ /bin/bash
+ rm -rf ${TMP_FOLDER}/ati-files
+
+fi
+
diff --git a/os-plugins/plugins/xserver/files/nvidia-install.sh b/os-plugins/plugins/xserver/files/nvidia-install.sh
new file mode 100755
index 00000000..d30008c9
--- /dev/null
+++ b/os-plugins/plugins/xserver/files/nvidia-install.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+set -x
+
+
+# local path
+LPATH=$(pwd)
+
+# temp path
+TPATH=${LPATH}/tmp
+
+# file to call - should be replaced with argument
+FILE=../NVIDIA-Linux-x86-1.0-9639-pkg1.run
+
+# kernel version (not really useful in this context - on a server)
+# todo: we need to fix this for stage1 chroot
+KVERS=$(uname -r)
+
+if [ ! -d $TPATH ]; then
+ mkdir -p ${TPATH}
+fi
+
+mkdir -p ${TPATH}/{usr/lib/xorg/modules,lib/modules/${KVERS}/kernel/drivers}
+
+# driver path - install modules in this path
+DPATH=lib/modules/${KVERS}/kernel/drivers
+
+# extract contents - we need to fix some things
+./${FILE} -x --target ${TPATH}/src/
+
+
+##########################################
+# fix:
+# - module installation path
+# - automatic module loading
+##########################################
+sed \
+ -e 's,\(^MODULE_ROOT\s*= \)\(/lib/modules\),\1${TPATH}\2,g'\
+ -e '/.* modprobe .*/d' \
+ -i ${TPATH}/src/usr/src/nv/Makefile.kbuild
+
+
+
+# TODO: perhaps we don't need this part!
+/./${TPATH}/src/nvidia-installer -s --x-prefix=${TPATH} \
+ --no-runlevel-check --no-abi-note --no-x-check\
+ --no-rpms --no-recursion \
+ --x-module-path=${TPATH}/usr/lib/xorg/modules\
+ --x-library-path=${TPATH}/usr/lib\
+ --opengl-prefix=${TPATH}/usr\
+ --opengl-libdir=lib\
+ --utility-prefix=${TPATH}/usr\
+ --utility-libdir=lib\
+ --documentation-prefix=${TPATH}/usr\
+ --no-kernel-module \
+# --kernel-install-path=${TPATH}/lib/modules/${KVERS}/video \
+ 2>&1 > /dev/null
+
+mv ${TPATH}/src/usr/src ${TPATH}/usr/
+rm -rf ${TPATH}/usr/share ${TPATH}/src/
+
+############################################
+# build kernel modules
+############################################
+pushd ${TPATH}/usr/src/nv/
+make -f Makefile.kbuild
+popd
+