summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/desktop/OpenSLX/Distro/Ubuntu.pm
blob: 74d53181bb3e49c59b3bd759ffa6f3cdc993e9c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# 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
################################################################################

sub GDMPathInfo
{
    my $self = shift;
    
    my $pathInfo = $self->SUPER::GDMPathInfo();
    
    # link gdm.conf-custom instead of gdm.conf
    $pathInfo->{config} = '/etc/gdm/gdm.conf-custom';

    return $pathInfo;
}

sub setupGDMScript
{
    my $self     = shift;
    my $repoPath = shift;

    my $script = $self->SUPER::setupGDMScript($repoPath);

    my $configFile = $self->GDMPathInfo()->{config};
    
    $script .= unshiftHereDoc(<<'    End-of-Here');
        rllinker gdm 1 1
        echo '/usr/sbin/gdm' >/mnt/etc/X11/default-display-manager
        chroot /mnt update-alternatives --set x-window-manager /usr/bin/metacity
        chroot /mnt update-alternatives --set x-session-manager \
          /usr/bin/gnome-session
        testmkd /mnt/var/lib/gdm root:gdm 1770
        sed "/[daemon]/ a\BaseXsession=/etc/gdm/Xsession" -i /mnt$configFile
        case ${desktop_allowshutdown} in
          none)
          ;;
          root)
            sed "s|AllowShutdown.*|AllowShutdown=true|;\
                 s|SecureShutdown.*|SecureShutdown=true" -i /mnt$configFile
          ;;
          users)
            sed "s|AllowShutdown.*|AllowShutdown=true|;\
                 s|SecureShutdown.*|SecureShutdown=false" -i /mnt$configFile
          ;;
        esac
        [ ${desktop_rootlogin} -ne 0 ] && \
          sed "s|AllowRoot.*|AllowRoot=true|" -i /mnt$configFile
    End-of-Here

    return $script;
}

sub KDMPathInfo
{
    my $self = shift;
    
    my $pathInfo = $self->SUPER::KDMPathInfo();
    
    $pathInfo->{config} = '/etc/kde3/kdm/kdmrc';

    return $pathInfo;
}

sub setupKDMScript
{
    my $self     = shift;
    my $repoPath = shift;

    my $script = $self->SUPER::setupKDMScript($repoPath);
    
    $script .= unshiftHereDoc(<<'    End-of-Here');
        rllinker kdm 1 1
        echo '/usr/bin/kdm' > /mnt/etc/X11/default-display-manager
        chroot /mnt update-alternatives --set x-window-manager /usr/bin/kwin
        chroot /mnt update-alternatives --set x-session-manager \
          /usr/bin/startkde
    End-of-Here

    return $script;
}
1;