summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/xserver/OpenSLX/Distro/Suse.pm
blob: 7a706019b0e410a43bbc99b2b2cd24bbe49e7274 (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
# Copyright (c) 2008..2010 - 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;
use OpenSLX::DistroUtils;

use Data::Dumper;

################################################################################
### interface methods
################################################################################

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

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

    # add stuff to the script generated via Base.pm
    $script .= unshiftHereDoc(<<'    End-of-Here');
        # SuSE specific extension to stage3 xserver.sh
        testmkd /mnt/etc/X11/xorg.conf.d
        # Add InputClass to proper setup the keyboard and other input
        echo 'Section "InputClass"
          Identifier      "evdev pointer catchall"
          MatchIsPointer  "on"
          MatchDevicePath "/dev/input/event*"
          Driver          "evdev"
        EndSection
        Section "InputClass"
          Identifier "evdev keyboard catchall"
          MatchIsKeyboard "on"
          MatchDevicePath "/dev/input/event*"
          Driver "evdev"
        EndSection
        Section "InputClass"
          Identifier "evdev touchpad catchall"
          MatchIsTouchpad "on"
          MatchDevicePath "/dev/input/event*"
          Driver "evdev"
        EndSection
        Section "InputClass"
          Identifier "evdev tablet catchall"
          MatchIsTablet "on"
          MatchDevicePath "/dev/input/event*"
          Driver "evdev"
        EndSection
        Section "InputClass"
          Identifier "evdev touchscreen catchall"
          MatchIsTouchscreen "on"
          MatchDevicePath "/dev/input/event*"
          Driver "evdev"
        EndSection' >/mnt/etc/X11/xorg.conf.d/10-evdev.conf
        # Xorg hardware is autodetected, so no module information provided
        [ -z "${xmodule}" ] && \
          sed "/Section \"Device\"/,/EndSection/d" -i ${xfc}
        testmkd /mnt/var/lib/xkb/compiled
        testmkd /mnt/var/lib/X11
        testmkd /mnt/var/lib/xdm/authdir/authfiles 0700
        ln -s /usr/bin/Xorg /mnt/var/lib/X11/X
        rm /mnt/etc/X11/xdm/SuSEconfig.xdm
    End-of-Here

    return $script;
}

1;