summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm2
-rw-r--r--os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm158
-rw-r--r--os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm2
-rw-r--r--os-plugins/plugins/xserver/XX_xserver.sh14
-rwxr-xr-xos-plugins/plugins/xserver/files/ubuntu-gfx-install.sh9
5 files changed, 96 insertions, 89 deletions
diff --git a/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm b/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm
index 9672de87..04f85ed9 100644
--- a/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm
+++ b/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm
@@ -180,7 +180,7 @@ sub getdkms
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");
+ copyFile("dkms-2.0.21.1/dkms","/sbin");
chmod 0755, "/sbin/dkms";
}
}
diff --git a/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm b/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm
index 6419bc44..b96f6ffb 100644
--- a/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm
+++ b/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm
@@ -48,7 +48,7 @@ sub setupXserverScript
return $script;
}
-
+# This function needs wget installed
sub installNvidia
{
my $self = shift;
@@ -59,47 +59,13 @@ sub installNvidia
if( !-d $tmpdir ) {
mkdir( $tmpdir );
}
-#
-# my $ret = $self->SUPER::installNvidia(@_);
-#
-# if($ret =~ /^error$/) {
-# print "Something went wrong installing NVIDIA files!\n";
-# return;
-# }
-#
-# $self->SUPER::getdkms();
-#
+ else {
+ system("rm -rf $tmpdir/*");
+ }
+
+ # TODO: Sort out kernel version programmatically
my $kver = "2.6.25.20-0.1";
my $ksuffix = "pae";
-#
-# # here we have to compile the kernel modules for all kernels
-# my $grep = "grep -io DNV_VERSION_STRING=.* $ret/Makefile.nvidia |".
-# "cut -d'\\' -f2 | cut -d'\"' -f2";
-# my $nv_version = `$grep`;
-# chomp($nv_version);
-#
-# system("mv $ret /usr/src/nvidia-$nv_version >/dev/null 2>&1");
-#
-# open FH,">/usr/src/nvidia-$nv_version/dkms.conf";
-# print FH "DEST_MODULE_LOCATION=/updates\n";
-# print FH "PACKAGE_NAME=nvidia\n";
-# print FH "PACKAGE_VERSION=$nv_version\n";
-# close FH;
-#
-# system("/sbin/dkms add -m nvidia -v $nv_version");
-# my $cmd = "#============= Executing following command =============\n".
-# "/sbin/dkms ".
-# " -m nvidia -v $nv_version ".
-# " -k $kver-$ksuffix ".
-# " --kernelsourcedir /usr/src/linux-$kver-obj/i586/$ksuffix ".
-# " --no-prepare-kernel ".
-# " --no-clean-kernel ".
-# " build \n".
-# "#==========================================================";
-#
-# print $cmd;
-# system($cmd);
-
my $srinfo = `head -n1 /etc/SuSE-release`;
my @data = split (/ /, $srinfo);
@@ -109,7 +75,10 @@ sub installNvidia
my $chost = substr($data[2],1,-1);
my $url = "ftp://download.nvidia.com/opensuse/$version/$chost";
- system("wget -P $tmpdir $url/nvidia-gfxG01-kmp-$ksuffix* >/dev/null 2>&1");
+
+ 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";
@@ -137,7 +106,7 @@ sub installNvidia
my @nv_versions = split('_',$versions[5]);
my $nv_version = $nv_versions[0];
- system("wget -P $tmpdir $url/x11-video-nvidiaG01-$nv_version* >/dev/null 2>&1");
+ 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;
@@ -158,12 +127,28 @@ sub installNvidia
}
+
+# 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/*");
+ }
+
+ # TODO: Sort out kernel version programmatically
+ my $kver = "2.6.25.20-0.1";
+ my $kver_ati = $kver;
+ $kver_ati =~ s/-/_/;
+ my $ksuffix = "pae";
+
my $srinfo = `head -n1 /etc/SuSE-release`;
my @data = split (/ /, $srinfo);
chomp(@data);
@@ -171,60 +156,63 @@ sub installAti
my $version = $data[1];
my $chost = substr($data[2],1,-1);
- my $ret = $self->SUPER::installAti(@_);
+ my $url = "http://www2.ati.com/suse/$version/";
+
+ print " * Downloading ATI rpm from http://www2.ati.com/suse/$version\n";
- if($ret =~ /^error$/) {
- print "Something went wrong intalling ATI files!\n";
- return;
- }
+ system("wget -P $tmpdir -t2 -T2 $url/repodata/primary.xml.gz >/dev/null 2>&1");
- $self->SUPER::getdkms();
+ my $url2 = `zcat $tmpdir/primary.xml.gz | grep -P -o "$chost/ati-fglrxG01-kmp-$ksuffix.*?$kver_ati.*?$chost.rpm"`;
+ chomp($url2);
+ system("wget -P $tmpdir -t2 -T2 $url/$url2 >/dev/null 2>&1");
- my $kver = "2.6.25.20-0.1";
- my $ksuffix = "pae";
+ my @rpm = glob "$tmpdir/ati-fglrxG01-kmp-$ksuffix*$chost.rpm";
+ my $rpm = @rpm;
- # here we have to compile the kernel modules for all kernels
- #
- my $ati_version = `head $repopath/$pkgpath/ati-driver-installer-9-1-x86.x86_64.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 \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");
- system($cmd." >/dev/null 2>&1");
+ if($rpm == 0) {
+ print "Could not find ATI kernel module rpm on filesystem!\n";
+ print "Exiting!";
+ return;
}
- if(!-d "$repopath/ati/modules/")
+ system("cd $tmpdir; rpm2cpio $rpm[0] | cpio -idv >/dev/null 2>&1");
+
+ if(!-d "$repopath/ati/modules/")
{
- mkdir( "$repopath/ati/modules/" );
+ mkdir("$repopath/ati/modules/");
}
- copyFile("/var/lib/dkms/fglrx/$ati_version/$kver-$ksuffix/$chost/module/fglrx.ko",
+ copyFile("$tmpdir/lib/modules/$kver-$ksuffix/updates/fglrx.ko",
"$repopath/ati/modules");
- #if ($? > 0) {
- # print "\n\nCould not copy! Exit with Ctrl-D\n";
- # system("/bin/bash");
- #}
- rmtree("$repopath/ati/temp");
+ 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);
}
1;
diff --git a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
index 0191852a..50d69751 100644
--- a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
+++ b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
@@ -350,7 +350,7 @@ sub removeLinks
{
my $instFolders = "/usr/lib";
if(-d "/usr/X11R6/lib") {
- $instFolders .= "/usr/X11R6/lib";
+ $instFolders .= " /usr/X11R6/lib";
}
my $divertFolder = "/var/X11R6/lib";
my $pluginFolder = "/opt/openslx/plugin-repo/xserver";
diff --git a/os-plugins/plugins/xserver/XX_xserver.sh b/os-plugins/plugins/xserver/XX_xserver.sh
index d4218d9b..00503277 100644
--- a/os-plugins/plugins/xserver/XX_xserver.sh
+++ b/os-plugins/plugins/xserver/XX_xserver.sh
@@ -24,6 +24,10 @@ else
slxconfig-demuxer\n and transported via fileget) is not present" nonfatal
fi
+if [ -e /etc/slxsystem.conf ]; then
+ . /etc/slxsystem.conf
+fi
+
# Xorg configuration file location
xfc="/mnt/etc/X11/xorg.conf"
# directory for libGL, DRI library links to point to proper library set
@@ -87,6 +91,10 @@ ${PLUGIN_ROOTFS}/usr/X11R6/lib/modules/\,"
# we need some database for driver initialization
cp -r "${PLUGIN_PATH}/etc/ati" /mnt/etc
+
+ if [ "${slxconf_distro_name}" = "ubuntu" ]; then
+ echo "${PLUGIN_ROOTFS}/usr/lib/libGL.so.1" >> /mnt/etc/ld.so.preload
+ fi
# if fglrx_dri.so is linked wrong -> we have to link it here
if [ "1" -eq "$( ls -l /mnt/usr/lib/dri/fglrx_dri.so \
@@ -118,6 +126,12 @@ ${PLUGIN_ROOTFS}/usr/X11R6/lib/modules/\,"
modprobe agpgart
# insert kernel driver
chroot /mnt /sbin/insmod ${PLUGIN_ROOTFS}/modules/nvidia.ko
+
+
+ if [ "${slxconf_distro_name}" = "ubuntu" ]; then
+ echo "${PLUGIN_ROOTFS}/usr/lib/libGL.so.1" >> /mnt/etc/ld.so.preload
+ fi
+
else
xmodule="nv"
fi
diff --git a/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh b/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh
index 078f6c69..c6ac17c9 100755
--- a/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh
+++ b/os-plugins/plugins/xserver/files/ubuntu-gfx-install.sh
@@ -55,8 +55,6 @@ case ${TARGET} in
cd modules/lib/linux-restricted-modules/${KVER}/
ld_static -d -r -o ${PLUGIN_FOLDER}/ati/modules/fglrx.ko fglrx/*
- #TODO: Bastian: do we really need this part in stage1?
- # Volker: I think we could just copy it (is a unique file)
if [ -f /usr/lib/dri/fglrx_dri.so ]; then
mv /usr/lib/dri/fglrx_dri.so /usr/lib/dri/fglrx_dri.so.slx
else
@@ -66,6 +64,13 @@ case ${TARGET} in
ln -s ${PLUGIN_FOLDER}/ati/usr/lib/dri/fglrx_dri.so \
/usr/lib/dri/fglrx_dri.so
+ # Recent ATI drivers expect the driver link in /xyz
+ if [ ! -d /usr/X11R6/lib/modules/dri ]; then
+ mkdir -p /usr/X11R6/lib/modules/dri
+ fi
+ ln -s ${PLUGIN_FOLDER}/ati/usr/lib/dri/fglrx_dri.so \
+ /usr/X11R6/lib/modules/dri/fglrx_dri.so
+
# cleanup
cd ${PLUGIN_FOLDER}/ati