From d8565fa1432a85ba53237545f8780d8cb30d1060 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Fri, 23 Mar 2007 09:14:09 +0000 Subject: * export backend is now capable of exporting just any distribution * added specializations for Gentoo, Fedora, Debian and Ubuntu git-svn-id: http://svn.openslx.org/svn/openslx/trunk@803 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSExport/Distro/Any.pm | 50 +++++++++++++ installer/OpenSLX/OSExport/Distro/Debian.pm | 49 +++++++++++++ installer/OpenSLX/OSExport/Distro/Fedora.pm | 53 ++++++++++++++ installer/OpenSLX/OSExport/Distro/Gentoo.pm | 49 +++++++++++++ installer/OpenSLX/OSExport/Distro/SUSE.pm | 89 +++++++++++++++++++++++ installer/OpenSLX/OSExport/Distro/SUSE_10_2.pm | 97 -------------------------- installer/OpenSLX/OSExport/Distro/Ubuntu.pm | 51 ++++++++++++++ installer/OpenSLX/OSExport/Engine.pm | 56 +++++++-------- 8 files changed, 365 insertions(+), 129 deletions(-) create mode 100644 installer/OpenSLX/OSExport/Distro/Any.pm create mode 100644 installer/OpenSLX/OSExport/Distro/Debian.pm create mode 100644 installer/OpenSLX/OSExport/Distro/Fedora.pm create mode 100644 installer/OpenSLX/OSExport/Distro/Gentoo.pm create mode 100644 installer/OpenSLX/OSExport/Distro/SUSE.pm delete mode 100644 installer/OpenSLX/OSExport/Distro/SUSE_10_2.pm create mode 100644 installer/OpenSLX/OSExport/Distro/Ubuntu.pm (limited to 'installer/OpenSLX') diff --git a/installer/OpenSLX/OSExport/Distro/Any.pm b/installer/OpenSLX/OSExport/Distro/Any.pm new file mode 100644 index 00000000..da579dd1 --- /dev/null +++ b/installer/OpenSLX/OSExport/Distro/Any.pm @@ -0,0 +1,50 @@ +# Any.pm +# - provides generic overrides of the OpenSLX OSExport API. +# +# (c) 2006 - OpenSLX.com +# +# Oliver Tappe +# +package OpenSLX::OSExport::Distro::Any; + +use vars qw(@ISA $VERSION); +@ISA = ('OpenSLX::OSExport::Distro::Base'); +$VERSION = 1.01; # API-version . implementation-version + +use strict; +use Carp; +use OpenSLX::Basics; +use OpenSLX::OSExport::Distro::Base 1.01; + +################################################################################ +### implementation +################################################################################ +sub new +{ + my $class = shift; + my $self = { + 'base-name' => 'any', + }; + return bless $self, $class; +} + +sub initDistroInfo +{ + my $self = shift; + + $self->{'export-filter'} = " + - /var/tmp/* + - /var/spool/* + - /var/run/* + - /var/lock/* + - /var/log/* + - /var/lib/xdm + - /var/cache/man/* + - /usr/share/vmware/* + - /lib/klibc/events/* + - /boot/initrd* + - /boot/grub + "; +} + +1; \ No newline at end of file diff --git a/installer/OpenSLX/OSExport/Distro/Debian.pm b/installer/OpenSLX/OSExport/Distro/Debian.pm new file mode 100644 index 00000000..5056c877 --- /dev/null +++ b/installer/OpenSLX/OSExport/Distro/Debian.pm @@ -0,0 +1,49 @@ +# Debian.pm +# - provides Debian-specific overrides of the OpenSLX OSExport API. +# +# (c) 2006 - OpenSLX.com +# +# Oliver Tappe +# +package OpenSLX::OSExport::Distro::Debian; + +use vars qw(@ISA $VERSION); +@ISA = ('OpenSLX::OSExport::Distro::Base'); +$VERSION = 1.01; # API-version . implementation-version + +use strict; +use Carp; +use OpenSLX::Basics; +use OpenSLX::OSExport::Distro::Base 1.01; + +################################################################################ +### implementation +################################################################################ +sub new +{ + my $class = shift; + my $self = { + 'base-name' => 'debian', + }; + return bless $self, $class; +} + +sub initDistroInfo +{ + my $self = shift; + + $self->{'export-filter'} = " + - /var/tmp/* + - /var/spool/* + - /var/run/* + - /var/log/* + - /var/lib/xdm + - /var/cache/man/* + - /usr/share/vmware/* + - /lib/klibc/events/* + - /boot/initrd* + - /boot/grub + "; +} + +1; \ No newline at end of file diff --git a/installer/OpenSLX/OSExport/Distro/Fedora.pm b/installer/OpenSLX/OSExport/Distro/Fedora.pm new file mode 100644 index 00000000..b518008a --- /dev/null +++ b/installer/OpenSLX/OSExport/Distro/Fedora.pm @@ -0,0 +1,53 @@ +# Fedora.pm +# - provides Fedora-specific overrides of the OpenSLX OSExport API. +# +# (c) 2006 - OpenSLX.com +# +# Oliver Tappe +# +package OpenSLX::OSExport::Distro::Fedora; + +use vars qw(@ISA $VERSION); +@ISA = ('OpenSLX::OSExport::Distro::Base'); +$VERSION = 1.01; # API-version . implementation-version + +use strict; +use Carp; +use OpenSLX::Basics; +use OpenSLX::OSExport::Distro::Base 1.01; + +################################################################################ +### implementation +################################################################################ +sub new +{ + my $class = shift; + my $self = { + 'base-name' => 'fedora', + }; + return bless $self, $class; +} + +sub initDistroInfo +{ + my $self = shift; + + # TODO: check and refine this! + $self->{'export-filter'} = " + - /var/tmp/* + - /var/spool/* + - /var/run/* + - /var/lock/* + - /var/log/* + - /var/lib/xdm + - /var/cache/man/* + - /usr/share/vmware/* + - /lib/klibc/events/* + - /boot/initrd* + - /boot/grub + - *.rpmsave + - *.rpmnew + "; +} + +1; \ No newline at end of file diff --git a/installer/OpenSLX/OSExport/Distro/Gentoo.pm b/installer/OpenSLX/OSExport/Distro/Gentoo.pm new file mode 100644 index 00000000..5dbcb652 --- /dev/null +++ b/installer/OpenSLX/OSExport/Distro/Gentoo.pm @@ -0,0 +1,49 @@ +# Gentoo.pm +# - provides Gentoo-specific overrides of the OpenSLX OSExport API. +# +# (c) 2006 - OpenSLX.com +# +# Oliver Tappe +# +package OpenSLX::OSExport::Distro::Gentoo; + +use vars qw(@ISA $VERSION); +@ISA = ('OpenSLX::OSExport::Distro::Base'); +$VERSION = 1.01; # API-version . implementation-version + +use strict; +use Carp; +use OpenSLX::Basics; +use OpenSLX::OSExport::Distro::Base 1.01; + +################################################################################ +### implementation +################################################################################ +sub new +{ + my $class = shift; + my $self = { + 'base-name' => 'gentoo', + }; + return bless $self, $class; +} + +sub initDistroInfo +{ + my $self = shift; + + $self->{'export-filter'} = " + - /var/tmp/* + - /var/spool/* + - /var/run/* + - /var/log/* + - /var/lib/xdm + - /var/lib/init.d/* + - /var/cache/man/* + - /usr/share/vmware/* + - /boot/initrd* + - /boot/grub + "; +} + +1; \ No newline at end of file diff --git a/installer/OpenSLX/OSExport/Distro/SUSE.pm b/installer/OpenSLX/OSExport/Distro/SUSE.pm new file mode 100644 index 00000000..c760eeb9 --- /dev/null +++ b/installer/OpenSLX/OSExport/Distro/SUSE.pm @@ -0,0 +1,89 @@ +# SUSE.pm +# - provides SUSE-specific overrides of the OpenSLX OSExport API. +# +# (c) 2006 - OpenSLX.com +# +# Oliver Tappe +# +package OpenSLX::OSExport::Distro::SUSE; + +use vars qw(@ISA $VERSION); +@ISA = ('OpenSLX::OSExport::Distro::Base'); +$VERSION = 1.01; # API-version . implementation-version + +use strict; +use Carp; +use OpenSLX::Basics; +use OpenSLX::OSExport::Distro::Base 1.01; + +################################################################################ +### implementation +################################################################################ +sub new +{ + my $class = shift; + my $self = { + 'base-name' => 'suse', + }; + return bless $self, $class; +} + +sub initDistroInfo +{ + my $self = shift; + + $self->{'export-filter'} = " + - /var/tmp/* + - /var/spool/* + - /var/run/* + - /var/mail + - /var/log/* + - /var/lock/* + - /var/lib/zypp/cache/* + - /var/lib/zypp/* + - /var/lib/zmd + - /var/lib/xdm + - /var/lib/vm/* + - /var/lib/suspend* + - /var/lib/sax + - /var/lib/hardware/* + - /var/lib/gdm/* + - /var/lib/dhcp* + - /var/lib/YaST2/you/mnt/* + - /var/cache/man/* + - /var/adm/backup/rpmdb/* + - /var/adm/SuSEconfig + - /usr/share/vmware/* + - /usr/lib/zen-updater + + /usr/lib/python*/*/*.o + + /usr/lib/perl5/*/*/*/*.o + + /usr/lib/gcc/*/*/*.o + + /usr/lib/*.o + - /usr/bin/zen-* + - /usr/bin/nw-manager + - /usr/X11R6/bin/BackGround + - /opt/kde3/share/autostart/suseplugger.desktop + - /opt/kde3/share/autostart/runupdater.desktop + - /opt/kde3/share/autostart/profile_chooser-autostart.desktop + - /opt/kde3/share/autostart/opensuseupdater.desktop + - /opt/kde3/share/autostart/knetworkmanager-autostart.desktop + - /opt/kde3/share/autostart/kerry.autostart.desktop + - /opt/kde3/share/autostart/beagled.desktop + - /opt/kde3/share/autostart/SUSEgreeter.desktop + - /media/* + + /media + + /lib/modules/*/misc/vmnet.o + + /lib/modules/*/misc/vmmon.o + - /etc/dhcpd.conf* + - /etc/cron.*/* + - /etc/X11/xdm/SuSEconfig.xdm + - /boot/initrd* + - /boot/grub + - *.rpmsave + - *.rpmnew + - *.o + - *.YaST2save + "; +} + +1; \ No newline at end of file diff --git a/installer/OpenSLX/OSExport/Distro/SUSE_10_2.pm b/installer/OpenSLX/OSExport/Distro/SUSE_10_2.pm deleted file mode 100644 index 6c3fb07a..00000000 --- a/installer/OpenSLX/OSExport/Distro/SUSE_10_2.pm +++ /dev/null @@ -1,97 +0,0 @@ -# SUSE_10_2.pm -# - provides SUSE-10.2-specific overrides of the OpenSLX OSExport API. -# -# (c) 2006 - OpenSLX.com -# -# Oliver Tappe -# -package OpenSLX::OSExport::Distro::SUSE_10_2; - -use vars qw(@ISA $VERSION); -@ISA = ('OpenSLX::OSExport::Distro::Base'); -$VERSION = 1.01; # API-version . implementation-version - -use strict; -use Carp; -use OpenSLX::Basics; -use OpenSLX::OSExport::Distro::Base 1.01; - -################################################################################ -### implementation -################################################################################ -sub new -{ - my $class = shift; - my $self = { - 'base-name' => 'suse-10.2', - }; - return bless $self, $class; -} - -sub initialize -{ - my $self = shift; - my $engine = shift; - - $self->SUPER::initialize($engine); -} - -sub initDistroInfo -{ - my $self = shift; - - $self->{'export-filter'} = " - - /var/tmp/* - - /var/spool/* - - /var/run/* - - /var/mail - - /var/log/* - - /var/lock/* - - /var/lib/zypp/cache/* - - /var/lib/zypp/* - - /var/lib/zmd - - /var/lib/xdm - - /var/lib/vm/* - - /var/lib/suspend* - - /var/lib/sax - - /var/lib/hardware/* - - /var/lib/gdm/* - - /var/lib/dhcp* - - /var/lib/YaST2/you/mnt/* - - /var/cache/man/* - - /var/adm/backup/rpmdb/* - - /var/adm/SuSEconfig - - /usr/share/vmware/* - - /usr/lib/zen-updater - + /usr/lib/python*/*/*.o - + /usr/lib/perl5/*/*/*/*.o - + /usr/lib/gcc/*/*/*.o - + /usr/lib/*.o - - /usr/bin/zen-* - - /usr/bin/nw-manager - - /usr/X11R6/bin/BackGround - - /opt/kde3/share/autostart/suseplugger.desktop - - /opt/kde3/share/autostart/runupdater.desktop - - /opt/kde3/share/autostart/profile_chooser-autostart.desktop - - /opt/kde3/share/autostart/opensuseupdater.desktop - - /opt/kde3/share/autostart/knetworkmanager-autostart.desktop - - /opt/kde3/share/autostart/kerry.autostart.desktop - - /opt/kde3/share/autostart/beagled.desktop - - /opt/kde3/share/autostart/SUSEgreeter.desktop - - /media/* - + /media - + /lib/modules/*/misc/vmnet.o - + /lib/modules/*/misc/vmmon.o - - /etc/dhcpd.conf* - - /etc/cron.*/* - - /etc/X11/xdm/SuSEconfig.xdm - - /boot/initrd* - - /boot/grub - - *.rpmsave - - *.rpmnew - - *.o - - *.YaST2save - "; -} - -1; \ No newline at end of file diff --git a/installer/OpenSLX/OSExport/Distro/Ubuntu.pm b/installer/OpenSLX/OSExport/Distro/Ubuntu.pm new file mode 100644 index 00000000..52062a87 --- /dev/null +++ b/installer/OpenSLX/OSExport/Distro/Ubuntu.pm @@ -0,0 +1,51 @@ +# Ubuntu.pm +# - provides Ubuntu-specific overrides of the OpenSLX OSExport API. +# +# (c) 2006 - OpenSLX.com +# +# Oliver Tappe +# +package OpenSLX::OSExport::Distro::Ubuntu; + +use vars qw(@ISA $VERSION); +@ISA = ('OpenSLX::OSExport::Distro::Base'); +$VERSION = 1.01; # API-version . implementation-version + +use strict; +use Carp; +use OpenSLX::Basics; +use OpenSLX::OSExport::Distro::Base 1.01; + +################################################################################ +### implementation +################################################################################ +sub new +{ + my $class = shift; + my $self = { + 'base-name' => 'ubuntu', + }; + return bless $self, $class; +} + +sub initDistroInfo +{ + my $self = shift; + + $self->{'export-filter'} = " + - /var/tmp/* + - /var/spool/* + - /var/run/* + - /var/log/* + - /var/lib/xdm + - /var/cache/man/* + - /usr/share/vmware/* + - /lib/klibc/events/* + - /initrd* + - /etc/cron.*/* + - /boot/initrd* + - /boot/grub + "; +} + +1; \ No newline at end of file diff --git a/installer/OpenSLX/OSExport/Engine.pm b/installer/OpenSLX/OSExport/Engine.pm index 86c83341..c8768759 100644 --- a/installer/OpenSLX/OSExport/Engine.pm +++ b/installer/OpenSLX/OSExport/Engine.pm @@ -31,38 +31,18 @@ use vars qw(%supportedExportTypes %supportedDistros); ); %supportedDistros = ( - 'debian-3.1' - => { module => 'Debian_3_1' }, - 'debian-4.0' - => { module => 'Debian_4_0' }, - 'fedora-6' - => { module => 'Fedora_6' }, - 'fedora-6-x86_64' - => { module => 'Fedora_6_x86_64' }, - 'gentoo-2005.1' - => { module => 'Gentoo_2005_1' }, - 'gentoo-2006.1' - => { module => 'Gentoo_2006_1' }, - 'mandriva-2007.0' - => { module => 'Mandriva_2007_0' }, - 'suse-9.3' - => { module => 'SUSE_9_3' }, - 'suse-10.0' - => { module => 'SUSE_10_0' }, - 'suse-10.0-x86_64' - => { module => 'SUSE_10_0_x86_64' }, - 'suse-10.1' - => { module => 'SUSE_10_1' }, - 'suse-10.1-x86_64' - => { module => 'SUSE_10_1_x86_64' }, - 'suse-10.2' - => { module => 'SUSE_10_2' }, - 'suse-10.2-x86_64' - => { module => 'SUSE_10_2_x86_64' }, - 'ubuntu-6.06' - => { module => 'Ubuntu_6_06' }, - 'ubuntu-6.10' - => { module => 'Ubuntu_6_10' }, + '' + => { module => 'Any' }, + 'debian' + => { module => 'Debian' }, + 'fedora' + => { module => 'Fedora' }, + 'gentoo' + => { module => 'Gentoo' }, + 'suse' + => { module => 'SUSE' }, + 'ubuntu' + => { module => 'Ubuntu' }, ); ################################################################################ @@ -99,6 +79,18 @@ sub initialize $self->{'distro-name'} = $distroName; # load module for the requested distro: + if (!exists $supportedDistros{lc($distroName)}) { + # try without _x86_64: + $distroName =~ s[_x86_64$][]; + if (!exists $supportedDistros{lc($distroName)}) { + # try basic distro-type (e.g. debian or suse): + $distroName =~ s[-.+$][]; + if (!exists $supportedDistros{lc($distroName)}) { + # fallback to generic implementation: + $distroName = ''; + } + } + } my $distroModule = "OpenSLX::OSExport::Distro::" .$supportedDistros{lc($distroName)}->{module}; -- cgit v1.2.3-55-g7522