From 121f6854524af595578a949b7f86ad5434f286c0 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 18 May 2008 12:55:19 +0000 Subject: * intermediate commit of desktop plugin, preparing for travel ... * copied displaymanager themes into desktop plugin (original files will be removed once the desktop plugin is working) git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1775 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm | 38 ++++++++++++++++++++--- 1 file changed, 34 insertions(+), 4 deletions(-) (limited to 'os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm') diff --git a/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm b/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm index 80be8bcf..b9bf5f03 100644 --- a/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm +++ b/os-plugins/plugins/desktop/OpenSLX/Distro/Base.pm @@ -18,6 +18,8 @@ use warnings; our $VERSION = 1.01; # API-version . implementation-version +use File::Basename; + use OpenSLX::Basics; use OpenSLX::Utils; @@ -106,12 +108,40 @@ sub GDMPathInfo return $pathInfo; } -sub patchGDMScript +sub setupGDMScript { - my $self = shift; - my $script = shift; + my $self = shift; + my $repoPath = shift; + + my $pathInfo = $self->GDMPathInfo(); + my $configFile = $pathInfo->{config}; - # default implementation does nothing! + my $paths + = join( + ' ', + map { '/mnt' . $_ } ( dirname($configFile), @{$pathInfo->{paths}} ) + ); + my $script = unshiftHereDoc(<<" End-of-Here"); + #!/bin/ash + # written by OpenSLX-plugin 'desktop' + + mkdir -p $paths 2>/dev/null + + cp /mnt/$repoPath/gdm/\$desktop_mode/gdm.conf /mnt$configFile + + # activate theme only if the corresponding xml file is found + # (otherwise fall back to default theme of vendor-OS) + if [ -n "\$desktop_theme" ]; then + thdir=/opt/openslx/plugin-repo/desktop/themes/openslx/gdm + theme=\$desktop_theme + if [ -e /mnt\$thdir/\$theme/\$theme.xml ]; then + sed -i "s,\\[greeter\\],[greeter]\\nGraphicalThemeDir=\$thdir," \\ + /mnt$configFile + sed -i "s,\\[greeter\\],[greeter]\\nGraphicalTheme=\$theme," \\ + /mnt$configFile + fi + fi + End-of-Here return $script; } -- cgit v1.2.3-55-g7522