summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm
diff options
context:
space:
mode:
authorOliver Tappe2008-03-17 23:32:36 +0100
committerOliver Tappe2008-03-17 23:32:36 +0100
commit1d731c53b5aa248b0ae0fb3b217659f229c7e632 (patch)
tree834255d53fa9181e68175cd82115bc966863eccd /os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm
parent* removed debug output (diff)
downloadcore-1d731c53b5aa248b0ae0fb3b217659f229c7e632.tar.gz
core-1d731c53b5aa248b0ae0fb3b217659f229c7e632.tar.xz
core-1d731c53b5aa248b0ae0fb3b217659f229c7e632.zip
* Heavily worked at OSPlugin::Engine and 'desktop'-plugin. Support for stage1
attributes and most of the desktop framework is implemented. Although we have made good progress, we are not quite there yet, i.e. the desktop plugin gets the correct attributes into stage3, but it still does not work: kdm gets started although gdm should be run. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1650 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm')
-rw-r--r--os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm230
1 files changed, 230 insertions, 0 deletions
diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm
new file mode 100644
index 00000000..37cfff46
--- /dev/null
+++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm
@@ -0,0 +1,230 @@
+# 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/
+# -----------------------------------------------------------------------------
+# base.pm
+# - provides empty base of the OpenSLX OSPlugin Distro API for the desktop
+# plugin.
+# -----------------------------------------------------------------------------
+package OpenSLX::Distro::Base;
+
+use strict;
+use warnings;
+
+our $VERSION = 1.01; # API-version . implementation-version
+
+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 isInPath
+{
+ my $self = shift;
+ my $binary = shift;
+
+ my $path = qx{which $binary 2>/dev/null};
+
+ return $path ? 1 : 0;
+}
+
+sub isGNOMEInstalled
+{
+ my $self = shift;
+
+ return $self->isInPath('gnome-session');
+}
+
+sub isGDMInstalled
+{
+ my $self = shift;
+
+ return $self->isInPath('gdm');
+}
+
+sub installGNOME
+{
+ my $self = shift;
+
+ $self->{engine}->installPackages(
+ $self->{engine}->getInstallablePackagesForSelection('gnome')
+ );
+
+ return 1;
+}
+
+sub installGDM
+{
+ my $self = shift;
+
+ $self->{engine}->installPackages('gdm');
+
+ return 1;
+}
+
+sub GDMPathInfo
+{
+ my $self = shift;
+
+ my $pathInfo = {
+ config => '/etc/gdm/gdm.conf',
+ paths => [
+ '/var/lib/gdm',
+ '/var/log/gdm',
+ ],
+ };
+
+ return $pathInfo;
+}
+
+sub GDMConfigHashForWorkstation
+{
+ my $self = shift;
+
+ return {
+ 'chooser' => {
+ },
+ 'daemon' => {
+ AutomaticLoginEnable => 'false',
+ BaseXsession => '/etc/X11/Xsession',
+ Group => 'gdm',
+ User => 'gdm',
+ },
+ 'debug' => {
+ Enable => 'false',
+ },
+ 'greeter' => {
+ AllowShutdown => 'true',
+ Browser => 'false',
+ MinimalUID => '500',
+ SecureShutdown => 'false',
+ ShowDomain => 'false',
+ },
+ 'gui' => {
+ },
+ 'security' => {
+ AllowRemoteRoot => 'false',
+ DisallowTCP => 'true',
+ SupportAutomount => 'true',
+ },
+ 'server' => {
+ },
+ 'xdmcp' => {
+ Enable => 'false',
+ },
+ };
+}
+
+sub GDMConfigHashForKiosk
+{
+ my $self = shift;
+
+ my $configHash = $self->GDMConfigHashForWorkstation();
+
+ $configHash->{daemon}->{AutomaticLoginEnable} = 'true';
+ $configHash->{daemon}->{AutomaticLogin} = 'nobody';
+
+ return $configHash;
+}
+
+sub GDMConfigHashForChooser
+{
+ my $self = shift;
+
+ my $configHash = $self->GDMConfigHashForWorkstation();
+ $configHash->{xdmcp}->{Enable} = 'true';
+
+ return $configHash;
+}
+
+sub isKDEInstalled
+{
+ my $self = shift;
+
+ return $self->isInPath('startkde');
+}
+
+sub isKDMInstalled
+{
+ my $self = shift;
+
+ return $self->isInPath('kdm');
+}
+
+sub installKDE
+{
+ my $self = shift;
+
+ $self->{engine}->installPackages(
+ $self->{engine}->getInstallablePackagesForSelection('kde')
+ );
+
+ return 1;
+}
+
+sub installKDM
+{
+ my $self = shift;
+
+ $self->{engine}->installPackages('kdm');
+
+ return 1;
+}
+
+sub isXFCEInstalled
+{
+ my $self = shift;
+
+ return $self->isInPath('startxfce4');
+}
+
+sub isXDMInstalled
+{
+ my $self = shift;
+
+ return $self->isInPath('xdm');
+}
+
+sub installXFCE
+{
+ my $self = shift;
+
+ $self->{engine}->installPackages(
+ $self->{engine}->getInstallablePackagesForSelection('xfce')
+ );
+
+ return 1;
+}
+
+sub installXDM
+{
+ my $self = shift;
+
+ $self->{engine}->installPackages('xdm');
+
+ return 1;
+}
+
+1;