diff options
author | Oliver Tappe | 2007-03-03 22:06:43 +0100 |
---|---|---|
committer | Oliver Tappe | 2007-03-03 22:06:43 +0100 |
commit | f3cd70dcf74983c03776c5166e622afceec1f7a8 (patch) | |
tree | 1e6ed31f82bdf00465696dc4dd1d12d6522bef23 /installer/slxos-setup | |
parent | * added copies of exclude-filter specifications for the systems (diff) | |
download | core-f3cd70dcf74983c03776c5166e622afceec1f7a8.tar.gz core-f3cd70dcf74983c03776c5166e622afceec1f7a8.tar.xz core-f3cd70dcf74983c03776c5166e622afceec1f7a8.zip |
* added support for cloning existing systems, seems to work, but only for the systems that
are generally supported by slxos-setup (suse-10.1, suse-10.2, fedora-6).
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@745 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer/slxos-setup')
-rwxr-xr-x | installer/slxos-setup | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/installer/slxos-setup b/installer/slxos-setup index 6e829894..1d67d5ae 100755 --- a/installer/slxos-setup +++ b/installer/slxos-setup @@ -37,17 +37,18 @@ my ( $helpReq, $manReq, $listReq, + $selection, + $source, $verbose, $versionReq, ); -my $selection = 'default'; - GetOptions( 'help|?' => \$helpReq, 'list' => \$listReq, 'man' => \$manReq, 'selection=s' => \$selection, + 'source=s' => \$source, 'verbose' => \$verbose, 'version' => \$versionReq, ) or pod2usage(2); @@ -72,11 +73,30 @@ if (scalar(@ARGV) != 2) { } my $action = $ARGV[0]; my $distroName = $ARGV[1]; -if ($action !~ m[^import-into-db|install|update$]i) { - print STDERR _tr("You need to specify exactly one action:\n\tinstall, update or import-into-db\n"); +if ($action !~ m[^clone|import-into-db|install|update$]i) { + print STDERR _tr("You need to specify exactly one action:\n\tinstall, update, clone or import-into-db\n"); pod2usage(2); } +if ($action =~ m[clone]i) { + if (!length($source)) { + die _tr("You need to specifiy a source you'd like to clone!\n"); + } + if ($source !~ m[^.+::?.+$]) { + die _tr("Unkown source format given, expected '<hostname>:<path>' or '<hostname>::<module>'!\n"); + } + if (!defined $selection) { + $selection = "cloned-from-$source"; + $selection =~ tr[:/][_]; + # mask : and / + $selection =~ s[_+$][]; + # remove any trailing underscores, as they're ugly + } +} else { + $selection = 'default' unless defined $selection; +} + + # we chdir into the script's folder such that all relative paths have # a known starting point: chdir($FindBin::RealBin) @@ -97,6 +117,9 @@ if ($action =~ m[import]i) { } elsif ($action =~ m[install]i) { $engine->initialize($distroName, $selection, 1); $engine->installVendorOS(); +} elsif ($action =~ m[clone]i) { + $engine->initialize($distroName, $selection, 0, 1); + $engine->cloneVendorOS($source); } __END__ @@ -114,9 +137,11 @@ slxos-setup [options] <action> <distro-name> --help brief help message --man show full documentation --selection=<string> specific selection for vendor-OS + --source=<string> (rsync-)source to clone vendor-OS from --version show version Actions: + clone clones an existing system via rsync import-into-db imports a vendor-OS into the openslx-db install installs a vendor-OS into a folder update updates an installed vendor-OS @@ -142,6 +167,16 @@ would like to use. If you pass an unknown selection, you will see a list of the selections that are available. +In clone-mode, the selection specifies the name by which the cloned system +will be known (exact name will be '<distro>-<selection>' instead of +'<distro>-cloned-from-<rsync-source>'). + +=item B<--source=<string>> + +When cloning a vendor-OS, slxos-setup needs to know where to fetch +the existing OS-files from. You can specify the rsync-uri with this +option. + =item B<--version> Prints the version and exits. |