summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/xserver
diff options
context:
space:
mode:
authorDirk von Suchodoletz2009-02-02 14:28:30 +0100
committerDirk von Suchodoletz2009-02-02 14:28:30 +0100
commit0731962ec450b3217d0603035763884d8ff1d10b (patch)
tree4372f1523c5b77f4d517dfb739cf913bbc273b7f /os-plugins/plugins/xserver
parentAdd information on log-level activation in the slx standard commands. (diff)
downloadcore-0731962ec450b3217d0603035763884d8ff1d10b.tar.gz
core-0731962ec450b3217d0603035763884d8ff1d10b.tar.xz
core-0731962ec450b3217d0603035763884d8ff1d10b.zip
Adding general purpose NVidia lib installer (incomplete, just demo
directory structure within the xserver plugin), see #371 too. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2561 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/xserver')
-rw-r--r--os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm68
-rwxr-xr-xos-plugins/plugins/xserver/files/nvidia-install.sh73
2 files changed, 79 insertions, 62 deletions
diff --git a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
index 32708740..4940cf31 100644
--- a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
+++ b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
@@ -47,8 +47,8 @@ sub getInfo
This plugin tries to configure the local Xorg-Server and
integrates binary graphics drivers (closed sourced) into the system.
Notice that you need to have kernel-headers installed to work properly.
- You need to download the driver packages yourself and write the
- download folder into the right option.
+ in some cases. You need to download the driver packages yourself and
+ supply the download folder into the pkgpath option.
End-of-Here
precedence => 80,
};
@@ -113,19 +113,19 @@ sub getAttrInfo
# plugin specific attributes start here ...
# stage1
-# Currently we don't need it anymore. Perhaps in the future, thats
-# why it's just commented out
-# 'xserver::pkgpath' => {
-# applies_to_vendor_os => 0,
-# applies_to_vendor_os => 1,
-# description => unshiftHereDoc(<<' End-of-Here'),
-# Path to downloaded ATI or Nvidia package
-# End-of-Here
-# # TODO:
-# #content_regex => qr{^0|1$},
-# content_descr => 'Path to Nvidia or ATI packages',
-# default => '/root/xserver-pkgs',
-# },
+ # Currently not needed in scenarios where distro specific packages are
+ # available
+ 'xserver::pkgpath' => {
+ applies_to_vendor_os => 0,
+ applies_to_vendor_os => 1,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ Path to downloaded ATI or Nvidia package
+ End-of-Here
+ # TODO:
+ #content_regex => qr{^0|1$},
+ content_descr => 'Path to Nvidia or ATI packages',
+ default => '/root/xserver-pkgs',
+ },
'xserver::ati' => {
applies_to_vendor_os => 1,
description => unshiftHereDoc(<<' End-of-Here'),
@@ -170,24 +170,23 @@ sub preInstallationPhase()
$self->{attrs} = $info->{'plugin-attrs'};
$self->{vendorOsPath} = $info->{'vendor-os-path'};
-## Due of the fact that we download now our files we don't need this
-## part anymore. Maybe in the future. Thats why it's just commented out
-# my $pkgpath = $self->{attrs}->{'xserver::pkgpath'};
-# 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 && ($installNvidia == 1 || $installAti == 1)) {
-# # Todo: use a openslx copy function!
-# system("cp -r $pkgpath $self->{pluginRepositoryPath}/packages");
-# }
+
+ my $pkgpath = $self->{attrs}->{'xserver::pkgpath'};
+ 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 && ($installNvidia == 1 || $installAti == 1)) {
+ # Todo: use a openslx copy function!
+ system("cp -r $pkgpath $self->{pluginRepositoryPath}/packages");
+ }
}
@@ -216,6 +215,7 @@ sub installationPhase
# chroot
my $attrs = $info->{'plugin-attrs'};
# attributes in effect for this installation
+ my $vendorOSName = $self->{'os-plugin-engine'}->{'vendor-os-name'};
# write the distro specific extension (inclusion) of XX_xserver.sh
my $script = $self->{distro}->setupXserverScript($pluginRepoPath);
@@ -248,7 +248,7 @@ sub installationPhase
}
if ($attrs->{'xserver::nvidia'} == 1) {
copyFile("$pluginFilesPath/nvidia-install.sh", "$installationPath");
- system("/bin/bash /opt/openslx/plugin-repo/$self->{'name'}/nvidia-install.sh");
+ system("/bin/bash /opt/openslx/plugin-repo/$self->{'name'}/nvidia-install.sh $vendorOSName");
#system("/bin/bash /opt/openslx/plugin-repo/$self->{'name'}/linkage.sh nvidia");
}
diff --git a/os-plugins/plugins/xserver/files/nvidia-install.sh b/os-plugins/plugins/xserver/files/nvidia-install.sh
index 218020d5..cd91c22a 100755
--- a/os-plugins/plugins/xserver/files/nvidia-install.sh
+++ b/os-plugins/plugins/xserver/files/nvidia-install.sh
@@ -4,37 +4,54 @@
# Installs NVIDIA binary drivers into openslx plugin-repo
##########################################################
PLUGIN_PATH="/opt/openslx/plugin-repo/xserver"
-TMP_FOLDER="/opt/openslx/plugin-repo/xserver/nvidia/temp"
-PKG_FOLDER="/opt/openslx/plugin-repo/xserver/packages"
-MODULES_FOLDER="/opt/openslx/plugin-repo/xserver/modules"
-
-#TODO: check if we still have .../xserver/nvidia folder
-
-DISTRO=$(lsb_release -i)
-RELEASE=$(lsb_release -r)
+# we could easily pass this information via calling stage1 script and do not
+# need to find it our here ...
+DISTRO=$1
cd ${PLUGIN_PATH}
-# Ubuntu gfx-install.sh skript
-if [ "1" -eq "$(echo ${DISTRO} | grep 'Ubuntu' | wc -l)" ]; then
- # we have Ubuntu - run ubuntu-gfx-install
- echo "* Using Ubuntu packages to install nvidia modules and libs"
- if [ "8.10" = "$(echo ${RELEASE}| awk '{print $2}')" ]; then
+case ${DISTRO} in
+ ubuntu-8.10*)
./ubuntu-8.10-gfx-install.sh nvidia
- else
+ ;;
+ ubuntu*)
./ubuntu-gfx-install.sh nvidia
- 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 nvidia modules and libs"
- ./suse-gfx-install.sh nvidia
- exit
-fi
-# End suse gfx-install.sh
+ ;;
+ suse-11.X*)
+ ./suse-gfx-install.sh nvidia
+ ;;
+ # general purpose nvidia installer script
+ *)
+ echo " * Running general NVidia installer (expected in ~/xserver-pkgs)"
+ # unpack the nvidia installer; quickhack - expects just one package
+ echo " * Unpacking installer"
+ sh packages/NVIDIA-Linux-*.run -a -x >>nvidia-inst.log 2>&1
+ stdprfx=/opt/openslx/plugin-repo/xserver/nvidia
+ # run the lib installer
+ echo " * Starting the library installer"
+ echo "Starting the lib installer" >>nvidia-inst.log
+ $(ls -d NVIDIA-Linux-*)/nvidia-installer -s -q -N --no-abi-note \
+ --x-prefix=${stdprfx}/usr --x-library-path=${stdprfx}/usr/lib \
+ --x-module-path=${stdprfx}/usr/lib/xorg/modules \
+ --opengl-prefix=${stdprfx}/usr --utility-prefix=${stdprfx}/usr \
+ --documentation-prefix=${stdprfx}/usr --no-runlevel-check \
+ --no-rpms --no-x-check --no-kernel-module \
+ --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
+ echo " * Trying to compile a kernel module for $kernel"
+ echo "Starting the kernel $kernel installer" >>nvidia-inst.log
+ $(ls -d NVIDIA-Linux-*)/nvidia-installer -s -q -N -K --no-abi-note \
+ --kernel-source-path=/lib/modules/${kernel}/build -k ${kernel} \
+ --kernel-install-path=/opt/openslx/plugin-repo/xserver/nvidia/modules \
+ --no-runlevel-check --no-abi-note --no-rpms --no-cc-version-check \
+ --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"
+ ;;
+esac
+
+# set a proper return value to evaluate it in the calling script
+exit 0