From 70751e69e798db509a385e17b15be20ca1b9a683 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Sun, 10 Aug 2008 11:36:37 +0000 Subject: Extension to the xserver plugin (for later integration of the non-gpl drivers stuff) ... git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2012 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm | 77 ++++++++++++++++++++++ .../plugins/xserver/OpenSLX/Distro/Debian.pm | 43 ++++++++++++ os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm | 47 +++++++++++++ .../plugins/xserver/OpenSLX/Distro/Ubuntu.pm | 43 ++++++++++++ .../plugins/xserver/OpenSLX/OSPlugin/xserver.pm | 37 +++++++++-- os-plugins/plugins/xserver/XX_xserver.sh | 3 + 6 files changed, 246 insertions(+), 4 deletions(-) create mode 100644 os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm create mode 100644 os-plugins/plugins/xserver/OpenSLX/Distro/Debian.pm create mode 100644 os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm create mode 100644 os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu.pm (limited to 'os-plugins') diff --git a/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm b/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm new file mode 100644 index 00000000..bce3a03b --- /dev/null +++ b/os-plugins/plugins/xserver/OpenSLX/Distro/Base.pm @@ -0,0 +1,77 @@ +# 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/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 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; + + 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' + # repoPath is $repoPath + + 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; +} + +1; diff --git a/os-plugins/plugins/xserver/OpenSLX/Distro/Debian.pm b/os-plugins/plugins/xserver/OpenSLX/Distro/Debian.pm new file mode 100644 index 00000000..fe43b2e6 --- /dev/null +++ b/os-plugins/plugins/xserver/OpenSLX/Distro/Debian.pm @@ -0,0 +1,43 @@ +# 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/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 +################################################################################ + +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 + End-of-Here + + return $script; +} + +1; \ No newline at end of file diff --git a/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm b/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm new file mode 100644 index 00000000..e81a0217 --- /dev/null +++ b/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm @@ -0,0 +1,47 @@ +# 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/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; + +################################################################################ +### 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/X11R6/X + ln -s /usr/bin/Xorg /mnt/var/X11R6/X + End-of-Here + + return $script; +} + +1; diff --git a/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu.pm b/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu.pm new file mode 100644 index 00000000..bf691b67 --- /dev/null +++ b/os-plugins/plugins/xserver/OpenSLX/Distro/Ubuntu.pm @@ -0,0 +1,43 @@ +# 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/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 +################################################################################ + +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 + End-of-Here + + return $script; +} + +1; \ No newline at end of file diff --git a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm index 5cc8dcfc..2a367fa2 100644 --- a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm +++ b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm @@ -72,6 +72,35 @@ sub getAttrInfo # plugin specific attributes start here ... + # stage1 + 'xserver::ati' => { + applies_to_vendor_os => 1, + description => unshiftHereDoc(<<' End-of-Here'), + should the non-gpl ATI drivers be available (installed in vendor-OS - not implemented yet)? + End-of-Here + content_regex => qr{^0|1$}, + content_descr => '"0", "1" or "-" (for unset)', + default => undef, + }, + 'xserver::nvidia' => { + applies_to_vendor_os => 1, + description => unshiftHereDoc(<<' End-of-Here'), + should the non-gpl NVidia drivers be available (installed in vendor-OS - not implemented yet)? + End-of-Here + content_regex => qr{^0|1$}, + content_descr => '"0", "1" or "-" (for unset)', + default => undef, + }, + #'xserver::matrox' => { + # applies_to_vendor_os => 1, + # description => unshiftHereDoc(<<' End-of-Here'), + # should the non-gpl Matrox drivers (e.g. for the Parhelia) be + # available (installed in vendor-OS)? + # End-of-Here + # content_regex => qr{^0|1$}, + # content_descr => '"0", "1" or "-" (for unset)', + # default => undef, + #}, }; } @@ -97,10 +126,10 @@ sub installationPhase # chroot my $attrs = $info->{'plugin-attrs'}; # attributes in effect for this installation - - # for this example plugin, we simply create two files: - spitFile("$pluginRepoPath/right", "(-;\n"); - spitFile("$pluginRepoPath/left", ";-)\n"); + + # write the distro specific extension (inclusion) of XX_xserver.sh + my $script = $self->{distro}->setupXserverScript($pluginRepoPath); + spitFile("$pluginRepoPath/xserver.sh", $script); # Some plugins have to copy files from their plugin folder into the # vendor-OS. Here's an example for how to do that: diff --git a/os-plugins/plugins/xserver/XX_xserver.sh b/os-plugins/plugins/xserver/XX_xserver.sh index 69369f7c..ddbcba6a 100644 --- a/os-plugins/plugins/xserver/XX_xserver.sh +++ b/os-plugins/plugins/xserver/XX_xserver.sh @@ -152,4 +152,7 @@ a\ \ InputDevice\ \ "Synaptics TP"\ \ \ \ \ \ "SendCoreEvents" fi [ $DEBUGLEVEL -gt 0 ] && echo "done with 'xserver' os-plugin ..."; fi + # run distro specific generated stage3 script + [ -e /mnt/opt/openslx/plugin-repo/xserver/xserver.sh ] && \ + . /mnt/opt/openslx/plugin-repo/xserver/xserver.sh fi -- cgit v1.2.3-55-g7522