From 5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 6 Apr 2008 13:40:09 +0000 Subject: * made names of distro module consistent across OpenSLX - now the always start with a capital letter followed by all lowercase (Debian, Fedora, Gentoo, Suse, Ubuntu) * refactored loading of distro modules into a separate function (loadDistroModule() in Basics.pm) * finished support to logging to a file in syslog plugin * worked at desktop plugin (still not working, though) git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1721 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm | 16 ++++-- .../plugins/desktop/OpenSLX/Distro/Debian.pm | 31 ++++++++++++ .../plugins/desktop/OpenSLX/Distro/Fedora.pm | 30 +++++++++++ .../plugins/desktop/OpenSLX/Distro/Gentoo.pm | 30 +++++++++++ os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm | 39 +++++++++++++++ .../plugins/desktop/OpenSLX/Distro/Ubuntu.pm | 31 ++++++++++++ .../plugins/desktop/OpenSLX/Distro/debian.pm | 29 ----------- .../plugins/desktop/OpenSLX/Distro/fedora.pm | 48 ------------------ .../plugins/desktop/OpenSLX/Distro/gentoo.pm | 58 ---------------------- os-plugins/plugins/desktop/OpenSLX/Distro/suse.pm | 28 ----------- .../plugins/desktop/OpenSLX/Distro/ubuntu.pm | 28 ----------- .../plugins/desktop/OpenSLX/OSPlugin/desktop.pm | 2 +- 12 files changed, 174 insertions(+), 196 deletions(-) create mode 100644 os-plugins/plugins/desktop/OpenSLX/Distro/Debian.pm create mode 100644 os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm create mode 100644 os-plugins/plugins/desktop/OpenSLX/Distro/Gentoo.pm create mode 100644 os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm create mode 100644 os-plugins/plugins/desktop/OpenSLX/Distro/Ubuntu.pm delete mode 100644 os-plugins/plugins/desktop/OpenSLX/Distro/debian.pm delete mode 100644 os-plugins/plugins/desktop/OpenSLX/Distro/fedora.pm delete mode 100644 os-plugins/plugins/desktop/OpenSLX/Distro/gentoo.pm delete mode 100644 os-plugins/plugins/desktop/OpenSLX/Distro/suse.pm delete mode 100644 os-plugins/plugins/desktop/OpenSLX/Distro/ubuntu.pm (limited to 'os-plugins/plugins/desktop') diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm index 3764de39..dffa1850 100644 --- a/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm +++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm @@ -8,11 +8,10 @@ # # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- -# base.pm -# - provides empty base of the OpenSLX OSPlugin Distro API for the desktop -# plugin. +# desktop/OpenSLX/Distro/Base.pm +# - provides base implementation of the Distro API for the desktop plugin. # ----------------------------------------------------------------------------- -package OpenSLX::Distro::Base; +package desktop::OpenSLX::Distro::Base; use strict; use warnings; @@ -99,6 +98,15 @@ sub GDMPathInfo return $pathInfo; } +sub GDMRunlevelLinks +{ + my $self = shift; + + return unshiftHereDoc(<<" End-of-Here"); + rllinker gdm 15 15 + End-of-Here +} + sub GDMConfigHashForWorkstation { my $self = shift; diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Debian.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Debian.pm new file mode 100644 index 00000000..361543e9 --- /dev/null +++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Debian.pm @@ -0,0 +1,31 @@ +# Copyright (c) 2006, 2007 - 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/ +# ----------------------------------------------------------------------------- +# desktop/OpenSLX/Distro/Debian.pm +# - provides Debian-specific overrides of the Distro API for the desktop +# plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Debian; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +# TODO: implement! + +1; \ No newline at end of file diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm new file mode 100644 index 00000000..f9428aab --- /dev/null +++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm @@ -0,0 +1,30 @@ +# Copyright (c) 2006, 2007 - 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/ +# ----------------------------------------------------------------------------- +# desktop/OpenSLX/Distro/Fedora.pm +# - provides Fedora-specific overrides of the Distro API for the desktop +# plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Fedora; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Base); + +use OpenSLX::Basics; + +################################################################################ +### interface methods +################################################################################ + +# TODO: implement! + +1; \ No newline at end of file diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Gentoo.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Gentoo.pm new file mode 100644 index 00000000..129f4d08 --- /dev/null +++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Gentoo.pm @@ -0,0 +1,30 @@ +# Copyright (c) 2006, 2007 - 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/ +# ----------------------------------------------------------------------------- +# desktop/OpenSLX/Distro/Gentoo.pm +# - provides Gentoo-specific overrides of the Distro API for the desktop +# plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Gentoo; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Base); + +use OpenSLX::Basics; + +################################################################################ +### interface methods +################################################################################ + +# TODO: implement! + +1; diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm new file mode 100644 index 00000000..2c3818cd --- /dev/null +++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Suse.pm @@ -0,0 +1,39 @@ +# Copyright (c) 2006, 2007 - 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/ +# ----------------------------------------------------------------------------- +# desktop/OpenSLX/Distro/Suse.pm +# - provides SUSE-specific overrides of the Distro API for the desktop +# plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Suse; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +sub GDMRunlevelLinks +{ + my $self = shift; + + return unshiftHereDoc(<<" End-of-Here"); + rllinker earlygdm 1 15 + rllinker xdm 15 1 + End-of-Here +} + +1; diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Ubuntu.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Ubuntu.pm new file mode 100644 index 00000000..7cd8ebc7 --- /dev/null +++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Ubuntu.pm @@ -0,0 +1,31 @@ +# Copyright (c) 2006, 2007 - 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/ +# ----------------------------------------------------------------------------- +# desktop/OpenSLX/Distro/Ubuntu.pm +# - provides Ubuntu-specific overrides of the distro API for the desktop +# plugin. +# ----------------------------------------------------------------------------- +package desktop::OpenSLX::Distro::Ubuntu; + +use strict; +use warnings; + +use base qw(desktop::OpenSLX::Distro::Base); + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +# TODO: implement! + +1; \ No newline at end of file diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/debian.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/debian.pm deleted file mode 100644 index 2d837629..00000000 --- a/os-plugins/plugins/desktop/OpenSLX/Distro/debian.pm +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2006, 2007 - 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/ -# ----------------------------------------------------------------------------- -# debian.pm -# - provides Debian-specific overrides of the OpenSLX Distro API for the -# desktop plugin. -# ----------------------------------------------------------------------------- -package OpenSLX::Distro::debian; - -use strict; -use warnings; - -use base qw(OpenSLX::Distro::Base); - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### interface methods -################################################################################ - -1; \ No newline at end of file diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/fedora.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/fedora.pm deleted file mode 100644 index 0bc9ebdc..00000000 --- a/os-plugins/plugins/desktop/OpenSLX/Distro/fedora.pm +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2006, 2007 - 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/ -# ----------------------------------------------------------------------------- -# Fedora.pm -# - provides Fedora-specific overrides of the OpenSLX OSSetup API. -# ----------------------------------------------------------------------------- -package OpenSLX::OSSetup::Distro::Fedora; - -use strict; -use warnings; - -use base qw(OpenSLX::OSSetup::Distro::Base); - -use OpenSLX::Basics; - -################################################################################ -### interface methods -################################################################################ -sub new -{ - my $class = shift; - my $self = {}; - return bless $self, $class; -} - -sub initialize -{ - my $self = shift; - my $engine = shift; - - $self->SUPER::initialize($engine); - $self->{'packager-type'} = 'rpm'; - $self->{'meta-packager-type'} = $ENV{SLX_META_PACKAGER} || 'yum'; - $self->{'stage1c-faked-files'} = [ - '/etc/fstab', - '/etc/mtab', - ]; - return; -} - -1; \ No newline at end of file diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/gentoo.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/gentoo.pm deleted file mode 100644 index c49ba5d6..00000000 --- a/os-plugins/plugins/desktop/OpenSLX/Distro/gentoo.pm +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2006, 2007 - 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/ -# ----------------------------------------------------------------------------- -# SUSE.pm -# - provides SUSE-specific overrides of the OpenSLX OSSetup API. -# ----------------------------------------------------------------------------- -package OpenSLX::OSSetup::Distro::Gentoo; - -use strict; -use warnings; - -use base qw(OpenSLX::OSSetup::Distro::Base); - -use OpenSLX::Basics; - -################################################################################ -### interface methods -################################################################################ -sub new -{ - my $class = shift; - my $self = {}; - return bless $self, $class; -} - -sub pickKernelFile -{ - my $self = shift; - my $kernelPath = shift; - - my $newestKernelFile; - my $newestKernelFileSortKey = ''; - foreach my $kernelFile (glob("$kernelPath/kernel-genkernel-x86-*")) { - next unless $kernelFile =~ m{ - x86-(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?-(\d+(?:\.\d+)?) - }x; - my $sortKey - = sprintf("%02d.%02d.%02d.%02d-%2.1f", $1, $2, $3, $4||0, $5); - if ($newestKernelFileSortKey lt $sortKey) { - $newestKernelFile = $kernelFile; - $newestKernelFileSortKey = $sortKey; - } - } - - if (!defined $newestKernelFile) { - die _tr("unable to pick a kernel-file from path '%s'!", $kernelPath); - } - return $newestKernelFile; -} - -1; diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/suse.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/suse.pm deleted file mode 100644 index e360e1b5..00000000 --- a/os-plugins/plugins/desktop/OpenSLX/Distro/suse.pm +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2006, 2007 - 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/ -# ----------------------------------------------------------------------------- -# SUSE.pm -# - provides SUSE-specific overrides of the OpenSLX Distro API for the desktop -# plugin. -# ----------------------------------------------------------------------------- -package OpenSLX::Distro::suse; - -use strict; -use warnings; - -use base qw(OpenSLX::Distro::Base); - -use OpenSLX::Basics; - -################################################################################ -### interface methods -################################################################################ - -1; diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/ubuntu.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/ubuntu.pm deleted file mode 100644 index c932f87f..00000000 --- a/os-plugins/plugins/desktop/OpenSLX/Distro/ubuntu.pm +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (c) 2006, 2007 - 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/ -# ----------------------------------------------------------------------------- -# Ubuntu.pm -# - provides Ubuntu-specific overrides of the OpenSLX OSSetup API. -# ----------------------------------------------------------------------------- -package OpenSLX::Distro::ubuntu; - -use strict; -use warnings; - -use base qw(OpenSLX::Distro::Base); - -use OpenSLX::Basics; -use OpenSLX::Utils; - -################################################################################ -### interface methods -################################################################################ - -1; \ No newline at end of file diff --git a/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm b/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm index 046d0759..70f8d71c 100644 --- a/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm +++ b/os-plugins/plugins/desktop/OpenSLX/OSPlugin/desktop.pm @@ -420,8 +420,8 @@ sub _setupGDMScript # written by OpenSLX-plugin 'desktop' mkdir -p $paths 2>/dev/null ln -sf $repoPath/gdm/\$desktop_mode/gdm.conf /mnt$configFile - rllinker gdm 1 15 End-of-Here + $script .= $self->{distro}->GDMRunlevelLinks(); spitFile("$repoPath/gdm/desktop.sh", $script); return; } -- cgit v1.2.3-55-g7522