diff options
author | Bastian Wissler | 2008-10-16 13:56:16 +0200 |
---|---|---|
committer | Bastian Wissler | 2008-10-16 13:56:16 +0200 |
commit | 65fe3c4848e2efb759cd5d819ce36f318af72cfc (patch) | |
tree | 09bd13310d6b8cbb61548c51b95964799ad820ce /os-plugins | |
parent | * fixing start script (diff) | |
download | core-65fe3c4848e2efb759cd5d819ce36f318af72cfc.tar.gz core-65fe3c4848e2efb759cd5d819ce36f318af72cfc.tar.xz core-65fe3c4848e2efb759cd5d819ce36f318af72cfc.zip |
xserver plugin: * various changes to support binary drivers properly
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2326 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r-- | os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm | 2 | ||||
-rw-r--r-- | os-plugins/plugins/xserver/XX_xserver.sh | 42 | ||||
-rwxr-xr-x | os-plugins/plugins/xserver/files/linkage.sh | 5 | ||||
-rwxr-xr-x | os-plugins/plugins/xserver/files/suse-gfx-install.sh | 55 |
4 files changed, 87 insertions, 17 deletions
diff --git a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm index 71c02eb9..1a8de27f 100644 --- a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm +++ b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm @@ -228,6 +228,8 @@ sub installationPhase copyFile("$pluginFilesPath/ubuntu-gfx-install.sh", "$installationPath"); copyFile("$pluginFilesPath/suse-gfx-install.sh", "$installationPath"); copyFile("$pluginFilesPath/linkage.sh", "$installationPath"); + # be on the safe side + system("/bin/sh /opt/openslx/plugin-repo/$self->{'name'}/linkage.sh clean"); } if ($attrs->{'xserver::ati'} == 1) { copyFile("$pluginFilesPath/ati-install.sh", "$installationPath"); diff --git a/os-plugins/plugins/xserver/XX_xserver.sh b/os-plugins/plugins/xserver/XX_xserver.sh index 971833da..c7d47e24 100644 --- a/os-plugins/plugins/xserver/XX_xserver.sh +++ b/os-plugins/plugins/xserver/XX_xserver.sh @@ -60,14 +60,25 @@ if [ -e /initramfs/plugin-conf/xserver.conf -a \ ${PLUGIN_ROOTFS}/usr/X11R6/lib/modules/\," xmodule="fglrx" PLUGIN_PATH="/mnt${PLUGIN_ROOTFS}" - LINK_PATH="/mnt/var/lib/X11R6/lib/" + LINK_PATH="/mnt/var/X11R6/lib/" # we need some database for driver initialization cp -r ${PLUGIN_PATH}/etc/* /mnt/etc/ - # this is the most important thing - ln -s ${PLUGIN_PATH}/usr/lib/libGL.so.1.2 \ + if [ ! -d "${LINK_PATH}" ]; then + # create linkage folder + mkdir -p ${LINK_PATH} + fi + + chroot /mnt /sbin/insmod ${PLUGIN_ROOTFS}/modules/fglrx.ko + + # we need some pci.ids for fglrx driver + cp -r "${PLUGIN_PATH}/etc/ati" /mnt/etc/ + + ln -s ${PLUGIN_ROOTFS}/usr/lib/libGL.so.1.2 \ + ${LINK_PATH}libGL.so + ln -s ${PLUGIN_ROOTFS}/usr/lib/libGL.so.1.2 \ ${LINK_PATH}libGL.so.1 - ln -s ${PLUGIN_PATH}/usr/lib/libGL.so.1.2 \ + ln -s ${PLUGIN_ROOTFS}/usr/lib/libGL.so.1.2 \ ${LINK_PATH}libGL.so.1.2 fi @@ -81,10 +92,27 @@ ${PLUGIN_ROOTFS}/usr/X11R6/lib/modules/\," ${PLUGIN_ROOTFS}/usr/X11R6/lib/modules/\," xmodule="nvidia" PLUGIN_PATH="/mnt${PLUGIN_ROOTFS}" - LINK_PATH="/mnt/var/lib/X11R6/lib/" - ln -s ${PLUGIN_PATH}/usr/lib/libGL.so.1.2 \ + LINK_PATH="/mnt/var/X11R6/lib/" + if [ ! -d "${LINK_PATH}" ]; then + # create linkage folder + mkdir -p ${LINK_PATH} + fi + + # insert kernel driver + chroot /mnt /sbin/insmod ${PLUGIN_ROOTFS}/modules/nvidia.ko + + # create all relevant libGL links + # this is the most important thing + ln -s ${PLUGIN_ROOTFS}/usr/lib/libGLcore.so.1 \ + ${LINK_PATH}libGLcore.so.1 + + # create all relevant libGL links + # libGL.so.1 is a link to libGL.so.1.somebignumber + ln -s ${PLUGIN_ROOTFS}/usr/lib/libGL.so.1 \ + ${LINK_PATH}libGL.so + ln -s ${PLUGIN_ROOTFS}/usr/lib/libGL.so.1 \ ${LINK_PATH}libGL.so.1 - ln -s ${PLUGIN_PATH}/usr/lib/libGL.so.1.2 \ + ln -s ${PLUGIN_ROOTFS}/usr/lib/libGL.so.1 \ ${LINK_PATH}libGL.so.1.2 fi set +x diff --git a/os-plugins/plugins/xserver/files/linkage.sh b/os-plugins/plugins/xserver/files/linkage.sh index 4c9aad6d..b8921a7a 100755 --- a/os-plugins/plugins/xserver/files/linkage.sh +++ b/os-plugins/plugins/xserver/files/linkage.sh @@ -44,6 +44,11 @@ linkMesa() { ln -sf ${LINK_PATH}$(echo $file| sed -e 's,/usr/lib,,g') $file # link to writable dir elif [ -f "${file}" ]; then # this is a real file + #ATTENTION: in NVIDIA-OpenGL implementation libGL.so.1.2 is a link. + # This is a problem here, as we expect libGL.so.1.2 moved to + # libGL_mesa.so.1.2 -> we have to filter this in + # XX_xserver.sh + # ATI OpenGL has that file -> no problem there mv ${file} $(echo $file|sed -e 's,.so,_MESA.so,g') 2&>1 >/dev/null # rename file fi } diff --git a/os-plugins/plugins/xserver/files/suse-gfx-install.sh b/os-plugins/plugins/xserver/files/suse-gfx-install.sh index f99dbbd4..bff8bf23 100755 --- a/os-plugins/plugins/xserver/files/suse-gfx-install.sh +++ b/os-plugins/plugins/xserver/files/suse-gfx-install.sh @@ -25,7 +25,10 @@ if [ "$1" = "nvidia" ]; then #TODO: licence information... even suse requires an accept # TODO: let it automatical find the newest file... see ati section # only problem should be the kernel package - if [ "10.2" = "$(cat /etc/SuSE-release | tail -n1 | cut -d' ' -f3)" ]; then + + # TODO: the following check doesn't work - why? + # this is wasted time for suse-11.0 users + if [ "10.2" = "`cat /etc/SuSE-release | tail -n1 | cut -d' ' -f3`" ]; then echo " * Downloading nvidia rpm packages... this could take some time..." wget -q -c \ ftp://download.nvidia.com/opensuse/10.2/i586/nvidia-gfxG01-kmp-bigsmp-173.14.12_2.6.18.8_0.10-0.1.i586.rpm \ @@ -48,7 +51,8 @@ if [ "$1" = "nvidia" ]; then find lib/ -name "*.ko" -exec mv {} ../modules \; fi - if [ "11.0" = "$(cat /etc/SuSE-release | tail -n1 | cut -d' ' -f3)" ]; then + if [ "11.0" = "`cat /etc/SuSE-release | tail -n1 | cut -d' ' -f3`" ]; then + echo " * Downloading nvidia rpm packages... this could take some time..." # add repository for nvidia drivers zypper addrepo http://download.nvidia.com/opensuse/11.0/ NVIDIA # confirm authenticity of key (once) @@ -58,19 +62,20 @@ if [ "$1" = "nvidia" ]; then zypper -n -vv install -D x11-video-nvidiaG01 > logfile # take unique urls from logfile - URLS=$(cat logfile | grep -P -o "http://.*? " | sort -u | xargs) + URLS=$(cat logfile | grep -P -o "http://.*?rpm " | sort -u | xargs) for RPM in $URLS; do RNAME=$(echo ${RPM} | sed -e 's,^.*/\(.*\)$,\1,g') - rm -rf ${RNAME} - wget ${RPM} - # TODO: the following is not working - I don't know why... - ${BUSYBOX} rpm2cpio ${RNAME} | ${BUSYBOX} cpio -idv + rm -rf ${RNAME} + wget ${RPM} 2>&1 /dev/null + # We use rpm2cpio from suse to extract + rpm2cpio ${RNAME} | ${BUSYBOX} cpio -id > /dev/null done + mv ./usr/X11R6/lib/* ./usr/lib/ mv ./usr .. find lib/ -name "*.ko" -exec mv {} ../modules \; - #echo "DEBUG xserver SUSE-GFX-INSTALL.SH" - #/bin/bash - #echo "END DEBUG" +# echo "DEBUG xserver SUSE-GFX-INSTALL.SH NVIDIA" +# /bin/bash +# echo "END DEBUG" fi cd .. @@ -87,6 +92,35 @@ if [ "$1" = "ati" ]; then mkdir -p ati/modules ati/temp cd ati/temp + if [ "11.0" = "`cat /etc/SuSE-release | tail -n1 | cut -d' ' -f3`" ]; then + echo " * Downloading ati rpm packages... this could take some time..." + # add repository for nvidia drivers + zypper addrepo http://www2.ati.com/suse/11.0/ ATI + # confirm authenticity of key (once) + # -> After key is cached, this is obsolete + zypper se -r ATI x11-video-fglrxG01 + # get URLs by virtually installing nvidia-OpenGL driver + zypper -n -vv install -D ati-fglrxG01-kmp-pae x11-video-fglrxG01 > logfile + + # take unique urls from logfile + URLS=$(cat logfile | grep -P -o "http://.*?rpm " | grep fglrx | sort -u | xargs) + for RPM in $URLS; do + RNAME=$(echo ${RPM} | sed -e 's,^.*/\(.*\)$,\1,g') + rm -rf ${RNAME} + wget ${RPM} 2>&1 /dev/null + # We use rpm2cpio from suse to extract + rpm2cpio ${RNAME} | ${BUSYBOX} cpio -id > /dev/null + done + mv ./usr/X11R6/lib/* ./usr/lib/ + mv ./usr .. + mv ./etc .. + find lib/ -name "*.ko" -exec mv {} ../modules \; +# echo "DEBUG xserver SUSE-GFX-INSTALL.SH ATI" +# /bin/bash +# echo "END DEBUG" + else + + #TODO: licence information... even suse requires an accept BASEURL="http://www2.ati.com/suse/$(lsb_release -r|sed 's/^.*\t//')" # if it dont work in the future, check .../repodata/repomd.xml @@ -123,6 +157,7 @@ if [ "$1" = "ati" ]; then #${BUSYBOX} rpm2cpio nvidia-gfxG01-kmp-default-173.14.12_2.6.18.8_0.10-0.1.i586.rpm | ${BUSYBOX} cpio -idv #TODO: take care about the kernel issue. Find won't work with two equal kernelmodules in lib/... find lib/ -name "*.ko" -exec mv {} ../modules \; + fi cd .. |