diff options
author | Bastian Wissler | 2009-05-14 19:27:12 +0200 |
---|---|---|
committer | Bastian Wissler | 2009-05-14 19:27:12 +0200 |
commit | 641917d1f5eae763fbb6cffe4b583c2dd06d7d5e (patch) | |
tree | 68cbdf42e9f3814f95635e51b0c44ed5737f34b8 /os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm | |
parent | status in wlanboot plugin and typo in suse-11.1 installation (diff) | |
download | core-641917d1f5eae763fbb6cffe4b583c2dd06d7d5e.tar.gz core-641917d1f5eae763fbb6cffe4b583c2dd06d7d5e.tar.xz core-641917d1f5eae763fbb6cffe4b583c2dd06d7d5e.zip |
xserver plugin (some severe changes):
* Suse-11.x driver installation supported by perl module in Distro
* Ubuntu-9.04 tested with recent scripts (ubuntu-8.10-gfx-install.sh)
* this version does NOT (yet) support < suse-11.0, < ubuntu-8.04
-> below suse-11.0 is only not tested
* we use driver packages just for ati drivers on SuSE-11.0 and greater
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2856 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm')
-rw-r--r-- | os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm b/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm index 65ccb879..9672de87 100644 --- a/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm +++ b/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm @@ -19,6 +19,7 @@ use warnings; our $VERSION = 1.01; # API-version . implementation-version use File::Basename; +use File::Path; use OpenSLX::Basics; use OpenSLX::Utils; @@ -73,4 +74,115 @@ sub XserverPathInfo return $pathInfo; } + +# looks for the NVIDIA-installer and extracts it +sub installNvidia +{ + my $self = shift; + my $repopath = shift || "/opt/openslx/plugin-repo/xserver/"; + my $pkgpath = shift || "packages"; + + my @paths = glob $repopath.$pkgpath."/NVIDIA-Linux-x86*\n"; + my $paths = @paths; + + if ($paths > 1) + { + print "Found more than one NVIDIA-Linux-x86 installer. Taking first one.\n"; + } + if ($paths == 0) + { + print "Found no NVIDIA-Linux-x86 installer. Quitting NVIDIA installation!\n"; + return "error"; + } + + if ( ! -X $paths[0] ) + { + system("chmod +x ".$paths[0]); + } + system($paths[0]." -x --target $repopath/nvidia/temp >/dev/null 2>&1"); + + if($? == -1 ) + { + print "Failed to execute ".$paths[0]."\n"; + return "error"; + } + + system("mv $repopath/nvidia/temp/usr/src $repopath/nvidia/temp/"); + system("mv $repopath/nvidia/temp/usr/ $repopath/nvidia/"); + rmtree("$repopath/nvidia/usr/share/"); + + return "$repopath/nvidia/temp/src/nv"; +} + + +sub installAti +{ + my $self = shift; + my $repopath = shift || "/opt/openslx/plugin-repo/xserver/"; + my $pkgpath = shift || "packages"; + + my @paths = glob $repopath."/".$pkgpath."/ati-driver-installer*"; + my $paths = @paths; + + if ($paths > 1) + { + print "Found more than one ati-driver-installer. Taking first one.\n"; + } + if ($paths == 0) + { + print "Found no ati-driver-installer. Quitting ATI installation!\n"; + return "error"; + } + + if ( ! -X $paths[0] ) + { + system("chmod +x ".$paths[0]); + } + system($paths[0]." --extract $repopath/ati/temp >/dev/null 2>&1"); + + if($? == -1 ) + { + print "Failed to execute ".$paths[0]."\n"; + return "error"; + } + + # TODO: allow x86_64 driver installation (libs) + my $arch = "x86"; + + rmtree("$repopath/ati/usr"); + system("mv $repopath/ati/temp/common/usr $repopath/ati/"); + if (!-d "$repopath/ati/usr/lib" ) { + mkdir "$repopath/ati/usr/lib"; + } + system("mv $repopath/ati/temp/arch/$arch/usr/X11R6/lib/* $repopath/ati/usr/lib/"); + system("mv $repopath/ati/temp/arch/$arch/usr/lib/* $repopath/ati/usr/lib/"); + rmtree("$repopath/ati/usr/share/"); + + my $cmd='gcc --version | head -n 1 | sed -e "s/[^0-9. ]//g;s/^ *//;s/^\(.\)\..*$/\1/"'; + my $gcc_ver_maj =`$cmd`; + chomp($gcc_ver_maj); + + system("mv $repopath/ati/temp/arch/$arch/lib/modules/fglrx/build_mod/libfglrx_ip.a.GCC$gcc_ver_maj $repopath/ati/temp/common/lib/modules/fglrx/build_mod/"); + + + return "$repopath/ati/temp/common/lib/modules/fglrx/build_mod"; +} + +# get dkms with wget/tar and put it into /sbin +sub getdkms +{ + if( !-f "/sbin/dkms") { + if(!-f "dkms-2.0.21.1.tar.gz" ) { + system("wget http://linux.dell.com/dkms/permalink/dkms-2.0.21.1.tar.gz"); + die("Could not download dkms tarball! Exiting!") if($? > 0 ); + } + if(!-f "dkms-2.0.21.1/dkms" ) { + system("tar -zxvf dkms-2.0.21.1.tar.gz dkms-2.0.21.1/dkms"); + die("Could not extract dkms script from tarball! Exiting!") if($? > 0 ); + } + copy("dkms-2.0.21.1/dkms","/sbin/dkms"); + chmod 0755, "/sbin/dkms"; + } +} + 1; |