From ea946678e9ebc00d37b489ec4f22e2bbf2bc04a3 Mon Sep 17 00:00:00 2001 From: Bastian Wissler Date: Fri, 29 Aug 2008 09:31:34 +0000 Subject: First real stage3 implementation (I just thought last time) git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2128 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/plugins/xserver/files/linkage.sh | 104 +++++++++++++++++++++ .../plugins/xserver/files/ubuntu-gfx-install.sh | 27 +++++- 2 files changed, 128 insertions(+), 3 deletions(-) create mode 100755 os-plugins/plugins/xserver/files/linkage.sh (limited to 'os-plugins/plugins/xserver/files') diff --git a/os-plugins/plugins/xserver/files/linkage.sh b/os-plugins/plugins/xserver/files/linkage.sh new file mode 100755 index 00000000..040b4c8a --- /dev/null +++ b/os-plugins/plugins/xserver/files/linkage.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +# +# +# general: linking libGL.so and stuff to writable locations +# +# + +PLUGIN_FOLDER="/opt/openslx/plugin-repo/xserver/" +MESA_FOLDER="${PLUGIN_FOLDER}mesa/" +# this has to be writable in stage3 - any folder is possible +LINK_FOLDER="/var/lib/X11R6/xserver/" + +# these are to link libs to +ATIROOT="${PLUGIN_FOLDER}ati/atiroot" +NVROOT="${PLUGIN_FOLDER}nvidia/nvroot" + +# declare array of conflicting libs +# TODO: add conflicting libs for opengl here +declare -a CONFLIBS=("/usr/lib/libGL.so.1.2" "/usr/lib/libGL.so.1") + + +if [ ! -d "${MESA_FOLDER}usr/lib/" ]; then + mkdir -p "${MESA_FOLDER}usr/lib/" +fi +if [ ! -d "${LINK_FOLDER}usr/lib/" ]; then + mkdir -p "${LINK_FOLDER}usr/lib/" +fi + + + + + + + + + + +function linkMesa { + file=$1 + if [ -f "/${file}" ]; then + # move file to the mesa implementation folder + mv "${file}" "${MESA_FOLDER}${file}" + # create links from link-folder to mesa-folder + ln -s "${MESA_FOLDER}${file}" "${LINK_FOLDER}${file}" + # create links from sys-folder to link-folder + ln -s "${LINK_FOLDER}${file}" "${file}" + + else + # ${file} is a link here + rm -rf "${file}" + case ${file} in + /usr/lib/libGL.so.1) + ln -s "${LINK_FOLDER}${file}.2" "${LINK_FOLDER}${file}" + ;; + *) + ;; + esac + fi +} + + + + + + + + + + +# we create links for all of the binary drivers here +# - as long as it's possible +# - if not, add to array of link files + +# ATI +declare -a ATILIBS=($(find ${ATIROOT} -name "*\\.so*" | xargs)) +# with stripped ATIROOT path +declare -a UATILIBS=(${ATILIBS[@]#${ATIROOT}}) +for lib in ${UATILIBS[@]}; do + if [ -e $lib ]; then + # this is a conflicting MESA-Library + linkMesa $lib + fi +done +# NVIDIA +for lib in $(find ${NVROOT} -name "*\\.so*" | xargs); do + +done + + + + + + + +# go through conflicting libs and link them accordingly +for file in ${CONFLIBS[@]}; do + linkMesa $file +done + + + + + diff --git a/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh b/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh index fd65a4a6..dbcd0ad1 100755 --- a/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh +++ b/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh @@ -19,8 +19,6 @@ else KVER=$(find /lib/modules/2.6* -maxdepth 0|sed 's,/lib/modules/,,g'|sort|tail -n1) fi -bash - aptitude download linux-restricted-modules-${KVER} > /dev/null 2&>1 MODULE_DEB=$(ls linux-restricted-modules-*.deb | tail -n1) @@ -29,6 +27,10 @@ dpkg-deb -x ${MODULE_DEB} ${TMP_FOLDER}/modules case ${TARGET} in ati) aptitude download xorg-driver-fglrx > /dev/null 2&>1 + if [ $? -eq 1 ]; then + echo "Didn't get package xorg-driver-fglrx! Starting debug shell.." + bash + fi FGLRX_DEB=$(ls xorg-driver-fglrx_*.deb | tail -n1) # extract $DEB into folder "atiroot" dpkg-deb -x ${FGLRX_DEB} ${PLUGIN_FOLDER}/ati/atiroot/ @@ -42,7 +44,10 @@ case ${TARGET} in ;; nvidia) aptitude download nvidia-glx-new > /dev/null 2&>1 - #oder + if [ $? -eq 1 ]; then + echo "Didn't get package nvidia-glx-new! Starting debug shell.." + bash + fi #oder #aptitude download nvidia-glx # extract $DEB into folder "nvroot" NVIDIA_DEB=$(ls nvidia-glx*.deb | tail -n1) @@ -66,3 +71,19 @@ popd > /dev/null #${TMP_FOLDER} rm -rf ${TMP_FOLDER}/modules + +# +# +# TODO: move following line to a more general location +# +# +if [ "${TARGET}" = "ati" ];then + ln -s ${PLUGIN_FOLDER}/ati/atiroot/usr/lib/dri/fglrx_dri.so \ + /usr/lib/dri/fglrx_dri.so +fi + +#if [ "${TARGET}" -eq "nvidia" ];then +# ln -s ${PLUGIN_FOLDER}/nvidia/nvroot/usr/lib/dri/nvidia_dri.so \ +# /usr/lib/dri/fglrx_dri.so +#fi + -- cgit v1.2.3-55-g7522