From 5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 6 Apr 2008 13:40:09 +0000 Subject: * made names of distro module consistent across OpenSLX - now the always start with a capital letter followed by all lowercase (Debian, Fedora, Gentoo, Suse, Ubuntu) * refactored loading of distro modules into a separate function (loadDistroModule() in Basics.pm) * finished support to logging to a file in syslog plugin * worked at desktop plugin (still not working, though) git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1721 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/OpenSLX/MakeInitRamFS/Distro/SUSE.pm | 45 -------------------------- initramfs/OpenSLX/MakeInitRamFS/Distro/Suse.pm | 45 ++++++++++++++++++++++++++ initramfs/OpenSLX/MakeInitRamFS/Engine.pm | 17 ++++------ 3 files changed, 52 insertions(+), 55 deletions(-) delete mode 100644 initramfs/OpenSLX/MakeInitRamFS/Distro/SUSE.pm create mode 100644 initramfs/OpenSLX/MakeInitRamFS/Distro/Suse.pm (limited to 'initramfs/OpenSLX') diff --git a/initramfs/OpenSLX/MakeInitRamFS/Distro/SUSE.pm b/initramfs/OpenSLX/MakeInitRamFS/Distro/SUSE.pm deleted file mode 100644 index 991a2fd1..00000000 --- a/initramfs/OpenSLX/MakeInitRamFS/Distro/SUSE.pm +++ /dev/null @@ -1,45 +0,0 @@ -# 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/ -# ----------------------------------------------------------------------------- -# MakeInitRamFS::Distro::SUSE.pm -# - provides SUSE-specific overrides of the MakeInitRamFS::Distro API. -# ----------------------------------------------------------------------------- -package OpenSLX::MakeInitRamFS::Distro::SUSE; - -use strict; -use warnings; - -use base qw(OpenSLX::MakeInitRamFS::Distro::Base); - -use OpenSLX::Basics; - -################################################################################ -### implementation -################################################################################ -sub new -{ - my $class = shift; - my $self = { - 'base-name' => 'suse', - }; - return bless $self, $class; -} - -sub applyChanges -{ - my $self = shift; - my $engine = shift; - - $engine->_addFilteredKernelModules( qw( hid unix )); - - return; -} - -1; \ No newline at end of file diff --git a/initramfs/OpenSLX/MakeInitRamFS/Distro/Suse.pm b/initramfs/OpenSLX/MakeInitRamFS/Distro/Suse.pm new file mode 100644 index 00000000..991a2fd1 --- /dev/null +++ b/initramfs/OpenSLX/MakeInitRamFS/Distro/Suse.pm @@ -0,0 +1,45 @@ +# 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/ +# ----------------------------------------------------------------------------- +# MakeInitRamFS::Distro::SUSE.pm +# - provides SUSE-specific overrides of the MakeInitRamFS::Distro API. +# ----------------------------------------------------------------------------- +package OpenSLX::MakeInitRamFS::Distro::SUSE; + +use strict; +use warnings; + +use base qw(OpenSLX::MakeInitRamFS::Distro::Base); + +use OpenSLX::Basics; + +################################################################################ +### implementation +################################################################################ +sub new +{ + my $class = shift; + my $self = { + 'base-name' => 'suse', + }; + return bless $self, $class; +} + +sub applyChanges +{ + my $self = shift; + my $engine = shift; + + $engine->_addFilteredKernelModules( qw( hid unix )); + + return; +} + +1; \ No newline at end of file diff --git a/initramfs/OpenSLX/MakeInitRamFS/Engine.pm b/initramfs/OpenSLX/MakeInitRamFS/Engine.pm index 43374e9e..efa8d1de 100644 --- a/initramfs/OpenSLX/MakeInitRamFS/Engine.pm +++ b/initramfs/OpenSLX/MakeInitRamFS/Engine.pm @@ -58,18 +58,15 @@ sub new $self->{'system-name'} =~ m{^([^\-]+)-([^:\-]+)} or die "unable to extract distro-info from $self->{'system-name'}!"; - $self->{'distro-name'} = $1; + $self->{'distro-name'} = lc($1); $self->{'distro-ver'} = $2; - my %distroMap = ( - 'debian' => 'Debian', - 'suse' => 'SUSE', - 'ubuntu' => 'Ubuntu', - ); - my $distroModule = $distroMap{$self->{'distro-name'}} || 'Base'; - $self->{distro} = instantiateClass( - "OpenSLX::MakeInitRamFS::Distro::$distroModule" - ); + my $distroModule + = 'OpenSLX::MakeInitRamFS::Distro::' . ucfirst($self->{'distro-name'}); + if (!eval { $self->{distro} = instantiateClass($distroModule); }) { + $self->{distro} + = instantiateClass('OpenSLX::MakeInitRamFS::Distro::Base'); + } $self->{'lib-scanner'} = OpenSLX::LibScanner->new({ 'root-path' => $self->{'root-path'} }); -- cgit v1.2.3-55-g7522