summaryrefslogtreecommitdiffstats
path: root/os-plugins
diff options
context:
space:
mode:
authorBastian Wissler2009-02-18 18:08:48 +0100
committerBastian Wissler2009-02-18 18:08:48 +0100
commit7368d7b1866e20301beb1e1cf0a83688fe2aadb4 (patch)
tree38b9ced82a373b8d3186352171455a64817bd83b /os-plugins
parent * added modifications from 5.0 tree (diff)
downloadcore-7368d7b1866e20301beb1e1cf0a83688fe2aadb4.tar.gz
core-7368d7b1866e20301beb1e1cf0a83688fe2aadb4.tar.xz
core-7368d7b1866e20301beb1e1cf0a83688fe2aadb4.zip
xserver: * corrected kernel module building with nvidia-installer
* suse-10.2 works with ati/nvidia-installer git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2600 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r--os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm21
-rwxr-xr-xos-plugins/plugins/xserver/files/ati-install.sh30
-rwxr-xr-xos-plugins/plugins/xserver/files/nvidia-install.sh73
-rwxr-xr-xos-plugins/plugins/xserver/files/suse-gfx-install.sh118
4 files changed, 155 insertions, 87 deletions
diff --git a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
index d8bef737..fc1d5124 100644
--- a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
+++ b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
@@ -114,9 +114,9 @@ sub getAttrInfo
# stage1
# Currently not needed in scenarios where distro specific packages are
- # available
+ # available, but in Suse-10.2 for example we use this method
+ # -> provide downloaded packages here.
'xserver::pkgpath' => {
- applies_to_vendor_os => 0,
applies_to_vendor_os => 1,
description => unshiftHereDoc(<<' End-of-Here'),
Path to downloaded ATI or Nvidia package
@@ -175,13 +175,14 @@ sub preInstallationPhase()
my $installAti = $self->{attrs}->{'xserver::ati'};
my $installNvidia = $self->{attrs}->{'xserver::nvidia'};
- #if (! -d $pkgpath && ($installAti == 1 || $installNvidia == 1)) {
- # print "\n\n * xserver::pkgpath: no such directory!\n";
- # print " * xserver plugin can't install ATI or Nvidia driver!\n\n";
- # # exit 1 => xserver plugin is not getting installed because ati
- # # or nvidia where selected but are not installable!
- # exit 1;
- #}
+ if (! -d $pkgpath && ($installAti == 1 || $installNvidia == 1)) {
+ print "\n\n * xserver::pkgpath: no such directory!\n";
+ print " * xserver plugin can only install ATI or Nvidia driver\n";
+ print " via operating system packaging (e.g. != SuSE-10.2)!\n";
+ # exit 1 => xserver plugin is not getting installed because ati
+ # or nvidia where selected but are not installable!
+ # exit 1;
+ }
if (-d $pkgpath && ($installNvidia == 1 || $installAti == 1)) {
# Todo: use a openslx copy function!
@@ -243,7 +244,7 @@ sub installationPhase
}
if ($attrs->{'xserver::ati'} == 1) {
copyFile("$pluginFilesPath/ati-install.sh", "$installationPath");
- system("/bin/bash /opt/openslx/plugin-repo/$self->{'name'}/ati-install.sh");
+ system("/bin/bash /opt/openslx/plugin-repo/$self->{'name'}/ati-install.sh $vendorOSName");
#system("/bin/bash /opt/openslx/plugin-repo/$self->{'name'}/linkage.sh ati");
}
if ($attrs->{'xserver::nvidia'} == 1) {
diff --git a/os-plugins/plugins/xserver/files/ati-install.sh b/os-plugins/plugins/xserver/files/ati-install.sh
index 9c5a0139..7bbe48d1 100755
--- a/os-plugins/plugins/xserver/files/ati-install.sh
+++ b/os-plugins/plugins/xserver/files/ati-install.sh
@@ -3,26 +3,22 @@
cd /opt/openslx/plugin-repo/xserver
# Ubuntu gfx-install.sh skript
-DISTRO=$(lsb_release -i)
-RELEASE=$(lsb_release -r)
+DISTRO=$1
+case $DISTRO in
-if [ "1" -eq "$(echo ${DISTRO} | grep 'Ubuntu' | wc -l)" ]; then
- # we have Ubuntu - run ubuntu-gfx-install
- echo "* Using Ubuntu packages to install ati modules and libs"
- if [ "8.10" = "$(echo ${RELEASE} | awk '{print $2}' )" ]; then
+ ubuntu-8.10)
./ubuntu-8.10-gfx-install.sh ati
- else
+
+ ;;
+ ubuntu-*)
./ubuntu-gfx-install.sh ati
- fi
- exit
-fi
+ ;;
+
# End ubuntu gfx-install.sh
# 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 ati modules and libs"
- ./suse-gfx-install.sh ati
- exit
-fi
-# End ubuntu gfx-install.sh
+ suse-*)
+ # we have SuSE - run ubuntu-gfx-install
+ ./suse-gfx-install.sh ati
+ ;;
+esac
diff --git a/os-plugins/plugins/xserver/files/nvidia-install.sh b/os-plugins/plugins/xserver/files/nvidia-install.sh
index 55bc8188..ded6395e 100755
--- a/os-plugins/plugins/xserver/files/nvidia-install.sh
+++ b/os-plugins/plugins/xserver/files/nvidia-install.sh
@@ -9,6 +9,16 @@ PLUGIN_PATH="/opt/openslx/plugin-repo/xserver"
# need to find it our here ...
DISTRO=$1
+
+# for development we take the only kernel version from normal systems
+if [ -L /boot/vmlinuz ]; then
+ KVERS=$(ls -l /boot/vmlinuz | awk -F "->" '{print $2}'| grep -P -o "2.6.*")
+else
+ KVERS=$(ls /boot/vmlinuz-* | head -n1 | awk -F "->" '{print $2}' | grep -P -o "2.6.*" )
+fi
+
+
+
cd ${PLUGIN_PATH}
case ${DISTRO} in
@@ -23,13 +33,34 @@ case ${DISTRO} in
;;
# general purpose nvidia installer script
*)
- echo " * Running general NVidia installer (expected in ~/xserver-pkgs)"
+ echo "* Running general NVidia installer (expected in xserver::pkgpath)"
# unpack the nvidia installer; quickhack - expects just one package
echo " * Unpacking installer"
sh packages/NVIDIA-Linux-*.run -a -x >>nvidia-inst.log 2>&1
# prefix and paths should be matched more closely to each distro
- # just demo at the moment ...
+ # just demo at the moment ... but working at the moment
+ # without the kernel module
stdprfx=/opt/openslx/plugin-repo/xserver/nvidia
+
+ # backing up libglx.so and libGLcore.so
+ BACKUP_PATH=${stdprfx}/../mesa/usr/lib/xorg/modules/extensions
+ mkdir -p ${BACKUP_PATH}
+ if [ -f /usr/lib/xorg/modules/extensions/libglx.so ]; then
+ cp /usr/lib/xorg/modules/extensions/libGLcore.so ${BACKUP_PATH}
+ cp /usr/lib/xorg/modules/extensions/libglx.so ${BACKUP_PATH}
+ elif [ -f /usr/X11R6/lib/xorg/modules/extensions/libglx.so ]; then
+ cp /usr/X11R6/lib/xorg/modules/extensions/libglx.so ${BACKUP_PATH}
+ cp /usr/X11R6/lib/xorg/modules/extensions/libGLcore.so ${BACKUP_PATH}
+ touch ${BACKUP_PATH}/X11R6
+ fi
+ if [ -f /usr/lib/libGL.so.1.2 ]; then
+ cp /usr/lib/libGL.so.1.2 ${BACKUP_PATH}/../../..
+ elif [ -f /usr/X11R6/lib/libGL.so.1.2 ]; then
+ cp /usr/X11R6/lib/libGL.so.1.2 ${BACKUP_PATH}/../../..
+ touch ${BACKUP_PATH}/../../../X11R6
+ fi
+
+
# run the lib installer
echo " * Starting the library installer"
echo "Starting the lib installer" >>nvidia-inst.log
@@ -42,20 +73,54 @@ case ${DISTRO} in
--log-file-name=nvidia-lib.log >>nvidia-inst.log 2>&1
# how to get an idea of the installed kernel?
# run the kernel module creator (should be done for every kernel!?)
- kernel=2.6.25.18-0.2-pae
+ kernel=${KVERS}
echo " * Trying to compile a kernel module for $kernel"
echo "Starting the kernel $kernel installer" >>nvidia-inst.log
# we need the .config file in /usr/src/linux or where ever!
# we need scripts/genksyms/genksyms compiled via make scripts in /usr/src/linux
# option available in newer nvidia packages
+ if [ ! -f /usr/src/linux-${kernel}/include/linux/kernel.h ]; then
+ cd /usr/src/linux-${kernel%-*}
+ if [ ! -f .config ]; then
+ if [ -f /boot/config-${kernel} ]; then
+ # in suse we have the config file lying there
+ cp /boot/config-${kernel} .config
+ fi
+ fi
+ make scripts >/dev/null 2>&1
+ make prepare >/dev/null 2>&1
+ cd - >/dev/null 2>&1
+ fi
addopts="--no-cc-version-check"
$(ls -d NVIDIA-Linux-*)/nvidia-installer -s -q -N -K --no-abi-note \
- --kernel-source-path=/lib/modules/${kernel}/build -k ${kernel} \
+ --kernel-source-path=/usr/src/linux-${kernel%-*} -k ${kernel} \
--kernel-install-path=/opt/openslx/plugin-repo/xserver/nvidia/modules \
--no-runlevel-check --no-abi-note --no-rpms ${addopts} \
--log-file-name=nvidia-kernel.log >>nvidia-inst.log 2>&1
echo " * Have a look into the several *.log files in "
echo " stage1/${DISTRO}/plugin-repo/xserver"
+
+
+ # redo some unwanted changes of nvidia-installer
+ if [ -f ${BACKUP_PATH}/libglx.so ]; then
+ cp ${BACKUP_PATH}/libGLcore.so /usr/lib/xorg/modules/extensions
+ cp ${BACKUP_PATH}/libglx.so /usr/lib/xorg/modules/extensions
+ if [ -f ${BACKUP_PATH}/X11R6 ]; then
+ cp ${BACKUP_PATH}/libGLcore.so /usr/X11R6/lib/xorg/modules/extensions
+ cp ${BACKUP_PATH}/libglx.so /usr/X11R6/lib/xorg/modules/extensions
+ fi
+ fi
+ if [ -f ${BACKUP_PATH}/../../../libGL.so.1.2 ]; then
+ cp ${BACKUP_PATH}/../../../libGL.so.1.2 /usr/lib
+ ln -sf /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1
+ ln -sf /usr/lib/libGL.so.1.2 /usr/lib/libGL.so
+ elif [ -f ${BACKUP_PATH}/../../../X11R6 ]; then
+ cp ${BACKUP_PATH}/../../../libGL.so.1.2 /usr/X11R6/lib/
+ ln -sf /usr/lib/libGL.so.1.2 /usr/lib/libGL.so.1
+ ln -sf /usr/lib/libGL.so.1.2 /usr/lib/libGL.so
+ fi
+
+
;;
esac
diff --git a/os-plugins/plugins/xserver/files/suse-gfx-install.sh b/os-plugins/plugins/xserver/files/suse-gfx-install.sh
index 33c3a456..9a55f0b0 100755
--- a/os-plugins/plugins/xserver/files/suse-gfx-install.sh
+++ b/os-plugins/plugins/xserver/files/suse-gfx-install.sh
@@ -3,25 +3,50 @@
#
# Currently 11.0 is supported!
#
+# Working on 10.2 with pgk-installer
+#
# not right any more - removed from script
# is there any busybox in this environment
#BUSYBOX="/mnt/opt/openslx//busybox/busybox"
-cd /opt/openslx/plugin-repo/xserver
+BASE=/opt/openslx/plugin-repo/xserver
+cd ${BASE}
-if [ -s /boot/vmlinuz ]; then
+if [ -L /boot/vmlinuz ]; then
KSUFFIX=$(ls -l /boot/vmlinuz | grep -P -o -e "-[a-z]*$" )
+ KVERS=$(ls -l /boot/vmlinuz | awk -F "->" '{print $2}'| grep -P -o "2.6.*")
else
KSUFFIX=$(ls /boot/vmlinuz-* | head -n1 | grep -P -o -e "-[a-z]*$" )
+ KVERS=$(ls /boot/vmlinuz-* | head -n1 | awk -F "->" '{print $2}' | grep -P -o "2.6.*" )
+
fi
if [ -z "${KSUFFIX}" ]; then
echo "Could not determine proper local kernel suffix!"
echo "This is needed to install kernel modules for graphics drivers!"
exit 1
+#else
+# echo -e "Kernel-Suffix: ${KSUFFIX}"
+# echo -e "Kernel-version:${KVERS}"
fi
+
+buildfglrx() {
+ # build ATI kernel module
+ cd ${BASE}/ati/usr/src/kernel-modules/fglrx
+ rm -rf fglrx.ko >/dev/null 2>&1
+ make KVER=${1} >/dev/null 2>&1
+ if [ "$?" -eq "0" ]; then
+ cp fglrx.ko ../../../../modules
+ else
+ echo -e "Kernel module for kernel ${1} could not be built!"
+ fi
+ cd - >/dev/null 2>&1
+
+}
+
+
##########################################################################
# NVidia section
##########################################################################
@@ -62,14 +87,9 @@ if [ "$1" = "nvidia" ]; then
mv ./usr ..
find lib/ -name "*.ko" -exec mv {} ../modules \;
-# echo "DEBUG xserver SUSE-GFX-INSTALL.SH NVIDIA"
-# /bin/bash
-# echo "END DEBUG"
fi
cd ..
- # TODO: after development
- rm -rf temp/
fi
@@ -83,12 +103,41 @@ if [ "$1" = "ati" ]; then
fi
mkdir -p ati/modules ati/temp
- cd ati/temp
- if [ "11.0" = "`cat /etc/SuSE-release | tail -n1 | cut -d' ' -f3`" ]; then
- ## SUSE 11.0 Section ###
+ if [ "10.2" = "`cat /etc/SuSE-release | tail -n1 | awk '{print $3}'`" ]; then
+ ### SUSE 10.2 section ###
+ echo "* Extracting ATI package (expected in xserver::pkgpath) ... this could take some time..."
+
+ PKG=`find packages/ -name ati-driver*\.run | tail -n1`
+ PKG_VERSION=`head ${PKG} | grep -P -o "[0-9]\.[0-9]{3}"`
+
+ chmod +x ${PKG}
+
+ ${PKG} --extract ati/temp >/dev/null 2>&1
+
+ cd ati/temp/
+ RPM=`./ati-installer.sh ${PKG_VERSION} --buildpkg SuSE/SUSE102-IA32 2>&1 | grep Package | awk '{print $2}' | tail -n1`
+
+ cd ..
+ rpm2cpio ${RPM} 2>/dev/null | cpio -i --make-directories >/dev/null 2>&1
+
- echo " * Downloading ati rpm packages... this could take some time..."
+ mv ./usr/X11R6/lib/* ./usr/lib/
+
+ # cleanup
+ rm -rf ${RPM}
+ cd ..
+ rm -rf ${PKG}
+
+ buildfglrx ${KVERS}
+
+ fi
+
+ if [ "11.0" = "`cat /etc/SuSE-release | tail -n1 | awk '{print $3}'`" ]; then
+ ### SUSE 11.0 Section ###
+
+ echo "* Downloading ati rpm packages... this could take some time..."
+ cd ati/temp
# add repository for nvidia drivers
zypper --no-gpg-checks addrepo http://www2.ati.com/suse/11.0/ ATI > /dev/null 2>&1
@@ -113,57 +162,14 @@ if [ "$1" = "ati" ]; then
done
mv ./usr/X11R6/lib/* ./usr/lib/
- # fix for fglrx_dri.so - TODO: Why is this in here?
-# mkdir -p ./usr/X11R6/lib/modules/dri
-# ln -s ../../../../lib/dri/fglrx_dri.so \
-# ./usr/X11R6/lib/modules/dri/fglrx_dri.so
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
- ############################################################
- ## SUSE 10.2 Section ##
- ############################################################
-
- #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
- wget -q ${BASEURL}/repodata/primary.xml.gz
- gunzip primary.xml.gz
-
- echo " * Downloading ati rpm packages... this could take some time..."
- # notice the i586! we can also get x86_64!
- for i in $(grep "<location href=.i586" primary.xml \
- |sed 's/.*<location href="//'|sed 's/".*//g')
- do
- wget -c -q ${BASEURL}/${i}
- done
-
- rpm2cpio $(find . -name "x11*")| cpio -idv > /dev/null 2>&1
-
- rm -rf ./usr/include
- rm -rf ./usr/lib/pm-utils
- rm -rf ./usr/lib/powersave
- # Todo: recheck after development progress, perhaps an nvidia x11 tool needs /usr/share/pixmaps
- # same with var id's
- #rm -rf ./usr/share
-
- mv ./usr ..
-
- # TODO: matching kernel problem... our openslx system picks -bigsmp - unintentionally!
- rpm2cpio $(find . -name "ati-fglrx*bigsmp*") | cpio -idv > /dev/null
- #rpm2cpio nvidia-gfxG01-kmp-default-173.14.12_2.6.18.8_0.10-0.1.i586.rpm | 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 ..
- # TODO: after development
- #rm -rf temp/
+ rm -rf temp/
fi
+