summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--installer/OpenSLX/OSSetup/Distro/Any_Clone.pm31
-rw-r--r--installer/OpenSLX/OSSetup/Engine.pm27
2 files changed, 49 insertions, 9 deletions
diff --git a/installer/OpenSLX/OSSetup/Distro/Any_Clone.pm b/installer/OpenSLX/OSSetup/Distro/Any_Clone.pm
new file mode 100644
index 00000000..7602870d
--- /dev/null
+++ b/installer/OpenSLX/OSSetup/Distro/Any_Clone.pm
@@ -0,0 +1,31 @@
+# Any_Clone.pm
+# - provides generic clone-only overrides of the OpenSLX OSSetup API.
+#
+# (c) 2006 - OpenSLX.com
+#
+# Oliver Tappe <ot@openslx.com>
+#
+package OpenSLX::OSSetup::Distro::Any_Clone;
+
+use vars qw(@ISA $VERSION);
+@ISA = ('OpenSLX::OSSetup::Distro::Base');
+$VERSION = 1.01; # API-version . implementation-version
+
+use strict;
+use Carp;
+use OpenSLX::Basics;
+use OpenSLX::OSSetup::Distro::Base 1.01;
+
+################################################################################
+### implementation
+################################################################################
+sub new
+{
+ my $class = shift;
+ my $self = {
+ 'base-name' => 'any-clone',
+ };
+ return bless $self, $class;
+}
+
+1; \ No newline at end of file
diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm
index ff266e66..6e89fccb 100644
--- a/installer/OpenSLX/OSSetup/Engine.pm
+++ b/installer/OpenSLX/OSSetup/Engine.pm
@@ -104,6 +104,12 @@ sub initialize
my $distroModule
= "OpenSLX::OSSetup::Distro::"
.$supportedDistros{lc($distroName)}->{module};
+ if ($actionType eq 'clone') {
+ # fallback to generic clone module, such that we can clone
+ # distro's for which there is no specific distro-module yet
+ # (like for example for Gentoo):
+ $distroModule = "OpenSLX::OSSetup::Distro::Any_Clone";
+ }
unless (eval "require $distroModule") {
if ($! == 2) {
die _tr("Distro-module <%s> not found!\n", $distroModule);
@@ -120,13 +126,15 @@ sub initialize
$distro->initialize($self);
$self->{distro} = $distro;
- # setup path to distribution-specific info:
- my $distroInfoDir = "../lib/distro-info/$distro->{'base-name'}";
- if (!-d $distroInfoDir) {
- die _tr("unable to find distro-info for distro '%s'\n", $distro->{'base-name'});
+ if ($actionType ne 'clone') {
+ # setup path to distribution-specific info:
+ my $distroInfoDir = "../lib/distro-info/$distro->{'base-name'}";
+ if (!-d $distroInfoDir) {
+ die _tr("unable to find distro-info for distro '%s'\n", $distro->{'base-name'});
+ }
+ $self->{'distro-info-dir'} = $distroInfoDir;
+ $self->readDistroInfo();
}
- $self->{'distro-info-dir'} = $distroInfoDir;
- $self->readDistroInfo();
if (!$self->{'action-type'} eq 'install'
&& !exists $self->{'distro-info'}->{'selection'}->{$selectionName}) {
@@ -141,9 +149,10 @@ sub initialize
= "$openslxConfig{'stage1-path'}/$self->{'vendor-os-name'}";
vlog 1, "vendor-OS will be installed to '$self-vendor-os-path'}'";
- $self->createPackager();
- $self->createMetaPackager();
-
+ if ($actionType ne 'clone') {
+ $self->createPackager();
+ $self->createMetaPackager();
+ }
}
sub installVendorOS