From 3a82c9b82e6fa848ea485e19cf16114a4a4838bf Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 25 May 2011 14:54:05 +0200 Subject: Distro specific stuff for Fedora inclusion ... --- .../plugins/desktop/OpenSLX/Distro/Fedora.pm | 162 +++++++++++++++++---- .../plugins/kiosk/OpenSLX/Distro/Fedora.pm | 6 +- 2 files changed, 134 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm index f9428aab..c9313576 100644 --- a/src/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm +++ b/src/os-plugins/plugins/desktop/OpenSLX/Distro/Fedora.pm @@ -1,30 +1,132 @@ -# 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 +# Copyright (c) 2006..2011 - 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 File::Path; + +use OpenSLX::Basics; +use OpenSLX::Utils; + +################################################################################ +### interface methods +################################################################################ + +sub GDMPathInfo +{ + my $self = shift; + + my $pathInfo = $self->SUPER::GDMPathInfo(); + + # create gdm.conf-custom instead of gdm.conf + $pathInfo->{config} = '/etc/gdm/custom.conf'; + + return $pathInfo; +} + +sub setupGDMScript +{ + my $self = shift; + my $repoPath = shift; + + my $script = $self->SUPER::setupGDMScript($repoPath); + + my $configFile = $self->GDMPathInfo->{config}; + + # include common stuff (independent of display manager used) + $script = _setupCommonDmScript($script); + + $script .= unshiftHereDoc(<<' End-of-Here'); + echo "DISPLAYMANAGER=GNOME" \ + >/mnt/etc/sysconfig/desktop + # gdm does not like AUFS/UnionFS on its var directory + mkdir -m 1770 /mnt/var/lib/gdm + chown root:gdm /mnt/var/lib/gdm + End-of-Here + + return $script; +} + +sub GDMConfigHashForWorkstation +{ + my $self = shift; + + my $configHash = $self->SUPER::GDMConfigHashForWorkstation(); + $configHash->{'daemon'}->{SessionDesktopDir} = + '/etc/X11/session/:/usr/share/xsessions/:/usr/share/gdm/BuiltInSessions'; + $configHash->{'daemon'}->{Greeter} = + '/usr/libexec/gdmgreeter'; + + return $configHash; +} + +sub setupKDMScript +{ + my $self = shift; + my $repoPath = shift; + + # SUSE reads /var/adm/kdm/kdmrc.sysconfig, so we link that to + # our config file + my $pathInfo = $self->KDMPathInfo(); + my $configFile = $pathInfo->{config}; + mkpath("/etc/opt/kdm"); + mkpath("/var/adm/kdm"); + # maybe backup kdmrc.sysconfig sometimes + unlink("/var/adm/kdm/kdmrc.sysconfig"); + # the config file gets overwritten if this script is present + unlink("/opt/kde3/share/apps/kdm/read_sysconfig.sh"); + symlink("/etc/opt/kdm/kdmrc", "/var/adm/kdm/kdmrc.sysconfig"); + + my $script = $self->SUPER::setupKDMScript($repoPath); + + # include common stuff (independent of display manager used) + $script = _setupCommonDmScript($script); + + $script .= unshiftHereDoc(<<' End-of-Here'); + echo "DISPLAYMANAGER=KDE" \ + >/mnt/etc/sysconfig/desktop + End-of-Here + + return $script; +} + +sub _setupCommonDmScript +{ + my $script = shift; + + $script .= unshiftHereDoc(<<' End-of-Here'); + # cleanup after users Xorg session + sed 's,^#!.*,,' /mnt/etc/X11/xdm/Xreset \ + > /mnt/etc/X11/xdm/Xreset.system + echo -e '#!/bin/sh\n#\n# modified by desktop plugin in Stage3\n#\n + # remove safely any remaining files of the leaving user in /tmp + ( su -c "rm -rf /tmp/*" - $USER + echo "$USER files removed by $0" >/tmp/files.removed 2>/dev/null ) & + . /etc/X11/xdm/Xreset.system' >/mnt/etc/X11/xdm/Xreset + chmod a+x /mnt/etc/X11/xdm/Xreset* + + # enable the inittab entry again (incomplete) + # sed -e "s,# line deleted.*,x:5:respawn:/etc/X11/prefdm -nodaemon," \ + # -i /mnt/etc/inittab + End-of-Here + + return $script; +} + +1; diff --git a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Fedora.pm b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Fedora.pm index 2b9f8ff5..a8cd25b3 100644 --- a/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Fedora.pm +++ b/src/os-plugins/plugins/kiosk/OpenSLX/Distro/Fedora.pm @@ -1,4 +1,4 @@ -# Copyright (c) 2009 - OpenSLX GmbH +# Copyright (c) 2011 - OpenSLX GmbH # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -9,7 +9,7 @@ # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- # kiosk/OpenSLX/Distro/Fedora.pm -# - provides Fedora-specific overrides of the Distro API for the kiosk +# - provides fedora-specific overrides of the Distro API for the kiosk # plugin. # ----------------------------------------------------------------------------- package kiosk::OpenSLX::Distro::Fedora; @@ -27,6 +27,4 @@ use OpenSLX::Utils; ################################################################################ - - 1; -- cgit v1.2.3-55-g7522