summaryrefslogtreecommitdiffstats
path: root/src/os-plugins/plugins/xserver/OpenSLX/Distro
diff options
context:
space:
mode:
Diffstat (limited to 'src/os-plugins/plugins/xserver/OpenSLX/Distro')
-rw-r--r--src/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm212
-rw-r--r--src/os-plugins/plugins/xserver/OpenSLX/Distro/Debian.pm50
-rw-r--r--src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm89
-rw-r--r--src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_10.pm63
-rw-r--r--src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_0.pm360
-rw-r--r--src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_1.pm361
-rw-r--r--src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_2.pm53
-rw-r--r--src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu.pm96
-rw-r--r--src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu_8.pm73
-rw-r--r--src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu_9.pm30
10 files changed, 1387 insertions, 0 deletions
diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm
new file mode 100644
index 00000000..51c1c60b
--- /dev/null
+++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm
@@ -0,0 +1,212 @@
+# Copyright (c) 2008..2010 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# xserver/OpenSLX/Distro/Base.pm
+# - provides base implementation of the Distro API for the xserver plugin.
+# -----------------------------------------------------------------------------
+package xserver::OpenSLX::Distro::Base;
+
+use strict;
+use warnings;
+
+our $VERSION = 1.01; # API-version . implementation-version
+
+use File::Basename;
+use File::Path;
+use Scalar::Util qw( weaken );
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+################################################################################
+### interface methods
+################################################################################
+sub new
+{
+ my $class = shift;
+ my $self = {};
+ return bless $self, $class;
+}
+
+sub initialize
+{
+ my $self = shift;
+ $self->{engine} = shift;
+ weaken($self->{engine});
+ # avoid circular reference between plugin and its engine
+
+ return 1;
+}
+
+sub setupXserverScript
+{
+ my $self = shift;
+ my $repoPath = shift;
+
+ my $pathInfo = $self->XserverPathInfo();
+ my $configFile = $pathInfo->{config};
+
+ my $script = unshiftHereDoc(<<' End-of-Here');
+ # xserver.sh (base part)
+ # written by OpenSLX-plugin 'xserver' (via xserver/Distro/Base.pm module)
+
+ # generating the base configuration file (might be split into several
+ # files for newer Xorg servers)
+ echo -e "# ${xfc#/mnt*}\n# autogenerated X hardware configuration by \
+ the xserver plugin in OpenSLX stage3\n# DO NOT EDIT THIS FILE BUT THE PLUGIN \
+ INSTEAD" >${xfc}
+ # using variables defined in XX_xserver.sh
+ echo -e "${x_modpath}\n${x_srvflags}\n${x_modules}" >>${xfc}
+ echo -e "${x_keyboard}\n${x_mouse}\n${x_videocard}" >>${xfc}
+ echo -e "${x_monitor}\n${x_screen}\n${x_srvlayout}\n${x_dri}" >>${xfc}
+ # if no module was detected, stick to vesa module
+ if [ -n "$xmodule" ] ; then
+ sed "s/vesa/$xmodule/;s/\"us\"/\"${XKEYBOARD}\"/" -i ${xfc}
+ else
+ sed "s/\"us\"/\"${XKEYBOARD}\"/" -i ${xfc}
+ fi
+ if [ -n "${BUSID}" ]; then
+ sed -e "s,^#.*BusID .*, BusID \"${BUSID}\",g" -i ${xfc}
+ fi
+ # end of base xorg.conf generation
+
+ End-of-Here
+
+ return $script;
+}
+
+# not used yet, kept as example
+sub XserverPathInfo
+{
+ my $self = shift;
+
+ my $pathInfo = {
+ config => '/etc/X11/xorg.conf',
+ paths => [
+ '/usr/bin',
+ ],
+ };
+
+ 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 >/dev/null 2>&1");
+ 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 >/dev/null 2>&1");
+ die("Could not extract dkms script from tarball! Exiting!") if($? > 0 );
+ }
+ copyFile("dkms-2.0.21.1/dkms","/sbin");
+ chmod 0755, "/sbin/dkms";
+ }
+}
+
+
+1;
diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Debian.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Debian.pm
new file mode 100644
index 00000000..29156e60
--- /dev/null
+++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Debian.pm
@@ -0,0 +1,50 @@
+# Copyright (c) 2008 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# xserver/OpenSLX/Distro/Debian.pm
+# - provides Debian-specific overrides of the distro API for the xserver
+# plugin.
+# -----------------------------------------------------------------------------
+package xserver::OpenSLX::Distro::Debian;
+
+use strict;
+use warnings;
+
+use base qw(xserver::OpenSLX::Distro::Base);
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+################################################################################
+### interface methods
+################################################################################
+
+sub setupXserverScript
+{
+ my $self = shift;
+ my $repoPath = shift;
+
+ my $script = $self->SUPER::setupXserverScript($repoPath);
+
+ $script .= unshiftHereDoc(<<' End-of-Here');
+ # Debian specific extension to stage3 xserver.sh
+ testmkd /mnt/var/lib/xkb
+ End-of-Here
+
+ return $script;
+}
+
+# stage3 script might need to add special path /var/X11R6/bin to the PATH variable
+# # fixme!! add path directly to /etc/profile!?
+# #[ "x$addpath" != "x" ] && \
+# # echo -e "# added path component by $0: $date\n\
+# #PATH=\"\$PATH:/var/X11R6/bin\"" >>/mnt/etc/profile
+
+1;
diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm
new file mode 100644
index 00000000..7a706019
--- /dev/null
+++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm
@@ -0,0 +1,89 @@
+# Copyright (c) 2008..2010 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# xserver/OpenSLX/Distro/Suse.pm
+# - provides SUSE-specific overrides of the Distro API for the xserver
+# plugin.
+# -----------------------------------------------------------------------------
+package xserver::OpenSLX::Distro::Suse;
+
+use strict;
+use warnings;
+
+use base qw(xserver::OpenSLX::Distro::Base);
+
+use File::Path;
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+use OpenSLX::DistroUtils;
+
+use Data::Dumper;
+
+################################################################################
+### interface methods
+################################################################################
+
+sub setupXserverScript
+{
+ my $self = shift;
+ my $repoPath = shift;
+
+ my $script = $self->SUPER::setupXserverScript($repoPath);
+
+ # add stuff to the script generated via Base.pm
+ $script .= unshiftHereDoc(<<' End-of-Here');
+ # SuSE specific extension to stage3 xserver.sh
+ testmkd /mnt/etc/X11/xorg.conf.d
+ # Add InputClass to proper setup the keyboard and other input
+ echo 'Section "InputClass"
+ Identifier "evdev pointer catchall"
+ MatchIsPointer "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "evdev"
+ EndSection
+ Section "InputClass"
+ Identifier "evdev keyboard catchall"
+ MatchIsKeyboard "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "evdev"
+ EndSection
+ Section "InputClass"
+ Identifier "evdev touchpad catchall"
+ MatchIsTouchpad "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "evdev"
+ EndSection
+ Section "InputClass"
+ Identifier "evdev tablet catchall"
+ MatchIsTablet "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "evdev"
+ EndSection
+ Section "InputClass"
+ Identifier "evdev touchscreen catchall"
+ MatchIsTouchscreen "on"
+ MatchDevicePath "/dev/input/event*"
+ Driver "evdev"
+ EndSection' >/mnt/etc/X11/xorg.conf.d/10-evdev.conf
+ # Xorg hardware is autodetected, so no module information provided
+ [ -z "${xmodule}" ] && \
+ sed "/Section \"Device\"/,/EndSection/d" -i ${xfc}
+ testmkd /mnt/var/lib/xkb/compiled
+ testmkd /mnt/var/lib/X11
+ testmkd /mnt/var/lib/xdm/authdir/authfiles 0700
+ ln -s /usr/bin/Xorg /mnt/var/lib/X11/X
+ rm /mnt/etc/X11/xdm/SuSEconfig.xdm
+ End-of-Here
+
+ return $script;
+}
+
+1;
diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_10.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_10.pm
new file mode 100644
index 00000000..f0c3ebb8
--- /dev/null
+++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_10.pm
@@ -0,0 +1,63 @@
+# Copyright (c) 2008..2010 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# xserver/OpenSLX/Distro/Suse_10.pm
+# - provides SUSE-specific overrides of the Distro API for the xserver
+# plugin.
+# -----------------------------------------------------------------------------
+package xserver::OpenSLX::Distro::Suse_10;
+
+use strict;
+use warnings;
+
+use base qw(xserver::OpenSLX::Distro::Base);
+
+use File::Path;
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+################################################################################
+### interface methods
+################################################################################
+
+sub setupXserverScript
+{
+ my $self = shift;
+ my $repoPath = shift;
+
+ my $script = $self->SUPER::setupXserverScript($repoPath);
+
+ $script .= unshiftHereDoc(<<' End-of-Here');
+ # suse specific extension to stage3 xserver.sh
+ testmkd /mnt/var/lib/xkb/compiled
+ testmkd /mnt/var/X11R6/bin
+ ln -s /usr/bin/Xorg /mnt/var/X11R6/bin/X
+ rm /mnt/etc/X11/xdm/SuSEconfig.xdm
+ # use the old kbd keyboard driver instead of evdev
+ sed "s/\"evdev\"/,/\"kbd\"/" -i ${xfc}
+ # relevant for older xservers only: check for kind of xorg module used
+ # and patch the i8,9XX VGA BIOS if needed
+ #if strinfile '"i810"' $xfc && [ -f /etc/hwinfo.display ] ; then
+ # highres=$(sort -run /etc/hwinfo.display|grep -i x -m 1)
+ # 915resolution -l|sed -n "s/Mode //;/32 bits/p" > /tmp/915res
+ # strinfile ${highres} /tmp/915res || {
+ # 915resolution $(grep -i x -m 1 /tmp/915res|sed "s/\ :.*//") $(echo \
+ # $highres|sed "s/x/\ /") 2>&1 >/dev/null;
+ # # for some reason the above does not work for a Dell laptop with Intel
+ # # 855 chipset, so add another mode too
+ # 915resolution 3c $(echo $highres|sed "s/x/\ /") 2>&1 >/dev/null; }
+ #fi
+ End-of-Here
+
+ return $script;
+}
+
+1;
diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_0.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_0.pm
new file mode 100644
index 00000000..4117c421
--- /dev/null
+++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_0.pm
@@ -0,0 +1,360 @@
+# Copyright (c) 2008..2010 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# xserver/OpenSLX/Distro/Suse_11_0.pm
+# - provides SUSE-specific overrides of the Distro API for the xserver
+# plugin.
+# -----------------------------------------------------------------------------
+package xserver::OpenSLX::Distro::Suse_11_0;
+
+use strict;
+use warnings;
+
+use base qw(xserver::OpenSLX::Distro::Base);
+
+use File::Path;
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+use OpenSLX::DistroUtils;
+
+use Data::Dumper;
+
+################################################################################
+### interface methods
+################################################################################
+
+sub setupXserverScript
+{
+ my $self = shift;
+ my $repoPath = shift;
+
+ my $script = $self->SUPER::setupXserverScript($repoPath);
+
+ $script .= unshiftHereDoc(<<' End-of-Here');
+ # SuSE specific extension to stage3 xserver.sh
+ testmkd /mnt/var/lib/xkb/compiled
+ testmkd /mnt/var/X11R6/bin
+ testmkd /mnt/var/lib/xdm/authdir/authfiles 0700
+ ln -s /usr/bin/Xorg /mnt/var/X11R6/bin/X
+ rm /mnt/etc/X11/xdm/SuSEconfig.xdm
+ End-of-Here
+
+ return $script;
+}
+
+# This function needs wget installed
+sub installNvidia
+{
+ my $self = shift;
+ my $repopath = shift || "/opt/openslx/plugin-repo/xserver/";
+ my $pkgpath = shift || "packages";
+
+ my $tmpdir = "$repopath/nvidia/temp";
+ if( !-d $tmpdir ) {
+ mkdir( $tmpdir );
+ }
+ else {
+ system("rm -rf $tmpdir/*");
+ }
+
+ my $mykernel = getKernelVersionForDistro("/boot");
+ my $kver = $mykernel->{'version'};
+ my $ksuffix = $mykernel->{'suffix'};
+
+ my $srinfo = `head -n1 /etc/SuSE-release`;
+ my @data = split (/ /, $srinfo);
+ chomp(@data);
+
+ my $version = $data[1];
+ my $chost = substr($data[2],1,-1);
+
+ my $url = "ftp://download.nvidia.com/opensuse/$version/$chost";
+
+ print " * Downloading NVIDIA rpm from ftp://download.nvidia.com/opensuse/$version\n";
+
+ system("wget -P $tmpdir -t2 -T2 $url/nvidia-gfxG01-kmp-$ksuffix* >/dev/null 2>&1");
+
+ if($? > 0) {
+ print "Could not download nvidia kernel module rpm!\n";
+ }
+
+ my @rpm = glob "$tmpdir/nvidia-gfxG01*.rpm";
+ my $rpm = @rpm;
+ $rpm[0] =~ /nvidia-gfxG01-kmp-$ksuffix-(.*?)_(.*?)-.*?\.$chost.rpm/;
+
+ my $nv_kver = $2;
+ $nv_kver =~ s/_/-/g;
+
+ if($rpm == 0) {
+ print "Could not download nvidia kernel module rpm!";
+ return;
+ }
+
+ system("cd $tmpdir; rpm2cpio $rpm[0] | cpio -idv >/dev/null 2>&1");
+
+ if(!-d "$repopath/nvidia/modules/")
+ {
+ mkdir("$repopath/nvidia/modules/");
+ }
+
+
+ # since kernel 2.6.25.20-0.1 there has to be a call to ld
+ # ld -r -m elf_i386 -o ../modules/nvidia.ko lib/modules/2.6.25.20-0.4-pae/updates/{nv-kernel,nv-linux}.o
+
+ my $nv_path = glob "$tmpdir/lib/modules/*-$ksuffix/updates/";
+ if ( -f "$nv_path/nv-kernel.o" ) {
+ # we have to link our kernel module here
+ system("ld -r -m elf_i386 -o $nv_path/nvidia.ko $nv_path/{nv-kernel,nv-linux}.o");
+ }
+
+ copyFile("$nv_path/nvidia.ko", "$repopath/nvidia/modules");
+
+
+ my @versions = split(/-/, $rpm[0]);
+ my @nv_versions = split('_',$versions[5]);
+ my $nv_version = $nv_versions[0];
+
+ system("wget -P $tmpdir -t2 -T2 $url/x11-video-nvidiaG01-$nv_version* >/dev/null 2>&1");
+
+ @rpm = glob "$tmpdir/x11-video-nvidiaG01-$nv_version*";
+ $rpm = @rpm;
+
+ if($rpm == 0)
+ {
+ print "Could not download x11-video-nvidiaG01-$nv_version*.rpm!\n";
+ print "Exiting nvidia driver installation!\n";
+ return;
+ }
+
+ system("cd $tmpdir; rpm2cpio $rpm[0] | cpio -idv >/dev/null 2>&1");
+
+ rmtree("$tmpdir/usr/share");
+ system("mv $tmpdir/usr $repopath/nvidia/");
+
+ rmtree($tmpdir);
+
+}
+
+# this function needs wget
+sub installAti
+{
+ my $self = shift;
+ my $repopath = shift || "/opt/openslx/plugin-repo/xserver/";
+ my $pkgpath = shift || "packages";
+
+ my $tmpdir = "$repopath/ati/temp";
+ if( !-d $tmpdir ) {
+ mkdir( $tmpdir );
+ }
+ else {
+ system("rm -rf $tmpdir/*");
+ }
+
+ my $mykernel = getKernelVersionForDistro("/boot");
+ my $kver = $mykernel->{'version'};
+ my $kver_ati = $kver;
+ $kver_ati =~ s/-/_/;
+
+ my $ksuffix = $mykernel->{'suffix'};
+
+ my $srinfo = `head -n1 /etc/SuSE-release`;
+ my @data = split (/ /, $srinfo);
+ chomp(@data);
+
+ my $version = $data[1];
+ my $chost = substr($data[2],1,-1);
+
+ my $url = "http://www2.ati.com/suse/$version/";
+
+ print " * Downloading ATI rpm from http://www2.ati.com/suse/$version\n";
+
+ system("wget -P $tmpdir -t2 -T2 $url/repodata/primary.xml.gz >/dev/null 2>&1");
+
+ my $url2 = `zcat $tmpdir/primary.xml.gz | grep -P -o "$chost/ati-fglrxG01-kmp-$ksuffix.*?$kver_ati.*?$chost.rpm"`;
+ chomp($url2);
+
+ if($url2 eq '') {
+ # Taking more general kernel version (minus local suse version)
+ my $newkernvers = '';
+ if($kver_ati =~ /(.*)_(.*?)$/) {
+ # if we have a match here
+ $newkernvers = $1;
+ }
+ else {
+ # just try the old method
+ $newkernvers = substr $kver_ati, 0, -4;
+ }
+ $url2 = `zcat $tmpdir/primary.xml.gz | grep -P -o "$chost/ati-fglrxG01-kmp-$ksuffix.*?$newkernvers.*?$chost.rpm"`;
+ chomp($url2);
+ if(! $url2 eq '') {
+ $kver = $newkernvers;
+ }
+ else {
+ # Minus local Suse version number - hoping, there was no ABI change
+ if($newkernvers =~ /(.*).(.*?)$/) {
+ # here we try with yet another older kernel version
+ $newkernvers = $1;
+ }
+ else {
+ $newkernvers = substr $kver_ati, 0, -7;
+ }
+ $url2 = `zcat $tmpdir/primary.xml.gz | grep -P -o "$chost/ati-fglrxG01-kmp-$ksuffix.*?$newkernvers.*?$chost.rpm"`;
+ chomp($url2);
+ if(! $url2 eq '') {
+ $kver = $newkernvers;
+ }
+
+ }
+ }
+
+# print "KVER = $kver; CHOST = $chost; ksuffix=$ksuffix\n";
+# system("bash");
+
+ if($url2 eq '') {
+ print "No ATI module rpm for the chosen kernel version ($kver) found! Exiting!\n";
+ return;
+ }
+ system("wget -P $tmpdir -t2 -T2 $url/$url2 >/dev/null 2>&1");
+
+ my @rpm = glob "$tmpdir/ati-fglrxG01-kmp-$ksuffix*$chost.rpm";
+ my $rpm = @rpm;
+
+ if($rpm == 0) {
+ print "Could not download ATI kernel module rpm (for kernel $kver)!\n";
+ print "Consider downgrading your Kernel! \nTrying package-install!\n";
+ $self->installAtiOldStyle(@_);
+ return;
+ }
+
+ system("cd $tmpdir; rpm2cpio $rpm[0] | cpio -idv >/dev/null 2>&1");
+
+ if(!-d "$repopath/ati/modules/")
+ {
+ mkdir("$repopath/ati/modules/");
+ }
+ copyFile("$tmpdir/lib/modules/$kver*-$ksuffix/updates/fglrx.ko",
+ "$repopath/ati/modules");
+
+ my @versions = split(/-/, $rpm[0]);
+ my @ati_versions = split('_',$versions[5]);
+ my $ati_version = $ati_versions[0];
+
+ $url2 = `zcat $tmpdir/primary.xml.gz | grep -P -o "$chost/x11-video-fglrxG01-$ati_version-.*?.$chost.rpm"`;
+ chomp($url2);
+ system("wget -P $tmpdir -t2 -T2 $url/$url2 >/dev/null 2>&1");
+
+ @rpm = glob "$tmpdir/x11-video-fglrxG01-$ati_version*";
+ $rpm = @rpm;
+
+ if($rpm == 0)
+ {
+ print " Could not download x11-video-fglrxG01-$ati_version*.rpm!\n";
+ print " Exiting ATI driver installation!\n";
+ return;
+ }
+
+ system("cd $tmpdir; rpm2cpio $rpm[0] | cpio -idv >/dev/null 2>&1");
+
+ rmtree("$tmpdir/usr/share");
+ system("mv $tmpdir/usr $repopath/ati/");
+ system("mv $tmpdir/etc $repopath/ati/");
+ if( ! -d "/usr/X11R6/lib/modules/dri/" ) {
+ system("mkdir -p /usr/X11R6/lib/modules/dri/");
+ }
+ symlink("$repopath/ati/usr/lib/dri/fglrx_dri.so","/usr/X11R6/lib/modules/dri/fglrx_dri.so");
+
+ rmtree($tmpdir);
+}
+
+
+
+sub installAtiOldStyle
+{
+ my $self = shift;
+ my $repopath = shift || "/opt/openslx/plugin-repo/xserver/";
+ my $pkgpath = shift || "packages";
+
+
+ my $ret = $self->SUPER::installAti(@_);
+
+ if($ret =~ /^error$/) {
+ print "Something went wrong installing ATI files!\n";
+ return;
+ }
+
+ $self->SUPER::getdkms();
+ my $mykernel = getKernelVersionForDistro("/boot");
+ my $kver = $mykernel->{'version'};
+ my $kver_ati = $kver;
+ $kver_ati =~ s/-/_/;
+
+ my $ksuffix = $mykernel->{'suffix'};
+
+ my $srinfo = `head -n1 /etc/SuSE-release`;
+ my @data = split (/ /, $srinfo);
+ chomp(@data);
+
+ my $version = $data[1];
+ my $chost = substr($data[2],1,-1);
+
+ # here we have to compile the kernel modules for all kernels
+ #
+ my $ati_version = `head $repopath/$pkgpath/ati-driver-installer-*.run | grep -P -o '[0-9]+\.[0-9]{3}' | tail -n1`;
+ chomp($ati_version);
+
+ system("mv $ret /usr/src/fglrx-$ati_version >/dev/null 2>&1");
+
+ open FH,">/usr/src/fglrx-$ati_version/dkms.conf";
+ print FH "DEST_MODULE_LOCATION=/updates\n";
+ print FH "PACKAGE_NAME=fglrx\n";
+ print FH "PACKAGE_VERSION=$ati_version\n";
+ close FH;
+
+ my $cmd = "#============= Executing following command =============\n".
+ "/sbin/dkms ".
+ " -m fglrx -v $ati_version ".
+ " -k $kver-$ksuffix ".
+ " --kernelsourcedir /usr/src/linux-$kver-obj/i586/$ksuffix ".
+ " --no-prepare-kernel ".
+ " --no-clean-kernel ".
+ " build >/dev/null 2>&1 \n".
+ "#==========================================================";
+
+#print $cmd;
+ if(!-f "/var/lib/dkms/fglrx/$ati_version/$kver-$ksuffix/$chost/module/fglrx.ko") {
+ system("/sbin/dkms add -m fglrx -v $ati_version >/dev/null 2>&1");
+ system($cmd);
+ #if ($? > 0) {
+ # print "\n\nCould not compile module! Exit with Ctrl-D\n";
+ # system("/bin/bash");
+ #}
+ }
+
+
+ if(!-d "$repopath/ati/modules/")
+ {
+ mkdir( "$repopath/ati/modules/" );
+ }
+
+ if( -e "/var/lib/dkms/fglrx/$ati_version/$kver-$ksuffix/$chost/module/fglrx.ko") {
+ copyFile("/var/lib/dkms/fglrx/$ati_version/$kver-$ksuffix/$chost/module/fglrx.ko",
+ "$repopath/ati/modules");
+ }
+ else {
+ print "Could not install ati driver via pkg-installer!\n";
+ rmtree($repopath."/ati");
+ return;
+ }
+ rmtree("$repopath/ati/temp");
+
+}
+
+1;
diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_1.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_1.pm
new file mode 100644
index 00000000..ab543549
--- /dev/null
+++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_1.pm
@@ -0,0 +1,361 @@
+# Copyright (c) 2008..2010 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# xserver/OpenSLX/Distro/Suse_11_1.pm
+# - provides SUSE-specific overrides of the Distro API for the xserver
+# plugin.
+# -----------------------------------------------------------------------------
+package xserver::OpenSLX::Distro::Suse_11_1;
+
+use strict;
+use warnings;
+
+use base qw(xserver::OpenSLX::Distro::Base);
+
+use File::Path;
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+use OpenSLX::DistroUtils;
+
+use Data::Dumper;
+
+################################################################################
+### interface methods
+################################################################################
+
+sub setupXserverScript
+{
+ my $self = shift;
+ my $repoPath = shift;
+
+ my $script = $self->SUPER::setupXserverScript($repoPath);
+
+ $script .= unshiftHereDoc(<<' End-of-Here');
+ # SuSE specific extension to stage3 xserver.sh
+ testmkd /mnt/var/lib/xkb/compiled
+ testmkd /mnt/var/X11R6/bin
+ testmkd /mnt/var/lib/xdm/authdir/authfiles 0700
+ ln -s /usr/bin/Xorg /mnt/var/X11R6/bin/X
+ rm /mnt/etc/X11/xdm/SuSEconfig.xdm
+ End-of-Here
+
+ return $script;
+}
+
+# This function needs wget installed
+sub installNvidia
+{
+ my $self = shift;
+ my $repopath = shift || "/opt/openslx/plugin-repo/xserver/";
+ my $pkgpath = shift || "packages";
+
+ my $tmpdir = "$repopath/nvidia/temp";
+ if( !-d $tmpdir ) {
+ mkdir( $tmpdir );
+ }
+ else {
+ system("rm -rf $tmpdir/*");
+ }
+
+ my $mykernel = getKernelVersionForDistro("/boot");
+ my $kver = $mykernel->{'version'};
+ my $ksuffix = $mykernel->{'suffix'};
+
+ my $srinfo = `head -n1 /etc/SuSE-release`;
+ my @data = split (/ /, $srinfo);
+ chomp(@data);
+
+ my $version = $data[1];
+ my $chost = substr($data[2],1,-1);
+
+ my $url = "ftp://download.nvidia.com/opensuse/$version/$chost";
+
+ print " * Downloading NVIDIA rpm from ftp://download.nvidia.com/opensuse/$version\n";
+
+ system("wget -P $tmpdir -t2 -T2 $url/nvidia-gfxG01-kmp-$ksuffix* >/dev/null 2>&1");
+
+ if($? > 0) {
+ print "Could not download nvidia kernel module rpm!\n";
+ }
+
+ my @rpm = glob "$tmpdir/nvidia-gfxG01*.rpm";
+ my $rpm = @rpm;
+ $rpm[0] =~ /nvidia-gfxG01-kmp-$ksuffix-(.*?)_(.*?)-.*?\.$chost.rpm/;
+
+ my $nv_kver = $2;
+ $nv_kver =~ s/_/-/g;
+
+ if($rpm == 0) {
+ print "Could not download nvidia kernel module rpm!";
+ return;
+ }
+
+ system("cd $tmpdir; rpm2cpio $rpm[0] | cpio -idv >/dev/null 2>&1");
+
+ if(!-d "$repopath/nvidia/modules/")
+ {
+ mkdir("$repopath/nvidia/modules/");
+ }
+
+
+ # since kernel 2.6.25.20-0.1 there has to be a call to ld
+ # ld -r -m elf_i386 -o ../modules/nvidia.ko lib/modules/2.6.25.20-0.4-pae/updates/{nv-kernel,nv-linux}.o
+
+ my $nv_path = glob "$tmpdir/lib/modules/*-$ksuffix/updates/";
+ if ( -f "$nv_path/nv-kernel.o" ) {
+ # we have to link our kernel module here
+ system("ld -r -m elf_i386 -o $nv_path/nvidia.ko $nv_path/{nv-kernel,nv-linux}.o");
+ }
+
+ copyFile("$nv_path/nvidia.ko", "$repopath/nvidia/modules");
+
+
+ my @versions = split(/-/, $rpm[0]);
+ my @nv_versions = split('_',$versions[5]);
+ my $nv_version = $nv_versions[0];
+
+ system("wget -P $tmpdir -t2 -T2 $url/x11-video-nvidiaG01-$nv_version* >/dev/null 2>&1");
+
+ @rpm = glob "$tmpdir/x11-video-nvidiaG01-$nv_version*";
+ $rpm = @rpm;
+
+ if($rpm == 0)
+ {
+ print "Could not download x11-video-nvidiaG01-$nv_version*.rpm!\n";
+ print "Exiting nvidia driver installation!\n";
+ return;
+ }
+
+ system("cd $tmpdir; rpm2cpio $rpm[0] | cpio -idv >/dev/null 2>&1");
+
+ rmtree("$tmpdir/usr/share");
+ system("mv $tmpdir/usr $repopath/nvidia/");
+
+ rmtree($tmpdir);
+
+}
+
+
+# this function needs wget
+sub installAti
+{
+ my $self = shift;
+ my $repopath = shift || "/opt/openslx/plugin-repo/xserver/";
+ my $pkgpath = shift || "packages";
+
+ my $tmpdir = "$repopath/ati/temp";
+ if( !-d $tmpdir ) {
+ mkdir( $tmpdir );
+ }
+ else {
+ system("rm -rf $tmpdir/*");
+ }
+
+ my $mykernel = getKernelVersionForDistro("/boot");
+ my $kver = $mykernel->{'version'};
+ my $kver_ati = $kver;
+ $kver_ati =~ s/-/_/;
+
+ my $ksuffix = $mykernel->{'suffix'};
+
+ my $srinfo = `head -n1 /etc/SuSE-release`;
+ my @data = split (/ /, $srinfo);
+ chomp(@data);
+
+ my $version = $data[1];
+ my $chost = substr($data[2],1,-1);
+
+ my $url = "http://www2.ati.com/suse/$version/";
+
+ print " * Downloading ATI rpm from http://www2.ati.com/suse/$version\n";
+
+ system("wget -P $tmpdir -t2 -T2 $url/repodata/primary.xml.gz >/dev/null 2>&1");
+
+ my $url2 = `zcat $tmpdir/primary.xml.gz | grep -P -o "$chost/ati-fglrxG01-kmp-$ksuffix.*?$kver_ati.*?$chost.rpm"`;
+ chomp($url2);
+
+ if($url2 eq '') {
+ # Taking more general kernel version (minus local suse version)
+ my $newkernvers = '';
+ if($kver_ati =~ /(.*)_(.*?)$/) {
+ # if we have a match here
+ $newkernvers = $1;
+ }
+ else {
+ # just try the old method
+ $newkernvers = substr $kver_ati, 0, -4;
+ }
+ $url2 = `zcat $tmpdir/primary.xml.gz | grep -P -o "$chost/ati-fglrxG01-kmp-$ksuffix.*?$newkernvers.*?$chost.rpm"`;
+ chomp($url2);
+ if(! $url2 eq '') {
+ $kver = $newkernvers;
+ }
+ else {
+ # Minus local Suse version number - hoping, there was no ABI change
+ if($newkernvers =~ /(.*).(.*?)$/) {
+ # here we try with yet another older kernel version
+ $newkernvers = $1;
+ }
+ else {
+ $newkernvers = substr $kver_ati, 0, -7;
+ }
+ $url2 = `zcat $tmpdir/primary.xml.gz | grep -P -o "$chost/ati-fglrxG01-kmp-$ksuffix.*?$newkernvers.*?$chost.rpm"`;
+ chomp($url2);
+ if(! $url2 eq '') {
+ $kver = $newkernvers;
+ }
+
+ }
+ }
+
+# print "KVER = $kver; CHOST = $chost; ksuffix=$ksuffix\n";
+# system("bash");
+
+ if($url2 eq '') {
+ print "No ATI module rpm for the chosen kernel version ($kver) found! Exiting!\n";
+ return;
+ }
+ system("wget -P $tmpdir -t2 -T2 $url/$url2 >/dev/null 2>&1");
+
+ my @rpm = glob "$tmpdir/ati-fglrxG01-kmp-$ksuffix*$chost.rpm";
+ my $rpm = @rpm;
+
+ if($rpm == 0) {
+ print "Could not download ATI kernel module rpm (for kernel $kver)!\n";
+ print "Consider downgrading your Kernel! \nTrying package-install!\n";
+ $self->installAtiOldStyle(@_);
+ return;
+ }
+
+ system("cd $tmpdir; rpm2cpio $rpm[0] | cpio -idv >/dev/null 2>&1");
+
+ if(!-d "$repopath/ati/modules/")
+ {
+ mkdir("$repopath/ati/modules/");
+ }
+ copyFile("$tmpdir/lib/modules/$kver*-$ksuffix/updates/fglrx.ko",
+ "$repopath/ati/modules");
+
+ my @versions = split(/-/, $rpm[0]);
+ my @ati_versions = split('_',$versions[5]);
+ my $ati_version = $ati_versions[0];
+
+ $url2 = `zcat $tmpdir/primary.xml.gz | grep -P -o "$chost/x11-video-fglrxG01-$ati_version-.*?.$chost.rpm"`;
+ chomp($url2);
+ system("wget -P $tmpdir -t2 -T2 $url/$url2 >/dev/null 2>&1");
+
+ @rpm = glob "$tmpdir/x11-video-fglrxG01-$ati_version*";
+ $rpm = @rpm;
+
+ if($rpm == 0)
+ {
+ print " Could not download x11-video-fglrxG01-$ati_version*.rpm!\n";
+ print " Exiting ATI driver installation!\n";
+ return;
+ }
+
+ system("cd $tmpdir; rpm2cpio $rpm[0] | cpio -idv >/dev/null 2>&1");
+
+ rmtree("$tmpdir/usr/share");
+ system("mv $tmpdir/usr $repopath/ati/");
+ system("mv $tmpdir/etc $repopath/ati/");
+ if( ! -d "/usr/X11R6/lib/modules/dri/" ) {
+ system("mkdir -p /usr/X11R6/lib/modules/dri/");
+ }
+ symlink("$repopath/ati/usr/lib/dri/fglrx_dri.so","/usr/X11R6/lib/modules/dri/fglrx_dri.so");
+
+ rmtree($tmpdir);
+}
+
+
+
+sub installAtiOldStyle
+{
+ my $self = shift;
+ my $repopath = shift || "/opt/openslx/plugin-repo/xserver/";
+ my $pkgpath = shift || "packages";
+
+
+ my $ret = $self->SUPER::installAti(@_);
+
+ if($ret =~ /^error$/) {
+ print "Something went wrong installing ATI files!\n";
+ return;
+ }
+
+ $self->SUPER::getdkms();
+ my $mykernel = getKernelVersionForDistro("/boot");
+ my $kver = $mykernel->{'version'};
+ my $kver_ati = $kver;
+ $kver_ati =~ s/-/_/;
+
+ my $ksuffix = $mykernel->{'suffix'};
+
+ my $srinfo = `head -n1 /etc/SuSE-release`;
+ my @data = split (/ /, $srinfo);
+ chomp(@data);
+
+ my $version = $data[1];
+ my $chost = substr($data[2],1,-1);
+
+ # here we have to compile the kernel modules for all kernels
+ #
+ my $ati_version = `head $repopath/$pkgpath/ati-driver-installer-*.run | grep -P -o '[0-9]+\.[0-9]{3}' | tail -n1`;
+ chomp($ati_version);
+
+ system("mv $ret /usr/src/fglrx-$ati_version >/dev/null 2>&1");
+
+ open FH,">/usr/src/fglrx-$ati_version/dkms.conf";
+ print FH "DEST_MODULE_LOCATION=/updates\n";
+ print FH "PACKAGE_NAME=fglrx\n";
+ print FH "PACKAGE_VERSION=$ati_version\n";
+ close FH;
+
+ my $cmd = "#============= Executing following command =============\n".
+ "/sbin/dkms ".
+ " -m fglrx -v $ati_version ".
+ " -k $kver-$ksuffix ".
+ " --kernelsourcedir /usr/src/linux-$kver-obj/i586/$ksuffix ".
+ " --no-prepare-kernel ".
+ " --no-clean-kernel ".
+ " build >/dev/null 2>&1 \n".
+ "#==========================================================";
+
+#print $cmd;
+ if(!-f "/var/lib/dkms/fglrx/$ati_version/$kver-$ksuffix/$chost/module/fglrx.ko") {
+ system("/sbin/dkms add -m fglrx -v $ati_version >/dev/null 2>&1");
+ system($cmd);
+ #if ($? > 0) {
+ # print "\n\nCould not compile module! Exit with Ctrl-D\n";
+ # system("/bin/bash");
+ #}
+ }
+
+
+ if(!-d "$repopath/ati/modules/")
+ {
+ mkdir( "$repopath/ati/modules/" );
+ }
+
+ if( -e "/var/lib/dkms/fglrx/$ati_version/$kver-$ksuffix/$chost/module/fglrx.ko") {
+ copyFile("/var/lib/dkms/fglrx/$ati_version/$kver-$ksuffix/$chost/module/fglrx.ko",
+ "$repopath/ati/modules");
+ }
+ else {
+ print "Could not install ati driver via pkg-installer!\n";
+ rmtree($repopath."/ati");
+ return;
+ }
+ rmtree("$repopath/ati/temp");
+
+}
+
+1;
diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_2.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_2.pm
new file mode 100644
index 00000000..5cddcef0
--- /dev/null
+++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Suse_11_2.pm
@@ -0,0 +1,53 @@
+# Copyright (c) 2010 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# xserver/OpenSLX/Distro/Suse_11_2.pm
+# - provides SUSE-specific overrides of the Distro API for the xserver
+# plugin.
+# -----------------------------------------------------------------------------
+package xserver::OpenSLX::Distro::Suse_11_2;
+
+use strict;
+use warnings;
+
+use base qw(xserver::OpenSLX::Distro::Base);
+
+use File::Path;
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+use OpenSLX::DistroUtils;
+
+use Data::Dumper;
+
+################################################################################
+### interface methods
+################################################################################
+
+sub setupXserverScript
+{
+ my $self = shift;
+ my $repoPath = shift;
+
+ my $script = $self->SUPER::setupXserverScript($repoPath);
+
+ $script .= unshiftHereDoc(<<' End-of-Here');
+ # SuSE specific extension to stage3 xserver.sh
+ testmkd /mnt/var/lib/xkb/compiled
+ testmkd /mnt/var/lib/X11
+ testmkd /mnt/var/lib/xdm/authdir/authfiles 0700
+ ln -s /usr/bin/Xorg /mnt/var/lib/X11/X
+ rm /mnt/etc/X11/xdm/SuSEconfig.xdm
+ End-of-Here
+
+ return $script;
+}
+
+1;
diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu.pm
new file mode 100644
index 00000000..057cf138
--- /dev/null
+++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu.pm
@@ -0,0 +1,96 @@
+# Copyright (c) 2008..2010 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# xserver/OpenSLX/Distro/Ubuntu.pm
+# - provides Ubuntu-specific overrides of the distro API for the xserver
+# plugin.
+# -----------------------------------------------------------------------------
+package xserver::OpenSLX::Distro::Ubuntu;
+
+use strict;
+use warnings;
+
+use base qw(xserver::OpenSLX::Distro::Base);
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+################################################################################
+### interface methods
+################################################################################
+
+# needs to be implemented ...
+sub XserverPathInfo
+{
+ my $self = shift;
+
+ my $pathInfo = {
+ config => '/etc/X11/xorg.openslx',
+ paths => [
+ '/usr/bin',
+ ],
+ };
+
+ return $pathInfo;
+}
+
+sub setupXserverScript
+{
+ my $self = shift;
+ my $repoPath = shift;
+
+ my $script = $self->SUPER::setupXserverScript($repoPath);
+
+ # overwriting script part from Base.pm
+ $script = unshiftHereDoc(<<' End-of-Here');
+ # Ubuntu specific extension to stage3 xserver.sh
+ echo -e "# ${xfc#/mnt*}\n# autogenerated X hardware configuration by \
+ the xserver plugin in OpenSLX stage3\n# DO NOT EDIT THIS FILE BUT THE PLUGIN \
+ INSTEAD" >${xfc}
+ # using variables defined in XX_xserver.sh
+ echo -e "${x_modpath}\n${x_srvflags}\n${x_modules}" >>${xfc}
+ echo "${x_keyboard}" | sed "s/kbd/evdev/" >>${xfc}
+ echo -e "${x_mouse}\n${x_monitor}\n${x_screen}" >>${xfc}
+ echo "${x_srvlayout}" | sed "/ Screen /d" >>${xfc}
+ testmkd /mnt/etc/X11/xorg.conf.d
+ testmkd /mnt/var/run/xauth
+ testmkd /mnt/var/lib/xkb
+ ln -sf /usr/bin/Xorg /mnt/etc/X11/X
+ End-of-Here
+
+ return $script;
+}
+
+
+sub installNvidia
+{
+ my $self = shift;
+ my $repopath = shift || "/opt/openslx/plugin-repo/xserver/";
+ my $pkgpath = shift || "packages";
+
+ my $distroName = $self->{engine}->distroName();
+
+ system($repopath."/ubuntu-gfx-install.sh nvidia $distroName");
+
+}
+
+sub installAti
+{
+ my $self = shift;
+ my $repopath = shift || "/opt/openslx/plugin-repo/xserver/";
+ my $pkgpath = shift || "packages";
+
+ my $distroName = $self->{engine}->distroName();
+
+ system($repopath."/ubuntu-gfx-install.sh ati $distroName");
+
+}
+
+1;
diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu_8.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu_8.pm
new file mode 100644
index 00000000..1fa88446
--- /dev/null
+++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu_8.pm
@@ -0,0 +1,73 @@
+# Copyright (c) 2008..2010 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# xserver/OpenSLX/Distro/Ubuntu_8.pm
+# - provides Ubuntu-specific overrides of the distro API for the xserver
+# plugin.
+# -----------------------------------------------------------------------------
+package xserver::OpenSLX::Distro::Ubuntu_8;
+
+use strict;
+use warnings;
+
+use base qw(xserver::OpenSLX::Distro::Base);
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+################################################################################
+### interface methods
+################################################################################
+
+sub setupXserverScript
+{
+ my $self = shift;
+ my $repoPath = shift;
+
+ my $script = $self->SUPER::setupXserverScript($repoPath);
+
+ $script .= unshiftHereDoc(<<' End-of-Here');
+ # Ubuntu specific extension to stage3 xserver.sh
+ # use the old kbd keyboard driver instead of evdev
+ sed "s/\"evdev\"/,/\"kbd\"/" -i ${xfc}
+ testmkd /mnt/var/run/xauth
+ testmkd /mnt/var/lib/xkb
+ ln -sf /usr/bin/Xorg /mnt/etc/X11/X
+ End-of-Here
+
+ return $script;
+}
+
+
+sub installNvidia
+{
+ my $self = shift;
+ my $repopath = shift || "/opt/openslx/plugin-repo/xserver/";
+ my $pkgpath = shift || "packages";
+
+ my $distroName = $self->{engine}->distroName();
+
+ system($repopath."/ubuntu-gfx-install.sh nvidia $distroName");
+
+}
+
+sub installAti
+{
+ my $self = shift;
+ my $repopath = shift || "/opt/openslx/plugin-repo/xserver/";
+ my $pkgpath = shift || "packages";
+
+ my $distroName = $self->{engine}->distroName();
+
+ system($repopath."/ubuntu-gfx-install.sh ati $distroName");
+
+}
+
+1;
diff --git a/src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu_9.pm b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu_9.pm
new file mode 100644
index 00000000..80dccbc9
--- /dev/null
+++ b/src/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu_9.pm
@@ -0,0 +1,30 @@
+# Copyright (c) 2008..2010 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# xserver/OpenSLX/Distro/Ubuntu_9.pm
+# - provides Ubuntu-specific overrides of the distro API for the xserver
+# plugin.
+# -----------------------------------------------------------------------------
+package xserver::OpenSLX::Distro::Ubuntu_9;
+
+use strict;
+use warnings;
+
+use base qw(xserver::OpenSLX::Distro::Ubuntu_8);
+
+use OpenSLX::Basics;
+use OpenSLX::Utils;
+
+################################################################################
+### interface methods
+################################################################################
+
+
+1;