summaryrefslogtreecommitdiffstats
path: root/installer
diff options
context:
space:
mode:
authorOliver Tappe2007-03-23 10:14:09 +0100
committerOliver Tappe2007-03-23 10:14:09 +0100
commitd8565fa1432a85ba53237545f8780d8cb30d1060 (patch)
tree22d722ace0eb25d18ef0e635f0dcf366d96d3359 /installer
parent* adjusted argument conventions to a more sensible separation between options... (diff)
downloadcore-d8565fa1432a85ba53237545f8780d8cb30d1060.tar.gz
core-d8565fa1432a85ba53237545f8780d8cb30d1060.tar.xz
core-d8565fa1432a85ba53237545f8780d8cb30d1060.zip
* 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
Diffstat (limited to 'installer')
-rw-r--r--installer/OpenSLX/OSExport/Distro/Any.pm50
-rw-r--r--installer/OpenSLX/OSExport/Distro/Debian.pm49
-rw-r--r--installer/OpenSLX/OSExport/Distro/Fedora.pm53
-rw-r--r--installer/OpenSLX/OSExport/Distro/Gentoo.pm49
-rw-r--r--installer/OpenSLX/OSExport/Distro/SUSE.pm (renamed from installer/OpenSLX/OSExport/Distro/SUSE_10_2.pm)16
-rw-r--r--installer/OpenSLX/OSExport/Distro/Ubuntu.pm51
-rw-r--r--installer/OpenSLX/OSExport/Engine.pm56
7 files changed, 280 insertions, 44 deletions
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 <ot@openslx.com>
+#
+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 <ot@openslx.com>
+#
+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 <ot@openslx.com>
+#
+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 <ot@openslx.com>
+#
+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_10_2.pm b/installer/OpenSLX/OSExport/Distro/SUSE.pm
index 6c3fb07a..c760eeb9 100644
--- a/installer/OpenSLX/OSExport/Distro/SUSE_10_2.pm
+++ b/installer/OpenSLX/OSExport/Distro/SUSE.pm
@@ -1,11 +1,11 @@
-# SUSE_10_2.pm
-# - provides SUSE-10.2-specific overrides of the OpenSLX OSExport API.
+# SUSE.pm
+# - provides SUSE-specific overrides of the OpenSLX OSExport API.
#
# (c) 2006 - OpenSLX.com
#
# Oliver Tappe <ot@openslx.com>
#
-package OpenSLX::OSExport::Distro::SUSE_10_2;
+package OpenSLX::OSExport::Distro::SUSE;
use vars qw(@ISA $VERSION);
@ISA = ('OpenSLX::OSExport::Distro::Base');
@@ -23,19 +23,11 @@ sub new
{
my $class = shift;
my $self = {
- 'base-name' => 'suse-10.2',
+ 'base-name' => 'suse',
};
return bless $self, $class;
}
-sub initialize
-{
- my $self = shift;
- my $engine = shift;
-
- $self->SUPER::initialize($engine);
-}
-
sub initDistroInfo
{
my $self = shift;
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 <ot@openslx.com>
+#
+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' },
+ '<any>'
+ => { 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 = '<any>';
+ }
+ }
+ }
my $distroModule
= "OpenSLX::OSExport::Distro::"
.$supportedDistros{lc($distroName)}->{module};